diff --git a/.eslintrc b/.eslintrc index 6ae06ef7dde353..6e483a13b7d6c5 100644 --- a/.eslintrc +++ b/.eslintrc @@ -80,7 +80,7 @@ rules: max-len: [2, 80, 2] new-parens: 2 no-mixed-spaces-and-tabs: 2 - no-multiple-empty-lines: [2, {max: 2}] + no-multiple-empty-lines: [2, {max: 2, maxEOF: 0, maxBOF: 0}] no-tabs: 2 no-trailing-spaces: 2 quotes: [2, single, avoid-escape] @@ -103,7 +103,7 @@ rules: no-dupe-class-members: 2 no-new-symbol: 2 no-this-before-super: 2 - prefer-const: 2 + prefer-const: [2, {ignoreReadBeforeAssign: true}] rest-spread-spacing: 2 template-curly-spacing: 2 diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 7b004801207054..6bf44097890794 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -9,7 +9,7 @@ Contributors guide: https://github.com/nodejs/node/blob/master/CONTRIBUTING.md ##### Checklist -- [ ] `make -j4 test` (UNIX), or `vcbuild test nosign` (Windows) passes +- [ ] `make -j8 test` (UNIX), or `vcbuild test nosign` (Windows) passes - [ ] tests and/or benchmarks are included - [ ] documentation is changed or added - [ ] commit message follows commit guidelines diff --git a/.remarkrc b/.remarkrc index d00f2c2488286d..b8cee4c2bb8651 100644 --- a/.remarkrc +++ b/.remarkrc @@ -1,34 +1,62 @@ { "plugins": { - "remark-lint": { - "code-block-style": false, + "remark-lint/": { + "blockquote-indentation": 2, + "checkbox-character-style": { "checked": "x", "unchecked": " " }, + "checkbox-content-indent": true, + "code-block-style": "fenced", "definition-case": false, + "definition-spacing": true, "emphasis-marker": false, - "first-heading-level": false, + "fenced-code-flag": true, + "fenced-code-marker": "`", + "file-extension": "md", + "final-definition": true, + "final-newline": true, + "first-heading-level": 1, + "hard-break-spaces": true, "heading-increment": false, - "list-item-content-indent": false, + "heading-style": "atx", + "link-title-style": false, "list-item-bullet-indent": false, + "list-item-content-indent": false, "list-item-indent": false, "list-item-spacing": false, "maximum-heading-length": false, "maximum-line-length": false, + "no-auto-link-without-protocol": true, + "no-blockquote-without-caret": true, "no-consecutive-blank-lines": false, + "no-duplicate-definitions": true, "no-duplicate-headings": false, "no-emphasis-as-heading": false, - "no-file-name-articles": false, + "no-file-name-articles": true, + "no-file-name-consecutive-dashes": true, "no-file-name-irregular-characters": false, + "no-file-name-mixed-case": false, + "no-file-name-outer-dashes": true, + "no-heading-content-indent": true, + "no-heading-indent": true, "no-heading-punctuation": false, "no-html": false, - "no-inline-padding": false, - "no-shell-dollars": false, - "no-shortcut-reference-link": false, + "no-inline-padding": true, "no-literal-urls": false, "no-missing-blank-lines": false, - "no-multiple-toplevel-headings": false, + "no-multiple-toplevel-headings": true, + "no-shell-dollars": true, + "no-shortcut-reference-image": true, + "no-shortcut-reference-link": false, + "no-table-indentation": true, + "no-tabs": true, "no-undefined-references": false, + "no-unused-definitions": true, "ordered-list-marker-style": false, "ordered-list-marker-value": false, + "rule-style": true, + "strong-marker": "*", + "table-cell-padding": "padded", "table-pipe-alignment": false, + "table-pipes": true, "unordered-list-marker-style": false } } diff --git a/BUILDING.md b/BUILDING.md index a9d806727e59bb..7749574a993ee1 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,4 +1,4 @@ -## Building Node.js +# Building Node.js Depending on what platform or features you require, the build process may differ slightly. After you've successfully built a binary, running the @@ -34,14 +34,7 @@ $ ./configure $ make ``` -If your Python binary is in a non-standard location or has a -non-standard name, run the following instead: - -```console -$ export PYTHON=/path/to/python -$ $PYTHON ./configure -$ make -``` +Note that the above requires that `python` resolve to Python 2.6 or 2.7 and not a newer version. To run the tests: @@ -105,13 +98,13 @@ Prerequisites: and tools which can be included in the global `PATH`. ```console -> vcbuild nosign +> .\vcbuild nosign ``` To run the tests: ```console -> vcbuild test +> .\vcbuild test ``` To test if Node.js was built correctly: @@ -169,7 +162,7 @@ $ ./configure --with-intl=full-icu --download=all ##### Windows: ```console -> vcbuild full-icu download-all +> .\vcbuild full-icu download-all ``` #### Building without Intl support @@ -186,7 +179,7 @@ $ ./configure --without-intl ##### Windows: ```console -> vcbuild without-intl +> .\vcbuild without-intl ``` #### Use existing installed ICU (Unix / OS X only): @@ -229,7 +222,7 @@ First unpack latest ICU to `deps/icu` as `deps/icu` (You'll have: `deps/icu/source/...`) ```console -> vcbuild full-icu +> .\vcbuild full-icu ``` ## Building Node.js with FIPS-compliant OpenSSL diff --git a/CHANGELOG.md b/CHANGELOG.md index 7dd58301bd95a0..2915007f2a6607 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,8 @@ release. -6.6.0
+6.7.0
+6.6.0
6.5.0
6.4.0
6.3.1
diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c250585b816f48..4249ae1ca3ba47 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -1,6 +1,6 @@ -## Code of Conduct +# Code of Conduct -### Conduct +## Conduct * We are committed to providing a friendly, safe and welcoming environment for all, regardless of level of experience, gender @@ -38,17 +38,17 @@ documentation. There is no need to address persons when explaining code (e.g. "When the developer"). -### Contact +## Contact Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by: * Emailing [report@nodejs.org](mailto:report@nodejs.org) (this will email all TSC members) * Contacting [individual TSC members](https://nodejs.org/en/foundation/tsc/#current-members-of-the-technical-steering-committee). -### Moderation +## Moderation See the TSC's [moderation policy](https://github.com/nodejs/TSC/blob/master/Moderation-Policy.md) for details about moderation. -### Attribution +## Attribution This Code of Conduct is adapted from [Rust's wonderful CoC](http://www.rust-lang.org/conduct.html) as well as the diff --git a/COLLABORATOR_GUIDE.md b/COLLABORATOR_GUIDE.md index 2bab2e203145f0..5d0bfbfbb4339c 100644 --- a/COLLABORATOR_GUIDE.md +++ b/COLLABORATOR_GUIDE.md @@ -101,6 +101,8 @@ information regarding the change process: - A `Reviewed-By: Name ` line for yourself and any other Collaborators who have reviewed the change. + - Useful for @mentions / contact list if something goes wrong in the PR. + - Protects against the assumption that GitHub will be around forever. - A `PR-URL:` line that references the *full* GitHub URL of the original pull request being merged so it's easy to trace a commit back to the conversation that led up to that change. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4c93bb6fc415f2..120fdeaf3b0c6e 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -93,15 +93,19 @@ Writing good commit logs is important. A commit log should describe what changed and why. Follow these guidelines when writing one: 1. The first line should be 50 characters or less and contain a short - description of the change prefixed with the name of the changed - subsystem (e.g. "net: add localAddress and localPort to Socket"). + description of the change. All words in the description should be in + lowercase with the exception of proper nouns, acronyms, and the ones that + refer to code, like function/variable names. The description should + be prefixed with the name of the changed subsystem and start with an + imperative verb, for example, "net: add localAddress and localPort + to Socket". 2. Keep the second line blank. 3. Wrap all other lines at 72 columns. A good commit log can look something like this: ```txt -subsystem: explaining the commit in one line +subsystem: explain the commit in one line Body of commit message is a few lines of text, explaining things in more detail, possibly giving some background about the issue diff --git a/GOVERNANCE.md b/GOVERNANCE.md index d3ba8355e0fca8..a61d9848b10ae9 100644 --- a/GOVERNANCE.md +++ b/GOVERNANCE.md @@ -23,14 +23,11 @@ The [nodejs/node](https://github.com/nodejs/node) GitHub repository is maintained by the CTC and additional Collaborators who are added by the CTC on an ongoing basis. -Individuals making significant and valuable contributions are made -Collaborators and given commit-access to the project. These -individuals are identified by the CTC and their addition as -Collaborators is discussed during the weekly CTC meeting. +Individuals identified by the CTC as making significant and valuable +contributions are made Collaborators and given commit access to the project. _Note:_ If you make a significant contribution and are not considered -for commit-access, log an issue or contact a CTC member directly and it -will be brought up in the next CTC meeting. +for commit access, log an issue or contact a CTC member directly. Modifications of the contents of the nodejs/node repository are made on a collaborative basis. Anybody with a GitHub account may propose a @@ -44,11 +41,9 @@ participate and there is disagreement around a particular modification. See [Consensus Seeking Process](#consensus-seeking-process) below for further detail on the consensus model used for governance. -Collaborators may opt to elevate significant or controversial -modifications, or modifications that have not found consensus to the -CTC for discussion by assigning the ***ctc-agenda*** tag to a pull -request or issue. The CTC should serve as the final arbiter where -required. +Collaborators may opt to elevate significant or controversial modifications to +the CTC by assigning the ***ctc-agenda*** tag to a pull request or issue. The +CTC should serve as the final arbiter where required. For the current list of Collaborators, see the project [README.md](./README.md#current-project-team-members). @@ -127,7 +122,7 @@ group of Collaborators. Any community member or contributor can ask that something be added to the next meeting's agenda by logging a GitHub issue. Any Collaborator, -CTC member or the moderator can add the item to the agenda by adding +CTC member, or the moderator can add the item to the agenda by adding the ***ctc-agenda*** tag to the issue. Prior to each CTC meeting, the moderator will share the agenda with @@ -141,6 +136,20 @@ participate in a non-voting capacity. The moderator is responsible for summarizing the discussion of each agenda item and sending it as a pull request after the meeting. +Due to the challenges of scheduling a global meeting with participants in +several timezones, the CTC will seek to resolve as many agenda items as possible +outside of meetings using +[the CTC issue tracker](https://github.com/nodejs/CTC/issues). The process in +the issue tracker is: + +* A CTC member opens an issue explaining the proposal/issue and @-mentions + @nodejs/ctc. +* After 72 hours, if there are two or more `LGTM`s from other CTC members and no + explicit opposition from other CTC members, then the proposal is approved. +* If there are any CTC members objecting, then a conversation ensues until + either the proposal is dropped or the objecting members are persuaded. If + there is an extended impasse, a motion for a vote may be made. + ## Consensus Seeking Process The CTC follows a diff --git a/Makefile b/Makefile index 5705789b80e59e..33bcce6afddc22 100644 --- a/Makefile +++ b/Makefile @@ -71,15 +71,14 @@ $(NODE_G_EXE): config.gypi out/Makefile $(MAKE) -C out BUILDTYPE=Debug V=$(V) ln -fs out/Debug/$(NODE_EXE) $@ -out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp deps/zlib/zlib.gyp deps/v8/build/toolchain.gypi deps/v8/build/features.gypi deps/v8/tools/gyp/v8.gyp node.gyp config.gypi +out/Makefile: common.gypi deps/uv/uv.gyp deps/http_parser/http_parser.gyp \ + deps/zlib/zlib.gyp deps/v8/gypfiles/toolchain.gypi \ + deps/v8/gypfiles/features.gypi deps/v8/src/v8.gyp node.gyp \ + config.gypi $(PYTHON) tools/gyp_node.py -f make config.gypi: configure - if [ -f $@ ]; then - $(error Stale $@, please re-run ./configure) - else - $(error No $@, please run ./configure first) - fi + $(error Missing or stale $@, please run ./$<) install: all $(PYTHON) tools/install.py $@ '$(DESTDIR)' '$(PREFIX)' @@ -105,7 +104,6 @@ distclean: -rm -rf deps/icu4c*.tgz deps/icu4c*.zip deps/icu-tmp -rm -f $(BINARYTAR).* $(TARBALL).* -rm -rf deps/v8/testing/gmock - -rm -rf deps/v8/testing/gtest check: test @@ -162,7 +160,7 @@ test/addons/.buildstamp: config.gypi \ deps/npm/node_modules/node-gyp/package.json \ $(ADDONS_BINDING_GYPS) $(ADDONS_BINDING_SOURCES) \ deps/uv/include/*.h deps/v8/include/*.h \ - src/node.h src/node_buffer.h src/node_object_wrap.h \ + src/node.h src/node_buffer.h src/node_object_wrap.h src/node_version.h \ test/addons/.docbuildstamp # Cannot use $(wildcard test/addons/*/) here, it's evaluated before # embedded addons have been generated from the documentation. @@ -209,6 +207,7 @@ test-ci-js: $(TEST_CI_ARGS) $(CI_JS_SUITES) test-ci: | build-addons + out/Release/cctest --gtest_output=tap:cctest.tap $(PYTHON) tools/test.py $(PARALLEL_ARGS) -p tap --logfile test.tap \ --mode=release --flaky-tests=$(FLAKY_TESTS) \ $(TEST_CI_ARGS) $(CI_NATIVE_SUITES) $(CI_JS_SUITES) diff --git a/README.md b/README.md index 42584e52ebcaac..d15916e2ff09c5 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ source libraries in the world. The Node.js project is supported by the [Node.js Foundation](https://nodejs.org/en/foundation/). Contributions, -policies and releases are managed under an +policies, and releases are managed under an [open governance model](./GOVERNANCE.md). We are also bound by a [Code of Conduct](./CODE_OF_CONDUCT.md). @@ -44,7 +44,7 @@ The Node.js project maintains multiple types of releases: versioned by [SemVer](http://semver.org/) and signed by a member of the [Release Team](#release-team). Code for Current releases is organized in this repository by major version - number, For example: [v4.x](https://github.com/nodejs/node/tree/v4.x). + number. For example: [v4.x](https://github.com/nodejs/node/tree/v4.x). The major version number of Current releases will increment every 6 months allowing for breaking changes to be introduced. This happens in April and October every year. Current release lines beginning in October each year have @@ -240,7 +240,7 @@ more information about the governance of the Node.js project, see * [iWuzHere](https://github.com/iWuzHere) - **Imran Iqbal** <imran@imraniqbal.org> * [JacksonTian](https://github.com/JacksonTian) - -**Jackson Tian** <shvyo1987@gmail.com> +**Jackson Tian** <shyvo1987@gmail.com> * [jbergstroem](https://github.com/jbergstroem) - **Johan Bergström** <bugs@bergstroem.nu> * [jhamhader](https://github.com/jhamhader) - diff --git a/ROADMAP.md b/ROADMAP.md index c85576c670e788..da8e47941916cc 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -38,9 +38,9 @@ In order for Node.js to stay competitive we need to work on the next generation While this constitutes a great leap forward for the platform we will be making this leap without breaking backwards compatibility with the existing ecosystem of modules. -# Immediate Priorities +## Immediate Priorities -## Debugging and Tracing +### Debugging and Tracing Debugging is one of the first things from everyone's mouth, both developer and enterprise, when describing trouble they've had with Node.js. @@ -55,7 +55,7 @@ The [Tracing WG](https://github.com/nodejs/tracing-wg) is driving this effort: * [Unify the Tracing endpoint](https://github.com/nodejs/node/issues/729). * New Chrome Debugger - Google is working on a version of Chrome's debugger that is without Chrome and can be used with Node.js. -## Ecosystem Automation +### Ecosystem Automation In order to maintain a good release cadence without harming compatibility we must do a better job of understanding exactly what impact a particular change or release will have on the ecosystem. This requires new automation. @@ -65,19 +65,19 @@ The initial goals for this automation are relatively simple but will create a ba * Produce a list of modules that use a particular core API. * Produce detailed code coverage data for the tests in core. -## Improve Installation and Upgrades +### Improve Installation and Upgrades * Host and maintain registry endpoints (Homebrew, apt, etc). * Document installation and upgrade procedures with an emphasis on using nvm or nave for development and our registry endpoints for traditional package managers and production. -## Streams +### Streams * Fix all existing compatibility issues. * Simplify stream creation to avoid user error. * Explore and identify compatibility issues with [WHATWG Streams](https://github.com/whatwg/streams). * Improve stream performance. -## Internationalization / Localization +### Internationalization / Localization * Build documentation tooling with localization support built in. * Reduce size of ICU and ship with it by default. diff --git a/benchmark/README.md b/benchmark/README.md index 770df018378e2e..1012ac898fee65 100644 --- a/benchmark/README.md +++ b/benchmark/README.md @@ -34,6 +34,10 @@ benchmarker to be used by providing it as an argument, e. g.: `node benchmark/http/simple.js benchmarker=autocannon` +Basic Unix tools are required for some benchmarks. +[Git for Windows][git-for-windows] includes Git Bash and the necessary tools, +which need to be included in the global Windows `PATH`. + To analyze the results `R` should be installed. Check you package manager or download it from https://www.r-project.org/. @@ -348,3 +352,4 @@ Supported options keys are: [autocannon]: https://github.com/mcollina/autocannon [wrk]: https://github.com/wg/wrk [t-test]: https://en.wikipedia.org/wiki/Student%27s_t-test#Equal_or_unequal_sample_sizes.2C_unequal_variances +[git-for-windows]: http://git-scm.com/download/win \ No newline at end of file diff --git a/benchmark/buffers/buffer-from.js b/benchmark/buffers/buffer-from.js new file mode 100644 index 00000000000000..c35a0f23e06958 --- /dev/null +++ b/benchmark/buffers/buffer-from.js @@ -0,0 +1,86 @@ +'use strict'; + +const common = require('../common.js'); +const assert = require('assert'); +const bench = common.createBenchmark(main, { + source: [ + 'array', + 'arraybuffer', + 'arraybuffer-middle', + 'buffer', + 'uint8array', + 'string', + 'string-base64' + ], + len: [10, 2048], + n: [1024] +}); + +function main(conf) { + const len = +conf.len; + const n = +conf.n; + + const array = new Array(len).fill(42); + const arrayBuf = new ArrayBuffer(len); + const str = 'a'.repeat(len); + const buffer = Buffer.allocUnsafe(len); + const uint8array = new Uint8Array(len); + + var i; + + switch (conf.source) { + case 'array': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(array); + } + bench.end(n); + break; + case 'arraybuffer': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(arrayBuf); + } + bench.end(n); + break; + case 'arraybuffer-middle': + const offset = ~~(len / 4); + const length = ~~(len / 2); + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(arrayBuf, offset, length); + } + bench.end(n); + break; + case 'buffer': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(buffer); + } + bench.end(n); + break; + case 'uint8array': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(uint8array); + } + bench.end(n); + break; + case 'string': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(str); + } + bench.end(n); + break; + case 'string-base64': + bench.start(); + for (i = 0; i < n * 1024; i++) { + Buffer.from(str, 'base64'); + } + bench.end(n); + break; + default: + assert.fail(null, null, 'Should not get here'); + } +} diff --git a/benchmark/child_process/child-process-exec-stdout.js b/benchmark/child_process/child-process-exec-stdout.js index 6194f66b55d987..7b93aacff8532d 100644 --- a/benchmark/child_process/child-process-exec-stdout.js +++ b/benchmark/child_process/child-process-exec-stdout.js @@ -20,8 +20,7 @@ function main(conf) { const msg = `"${'.'.repeat(len)}"`; msg.match(/./); const options = {'stdio': ['ignore', 'pipe', 'ignore']}; - // NOTE: Command below assumes bash shell. - const child = exec(`while\n echo ${msg}\ndo :; done\n`, options); + const child = exec(`yes ${msg}`, options); var bytes = 0; child.stdout.on('data', function(msg) { diff --git a/benchmark/common.js b/benchmark/common.js index adc04a0b8082f9..495d6fdf365871 100644 --- a/benchmark/common.js +++ b/benchmark/common.js @@ -137,7 +137,8 @@ Benchmark.prototype._run = function() { } const child = child_process.fork(require.main.filename, childArgs, { - env: childEnv + env: childEnv, + execArgv: ['--expose_internals'].concat(process.execArgv) }); child.on('message', sendResult); child.on('close', function(code) { diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js new file mode 100644 index 00000000000000..a3277aa6bfb99f --- /dev/null +++ b/benchmark/es/destructuring-object-bench.js @@ -0,0 +1,49 @@ +'use strict'; + +const common = require('../common.js'); + +const bench = common.createBenchmark(main, { + method: ['normal', 'destructureObject'], + millions: [100] +}); + +function runNormal(n) { + var i = 0; + var o = { x: 0, y: 1 }; + bench.start(); + for (; i < n; i++) { + /* eslint-disable no-unused-vars */ + var x = o.x; + var y = o.y; + var r = o.r || 2; + /* eslint-enable no-unused-vars */ + } + bench.end(n / 1e6); +} + +function runDestructured(n) { + var i = 0; + var o = { x: 0, y: 1 }; + bench.start(); + for (; i < n; i++) { + /* eslint-disable no-unused-vars */ + var { x, y, r = 2 } = o; + /* eslint-enable no-unused-vars */ + } + bench.end(n / 1e6); +} + +function main(conf) { + const n = +conf.millions * 1e6; + + switch (conf.method) { + case 'normal': + runNormal(n); + break; + case 'destructureObject': + runDestructured(n); + break; + default: + throw new Error('Unexpected method'); + } +} diff --git a/benchmark/misc/freelist.js b/benchmark/misc/freelist.js index 7956dc3d6b18c0..a2732c9bc815e5 100644 --- a/benchmark/misc/freelist.js +++ b/benchmark/misc/freelist.js @@ -1,13 +1,16 @@ 'use strict'; var common = require('../common.js'); -var FreeList = require('internal/freelist').FreeList; var bench = common.createBenchmark(main, { n: [100000] }); function main(conf) { + // Using internal/freelist requires node to be run with --expose_internals + // switch. common.js will do that when calling main(), so we require + // this module here + const FreeList = require('internal/freelist').FreeList; var n = conf.n; var poolSize = 1000; var list = new FreeList('test', poolSize, Object); diff --git a/benchmark/misc/v8-bench.js b/benchmark/misc/v8-bench.js index 9c0448a510d471..85c64b51fda1ef 100644 --- a/benchmark/misc/v8-bench.js +++ b/benchmark/misc/v8-bench.js @@ -23,6 +23,7 @@ load('regexp.js'); load('splay.js'); load('navier-stokes.js'); +const benchmark_name = path.join('misc', 'v8-bench.js'); const times = {}; global.BenchmarkSuite.RunSuites({ NotifyStart: function(name) { @@ -31,8 +32,10 @@ global.BenchmarkSuite.RunSuites({ NotifyResult: function(name, result) { const elapsed = process.hrtime(times[name]); common.sendResult({ - name: name, - conf: {}, + name: benchmark_name, + conf: { + benchmark: name + }, rate: result, time: elapsed[0] + elapsed[1] / 1e9 }); @@ -42,8 +45,10 @@ global.BenchmarkSuite.RunSuites({ }, NotifyScore: function(score) { common.sendResult({ - name: 'Score (version ' + global.BenchmarkSuite.version + ')', - conf: {}, + name: benchmark_name, + conf: { + benchmark: 'Score (version ' + global.BenchmarkSuite.version + ')' + }, rate: score, time: 0 }); diff --git a/benchmark/url/new-url-parse.js b/benchmark/url/new-url-parse.js new file mode 100644 index 00000000000000..ef60e81847682b --- /dev/null +++ b/benchmark/url/new-url-parse.js @@ -0,0 +1,57 @@ +'use strict'; +const common = require('../common.js'); +const url = require('url'); +const v8 = require('v8'); + +const bench = common.createBenchmark(main, { + type: 'one two three four five'.split(' '), + method: ['old', 'new'], + n: [25e4] +}); + +function useOld(n, input) { + // Force-optimize url.parse() so that the benchmark doesn't get + // disrupted by the optimizer kicking in halfway through. + url.parse(input); + v8.setFlagsFromString('--allow_natives_syntax'); + eval('%OptimizeFunctionOnNextCall(url.parse)'); + + bench.start(); + for (var i = 0; i < n; i += 1) + url.parse(input); + bench.end(n); +} + +function useNew(n, input) { + bench.start(); + for (var i = 0; i < n; i += 1) + new url.URL(input); + bench.end(n); +} + +function main(conf) { + const type = conf.type; + const n = conf.n | 0; + const method = conf.method; + + var inputs = { + one: 'http://nodejs.org/docs/latest/api/url.html#url_url_format_urlobj', + two: 'http://blog.nodejs.org/', + three: 'https://encrypted.google.com/search?q=url&q=site:npmjs.org&hl=en', + four: 'javascript:alert("node is awesome");', + //five: 'some.ran/dom/url.thing?oh=yes#whoo', + five: 'https://user:pass@example.com/', + }; + var input = inputs[type] || ''; + + switch (method) { + case 'old': + useOld(n, input); + break; + case 'new': + useNew(n, input); + break; + default: + throw new Error('Unknown method'); + } +} diff --git a/common.gypi b/common.gypi index 01ab2def6e0f29..d1411ed1c6f19c 100644 --- a/common.gypi +++ b/common.gypi @@ -31,6 +31,9 @@ # Don't bake anything extra into the snapshot. 'v8_use_external_startup_data%': 0, + # Don't use ICU data file (icudtl.dat) from V8, we use our own. + 'icu_use_data_file_flag%': 0, + 'conditions': [ ['OS == "win"', { 'os_posix': 0, @@ -44,7 +47,7 @@ 'V8_BASE': '<(PRODUCT_DIR)/libv8_base.a', }, { 'OBJ_DIR': '<(PRODUCT_DIR)/obj.target', - 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/tools/gyp/libv8_base.a', + 'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a', }], ['openssl_fips != ""', { 'OPENSSL_PRODUCT': 'libcrypto.a', @@ -382,6 +385,7 @@ 'xcode_settings': { 'GCC_VERSION': 'com.apple.compilers.llvm.clang.1_0', 'CLANG_CXX_LANGUAGE_STANDARD': 'gnu++0x', # -std=gnu++0x + 'CLANG_CXX_LIBRARY': 'libc++', }, }], ], diff --git a/configure b/configure index 42dac5ff64ce94..9b4fa94521a7f4 100755 --- a/configure +++ b/configure @@ -760,6 +760,8 @@ def configure_node(o): want_snapshots = not options.without_snapshot o['variables']['want_separate_host_toolset'] = int( cross_compiling and want_snapshots) + o['variables']['want_separate_host_toolset_mkpeephole'] = int( + cross_compiling) if target_arch == 'arm': configure_arm(o) diff --git a/deps/cares/src/ares_create_query.c b/deps/cares/src/ares_create_query.c index a34dda7de6de6d..7f4c52d41dfbf4 100644 --- a/deps/cares/src/ares_create_query.c +++ b/deps/cares/src/ares_create_query.c @@ -85,57 +85,31 @@ */ int ares_create_query(const char *name, int dnsclass, int type, - unsigned short id, int rd, unsigned char **buf, - int *buflen, int max_udp_size) + unsigned short id, int rd, unsigned char **bufp, + int *buflenp, int max_udp_size) { - int len; + size_t len; unsigned char *q; const char *p; + size_t buflen; + unsigned char *buf; /* Set our results early, in case we bail out early with an error. */ - *buflen = 0; - *buf = NULL; + *buflenp = 0; + *bufp = NULL; - /* Compute the length of the encoded name so we can check buflen. - * Start counting at 1 for the zero-length label at the end. */ - len = 1; - for (p = name; *p; p++) - { - if (*p == '\\' && *(p + 1) != 0) - p++; - len++; - } - /* If there are n periods in the name, there are n + 1 labels, and - * thus n + 1 length fields, unless the name is empty or ends with a - * period. So add 1 unless name is empty or ends with a period. + /* Allocate a memory area for the maximum size this packet might need. +2 + * is for the length byte and zero termination if no dots or ecscaping is + * used. */ - if (*name && *(p - 1) != '.') - len++; - - /* Immediately reject names that are longer than the maximum of 255 - * bytes that's specified in RFC 1035 ("To simplify implementations, - * the total length of a domain name (i.e., label octets and label - * length octets) is restricted to 255 octets or less."). We aren't - * doing this just to be a stickler about RFCs. For names that are - * too long, 'dnscache' closes its TCP connection to us immediately - * (when using TCP) and ignores the request when using UDP, and - * BIND's named returns ServFail (TCP or UDP). Sending a request - * that we know will cause 'dnscache' to close the TCP connection is - * painful, since that makes any other outstanding requests on that - * connection fail. And sending a UDP request that we know - * 'dnscache' will ignore is bad because resources will be tied up - * until we time-out the request. - */ - if (len > MAXCDNAME) - return ARES_EBADNAME; - - *buflen = len + HFIXEDSZ + QFIXEDSZ + (max_udp_size ? EDNSFIXEDSZ : 0); - *buf = ares_malloc(*buflen); - if (!*buf) - return ARES_ENOMEM; + len = strlen(name) + 2 + HFIXEDSZ + QFIXEDSZ + + (max_udp_size ? EDNSFIXEDSZ : 0); + buf = ares_malloc(len); + if (!buf) + return ARES_ENOMEM; /* Set up the header. */ - q = *buf; + q = buf; memset(q, 0, HFIXEDSZ); DNS_HEADER_SET_QID(q, id); DNS_HEADER_SET_OPCODE(q, QUERY); @@ -159,8 +133,10 @@ int ares_create_query(const char *name, int dnsclass, int type, q += HFIXEDSZ; while (*name) { - if (*name == '.') + if (*name == '.') { + free (buf); return ARES_EBADNAME; + } /* Count the number of bytes in this label. */ len = 0; @@ -170,8 +146,10 @@ int ares_create_query(const char *name, int dnsclass, int type, p++; len++; } - if (len > MAXLABEL) + if (len > MAXLABEL) { + free (buf); return ARES_EBADNAME; + } /* Encode the length and copy the data. */ *q++ = (unsigned char)len; @@ -195,14 +173,30 @@ int ares_create_query(const char *name, int dnsclass, int type, DNS_QUESTION_SET_TYPE(q, type); DNS_QUESTION_SET_CLASS(q, dnsclass); + q += QFIXEDSZ; if (max_udp_size) { - q += QFIXEDSZ; memset(q, 0, EDNSFIXEDSZ); q++; DNS_RR_SET_TYPE(q, T_OPT); DNS_RR_SET_CLASS(q, max_udp_size); + q += (EDNSFIXEDSZ-1); + } + buflen = (q - buf); + + /* Reject names that are longer than the maximum of 255 bytes that's + * specified in RFC 1035 ("To simplify implementations, the total length of + * a domain name (i.e., label octets and label length octets) is restricted + * to 255 octets or less."). */ + if (buflen > (MAXCDNAME + HFIXEDSZ + QFIXEDSZ + + (max_udp_size ? EDNSFIXEDSZ : 0))) { + free (buf); + return ARES_EBADNAME; } + /* we know this fits in an int at this point */ + *buflenp = (int) buflen; + *bufp = buf; + return ARES_SUCCESS; } diff --git a/deps/gtest/src/gtest.cc b/deps/gtest/src/gtest.cc index 7fd5f298dc04ed..970c0976cb5acf 100644 --- a/deps/gtest/src/gtest.cc +++ b/deps/gtest/src/gtest.cc @@ -3498,6 +3498,125 @@ std::string XmlUnitTestResultPrinter::RemoveInvalidXmlCharacters( // // +class TapUnitTestResultPrinter : public EmptyTestEventListener { + public: + TapUnitTestResultPrinter(); + explicit TapUnitTestResultPrinter(const char* output_file); + virtual void OnTestIterationEnd(const UnitTest& unit_test, int iteration); + + private: + static void PrintTapUnitTest(::std::ostream* stream, + const UnitTest& unit_test); + static void PrintTapTestCase(int* count, + ::std::ostream* stream, + const TestCase& test_case); + static void OutputTapTestInfo(int* count, + ::std::ostream* stream, + const char* test_case_name, + const TestInfo& test_info); + static void OutputTapComment(::std::ostream* stream, const char* comment); + + const std::string output_file_; + GTEST_DISALLOW_COPY_AND_ASSIGN_(TapUnitTestResultPrinter); +}; + +TapUnitTestResultPrinter::TapUnitTestResultPrinter() {} + +TapUnitTestResultPrinter::TapUnitTestResultPrinter(const char* output_file) + : output_file_(output_file) { + if (output_file_.c_str() == NULL || output_file_.empty()) { + fprintf(stderr, "TAP output file may not be null\n"); + fflush(stderr); + exit(EXIT_FAILURE); + } +} + +void TapUnitTestResultPrinter::OnTestIterationEnd(const UnitTest& unit_test, + int /*iteration*/) { + FILE* tapout = stdout; + + if (!output_file_.empty()) { + FilePath output_file(output_file_); + FilePath output_dir(output_file.RemoveFileName()); + + tapout = NULL; + if (output_dir.CreateDirectoriesRecursively()) + tapout = posix::FOpen(output_file_.c_str(), "w"); + + if (tapout == NULL) { + fprintf(stderr, "Unable to open file \"%s\"\n", output_file_.c_str()); + fflush(stderr); + exit(EXIT_FAILURE); + } + } + + std::stringstream stream; + PrintTapUnitTest(&stream, unit_test); + fprintf(tapout, "%s", StringStreamToString(&stream).c_str()); + fflush(tapout); + + if (tapout != stdout) + fclose(tapout); +} + +void TapUnitTestResultPrinter::PrintTapUnitTest(std::ostream* stream, + const UnitTest& unit_test) { + *stream << "TAP version 13\n"; + *stream << "1.." << unit_test.reportable_test_count() << "\n"; + + int count = 1; + for (int i = 0; i < unit_test.total_test_case_count(); ++i) { + const TestCase& test_case = *unit_test.GetTestCase(i); + if (test_case.reportable_test_count() > 0) + PrintTapTestCase(&count, stream, test_case); + } + + *stream << "# failures: " << unit_test.failed_test_count() << "\n"; +} + +void TapUnitTestResultPrinter::PrintTapTestCase(int* count, + std::ostream* stream, + const TestCase& test_case) { + for (int i = 0; i < test_case.total_test_count(); ++i) { + const TestInfo& test_info = *test_case.GetTestInfo(i); + if (test_info.is_reportable()) + OutputTapTestInfo(count, stream, test_case.name(), test_info); + } +} + +void TapUnitTestResultPrinter::OutputTapTestInfo(int* count, + ::std::ostream* stream, + const char* test_case_name, + const TestInfo& test_info) { + const TestResult& result = *test_info.result(); + const char* status = result.Passed() ? "ok" : "not ok"; + + *stream << status << " " << *count << " - " << + test_case_name << "." << test_info.name() << "\n"; + *stream << " ---\n"; + *stream << " duration_ms: " << + FormatTimeInMillisAsSeconds(result.elapsed_time()) << "\n"; + *stream << " ...\n"; + + for (int i = 0; i < result.total_part_count(); ++i) { + const TestPartResult& part = result.GetTestPartResult(i); + OutputTapComment(stream, part.message()); + } + + *count += 1; +} + +void TapUnitTestResultPrinter::OutputTapComment(::std::ostream* stream, + const char* comment) { + const char* start = comment; + while (const char* end = strchr(start, '\n')) { + *stream << "# " << std::string(start, end) << "\n"; + start = end + 1; + } + if (*start) + *stream << "# " << start << "\n"; +} + // Formats the given time in milliseconds as seconds. std::string FormatTimeInMillisAsSeconds(TimeInMillis ms) { ::std::stringstream ss; @@ -4314,7 +4433,7 @@ UnitTestImpl::UnitTestImpl(UnitTest* parent) #endif // Will be overridden by the flag before first use. catch_exceptions_(false) { - listeners()->SetDefaultResultPrinter(new PrettyUnitTestResultPrinter); + listeners()->SetDefaultResultPrinter(new TapUnitTestResultPrinter); } UnitTestImpl::~UnitTestImpl() { @@ -4365,6 +4484,9 @@ void UnitTestImpl::ConfigureXmlOutput() { if (output_format == "xml") { listeners()->SetDefaultXmlGenerator(new XmlUnitTestResultPrinter( UnitTestOptions::GetAbsolutePathToOutputFile().c_str())); + } else if (output_format == "tap") { + listeners()->SetDefaultXmlGenerator(new TapUnitTestResultPrinter( + UnitTestOptions::GetAbsolutePathToOutputFile().c_str())); } else if (output_format != "") { printf("WARNING: unrecognized output format \"%s\" ignored.\n", output_format.c_str()); diff --git a/deps/gtest/src/gtest_main.cc b/deps/gtest/src/gtest_main.cc index f3028225523306..4cf03e59bac5df 100644 --- a/deps/gtest/src/gtest_main.cc +++ b/deps/gtest/src/gtest_main.cc @@ -32,7 +32,6 @@ #include "gtest/gtest.h" GTEST_API_ int main(int argc, char **argv) { - printf("Running main() from gtest_main.cc\n"); testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } diff --git a/deps/npm/.github/issue_template.md b/deps/npm/.github/issue_template.md new file mode 100644 index 00000000000000..a40c57fa3d25e5 --- /dev/null +++ b/deps/npm/.github/issue_template.md @@ -0,0 +1,69 @@ +#### I'm opening this issue because: + + - [ ] npm is crashing. + - [ ] npm is producing an incorrect install. + - [ ] npm is doing something I don't understand. + - [ ] Other (_see below for feature requests_): + +#### What's going wrong? + +#### How can the CLI team reproduce the problem? + + + +### supporting information: + + - `npm -v` prints: + - `node -v` prints: + - `npm config get registry` prints: + - Windows, OS X, or Linux?: + - Network issues: + - Geographic location where npm was run: + - [ ] I use a proxy to connect to the npm registry. + - [ ] I use a proxy to connect to the web. + - [ ] I use a proxy when downloading Git repos. + - [ ] I access the npm registry via a VPN + - [ ] I don't use a proxy, but have limited or unreliable internet access. + - Container: + - [ ] I develop using Vagrant on Windows. + - [ ] I develop using Vagrant on OS X or Linux. + - [ ] I develop / deploy using Docker. + - [ ] I deploy to a PaaS (Triton, Heroku). + + + + diff --git a/deps/npm/.mailmap b/deps/npm/.mailmap index 06eb16cff3ee50..abd5c5d4a24c70 100644 --- a/deps/npm/.mailmap +++ b/deps/npm/.mailmap @@ -15,6 +15,7 @@ Dave Galbraith David Beitey Domenic Denicola Einar Otto Stangvik +Emma Ramirez Erik Wienhold Evan Lucas Evan Lucas @@ -23,6 +24,7 @@ Forbes Lindesay Forrest L Norvell Gabriel Barros Geoff Flarity +Gregers Gram Rygg Ifeanyi Oraelosi Isaac Z. Schlueter Isaac Z. Schlueter isaacs diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml index d4cef3e3d15175..988ee7e30a770f 100644 --- a/deps/npm/.travis.yml +++ b/deps/npm/.travis.yml @@ -1,23 +1,31 @@ +sudo: false +# need to declare the language as well as the matrix below language: node_js -node_js: - # LTS is our most important target - - "4" - # next LTS and master is next most important - - "6" - # still in LTS maintenance until fall 2016 - # (also still in wide use) - - "0.10" - # will be unsupported as soon as 6 becomes LTS and 7 released - - "5" - # technically in LTS / distros, unbeloved - - "0.12" -env: - - DEPLOY_VERSION=testing +# having top-level `env:` adds a phantom build +# https://github.com/travis-ci/travis-ci/issues/4681 +#env: DEPLOY_VERSION=testing +matrix: + include: + # LTS is our most important target + - node_js: "4" + # DEPLOY_VERSION is used to set the couchapp setup mode for test/tap/registry.js + # only gather coverage info for LTS + env: DEPLOY_VERSION=testing COVERALLS_REPO_TOKEN="$COVERALLS_OPTIONAL_TOKEN" + # next LTS and master is next most important + - node_js: "6" + env: DEPLOY_VERSION=testing + # still in LTS maintenance until fall 2016 (also still in wide use) + - node_js: "0.10" + env: DEPLOY_VERSION=testing + # will be unsupported as soon as 6 becomes LTS and 7 released + - node_js: "5" + env: DEPLOY_VERSION=testing + # technically in LTS / distros, unbeloved + - node_js: "0.12" + env: DEPLOY_VERSION=testing before_install: - - "npm config set spin false" - "node . install -g ." + # required by test/tap/registry.js - "mkdir -p /var/run/couchdb" -sudo: false -script: "npm test" notifications: slack: npm-inc:kRqQjto7YbINqHPb1X6nS3g8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 9e9000de638ccb..d3c64f53cc64f6 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -408,3 +408,25 @@ Aaron Tribou Tapani Moilanen Han Seoul-Oh Aleksey Shvayka +Emma Ramirez +Julian Duque +Simon MacDonald +Adam Stankiewicz +Gregers Gram Rygg +Peter Dave Hello +Jordan Klassen +Jason Palmer +Michael Hart +Sasha Koss +David Emmerson +Christophe Hurpeau +Daniel Paz-Soldan +Sakthipriyan Vairamani +Zach Renner +Christopher Hiller +legodude17 +Andrew Meyer +Michael Jasper +Max +Szymon Nowak +Jason Karns diff --git a/deps/npm/CHANGELOG.md b/deps/npm/CHANGELOG.md index 4f94100434f573..eae0e4aed2c391 100644 --- a/deps/npm/CHANGELOG.md +++ b/deps/npm/CHANGELOG.md @@ -1,3 +1,593 @@ +### v3.10.8 (2016-09-08) + +Monthly releases are so big! Just look at all this stuff! + +Our quarter of monthly releases is almost over. The next one, in October, might +very well be our last one as we move to trying something different and learning +lessons from our little experiment. + +You may also want to keep an eye our for `npm@4` next month, since we're +planning on finally releasing it then and including a (small) number of breaking +changes we've been meaning to do for a long time. Don't worry, though: `npm@3` +will still be around for a bit and will keep getting better and better, and is +most likely going to be the version that `node@6` uses once it goes to LTS. + +As some of us have mentioned before, npm is likely to start doing more regular +semver-major bumps, while keeping those bumps significantly smaller than the +huge effort that was `npm@3` -- we're not very likely to do a world-shaking +thing like that for a while, if ever. + +All that said, let's move on to the patches included in v3.10.8! + +#### SHRINKWRAP LEVEL UP + +The most notable part of this release is a series of commits meant to make `npm +shrinkwrap` more consistent. By itself, shrinkwrap seems like a fairly +straightforward thing to implement, but things get complicated when it starts +interacting with `devDependencies`, `optionalDependencies`, and +`bundledDependencies`. These commits address some corner cases related to these. + +* [`a7eca32`](https://github.com/npm/npm/commit/a7eca3246fbbcbb05434cb6677f65d14c945d74f) + [#10073](https://github.com/npm/npm/pull/10073) + Record if a dependency is only used as a devDependency and exclude it from the + shrinkwrap file. + ([@bengl](https://github.com/bengl)) +* [`1eabcd1`](https://github.com/npm/npm/commit/1eabcd16bf2590364ca20831096350073539bf3a) + [#10073](https://github.com/npm/npm/pull/10073) + Record if a dependency is optional to shrinkwrap. + ([@bengl](https://github.com/bengl)) +* [`03efc89`](https://github.com/npm/npm/commit/03efc89522c99ee0fa37d8f4a99bc3b44255ef98) + [#13692](https://github.com/npm/npm/pull/13692/) + We were doing a weird thing where we used a `package.json` field `installable` + to check to see if we'd checked for platform compatibility, and if not did + so. But this was the only place that was ever done so there was no reason to + implement it in such an obfuscated manner. + Instead it now just directly checks and then records that its done so on the + node object with `knownInstallable`. This is useful to know because modules + expanded via shrinkwrap don't go through this– `inflateShrinkwrap` does not + currently have any rollback semantics and so checking this sort of thing there + is unhelpful. + ([@iarna](https://github.com/iarna)) +* [`ff87938`](https://github.com/npm/npm/commit/ff879382fda21dac7216a5f666287b3a7e74a947) + [#11735](https://github.com/npm/npm/issues/11735) + Running `npm install --save-dev` will now update shrinkwrap file, but only + if there already are devDependencies in it. + ([@szimek](https://github.com/szimek)) +* [`c00ca3a`](https://github.com/npm/npm/commit/c00ca3aef836709eeaeade91c5305bc2fbda2e8a) + [#13394](https://github.com/npm/npm/issues/13394) + Check installability of modules from shrinkwrap, since modules that came into + the tree vie shrinkwrap won't already have this information recorded in + advance. + ([@iarna](https://github.com/iarna)) + +#### INSTALLER ERROR REPORTING LEVEL UP + +As part of the shrinkwrap push, there were also a lot of error-reporting +improvements. Some to add more detail to error objects, others to fix bugs and +inconsistencies. + +* [`2cdd713`](https://github.com/npm/npm/commit/2cdd7132abddcc7f826a355c14348ce9a5897ffe) + Consistently set code on `ETARGET` when fetching package metadata if no + compatible version is found. + ([@iarna](https://github.com/iarna)) +* [`cabcd17`](https://github.com/npm/npm/commit/cabcd173f2923cb5b77e7be0e42eea2339a24727) + [#13692](https://github.com/npm/npm/pull/13692/) + Include installer warning details at the `verbose` log level. + ([@iarna](https://github.com/iarna)) +* [`95a4044`](https://github.com/npm/npm/commit/95a4044cbae93d19d0da0f3cd04ea8fa620295d9) + [`dbb14c2`](https://github.com/npm/npm/commit/dbb14c241d982596f1cdaee251658f5716989fd2) + [`9994383`](https://github.com/npm/npm/commit/9994383959798f80749093301ec43a8403566bb6) + [`7417000`](https://github.com/npm/npm/commit/74170003db0c53def9b798cb6fe3fe7fc3e06482) + [`f45f85d`](https://github.com/npm/npm/commit/f45f85dac800372d63dfa8653afccbf5bcae7295) + [`e79cc1b`](https://github.com/npm/npm/commit/e79cc1b11440f0d122c4744d5eff98def9553f4a) + [`146ee39`](https://github.com/npm/npm/commit/146ee394b1f7a33cf409a30b835a85d939acb438) + [#13692](https://github.com/npm/npm/pull/13692/) + Improve various bits of error reporting, adding more error information and + some related refactoring. + ([@iarna](https://github.com/iarna)) + +#### MISCELLANEOUS BUGS LEVEL UP + +* [`116b6c6`](https://github.com/npm/npm/commit/116b6c60a174ea0cc49e4d62717e4e26175b6534) + [#13456](https://github.com/npm/npm/issues/13456) + In lifecycle scripts, any `node_modules/.bin` existing in the hierarchy + should be turned into an entry in the PATH environment variable. + However, prior to this commit, it was splitting based on the string + `node_modules`, rather than restricting it to only path portions like + `/node_modules/` or `\node_modules\`. So, a path containing an entry + like `my_node_modules` would be improperly split. + ([@isaacs](https://github.com/isaacs)) +* [`0a28dd0`](https://github.com/npm/npm/commit/0a28dd0104e5b4a8cc0cb038bd213e6a50827fe8) + [npm/fstream-npm#23](https://github.com/npm/fstream-npm/pull/23) + `fstream-npm@1.2.0`: + Always ignore `*.orig` files, which are generated by git when using `git + mergetool`, by default. + ([@zkat](https://github.com/zkat)) +* [`a3a2fb9`](https://github.com/npm/npm/commit/a3a2fb97adc87c2aa9b2b8957861b30efafc7ad0) + [#13708](https://github.com/npm/npm/pull/13708) + Always ignore `*.orig` files, which are generated by git when using `git + mergetool`, by default. + ([@boneskull](https://github.com/boneskull)) + +#### TOOLING LEVEL UP + +* [`e1d7e6c`](https://github.com/npm/npm/commit/e1d7e6ce551cbc42026cdcadcb37ea515059c972) + Add helper for generating test skeletons. + ([@iarna](https://github.com/iarna)) +* [`4400b35`](https://github.com/npm/npm/commit/4400b356bca9175935edad1469c608c909bc01bf) + Fix fixture creation and cleanup in `maketest`. + ([@iarna](https://github.com/iarna)) + +#### DOCUMENTATION LEVEL UP + +* [`8eb9460`](https://github.com/npm/npm/commit/8eb94601fe895b97cbcf8c6134e6b371c5371a1e) + [#13717](https://github.com/npm/npm/pull/13717) + Document that `npm link` will link the files specified in the `bin` field of + `package.json` to `{prefix}/bin/{name}`. + ([@legodude17](https://github.com/legodude17)) +* [`a66e5e9`](https://github.com/npm/npm/commit/a66e5e9c388878fe03fb29014c3b95d28bedd3c1) + [#13682](https://github.com/npm/npm/pull/13682) + Minor grammar fix in documentation for `npm scripts`. + ([@Ajedi32](https://github.com/Ajedi32)) +* [`74b8043`](https://github.com/npm/npm/commit/74b80437ffdfcf8172f6ed4f39bfb021608dd9dd) + [#13655](https://github.com/npm/npm/pull/13655) + Document line comment syntax for `.npmrc`. + ([@mdjasper](https://github.com/mdjasper)) +* [`b352a84`](https://github.com/npm/npm/commit/b352a84c2c7ad15e9c669af75f65cdaa964f86c0) + [#12438](https://github.com/npm/npm/issues/12438) + Remind folks to use `#!/usr/bin/env node` in their `bin` scripts to make files + executable directly. + ([@mxstbr](https://github.com/mxstbr)) +* [`b82fd83`](https://github.com/npm/npm/commit/b82fd838edbfff5d2833a62f6d8ae8ea2df5a1f2) + [#13493](https://github.com/npm/npm/pull/13493) + Document that the user config file can itself be configured either through the + `$NPM_CONFIG_USERCONFIG` environment variable, or `--userconfig` command line + flag. + ([@jasonkarns](https://github.com/jasonkarns)) +* [`8a02699`](https://github.com/npm/npm/commit/8a026992a03d90e563a97c70e90926862120693b) + [#13911](https://github.com/npm/npm/pull/13911) + Minor documentation reword and cleanup. + ([@othiym23](https://github.com/othiym23)) + +#### DEPENDENCY LEVEL UP + +* [`2818fb0`](https://github.com/npm/npm/commit/2818fb0f6081d68a91f0905945ad102f26c6cf85) + `glob@7.0.6` + ([@isaacs](https://github.com/isaacs)) +* [`d88ec81`](https://github.com/npm/npm/commit/d88ec81ad33eb2268fcd517d35346a561bc59aff) + `graceful-fs@4.1.6` + ([@francescoinfante](https://github.com/francescoinfante)) +* [`4727f86`](https://github.com/npm/npm/commit/4727f8646daca7b3e3c1c95860e02acf583b9dae) + `lodash.clonedeep@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`c347678`](https://github.com/npm/npm/commit/c3476780ef4483425e4ae1d095a5884b46b8db86) + `lodash.union@4.6.0` + ([@jdalton](https://github.com/jdalton)) +* [`530bd4d`](https://github.com/npm/npm/commit/530bd4d2ae6f704f624e4f7bf64f911f37e2b7f8) + `lodash.uniq@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`483d56a`](https://github.com/npm/npm/commit/483d56ae8137eca0c0f7acd5d1c88ca6d5118a6a) + `lodash.without@4.4.0` + ([@jdalton](https://github.com/jdalton)) +* [`6c934df`](https://github.com/npm/npm/commit/6c934df6e74bacd0ed40767b319936837a43b586) + `inherits@2.0.3` + ([@isaacs](https://github.com/isaacs)) +* [`a65ed7c`](https://github.com/npm/npm/commit/a65ed7cbd3c950383a14461a4b2c87b67ef773b9) + `npm-registry-client@7.2.1`: + * [npm/npm-registry-client#142](https://github.com/npm/npm-registry-client/pull/142) Fix `EventEmitter` warning spam from error handlers on socket. ([@addaleax](https://github.com/addaleax)) + * [npm/npm-registry-client#131](https://github.com/npm/npm-registry-client/pull/131) Adds support for streaming request bodies. ([@aredridel](https://github.com/aredridel)) + * Fixes [#13656](https://github.com/npm/npm/issues/13656). + * Dependency updates. + * Documentation improvements. + ([@othiym23](https://github.com/othiym23)) +* [`2b88d62`](https://github.com/npm/npm/commit/2b88d62e6a730716b27052c0911c094d01830a60) + [npm/npmlog#34](https://github.com/npm/npmlog/pull/34) + `npmlog@4.0.0`: + Allows creating log levels that are empty strings or 0 + ([@rwaldron](https://github.com/rwaldron)) +* [`242babb`](https://github.com/npm/npm/commit/242babbd02274ee2d212ae143992c20f47ef0066) + `once@1.4.0` + ([@zkochan](https://github.com/zkochan)) +* [`6d8ba2b`](https://github.com/npm/npm/commit/6d8ba2b4918e2295211130af68ee8a67099139e0) + `readable-stream@2.1.5` + ([@calvinmetcalf](https://github.com/calvinmetcalf)) +* [`855c099`](https://github.com/npm/npm/commit/855c099482a8d93b7f0646bd7bcf8a31f81868e0) + `retry@0.10.0` + ([@tim-kos](https://github.com/tim-kos)) +* [`80540c5`](https://github.com/npm/npm/commit/80540c52b252615ae8a6271b3df870eabfea935e) + `semver@5.3.0`: + * Add `minSatisfying` + * Add `prerelease(v)` + ([@isaacs](https://github.com/isaacs)) +* [`8aaac52`](https://github.com/npm/npm/commit/8aaac52ffae8e689fae265712913b1e2a36b1aa6) + `which@1.2.1` + ([@isaacs](https://github.com/isaacs)) +* [`85108a2`](https://github.com/npm/npm/commit/85108a29108ab0a57997572dc14f87eb706890ba) + `write-file-atomic@1.2.0`: + Preserve chmod and chown from the overwritten file + ([@iarna](https://github.com/iarna)) +* [`291a377`](https://github.com/npm/npm/commit/291a377f32f5073102a8ede61a27e6a9b37154c2) + Update npm documentation to reflect documentation for `semver@5.3.0`. + ([@zkat](https://github.com/zkat)) + +### v3.10.7 (2016-08-11) + +Hi all, today's our first release coming out of the new monthly release +cadence. See below for details. We're all recovered from conferences now +and raring to go! We've got some pretty keen bug fixes and a bunch of +documentation and dependency updates. It's hard to narrow it down to just a +few, but of note are scoped packages in bundled dependencies, the +`preinstall` lifecycle fix, the shrinkwrap and Git dependencies fix and the +fix to a crasher involving cycles in development dependencies. + +#### NEW RELEASE CADENCE + +Releasing npm has been, for the most part, a very prominent part of our +weekly process process. As part of our efforts to find the most effective +ways to allocate our team's resources, we decided last month that we would +try and slow our releases down to a monthly cadence, and see if we found +ourselves with as much extra time and attention as we expected to have. +Process experiments are useful for finding more effective ways to do our +work, and we're at least going to keep doing this for a whole quarter, and +then measure how well it worked out. It's entirely likely that we'll switch +back to a more frequent cadence, specially if we find that the value that +weekly cadence was providing the community is not worth sacrificing for a +bit of extra time. Does this affect you significantly? Let us know! + +#### SCOPED PACKAGES IN BUNDLED DEPENDENCIES + +Prior to this release and +[v2.15.10](https://github.com/npm/npm/releases/v2.15.10), npm had ignored +scoped modules found in `bundleDependencies`. + +* [`29cf56d`](https://github.com/npm/npm/commit/29cf56dbae8e3dd16c24876f998051623842116a) + [#8614](https://github.com/npm/npm/issues/8614) + Include scoped packages in bundled dependencies. + ([@forivall](https://github.com/forivall)) + +#### `preinstall` LIFECYCLE IN CURRENT PROJECT + +* [`b7f13bc`](https://github.com/npm/npm/commit/b7f13bc80b89b025be0c53d81b90ec8f2cebfab7) + [#13259](https://github.com/npm/npm/pull/13259) + Run top level preinstall before installing dependencies + ([@palmerj3](https://github.com/palmerj3)) + +#### BETTER SHRINKWRAP WITH GIT DEPENDENCIES + +* [`0f7e319`](https://github.com/npm/npm/commit/0f7e3197bcec7a328b603efdffd3681bbc40f585) + [#12718](https://github.com/npm/npm/issues/12718.) + Update outdated git dependencies found in shrinkwraps. Previously, if the + module version was the same then no update would be completed even if the + committish had changed. + ([@kossnocorp](https://github.com/kossnocorp)) + + +#### CYCLES IN DEVELOPMENT DEPENDENCIES NO LONGER CRASH + +* [`1691de6`](https://github.com/npm/npm/commit/1691de668d34cd92ab3de08bf3a06085388f2f07) + [#13327](https://github.com/npm/npm/issues/13327) + Fix bug where cycles found in development dependencies could result in + infinite recursion that resulted in crashes. + ([@iarna](https://github.com/iarna)) + +#### IMPROVE "NOT UPDATING LINKED MODULE" WARNINGS + +* [`1619871`](https://github.com/npm/npm/commit/1619871ac0cc8839dc9962c78e736095976c1eb4) + [#12893](https://github.com/npm/npm/pull/12893) + Only warn about symlink update if version number differs + The update-linked action outputs a warning that it needs to update the + linked package, but can't, There is no need for the package to be updated if + it is already at the correct version. This change does a check before + logging the warning. + ([@DaveEmmerson](https://github.com/DaveEmmerson)) + +#### MORE BUG FIXES + +* [`8f8d1b3`](https://github.com/npm/npm/commit/8f8d1b33a78c79aff9de73df362abaa7f05751d2) + [#11398](https://github.com/npm/npm/issues/11398) + Fix bug where `package.json` files that contained a `type` property could + cause crashes. `type` is not a `package.json` property that npm makes use + of and having it should be (and now is) harmless. + ([@zkat](https://github.com/zkat)) +* [`e7fa6c6`](https://github.com/npm/npm/commit/e7fa6c6a2c1de2a214479daa8c6901eebb350381) + [#13353](https://github.com/npm/npm/issues/13353) + Add GIT_EXEC_PATH to Git environment whitelist. + ([@mhart](https://github.com/mhart)) +* [`c23af21`](https://github.com/npm/npm/commit/c23af21d4cedd7fedcb4168672044db76ad054a8) + [#13626](https://github.com/npm/npm/pull/13626) + Use HTTPS issues URL in the error message for type validation errors. + ([@watilde](https://github.com/watilde)) + +#### INCLUDE `npm login` IN COMMAND SUMMARY + +* [`ab0c4b1`](https://github.com/npm/npm/commit/ab0c4b137b05762e75e0913038b606f087b58aa0) + [#13581](https://github.com/npm/npm/issues/13581) + The `login` command has long been an alias for `adduser`. + At the same time, there is an expectation not just of that + particular word being something to look for, but of there being + clear symmetry with `logout`. + So it was a bit confusing when `login` didn't show up in + `npm help` on a technicality. This seems like an acceptable + exception to the rule that says "no aliases in `npm help`". + ([@zkat](https://github.com/zkat)) + +#### DOCUMENTATION + +* [`e2d7e78`](https://github.com/npm/npm/commit/e2d7e7820a7875ed96e0382dc1e91b8df4e83746) + [#13319](https://github.com/npm/npm/pull/13319) + As Node.js 0.8 is no longer supported, remove mention of it from the README. + ([@watilde](https://github.com/watilde)) +* [`c565d89`](https://github.com/npm/npm/commit/c565d893a38efb6006e841450503329c9e58f100) + [#13349](https://github.com/npm/npm/pull/13349) + Updated the scripts documentation to explain the different between `version` and `preversion`. + ([@christophehurpeau](https://github.com/christophehurpeau)) +* [`fa8f87f`](https://github.com/npm/npm/commit/fa8f87f1ec92e543dd975156c4b184eb3e0b80cb) + [#10167](https://github.com/npm/npm/pull/10167) + Clarify in scope documentation that npm@2 is required for scoped packages. + ([@danpaz](https://github.com/danpaz)) + +#### DEPENDENCIES + +* [`124427e`](https://github.com/npm/npm/commit/124427eabbfd200aa145114e389e19692559ff1e) + [#8614](https://github.com/npm/npm/issues/8614) + `fstream-npm@1.1.1`: + Fixes bug with inclusion of scoped bundled dependencies. + ([@forivall](https://github.com/forivall)) +* [`7e0cdff`](https://github.com/npm/npm/commit/7e0cdff04714709f6dc056b19422d3f937502f1c) + [#13497](https://github.com/npm/npm/pull/13497) + `graceful-fs@4.1.5`: + `graceful-fs` had a [bug fix](https://github.com/isaacs/node-graceful-fs/pull/71) which + fixes a problem ([nodejs/node#7846](https://github.com/nodejs/node/pull/7846)) exposed + by recent changes to Node.js. + ([@thefourtheye](https://github.com/thefourtheye)) +* [`9b88cb8`](https://github.com/npm/npm/commit/9b88cb89f138443f324094685f4de073f33ecef0) + [#9984](https://github.com/npm/npm/issues/9984) + `request@2.74.0`: + Update request library to at least 2.73 to fix a bug where `npm install` would crash with + _Cannot read property 'emit' of null._ + + Update `request` dependency `tough-cookie` to `2.3.0` to + to address [https://nodesecurity.io/advisories/130](https://nodesecurity.io/advisories/130). + Versions 0.9.7 through 2.2.2 contain a vulnerable regular expression that, + under certain conditions involving long strings of semicolons in the + "Set-Cookie" header, causes the event loop to block for excessive amounts of + time. + ([@zarenner](https://github.com/zarenner)) + ([@stash-sfdc](https://github.com/stash-sfdc)) +* [`bf78ce5`](https://github.com/npm/npm/commit/bf78ce5ef5d2d6e95177193cca5362dd27bff968) + [#13387](https://github.com/npm/npm/issues/13387) + `minimatch@3.0.3`: + Handle extremely long and terrible patterns more gracefully. + There were some magic numbers that assumed that every extglob pattern starts + and ends with a specific number of characters in the regular expression. + Since !(||) patterns are a little bit more complicated, this led to creating + an invalid regular expression and throwing. + ([@isaacs](https://github.com/isaacs)) +* [`803e538`](https://github.com/npm/npm/commit/803e538efaae4b56a764029742adcf6761e8398b) + [isaacs/rimraf#111](https://github.com/isaacs/rimraf/issues/111) + `rimraf@2.5.4`: Clarify assertions: cb is required, options are not. + ([@isaacs](https://github.com/isaacs)) +* [`a9f84ef`](https://github.com/npm/npm/commit/a9f84ef61b4c719b646bf9cda00577ef16e3a113) + `lodash.without@4.2.0` + ([@jdalton](https://github.com/jdalton)) +* [`f59ff1c`](https://github.com/npm/npm/commit/f59ff1c2701f1bfd21bfdb97b4571823b614f694) + `lodash.uniq@4.4.0` + ([@jdalton](https://github.com/jdalton)) +* [`8cc027e`](https://github.com/npm/npm/commit/8cc027e5e81623260a49b31fe406ce483258b203) + `lodash.union@4.5.0` + ([@jdalton](https://github.com/jdalton)) +* [`0a6c1e4`](https://github.com/npm/npm/commit/0a6c1e4302a153fb055f495043ed33afd8324193) + `lodash.without@4.3.0` + ([@jdalton](https://github.com/jdalton)) +* [`4ab0181`](https://github.com/npm/npm/commit/4ab0181fca2eda18888b865ef691b83d30fb0c33) + `lodash.clonedeep@4.4.1` + ([@jdalton](https://github.com/jdalton)) + +### v3.10.6 (2016-07-07) + +This week we have a bunch of bug fixes for ya! A shrinkwrap regression +introduced in 3.10.0, better lifecycle `PATH` behavior, improvements when +working with registries other than `registry.npmjs.org` and a fix for +hopefully the last _don't print a progress bar over my interactive thingy_ +bug. + +#### SHRINKWRAP AND DEV DEPENDENCIES + +The rewrite in 3.10.0 triggered a bug where dependencies of devDependencies +would be included in your shrinkwrap even if you didn't request +devDependencies. + +* [`2484529`](https://github.com/npm/npm/commit/2484529ab56a42e5d6f13c48006f39a596d9e327) + [#13308](https://github.com/npm/npm/pull/13308) + Fix bug where deps of devDependencies would be incorrectly included in + shrinkwraps. + ([@iarna](https://github.com/iarna)) + +#### BETTER PATH LIFECYCLE BEHAVIOR + +We've been around the details on this one a few times in recent months and +hopefully this will bring is to where we want to be. + +* [`81051a9`](https://github.com/npm/npm/commit/81051a90eee66a843f76eb8cccedbb1d0a5c1f47) + [#12968](https://github.com/npm/npm/pull/12968) + When running lifecycle scripts, only prepend directory containing the node + binary to PATH if not already in PATH. + ([@segrey](https://github.com/segrey)) + +#### BETTER INTERACTIONS WITH THIRD PARTY REGISTRIES + +* [`071193c`](https://github.com/npm/npm/commit/071193c8e193767dd1656cb27556cb3751d77a3b) + [#10869](https://github.com/npm/npm/pull/10869) + If the registry returns a list of versions some of which are invalid, skip + those when picking a version to install. This can't happen with + registry.npmjs.org as it will normalize versions published with it, but it + can happen with other registries. + ([@gregersrygg](https://github.com/gregersrygg)) + +#### ONE LAST TOO-MUCH-PROGRESS CORNER + +* [`1244cc1`](https://github.com/npm/npm/commit/1244cc16dc5a0536acf26816a1deeb8e221d67eb) + [#13305](https://github.com/npm/npm/pull/13305) + Disable progress bar in `npm edit` and `npm config edit`. + ([@watilde](https://github.com/watilde)) + +#### HTML DOCS IMPROVEMENTS + +* [`58da923`](https://github.com/npm/npm/commit/58da9234ae72a5474b997f890a1155ee9785e6f1) + [#13225](https://github.com/npm/npm/issues/13225) + Fix HTML character set declaration in generated HTML documentation. + ([@KenanY](https://github.com/KenanY)) +* [`d1f0bf4`](https://github.com/npm/npm/commit/d1f0bf4303566f8690502034f82bbb449850958d) + [#13250](https://github.com/npm/npm/pull/13250) + Optimize png images using zopflipng. + ([@PeterDaveHello](https://github.com/PeterDaveHello)) + +#### DEPENDENCY UPDATES (THAT MATTER) + +* [`c7567e5`](https://github.com/npm/npm/commit/c7567e58618b63f97884afa104d2f560c9272dd5) + [npm/npm-user-validate#9](https://github.com/npm/npm-user-validate/pull/9) + `npm-user-validate@0.1.5`: + Lower the username length limits to 214 from 576 to match `registry.npmjs.org`'s limits. + ([@aredridel](https://github.com/aredridel)) +* [`22802c9`](https://github.com/npm/npm/commit/22802c9db3cf990c905e8f61304db9b5571d7964) + [#isaacs/rimraf](https://github.com/npm/npm/issues/isaacs/rimraf) + `rimraf@2.5.3`: + Fixes EPERM errors when running `lstat` on read-only directories. + ([@isaacs](https://github.com/isaacs)) +* [`ce6406f`](https://github.com/npm/npm/commit/ce6406f4b6c4dffbb5cd8a3c049f6663a5665522) + `glob@7.0.5`: + Forces the use of `minimatch` to 3.0.2, which improved handling of long and + complicated patterns. + ([@isaacs](https://github.com/isaacs)) + + +### v3.10.5 (2016-07-05) + +This is a fix to this week's testing release to correct the update of +`node-gyp` which somehow got mangled. + +* [`ca97ce2`](https://github.com/npm/npm/commit/ca97ce2e8d8ba44c445b39ffa40daf397d5601b3) + [#13256](https://github.com/npm/npm/issues/13256) + Fresh reinstall of `node-gyp@3.4.0`. + ([@zkat](https://github.com/zkat)) + +### v3.10.4 (2016-06-30) + +Hey y'all! This release includes a bunch of fixes we've been working on as we +continue on our `big-bug` push. There's still [a lot of it left to +do](https://github.com/npm/npm/labels/big-bug), but once this is done, things +should just generally be more stable, installs should be more reliable and +correct, and we'll be able to move on to more future work. We'll keep doing our +best! 🙌 + +#### RACES AS WACKY AS [REDLINE](https://en.wikipedia.org/wiki/Redline_\(2009_film\)) + +Races are notoriously hard to squash, and tend to be some of the more common +recurring bugs we see on the CLI. [@julianduque](https://github.com/julianduque) +did some pretty awesome [sleuthing +work](https://github.com/npm/npm/issues/12669) to track down a cache race and +helpfully submitted a patch. There were some related races in the same area that +also got fixed at around the same time, mostly affecting Windows users. + +* [`2a37c97`](https://github.com/npm/npm/commit/2a37c97121483db2b6f817fe85c2a5a77b76080e) + [#12669](https://github.com/npm/npm/issues/12669) + [#13023](https://github.com/npm/npm/pull/13023) + The CLI is pretty aggressive about correcting permissions across the cache + whenever it writes to it. This aggressiveness caused a couple of races where + temporary cache files would get picked up by `fs.readdir`, and removed before + `chownr` was called on them, causing `ENOENT` errors. While the solution might + seem a bit hamfisted, it's actually perfectly safe and appropriate in this + case to just ignore those resulting `ENOENT` errors. + ([@julianduque](https://github.com/julianduque)) +* [`ea018b9`](https://github.com/npm/npm/commit/ea018b9e3856d1798d199ae3ebce4ed07eea511b) + [#13023](https://github.com/npm/npm/pull/13023) + If a user were to have SUDO_UID and SUDO_GID, they'd be able to get into a + pretty weird state. This fixes that corner case. + ([@zkat](https://github.com/zkat)) +* [`703ca3a`](https://github.com/npm/npm/commit/703ca3abbf4f1cb4dff08be32acd2142d5493482) + [#13023](https://github.com/npm/npm/pull/13023) + A missing `return` was causing `chownr` to be called on Windows, even though + that's literally pointless, and causing crashes in the process, instead of + short-circuiting. This was entirely dependent on which callback happened to be + called first, and in some cases, the failing one would win the race. This + should prevent this from happening in the future. + ([@zkat](https://github.com/zkat)) +* [`69267f4`](https://github.com/npm/npm/commit/69267f4fbd1467ce576f173909ced361f8fe2a9d) + [#13023](https://github.com/npm/npm/pull/13023) + Added tests to verify `correct-mkdir` race patch. + ([@zkat](https://github.com/zkat)) +* [`e5f50ea`](https://github.com/npm/npm/commit/e5f50ea9f84fe8cac6978d18f7efdf43834928e7) + [#13023](https://github.com/npm/npm/pull/13023) + Added tests to verify `addLocal` race patch. + ([@zkat](https://github.com/zkat)) + +#### SHRINKWRAP IS COMPLICATED BUT IT'S BETTER NOW + +[@iarna](https://github.com/iarna) did some heroic hacking to refactor a bunch +of `shrinkwrap`-related bits and fixed some resolution and pathing issues that +were biting users. The code around that stuff got more readable/maintainable in +the process, too! + +* [`346bba1`](https://github.com/npm/npm/commit/346bba1e1fee9cc814b07c56f598a73be5c21686) + [#13214](https://github.com/npm/npm/pull/13214) + Resolve local dependencies in `npm-shrinkwrap.json` relative to the top of the + tree. + ([@iarna](https://github.com/iarna)) +* [`4a67fdb`](https://github.com/npm/npm/commit/4a67fdbd0f160deb6644a9c4c5b587357db04d2d) + [#13213](https://github.com/npm/npm/pull/13213) + If you run `npm install modulename` it should, if a `npm-shrinkwrap.json` is + present, use the version found there. If not, it'll use the version found in + your `package.json`, and failing *that*, use `latest`. + This fixes a case where the first check was being bypassed because version + resolution was being done prior to loading the shrinkwrap, and so checks to + match the shrinkwrap version couldn't succeed. + ([@iarna](https://github.com/iarna)) +* [`afa2133`](https://github.com/npm/npm/commit/afa2133a5d8ac4f6f44cdc6083d89ad7f946f5bb) + [#13214](https://github.com/npm/npm/pull/13214) + Refactor shrinkwrap specifier lookup into shared function. + ([@iarna](https://github.com/iarna)) +* [`2820b56`](https://github.com/npm/npm/commit/2820b56a43e1cc1e12079a4c886f6c14fe8c4f10) + [#13214](https://github.com/npm/npm/pull/13214) + Refactor operations in `inflate-shrinkwrap.js` into separate functions for + added clarity. + ([@iarna](https://github.com/iarna)) +* [`ee5bfb3`](https://github.com/npm/npm/commit/ee5bfb3e56ee7ae582bec9f741f32b224c279947) + Fix Windows path issue in a shrinkwrap test. + ([@zkat](https://github.com/zkat)) + +#### OTHER BUGFIXES + +* [`a11a7b2`](https://github.com/npm/npm/commit/a11a7b2e7df9478ac9101b06eead4a74c41a648d) + [#13212](https://github.com/npm/npm/pull/13212) + Resolve local paths passed in through the command line relative to current + directory, instead of relative to the `package.json`. + ([@iarna](https://github.com/iarna)) + +#### DEPENDENCY UPDATES + +* [`900a5b7`](https://github.com/npm/npm/commit/900a5b7f18b277786397faac05853c030263feb8) + [#13199](https://github.com/npm/npm/pull/13199) + [`node-gyp@3.4.0`](https://github.com/nodejs/node-gyp/blob/master/CHANGELOG.md): + AIX, Visual Studio 2015, and logging improvements. Oh my~! + ([@rvagg](https://github.com/rvagg)) + +#### DOCUMENTATION FIXES + +* [`c6942a7`](https://github.com/npm/npm/commit/c6942a7d6acb2b8c73206353bbec03380a056af4) + [#13134](https://github.com/npm/npm/pull/13134) + Fixed a few typos in `CHANGELOG.md`. + ([@watilde](https://github.com/watilde)) +* [`e63d913`](https://github.com/npm/npm/commit/e63d913127731ece56dcd69c7c0182af21be58f8) + [#13156](https://github.com/npm/npm/pull/13156) + Fix old reference to `doc/install` in a source comment. + ([@sheerun](https://github.com/sheerun)) +* [`099d23c`](https://github.com/npm/npm/commit/099d23cc8f38b524dc19a25857b2ebeca13c49d6) + [#13113](https://github.com/npm/npm/issues/13113) + [#13189](https://github.com/npm/npm/pull/13189) + Fixes a link to `npm-tag(3)` that was breaking to instead point to + `npm-dist-tag(1)`, as reported by [@SimenB](https://github.com/SimenB) + ([@macdonst](https://github.com/macdonst)) + ### v3.10.3 (2016-06-23) Given that we had not one, but two updates to our RC this past week, it @@ -88,12 +678,12 @@ unrecoverable errors then npm would crash instead of printing the error. * [`6a33b2c`](https://github.com/npm/npm/commit/6a33b2c13f637a41e25cd0339925bc430b50358a) [#13115](https://github.com/npm/npm/issues/13115) Ensure that errors reading the package tree for `outdated` does not result - in crashs. + in crashes. ([@iarna](https://github.com/iarna)) ### v3.10.1 (2016-06-17): -There are two very important bug fixes and one long-awaited (and signifcant!) +There are two very important bug fixes and one long-awaited (and significant!) deprecation in this hotfix release. [Hold on.](http://butt.holdings/) #### *WHOA* @@ -225,7 +815,7 @@ Node.js 0.10 and 0.12, it's unlikely that patches that rely on ES 2015 functionality will land anytime soon. Looking forward, the team's current plan is to drop support for Node.js 0.10 -when its LTS maintenace window expires in October, 2016, and 0.12 when its +when its LTS maintenance window expires in October, 2016, and 0.12 when its maintenance / LTS window ends at the end of 2016. We will also drop support for Node.js 5.x when Node.js 6 becomes LTS and Node.js 7 is released, also in the October-December 2016 timeframe. diff --git a/deps/npm/README.md b/deps/npm/README.md index a2e2481dd793d2..671dd387403bad 100644 --- a/deps/npm/README.md +++ b/deps/npm/README.md @@ -9,7 +9,7 @@ Much more info available via `npm help` once it's installed. ## IMPORTANT -**You need node v0.8 or higher to run this program.** +**You need node v0.10 or higher to run this program.** To install an old **and unsupported** version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches. diff --git a/deps/npm/doc/cli/npm-install.md b/deps/npm/doc/cli/npm-install.md index 177bf41ec2b300..874ce1c2872e1f 100644 --- a/deps/npm/doc/cli/npm-install.md +++ b/deps/npm/doc/cli/npm-install.md @@ -183,6 +183,7 @@ after packing it up into a tarball (b). to the environment when running git: * `GIT_ASKPASS` + * `GIT_EXEC_PATH` * `GIT_PROXY_COMMAND` * `GIT_SSH` * `GIT_SSH_COMMAND` @@ -271,7 +272,7 @@ global `node_modules` folder. Only your direct dependencies will show in `node_modules` and everything they depend on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. -The `--ignore-scripts` argument will cause npm to not execute any +The `--ignore-scripts` argument will cause npm to not execute any scripts defined in the package.json. See `npm-scripts(7)`. The `--legacy-bundling` argument will cause npm to install the package such diff --git a/deps/npm/doc/cli/npm-link.md b/deps/npm/doc/cli/npm-link.md index 3970ffdf80b992..7ba22852502560 100644 --- a/deps/npm/doc/cli/npm-link.md +++ b/deps/npm/doc/cli/npm-link.md @@ -14,7 +14,8 @@ Package linking is a two-step process. First, `npm link` in a package folder will create a symlink in the global folder `{prefix}/lib/node_modules/` that links to the package where the `npm -link` command was executed. (see `npm-config(7)` for the value of `prefix`). +link` command was executed. (see `npm-config(7)` for the value of `prefix`). It +will also link any bins in the package to `{prefix}/bin/{name}`. Next, in some other location, `npm link package-name` will create a symbolic link from globally-installed `package-name` to `node_modules/` diff --git a/deps/npm/doc/cli/npm-run-script.md b/deps/npm/doc/cli/npm-run-script.md index 43fa58e5d8d37d..fc6b42a4785edc 100644 --- a/deps/npm/doc/cli/npm-run-script.md +++ b/deps/npm/doc/cli/npm-run-script.md @@ -41,8 +41,8 @@ you should write: instead of `"scripts": {"test": "node_modules/.bin/tap test/\*.js"}` to run your tests. `npm run` sets the `NODE` environment variable to the `node` executable with -which `npm` is executed, and adds the directory within which it resides to the -`PATH`, too. +which `npm` is executed. Also, the directory within which it resides is added to the +`PATH`, if the `node` executable is not in the `PATH`. If you try to run a script without having a `node_modules` directory and it fails, you will be given a warning to run `npm install`, just in case you've forgotten. diff --git a/deps/npm/doc/cli/npm-shrinkwrap.md b/deps/npm/doc/cli/npm-shrinkwrap.md index 6fc7d96f7c2253..f89c3b8375e690 100644 --- a/deps/npm/doc/cli/npm-shrinkwrap.md +++ b/deps/npm/doc/cli/npm-shrinkwrap.md @@ -137,11 +137,11 @@ To add or update a dependency in a shrinkwrapped package: 1. Run `npm install` in the package root to install the current versions of all dependencies. -2. Add or update dependencies. `npm install --save` each new or updated - package individually to update the `package.json` and the shrinkwrap. - Note that they must be explicitly named in order to be installed: running - `npm install` with no arguments will merely reproduce the existing - shrinkwrap. +2. Add or update dependencies. `npm install --save` or `npm install --save-dev` + each new or updated package individually to update the `package.json` and + the shrinkwrap. Note that they must be explicitly named in order to be + installed: running `npm install` with no arguments will merely reproduce + the existing shrinkwrap. 3. Validate that the package works as expected with the new dependencies. 4. Commit the new `npm-shrinkwrap.json`, and publish your package. diff --git a/deps/npm/doc/cli/npm-tag.md b/deps/npm/doc/cli/npm-tag.md index 357c0862f267e3..88689d59d38b03 100644 --- a/deps/npm/doc/cli/npm-tag.md +++ b/deps/npm/doc/cli/npm-tag.md @@ -57,5 +57,5 @@ that do not begin with a number or the letter `v`. * npm-registry(7) * npm-config(1) * npm-config(7) -* npm-tag(3) +* npm-dist-tag(1) * npmrc(5) diff --git a/deps/npm/doc/files/npmrc.md b/deps/npm/doc/files/npmrc.md index 8aab60aff643a3..011c703be3bd3d 100644 --- a/deps/npm/doc/files/npmrc.md +++ b/deps/npm/doc/files/npmrc.md @@ -41,6 +41,16 @@ sensitive credentials, they must be readable and writable _only_ by your user account (i.e. must have a mode of `0600`), otherwise they _will be ignored by npm!_ +#### Comments + +Lines in `.npmrc` files are interpreted as comments when they begin with a `;` or `#` character. `.npmrc` files are parsed by [npm/ini](https://github.com/npm/ini), which specifies this comment syntax. + +For example: + + # last modified: 01 Jan 2016 + ; Set a new registry for a scoped package + @myscope:registry=https://mycustomregistry.example.org + ### Per-project config file When working locally in a project, a `.npmrc` file in the root of the diff --git a/deps/npm/doc/files/package.json.md b/deps/npm/doc/files/package.json.md index 98b77af3e534d4..f583436045e99c 100644 --- a/deps/npm/doc/files/package.json.md +++ b/deps/npm/doc/files/package.json.md @@ -203,6 +203,7 @@ Conversely, some files are always ignored: * `.npmrc` * `node_modules` * `config.gypi` +* `*.orig` ## main @@ -247,6 +248,10 @@ would be the same as this: , "version": "1.2.5" , "bin" : { "my-program" : "./path/to/program" } } +Please make sure that your file(s) referenced in `bin` starts with +`#!/usr/bin/env node`, otherwise the scripts are started without the node +executable! + ## man Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index 764555ea4a060a..76d1ee489caff5 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -26,10 +26,12 @@ same. The four relevant files are: -* per-project config file (/path/to/my/project/.npmrc) -* per-user config file (~/.npmrc) -* global config file ($PREFIX/etc/npmrc) -* npm builtin config file (/path/to/npm/npmrc) +* per-project configuration file (`/path/to/my/project/.npmrc`) +* per-user configuration file (defaults to `$HOME/.npmrc`; configurable via CLI + option `--userconfig` or environment variable `$NPM_CONF_USERCONFIG`) +* global configuration file (defaults to `$PREFIX/etc/npmrc`; configurable via + CLI option `--globalconfig` or environment variable `$NPM_CONF_GLOBALCONFIG`) +* npm's built-in configuration file (`/path/to/npm/npmrc`) See npmrc(5) for more details. diff --git a/deps/npm/doc/misc/npm-orgs.md b/deps/npm/doc/misc/npm-orgs.md index e28b6c17640fd6..3db22f8c7eab49 100644 --- a/deps/npm/doc/misc/npm-orgs.md +++ b/deps/npm/doc/misc/npm-orgs.md @@ -7,7 +7,7 @@ There are three levels of org users: 1. Super admin, controls billing & adding people to the org. 2. Team admin, manages team membership & package access. -3. Developer, works on packages they are given access to. +3. Developer, works on packages they are given access to. The super admin is the only person who can add users to the org because it impacts the monthly bill. The super admin will use the website to manage membership. Every org has a `developers` team that all users are automatically added to. @@ -51,7 +51,7 @@ npm init --scope= ``` to scope it for your org & publish as usual -* Grant access: +* Grant access: ``` npm access grant [] diff --git a/deps/npm/doc/misc/npm-registry.md b/deps/npm/doc/misc/npm-registry.md index cc1a1b299c25e0..becffa2f6ebda4 100644 --- a/deps/npm/doc/misc/npm-registry.md +++ b/deps/npm/doc/misc/npm-registry.md @@ -31,7 +31,7 @@ similar) design doc to implement the APIs. If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by -default will only publish internally. +default will only publish internally. If you then want to publish a package for the whole world to see, you can simply override the `--registry` option for that `publish` command. diff --git a/deps/npm/doc/misc/npm-scope.md b/deps/npm/doc/misc/npm-scope.md index 7431e62129343b..e9d4d025c2449f 100644 --- a/deps/npm/doc/misc/npm-scope.md +++ b/deps/npm/doc/misc/npm-scope.md @@ -13,9 +13,10 @@ followed by a slash, e.g. Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package. -Scoped packages are supported by the public npm registry. The npm -client is backwards-compatible with un-scoped registries, so it can be -used to work with scoped and un-scoped registries at the same time. +Scoped packages can be published and installed as of `npm@2` and are supported +by the primary npm registry. The npm client is backwards-compatible with +un-scoped registries, so it can be used to work with scoped and un-scoped +registries at the same time. ## Installing scoped packages @@ -51,14 +52,16 @@ just specifying to require the module `mypackage` in the folder called `@myorg`. ## Publishing scoped packages -Scoped packages can be published to any registry that supports them, including -the public npm registry. +Scoped packages can be published from the CLI as of `npm@2` and can be +published to any registry that supports them, including the primary npm +registry. -(As of 2015-04-19, and with npm 2.0 or better, the public npm registry **does** support scoped packages) +(As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +**does** support scoped packages) If you wish, you may associate a scope with a registry; see below. -### Publishing public scoped packages to the public npm registry +### Publishing public scoped packages to the primary npm registry To publish a public scoped package, you must specify `--access public` with the initial publication. This will publish the package and set access @@ -78,7 +81,7 @@ desired, with `npm access` or on the npmjs.com website. ## Associating a scope with a registry Scopes can be associated with a separate registry. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise. You can associate a scope with a registry at login, e.g. diff --git a/deps/npm/doc/misc/npm-scripts.md b/deps/npm/doc/misc/npm-scripts.md index 9ec75cc5ddf3dd..241815fcd41838 100644 --- a/deps/npm/doc/misc/npm-scripts.md +++ b/deps/npm/doc/misc/npm-scripts.md @@ -19,10 +19,12 @@ following scripts: Run BEFORE the package is uninstalled. * postuninstall: Run AFTER the package is uninstalled. -* preversion, version: - Run BEFORE bump the package version. +* preversion: + Run BEFORE bumping the package version. +* version: + Run AFTER bumping the package version, but BEFORE commit. * postversion: - Run AFTER bump the package version. + Run AFTER bumping the package version, and AFTER commit. * pretest, test, posttest: Run by the `npm test` command. * prestop, stop, poststop: diff --git a/deps/npm/doc/misc/semver.md b/deps/npm/doc/misc/semver.md index 97a50cdf0c500d..508d54403d0d15 100644 --- a/deps/npm/doc/misc/semver.md +++ b/deps/npm/doc/misc/semver.md @@ -4,6 +4,8 @@ semver(7) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] [ [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range + Print versions that match the specified range. + + -i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -242,7 +261,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -272,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -306,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index f29b1d371e9f6d..d45cf66a81be90 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -1,7 +1,7 @@ README - + @@ -15,7 +15,7 @@

SYNOPSIS

This is just enough info to get you up and running.

Much more info available via npm help once it's installed.

IMPORTANT

-

You need node v0.8 or higher to run this program.

+

You need node v0.10 or higher to run this program.

To install an old and unsupported version of npm that works on node 0.3 and prior, clone the git repo and dig through the old tags and branches.

npm is configured to use npm, Inc.'s public package registry at @@ -126,5 +126,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-access.html b/deps/npm/html/doc/cli/npm-access.html index db12b9db8c4d23..387e5d80a1d4ca 100644 --- a/deps/npm/html/doc/cli/npm-access.html +++ b/deps/npm/html/doc/cli/npm-access.html @@ -1,7 +1,7 @@ npm-access - + @@ -84,5 +84,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index cf63d917cf7c59..51a420c9e1545d 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -1,7 +1,7 @@ npm-adduser - + @@ -72,5 +72,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index edfad8410b3ded..da6760127ef53b 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -1,7 +1,7 @@ npm-bin - + @@ -35,5 +35,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 6b0ba4da0eb7bb..7f0cf04c2a8a27 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -1,7 +1,7 @@ npm-bugs - + @@ -55,5 +55,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index ff4d8c41b0c6a2..32ad0f728741a3 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -1,7 +1,7 @@ npm-build - + @@ -40,5 +40,5 @@

DESCRIPTION

       - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index 4ac20ba250ed42..c0e5cd7fe14e64 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -1,7 +1,7 @@ npm-bundle - + @@ -31,5 +31,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index 4970a1e72b26c1..9b09bc13d9251e 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -1,7 +1,7 @@ npm-cache - + @@ -81,5 +81,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 0cc67c6b8023b1..db07154f63ab09 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -1,7 +1,7 @@ npm-completion - + @@ -43,5 +43,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index c4338e24db3a9d..05525fce50a148 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -1,7 +1,7 @@ npm-config - + @@ -67,5 +67,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index 53ac72d3d646a8..4a3c71e0f92f2d 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -1,7 +1,7 @@ npm-dedupe - + @@ -61,5 +61,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index e7f08317ad3c4c..19e2a0aad1ffaa 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -1,7 +1,7 @@ npm-deprecate - + @@ -38,5 +38,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-dist-tag.html b/deps/npm/html/doc/cli/npm-dist-tag.html index 73d81b75a701ac..905a1e255e5c3f 100644 --- a/deps/npm/html/doc/cli/npm-dist-tag.html +++ b/deps/npm/html/doc/cli/npm-dist-tag.html @@ -1,7 +1,7 @@ npm-dist-tag - + @@ -87,5 +87,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index ff63edf7976d41..4d89d2234a3e46 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -1,7 +1,7 @@ npm-docs - + @@ -56,5 +56,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 4ad12b97531fc5..3d2e9b1ae8ea2c 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -1,7 +1,7 @@ npm-edit - + @@ -49,5 +49,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 4c3db7f749a284..31351c3320b747 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -1,7 +1,7 @@ npm-explore - + @@ -49,5 +49,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index e1c8633bb2ae2e..f356e594e5cf54 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -1,7 +1,7 @@ npm-help-search - + @@ -45,5 +45,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 7997896bb2487c..42b466f34cbb4a 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -1,7 +1,7 @@ npm-help - + @@ -50,5 +50,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 32b0326ae868aa..7378a258a8c5b1 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -1,7 +1,7 @@ npm-init - + @@ -48,5 +48,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-install-test.html b/deps/npm/html/doc/cli/npm-install-test.html index e236e425a3c630..bb1fa931c39392 100644 --- a/deps/npm/html/doc/cli/npm-install-test.html +++ b/deps/npm/html/doc/cli/npm-install-test.html @@ -1,7 +1,7 @@ npm-install-test - + @@ -42,4 +42,5 @@

SEE ALSO

       - + + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 7866afcdb2f563..c7b573e79aacc2 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -1,7 +1,7 @@ npm-install - + @@ -152,6 +152,7 @@

SYNOPSIS

to the environment when running git:

  • GIT_ASKPASS
  • +
  • GIT_EXEC_PATH
  • GIT_PROXY_COMMAND
  • GIT_SSH
  • GIT_SSH_COMMAND
  • @@ -217,7 +218,7 @@

    SYNOPSIS

    global node_modules folder. Only your direct dependencies will show in node_modules and everything they depend on will be flattened in their node_modules folders. This obviously will eliminate some deduping.

    -

    The --ignore-scripts argument will cause npm to not execute any +

    The --ignore-scripts argument will cause npm to not execute any scripts defined in the package.json. See npm-scripts(7).

    The --legacy-bundling argument will cause npm to install the package such that versions of npm prior to 1.4, such as the one included with node 0.8, @@ -312,5 +313,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index b3ee5da28c9878..d629b5f7657bbd 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -1,7 +1,7 @@ npm-link - + @@ -19,7 +19,8 @@

    SYNOPSIS

    Package linking is a two-step process.

    First, npm link in a package folder will create a symlink in the global folder {prefix}/lib/node_modules/<package> that links to the package where the npm -link command was executed. (see npm-config(7) for the value of prefix).

    +link command was executed. (see npm-config(7) for the value of prefix). It +will also link any bins in the package to {prefix}/bin/{name}.

    Next, in some other location, npm link package-name will create a symbolic link from globally-installed package-name to node_modules/ of the current folder.

    @@ -73,5 +74,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-logout.html b/deps/npm/html/doc/cli/npm-logout.html index 7b054c5fef1fcf..0e66b22d30ecba 100644 --- a/deps/npm/html/doc/cli/npm-logout.html +++ b/deps/npm/html/doc/cli/npm-logout.html @@ -1,7 +1,7 @@ npm-logout - + @@ -51,5 +51,5 @@

    scope

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index ff0ce5947edb62..bb26788e29d2f9 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -1,7 +1,7 @@ npm-ls - + @@ -21,7 +21,7 @@

    SYNOPSIS

    limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -
    npm@3.10.3 /path/to/npm
    +
    npm@3.10.8 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

    It will print out extraneous, missing, and invalid packages.

    @@ -104,5 +104,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index 414468a4959f91..0153d0e71227fc 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -1,7 +1,7 @@ npm-outdated - + @@ -116,5 +116,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index 15a5902a6ab019..3918d686af5570 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -1,7 +1,7 @@ npm-owner - + @@ -51,5 +51,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index b28706242df1b3..1b0fa7bc10afd0 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -1,7 +1,7 @@ npm-pack - + @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-ping.html b/deps/npm/html/doc/cli/npm-ping.html index f6b275cfd1e141..4e1a2131161acc 100644 --- a/deps/npm/html/doc/cli/npm-ping.html +++ b/deps/npm/html/doc/cli/npm-ping.html @@ -1,7 +1,7 @@ npm-ping - + @@ -32,4 +32,5 @@

    SEE ALSO

           - + + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 5e85f6567f6840..a9760dbfa87aed 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -1,7 +1,7 @@ npm-prefix - + @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index 85540d1ffbc74b..e3a0e264bf168a 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -1,7 +1,7 @@ npm-prune - + @@ -40,5 +40,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index 4a7f7242636900..89e4c783725a24 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -1,7 +1,7 @@ npm-publish - + @@ -76,5 +76,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index aa3b2766c730ff..815e2219f02eb4 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -1,7 +1,7 @@ npm-rebuild - + @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 36b34ac815c8d5..ff71c0029d80fa 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -1,7 +1,7 @@ npm-repo - + @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 512d4ef41cb3b7..69426118d46bc6 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -1,7 +1,7 @@ npm-restart - + @@ -53,5 +53,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 76dcf86db12b59..fe14f23ea35533 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -1,7 +1,7 @@ npm-root - + @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 91f5d69b8dd261..0b0b1f8d740606 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -1,7 +1,7 @@ npm-run-script - + @@ -39,8 +39,8 @@

    SYNOPSIS

    "scripts": {"test": "tap test/\*.js"}
     

    instead of "scripts": {"test": "node_modules/.bin/tap test/\*.js"} to run your tests.

    npm run sets the NODE environment variable to the node executable with -which npm is executed, and adds the directory within which it resides to the -PATH, too.

    +which npm is executed. Also, the directory within which it resides is added to the +PATH, if the node executable is not in the PATH.

    If you try to run a script without having a node_modules directory and it fails, you will be given a warning to run npm install, just in case you've forgotten.

    SEE ALSO

    @@ -63,5 +63,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 339239957b0f1c..86721abb524e5d 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -1,7 +1,7 @@ npm-search - + @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 633cc0a545b9ad..ccbe2e53b3e195 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -1,7 +1,7 @@ npm-shrinkwrap - + @@ -121,11 +121,11 @@

    Building shrinkwrapped packages

    1. Run npm install in the package root to install the current versions of all dependencies.
    2. -
    3. Add or update dependencies. npm install --save each new or updated -package individually to update the package.json and the shrinkwrap. -Note that they must be explicitly named in order to be installed: running -npm install with no arguments will merely reproduce the existing -shrinkwrap.
    4. +
    5. Add or update dependencies. npm install --save or npm install --save-dev +each new or updated package individually to update the package.json and +the shrinkwrap. Note that they must be explicitly named in order to be +installed: running npm install with no arguments will merely reproduce +the existing shrinkwrap.
    6. Validate that the package works as expected with the new dependencies.
    7. Commit the new npm-shrinkwrap.json, and publish your package.
    8. @@ -176,5 +176,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index aceae49107f9f8..4ed9d8034f5b19 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -1,7 +1,7 @@ npm-star - + @@ -36,5 +36,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 9b1e2375fc843d..e7b474f1d68d41 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -1,7 +1,7 @@ npm-stars - + @@ -36,5 +36,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index fabb59c82916b9..0b4e7d701cf686 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -1,7 +1,7 @@ npm-start - + @@ -39,5 +39,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 99c73800514167..f0ef8065d22568 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -1,7 +1,7 @@ npm-stop - + @@ -34,5 +34,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index e1c88fd82f5369..74c0a34593c58f 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -1,7 +1,7 @@ npm-tag - + @@ -48,7 +48,7 @@

      SEE ALSO

    9. npm-registry(7)
    10. npm-config(1)
    11. npm-config(7)
    12. -
    13. npm-tag(3)
    14. +
    15. npm-dist-tag(1)
    16. npmrc(5)
@@ -63,5 +63,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-team.html b/deps/npm/html/doc/cli/npm-team.html index 6da75633556818..90655239f2b79e 100644 --- a/deps/npm/html/doc/cli/npm-team.html +++ b/deps/npm/html/doc/cli/npm-team.html @@ -1,7 +1,7 @@ npm-team - + @@ -67,4 +67,5 @@

SEE ALSO

       - + + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index a23c21e87be4b8..7ca65fa4a2e2dd 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -1,7 +1,7 @@ npm-test - + @@ -38,5 +38,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index f6576a57cce3bb..02f8971db3657f 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -1,7 +1,7 @@ npm-uninstall - + @@ -60,5 +60,5 @@

SYNOPSIS

       - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 637db014068ec5..2d9aa063b8557c 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -1,7 +1,7 @@ npm-unpublish - + @@ -47,5 +47,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index 2c665efdbe1ab5..d0a375ec1b9e42 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -1,7 +1,7 @@ npm-update - + @@ -118,5 +118,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index c4ad92100fd3a8..881c02f27f68e8 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -1,7 +1,7 @@ npm-version - + @@ -100,5 +100,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index b5b4c6d4100465..047845427d67a9 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -1,7 +1,7 @@ npm-view - + @@ -86,5 +86,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index a4672dfc3fc7db..8ae3b976d09668 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -1,7 +1,7 @@ npm-whoami - + @@ -33,5 +33,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 9b8fdfc9ebbbd2..705d4b2557e0d4 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -1,7 +1,7 @@ npm - + @@ -13,7 +13,7 @@

npm

javascript package manager

SYNOPSIS

npm <command> [args]
 

VERSION

-

3.10.3

+

3.10.8

DESCRIPTION

npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency @@ -126,7 +126,7 @@

AUTHOR

Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

+i@izs.me

SEE ALSO

  • npm-help(1)
  • @@ -150,5 +150,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index bcfd0279138d5c..29cc77204c650b 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -1,7 +1,7 @@ npm-folders - + @@ -182,5 +182,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index bcfd0279138d5c..29cc77204c650b 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -1,7 +1,7 @@ npm-folders - + @@ -182,5 +182,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index 56fc6594dcb983..46c77ec1c04397 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -1,7 +1,7 @@ package.json - + @@ -161,6 +161,7 @@

    files

  • .npmrc
  • node_modules
  • config.gypi
  • +
  • *.orig

main

The main field is a module ID that is the primary entry point to your program. @@ -190,7 +191,10 @@

bin

{ "name": "my-program"
 , "version": "1.2.5"
 , "bin" : { "my-program" : "./path/to/program" } }
-

man

+

Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

+

man

Specify either a single file or an array of filenames to put in place for the man program to find.

If only a single file is provided, then it's installed such that it is the @@ -581,5 +585,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index c78bea864c03e6..62ba82f66b39b6 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -1,7 +1,7 @@ npmrc - + @@ -39,7 +39,13 @@

FILES

sensitive credentials, they must be readable and writable only by your user account (i.e. must have a mode of 0600), otherwise they will be ignored by npm!

-

Per-project config file

+

Comments

+

Lines in .npmrc files are interpreted as comments when they begin with a ; or # character. .npmrc files are parsed by npm/ini, which specifies this comment syntax.

+

For example:

+
# last modified: 01 Jan 2016
+; Set a new registry for a scoped package
+@myscope:registry=https://mycustomregistry.example.org
+

Per-project config file

When working locally in a project, a .npmrc file in the root of the project (ie, a sibling of node_modules and package.json) will set config values specific to this project.

@@ -83,5 +89,5 @@

SEE ALSO

       - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index 56fc6594dcb983..46c77ec1c04397 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -1,7 +1,7 @@ package.json - + @@ -161,6 +161,7 @@

files

  • .npmrc
  • node_modules
  • config.gypi
  • +
  • *.orig
  • main

    The main field is a module ID that is the primary entry point to your program. @@ -190,7 +191,10 @@

    bin

    { "name": "my-program"
     , "version": "1.2.5"
     , "bin" : { "my-program" : "./path/to/program" } }
    -

    man

    +

    Please make sure that your file(s) referenced in bin starts with +#!/usr/bin/env node, otherwise the scripts are started without the node +executable!

    +

    man

    Specify either a single file or an array of filenames to put in place for the man program to find.

    If only a single file is provided, then it's installed such that it is the @@ -581,5 +585,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index d12a7e132e65c9..81cd3a1dbdb2f3 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -1,7 +1,7 @@ npm-index - + @@ -162,5 +162,5 @@

    semver(7)

           - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index 1f923462fba90d..f2bb954f73edd1 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -1,7 +1,7 @@ npm-coding-style - + @@ -153,5 +153,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index 7541b826d2d573..26adf609b6fdaa 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -1,7 +1,7 @@ npm-config - + @@ -28,10 +28,12 @@

    Environment Variables

    npmrc Files

    The four relevant files are:

      -
    • per-project config file (/path/to/my/project/.npmrc)
    • -
    • per-user config file (~/.npmrc)
    • -
    • global config file ($PREFIX/etc/npmrc)
    • -
    • npm builtin config file (/path/to/npm/npmrc)
    • +
    • per-project configuration file (/path/to/my/project/.npmrc)
    • +
    • per-user configuration file (defaults to $HOME/.npmrc; configurable via CLI +option --userconfig or environment variable $NPM_CONF_USERCONFIG)
    • +
    • global configuration file (defaults to $PREFIX/etc/npmrc; configurable via +CLI option --globalconfig or environment variable $NPM_CONF_GLOBALCONFIG)
    • +
    • npm's built-in configuration file (/path/to/npm/npmrc)

    See npmrc(5) for more details.

    Default Configs

    @@ -862,5 +864,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 8b932609710b75..0864d558e59b4e 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -1,7 +1,7 @@ npm-developers - + @@ -194,5 +194,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index c28db606dbaab3..bb6afe880ccfee 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -1,7 +1,7 @@ npm-disputes - + @@ -13,7 +13,7 @@

    npm-disputes

    Handling Module

    SYNOPSIS

    1. Get the author email with npm owner ls <pkgname>
    2. -
    3. Email the author, CC support@npmjs.com
    4. +
    5. Email the author, CC support@npmjs.com
    6. After a few weeks, if there's no resolution, we'll sort it out.

    Don't squat on package names. Publish code or move out of the way.

    @@ -51,12 +51,12 @@

    DESCRIPTION

    owner (Bob).
  • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
  • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
  • @@ -112,5 +112,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 1d5a6eb8cd5fcf..2c4aaab7a32575 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -1,7 +1,7 @@ npm-index - + @@ -162,4 +162,5 @@

    semver(7)

           - + + diff --git a/deps/npm/html/doc/misc/npm-orgs.html b/deps/npm/html/doc/misc/npm-orgs.html index 5ba1b7cb592ddd..247c86684dfcca 100644 --- a/deps/npm/html/doc/misc/npm-orgs.html +++ b/deps/npm/html/doc/misc/npm-orgs.html @@ -1,7 +1,7 @@ npm-orgs - + @@ -86,4 +86,5 @@

    Team Admins create teams

           - + + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index c0a7fa512ec1a3..ed89e342565ede 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -1,7 +1,7 @@ npm-registry - + @@ -70,5 +70,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scope.html b/deps/npm/html/doc/misc/npm-scope.html index 21b22d926c219a..632ea3e24eb815 100644 --- a/deps/npm/html/doc/misc/npm-scope.html +++ b/deps/npm/html/doc/misc/npm-scope.html @@ -1,7 +1,7 @@ npm-scope - + @@ -18,9 +18,10 @@

    DESCRIPTION

    @somescope/somepackagename
     

    Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package.

    -

    Scoped packages are supported by the public npm registry. The npm -client is backwards-compatible with un-scoped registries, so it can be -used to work with scoped and un-scoped registries at the same time.

    +

    Scoped packages can be published and installed as of npm@2 and are supported +by the primary npm registry. The npm client is backwards-compatible with +un-scoped registries, so it can be used to work with scoped and un-scoped +registries at the same time.

    Installing scoped packages

    Scoped packages are installed to a sub-folder of the regular installation folder, e.g. if your other packages are installed in node_modules/packagename, @@ -43,11 +44,13 @@

    Requiring scoped packages

    There is nothing special about the way Node treats scope folders, this is just specifying to require the module mypackage in the folder called @myorg.

    Publishing scoped packages

    -

    Scoped packages can be published to any registry that supports them, including -the public npm registry.

    -

    (As of 2015-04-19, and with npm 2.0 or better, the public npm registry does support scoped packages)

    +

    Scoped packages can be published from the CLI as of npm@2 and can be +published to any registry that supports them, including the primary npm +registry.

    +

    (As of 2015-04-19, and with npm 2.0 or better, the primary npm registry +does support scoped packages)

    If you wish, you may associate a scope with a registry; see below.

    -

    Publishing public scoped packages to the public npm registry

    +

    Publishing public scoped packages to the primary npm registry

    To publish a public scoped package, you must specify --access public with the initial publication. This will publish the package and set access to public as if you had run npm access public after publishing.

    @@ -61,7 +64,7 @@

    Publishing priva desired, with npm access or on the npmjs.com website.

    Associating a scope with a registry

    Scopes can be associated with a separate registry. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise.

    You can associate a scope with a registry at login, e.g.

    npm login --registry=http://reg.example.com --scope=@myco
    @@ -91,5 +94,5 @@ 

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 53cbe9223f7149..9fc0e32ec2212f 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -1,7 +1,7 @@ npm-scripts - + @@ -27,10 +27,12 @@

    DESCRIPTION

    Run BEFORE the package is uninstalled.
  • postuninstall: Run AFTER the package is uninstalled.
  • -
  • preversion, version: -Run BEFORE bump the package version.
  • +
  • preversion: +Run BEFORE bumping the package version.
  • +
  • version: +Run AFTER bumping the package version, but BEFORE commit.
  • postversion: -Run AFTER bump the package version.
  • +Run AFTER bumping the package version, and AFTER commit.
  • pretest, test, posttest: Run by the npm test command.
  • prestop, stop, poststop: @@ -211,5 +213,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index 67c84990727f8d..a74838cb9a7341 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -1,7 +1,7 @@ removing-npm - + @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 0d2f0919dd5b07..493872d6506054 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -1,7 +1,7 @@ semver - + @@ -12,6 +12,8 @@

    semver

    The semantic versioner for npm

    Usage

    $ npm install semver
    +$ node
    +var semver = require('semver')
     
     semver.valid('1.2.3') // '1.2.3'
     semver.valid('a.b.c') // null
    @@ -22,18 +24,35 @@ 

    Usage

    As a command-line utility:

    $ semver -h
     
    -Usage: semver <version> [<version> [...]] [-r <range> | -i <inc> | --preid <identifier> | -l | -rv]
    -Test if version(s) satisfy the supplied range(s), and sort them.
    +SemVer 5.1.0
     
    -Multiple versions or ranges may be supplied, unless increment
    -option is specified.  In that case, only a single version may
    -be used, and it is incremented by the specified level
    +A JavaScript implementation of the http://semver.org/ specification
    +Copyright Isaac Z. Schlueter
    +
    +Usage: semver [options] <version> [<version> [...]]
    +Prints valid versions sorted by SemVer precedence
    +
    +Options:
    +-r --range <range>
    +        Print versions that match the specified range.
    +
    +-i --increment [<level>]
    +        Increment a version by the specified level.  Level can
    +        be one of: major, minor, patch, premajor, preminor,
    +        prepatch, or prerelease.  Default level is 'patch'.
    +        Only one version may be specified.
    +
    +--preid <identifier>
    +        Identifier to be used to prefix premajor, preminor,
    +        prepatch or prerelease version increments.
    +
    +-l --loose
    +        Interpret versions and ranges loosely
     
     Program exits successfully if any valid version satisfies
     all supplied ranges, and prints all satisfying versions.
     
    -If no versions are valid, or ranges are not satisfied,
    -then exits failure.
    +If no satisfying versions are found, then exits failure.
     
     Versions are printed in ascending order, so supplying
     multiple versions to the utility will just sort them.
    @@ -210,7 +229,7 @@ 

    Range Grammar

    primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -239,6 +258,8 @@

    Functions

    increments it.
  • +
  • prerelease(v): Returns an array of prerelease components, or null +if none exist. Example: prerelease('1.2.3-alpha.1') -> ['alpha', 1]
  • major(v): Return the major version number.
  • minor(v): Return the minor version number.
  • patch(v): Return the patch version number.
  • @@ -272,6 +293,8 @@

    Ranges

    range.
  • maxSatisfying(versions, range): Return the highest version in the list that satisfies the range, or null if none of them do.
  • +
  • minSatisfying(versions, range): Return the lowest version in the list +that satisfies the range, or null if none of them do.
  • gtr(version, range): Return true if version is greater than all the versions possible in the range.
  • ltr(version, range): Return true if version is less than all the @@ -302,5 +325,5 @@

    Ranges

           - + diff --git a/deps/npm/html/dochead.html b/deps/npm/html/dochead.html index e2f0e83d78ee49..26602b2b8af684 100644 --- a/deps/npm/html/dochead.html +++ b/deps/npm/html/dochead.html @@ -1,7 +1,7 @@ @NAME@ - + diff --git a/deps/npm/lib/cache/add-local.js b/deps/npm/lib/cache/add-local.js index 075ca5fc61d8de..0794b9214489c1 100644 --- a/deps/npm/lib/cache/add-local.js +++ b/deps/npm/lib/cache/add-local.js @@ -20,7 +20,7 @@ module.exports = addLocal function addLocal (p, pkgData, cb_) { assert(typeof p === 'object', 'must have spec info') - assert(typeof cb === 'function', 'must have callback') + assert(typeof cb_ === 'function', 'must have callback') pkgData = pkgData || {} @@ -91,10 +91,10 @@ function addLocalDirectory (p, pkgData, shasum, cb) { getCacheStat(function (er, cs) { mkdir(path.dirname(pj), function (er, made) { - if (er) return cb(er) + if (er) return wrapped(er) var doPrePublish = !pathIsInside(p, npm.tmp) if (doPrePublish) { - lifecycle(data, 'prepublish', p, iferr(cb, thenPack)) + lifecycle(data, 'prepublish', p, iferr(wrapped, thenPack)) } else { thenPack() } @@ -102,12 +102,15 @@ function addLocalDirectory (p, pkgData, shasum, cb) { tar.pack(tgz, p, data, function (er) { if (er) { log.error('addLocalDirectory', 'Could not pack', p, 'to', tgz) - return cb(er) + return wrapped(er) } - if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) wrapped() + if (!cs || isNaN(cs.uid) || isNaN(cs.gid)) return wrapped() - chownr(made || tgz, cs.uid, cs.gid, wrapped) + chownr(made || tgz, cs.uid, cs.gid, function (er) { + if (er && er.code === 'ENOENT') return wrapped() + wrapped(er) + }) }) } }) diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index d8f64a85be45de..0da1554f80a5a4 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -26,6 +26,7 @@ var templates = path.join(remotes, '_templates') var VALID_VARIABLES = [ 'GIT_ASKPASS', + 'GIT_EXEC_PATH', 'GIT_PROXY_COMMAND', 'GIT_SSH', 'GIT_SSH_COMMAND', diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index 7112e88c5f7d6e..0426546274e950 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -12,6 +12,7 @@ var os = require('os') var umask = require('./utils/umask') var usage = require('./utils/usage') var output = require('./utils/output') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone config.usage = usage( 'config', @@ -106,7 +107,7 @@ function edit (cb) { data, function (er) { if (er) return cb(er) - editor(f, { editor: e }, cb) + editor(f, { editor: e }, noProgressTillDone(cb)) } ) }) diff --git a/deps/npm/lib/config/cmd-list.js b/deps/npm/lib/config/cmd-list.js index 34ebeed4486cd1..d66a5722dbdc89 100644 --- a/deps/npm/lib/config/cmd-list.js +++ b/deps/npm/lib/config/cmd-list.js @@ -66,6 +66,7 @@ var cmdList = [ 'stars', 'tag', 'adduser', + 'login', // This is an alias for `adduser` but it can be confusing 'logout', 'unpublish', 'owner', diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index 155db6fd97828c..8e9bbd179709e5 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -10,6 +10,7 @@ var npm = require('./npm.js') var path = require('path') var fs = require('graceful-fs') var editor = require('editor') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone function edit (args, cb) { var p = args[0] @@ -26,9 +27,9 @@ function edit (args, cb) { var f = path.resolve(npm.dir, p) fs.lstat(f, function (er) { if (er) return cb(er) - editor(f, { editor: e }, function (er) { + editor(f, { editor: e }, noProgressTillDone(function (er) { if (er) return cb(er) npm.commands.rebuild(args, cb) - }) + })) }) } diff --git a/deps/npm/lib/fetch-package-metadata.js b/deps/npm/lib/fetch-package-metadata.js index d4f02bb2784083..85322304d5f15c 100644 --- a/deps/npm/lib/fetch-package-metadata.js +++ b/deps/npm/lib/fetch-package-metadata.js @@ -122,7 +122,15 @@ function fetchNamedPackageData (dep, next) { } function pickVersionFromRegistryDocument (pkg) { if (!regCache[url]) regCache[url] = pkg - var versions = Object.keys(pkg.versions).sort(semver.rcompare) + var versions = Object.keys(pkg.versions) + + var invalidVersions = versions.filter(function (v) { return !semver.valid(v) }) + if (invalidVersions.length > 0) { + log.warn('pickVersion', 'The package %s has invalid semver-version(s): %s. This usually only happens for unofficial private registries. ' + + 'You should delete or re-publish the invalid versions.', pkg.name, invalidVersions.join(', ')) + } + + versions = versions.filter(function (v) { return semver.valid(v) }).sort(semver.rcompare) if (dep.type === 'tag') { var tagVersion = pkg['dist-tags'][dep.spec] @@ -169,6 +177,7 @@ function fetchNamedPackageData (dep, next) { : 'No valid targets found.' var er = new Error('No compatible version found: ' + dep.raw + '\n' + targets) + er.code = 'ETARGET' return next(er) } })) diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js index a5d102c1f314f7..df5615e47632fd 100644 --- a/deps/npm/lib/init.js +++ b/deps/npm/lib/init.js @@ -6,13 +6,13 @@ var log = require('npmlog') var npm = require('./npm.js') var initJson = require('init-package-json') var output = require('./utils/output.js') +var noProgressTillDone = require('./utils/no-progress-while-running').tillDone init.usage = 'npm init [--force|-f|--yes|-y]' function init (args, cb) { var dir = process.cwd() log.pause() - log.disableProgress() var initFile = npm.config.get('init-module') if (!initJson.yes(npm.config)) { output([ @@ -28,7 +28,7 @@ function init (args, cb) { 'Press ^C at any time to quit.' ].join('\n')) } - initJson(dir, initFile, npm.config, function (er, data) { + initJson(dir, initFile, npm.config, noProgressTillDone(function (er, data) { log.resume() log.silly('package data', data) if (er && er.message === 'canceled') { @@ -37,5 +37,5 @@ function init (args, cb) { } log.info('init', 'written successfully') cb(er, data) - }) + })) } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 1fb5a4f4e6d0ab..4c3d0def78a7c1 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -1,8 +1,8 @@ 'use strict' // npm install // -// See doc/install.md for more description - +// See doc/cli/npm-install.md for more description +// // Managing contexts... // there's a lot of state associated with an "install" operation, including // packages that are already installed, parent packages, current shrinkwrap, and @@ -259,6 +259,9 @@ Installer.prototype.run = function (cb) { [this, this.debugActions, 'decomposeActions', 'todo']) if (!this.dryrun) { installSteps.push( + [this.newTracker(log, 'runTopLevelLifecycles', 2)], + [this, this.runPreinstallTopLevelLifecycles], + [this.newTracker(log, 'executeActions', 8)], [this, this.executeActions], [this, this.finishTracker, 'executeActions']) @@ -269,10 +272,9 @@ Installer.prototype.run = function (cb) { [this, this.rollbackFailedOptional, staging, this.todo], [this, this.finishTracker, 'rollbackFailedOptional'], [this, this.commit, staging, this.todo], - [this.newTracker(log, 'runTopLevelLifecycles', 2)], - [this, this.runTopLevelLifecycles], - [this, this.finishTracker, 'runTopLevelLifecycles']) + [this, this.runPostinstallTopLevelLifecycles], + [this, this.finishTracker, 'runTopLevelLifecycles']) if (getSaveType(this.args)) { postInstallSteps.push( [this, this.saveToDependencies]) @@ -289,9 +291,13 @@ Installer.prototype.run = function (cb) { self.idealTree.warnings.forEach(function (warning) { if (warning.code === 'EPACKAGEJSON' && self.global) return if (warning.code === 'ENOTDIR') return - errorMessage(warning).summary.forEach(function (logline) { + var output = errorMessage(warning) + output.summary.forEach(function (logline) { log.warn.apply(log, logline) }) + output.detail.forEach(function (logline) { + log.verbose.apply(log, logline) + }) }) } if (installEr && postInstallEr) { @@ -310,7 +316,7 @@ Installer.prototype.run = function (cb) { Installer.prototype.loadArgMetadata = function (next) { var self = this - getAllMetadata(this.args, this.currentTree, iferr(next, function (args) { + getAllMetadata(this.args, this.currentTree, process.cwd(), iferr(next, function (args) { self.args = args next() })) @@ -520,19 +526,29 @@ Installer.prototype.commit = function (staging, actionsToRun, cb) { }, cb) } -Installer.prototype.runTopLevelLifecycles = function (cb) { +Installer.prototype.runPreinstallTopLevelLifecycles = function (cb) { validate('F', arguments) if (this.failing) return cb() - log.silly('install', 'runTopLevelLifecycles') + if (!this.topLevelLifecycles) return cb() + log.silly('install', 'runPreinstallTopLevelLifecycles') + var steps = [] + var trackLifecycle = this.progress.runTopLevelLifecycles + + steps.push( + [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')] + ) + chain(steps, cb) +} + +Installer.prototype.runPostinstallTopLevelLifecycles = function (cb) { + validate('F', arguments) + if (this.failing) return cb() + if (!this.topLevelLifecycles) return cb() + log.silly('install', 'runPostinstallTopLevelLifecycles') var steps = [] var trackLifecycle = this.progress.runTopLevelLifecycles - if (!this.topLevelLifecycles) { - trackLifecycle.finish() - return cb() - } steps.push( - [doOneAction, 'preinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('preinstall:.')], [doOneAction, 'build', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('build:.')], [doOneAction, 'install', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('install:.')], [doOneAction, 'postinstall', this.idealTree.path, this.idealTree, trackLifecycle.newGroup('postinstall:.')]) @@ -591,18 +607,19 @@ Installer.prototype.readLocalPackageData = function (cb) { return cb(er) } if (!currentTree.package) currentTree.package = {} - self.loadArgMetadata(iferr(cb, function () { - if (currentTree.package._shrinkwrap) return cb() + if (currentTree.package._shrinkwrap) { + self.loadArgMetadata(cb) + } else { fs.readFile(path.join(self.where, 'npm-shrinkwrap.json'), function (er, data) { - if (er) return cb() + if (er) return self.loadArgMetadata(cb) try { currentTree.package._shrinkwrap = parseJSON(data) } catch (ex) { return cb(ex) } - return cb() + return self.loadArgMetadata(cb) }) - })) + } })) })) } diff --git a/deps/npm/lib/install/action/update-linked.js b/deps/npm/lib/install/action/update-linked.js index 46c4cdfadd1509..b37f477e17af2a 100644 --- a/deps/npm/lib/install/action/update-linked.js +++ b/deps/npm/lib/install/action/update-linked.js @@ -2,7 +2,9 @@ var path = require('path') module.exports = function (top, buildpath, pkg, log, next) { - log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, - 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + if (pkg.package.version !== pkg.oldPkg.package.version) { + log.warn('update-linked', path.relative(top, pkg.path), 'needs updating to', pkg.package.version, + 'from', pkg.oldPkg.package.version, "but we can't, as it's a symlink") + } next() } diff --git a/deps/npm/lib/install/actions.js b/deps/npm/lib/install/actions.js index 1c7462030c2a5a..7c3f97cefc82bc 100644 --- a/deps/npm/lib/install/actions.js +++ b/deps/npm/lib/install/actions.js @@ -3,13 +3,14 @@ var path = require('path') var validate = require('aproba') var chain = require('slide').chain var asyncMap = require('slide').asyncMap -var log = require('npmlog') +var iferr = require('iferr') var andFinishTracker = require('./and-finish-tracker.js') var andAddParentToErrors = require('./and-add-parent-to-errors.js') var failedDependency = require('./deps.js').failedDependency -var packageId = require('../utils/package-id.js') var moduleName = require('../utils/module-name.js') var buildPath = require('./build-path.js') +var reportOptionalFailure = require('./report-optional-failure.js') +var isInstallable = require('./validate-args.js').isInstallable var actions = {} @@ -45,7 +46,23 @@ Object.keys(actions).forEach(function (actionName) { if (!pkg.commit) pkg.commit = [] pkg.commit.push(action.commit) } - return action(top, buildpath, pkg, log, andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, next)))) + if (pkg.knownInstallable) { + return thenRunAction() + } else { + return isInstallable(pkg.package, iferr(andDone(next), andMarkInstallable(thenRunAction))) + } + function andMarkInstallable (cb) { + return function () { + pkg.knownInstallable = true + cb() + } + } + function thenRunAction () { + action(top, buildpath, pkg, log, andDone(next)) + } + function andDone (cb) { + return andFinishTracker(log, andAddParentToErrors(pkg.parent, andHandleOptionalDepErrors(pkg, cb))) + } } }) @@ -70,8 +87,7 @@ function andHandleOptionalDepErrors (pkg, next) { if (isFatal) anyFatal = true } if (anyFatal) return next.apply(null, arguments) - log.warn('install:' + packageId(pkg), er.message) - log.verbose('install:' + packageId(pkg), er.stack) + reportOptionalFailure(pkg, null, er) next() } } diff --git a/deps/npm/lib/install/deps.js b/deps/npm/lib/install/deps.js index 886e8419135767..762f3967524349 100644 --- a/deps/npm/lib/install/deps.js +++ b/deps/npm/lib/install/deps.js @@ -1,7 +1,6 @@ 'use strict' var assert = require('assert') var path = require('path') -var url = require('url') var semver = require('semver') var asyncMap = require('slide').asyncMap var chain = require('slide').chain @@ -10,6 +9,7 @@ var iferr = require('iferr') var npa = require('npm-package-arg') var validate = require('aproba') var realizePackageSpecifier = require('realize-package-specifier') +var realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier') var asap = require('asap') var dezalgo = require('dezalgo') var fetchPackageMetadata = require('../fetch-package-metadata.js') @@ -21,13 +21,16 @@ var inflateShrinkwrap = require('./inflate-shrinkwrap.js') var inflateBundled = require('./inflate-bundled.js') var andFinishTracker = require('./and-finish-tracker.js') var npm = require('../npm.js') -var flatName = require('./flatten-tree.js').flatName +var flatNameFromTree = require('./flatten-tree.js').flatNameFromTree var createChild = require('./node.js').create var resetMetadata = require('./node.js').reset var andIgnoreErrors = require('./and-ignore-errors.js') var isInstallable = require('./validate-args.js').isInstallable var packageId = require('../utils/package-id.js') var moduleName = require('../utils/module-name.js') +var isDevDep = require('./is-dev-dep.js') +var isProdDep = require('./is-prod-dep.js') +var reportOptionalFailure = require('./report-optional-failure.js') // The export functions in this module mutate a dependency tree, adding // items to them. @@ -50,16 +53,6 @@ function isDep (tree, child, cb) { }) } -function isDevDep (tree, name, cb) { - var devDeps = tree.package.devDependencies || {} - return devDeps[name] -} - -function isProdDep (tree, name, cb) { - var deps = tree.package.dependencies || {} - return deps[name] -} - var registryTypes = { range: true, version: true } function doesChildVersionMatch (child, requested, requestor) { @@ -212,26 +205,29 @@ function getShrinkwrap (tree, name) { return tree.package._shrinkwrap && tree.package._shrinkwrap.dependencies && tree.package._shrinkwrap.dependencies[name] } -exports.getAllMetadata = function (args, tree, next) { - asyncMap(args, function (spec, done) { - if (tree && spec.lastIndexOf('@') <= 0) { - var sw = getShrinkwrap(tree, spec) +exports.getAllMetadata = function (args, tree, where, next) { + asyncMap(args, function (arg, done) { + function fetchMetadataWithVersion () { + var version = matchingDep(tree, arg) + var spec = version == null ? arg : arg + '@' + version + return fetchPackageMetadata(spec, where, done) + } + if (tree && arg.lastIndexOf('@') <= 0) { + var sw = getShrinkwrap(tree, arg) if (sw) { - // FIXME: This is duplicated in inflate-shrinkwrap and should be factoed - // into a shared function - spec = sw.resolved - ? spec + '@' + sw.resolved - : (sw.from && url.parse(sw.from).protocol) - ? spec + '@' + sw.from - : spec + '@' + sw.version + return realizeShrinkwrapSpecifier(arg, sw, where, function (err, spec) { + if (err) { + return fetchMetadataWithVersion() + } else { + return fetchPackageMetadata(spec, where, done) + } + }) } else { - var version = matchingDep(tree, spec) - if (version != null) { - spec += '@' + version - } + return fetchMetadataWithVersion() } + } else { + return fetchPackageMetadata(arg, where, done) } - fetchPackageMetadata(spec, packageRelativePath(tree), done) }, next) } @@ -354,18 +350,6 @@ var failedDependency = exports.failedDependency = function (tree, name_pkg) { return false } -function top (tree) { - if (tree.parent) return top(tree.parent) - return tree -} - -function treeWarn (tree, what, error) { - var topTree = top(tree) - if (!topTree.warnings) topTree.warnings = [] - error.optional = flatNameFromTree(tree) + '/' + what - topTree.warnings.push(error) -} - function andHandleOptionalErrors (log, tree, name, done) { validate('OOSF', arguments) return function (er, child, childLog) { @@ -374,7 +358,7 @@ function andHandleOptionalErrors (log, tree, name, done) { var isFatal = failedDependency(tree, name) if (er && !isFatal) { tree.children = tree.children.filter(noModuleNameMatches(name)) - treeWarn(tree, name, er) + reportOptionalFailure(tree, name, er) return done() } else { return done(er, child, childLog) @@ -449,7 +433,9 @@ function addDependency (name, versionSpec, tree, log, done) { } })) } else { - resolveWithNewModule(req, tree, log, next) + fetchPackageMetadata(req, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { + resolveWithNewModule(pkg, tree, log, next) + })) } })) } @@ -471,14 +457,6 @@ var updatePhantomChildren = exports.updatePhantomChildren = function (current, c } } -function flatNameFromTree (tree) { - validate('O', arguments) - if (tree.isTop) return '/' - var path = flatNameFromTree(tree.parent) - if (path !== '/') path += '/' - return flatName(path, tree) -} - exports._replaceModuleByPath = replaceModuleByPath function replaceModuleByPath (obj, key, child) { return replaceModule(obj, key, child, function (replacing, child) { @@ -511,56 +489,47 @@ function replaceModule (obj, key, child, matchBy) { function resolveWithNewModule (pkg, tree, log, next) { validate('OOOF', arguments) - if (pkg.type) { - return fetchPackageMetadata(pkg, packageRelativePath(tree), log.newItem('fetchMetadata'), iferr(next, function (pkg) { - resolveWithNewModule(pkg, tree, log, next) - })) - } - - if (!pkg._installable) { - log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') - return isInstallable(pkg, iferr(next, function () { - pkg._installable = true - resolveWithNewModule(pkg, tree, log, next) - })) - } - - if (!pkg._from) { - pkg._from = pkg._requested.name + '@' + pkg._requested.spec - } - addShrinkwrap(pkg, iferr(next, function () { - addBundled(pkg, iferr(next, function () { - var parent = earliestInstallable(tree, tree, pkg) || tree - var child = createChild({ - package: pkg, - parent: parent, - path: path.join(parent.path, 'node_modules', pkg.name), - realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), - children: pkg._bundled || [], - isLink: tree.isLink - }) - delete pkg._bundled - var hasBundled = child.children.length - - var replaced = replaceModuleByName(parent, 'children', child) - if (replaced) removeObsoleteDep(replaced) - addRequiredDep(tree, child, function () { - child.location = flatNameFromTree(child) - if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) - - if (hasBundled) { - inflateBundled(child, child.children) - } - - if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { - return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { - next(er, child, log) - }) - } + log.silly('resolveWithNewModule', packageId(pkg), 'checking installable status') + return isInstallable(pkg, iferr(next, function () { + if (!pkg._from) { + pkg._from = pkg._requested.name + '@' + pkg._requested.spec + } + addShrinkwrap(pkg, iferr(next, function () { + addBundled(pkg, iferr(next, function () { + var parent = earliestInstallable(tree, tree, pkg) || tree + var child = createChild({ + package: pkg, + parent: parent, + path: path.join(parent.path, 'node_modules', pkg.name), + realpath: path.resolve(parent.realpath, 'node_modules', pkg.name), + children: pkg._bundled || [], + isLink: tree.isLink, + knownInstallable: true + }) + delete pkg._bundled + var hasBundled = child.children.length + + var replaced = replaceModuleByName(parent, 'children', child) + if (replaced) removeObsoleteDep(replaced) + addRequiredDep(tree, child, function () { + child.location = flatNameFromTree(child) + + if (tree.parent && parent !== tree) updatePhantomChildren(tree.parent, child) + + if (hasBundled) { + inflateBundled(child, child.children) + } + + if (pkg._shrinkwrap && pkg._shrinkwrap.dependencies) { + return inflateShrinkwrap(child, pkg._shrinkwrap.dependencies, function (er) { + next(er, child, log) + }) + } - next(null, child, log) - }) + next(null, child, log) + }) + })) })) })) } diff --git a/deps/npm/lib/install/flatten-tree.js b/deps/npm/lib/install/flatten-tree.js index 869685a4e8450c..b6ceb30f2fd916 100644 --- a/deps/npm/lib/install/flatten-tree.js +++ b/deps/npm/lib/install/flatten-tree.js @@ -2,7 +2,11 @@ var validate = require('aproba') var moduleName = require('../utils/module-name.js') -module.exports = function (tree) { +module.exports = flattenTree +module.exports.flatName = flatName +module.exports.flatNameFromTree = flatNameFromTree + +function flattenTree (tree) { validate('O', arguments) var seen = {} var flat = {} @@ -24,7 +28,15 @@ module.exports = function (tree) { return flat } -var flatName = module.exports.flatName = function (path, child) { +function flatName (path, child) { validate('SO', arguments) return path + (moduleName(child) || 'TOP') } + +function flatNameFromTree (tree) { + validate('O', arguments) + if (tree.isTop) return '/' + var path = flatNameFromTree(tree.parent) + if (path !== '/') path += '/' + return flatName(path, tree) +} diff --git a/deps/npm/lib/install/inflate-shrinkwrap.js b/deps/npm/lib/install/inflate-shrinkwrap.js index 1853f2c068cb93..ab1bdd1f1912f0 100644 --- a/deps/npm/lib/install/inflate-shrinkwrap.js +++ b/deps/npm/lib/install/inflate-shrinkwrap.js @@ -1,9 +1,9 @@ 'use strict' -var url = require('url') var asyncMap = require('slide').asyncMap var validate = require('aproba') var iferr = require('iferr') -var realizePackageSpecifier = require('realize-package-specifier') +var realizeShrinkwrapSpecifier = require('./realize-shrinkwrap-specifier.js') +var isRegistrySpecifier = require('./is-registry-specifier.js') var fetchPackageMetadata = require('../fetch-package-metadata.js') var annotateMetadata = require('../fetch-package-metadata.js').annotateMetadata var addShrinkwrap = require('../fetch-package-metadata.js').addShrinkwrap @@ -14,53 +14,80 @@ var createChild = require('./node.js').create var moduleName = require('../utils/module-name.js') var childPath = require('../utils/child-path.js') -var inflateShrinkwrap = module.exports = function (tree, swdeps, finishInflating) { - validate('OOF', arguments) +module.exports = function (tree, swdeps, finishInflating) { if (!npm.config.get('shrinkwrap')) return finishInflating() + return inflateShrinkwrap(tree.path, tree, swdeps, finishInflating) +} + +function inflateShrinkwrap (topPath, tree, swdeps, finishInflating) { + validate('SOOF', arguments) var onDisk = {} tree.children.forEach(function (child) { onDisk[moduleName(child)] = child }) tree.children = [] - asyncMap(Object.keys(swdeps), function (name, next) { - var sw = swdeps[name] - var spec = sw.resolved - ? name + '@' + sw.resolved - : (sw.from && url.parse(sw.from).protocol) - ? name + '@' + sw.from - : name + '@' + sw.version - var child = onDisk[name] - if (child && (child.fromShrinkwrap || - (sw.resolved && child.package._resolved === sw.resolved) || - (sw.from && url.parse(sw.from).protocol && child.package._from === sw.from) || - child.package.version === sw.version)) { - if (!child.fromShrinkwrap) child.fromShrinkwrap = spec - tree.children.push(child) + var dev = npm.config.get('dev') || (!/^prod(uction)?$/.test(npm.config.get('only')) && !npm.config.get('production')) || /^dev(elopment)?$/.test(npm.config.get('only')) + var prod = !/^dev(elopment)?$/.test(npm.config.get('only')) + return asyncMap(Object.keys(swdeps), doRealizeAndInflate, finishInflating) + + function doRealizeAndInflate (name, next) { + return realizeShrinkwrapSpecifier(name, swdeps[name], topPath, iferr(next, andInflate(name, next))) + } - return realizePackageSpecifier(spec, tree.path, iferr(next, function (requested) { - annotateMetadata(child.package, requested, spec, tree.path) - return inflateShrinkwrap(child, sw.dependencies || {}, next) - })) + function andInflate (name, next) { + return function (requested) { + var sw = swdeps[name] + var dependencies = sw.dependencies || {} + if ((!prod && !sw.dev) || (!dev && sw.dev)) return next() + var child = onDisk[name] + if (childIsEquivalent(sw, requested, child)) { + if (!child.fromShrinkwrap) child.fromShrinkwrap = requested.raw + tree.children.push(child) + annotateMetadata(child.package, requested, requested.raw, topPath) + return inflateShrinkwrap(topPath, child, dependencies || {}, next) + } else { + var from = sw.from || requested.raw + return fetchPackageMetadata(requested, topPath, iferr(next, andAddShrinkwrap(from, dependencies, next))) + } } - fetchPackageMetadata(spec, tree.path, iferr(next, function (pkg) { - pkg._from = sw.from || spec - addShrinkwrap(pkg, iferr(next, function () { - addBundled(pkg, iferr(next, function () { - var child = createChild({ - package: pkg, - loaded: false, - parent: tree, - fromShrinkwrap: spec, - path: childPath(tree.path, pkg), - realpath: childPath(tree.realpath, pkg), - children: pkg._bundled || [] - }) - tree.children.push(child) - if (pkg._bundled) { - delete pkg._bundled - inflateBundled(child, child.children) - } - inflateShrinkwrap(child, sw.dependencies || {}, next) - })) - })) - })) - }, finishInflating) + } + + function andAddShrinkwrap (from, dependencies, next) { + return function (pkg) { + pkg._from = from + addShrinkwrap(pkg, iferr(next, andAddBundled(pkg, dependencies, next))) + } + } + + function andAddBundled (pkg, dependencies, next) { + return function () { + return addBundled(pkg, iferr(next, andAddChild(pkg, dependencies, next))) + } + } + + function andAddChild (pkg, dependencies, next) { + return function () { + var child = createChild({ + package: pkg, + loaded: false, + parent: tree, + fromShrinkwrap: pkg._from, + path: childPath(tree.path, pkg), + realpath: childPath(tree.realpath, pkg), + children: pkg._bundled || [] + }) + tree.children.push(child) + if (pkg._bundled) { + delete pkg._bundled + inflateBundled(child, child.children) + } + inflateShrinkwrap(topPath, child, dependencies || {}, next) + } + } +} + +function childIsEquivalent (sw, requested, child) { + if (!child) return false + if (child.fromShrinkwrap) return true + if (sw.resolved) return child.package._resolved === sw.resolved + if (!isRegistrySpecifier(requested) && sw.from) return child.package._from === sw.from + return child.package.version === sw.version } diff --git a/deps/npm/lib/install/is-dev-dep.js b/deps/npm/lib/install/is-dev-dep.js new file mode 100644 index 00000000000000..c7a7982c5e670e --- /dev/null +++ b/deps/npm/lib/install/is-dev-dep.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = isDevDep + +function isDevDep (node, name) { + return node.package && + node.package.devDependencies && + node.package.devDependencies[name] +} diff --git a/deps/npm/lib/install/is-dev.js b/deps/npm/lib/install/is-dev.js deleted file mode 100644 index e0fae4eb82dc41..00000000000000 --- a/deps/npm/lib/install/is-dev.js +++ /dev/null @@ -1,26 +0,0 @@ -'use strict' -var moduleName = require('../utils/module-name.js') - -function andIsDev (name) { - return function (req) { - return req.package && - req.package.devDependencies && - req.package.devDependencies[name] - } -} - -exports.isDev = function (node) { - return node.requiredBy.some(andIsDev(moduleName(node))) -} - -function andIsOnlyDev (name) { - var isThisDev = andIsDev(name) - return function (req) { - return isThisDev(req) && - (!req.package.dependencies || !req.package.dependencies[name]) - } -} - -exports.isOnlyDev = function (node) { - return node.requiredBy.every(andIsOnlyDev(moduleName(node))) -} diff --git a/deps/npm/lib/install/is-opt-dep.js b/deps/npm/lib/install/is-opt-dep.js new file mode 100644 index 00000000000000..807b8ab998bf20 --- /dev/null +++ b/deps/npm/lib/install/is-opt-dep.js @@ -0,0 +1,8 @@ +'use strict' +module.exports = isOptDep + +function isOptDep (node, name) { + return node.package && + node.package.optionalDependencies && + node.package.optionalDependencies[name] +} diff --git a/deps/npm/lib/install/is-prod-dep.js b/deps/npm/lib/install/is-prod-dep.js new file mode 100644 index 00000000000000..1e2a0b4e4904cf --- /dev/null +++ b/deps/npm/lib/install/is-prod-dep.js @@ -0,0 +1,9 @@ +'use strict' + +module.exports = isProdDep + +function isProdDep (node, name) { + return node.package && + node.package.dependencies && + node.package.dependencies[name] +} diff --git a/deps/npm/lib/install/is-registry-specifier.js b/deps/npm/lib/install/is-registry-specifier.js new file mode 100644 index 00000000000000..606be2bd1319d1 --- /dev/null +++ b/deps/npm/lib/install/is-registry-specifier.js @@ -0,0 +1,6 @@ +'use strict' +module.exports = isRegistrySpecifier + +function isRegistrySpecifier (spec) { + return spec.type === 'range' || spec.type === 'version' || spec.type === 'tag' +} diff --git a/deps/npm/lib/install/realize-shrinkwrap-specifier.js b/deps/npm/lib/install/realize-shrinkwrap-specifier.js new file mode 100644 index 00000000000000..0c491a60289b4b --- /dev/null +++ b/deps/npm/lib/install/realize-shrinkwrap-specifier.js @@ -0,0 +1,25 @@ +'use strict' +var realizePackageSpecifier = require('realize-package-specifier') +var isRegistrySpecifier = require('./is-registry-specifier.js') + +module.exports = function (name, sw, where, cb) { + function lookup (ver, cb) { + realizePackageSpecifier(name + '@' + ver, where, cb) + } + if (sw.resolved) { + return lookup(sw.resolved, cb) + } else if (sw.from) { + return lookup(sw.from, function (err, spec) { + if (err || isRegistrySpecifier(spec)) { + return thenUseVersion() + } else { + return cb(null, spec) + } + }) + } else { + return thenUseVersion() + } + function thenUseVersion () { + lookup(sw.version, cb) + } +} diff --git a/deps/npm/lib/install/report-optional-failure.js b/deps/npm/lib/install/report-optional-failure.js new file mode 100644 index 00000000000000..41c7c535bdd63b --- /dev/null +++ b/deps/npm/lib/install/report-optional-failure.js @@ -0,0 +1,31 @@ +'use strict' +var path = require('path') +var moduleName = require('../utils/module-name.js') + +module.exports = reportOptionalFailure + +function top (tree) { + if (tree.parent) return top(tree.parent) + return tree +} + +function reportOptionalFailure (tree, what, error) { + var topTree = top(tree) + if (!topTree.warnings) topTree.warnings = [] + var id + if (what) { + var depVer = tree.package.dependencies && tree.package.dependencies[what] + var optDepVer = tree.package.optionalDependencies && tree.package.optionalDependencies[what] + var devDepVer = tree.package.devDependencies && tree.package.devDependencies[what] + var version = depVer || optDepVer || devDepVer + id = what + (version ? '@' + version : '') + } else { + id = tree._id || moduleName(tree) + (tree.package.version ? '@' + tree.package.version : '') + } + var location = path.relative(topTree.path, tree.path) + if (what) location = path.join(location, 'node_modules', what) + + error.optional = id + error.location = location + topTree.warnings.push(error) +} diff --git a/deps/npm/lib/install/save.js b/deps/npm/lib/install/save.js index 708da61c8a9488..d5c97bfaa26f4e 100644 --- a/deps/npm/lib/install/save.js +++ b/deps/npm/lib/install/save.js @@ -12,7 +12,8 @@ var npm = require('../npm.js') var deepSortObject = require('../utils/deep-sort-object.js') var parseJSON = require('../utils/parse-json.js') var moduleName = require('../utils/module-name.js') -var isOnlyDev = require('./is-dev.js').isOnlyDev +var isDevDep = require('./is-dev-dep.js') +var createShrinkwrap = require('../shrinkwrap.js').createShrinkwrap // if the -S|--save option is specified, then write installed packages // as dependencies to a package.json file. @@ -49,25 +50,17 @@ function saveShrinkwrap (tree, next) { var saveOptional = npm.config.get('save-optional') var shrinkwrap = tree.package._shrinkwrap || {dependencies: {}} - var hasDevOnlyDeps = tree.requires.filter(function (dep) { - return isOnlyDev(dep) - }).some(function (dep) { - return shrinkwrap.dependencies[dep.package.name] != null + var shrinkwrapHasAnyDevOnlyDeps = tree.requires.some(function (dep) { + var name = moduleName(dep) + return isDevDep(tree, name) && + shrinkwrap.dependencies[name] != null }) - if (!saveOptional && saveDev && !hasDevOnlyDeps) return next() - if (saveOptional || !save) return next() + if (!saveOptional && saveDev && !shrinkwrapHasAnyDevOnlyDeps) return next() + if (saveOptional || !(save || saveDev)) return next() - if (hasDevOnlyDeps) { - var dev = npm.config.get('dev') - npm.config.set('dev', true) - npm.commands.shrinkwrap([], true, function () { - npm.config.set('dev', dev) - next.apply(this, arguments) - }) - } else { - npm.commands.shrinkwrap([], true, next) - } + var silent = false + createShrinkwrap(tree.path, tree.package, shrinkwrapHasAnyDevOnlyDeps, silent, next) }) } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index c6a41842fcc4b2..02481a235e64c3 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -15,11 +15,13 @@ var npm = require('./npm.js') var recalculateMetadata = require('./install/deps.js').recalculateMetadata var validatePeerDeps = require('./install/deps.js').validatePeerDeps var isExtraneous = require('./install/is-extraneous.js') -var isOnlyDev = require('./install/is-dev.js').isOnlyDev var packageId = require('./utils/package-id.js') var moduleName = require('./utils/module-name.js') var output = require('./utils/output.js') var lifecycle = require('./utils/lifecycle.js') +var isDevDep = require('./install/is-dev-dep.js') +var isProdDep = require('./install/is-prod-dep.js') +var isOptDep = require('./install/is-opt-dep.js') shrinkwrap.usage = 'npm shrinkwrap' @@ -35,25 +37,31 @@ function shrinkwrap (args, silent, cb) { var dir = path.resolve(npm.dir, '..') var packagePath = path.join(npm.localPrefix, 'package.json') - npm.config.set('production', true) - - readPackageJson(packagePath, iferr(cb, function (data) { - lifecycle(data, 'preshrinkwrap', function () { - readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { - var pkginfo = treeToShrinkwrap(tree, !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also'))) - - chain([ - [lifecycle, tree.package, 'shrinkwrap'], - [shrinkwrap_, pkginfo, silent], - [lifecycle, tree.package, 'postshrinkwrap'] - ], iferr(cb, function (data) { - cb(null, data[0]) - })) - }))) - }) + var dev = !!npm.config.get('dev') || /^dev(elopment)?$/.test(npm.config.get('also')) + + readPackageJson(packagePath, iferr(cb, function (pkg) { + createShrinkwrap(dir, pkg, dev, silent, cb) })) } +module.exports.createShrinkwrap = createShrinkwrap + +function createShrinkwrap (dir, pkg, dev, silent, cb) { + lifecycle(pkg, 'preshrinkwrap', function () { + readPackageTree(dir, andRecalculateMetadata(iferr(cb, function (tree) { + var pkginfo = treeToShrinkwrap(tree, dev) + + chain([ + [lifecycle, tree.package, 'shrinkwrap'], + [shrinkwrap_, pkginfo, silent], + [lifecycle, tree.package, 'postshrinkwrap'] + ], iferr(cb, function (data) { + cb(null, data[0]) + })) + }))) + }) +} + function andRecalculateMetadata (next) { validate('F', arguments) return function (er, tree) { @@ -92,14 +100,17 @@ function shrinkwrapDeps (dev, problems, deps, tree, seen) { } }) tree.children.sort(function (aa, bb) { return moduleName(aa).localeCompare(moduleName(bb)) }).forEach(function (child) { - if (!dev && isOnlyDev(child)) { - log.warn('shrinkwrap', 'Excluding devDependency: %s', packageId(child), child.parent.package.dependencies) + var childIsOnlyDev = isOnlyDev(child) + if (!dev && childIsOnlyDev) { + log.warn('shrinkwrap', 'Excluding devDependency: %s', child.location) return } var pkginfo = deps[moduleName(child)] = {} pkginfo.version = child.package.version pkginfo.from = child.package._from pkginfo.resolved = child.package._resolved + if (dev && childIsOnlyDev) pkginfo.dev = true + if (isOptional(child)) pkginfo.optional = true if (isExtraneous(child)) { problems.push('extraneous: ' + child.package._id + ' ' + child.path) } @@ -143,3 +154,46 @@ function save (pkginfo, silent, cb) { cb(null, pkginfo) }) } + +// Returns true if the module `node` is only required direcctly as a dev +// dependency of the top level or transitively _from_ top level dev +// dependencies. +// Dual mode modules (that are both dev AND prod) should return false. +function isOnlyDev (node, seen) { + if (!seen) seen = {} + return node.requiredBy.length && node.requiredBy.every(andIsOnlyDev(moduleName(node), seen)) +} + +// There is a known limitation with this implementation: If a dependency is +// ONLY required by cycles that are detached from the top level then it will +// ultimately return ture. +// +// This is ok though: We don't allow shrinkwraps with extraneous deps and +// these situation is caught by the extraneous checker before we get here. +function andIsOnlyDev (name, seen) { + return function (req) { + var isDev = isDevDep(req, name) + var isProd = isProdDep(req, name) + if (req.isTop) { + return isDev && !isProd + } else { + if (seen[req.path]) return true + seen[req.path] = true + return isOnlyDev(req, seen) + } + } +} + +function isOptional (node, seen) { + if (!seen) seen = {} + // If a node is not required by anything, then we've reached + // the top level package. + if (seen[node.path] || node.requiredBy.length === 0) { + return false + } + seen[node.path] = true + + return node.requiredBy.every(function (req) { + return isOptDep(req, node.package.name) || isOptional(req, seen) + }) +} diff --git a/deps/npm/lib/utils/correct-mkdir.js b/deps/npm/lib/utils/correct-mkdir.js index c0a31bdc58a10a..68c4a4ad79ae2e 100644 --- a/deps/npm/lib/utils/correct-mkdir.js +++ b/deps/npm/lib/utils/correct-mkdir.js @@ -43,8 +43,13 @@ function calculateOwner () { if (!effectiveOwner) { effectiveOwner = { uid: 0, gid: 0 } - if (process.getuid) effectiveOwner.uid = +process.getuid() - if (process.getgid) effectiveOwner.gid = +process.getgid() + // Pretty much only on windows + if (!process.getuid) { + return effectiveOwner + } + + effectiveOwner.uid = +process.getuid() + effectiveOwner.gid = +process.getgid() if (effectiveOwner.uid === 0) { if (process.env.SUDO_UID) effectiveOwner.uid = +process.env.SUDO_UID @@ -112,6 +117,7 @@ function makeDirectory (path, cb) { function setPermissions (path, st, cb) { chownr(path, st.uid, st.gid, function (er) { + if (er && er.code === 'ENOENT') return cb(null, st) return cb(er, st) }) } diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js index fca92ee4cb5358..5c7ce15bf1b578 100644 --- a/deps/npm/lib/utils/error-message.js +++ b/deps/npm/lib/utils/error-message.js @@ -8,9 +8,6 @@ module.exports = errorMessage function errorMessage (er) { var short = [] var detail = [] - if (er.optional) { - short.push(['optional', 'Skipping failed optional dependency ' + er.optional + ':']) - } switch (er.code) { case 'ECONNREFUSED': short.push(['', er]) @@ -150,17 +147,21 @@ function errorMessage (er) { break case 'EBADPLATFORM': + var validOs = er.os.join ? er.os.join(',') : er.os + var validArch = er.cpu.join ? er.cpu.join(',') : er.cpu + var expected = {os: validOs, arch: validArch} + var actual = {os: process.platform, arch: process.arch} short.push([ 'notsup', [ - 'Not compatible with your operating system or architecture: ' + er.pkgid + util.format('Unsupported platform for %s: wanted %j (current: %j)', er.pkgid, expected, actual) ].join('\n') ]) detail.push([ 'notsup', [ - 'Valid OS: ' + (er.os.join ? er.os.join(',') : util.inspect(er.os)), - 'Valid Arch: ' + (er.cpu.join ? er.cpu.join(',') : util.inspect(er.cpu)), + 'Valid OS: ' + validOs, + 'Valid Arch: ' + validArch, 'Actual OS: ' + process.platform, 'Actual Arch: ' + process.arch ].join('\n') @@ -284,7 +285,7 @@ function errorMessage (er) { 'typeerror', [ 'This is an error with npm itself. Please report this error at:', - ' ' + ' ' ].join('\n') ]) break @@ -313,5 +314,12 @@ function errorMessage (er) { ]) break } + if (er.optional) { + short.unshift(['optional', er.optional + ' (' + er.location + '):']) + short.concat(detail).forEach(function (msg) { + if (!msg[0]) msg[0] = 'optional' + if (msg[1]) msg[1] = msg[1].toString().replace(/(^|\n)/g, '$1SKIPPING OPTIONAL DEPENDENCY: ') + }) + } return {summary: short, detail: detail} } diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js index 6a862366f28374..adf534d8824256 100644 --- a/deps/npm/lib/utils/lifecycle.js +++ b/deps/npm/lib/utils/lifecycle.js @@ -15,6 +15,7 @@ var uidNumber = require('uid-number') var umask = require('./umask') var usage = require('./usage') var output = require('./output.js') +var which = require('which') // windows calls it's path 'Path' usually, but this is not guaranteed. if (process.platform === 'win32') { @@ -88,7 +89,7 @@ function _incorrectWorkingDirectory (wd, pkg) { function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { var pathArr = [] - var p = wd.split('node_modules') + var p = wd.split(/[\\\/]node_modules[\\\/]/) var acc = path.resolve(p.shift()) p.forEach(function (pp) { @@ -101,8 +102,10 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { // the bundled one will be used for installing things. pathArr.unshift(path.join(__dirname, '..', '..', 'bin', 'node-gyp-bin')) - // prefer current node interpreter in child scripts - pathArr.push(path.dirname(process.execPath)) + if (shouldPrependCurrentNodeDirToPATH()) { + // prefer current node interpreter in child scripts + pathArr.push(path.dirname(process.execPath)) + } if (env[PATH]) pathArr.push(env[PATH]) env[PATH] = pathArr.join(process.platform === 'win32' ? ';' : ':') @@ -138,6 +141,16 @@ function lifecycle_ (pkg, stage, wd, env, unsafe, failOk, cb) { ) } +function shouldPrependCurrentNodeDirToPATH () { + var isWindows = process.platform === 'win32' + try { + var foundExecPath = which.sync(path.basename(process.execPath), {pathExt: isWindows ? ';' : ':'}) + return process.execPath.toUpperCase() !== foundExecPath.toUpperCase() + } catch (e) { + return true + } +} + function validWd (d, cb) { fs.stat(d, function (er, st) { if (er || !st.isDirectory()) { diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js index 1e00040dbb12e2..f580c8e05dee2f 100644 --- a/deps/npm/lib/utils/tar.js +++ b/deps/npm/lib/utils/tar.js @@ -102,7 +102,8 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { entry === '.npmrc' || entry.match(/^\..*\.swp$/) || entry === '.DS_Store' || - entry.match(/^\._/) + entry.match(/^\._/) || + entry.match(/^.*\.orig$/) ) { return false } @@ -117,7 +118,17 @@ BundledPacker.prototype.applyIgnores = function (entry, partial, entryObj) { // if they're not already present at a higher level. if (this.bundleMagic) { // bubbling up. stop here and allow anything the bundled pkg allows - if (entry.indexOf('/') !== -1) return true + if (entry.charAt(0) === '@') { + var firstSlash = entry.indexOf('/') + // continue to list the packages in this scope + if (firstSlash === -1) return true + + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/', firstSlash + 1) !== -1) return true + // bubbling up. stop here and allow anything the bundled pkg allows + } else if (entry.indexOf('/') !== -1) { + return true + } // never include the .bin. It's typically full of platform-specific // stuff like symlinks and .cmd files anyway. diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index ee683f3faa33e3..cc29b0d5dbfa31 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2016" "" "" +.TH "NPM" "1" "September 2016" "" "" .SH "NAME" \fBnpm\fR \- a JavaScript package manager .P @@ -10,7 +10,7 @@ This is just enough info to get you up and running\. Much more info available via \fBnpm help\fP once it's installed\. .SH IMPORTANT .P -\fBYou need node v0\.8 or higher to run this program\.\fR +\fBYou need node v0\.10 or higher to run this program\.\fR .P To install an old \fBand unsupported\fR version of npm that works on node 0\.3 and prior, clone the git repo and dig through the old tags and branches\. diff --git a/deps/npm/man/man1/npm-access.1 b/deps/npm/man/man1/npm-access.1 index b286750f75738a..bbe984114b9889 100644 --- a/deps/npm/man/man1/npm-access.1 +++ b/deps/npm/man/man1/npm-access.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ACCESS" "1" "July 2016" "" "" +.TH "NPM\-ACCESS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-access\fR \- Set access level on published packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index d5ab3388dbade7..f4d1791135d12b 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ADDUSER" "1" "July 2016" "" "" +.TH "NPM\-ADDUSER" "1" "September 2016" "" "" .SH "NAME" \fBnpm-adduser\fR \- Add a registry user account .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 79c96247b3c36e..1677875ccac8cf 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BIN" "1" "July 2016" "" "" +.TH "NPM\-BIN" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bin\fR \- Display npm bin folder .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 6ff470e37d230d..b7fa194c5ab686 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUGS" "1" "July 2016" "" "" +.TH "NPM\-BUGS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bugs\fR \- Bugs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index 7ff15443520619..b19ccdcb1536b5 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUILD" "1" "July 2016" "" "" +.TH "NPM\-BUILD" "1" "September 2016" "" "" .SH "NAME" \fBnpm-build\fR \- Build a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index a5a155afef5a86..a7e5074c9f3729 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,4 +1,4 @@ -.TH "NPM\-BUNDLE" "1" "July 2016" "" "" +.TH "NPM\-BUNDLE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-bundle\fR \- REMOVED .SH DESCRIPTION diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index d398aec675d311..dde845e55c1459 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CACHE" "1" "July 2016" "" "" +.TH "NPM\-CACHE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-cache\fR \- Manipulates packages cache .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 921bdffa3d2548..8deed99426fa4c 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,4 +1,4 @@ -.TH "NPM\-COMPLETION" "1" "July 2016" "" "" +.TH "NPM\-COMPLETION" "1" "September 2016" "" "" .SH "NAME" \fBnpm-completion\fR \- Tab Completion for npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index 42ac398922f68e..656e5c9edcba96 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "1" "July 2016" "" "" +.TH "NPM\-CONFIG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-config\fR \- Manage the npm configuration files .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index ff30caa4f06f99..d87889b98a303f 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEDUPE" "1" "July 2016" "" "" +.TH "NPM\-DEDUPE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-dedupe\fR \- Reduce duplication .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 14804f667f2a1f..aba4ad4264fa66 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DEPRECATE" "1" "July 2016" "" "" +.TH "NPM\-DEPRECATE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-deprecate\fR \- Deprecate a version of a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-dist-tag.1 b/deps/npm/man/man1/npm-dist-tag.1 index 1e76f9ddb90afb..d74a64cf7f11e3 100644 --- a/deps/npm/man/man1/npm-dist-tag.1 +++ b/deps/npm/man/man1/npm-dist-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DIST\-TAG" "1" "July 2016" "" "" +.TH "NPM\-DIST\-TAG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-dist-tag\fR \- Modify package distribution tags .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index f48035491d9a71..4a3656347ba3bc 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,4 +1,4 @@ -.TH "NPM\-DOCS" "1" "July 2016" "" "" +.TH "NPM\-DOCS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-docs\fR \- Docs for a package in a web browser maybe .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index 7d021c379bc2ab..7088e2740a9ee0 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EDIT" "1" "July 2016" "" "" +.TH "NPM\-EDIT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-edit\fR \- Edit an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index c903dbc6c10ec8..bdfb4799d2422e 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,4 +1,4 @@ -.TH "NPM\-EXPLORE" "1" "July 2016" "" "" +.TH "NPM\-EXPLORE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-explore\fR \- Browse an installed package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index 5051b9f15f7e38..23e3b82fe97dd8 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP\-SEARCH" "1" "July 2016" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-help-search\fR \- Search npm help documentation .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 4f7c51b05552c8..32d40841d1c1f8 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,4 +1,4 @@ -.TH "NPM\-HELP" "1" "July 2016" "" "" +.TH "NPM\-HELP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-help\fR \- Get help on npm .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 5bf262a91cd1d8..5c6c86a6b225bb 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INIT" "1" "July 2016" "" "" +.TH "NPM\-INIT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-init\fR \- Interactively create a package\.json file .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-install-test.1 b/deps/npm/man/man1/npm-install-test.1 index 00edb05ef5241b..c4d388164eb9fd 100644 --- a/deps/npm/man/man1/npm-install-test.1 +++ b/deps/npm/man/man1/npm-install-test.1 @@ -1,4 +1,4 @@ -.TH "NPM" "" "July 2016" "" "" +.TH "NPM" "" "September 2016" "" "" .SH "NAME" \fBnpm\fR .SH SYNOPSIS @@ -30,3 +30,4 @@ npm help install npm help test .RE + diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index abb1cee2cb6cc2..bd1060976db464 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,4 +1,4 @@ -.TH "NPM\-INSTALL" "1" "July 2016" "" "" +.TH "NPM\-INSTALL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-install\fR \- Install a package .SH SYNOPSIS @@ -209,6 +209,8 @@ fetch the package by name if it is not valid\. .IP \(bu 2 \fBGIT_ASKPASS\fP .IP \(bu 2 +\fBGIT_EXEC_PATH\fP +.IP \(bu 2 \fBGIT_PROXY_COMMAND\fP .IP \(bu 2 \fBGIT_SSH\fP @@ -320,7 +322,7 @@ global \fBnode_modules\fP folder\. Only your direct dependencies will show in \fBnode_modules\fP and everything they depend on will be flattened in their \fBnode_modules\fP folders\. This obviously will eliminate some deduping\. .P -The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any +The \fB\-\-ignore\-scripts\fP argument will cause npm to not execute any scripts defined in the package\.json\. See npm help 7 \fBnpm\-scripts\fP\|\. .P The \fB\-\-legacy\-bundling\fP argument will cause npm to install the package such diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index 39ef63626b3337..987972f594caa0 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LINK" "1" "July 2016" "" "" +.TH "NPM\-LINK" "1" "September 2016" "" "" .SH "NAME" \fBnpm-link\fR \- Symlink a package folder .SH SYNOPSIS @@ -17,7 +17,8 @@ Package linking is a two\-step process\. .P First, \fBnpm link\fP in a package folder will create a symlink in the global folder \fB{prefix}/lib/node_modules/\fP that links to the package where the \fBnpm -link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. +link\fP command was executed\. (see npm help 7 \fBnpm\-config\fP for the value of \fBprefix\fP)\. It +will also link any bins in the package to \fB{prefix}/bin/{name}\fP\|\. .P Next, in some other location, \fBnpm link package\-name\fP will create a symbolic link from globally\-installed \fBpackage\-name\fP to \fBnode_modules/\fP diff --git a/deps/npm/man/man1/npm-logout.1 b/deps/npm/man/man1/npm-logout.1 index 58bafbe8a8e93c..e8ab7c817f80e9 100644 --- a/deps/npm/man/man1/npm-logout.1 +++ b/deps/npm/man/man1/npm-logout.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LOGOUT" "1" "July 2016" "" "" +.TH "NPM\-LOGOUT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-logout\fR \- Log out of the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index b3c4b9ea0ed57c..31ce8100fec718 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,4 +1,4 @@ -.TH "NPM\-LS" "1" "July 2016" "" "" +.TH "NPM\-LS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-ls\fR \- List installed packages .SH SYNOPSIS @@ -22,7 +22,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show: .P .RS 2 .nf -npm@3.10.3 /path/to/npm +npm@3.10.8 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 .fi diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index 4f1a781707fdfc..f56632ca929fef 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OUTDATED" "1" "July 2016" "" "" +.TH "NPM\-OUTDATED" "1" "September 2016" "" "" .SH "NAME" \fBnpm-outdated\fR \- Check for outdated packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index fe78681ef0b19d..f64765ca0552c3 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,4 +1,4 @@ -.TH "NPM\-OWNER" "1" "July 2016" "" "" +.TH "NPM\-OWNER" "1" "September 2016" "" "" .SH "NAME" \fBnpm-owner\fR \- Manage package owners .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 7926b837be1bfc..b29aec3507bbb1 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PACK" "1" "July 2016" "" "" +.TH "NPM\-PACK" "1" "September 2016" "" "" .SH "NAME" \fBnpm-pack\fR \- Create a tarball from a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-ping.1 b/deps/npm/man/man1/npm-ping.1 index 737d3589ff5975..23e50b97cbc17d 100644 --- a/deps/npm/man/man1/npm-ping.1 +++ b/deps/npm/man/man1/npm-ping.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PING" "1" "July 2016" "" "" +.TH "NPM\-PING" "1" "September 2016" "" "" .SH "NAME" \fBnpm-ping\fR \- Ping npm registry .SH SYNOPSIS @@ -21,3 +21,4 @@ npm help 7 config npm help 5 npmrc .RE + diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index fb11988956d9f4..2fd5b3b278bc84 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PREFIX" "1" "July 2016" "" "" +.TH "NPM\-PREFIX" "1" "September 2016" "" "" .SH "NAME" \fBnpm-prefix\fR \- Display prefix .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index b6e3c5afd53cfb..da997ea619e8c9 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PRUNE" "1" "July 2016" "" "" +.TH "NPM\-PRUNE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-prune\fR \- Remove extraneous packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index b103bb726e8c75..71fb371c2c6c03 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-PUBLISH" "1" "July 2016" "" "" +.TH "NPM\-PUBLISH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-publish\fR \- Publish a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 93ae08be090cf7..e0331cffc1f8b2 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REBUILD" "1" "July 2016" "" "" +.TH "NPM\-REBUILD" "1" "September 2016" "" "" .SH "NAME" \fBnpm-rebuild\fR \- Rebuild a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 406e0973290793..cad707c716fa39 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,4 +1,4 @@ -.TH "NPM\-REPO" "1" "July 2016" "" "" +.TH "NPM\-REPO" "1" "September 2016" "" "" .SH "NAME" \fBnpm-repo\fR \- Open package repository page in the browser .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index d47e17f6474f31..921a9773e4b91e 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RESTART" "1" "July 2016" "" "" +.TH "NPM\-RESTART" "1" "September 2016" "" "" .SH "NAME" \fBnpm-restart\fR \- Restart a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 27f85d634b2599..3ec8c8304e899c 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,4 +1,4 @@ -.TH "NPM\-ROOT" "1" "July 2016" "" "" +.TH "NPM\-ROOT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-root\fR \- Display npm root .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index 01381138a8e2bd..b76c7a15d46475 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,4 +1,4 @@ -.TH "NPM\-RUN\-SCRIPT" "1" "July 2016" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "September 2016" "" "" .SH "NAME" \fBnpm-run-script\fR \- Run arbitrary package scripts .SH SYNOPSIS @@ -52,8 +52,8 @@ you should write: instead of \fB"scripts": {"test": "node_modules/\.bin/tap test/\\*\.js"}\fP to run your tests\. .P \fBnpm run\fP sets the \fBNODE\fP environment variable to the \fBnode\fP executable with -which \fBnpm\fP is executed, and adds the directory within which it resides to the -\fBPATH\fP, too\. +which \fBnpm\fP is executed\. Also, the directory within which it resides is added to the +\fBPATH\fP, if the \fBnode\fP executable is not in the \fBPATH\fP\|\. .P If you try to run a script without having a \fBnode_modules\fP directory and it fails, you will be given a warning to run \fBnpm install\fP, just in case you've forgotten\. diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index ee9b07cfe014ab..250cdc78c95daf 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SEARCH" "1" "July 2016" "" "" +.TH "NPM\-SEARCH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-search\fR \- Search for packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 3242ee6aff2892..9d8b2b36cc7fd0 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,4 +1,4 @@ -.TH "NPM\-SHRINKWRAP" "1" "July 2016" "" "" +.TH "NPM\-SHRINKWRAP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-shrinkwrap\fR \- Lock down dependency versions .SH SYNOPSIS @@ -179,11 +179,11 @@ To add or update a dependency in a shrinkwrapped package: Run \fBnpm install\fP in the package root to install the current versions of all dependencies\. .IP 2. 3 -Add or update dependencies\. \fBnpm install \-\-save\fP each new or updated -package individually to update the \fBpackage\.json\fP and the shrinkwrap\. -Note that they must be explicitly named in order to be installed: running -\fBnpm install\fP with no arguments will merely reproduce the existing -shrinkwrap\. +Add or update dependencies\. \fBnpm install \-\-save\fP or \fBnpm install \-\-save\-dev\fP +each new or updated package individually to update the \fBpackage\.json\fP and +the shrinkwrap\. Note that they must be explicitly named in order to be +installed: running \fBnpm install\fP with no arguments will merely reproduce +the existing shrinkwrap\. .IP 3. 3 Validate that the package works as expected with the new dependencies\. diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index ded49f816ca109..47f8072de3e89f 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STAR" "1" "July 2016" "" "" +.TH "NPM\-STAR" "1" "September 2016" "" "" .SH "NAME" \fBnpm-star\fR \- Mark your favorite packages .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 86bcc451c45614..fbc77313989a93 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STARS" "1" "July 2016" "" "" +.TH "NPM\-STARS" "1" "September 2016" "" "" .SH "NAME" \fBnpm-stars\fR \- View packages marked as favorites .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index 096c072065f3bb..59b1a8c8046b9a 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,4 +1,4 @@ -.TH "NPM\-START" "1" "July 2016" "" "" +.TH "NPM\-START" "1" "September 2016" "" "" .SH "NAME" \fBnpm-start\fR \- Start a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index b00d2033ce9fc2..3d99a839b95411 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,4 +1,4 @@ -.TH "NPM\-STOP" "1" "July 2016" "" "" +.TH "NPM\-STOP" "1" "September 2016" "" "" .SH "NAME" \fBnpm-stop\fR \- Stop a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index bb94a873fe50fb..7f5135db7ad9b4 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TAG" "1" "July 2016" "" "" +.TH "NPM\-TAG" "1" "September 2016" "" "" .SH "NAME" \fBnpm-tag\fR \- Tag a published version .SH SYNOPSIS @@ -72,7 +72,7 @@ npm help config .IP \(bu 2 npm help 7 config .IP \(bu 2 -npm apihelp tag +npm help dist\-tag .IP \(bu 2 npm help 5 npmrc diff --git a/deps/npm/man/man1/npm-team.1 b/deps/npm/man/man1/npm-team.1 index b3344ffc59765c..f90a4fbba367b1 100644 --- a/deps/npm/man/man1/npm-team.1 +++ b/deps/npm/man/man1/npm-team.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEAM" "1" "July 2016" "" "" +.TH "NPM\-TEAM" "1" "September 2016" "" "" .SH "NAME" \fBnpm-team\fR \- Manage organization teams and team memberships .SH SYNOPSIS @@ -61,3 +61,4 @@ npm help access npm help 7 registry .RE + diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 2635d70ebe7773..52062560844785 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,4 +1,4 @@ -.TH "NPM\-TEST" "1" "July 2016" "" "" +.TH "NPM\-TEST" "1" "September 2016" "" "" .SH "NAME" \fBnpm-test\fR \- Test a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 0bb84146302271..c5fabeeccb34b3 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNINSTALL" "1" "July 2016" "" "" +.TH "NPM\-UNINSTALL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-uninstall\fR \- Remove a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 159ab628a78d4b..91dcc58ca3d7a2 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UNPUBLISH" "1" "July 2016" "" "" +.TH "NPM\-UNPUBLISH" "1" "September 2016" "" "" .SH "NAME" \fBnpm-unpublish\fR \- Remove a package from the registry .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index 9f8a77b3ec495f..01d9f96074a8fe 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,4 +1,4 @@ -.TH "NPM\-UPDATE" "1" "July 2016" "" "" +.TH "NPM\-UPDATE" "1" "September 2016" "" "" .SH "NAME" \fBnpm-update\fR \- Update a package .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 7e942b16ea348b..93a97e650088f8 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VERSION" "1" "July 2016" "" "" +.TH "NPM\-VERSION" "1" "September 2016" "" "" .SH "NAME" \fBnpm-version\fR \- Bump a package version .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index cc25f085a3e97d..43dd0a7dac9df0 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,4 +1,4 @@ -.TH "NPM\-VIEW" "1" "July 2016" "" "" +.TH "NPM\-VIEW" "1" "September 2016" "" "" .SH "NAME" \fBnpm-view\fR \- View registry info .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index e0cf8bb9a0ed22..4b6a1eb042886d 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,4 +1,4 @@ -.TH "NPM\-WHOAMI" "1" "July 2016" "" "" +.TH "NPM\-WHOAMI" "1" "September 2016" "" "" .SH "NAME" \fBnpm-whoami\fR \- Display npm username .SH SYNOPSIS diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index a48effc9ba8a62..de1e602bb695d8 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,4 +1,4 @@ -.TH "NPM" "1" "July 2016" "" "" +.TH "NPM" "1" "September 2016" "" "" .SH "NAME" \fBnpm\fR \- javascript package manager .SH SYNOPSIS @@ -10,7 +10,7 @@ npm [args] .RE .SH VERSION .P -3.10.3 +3.10.8 .SH DESCRIPTION .P npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 6a5c69676f89e0..d92cbc2d58b693 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "July 2016" "" "" +.TH "NPM\-FOLDERS" "5" "September 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index 6a5c69676f89e0..d92cbc2d58b693 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,4 +1,4 @@ -.TH "NPM\-FOLDERS" "5" "July 2016" "" "" +.TH "NPM\-FOLDERS" "5" "September 2016" "" "" .SH "NAME" \fBnpm-folders\fR \- Folder Structures Used by npm .SH DESCRIPTION diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 6f9dc9dc467a59..fab44f3b50bec4 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "July 2016" "" "" +.TH "PACKAGE\.JSON" "5" "September 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -263,6 +263,8 @@ Conversely, some files are always ignored: \fBnode_modules\fP .IP \(bu 2 \fBconfig\.gypi\fP +.IP \(bu 2 +\fB*\.orig\fP .RE .SH main @@ -317,6 +319,10 @@ would be the same as this: , "bin" : { "my\-program" : "\./path/to/program" } } .fi .RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! .SH man .P Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index 3bcab8e76b1f14..2d1e9daa224e84 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,4 +1,4 @@ -.TH "NPMRC" "5" "July 2016" "" "" +.TH "NPMRC" "5" "September 2016" "" "" .SH "NAME" \fBnpmrc\fR \- The npm config files .SH DESCRIPTION @@ -53,6 +53,19 @@ key[] = "second value" sensitive credentials, they must be readable and writable \fIonly\fR by your user account (i\.e\. must have a mode of \fB0600\fP), otherwise they \fIwill be ignored by npm!\fR +.SS Comments +.P +Lines in \fB\|\.npmrc\fP files are interpreted as comments when they begin with a \fB;\fP or \fB#\fP character\. \fB\|\.npmrc\fP files are parsed by npm/ini \fIhttps://github\.com/npm/ini\fR, which specifies this comment syntax\. +.P +For example: +.P +.RS 2 +.nf +# last modified: 01 Jan 2016 +; Set a new registry for a scoped package +@myscope:registry=https://mycustomregistry\.example\.org +.fi +.RE .SS Per\-project config file .P When working locally in a project, a \fB\|\.npmrc\fP file in the root of the diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 6f9dc9dc467a59..fab44f3b50bec4 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,4 +1,4 @@ -.TH "PACKAGE\.JSON" "5" "July 2016" "" "" +.TH "PACKAGE\.JSON" "5" "September 2016" "" "" .SH "NAME" \fBpackage.json\fR \- Specifics of npm's package\.json handling .SH DESCRIPTION @@ -263,6 +263,8 @@ Conversely, some files are always ignored: \fBnode_modules\fP .IP \(bu 2 \fBconfig\.gypi\fP +.IP \(bu 2 +\fB*\.orig\fP .RE .SH main @@ -317,6 +319,10 @@ would be the same as this: , "bin" : { "my\-program" : "\./path/to/program" } } .fi .RE +.P +Please make sure that your file(s) referenced in \fBbin\fP starts with +\fB#!/usr/bin/env node\fP, otherwise the scripts are started without the node +executable! .SH man .P Specify either a single file or an array of filenames to put in place for the diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 14cb636613aa0a..fca57b636be35f 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CODING\-STYLE" "7" "July 2016" "" "" +.TH "NPM\-CODING\-STYLE" "7" "September 2016" "" "" .SH "NAME" \fBnpm-coding-style\fR \- npm's "funny" coding style .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index 3c6246659bef55..aa56118f30348e 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,4 +1,4 @@ -.TH "NPM\-CONFIG" "7" "July 2016" "" "" +.TH "NPM\-CONFIG" "7" "September 2016" "" "" .SH "NAME" \fBnpm-config\fR \- More than you probably want to know about npm configuration .SH DESCRIPTION @@ -24,13 +24,15 @@ same\. The four relevant files are: .RS 0 .IP \(bu 2 -per\-project config file (/path/to/my/project/\.npmrc) +per\-project configuration file (\fB/path/to/my/project/\.npmrc\fP) .IP \(bu 2 -per\-user config file (~/\.npmrc) +per\-user configuration file (defaults to \fB$HOME/\.npmrc\fP; configurable via CLI +option \fB\-\-userconfig\fP or environment variable \fB$NPM_CONF_USERCONFIG\fP) .IP \(bu 2 -global config file ($PREFIX/etc/npmrc) +global configuration file (defaults to \fB$PREFIX/etc/npmrc\fP; configurable via +CLI option \fB\-\-globalconfig\fP or environment variable \fB$NPM_CONF_GLOBALCONFIG\fP) .IP \(bu 2 -npm builtin config file (/path/to/npm/npmrc) +npm's built\-in configuration file (\fB/path/to/npm/npmrc\fP) .RE .P diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 8d95928286de5e..9a935711434bf7 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DEVELOPERS" "7" "July 2016" "" "" +.TH "NPM\-DEVELOPERS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-developers\fR \- Developer Guide .SH DESCRIPTION diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index b8d8f854759141..89b706c9c94e14 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,4 +1,4 @@ -.TH "NPM\-DISPUTES" "7" "July 2016" "" "" +.TH "NPM\-DISPUTES" "7" "September 2016" "" "" .SH "NAME" \fBnpm-disputes\fR \- Handling Module Name Disputes .SH SYNOPSIS diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index b6790ccb32486a..79e721b913f0ce 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,4 +1,4 @@ -.TH "NPM\-INDEX" "7" "July 2016" "" "" +.TH "NPM\-INDEX" "7" "September 2016" "" "" .SH "NAME" \fBnpm-index\fR \- Index of all npm documentation .SS npm help README diff --git a/deps/npm/man/man7/npm-orgs.7 b/deps/npm/man/man7/npm-orgs.7 index bbea89569d1cf3..454c6af6b63c66 100644 --- a/deps/npm/man/man7/npm-orgs.7 +++ b/deps/npm/man/man7/npm-orgs.7 @@ -1,4 +1,4 @@ -.TH "NPM\-ORGS" "7" "July 2016" "" "" +.TH "NPM\-ORGS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-orgs\fR \- Working with Teams & Orgs .SH DESCRIPTION @@ -10,7 +10,7 @@ Super admin, controls billing & adding people to the org\. .IP 2. 3 Team admin, manages team membership & package access\. .IP 3. 3 -Developer, works on packages they are given access to\. +Developer, works on packages they are given access to\. .RE .P @@ -80,7 +80,7 @@ npm init \-\-scope= to scope it for your org & publish as usual .RS 0 .IP \(bu 2 -Grant access: +Grant access: .RE .P @@ -144,3 +144,4 @@ npm help access npm help 7 scope .RE + diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 62b7d770098148..d404e6e2fcd192 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REGISTRY" "7" "July 2016" "" "" +.TH "NPM\-REGISTRY" "7" "September 2016" "" "" .SH "NAME" \fBnpm-registry\fR \- The JavaScript Package Registry .SH DESCRIPTION @@ -30,7 +30,7 @@ similar) design doc to implement the APIs\. If you set up continuous replication from the official CouchDB, and then set your internal CouchDB as the registry config, then you'll be able to read any published packages, in addition to your private ones, and by -default will only publish internally\. +default will only publish internally\. .P If you then want to publish a package for the whole world to see, you can simply override the \fB\-\-registry\fP option for that \fBpublish\fP command\. diff --git a/deps/npm/man/man7/npm-scope.7 b/deps/npm/man/man7/npm-scope.7 index 9533637b5254c4..b868d1867f4c2b 100644 --- a/deps/npm/man/man7/npm-scope.7 +++ b/deps/npm/man/man7/npm-scope.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCOPE" "7" "July 2016" "" "" +.TH "NPM\-SCOPE" "7" "September 2016" "" "" .SH "NAME" \fBnpm-scope\fR \- Scoped packages .SH DESCRIPTION @@ -17,9 +17,10 @@ followed by a slash, e\.g\. Scopes are a way of grouping related packages together, and also affect a few things about the way npm treats the package\. .P -Scoped packages are supported by the public npm registry\. The npm -client is backwards\-compatible with un\-scoped registries, so it can be -used to work with scoped and un\-scoped registries at the same time\. +Scoped packages can be published and installed as of \fBnpm@2\fP and are supported +by the primary npm registry\. The npm client is backwards\-compatible with +un\-scoped registries, so it can be used to work with scoped and un\-scoped +registries at the same time\. .SH Installing scoped packages .P Scoped packages are installed to a sub\-folder of the regular installation @@ -64,13 +65,15 @@ There is nothing special about the way Node treats scope folders, this is just specifying to require the module \fBmypackage\fP in the folder called \fB@myorg\fP\|\. .SH Publishing scoped packages .P -Scoped packages can be published to any registry that supports them, including -the public npm registry\. +Scoped packages can be published from the CLI as of \fBnpm@2\fP and can be +published to any registry that supports them, including the primary npm +registry\. .P -(As of 2015\-04\-19, and with npm 2\.0 or better, the public npm registry \fBdoes\fR support scoped packages) +(As of 2015\-04\-19, and with npm 2\.0 or better, the primary npm registry +\fBdoes\fR support scoped packages) .P If you wish, you may associate a scope with a registry; see below\. -.SS Publishing public scoped packages to the public npm registry +.SS Publishing public scoped packages to the primary npm registry .P To publish a public scoped package, you must specify \fB\-\-access public\fP with the initial publication\. This will publish the package and set access @@ -88,7 +91,7 @@ desired, with \fBnpm access\fP or on the npmjs\.com website\. .SH Associating a scope with a registry .P Scopes can be associated with a separate registry\. This allows you to -seamlessly use a mix of packages from the public npm registry and one or more +seamlessly use a mix of packages from the primary npm registry and one or more private registries, such as npm Enterprise\. .P You can associate a scope with a registry at login, e\.g\. diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 4190fc08b3c225..6bf3400824219b 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,4 +1,4 @@ -.TH "NPM\-SCRIPTS" "7" "July 2016" "" "" +.TH "NPM\-SCRIPTS" "7" "September 2016" "" "" .SH "NAME" \fBnpm-scripts\fR \- How npm handles the "scripts" field .SH DESCRIPTION @@ -26,11 +26,14 @@ Run BEFORE the package is uninstalled\. postuninstall: Run AFTER the package is uninstalled\. .IP \(bu 2 -preversion, version: -Run BEFORE bump the package version\. +preversion: +Run BEFORE bumping the package version\. +.IP \(bu 2 +version: +Run AFTER bumping the package version, but BEFORE commit\. .IP \(bu 2 postversion: -Run AFTER bump the package version\. +Run AFTER bumping the package version, and AFTER commit\. .IP \(bu 2 pretest, test, posttest: Run by the \fBnpm test\fP command\. diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index 9cfaae2aac45fa..3799c20517fdf5 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,4 +1,4 @@ -.TH "NPM\-REMOVAL" "1" "July 2016" "" "" +.TH "NPM\-REMOVAL" "1" "September 2016" "" "" .SH "NAME" \fBnpm-removal\fR \- Cleaning the Slate .SH SYNOPSIS diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index dd46a2e314750d..24116a603a9fa8 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,4 +1,4 @@ -.TH "SEMVER" "7" "July 2016" "" "" +.TH "SEMVER" "7" "September 2016" "" "" .SH "NAME" \fBsemver\fR \- The semantic versioner for npm .SH Usage @@ -6,6 +6,8 @@ .RS 2 .nf $ npm install semver +$ node +var semver = require('semver') semver\.valid('1\.2\.3') // '1\.2\.3' semver\.valid('a\.b\.c') // null @@ -22,18 +24,35 @@ As a command\-line utility: .nf $ semver \-h -Usage: semver [ [\.\.\.]] [\-r | \-i | \-\-preid | \-l | \-rv] -Test if version(s) satisfy the supplied range(s), and sort them\. +SemVer 5\.1\.0 -Multiple versions or ranges may be supplied, unless increment -option is specified\. In that case, only a single version may -be used, and it is incremented by the specified level +A JavaScript implementation of the http://semver\.org/ specification +Copyright Isaac Z\. Schlueter + +Usage: semver [options] [ [\.\.\.]] +Prints valid versions sorted by SemVer precedence + +Options: +\-r \-\-range + Print versions that match the specified range\. + +\-i \-\-increment [] + Increment a version by the specified level\. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease\. Default level is 'patch'\. + Only one version may be specified\. + +\-\-preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments\. + +\-l \-\-loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions\. -If no versions are valid, or ranges are not satisfied, -then exits failure\. +If no satisfying versions are found, then exits failure\. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them\. @@ -299,7 +318,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '\.' xr ( '\.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'\-'9']['0'\-'9']+ +nr ::= '0' | ['1'\-'9'] ( ['0'\-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '\-' pre )? ( '+' build )? @@ -337,6 +356,9 @@ increments it\. .RE .IP \(bu 2 +\fBprerelease(v)\fP: Returns an array of prerelease components, or null +if none exist\. Example: \fBprerelease('1\.2\.3\-alpha\.1') \-> ['alpha', 1]\fP +.IP \(bu 2 \fBmajor(v)\fP: Return the major version number\. .IP \(bu 2 \fBminor(v)\fP: Return the minor version number\. @@ -388,6 +410,9 @@ range\. \fBmaxSatisfying(versions, range)\fP: Return the highest version in the list that satisfies the range, or \fBnull\fP if none of them do\. .IP \(bu 2 +\fBminSatisfying(versions, range)\fP: Return the lowest version in the list +that satisfies the range, or \fBnull\fP if none of them do\. +.IP \(bu 2 \fBgtr(version, range)\fP: Return \fBtrue\fP if version is greater than all the versions possible in the range\. .IP \(bu 2 diff --git a/deps/npm/node_modules/aproba/LICENSE b/deps/npm/node_modules/aproba/LICENSE index 2a4982dc40cb69..f4be44d881b2d9 100644 --- a/deps/npm/node_modules/aproba/LICENSE +++ b/deps/npm/node_modules/aproba/LICENSE @@ -11,3 +11,4 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/aproba/README.md b/deps/npm/node_modules/aproba/README.md index 69e356eb6ab9fb..8246a9cc6e1a4d 100644 --- a/deps/npm/node_modules/aproba/README.md +++ b/deps/npm/node_modules/aproba/README.md @@ -49,10 +49,11 @@ I wanted a very simple argument validator. It needed to do two things: 2. Not encourage an infinite bikeshed of DSLs This is why types are specified by a single character and there's no such -thing as an optional argument. +thing as an optional argument. This is not intended to validate user data. This is specifically about asserting the interface of your functions. If you need greater validation, I encourage you to write them by hand or look elsewhere. + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE index 14deaf94b8162d..313ef1e888e41b 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/LICENSE @@ -27,3 +27,4 @@ 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. + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md index 64c1f3f7cd8a8a..5c5126d03287b4 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/docs/index.md @@ -60,3 +60,6 @@ for any purpose and without fee is hereby granted. The author disclaims all warranties with regard to this software. Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + + + diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js index eab79ff71f1498..60e0ffba8b4aab 100644 --- a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/test.js @@ -31,3 +31,4 @@ test("ensure defaults clone nested objects", function(t) { t.ok(result.b !== d.b, 'objects should be clones'); t.end(); }); + diff --git a/deps/npm/node_modules/fstream-npm/fstream-npm.js b/deps/npm/node_modules/fstream-npm/fstream-npm.js index c3b93214dcd678..62146664273fa1 100644 --- a/deps/npm/node_modules/fstream-npm/fstream-npm.js +++ b/deps/npm/node_modules/fstream-npm/fstream-npm.js @@ -78,6 +78,29 @@ Packer.prototype.readBundledLinks = function () { list.forEach(function (pkg) { if (pkg.charAt(0) === '.') return then() var pd = this.path + '/node_modules/' + pkg + + // scoped packages + if (pkg.charAt(0) === '@') { + fs.readdir(pd, function (er, slist) { + var sl = slist && slist.length + if (er || sl === 0) return then(er) + + l += sl + slist.forEach(function (spkg) { + if (spkg.charAt(0) === '.') return then() + var spd = pd + '/' + spkg + fs.realpath(spd, function (er, rp) { + if (er) return then() + this.bundleLinks = this.bundleLinks || {} + this.bundleLinks[pkg + '/' + spkg] = rp + then() + }.bind(this)) + }, this) + then() + }.bind(this)) + return + } + fs.realpath(pd, function (er, rp) { if (er) return then() this.bundleLinks = this.bundleLinks || {} @@ -127,7 +150,8 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) { entry === '.npmrc' || entry.match(/^\..*\.swp$/) || entry === '.DS_Store' || - entry.match(/^\._/) + entry.match(/^\._/) || + entry.match(/^.*\.orig$/) ) { return false } @@ -141,8 +165,16 @@ Packer.prototype.applyIgnores = function (entry, partial, entryObj) { // linked with npm link, even in a bundle, deps are only bundled // if they're not already present at a higher level. if (this.bundleMagic) { + if (entry.charAt(0) === '@') { + var firstSlash = entry.indexOf('/') + // continue to list the packages in this scope + if (firstSlash === -1) return true + + // bubbling up. stop here and allow anything the bundled pkg allows + if (entry.indexOf('/', firstSlash + 1) !== -1) return true + } // bubbling up. stop here and allow anything the bundled pkg allows - if (entry.indexOf('/') !== -1) return true + else if (entry.indexOf('/') !== -1) return true // never include the .bin. It's typically full of platform-specific // stuff like symlinks and .cmd files anyway. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 9322bb20fe8e85..fa5e604e0a4975 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, @@ -13,40 +14,41 @@ ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ "/fstream-npm/fstream-ignore/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", "_where": "/Users/zkat/Documents/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -75,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -90,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -102,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json index 0a28e3def37f3b..2b603477a4b52a 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -13,40 +14,41 @@ ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.4", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, "_location": "/fstream-npm/fstream-ignore/minimatch/brace-expansion", - "_nodeVersion": "6.0.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.4.tgz_1462130058897_0.14984136167913675" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/fstream-npm/fstream-ignore/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", - "_shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/zkat/Documents/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -58,26 +60,26 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "1660b75d0bf03b022e7888b576cd5a4080692c1d", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -92,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -104,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.4" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json index 51abf989189a64..4c704eeb860b6c 100644 --- a/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/fstream-npm/node_modules/fstream-ignore/node_modules/minimatch/package.json @@ -1,60 +1,99 @@ { + "_args": [ + [ + { + "raw": "minimatch@^3.0.0", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore" + ] + ], + "_from": "minimatch@>=3.0.0 <4.0.0", + "_id": "minimatch@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.6", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@^3.0.0", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "_shrinkwrap": null, + "_spec": "minimatch@^3.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/fstream-npm/node_modules/fstream-ignore", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { "brace-expansion": "^1.0.0" }, + "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" + }, + "directories": {}, + "dist": { + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "engines": { + "node": "*" }, - "license": "ISC", "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@3.0.0", - "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "_from": "minimatch@>=3.0.0 <4.0.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, + "license": "ISC", + "main": "minimatch.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.3" } diff --git a/deps/npm/node_modules/fstream-npm/package.json b/deps/npm/node_modules/fstream-npm/package.json index 0eddd8be095f3f..ea4c6b98b7f023 100644 --- a/deps/npm/node_modules/fstream-npm/package.json +++ b/deps/npm/node_modules/fstream-npm/package.json @@ -2,10 +2,11 @@ "_args": [ [ { - "name": "fstream-npm", "raw": "fstream-npm@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "fstream-npm", + "name": "fstream-npm", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, @@ -13,43 +14,45 @@ ] ], "_from": "fstream-npm@latest", - "_id": "fstream-npm@1.1.0", + "_id": "fstream-npm@1.2.0", "_inCache": true, "_installable": true, "_location": "/fstream-npm", - "_nodeVersion": "5.10.1", + "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/fstream-npm-1.1.0.tgz_1463528747313_0.84859543829225" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/fstream-npm-1.2.0.tgz_1473287973531_0.21196374762803316" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.10.7", "_phantomChildren": { - "fstream": "1.0.9", + "fstream": "1.0.10", "inherits": "2.0.1" }, "_requested": { - "name": "fstream-npm", "raw": "fstream-npm@latest", - "rawSpec": "latest", "scope": null, + "escapedName": "fstream-npm", + "name": "fstream-npm", + "rawSpec": "latest", "spec": "latest", "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.0.tgz", - "_shasum": "80e09743485eaa70d57e89d1ff8fafa366cdefea", + "_resolved": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.2.0.tgz", + "_shasum": "d2c3c89101346982d64e57091c38487bda916fce", "_shrinkwrap": null, "_spec": "fstream-npm@latest", "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -69,29 +72,29 @@ }, "directories": {}, "dist": { - "shasum": "80e09743485eaa70d57e89d1ff8fafa366cdefea", - "tarball": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.1.0.tgz" + "shasum": "d2c3c89101346982d64e57091c38487bda916fce", + "tarball": "https://registry.npmjs.org/fstream-npm/-/fstream-npm-1.2.0.tgz" }, - "gitHead": "7df2e946714506f287b0a8125dc05566b840d4b0", + "gitHead": "b839e060768000d634b43e44274df68e383d5791", "homepage": "https://github.com/npm/fstream-npm#readme", "license": "ISC", "main": "./fstream-npm.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "fstream-npm", @@ -104,5 +107,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "1.1.0" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/fstream-npm/test/scoped.js b/deps/npm/node_modules/fstream-npm/test/scoped.js new file mode 100644 index 00000000000000..c001c1b333d6ec --- /dev/null +++ b/deps/npm/node_modules/fstream-npm/test/scoped.js @@ -0,0 +1,94 @@ +var fs = require('graceful-fs') +var join = require('path').join + +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var Packer = require('..') + +var pkg = join(__dirname, 'test-package-scoped') + +var elfJS = function () {/* +module.exports = function () { + console.log("i'm a elf") +} +*/}.toString().split('\n').slice(1, -1).join() + +var json = { + 'name': 'test-package-scoped', + 'version': '3.1.4', + 'main': 'elf.js', + 'bundledDependencies': [ + '@npmwombat/scoped' + ] +} + +test('setup', function (t) { + setup() + t.end() +}) + +var included = [ + 'package.json', + 'elf.js', + join('node_modules', '@npmwombat', 'scoped', 'index.js') +] + +test('includes bundledDependencies', function (t) { + var subject = new Packer({ path: pkg, type: 'Directory', isDirectory: true }) + var filenames = [] + subject.on('entry', function (entry) { + t.equal(entry.type, 'File', 'only files in this package') + + // include relative path in filename + var filename = entry._path.slice(entry.root._path.length + 1) + + filenames.push(filename) + }) + // need to do this so fstream doesn't explode when files are removed from + // under it + subject.on('end', function () { + // ensure we get *exactly* the results we expect by comparing in both + // directions + filenames.forEach(function (filename) { + t.ok( + included.indexOf(filename) > -1, + filename + ' is included' + ) + }) + included.forEach(function (filename) { + t.ok( + filenames.indexOf(filename) > -1, + filename + ' is not included' + ) + }) + t.end() + }) +}) + +test('cleanup', function (t) { + // rimraf.sync chokes here for some reason + rimraf(pkg, function () { t.end() }) +}) + +function setup () { + rimraf.sync(pkg) + mkdirp.sync(pkg) + fs.writeFileSync( + join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + fs.writeFileSync( + join(pkg, 'elf.js'), + elfJS + ) + + var scopedDir = join(pkg, 'node_modules', '@npmwombat', 'scoped') + mkdirp.sync(scopedDir) + fs.writeFileSync( + join(scopedDir, 'index.js'), + "console.log('hello wombat')" + ) +} diff --git a/deps/npm/node_modules/glob/README.md b/deps/npm/node_modules/glob/README.md new file mode 100644 index 00000000000000..9dd9384fa143c3 --- /dev/null +++ b/deps/npm/node_modules/glob/README.md @@ -0,0 +1,365 @@ +# Glob + +Match files using the patterns the shell uses, like stars and stuff. + +[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master) + +This is a glob implementation in JavaScript. It uses the `minimatch` +library to do its matching. + +![](oh-my-glob.gif) + +## Usage + +Install with npm + +``` +npm i glob +``` + +```javascript +var glob = require("glob") + +// options is optional +glob("**/*.js", options, function (er, files) { + // files is an array of filenames. + // If the `nonull` option is set, and nothing + // was found, then files is ["**/*.js"] + // er is an error object or null. +}) +``` + +## Glob Primer + +"Globs" are the patterns you type when you do stuff like `ls *.js` on +the command line, or put `build/*` in a `.gitignore` file. + +Before parsing the path part patterns, braced sections are expanded +into a set. Braced sections start with `{` and end with `}`, with any +number of comma-delimited sections within. Braced sections may contain +slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. + +The following characters have special magic meaning when used in a +path portion: + +* `*` Matches 0 or more characters in a single path portion +* `?` Matches 1 character +* `[...]` Matches a range of characters, similar to a RegExp range. + If the first character of the range is `!` or `^` then it matches + any character not in the range. +* `!(pattern|pattern|pattern)` Matches anything that does not match + any of the patterns provided. +* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the + patterns provided. +* `+(pattern|pattern|pattern)` Matches one or more occurrences of the + patterns provided. +* `*(a|b|c)` Matches zero or more occurrences of the patterns provided +* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns + provided +* `**` If a "globstar" is alone in a path portion, then it matches + zero or more directories and subdirectories searching for matches. + It does not crawl symlinked directories. + +### Dots + +If a file or directory path portion has a `.` as the first character, +then it will not match any glob pattern unless that pattern's +corresponding path part also has a `.` as its first character. + +For example, the pattern `a/.*/c` would match the file at `a/.b/c`. +However the pattern `a/*/c` would not, because `*` does not start with +a dot character. + +You can make glob treat dots as normal characters by setting +`dot:true` in the options. + +### Basename Matching + +If you set `matchBase:true` in the options, and the pattern has no +slashes in it, then it will seek for any file anywhere in the tree +with a matching basename. For example, `*.js` would match +`test/simple/basic.js`. + +### Empty Sets + +If no matching files are found, then an empty array is returned. This +differs from the shell, where the pattern itself is returned. For +example: + + $ echo a*s*d*f + a*s*d*f + +To get the bash-style behavior, set the `nonull:true` in the options. + +### See Also: + +* `man sh` +* `man bash` (Search for "Pattern Matching") +* `man 3 fnmatch` +* `man 5 gitignore` +* [minimatch documentation](https://github.com/isaacs/minimatch) + +## glob.hasMagic(pattern, [options]) + +Returns `true` if there are any special characters in the pattern, and +`false` otherwise. + +Note that the options affect the results. If `noext:true` is set in +the options object, then `+(a|b)` will not be considered a magic +pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` +then that is considered magical, unless `nobrace:true` is set in the +options. + +## glob(pattern, [options], cb) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* `cb` `{Function}` + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Perform an asynchronous glob search. + +## glob.sync(pattern, [options]) + +* `pattern` `{String}` Pattern to be matched +* `options` `{Object}` +* return: `{Array}` filenames found matching the pattern + +Perform a synchronous glob search. + +## Class: glob.Glob + +Create a Glob object by instantiating the `glob.Glob` class. + +```javascript +var Glob = require("glob").Glob +var mg = new Glob(pattern, options, cb) +``` + +It's an EventEmitter, and starts walking the filesystem to find matches +immediately. + +### new glob.Glob(pattern, [options], [cb]) + +* `pattern` `{String}` pattern to search for +* `options` `{Object}` +* `cb` `{Function}` Called when an error occurs, or matches are found + * `err` `{Error | null}` + * `matches` `{Array}` filenames found matching the pattern + +Note that if the `sync` flag is set in the options, then matches will +be immediately available on the `g.found` member. + +### Properties + +* `minimatch` The minimatch object that the glob uses. +* `options` The options object passed in. +* `aborted` Boolean which is set to true when calling `abort()`. There + is no way at this time to continue a glob search after aborting, but + you can re-use the statCache to avoid having to duplicate syscalls. +* `cache` Convenience object. Each field has the following possible + values: + * `false` - Path does not exist + * `true` - Path exists + * `'FILE'` - Path exists, and is not a directory + * `'DIR'` - Path exists, and is a directory + * `[file, entries, ...]` - Path exists, is a directory, and the + array value is the results of `fs.readdir` +* `statCache` Cache of `fs.stat` results, to prevent statting the same + path multiple times. +* `symlinks` A record of which paths are symbolic links, which is + relevant in resolving `**` patterns. +* `realpathCache` An optional object which is passed to `fs.realpath` + to minimize unnecessary syscalls. It is stored on the instantiated + Glob object, and may be re-used. + +### Events + +* `end` When the matching is finished, this is emitted with all the + matches found. If the `nonull` option is set, and no match was found, + then the `matches` list contains the original pattern. The matches + are sorted, unless the `nosort` flag is set. +* `match` Every time a match is found, this is emitted with the specific + thing that matched. It is not deduplicated or resolved to a realpath. +* `error` Emitted when an unexpected error is encountered, or whenever + any fs error occurs if `options.strict` is set. +* `abort` When `abort()` is called, this event is raised. + +### Methods + +* `pause` Temporarily stop the search +* `resume` Resume the search +* `abort` Stop the search forever + +### Options + +All the options that can be passed to Minimatch can also be passed to +Glob to change pattern matching behavior. Also, some have been added, +or have glob-specific ramifications. + +All options are false by default, unless otherwise noted. + +All options are added to the Glob object, as well. + +If you are running many `glob` operations, you can pass a Glob object +as the `options` argument to a subsequent operation to shortcut some +`stat` and `readdir` calls. At the very least, you may pass in shared +`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that +parallel glob operations will be sped up by sharing information about +the filesystem. + +* `cwd` The current working directory in which to search. Defaults + to `process.cwd()`. +* `root` The place where patterns starting with `/` will be mounted + onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix + systems, and `C:\` or some such on Windows.) +* `dot` Include `.dot` files in normal matches and `globstar` matches. + Note that an explicit dot in a portion of the pattern will always + match dot files. +* `nomount` By default, a pattern starting with a forward-slash will be + "mounted" onto the root setting, so that a valid filesystem path is + returned. Set this flag to disable that behavior. +* `mark` Add a `/` character to directory matches. Note that this + requires additional stat calls. +* `nosort` Don't sort the results. +* `stat` Set to true to stat *all* results. This reduces performance + somewhat, and is completely unnecessary, unless `readdir` is presumed + to be an untrustworthy indicator of file existence. +* `silent` When an unusual error is encountered when attempting to + read a directory, a warning will be printed to stderr. Set the + `silent` option to true to suppress these warnings. +* `strict` When an unusual error is encountered when attempting to + read a directory, the process will just continue on in search of + other matches. Set the `strict` option to raise an error in these + cases. +* `cache` See `cache` property above. Pass in a previously generated + cache object to save some fs calls. +* `statCache` A cache of results of filesystem information, to prevent + unnecessary stat calls. While it should not normally be necessary + to set this, you may pass the statCache from one glob() call to the + options object of another, if you know that the filesystem will not + change between calls. (See "Race Conditions" below.) +* `symlinks` A cache of known symbolic links. You may pass in a + previously generated `symlinks` object to save `lstat` calls when + resolving `**` matches. +* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. +* `nounique` In some cases, brace-expanded patterns can result in the + same file showing up multiple times in the result set. By default, + this implementation prevents duplicates in the result set. Set this + flag to disable that behavior. +* `nonull` Set to never return an empty set, instead returning a set + containing the pattern itself. This is the default in glob(3). +* `debug` Set to enable debug logging in minimatch and glob. +* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. +* `noglobstar` Do not match `**` against multiple filenames. (Ie, + treat it as a normal `*` instead.) +* `noext` Do not match `+(a|b)` "extglob" patterns. +* `nocase` Perform a case-insensitive match. Note: on + case-insensitive filesystems, non-magic patterns will match by + default, since `stat` and `readdir` will not raise errors. +* `matchBase` Perform a basename-only match if the pattern does not + contain any slash characters. That is, `*.js` would be treated as + equivalent to `**/*.js`, matching all js files in all directories. +* `nodir` Do not match directories, only files. (Note: to match + *only* directories, simply put a `/` at the end of the pattern.) +* `ignore` Add a pattern or an array of glob patterns to exclude matches. + Note: `ignore` patterns are *always* in `dot:true` mode, regardless + of any other settings. +* `follow` Follow symlinked directories when expanding `**` patterns. + Note that this can result in a lot of duplicate references in the + presence of cyclic links. +* `realpath` Set to true to call `fs.realpath` on all of the results. + In the case of a symlink that cannot be resolved, the full absolute + path to the matched entry is returned (though it will usually be a + broken symlink) + +## Comparisons to other fnmatch/glob implementations + +While strict compliance with the existing standards is a worthwhile +goal, some discrepancies exist between node-glob and other +implementations, and are intentional. + +The double-star character `**` is supported by default, unless the +`noglobstar` flag is set. This is supported in the manner of bsdglob +and bash 4.3, where `**` only has special significance if it is the only +thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but +`a/**b` will not. + +Note that symlinked directories are not crawled as part of a `**`, +though their contents may match against subsequent portions of the +pattern. This prevents infinite loops and duplicates and the like. + +If an escaped pattern has no matches, and the `nonull` flag is set, +then glob returns the pattern as-provided, rather than +interpreting the character escapes. For example, +`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than +`"*a?"`. This is akin to setting the `nullglob` option in bash, except +that it does not resolve escaped pattern characters. + +If brace expansion is not disabled, then it is performed before any +other interpretation of the glob pattern. Thus, a pattern like +`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded +**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are +checked for validity. Since those two are valid, matching proceeds. + +### Comments and Negation + +Previously, this module let you mark a pattern as a "comment" if it +started with a `#` character, or a "negated" pattern if it started +with a `!` character. + +These options were deprecated in version 5, and removed in version 6. + +To specify things that should not match, use the `ignore` option. + +## Windows + +**Please only use forward-slashes in glob expressions.** + +Though windows uses either `/` or `\` as its path separator, only `/` +characters are used by this glob implementation. You must use +forward-slashes **only** in glob expressions. Back-slashes will always +be interpreted as escape characters, not path separators. + +Results from absolute patterns such as `/foo/*` are mounted onto the +root setting using `path.join`. On windows, this will by default result +in `/foo/*` matching `C:\foo\bar.txt`. + +## Race Conditions + +Glob searching, by its very nature, is susceptible to race conditions, +since it relies on directory walking and such. + +As a result, it is possible that a file that exists when glob looks for +it may have been deleted or modified by the time it returns the result. + +As part of its internal implementation, this program caches all stat +and readdir calls that it makes, in order to cut down on system +overhead. However, this also makes it even more susceptible to races, +especially if the cache or statCache objects are reused between glob +calls. + +Users are thus advised not to use a glob result as a guarantee of +filesystem state in the face of rapid changes. For the vast majority +of operations, this is never a problem. + +## Contributing + +Any change to behavior (including bugfixes) must come with a test. + +Patches that fail tests or reduce performance will be rejected. + +``` +# to run tests +npm test + +# to re-generate test fixtures +npm run test-regen + +# to benchmark against bash/zsh +npm run bench + +# to profile javascript +npm run prof +``` diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js index 02d15b755dd84e..9eca910bb05ec6 100644 --- a/deps/npm/node_modules/glob/glob.js +++ b/deps/npm/node_modules/glob/glob.js @@ -100,6 +100,10 @@ glob.hasMagic = function (pattern, options_) { var g = new Glob(pattern, options) var set = g.minimatch.set + + if (!pattern) + return false + if (set.length > 1) return true diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 208e61972bfc94..737524518e7bb7 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -4,6 +4,7 @@ { "raw": "balanced-match@^0.4.1", "scope": null, + "escapedName": "balanced-match", "name": "balanced-match", "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", @@ -13,34 +14,35 @@ ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { "raw": "balanced-match@^0.4.1", "scope": null, + "escapedName": "balanced-match", "name": "balanced-match", "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -105,5 +107,5 @@ "android-browser/4.2..latest" ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 3ffc8da5c03baa..6621b37b072ece 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -4,6 +4,7 @@ { "raw": "brace-expansion@^1.0.0", "scope": null, + "escapedName": "brace-expansion", "name": "brace-expansion", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", @@ -13,34 +14,35 @@ ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.5", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/glob/minimatch/brace-expansion", - "_nodeVersion": "4.4.5", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.5.tgz_1465989660138_0.34528115345165133" + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { "name": "juliangruber", "email": "julian@juliangruber.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { "raw": "brace-expansion@^1.0.0", "scope": null, + "escapedName": "brace-expansion", "name": "brace-expansion", "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/glob/minimatch" + "/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz", - "_shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch", @@ -58,14 +60,14 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "f5b4ad574e2cb7ccc1eb83e6fe79b8ecadf7a526", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.5.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "ff31acab078f1bb696ac4c55ca56ea24e6495fb6", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", @@ -107,5 +109,5 @@ "android-browser/4.2..latest" ] }, - "version": "1.1.5" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/glob/node_modules/minimatch/package.json index 4944eb0bccfada..eddb36b48e01f4 100644 --- a/deps/npm/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/glob/node_modules/minimatch/package.json @@ -1,60 +1,99 @@ { + "_args": [ + [ + { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/glob" + ] + ], + "_from": "minimatch@>=3.0.2 <4.0.0", + "_id": "minimatch@3.0.3", + "_inCache": true, + "_installable": true, + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.6", + "_phantomChildren": {}, + "_requested": { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "#USER", + "/" + ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "_shrinkwrap": null, + "_spec": "minimatch@^3.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/glob", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "3.0.0", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js" - }, - "engines": { - "node": "*" + "bugs": { + "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { "brace-expansion": "^1.0.0" }, + "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" + }, + "directories": {}, + "dist": { + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" + }, + "engines": { + "node": "*" }, - "license": "ISC", "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@3.0.0", - "_shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_npmVersion": "3.3.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" - }, + "license": "ISC", + "main": "minimatch.js", "maintainers": [ { "name": "isaacs", "email": "i@izs.me" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "minimatch", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/minimatch.git" + }, + "scripts": { + "posttest": "standard minimatch.js test/*.js", + "test": "tap test/*.js" + }, + "version": "3.0.3" } diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 253686f9b4b37c..66ce2c9246af5b 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -2,51 +2,55 @@ "_args": [ [ { - "raw": "glob@~7.0.3", + "raw": "glob@7.0.6", "scope": null, + "escapedName": "glob", "name": "glob", - "rawSpec": "~7.0.3", - "spec": ">=7.0.3 <7.1.0", - "type": "range" + "rawSpec": "7.0.6", + "spec": "7.0.6", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "glob@>=7.0.3 <7.1.0", - "_id": "glob@7.0.4", + "_from": "glob@7.0.6", + "_id": "glob@7.0.6", "_inCache": true, - "_installable": true, "_location": "/glob", - "_nodeVersion": "6.2.1", + "_nodeVersion": "4.5.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/glob-7.0.4.tgz_1466098181857_0.6043217403348535" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/glob-7.0.6.tgz_1472074762911_0.47247025789693" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.9.3", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "glob@~7.0.3", + "raw": "glob@7.0.6", "scope": null, + "escapedName": "glob", "name": "glob", - "rawSpec": "~7.0.3", - "spec": ">=7.0.3 <7.1.0", - "type": "range" + "rawSpec": "7.0.6", + "spec": "7.0.6", + "type": "version" }, "_requiredBy": [ "#USER", "/", + "/node-gyp", "/rimraf", - "/tap" + "/standard/standard-engine/deglob", + "/tap", + "/tap/tap-mocha-reporter" ], - "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.4.tgz", - "_shasum": "3b44afa0943bdc31b2037b934791e2e084bcb7f6", + "_resolved": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz", + "_shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", "_shrinkwrap": null, - "_spec": "glob@~7.0.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "glob@7.0.6", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -59,7 +63,7 @@ "fs.realpath": "^1.0.0", "inflight": "^1.0.4", "inherits": "2", - "minimatch": "2 || 3", + "minimatch": "^3.0.2", "once": "^1.3.0", "path-is-absolute": "^1.0.0" }, @@ -72,8 +76,8 @@ }, "directories": {}, "dist": { - "shasum": "3b44afa0943bdc31b2037b934791e2e084bcb7f6", - "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.4.tgz" + "shasum": "211bafaf49e525b8cd93260d14ab136152b3f57a", + "tarball": "https://registry.npmjs.org/glob/-/glob-7.0.6.tgz" }, "engines": { "node": "*" @@ -83,7 +87,7 @@ "sync.js", "common.js" ], - "gitHead": "3f883c43fec4f8046cbea9497add3b8ba4ef0a37", + "gitHead": "98327d8def195b1ba200217952df8ea829426038", "homepage": "https://github.com/isaacs/node-glob#readme", "license": "ISC", "main": "glob.js", @@ -109,5 +113,5 @@ "test": "tap test/*.js --cov", "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js" }, - "version": "7.0.4" + "version": "7.0.6" } diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md index d0dcd492549537..5273a50ad6a52c 100644 --- a/deps/npm/node_modules/graceful-fs/README.md +++ b/deps/npm/node_modules/graceful-fs/README.md @@ -7,7 +7,7 @@ The improvements are meant to normalize behavior across different platforms and environments, and to make filesystem access more resilient to errors. -## Improvements over [fs module](http://api.nodejs.org/fs.html) +## Improvements over [fs module](https://nodejs.org/api/fs.html) * Queues up `open` and `readdir` calls, and retries them once something closes if there is an EMFILE error from too many file diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index cca5d89f6ad185..df0cd9a110507d 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -1,35 +1,44 @@ { "_args": [ [ - "graceful-fs@~4.1.3", - "/Users/rebecca/code/npm" + { + "raw": "graceful-fs@4.1.6", + "scope": null, + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "4.1.6", + "spec": "4.1.6", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "graceful-fs@>=4.1.3 <4.2.0", - "_id": "graceful-fs@4.1.4", + "_from": "graceful-fs@4.1.6", + "_id": "graceful-fs@4.1.6", "_inCache": true, - "_installable": true, "_location": "/graceful-fs", - "_nodeVersion": "5.6.0", + "_nodeVersion": "4.4.4", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/graceful-fs-4.1.4.tgz_1462474854900_0.9423982477746904" + "tmp": "tmp/graceful-fs-4.1.6.tgz_1471616320359_0.39477095939219" }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.8.9", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "graceful-fs", - "raw": "graceful-fs@~4.1.3", - "rawSpec": "~4.1.3", + "raw": "graceful-fs@4.1.6", "scope": null, - "spec": ">=4.1.3 <4.2.0", - "type": "range" + "escapedName": "graceful-fs", + "name": "graceful-fs", + "rawSpec": "4.1.6", + "spec": "4.1.6", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/cmd-shim", "/fs-vacuum", @@ -43,17 +52,14 @@ "/readdir-scoped-modules", "/sha", "/standard/eslint/file-entry-cache/flat-cache", - "/standard/eslint/file-entry-cache/flat-cache/read-json-sync", "/tacks", - "/tap/nyc/read-pkg/load-json-file", - "/tap/nyc/read-pkg/path-type", "/write-file-atomic" ], - "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz", - "_shasum": "ef089d2880f033b011823ce5c8fae798da775dbd", + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz", + "_shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", "_shrinkwrap": null, - "_spec": "graceful-fs@~4.1.3", - "_where": "/Users/rebecca/code/npm", + "_spec": "graceful-fs@4.1.6", + "_where": "/Users/zkat/Documents/code/npm", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, @@ -68,8 +74,8 @@ "test": "test" }, "dist": { - "shasum": "ef089d2880f033b011823ce5c8fae798da775dbd", - "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.4.tgz" + "shasum": "514c38772b31bee2e08bedc21a0aeb3abf54c19e", + "tarball": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.6.tgz" }, "engines": { "node": ">=0.4.0" @@ -80,7 +86,7 @@ "legacy-streams.js", "polyfills.js" ], - "gitHead": "fe8f05ccc2779d1dfa6db6173f3ed64f1e9aa72c", + "gitHead": "cfe3ba80e37af542f02e445c89aa59482aa32a63", "homepage": "https://github.com/isaacs/node-graceful-fs#readme", "keywords": [ "fs", @@ -102,8 +108,8 @@ "main": "graceful-fs.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "graceful-fs", @@ -116,5 +122,5 @@ "scripts": { "test": "node test.js | tap -" }, - "version": "4.1.4" + "version": "4.1.6" } diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index 5e4f4804618d17..2798050604be2f 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -44,28 +44,28 @@ function patch (fs) { fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) - fs.chmod = chownFix(fs.chmod) - fs.fchmod = chownFix(fs.fchmod) - fs.lchmod = chownFix(fs.lchmod) + fs.chmod = chmodFix(fs.chmod) + fs.fchmod = chmodFix(fs.fchmod) + fs.lchmod = chmodFix(fs.lchmod) fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) - fs.chmodSync = chownFix(fs.chmodSync) - fs.fchmodSync = chownFix(fs.fchmodSync) - fs.lchmodSync = chownFix(fs.lchmodSync) + fs.chmodSync = chmodFixSync(fs.chmodSync) + fs.fchmodSync = chmodFixSync(fs.fchmodSync) + fs.lchmodSync = chmodFixSync(fs.lchmodSync) // if lchmod/lchown do not exist, then make them no-ops if (!fs.lchmod) { fs.lchmod = function (path, mode, cb) { - process.nextTick(cb) + if (cb) process.nextTick(cb) } fs.lchmodSync = function () {} } if (!fs.lchown) { fs.lchown = function (path, uid, gid, cb) { - process.nextTick(cb) + if (cb) process.nextTick(cb) } fs.lchownSync = function () {} } @@ -121,20 +121,19 @@ function patch (fs) { function patchLchmod (fs) { fs.lchmod = function (path, mode, callback) { - callback = callback || noop fs.open( path , constants.O_WRONLY | constants.O_SYMLINK , mode , function (err, fd) { if (err) { - callback(err) + if (callback) callback(err) return } // prefer to return the chmod error, if one occurs, // but still try to close, and report closing errors if they occur. fs.fchmod(fd, mode, function (err) { fs.close(fd, function(err2) { - callback(err || err2) + if (callback) callback(err || err2) }) }) }) @@ -167,11 +166,13 @@ function patchLutimes (fs) { if (constants.hasOwnProperty("O_SYMLINK")) { fs.lutimes = function (path, at, mt, cb) { fs.open(path, constants.O_SYMLINK, function (er, fd) { - cb = cb || noop - if (er) return cb(er) + if (er) { + if (cb) cb(er) + return + } fs.futimes(fd, at, mt, function (er) { fs.close(fd, function (er2) { - return cb(er || er2) + if (cb) cb(er || er2) }) }) }) @@ -197,17 +198,39 @@ function patchLutimes (fs) { } } else { - fs.lutimes = function (_a, _b, _c, cb) { process.nextTick(cb) } + fs.lutimes = function (_a, _b, _c, cb) { if (cb) process.nextTick(cb) } fs.lutimesSync = function () {} } } +function chmodFix (orig) { + if (!orig) return orig + return function (target, mode, cb) { + return orig.call(fs, target, mode, function (er) { + if (chownErOk(er)) er = null + if (cb) cb.apply(this, arguments) + }) + } +} + +function chmodFixSync (orig) { + if (!orig) return orig + return function (target, mode) { + try { + return orig.call(fs, target, mode) + } catch (er) { + if (!chownErOk(er)) throw er + } + } +} + + function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { - return orig.call(fs, target, uid, gid, function (er, res) { + return orig.call(fs, target, uid, gid, function (er) { if (chownErOk(er)) er = null - cb(er, res) + if (cb) cb.apply(this, arguments) }) } } diff --git a/deps/npm/node_modules/has-unicode/LICENSE b/deps/npm/node_modules/has-unicode/LICENSE index e756052969b780..d42e25e95655bb 100644 --- a/deps/npm/node_modules/has-unicode/LICENSE +++ b/deps/npm/node_modules/has-unicode/LICENSE @@ -11,3 +11,4 @@ ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/has-unicode/README.md b/deps/npm/node_modules/has-unicode/README.md index ebe3c2a7f4f9fa..5a03e5991c539e 100644 --- a/deps/npm/node_modules/has-unicode/README.md +++ b/deps/npm/node_modules/has-unicode/README.md @@ -36,7 +36,8 @@ that you encourage your users to override this via config. ### Unix Like Operating Systems We look at the environment variables `LC_ALL`, `LC_CTYPE`, and `LANG` in -that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. +that order. For `LC_ALL` and `LANG`, it looks for `.UTF-8` in the value. For `LC_CTYPE` it looks to see if the value is `UTF-8`. This is sufficient for most POSIX systems. While locale data can be put in `/etc/locale.conf` as well, AFAIK it's always copied into the environment. + diff --git a/deps/npm/node_modules/imurmurhash/imurmurhash.js b/deps/npm/node_modules/imurmurhash/imurmurhash.js index 05347a2536fce2..e63146a2b7e70b 100644 --- a/deps/npm/node_modules/imurmurhash/imurmurhash.js +++ b/deps/npm/node_modules/imurmurhash/imurmurhash.js @@ -95,7 +95,7 @@ // @return {number} The 32-bit hash MurmurHash3.prototype.result = function() { var k1, h1; - + k1 = this.k1; h1 = this.h1; diff --git a/deps/npm/node_modules/inherits/inherits.js b/deps/npm/node_modules/inherits/inherits.js index 29f5e24f57b5aa..3b94763a76eef0 100644 --- a/deps/npm/node_modules/inherits/inherits.js +++ b/deps/npm/node_modules/inherits/inherits.js @@ -1 +1,7 @@ -module.exports = require('util').inherits +try { + var util = require('util'); + if (typeof util.inherits !== 'function') throw ''; + module.exports = util.inherits; +} catch (e) { + module.exports = require('./inherits_browser.js'); +} diff --git a/deps/npm/node_modules/inherits/package.json b/deps/npm/node_modules/inherits/package.json index 933382a7f44bac..c68e2f3a35d726 100644 --- a/deps/npm/node_modules/inherits/package.json +++ b/deps/npm/node_modules/inherits/package.json @@ -1,7 +1,90 @@ { - "name": "inherits", + "_args": [ + [ + { + "raw": "inherits@2.0.3", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2.0.3", + "spec": "2.0.3", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" + ] + ], + "_from": "inherits@2.0.3", + "_id": "inherits@2.0.3", + "_inCache": true, + "_location": "/inherits", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/inherits-2.0.3.tgz_1473295776489_0.08142363070510328" + }, + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "_npmVersion": "3.10.7", + "_phantomChildren": {}, + "_requested": { + "raw": "inherits@2.0.3", + "scope": null, + "escapedName": "inherits", + "name": "inherits", + "rawSpec": "2.0.3", + "spec": "2.0.3", + "type": "version" + }, + "_requiredBy": [ + "#USER", + "/", + "/fstream", + "/fstream-npm", + "/fstream-npm/fstream-ignore", + "/glob", + "/init-package-json/glob", + "/npm-registry-client/concat-stream", + "/npm-registry-client/concat-stream/readable-stream", + "/npm-registry-couchapp/couchapp/nano/follow/request/bl/readable-stream", + "/read-package-json/glob", + "/readable-stream", + "/request/bl/readable-stream", + "/standard/eslint/concat-stream", + "/standard/eslint/concat-stream/readable-stream", + "/standard/eslint/file-entry-cache/flat-cache/del/globby/glob", + "/standard/eslint/glob", + "/tap/tap-mocha-reporter/readable-stream", + "/tap/tap-parser", + "/tar", + "/tar/block-stream" + ], + "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "_shasum": "633c2c83e3da42a502f52466022480f4208261de", + "_shrinkwrap": null, + "_spec": "inherits@2.0.3", + "_where": "/Users/zkat/Documents/code/npm", + "browser": "./inherits_browser.js", + "bugs": { + "url": "https://github.com/isaacs/inherits/issues" + }, + "dependencies": {}, "description": "Browser-friendly inheritance fully compatible with standard node.js inherits()", - "version": "2.0.1", + "devDependencies": { + "tap": "^7.1.0" + }, + "directories": {}, + "dist": { + "shasum": "633c2c83e3da42a502f52466022480f4208261de", + "tarball": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz" + }, + "files": [ + "inherits.js", + "inherits_browser.js" + ], + "gitHead": "e05d0fb27c61a3ec687214f0476386b765364d5f", + "homepage": "https://github.com/isaacs/inherits#readme", "keywords": [ "inheritance", "class", @@ -12,24 +95,23 @@ "browser", "browserify" ], + "license": "ISC", "main": "./inherits.js", - "browser": "./inherits_browser.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "name": "inherits", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/isaacs/inherits.git" }, - "license": "ISC", "scripts": { "test": "node test" }, - "readme": "Browser-friendly inheritance fully compatible with standard node.js\n[inherits](http://nodejs.org/api/util.html#util_util_inherits_constructor_superconstructor).\n\nThis package exports standard `inherits` from node.js `util` module in\nnode environment, but also provides alternative browser-friendly\nimplementation through [browser\nfield](https://gist.github.com/shtylman/4339901). Alternative\nimplementation is a literal copy of standard one located in standalone\nmodule to avoid requiring of `util`. It also has a shim for old\nbrowsers with no `Object.create` support.\n\nWhile keeping you sure you are using standard `inherits`\nimplementation in node.js environment, it allows bundlers such as\n[browserify](https://github.com/substack/node-browserify) to not\ninclude full `util` package to your client code if all you need is\njust `inherits` function. It worth, because browser shim for `util`\npackage is large and `inherits` is often the single function you need\nfrom it.\n\nIt's recommended to use this package instead of\n`require('util').inherits` for any code that has chances to be used\nnot only in node.js but in browser too.\n\n## usage\n\n```js\nvar inherits = require('inherits');\n// then use exactly as the standard one\n```\n\n## note on version ~1.0\n\nVersion ~1.0 had completely different motivation and is not compatible\nneither with 2.0 nor with standard node.js `inherits`.\n\nIf you are using version ~1.0 and planning to switch to ~2.0, be\ncareful:\n\n* new version uses `super_` instead of `super` for referencing\n superclass\n* new version overwrites current prototype while old one preserves any\n existing fields on it\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/isaacs/inherits/issues" - }, - "homepage": "https://github.com/isaacs/inherits#readme", - "_id": "inherits@2.0.1", - "_shasum": "b17d08d326b4423e568eff719f91b0b1cbdf69f1", - "_resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "_from": "inherits@>=2.0.1 <2.1.0" + "version": "2.0.3" } diff --git a/deps/npm/node_modules/inherits/test.js b/deps/npm/node_modules/inherits/test.js deleted file mode 100644 index fc53012d31c0cd..00000000000000 --- a/deps/npm/node_modules/inherits/test.js +++ /dev/null @@ -1,25 +0,0 @@ -var inherits = require('./inherits.js') -var assert = require('assert') - -function test(c) { - assert(c.constructor === Child) - assert(c.constructor.super_ === Parent) - assert(Object.getPrototypeOf(c) === Child.prototype) - assert(Object.getPrototypeOf(Object.getPrototypeOf(c)) === Parent.prototype) - assert(c instanceof Child) - assert(c instanceof Parent) -} - -function Child() { - Parent.call(this) - test(this) -} - -function Parent() {} - -inherits(Child, Parent) - -var c = new Child -test(c) - -console.log('ok') diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index d6880b2f36e72b..08e918c0db9a62 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -47,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -56,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 4670f7f79f4d2a..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -30,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 306b73b34311e9..7933a525fc3ac5 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -2,51 +2,53 @@ "_args": [ [ { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" ] ], "_from": "balanced-match@>=0.4.1 <0.5.0", - "_id": "balanced-match@0.4.1", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/balanced-match-0.4.1.tgz_1462129663650_0.39764496590942144" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", "raw": "balanced-match@^0.4.1", - "rawSpec": "^0.4.1", "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz", - "_shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, "_spec": "balanced-match@^0.4.1", - "_where": "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -55,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.5.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "19053e2e0748eadb379da6c09d455cf5e1039335", - "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.1.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "7004b289baaaab6a832f4901735e29d37cc2a863", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -75,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -90,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -102,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.4.1" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index ad188114f925ce..479c7879db59ca 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -2,51 +2,53 @@ "_args": [ [ { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" + "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.4", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch/brace-expansion", - "_nodeVersion": "6.0.0", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.4.tgz_1462130058897_0.14984136167913675" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.8.6", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob/minimatch" + "/minimatch" ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz", - "_shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/zkat/Documents/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", + "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -58,26 +60,26 @@ }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.5.1" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "464a204c77f482c085c2a36c456bbfbafb67a127", - "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.4.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "1660b75d0bf03b022e7888b576cd5a4080692c1d", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -92,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -104,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.4" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json index ded42917e5f997..22bfd82a8e2718 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -1,43 +1,55 @@ { "_args": [ [ - "minimatch@2 || 3", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "minimatch@2 || 3", + { + "raw": "minimatch@2 || 3", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob" ] ], "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/init-package-json/glob/minimatch", - "_nodeVersion": "4.0.0", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", "raw": "minimatch@2 || 3", - "rawSpec": "2 || 3", "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ - "/init-package-json/glob" + "#USER", + "/" ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, "_spec": "minimatch@2 || 3", "_where": "/Users/rebecca/code/npm/node_modules/init-package-json/node_modules/glob", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { @@ -49,12 +61,12 @@ "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" @@ -62,14 +74,14 @@ "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", "license": "ISC", "main": "minimatch.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "minimatch", @@ -83,5 +95,5 @@ "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "3.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js index c049c20f9a2736..bf7aedb82d41fd 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/example/substack-input.js @@ -17,7 +17,7 @@ module.exports = { ; } catch (e) {} - + return prompt('description', value); })(), "main" : prompt('entry point', 'index.js'), diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js index 424152a802eb02..da1abca9535e4f 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/promzard.js @@ -235,3 +235,4 @@ PromZard.prototype.prompt = function (pdt, cb) { read({ prompt: prompt + ':' , default: def }, cb) } + diff --git a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js index bcf8791113ead7..034a86475afbd5 100644 --- a/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js +++ b/deps/npm/node_modules/init-package-json/node_modules/promzard/test/simple.js @@ -3,7 +3,7 @@ var promzard = require('../'); test('simple', function (t) { t.plan(1); - + var ctx = { tmpdir : '/tmp' } var file = __dirname + '/simple.input'; promzard(file, ctx, function (err, output) { @@ -19,11 +19,11 @@ test('simple', function (t) { output ); }); - + setTimeout(function () { process.stdin.emit('data', '\n'); }, 100); - + setTimeout(function () { process.stdin.emit('data', '55\n'); }, 200); diff --git a/deps/npm/node_modules/lodash.clonedeep/LICENSE b/deps/npm/node_modules/lodash.clonedeep/LICENSE index bcbe13d67a9621..e0c69d56032d15 100644 --- a/deps/npm/node_modules/lodash.clonedeep/LICENSE +++ b/deps/npm/node_modules/lodash.clonedeep/LICENSE @@ -1,23 +1,47 @@ -The MIT License (MIT) +Copyright jQuery Foundation and other contributors -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, +Based on Underscore.js, copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors -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. +This software consists of voluntary contributions made by many +individuals. For exact contribution history, see the revision history +available at https://github.com/lodash/lodash + +The following license applies to all parts of this software except as +documented below: + +==== + +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. + +==== + +Copyright and related rights for sample code are waived via CC0. Sample +code is defined as all source code displayed within the prose of the +documentation. + +CC0: http://creativecommons.org/publicdomain/zero/1.0/ + +==== + +Files located in the node_modules and vendor directories are externally +maintained libraries used by this software which have their own +licenses; we recommend you read them, as their terms may differ from the +terms above. diff --git a/deps/npm/node_modules/lodash.clonedeep/README.md b/deps/npm/node_modules/lodash.clonedeep/README.md index 1287ee1c00732a..fee48e4706a972 100644 --- a/deps/npm/node_modules/lodash.clonedeep/README.md +++ b/deps/npm/node_modules/lodash.clonedeep/README.md @@ -1,4 +1,4 @@ -# lodash.clonedeep v4.3.2 +# lodash.clonedeep v4.5.0 The [lodash](https://lodash.com/) method `_.cloneDeep` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var cloneDeep = require('lodash.clonedeep'); ``` -See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.3.2-npm-packages/lodash.clonedeep) for more details. +See the [documentation](https://lodash.com/docs#cloneDeep) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.clonedeep) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/index.js b/deps/npm/node_modules/lodash.clonedeep/index.js index 88794c2c4a3bfe..1b0e50298222d6 100644 --- a/deps/npm/node_modules/lodash.clonedeep/index.js +++ b/deps/npm/node_modules/lodash.clonedeep/index.js @@ -1,21 +1,1392 @@ /** - * lodash 4.3.2 (Custom Build) + * lodash (Custom Build) * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation + * Copyright jQuery Foundation and other contributors + * Released under MIT license * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license + * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseClone = require('lodash._baseclone'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var MAX_SAFE_INTEGER = 9007199254740991; + +/** `Object#toString` result references. */ +var argsTag = '[object Arguments]', + arrayTag = '[object Array]', + boolTag = '[object Boolean]', + dateTag = '[object Date]', + errorTag = '[object Error]', + funcTag = '[object Function]', + genTag = '[object GeneratorFunction]', + mapTag = '[object Map]', + numberTag = '[object Number]', + objectTag = '[object Object]', + promiseTag = '[object Promise]', + regexpTag = '[object RegExp]', + setTag = '[object Set]', + stringTag = '[object String]', + symbolTag = '[object Symbol]', + weakMapTag = '[object WeakMap]'; + +var arrayBufferTag = '[object ArrayBuffer]', + dataViewTag = '[object DataView]', + float32Tag = '[object Float32Array]', + float64Tag = '[object Float64Array]', + int8Tag = '[object Int8Array]', + int16Tag = '[object Int16Array]', + int32Tag = '[object Int32Array]', + uint8Tag = '[object Uint8Array]', + uint8ClampedTag = '[object Uint8ClampedArray]', + uint16Tag = '[object Uint16Array]', + uint32Tag = '[object Uint32Array]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to match `RegExp` flags from their coerced string values. */ +var reFlags = /\w*$/; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Used to detect unsigned integer values. */ +var reIsUint = /^(?:0|[1-9]\d*)$/; + +/** Used to identify `toStringTag` values supported by `_.clone`. */ +var cloneableTags = {}; +cloneableTags[argsTag] = cloneableTags[arrayTag] = +cloneableTags[arrayBufferTag] = cloneableTags[dataViewTag] = +cloneableTags[boolTag] = cloneableTags[dateTag] = +cloneableTags[float32Tag] = cloneableTags[float64Tag] = +cloneableTags[int8Tag] = cloneableTags[int16Tag] = +cloneableTags[int32Tag] = cloneableTags[mapTag] = +cloneableTags[numberTag] = cloneableTags[objectTag] = +cloneableTags[regexpTag] = cloneableTags[setTag] = +cloneableTags[stringTag] = cloneableTags[symbolTag] = +cloneableTags[uint8Tag] = cloneableTags[uint8ClampedTag] = +cloneableTags[uint16Tag] = cloneableTags[uint32Tag] = true; +cloneableTags[errorTag] = cloneableTags[funcTag] = +cloneableTags[weakMapTag] = false; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** Detect free variable `exports`. */ +var freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports; + +/** Detect free variable `module`. */ +var freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module; + +/** Detect the popular CommonJS extension `module.exports`. */ +var moduleExports = freeModule && freeModule.exports === freeExports; + +/** + * Adds the key-value `pair` to `map`. + * + * @private + * @param {Object} map The map to modify. + * @param {Array} pair The key-value pair to add. + * @returns {Object} Returns `map`. + */ +function addMapEntry(map, pair) { + // Don't return `map.set` because it's not chainable in IE 11. + map.set(pair[0], pair[1]); + return map; +} + +/** + * Adds `value` to `set`. + * + * @private + * @param {Object} set The set to modify. + * @param {*} value The value to add. + * @returns {Object} Returns `set`. + */ +function addSetEntry(set, value) { + // Don't return `set.add` because it's not chainable in IE 11. + set.add(value); + return set; +} + +/** + * A specialized version of `_.forEach` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns `array`. + */ +function arrayEach(array, iteratee) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (iteratee(array[index], index, array) === false) { + break; + } + } + return array; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * A specialized version of `_.reduce` for arrays without support for + * iteratee shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @param {*} [accumulator] The initial value. + * @param {boolean} [initAccum] Specify using the first element of `array` as + * the initial value. + * @returns {*} Returns the accumulated value. + */ +function arrayReduce(array, iteratee, accumulator, initAccum) { + var index = -1, + length = array ? array.length : 0; + + if (initAccum && length) { + accumulator = array[++index]; + } + while (++index < length) { + accumulator = iteratee(accumulator, array[index], index, array); + } + return accumulator; +} + +/** + * The base implementation of `_.times` without support for iteratee shorthands + * or max array length checks. + * + * @private + * @param {number} n The number of times to invoke `iteratee`. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the array of results. + */ +function baseTimes(n, iteratee) { + var index = -1, + result = Array(n); + + while (++index < n) { + result[index] = iteratee(index); + } + return result; +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `map` to its key-value pairs. + * + * @private + * @param {Object} map The map to convert. + * @returns {Array} Returns the key-value pairs. + */ +function mapToArray(map) { + var index = -1, + result = Array(map.size); + + map.forEach(function(value, key) { + result[++index] = [key, value]; + }); + return result; +} + +/** + * Creates a unary function that invokes `func` with its argument transformed. + * + * @private + * @param {Function} func The function to wrap. + * @param {Function} transform The argument transform. + * @returns {Function} Returns the new function. + */ +function overArg(func, transform) { + return function(arg) { + return func(transform(arg)); + }; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Buffer = moduleExports ? root.Buffer : undefined, + Symbol = root.Symbol, + Uint8Array = root.Uint8Array, + getPrototype = overArg(Object.getPrototypeOf, Object), + objectCreate = Object.create, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeGetSymbols = Object.getOwnPropertySymbols, + nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined, + nativeKeys = overArg(Object.keys, Object); + +/* Built-in method references that are verified to be native. */ +var DataView = getNative(root, 'DataView'), + Map = getNative(root, 'Map'), + Promise = getNative(root, 'Promise'), + Set = getNative(root, 'Set'), + WeakMap = getNative(root, 'WeakMap'), + nativeCreate = getNative(Object, 'create'); + +/** Used to detect maps, sets, and weakmaps. */ +var dataViewCtorString = toSource(DataView), + mapCtorString = toSource(Map), + promiseCtorString = toSource(Promise), + setCtorString = toSource(Set), + weakMapCtorString = toSource(WeakMap); + +/** Used to convert symbols to primitives and strings. */ +var symbolProto = Symbol ? Symbol.prototype : undefined, + symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * Creates a stack cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Stack(entries) { + this.__data__ = new ListCache(entries); +} + +/** + * Removes all key-value entries from the stack. + * + * @private + * @name clear + * @memberOf Stack + */ +function stackClear() { + this.__data__ = new ListCache; +} + +/** + * Removes `key` and its value from the stack. + * + * @private + * @name delete + * @memberOf Stack + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function stackDelete(key) { + return this.__data__['delete'](key); +} + +/** + * Gets the stack value for `key`. + * + * @private + * @name get + * @memberOf Stack + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function stackGet(key) { + return this.__data__.get(key); +} + +/** + * Checks if a stack value for `key` exists. + * + * @private + * @name has + * @memberOf Stack + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function stackHas(key) { + return this.__data__.has(key); +} + +/** + * Sets the stack `key` to `value`. + * + * @private + * @name set + * @memberOf Stack + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the stack cache instance. + */ +function stackSet(key, value) { + var cache = this.__data__; + if (cache instanceof ListCache) { + var pairs = cache.__data__; + if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) { + pairs.push([key, value]); + return this; + } + cache = this.__data__ = new MapCache(pairs); + } + cache.set(key, value); + return this; +} + +// Add methods to `Stack`. +Stack.prototype.clear = stackClear; +Stack.prototype['delete'] = stackDelete; +Stack.prototype.get = stackGet; +Stack.prototype.has = stackHas; +Stack.prototype.set = stackSet; + +/** + * Creates an array of the enumerable property names of the array-like `value`. + * + * @private + * @param {*} value The value to query. + * @param {boolean} inherited Specify returning inherited property names. + * @returns {Array} Returns the array of property names. + */ +function arrayLikeKeys(value, inherited) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + // Safari 9 makes `arguments.length` enumerable in strict mode. + var result = (isArray(value) || isArguments(value)) + ? baseTimes(value.length, String) + : []; + + var length = result.length, + skipIndexes = !!length; + + for (var key in value) { + if ((inherited || hasOwnProperty.call(value, key)) && + !(skipIndexes && (key == 'length' || isIndex(key, length)))) { + result.push(key); + } + } + return result; +} + +/** + * Assigns `value` to `key` of `object` if the existing value is not equivalent + * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * for equality comparisons. + * + * @private + * @param {Object} object The object to modify. + * @param {string} key The key of the property to assign. + * @param {*} value The value to assign. + */ +function assignValue(object, key, value) { + var objValue = object[key]; + if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || + (value === undefined && !(key in object))) { + object[key] = value; + } +} + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.assign` without support for multiple sources + * or `customizer` functions. + * + * @private + * @param {Object} object The destination object. + * @param {Object} source The source object. + * @returns {Object} Returns `object`. + */ +function baseAssign(object, source) { + return object && copyObject(source, keys(source), object); +} + +/** + * The base implementation of `_.clone` and `_.cloneDeep` which tracks + * traversed objects. + * + * @private + * @param {*} value The value to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @param {boolean} [isFull] Specify a clone including symbols. + * @param {Function} [customizer] The function to customize cloning. + * @param {string} [key] The key of `value`. + * @param {Object} [object] The parent object of `value`. + * @param {Object} [stack] Tracks traversed objects and their clone counterparts. + * @returns {*} Returns the cloned value. + */ +function baseClone(value, isDeep, isFull, customizer, key, object, stack) { + var result; + if (customizer) { + result = object ? customizer(value, key, object, stack) : customizer(value); + } + if (result !== undefined) { + return result; + } + if (!isObject(value)) { + return value; + } + var isArr = isArray(value); + if (isArr) { + result = initCloneArray(value); + if (!isDeep) { + return copyArray(value, result); + } + } else { + var tag = getTag(value), + isFunc = tag == funcTag || tag == genTag; + + if (isBuffer(value)) { + return cloneBuffer(value, isDeep); + } + if (tag == objectTag || tag == argsTag || (isFunc && !object)) { + if (isHostObject(value)) { + return object ? value : {}; + } + result = initCloneObject(isFunc ? {} : value); + if (!isDeep) { + return copySymbols(value, baseAssign(result, value)); + } + } else { + if (!cloneableTags[tag]) { + return object ? value : {}; + } + result = initCloneByTag(value, tag, baseClone, isDeep); + } + } + // Check for circular references and return its corresponding clone. + stack || (stack = new Stack); + var stacked = stack.get(value); + if (stacked) { + return stacked; + } + stack.set(value, result); + + if (!isArr) { + var props = isFull ? getAllKeys(value) : keys(value); + } + arrayEach(props || value, function(subValue, key) { + if (props) { + key = subValue; + subValue = value[key]; + } + // Recursively populate clone (susceptible to call stack limits). + assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); + }); + return result; +} + +/** + * The base implementation of `_.create` without support for assigning + * properties to the created object. + * + * @private + * @param {Object} prototype The object to inherit from. + * @returns {Object} Returns the new object. + */ +function baseCreate(proto) { + return isObject(proto) ? objectCreate(proto) : {}; +} + +/** + * The base implementation of `getAllKeys` and `getAllKeysIn` which uses + * `keysFunc` and `symbolsFunc` to get the enumerable property names and + * symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {Function} keysFunc The function to get the keys of `object`. + * @param {Function} symbolsFunc The function to get the symbols of `object`. + * @returns {Array} Returns the array of property names and symbols. + */ +function baseGetAllKeys(object, keysFunc, symbolsFunc) { + var result = keysFunc(object); + return isArray(object) ? result : arrayPush(result, symbolsFunc(object)); +} + +/** + * The base implementation of `getTag`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +function baseGetTag(value) { + return objectToString.call(value); +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.keys` which doesn't treat sparse arrays as dense. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + */ +function baseKeys(object) { + if (!isPrototype(object)) { + return nativeKeys(object); + } + var result = []; + for (var key in Object(object)) { + if (hasOwnProperty.call(object, key) && key != 'constructor') { + result.push(key); + } + } + return result; +} + +/** + * Creates a clone of `buffer`. + * + * @private + * @param {Buffer} buffer The buffer to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Buffer} Returns the cloned buffer. + */ +function cloneBuffer(buffer, isDeep) { + if (isDeep) { + return buffer.slice(); + } + var result = new buffer.constructor(buffer.length); + buffer.copy(result); + return result; +} + +/** + * Creates a clone of `arrayBuffer`. + * + * @private + * @param {ArrayBuffer} arrayBuffer The array buffer to clone. + * @returns {ArrayBuffer} Returns the cloned array buffer. + */ +function cloneArrayBuffer(arrayBuffer) { + var result = new arrayBuffer.constructor(arrayBuffer.byteLength); + new Uint8Array(result).set(new Uint8Array(arrayBuffer)); + return result; +} + +/** + * Creates a clone of `dataView`. + * + * @private + * @param {Object} dataView The data view to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned data view. + */ +function cloneDataView(dataView, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(dataView.buffer) : dataView.buffer; + return new dataView.constructor(buffer, dataView.byteOffset, dataView.byteLength); +} + +/** + * Creates a clone of `map`. + * + * @private + * @param {Object} map The map to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned map. + */ +function cloneMap(map, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(mapToArray(map), true) : mapToArray(map); + return arrayReduce(array, addMapEntry, new map.constructor); +} + +/** + * Creates a clone of `regexp`. + * + * @private + * @param {Object} regexp The regexp to clone. + * @returns {Object} Returns the cloned regexp. + */ +function cloneRegExp(regexp) { + var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); + result.lastIndex = regexp.lastIndex; + return result; +} + +/** + * Creates a clone of `set`. + * + * @private + * @param {Object} set The set to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned set. + */ +function cloneSet(set, isDeep, cloneFunc) { + var array = isDeep ? cloneFunc(setToArray(set), true) : setToArray(set); + return arrayReduce(array, addSetEntry, new set.constructor); +} + +/** + * Creates a clone of the `symbol` object. + * + * @private + * @param {Object} symbol The symbol object to clone. + * @returns {Object} Returns the cloned symbol object. + */ +function cloneSymbol(symbol) { + return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; +} + +/** + * Creates a clone of `typedArray`. + * + * @private + * @param {Object} typedArray The typed array to clone. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the cloned typed array. + */ +function cloneTypedArray(typedArray, isDeep) { + var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; + return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); +} + +/** + * Copies the values of `source` to `array`. + * + * @private + * @param {Array} source The array to copy values from. + * @param {Array} [array=[]] The array to copy values to. + * @returns {Array} Returns `array`. + */ +function copyArray(source, array) { + var index = -1, + length = source.length; + + array || (array = Array(length)); + while (++index < length) { + array[index] = source[index]; + } + return array; +} + +/** + * Copies properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy properties from. + * @param {Array} props The property identifiers to copy. + * @param {Object} [object={}] The object to copy properties to. + * @param {Function} [customizer] The function to customize copied values. + * @returns {Object} Returns `object`. + */ +function copyObject(source, props, object, customizer) { + object || (object = {}); + + var index = -1, + length = props.length; + + while (++index < length) { + var key = props[index]; + + var newValue = customizer + ? customizer(object[key], source[key], key, object, source) + : undefined; + + assignValue(object, key, newValue === undefined ? source[key] : newValue); + } + return object; +} + +/** + * Copies own symbol properties of `source` to `object`. + * + * @private + * @param {Object} source The object to copy symbols from. + * @param {Object} [object={}] The object to copy symbols to. + * @returns {Object} Returns `object`. + */ +function copySymbols(source, object) { + return copyObject(source, getSymbols(source), object); +} + +/** + * Creates an array of own enumerable property names and symbols of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names and symbols. + */ +function getAllKeys(object) { + return baseGetAllKeys(object, keys, getSymbols); +} + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Creates an array of the own enumerable symbol properties of `object`. + * + * @private + * @param {Object} object The object to query. + * @returns {Array} Returns the array of symbols. + */ +var getSymbols = nativeGetSymbols ? overArg(nativeGetSymbols, Object) : stubArray; + +/** + * Gets the `toStringTag` of `value`. + * + * @private + * @param {*} value The value to query. + * @returns {string} Returns the `toStringTag`. + */ +var getTag = baseGetTag; + +// Fallback for data views, maps, sets, and weak maps in IE 11, +// for data views in Edge < 14, and promises in Node.js. +if ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) || + (Map && getTag(new Map) != mapTag) || + (Promise && getTag(Promise.resolve()) != promiseTag) || + (Set && getTag(new Set) != setTag) || + (WeakMap && getTag(new WeakMap) != weakMapTag)) { + getTag = function(value) { + var result = objectToString.call(value), + Ctor = result == objectTag ? value.constructor : undefined, + ctorString = Ctor ? toSource(Ctor) : undefined; + + if (ctorString) { + switch (ctorString) { + case dataViewCtorString: return dataViewTag; + case mapCtorString: return mapTag; + case promiseCtorString: return promiseTag; + case setCtorString: return setTag; + case weakMapCtorString: return weakMapTag; + } + } + return result; + }; +} + +/** + * Initializes an array clone. + * + * @private + * @param {Array} array The array to clone. + * @returns {Array} Returns the initialized clone. + */ +function initCloneArray(array) { + var length = array.length, + result = array.constructor(length); + + // Add properties assigned by `RegExp#exec`. + if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { + result.index = array.index; + result.input = array.input; + } + return result; +} + +/** + * Initializes an object clone. + * + * @private + * @param {Object} object The object to clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneObject(object) { + return (typeof object.constructor == 'function' && !isPrototype(object)) + ? baseCreate(getPrototype(object)) + : {}; +} + +/** + * Initializes an object clone based on its `toStringTag`. + * + * **Note:** This function only supports cloning values with tags of + * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. + * + * @private + * @param {Object} object The object to clone. + * @param {string} tag The `toStringTag` of the object to clone. + * @param {Function} cloneFunc The function to clone values. + * @param {boolean} [isDeep] Specify a deep clone. + * @returns {Object} Returns the initialized clone. + */ +function initCloneByTag(object, tag, cloneFunc, isDeep) { + var Ctor = object.constructor; + switch (tag) { + case arrayBufferTag: + return cloneArrayBuffer(object); + + case boolTag: + case dateTag: + return new Ctor(+object); + + case dataViewTag: + return cloneDataView(object, isDeep); + + case float32Tag: case float64Tag: + case int8Tag: case int16Tag: case int32Tag: + case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: + return cloneTypedArray(object, isDeep); + + case mapTag: + return cloneMap(object, isDeep, cloneFunc); + + case numberTag: + case stringTag: + return new Ctor(object); + + case regexpTag: + return cloneRegExp(object); + + case setTag: + return cloneSet(object, isDeep, cloneFunc); + + case symbolTag: + return cloneSymbol(object); + } +} + +/** + * Checks if `value` is a valid array-like index. + * + * @private + * @param {*} value The value to check. + * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. + * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. + */ +function isIndex(value, length) { + length = length == null ? MAX_SAFE_INTEGER : length; + return !!length && + (typeof value == 'number' || reIsUint.test(value)) && + (value > -1 && value % 1 == 0 && value < length); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Checks if `value` is likely a prototype object. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. + */ +function isPrototype(value) { + var Ctor = value && value.constructor, + proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; + + return value === proto; +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * This method is like `_.clone` except that it recursively clones `value`. * * @static * @memberOf _ + * @since 1.0.0 * @category Lang * @param {*} value The value to recursively clone. * @returns {*} Returns the deep cloned value. + * @see _.clone * @example * * var objects = [{ 'a': 1 }, { 'b': 2 }]; @@ -28,4 +1399,350 @@ function cloneDeep(value) { return baseClone(value, true, true); } +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + +/** + * Checks if `value` is array-like. A value is considered array-like if it's + * not a function and has a `value.length` that's an integer greater than or + * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is array-like, else `false`. + * @example + * + * _.isArrayLike([1, 2, 3]); + * // => true + * + * _.isArrayLike(document.body.children); + * // => true + * + * _.isArrayLike('abc'); + * // => true + * + * _.isArrayLike(_.noop); + * // => false + */ +function isArrayLike(value) { + return value != null && isLength(value.length) && !isFunction(value); +} + +/** + * This method is like `_.isArrayLike` except that it also checks if `value` + * is an object. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array-like object, + * else `false`. + * @example + * + * _.isArrayLikeObject([1, 2, 3]); + * // => true + * + * _.isArrayLikeObject(document.body.children); + * // => true + * + * _.isArrayLikeObject('abc'); + * // => false + * + * _.isArrayLikeObject(_.noop); + * // => false + */ +function isArrayLikeObject(value) { + return isObjectLike(value) && isArrayLike(value); +} + +/** + * Checks if `value` is a buffer. + * + * @static + * @memberOf _ + * @since 4.3.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. + * @example + * + * _.isBuffer(new Buffer(2)); + * // => true + * + * _.isBuffer(new Uint8Array(2)); + * // => false + */ +var isBuffer = nativeIsBuffer || stubFalse; + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is a valid array-like length. + * + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. + * @example + * + * _.isLength(3); + * // => true + * + * _.isLength(Number.MIN_VALUE); + * // => false + * + * _.isLength(Infinity); + * // => false + * + * _.isLength('3'); + * // => false + */ +function isLength(value) { + return typeof value == 'number' && + value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * Checks if `value` is object-like. A value is object-like if it's not `null` + * and has a `typeof` result of "object". + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is object-like, else `false`. + * @example + * + * _.isObjectLike({}); + * // => true + * + * _.isObjectLike([1, 2, 3]); + * // => true + * + * _.isObjectLike(_.noop); + * // => false + * + * _.isObjectLike(null); + * // => false + */ +function isObjectLike(value) { + return !!value && typeof value == 'object'; +} + +/** + * Creates an array of the own enumerable property names of `object`. + * + * **Note:** Non-object values are coerced to objects. See the + * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys) + * for more details. + * + * @static + * @since 0.1.0 + * @memberOf _ + * @category Object + * @param {Object} object The object to query. + * @returns {Array} Returns the array of property names. + * @example + * + * function Foo() { + * this.a = 1; + * this.b = 2; + * } + * + * Foo.prototype.c = 3; + * + * _.keys(new Foo); + * // => ['a', 'b'] (iteration order is not guaranteed) + * + * _.keys('hi'); + * // => ['0', '1'] + */ +function keys(object) { + return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object); +} + +/** + * This method returns a new empty array. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {Array} Returns the new empty array. + * @example + * + * var arrays = _.times(2, _.stubArray); + * + * console.log(arrays); + * // => [[], []] + * + * console.log(arrays[0] === arrays[1]); + * // => false + */ +function stubArray() { + return []; +} + +/** + * This method returns `false`. + * + * @static + * @memberOf _ + * @since 4.13.0 + * @category Util + * @returns {boolean} Returns `false`. + * @example + * + * _.times(2, _.stubFalse); + * // => [false, false] + */ +function stubFalse() { + return false; +} + module.exports = cloneDeep; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE deleted file mode 100644 index bcbe13d67a9621..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md deleted file mode 100644 index 7c997274efee06..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseclone v4.5.3 - -The internal [lodash](https://lodash.com/) function `baseClone` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseclone -``` - -In Node.js: -```js -var baseClone = require('lodash._baseclone'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.5.3-npm-packages/lodash._baseclone) for more details. diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js deleted file mode 100644 index 4781750782800a..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/index.js +++ /dev/null @@ -1,1644 +0,0 @@ -/** - * lodash 4.5.3 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - arrayTag = '[object Array]', - boolTag = '[object Boolean]', - dateTag = '[object Date]', - errorTag = '[object Error]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - mapTag = '[object Map]', - numberTag = '[object Number]', - objectTag = '[object Object]', - regexpTag = '[object RegExp]', - setTag = '[object Set]', - stringTag = '[object String]', - symbolTag = '[object Symbol]', - weakMapTag = '[object WeakMap]'; - -var arrayBufferTag = '[object ArrayBuffer]', - float32Tag = '[object Float32Array]', - float64Tag = '[object Float64Array]', - int8Tag = '[object Int8Array]', - int16Tag = '[object Int16Array]', - int32Tag = '[object Int32Array]', - uint8Tag = '[object Uint8Array]', - uint8ClampedTag = '[object Uint8ClampedArray]', - uint16Tag = '[object Uint16Array]', - uint32Tag = '[object Uint32Array]'; - -/** Used to match `RegExp` [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to match `RegExp` flags from their coerced string values. */ -var reFlags = /\w*$/; - -/** Used to detect host constructors (Safari > 5). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** Used to detect unsigned integer values. */ -var reIsUint = /^(?:0|[1-9]\d*)$/; - -/** Used to identify `toStringTag` values supported by `_.clone`. */ -var cloneableTags = {}; -cloneableTags[argsTag] = cloneableTags[arrayTag] = -cloneableTags[arrayBufferTag] = cloneableTags[boolTag] = -cloneableTags[dateTag] = cloneableTags[float32Tag] = -cloneableTags[float64Tag] = cloneableTags[int8Tag] = -cloneableTags[int16Tag] = cloneableTags[int32Tag] = -cloneableTags[mapTag] = cloneableTags[numberTag] = -cloneableTags[objectTag] = cloneableTags[regexpTag] = -cloneableTags[setTag] = cloneableTags[stringTag] = -cloneableTags[symbolTag] = cloneableTags[uint8Tag] = -cloneableTags[uint8ClampedTag] = cloneableTags[uint16Tag] = -cloneableTags[uint32Tag] = true; -cloneableTags[errorTag] = cloneableTags[funcTag] = -cloneableTags[weakMapTag] = false; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect the popular CommonJS extension `module.exports`. */ -var moduleExports = (freeModule && freeModule.exports === freeExports) - ? freeExports - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Adds the key-value `pair` to `map`. - * - * @private - * @param {Object} map The map to modify. - * @param {Array} pair The key-value pair to add. - * @returns {Object} Returns `map`. - */ -function addMapEntry(map, pair) { - // Don't return `Map#set` because it doesn't return the map instance in IE 11. - map.set(pair[0], pair[1]); - return map; -} - -/** - * Adds `value` to `set`. - * - * @private - * @param {Object} set The set to modify. - * @param {*} value The value to add. - * @returns {Object} Returns `set`. - */ -function addSetEntry(set, value) { - set.add(value); - return set; -} - -/** - * A specialized version of `_.forEach` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns `array`. - */ -function arrayEach(array, iteratee) { - var index = -1, - length = array.length; - - while (++index < length) { - if (iteratee(array[index], index, array) === false) { - break; - } - } - return array; -} - -/** - * A specialized version of `_.reduce` for arrays without support for - * iteratee shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {*} [accumulator] The initial value. - * @param {boolean} [initAccum] Specify using the first element of `array` as the initial value. - * @returns {*} Returns the accumulated value. - */ -function arrayReduce(array, iteratee, accumulator, initAccum) { - var index = -1, - length = array.length; - - if (initAccum && length) { - accumulator = array[++index]; - } - while (++index < length) { - accumulator = iteratee(accumulator, array[index], index, array); - } - return accumulator; -} - -/** - * The base implementation of `_.times` without support for iteratee shorthands - * or max array length checks. - * - * @private - * @param {number} n The number of times to invoke `iteratee`. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the array of results. - */ -function baseTimes(n, iteratee) { - var index = -1, - result = Array(n); - - while (++index < n) { - result[index] = iteratee(index); - } - return result; -} - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** - * Checks if `value` is a valid array-like index. - * - * @private - * @param {*} value The value to check. - * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index. - * @returns {boolean} Returns `true` if `value` is a valid index, else `false`. - */ -function isIndex(value, length) { - value = (typeof value == 'number' || reIsUint.test(value)) ? +value : -1; - length = length == null ? MAX_SAFE_INTEGER : length; - return value > -1 && value % 1 == 0 && value < length; -} - -/** - * Converts `map` to an array. - * - * @private - * @param {Object} map The map to convert. - * @returns {Array} Returns the converted array. - */ -function mapToArray(map) { - var index = -1, - result = Array(map.size); - - map.forEach(function(value, key) { - result[++index] = [key, value]; - }); - return result; -} - -/** - * Converts `set` to an array. - * - * @private - * @param {Object} set The set to convert. - * @returns {Array} Returns the converted array. - */ -function setToArray(set) { - var index = -1, - result = Array(set.size); - - set.forEach(function(value) { - result[++index] = value; - }); - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var Buffer = moduleExports ? root.Buffer : undefined, - Symbol = root.Symbol, - Uint8Array = root.Uint8Array, - getPrototypeOf = Object.getPrototypeOf, - getOwnPropertySymbols = Object.getOwnPropertySymbols, - objectCreate = Object.create, - propertyIsEnumerable = objectProto.propertyIsEnumerable, - splice = arrayProto.splice; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeKeys = Object.keys; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - Set = getNative(root, 'Set'), - WeakMap = getNative(root, 'WeakMap'), - nativeCreate = getNative(Object, 'create'); - -/** Used to detect maps, sets, and weakmaps. */ -var mapCtorString = Map ? funcToString.call(Map) : '', - setCtorString = Set ? funcToString.call(Set) : '', - weakMapCtorString = WeakMap ? funcToString.call(WeakMap) : ''; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolValueOf = symbolProto ? symbolProto.valueOf : undefined; - -/** - * Creates an hash object. - * - * @private - * @constructor - * @returns {Object} Returns the new hash object. - */ -function Hash() {} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(hash, key) { - return hashHas(hash, key) && delete hash[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(hash, key) { - if (nativeCreate) { - var result = hash[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(hash, key) ? hash[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @param {Object} hash The hash to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(hash, key) { - return nativeCreate ? hash[key] !== undefined : hasOwnProperty.call(hash, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function hashSet(hash, key, value) { - hash[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; -} - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function MapCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapClear() { - this.__data__ = { - 'hash': new Hash, - 'map': Map ? new Map : [], - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapDelete(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashDelete(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map['delete'](key) : assocDelete(data.map, key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapGet(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashGet(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.get(key) : assocGet(data.map, key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapHas(key) { - var data = this.__data__; - if (isKeyable(key)) { - return hashHas(typeof key == 'string' ? data.string : data.hash, key); - } - return Map ? data.map.has(key) : assocHas(data.map, key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache object. - */ -function mapSet(key, value) { - var data = this.__data__; - if (isKeyable(key)) { - hashSet(typeof key == 'string' ? data.string : data.hash, key, value); - } else if (Map) { - data.map.set(key, value); - } else { - assocSet(data.map, key, value); - } - return this; -} - -/** - * Creates a stack cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function Stack(values) { - var index = -1, - length = values ? values.length : 0; - - this.clear(); - while (++index < length) { - var entry = values[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the stack. - * - * @private - * @name clear - * @memberOf Stack - */ -function stackClear() { - this.__data__ = { 'array': [], 'map': null }; -} - -/** - * Removes `key` and its value from the stack. - * - * @private - * @name delete - * @memberOf Stack - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function stackDelete(key) { - var data = this.__data__, - array = data.array; - - return array ? assocDelete(array, key) : data.map['delete'](key); -} - -/** - * Gets the stack value for `key`. - * - * @private - * @name get - * @memberOf Stack - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function stackGet(key) { - var data = this.__data__, - array = data.array; - - return array ? assocGet(array, key) : data.map.get(key); -} - -/** - * Checks if a stack value for `key` exists. - * - * @private - * @name has - * @memberOf Stack - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function stackHas(key) { - var data = this.__data__, - array = data.array; - - return array ? assocHas(array, key) : data.map.has(key); -} - -/** - * Sets the stack `key` to `value`. - * - * @private - * @name set - * @memberOf Stack - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the stack cache object. - */ -function stackSet(key, value) { - var data = this.__data__, - array = data.array; - - if (array) { - if (array.length < (LARGE_ARRAY_SIZE - 1)) { - assocSet(array, key, value); - } else { - data.array = null; - data.map = new MapCache(array); - } - } - var map = data.map; - if (map) { - map.set(key, value); - } - return this; -} - -/** - * Removes `key` and its value from the associative array. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function assocDelete(array, key) { - var index = assocIndexOf(array, key); - if (index < 0) { - return false; - } - var lastIndex = array.length - 1; - if (index == lastIndex) { - array.pop(); - } else { - splice.call(array, index, 1); - } - return true; -} - -/** - * Gets the associative array value for `key`. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function assocGet(array, key) { - var index = assocIndexOf(array, key); - return index < 0 ? undefined : array[index][1]; -} - -/** - * Checks if an associative array value for `key` exists. - * - * @private - * @param {Array} array The array to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function assocHas(array, key) { - return assocIndexOf(array, key) > -1; -} - -/** - * Gets the index at which the first occurrence of `key` is found in `array` - * of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * Sets the associative array `key` to `value`. - * - * @private - * @param {Array} array The array to modify. - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - */ -function assocSet(array, key, value) { - var index = assocIndexOf(array, key); - if (index < 0) { - array.push([key, value]); - } else { - array[index][1] = value; - } -} - -/** - * Assigns `value` to `key` of `object` if the existing value is not equivalent - * using [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * for equality comparisons. - * - * @private - * @param {Object} object The object to modify. - * @param {string} key The key of the property to assign. - * @param {*} value The value to assign. - */ -function assignValue(object, key, value) { - var objValue = object[key]; - if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) || - (value === undefined && !(key in object))) { - object[key] = value; - } -} - -/** - * The base implementation of `_.assign` without support for multiple sources - * or `customizer` functions. - * - * @private - * @param {Object} object The destination object. - * @param {Object} source The source object. - * @returns {Object} Returns `object`. - */ -function baseAssign(object, source) { - return object && copyObject(source, keys(source), object); -} - -/** - * The base implementation of `_.clone` and `_.cloneDeep` which tracks - * traversed objects. - * - * @private - * @param {*} value The value to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @param {boolean} [isFull] Specify a clone including symbols. - * @param {Function} [customizer] The function to customize cloning. - * @param {string} [key] The key of `value`. - * @param {Object} [object] The parent object of `value`. - * @param {Object} [stack] Tracks traversed objects and their clone counterparts. - * @returns {*} Returns the cloned value. - */ -function baseClone(value, isDeep, isFull, customizer, key, object, stack) { - var result; - if (customizer) { - result = object ? customizer(value, key, object, stack) : customizer(value); - } - if (result !== undefined) { - return result; - } - if (!isObject(value)) { - return value; - } - var isArr = isArray(value); - if (isArr) { - result = initCloneArray(value); - if (!isDeep) { - return copyArray(value, result); - } - } else { - var tag = getTag(value), - isFunc = tag == funcTag || tag == genTag; - - if (isBuffer(value)) { - return cloneBuffer(value, isDeep); - } - if (tag == objectTag || tag == argsTag || (isFunc && !object)) { - if (isHostObject(value)) { - return object ? value : {}; - } - result = initCloneObject(isFunc ? {} : value); - if (!isDeep) { - result = baseAssign(result, value); - return isFull ? copySymbols(value, result) : result; - } - } else { - if (!cloneableTags[tag]) { - return object ? value : {}; - } - result = initCloneByTag(value, tag, isDeep); - } - } - // Check for circular references and return its corresponding clone. - stack || (stack = new Stack); - var stacked = stack.get(value); - if (stacked) { - return stacked; - } - stack.set(value, result); - - // Recursively populate clone (susceptible to call stack limits). - (isArr ? arrayEach : baseForOwn)(value, function(subValue, key) { - assignValue(result, key, baseClone(subValue, isDeep, isFull, customizer, key, value, stack)); - }); - return (isFull && !isArr) ? copySymbols(value, result) : result; -} - -/** - * The base implementation of `_.create` without support for assigning - * properties to the created object. - * - * @private - * @param {Object} prototype The object to inherit from. - * @returns {Object} Returns the new object. - */ -function baseCreate(proto) { - return isObject(proto) ? objectCreate(proto) : {}; -} - -/** - * The base implementation of `baseForIn` and `baseForOwn` which iterates - * over `object` properties returned by `keysFunc` invoking `iteratee` for - * each property. Iteratee functions may exit iteration early by explicitly - * returning `false`. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @param {Function} keysFunc The function to get the keys of `object`. - * @returns {Object} Returns `object`. - */ -var baseFor = createBaseFor(); - -/** - * The base implementation of `_.forOwn` without support for iteratee shorthands. - * - * @private - * @param {Object} object The object to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Object} Returns `object`. - */ -function baseForOwn(object, iteratee) { - return object && baseFor(object, iteratee, keys); -} - -/** - * The base implementation of `_.has` without support for deep paths. - * - * @private - * @param {Object} object The object to query. - * @param {Array|string} key The key to check. - * @returns {boolean} Returns `true` if `key` exists, else `false`. - */ -function baseHas(object, key) { - // Avoid a bug in IE 10-11 where objects with a [[Prototype]] of `null`, - // that are composed entirely of index properties, return `false` for - // `hasOwnProperty` checks of them. - return hasOwnProperty.call(object, key) || - (typeof object == 'object' && key in object && getPrototypeOf(object) === null); -} - -/** - * The base implementation of `_.keys` which doesn't skip the constructor - * property of prototypes or treat sparse arrays as dense. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - */ -function baseKeys(object) { - return nativeKeys(Object(object)); -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Creates a clone of `buffer`. - * - * @private - * @param {Buffer} buffer The buffer to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Buffer} Returns the cloned buffer. - */ -function cloneBuffer(buffer, isDeep) { - if (isDeep) { - return buffer.slice(); - } - var result = new buffer.constructor(buffer.length); - buffer.copy(result); - return result; -} - -/** - * Creates a clone of `arrayBuffer`. - * - * @private - * @param {ArrayBuffer} arrayBuffer The array buffer to clone. - * @returns {ArrayBuffer} Returns the cloned array buffer. - */ -function cloneArrayBuffer(arrayBuffer) { - var result = new arrayBuffer.constructor(arrayBuffer.byteLength); - new Uint8Array(result).set(new Uint8Array(arrayBuffer)); - return result; -} - -/** - * Creates a clone of `map`. - * - * @private - * @param {Object} map The map to clone. - * @returns {Object} Returns the cloned map. - */ -function cloneMap(map) { - return arrayReduce(mapToArray(map), addMapEntry, new map.constructor); -} - -/** - * Creates a clone of `regexp`. - * - * @private - * @param {Object} regexp The regexp to clone. - * @returns {Object} Returns the cloned regexp. - */ -function cloneRegExp(regexp) { - var result = new regexp.constructor(regexp.source, reFlags.exec(regexp)); - result.lastIndex = regexp.lastIndex; - return result; -} - -/** - * Creates a clone of `set`. - * - * @private - * @param {Object} set The set to clone. - * @returns {Object} Returns the cloned set. - */ -function cloneSet(set) { - return arrayReduce(setToArray(set), addSetEntry, new set.constructor); -} - -/** - * Creates a clone of the `symbol` object. - * - * @private - * @param {Object} symbol The symbol object to clone. - * @returns {Object} Returns the cloned symbol object. - */ -function cloneSymbol(symbol) { - return symbolValueOf ? Object(symbolValueOf.call(symbol)) : {}; -} - -/** - * Creates a clone of `typedArray`. - * - * @private - * @param {Object} typedArray The typed array to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the cloned typed array. - */ -function cloneTypedArray(typedArray, isDeep) { - var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer; - return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length); -} - -/** - * Copies the values of `source` to `array`. - * - * @private - * @param {Array} source The array to copy values from. - * @param {Array} [array=[]] The array to copy values to. - * @returns {Array} Returns `array`. - */ -function copyArray(source, array) { - var index = -1, - length = source.length; - - array || (array = Array(length)); - while (++index < length) { - array[index] = source[index]; - } - return array; -} - -/** - * Copies properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @returns {Object} Returns `object`. - */ -function copyObject(source, props, object) { - return copyObjectWith(source, props, object); -} - -/** - * This function is like `copyObject` except that it accepts a function to - * customize copied values. - * - * @private - * @param {Object} source The object to copy properties from. - * @param {Array} props The property names to copy. - * @param {Object} [object={}] The object to copy properties to. - * @param {Function} [customizer] The function to customize copied values. - * @returns {Object} Returns `object`. - */ -function copyObjectWith(source, props, object, customizer) { - object || (object = {}); - - var index = -1, - length = props.length; - - while (++index < length) { - var key = props[index]; - - var newValue = customizer - ? customizer(object[key], source[key], key, object, source) - : source[key]; - - assignValue(object, key, newValue); - } - return object; -} - -/** - * Copies own symbol properties of `source` to `object`. - * - * @private - * @param {Object} source The object to copy symbols from. - * @param {Object} [object={}] The object to copy symbols to. - * @returns {Object} Returns `object`. - */ -function copySymbols(source, object) { - return copyObject(source, getSymbols(source), object); -} - -/** - * Creates a base function for methods like `_.forIn`. - * - * @private - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {Function} Returns the new base function. - */ -function createBaseFor(fromRight) { - return function(object, iteratee, keysFunc) { - var index = -1, - iterable = Object(object), - props = keysFunc(object), - length = props.length; - - while (length--) { - var key = props[fromRight ? length : ++index]; - if (iteratee(iterable[key], key, iterable) === false) { - break; - } - } - return object; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) - * that affects Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Creates an array of the own symbol properties of `object`. - * - * @private - * @param {Object} object The object to query. - * @returns {Array} Returns the array of symbols. - */ -var getSymbols = getOwnPropertySymbols || function() { - return []; -}; - -/** - * Gets the `toStringTag` of `value`. - * - * @private - * @param {*} value The value to query. - * @returns {string} Returns the `toStringTag`. - */ -function getTag(value) { - return objectToString.call(value); -} - -// Fallback for IE 11 providing `toStringTag` values for maps, sets, and weakmaps. -if ((Map && getTag(new Map) != mapTag) || - (Set && getTag(new Set) != setTag) || - (WeakMap && getTag(new WeakMap) != weakMapTag)) { - getTag = function(value) { - var result = objectToString.call(value), - Ctor = result == objectTag ? value.constructor : null, - ctorString = typeof Ctor == 'function' ? funcToString.call(Ctor) : ''; - - if (ctorString) { - switch (ctorString) { - case mapCtorString: return mapTag; - case setCtorString: return setTag; - case weakMapCtorString: return weakMapTag; - } - } - return result; - }; -} - -/** - * Initializes an array clone. - * - * @private - * @param {Array} array The array to clone. - * @returns {Array} Returns the initialized clone. - */ -function initCloneArray(array) { - var length = array.length, - result = array.constructor(length); - - // Add properties assigned by `RegExp#exec`. - if (length && typeof array[0] == 'string' && hasOwnProperty.call(array, 'index')) { - result.index = array.index; - result.input = array.input; - } - return result; -} - -/** - * Initializes an object clone. - * - * @private - * @param {Object} object The object to clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneObject(object) { - return (typeof object.constructor == 'function' && !isPrototype(object)) - ? baseCreate(getPrototypeOf(object)) - : {}; -} - -/** - * Initializes an object clone based on its `toStringTag`. - * - * **Note:** This function only supports cloning values with tags of - * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`. - * - * @private - * @param {Object} object The object to clone. - * @param {string} tag The `toStringTag` of the object to clone. - * @param {boolean} [isDeep] Specify a deep clone. - * @returns {Object} Returns the initialized clone. - */ -function initCloneByTag(object, tag, isDeep) { - var Ctor = object.constructor; - switch (tag) { - case arrayBufferTag: - return cloneArrayBuffer(object); - - case boolTag: - case dateTag: - return new Ctor(+object); - - case float32Tag: case float64Tag: - case int8Tag: case int16Tag: case int32Tag: - case uint8Tag: case uint8ClampedTag: case uint16Tag: case uint32Tag: - return cloneTypedArray(object, isDeep); - - case mapTag: - return cloneMap(object); - - case numberTag: - case stringTag: - return new Ctor(object); - - case regexpTag: - return cloneRegExp(object); - - case setTag: - return cloneSet(object); - - case symbolTag: - return cloneSymbol(object); - } -} - -/** - * Creates an array of index keys for `object` values of arrays, - * `arguments` objects, and strings, otherwise `null` is returned. - * - * @private - * @param {Object} object The object to query. - * @returns {Array|null} Returns index keys, else `null`. - */ -function indexKeys(object) { - var length = object ? object.length : undefined; - if (isLength(length) && - (isArray(object) || isString(object) || isArguments(object))) { - return baseTimes(length, String); - } - return null; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return type == 'number' || type == 'boolean' || - (type == 'string' && value != '__proto__') || value == null; -} - -/** - * Checks if `value` is likely a prototype object. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a prototype, else `false`. - */ -function isPrototype(value) { - var Ctor = value && value.constructor, - proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto; - - return value === proto; -} - -/** - * Performs a [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is a buffer. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a buffer, else `false`. - * @example - * - * _.isBuffer(new Buffer(2)); - * // => true - * - * _.isBuffer(new Uint8Array(2)); - * // => false - */ -var isBuffer = !Buffer ? constant(false) : function(value) { - return value instanceof Buffer; -}; - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`. - * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (value == null) { - return false; - } - if (isFunction(value)) { - return reIsNative.test(funcToString.call(value)); - } - return isObjectLike(value) && - (isHostObject(value) ? reIsNative : reIsHostCtor).test(value); -} - -/** - * Checks if `value` is classified as a `String` primitive or object. - * - * @static - * @memberOf _ - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`. - * @example - * - * _.isString('abc'); - * // => true - * - * _.isString(1); - * // => false - */ -function isString(value) { - return typeof value == 'string' || - (!isArray(value) && isObjectLike(value) && objectToString.call(value) == stringTag); -} - -/** - * Creates an array of the own enumerable property names of `object`. - * - * **Note:** Non-object values are coerced to objects. See the - * [ES spec](http://ecma-international.org/ecma-262/6.0/#sec-object.keys) - * for more details. - * - * @static - * @memberOf _ - * @category Object - * @param {Object} object The object to query. - * @returns {Array} Returns the array of property names. - * @example - * - * function Foo() { - * this.a = 1; - * this.b = 2; - * } - * - * Foo.prototype.c = 3; - * - * _.keys(new Foo); - * // => ['a', 'b'] (iteration order is not guaranteed) - * - * _.keys('hi'); - * // => ['0', '1'] - */ -function keys(object) { - var isProto = isPrototype(object); - if (!(isProto || isArrayLike(object))) { - return baseKeys(object); - } - var indexes = indexKeys(object), - skipIndexes = !!indexes, - result = indexes || [], - length = result.length; - - for (var key in object) { - if (baseHas(object, key) && - !(skipIndexes && (key == 'length' || isIndex(key, length))) && - !(isProto && key == 'constructor')) { - result.push(key); - } - } - return result; -} - -/** - * Creates a function that returns `value`. - * - * @static - * @memberOf _ - * @category Util - * @param {*} value The value to return from the new function. - * @returns {Function} Returns the new function. - * @example - * - * var object = { 'user': 'fred' }; - * var getter = _.constant(object); - * - * getter() === object; - * // => true - */ -function constant(value) { - return function() { - return value; - }; -} - -// Avoid inheriting from `Object.prototype` when possible. -Hash.prototype = nativeCreate ? nativeCreate(null) : objectProto; - -// Add functions to the `MapCache`. -MapCache.prototype.clear = mapClear; -MapCache.prototype['delete'] = mapDelete; -MapCache.prototype.get = mapGet; -MapCache.prototype.has = mapHas; -MapCache.prototype.set = mapSet; - -// Add functions to the `Stack` cache. -Stack.prototype.clear = stackClear; -Stack.prototype['delete'] = stackDelete; -Stack.prototype.get = stackGet; -Stack.prototype.has = stackHas; -Stack.prototype.set = stackSet; - -module.exports = baseClone; diff --git a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json b/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json deleted file mode 100644 index 64c0ac7a1411d5..00000000000000 --- a/deps/npm/node_modules/lodash.clonedeep/node_modules/lodash._baseclone/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseclone@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.clonedeep" - ] - ], - "_from": "lodash._baseclone@>=4.0.0 <5.0.0", - "_id": "lodash._baseclone@4.5.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.clonedeep/lodash._baseclone", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._baseclone-4.5.3.tgz_1456902628287_0.513930449495092" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.17", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseclone", - "raw": "lodash._baseclone@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.clonedeep" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz", - "_shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", - "_shrinkwrap": null, - "_spec": "lodash._baseclone@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.clonedeep", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseClone` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "c3f6df594c44c16012f9ecd59e58d5f70d3d72e2", - "tarball": "http://registry.npmjs.org/lodash._baseclone/-/lodash._baseclone-4.5.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseclone", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.3" -} diff --git a/deps/npm/node_modules/lodash.clonedeep/package.json b/deps/npm/node_modules/lodash.clonedeep/package.json index 9da20a9494d7fc..daac794ccd2fcc 100644 --- a/deps/npm/node_modules/lodash.clonedeep/package.json +++ b/deps/npm/node_modules/lodash.clonedeep/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.clonedeep@4.3.2", + { + "raw": "lodash.clonedeep@4.5.0", + "scope": null, + "escapedName": "lodash.clonedeep", + "name": "lodash.clonedeep", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" + }, "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.clonedeep@4.3.2", - "_id": "lodash.clonedeep@4.3.2", + "_from": "lodash.clonedeep@4.5.0", + "_id": "lodash.clonedeep@4.5.0", "_inCache": true, - "_installable": true, "_location": "/lodash.clonedeep", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.clonedeep-4.3.2.tgz_1459310662712_0.4621682942379266" + "tmp": "tmp/lodash.clonedeep-4.5.0.tgz_1471109839710_0.7944763591513038" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.1", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.clonedeep", - "raw": "lodash.clonedeep@4.3.2", - "rawSpec": "4.3.2", + "raw": "lodash.clonedeep@4.5.0", "scope": null, - "spec": "4.3.2", + "escapedName": "lodash.clonedeep", + "name": "lodash.clonedeep", + "rawSpec": "4.5.0", + "spec": "4.5.0", "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz", - "_shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", + "_resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "_shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", "_shrinkwrap": null, - "_spec": "lodash.clonedeep@4.3.2", + "_spec": "lodash.clonedeep@4.5.0", "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,30 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseclone": "~4.5.0" - }, + "dependencies": {}, "description": "The lodash method `_.cloneDeep` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "d0112c02c76b5223833aebc6a4b6e334f0d057de", - "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.3.2.tgz" + "shasum": "e23f3f9c4f8fbdde872529c1071857a086e5ccef", + "tarball": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -81,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.clonedeep", @@ -103,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.3.2" + "version": "4.5.0" } diff --git a/deps/npm/node_modules/lodash.union/README.md b/deps/npm/node_modules/lodash.union/README.md index 5a4fb54a9e9201..001092dde8d569 100644 --- a/deps/npm/node_modules/lodash.union/README.md +++ b/deps/npm/node_modules/lodash.union/README.md @@ -1,4 +1,4 @@ -# lodash.union v4.4.0 +# lodash.union v4.6.0 The [lodash](https://lodash.com/) method `_.union` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var union = require('lodash.union'); ``` -See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.union) for more details. +See the [documentation](https://lodash.com/docs#union) or [package source](https://github.com/lodash/lodash/blob/4.6.0-npm-packages/lodash.union) for more details. diff --git a/deps/npm/node_modules/lodash.union/index.js b/deps/npm/node_modules/lodash.union/index.js index 5aa425b775b8ae..d1eb0305d57626 100644 --- a/deps/npm/node_modules/lodash.union/index.js +++ b/deps/npm/node_modules/lodash.union/index.js @@ -6,56 +6,889 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseFlatten = require('lodash._baseflatten'), - baseUniq = require('lodash._baseuniq'), - rest = require('lodash.rest'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; +var INFINITY = 1 / 0, + MAX_SAFE_INTEGER = 9007199254740991; /** `Object#toString` result references. */ -var funcTag = '[object Function]', +var argsTag = '[object Arguments]', + funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * Appends the elements of `values` to `array`. + * + * @private + * @param {Array} array The array to modify. + * @param {Array} values The values to append. + * @returns {Array} Returns `array`. + */ +function arrayPush(array, values) { + var index = -1, + length = values.length, + offset = array.length; + + while (++index < length) { + array[offset + index] = values[index]; + } + return array; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + /** Used for built-in method references. */ -var objectProto = Object.prototype; +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var Symbol = root.Symbol, + propertyIsEnumerable = objectProto.propertyIsEnumerable, + splice = arrayProto.splice, + spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + nativeCreate = getNative(Object, 'create'); + /** - * The base implementation of `_.property` without support for deep paths. + * Creates a hash object. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.flatten` with support for restricting flattening. + * + * @private + * @param {Array} array The array to flatten. + * @param {number} depth The maximum recursion depth. + * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. + * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. + * @param {Array} [result=[]] The initial result value. + * @returns {Array} Returns the new flattened array. + */ +function baseFlatten(array, depth, predicate, isStrict, result) { + var index = -1, + length = array.length; + + predicate || (predicate = isFlattenable); + result || (result = []); + + while (++index < length) { + var value = array[index]; + if (depth > 0 && predicate(value)) { + if (depth > 1) { + // Recursively flatten arrays (susceptible to call stack limits). + baseFlatten(value, depth - 1, predicate, isStrict, result); + } else { + arrayPush(result, value); + } + } else if (!isStrict) { + result[result.length] = value; + } + } + return result; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); }; } /** - * Gets the "length" property value of `object`. + * The base implementation of `_.uniqBy` without support for iteratee shorthands. * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -var getLength = baseProperty('length'); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is a flattenable `arguments` object or array. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. + */ +function isFlattenable(value) { + return isArray(value) || isArguments(value) || + !!(spreadableSymbol && value && value[spreadableSymbol]); +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates an array of unique values, in order, from all given arrays using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * * @static @@ -66,13 +899,98 @@ var getLength = baseProperty('length'); * @returns {Array} Returns the new array of combined values. * @example * - * _.union([2, 1], [4, 2], [1, 2]); - * // => [2, 1, 4] + * _.union([2], [1, 2]); + * // => [2, 1] */ -var union = rest(function(arrays) { +var union = baseRest(function(arrays) { return baseUniq(baseFlatten(arrays, 1, isArrayLikeObject, true)); }); +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is likely an `arguments` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an `arguments` object, + * else `false`. + * @example + * + * _.isArguments(function() { return arguments; }()); + * // => true + * + * _.isArguments([1, 2, 3]); + * // => false + */ +function isArguments(value) { + // Safari 8.1 makes `arguments.callee` enumerable in strict mode. + return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && + (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); +} + +/** + * Checks if `value` is classified as an `Array` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an array, else `false`. + * @example + * + * _.isArray([1, 2, 3]); + * // => true + * + * _.isArray(document.body.children); + * // => false + * + * _.isArray('abc'); + * // => false + * + * _.isArray(_.noop); + * // => false + */ +var isArray = Array.isArray; + /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -99,7 +1017,7 @@ var union = rest(function(arrays) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -139,8 +1057,7 @@ function isArrayLikeObject(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -151,8 +1068,7 @@ function isArrayLikeObject(value) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -160,16 +1076,15 @@ function isFunction(value) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -191,7 +1106,7 @@ function isLength(value) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static @@ -247,4 +1162,20 @@ function isObjectLike(value) { return !!value && typeof value == 'object'; } +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop() { + // No operation performed. +} + module.exports = union; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md deleted file mode 100644 index 2c839ab728df3a..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseflatten v4.2.1 - -The internal [lodash](https://lodash.com/) function `baseFlatten` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseflatten -``` - -In Node.js: -```js -var baseFlatten = require('lodash._baseflatten'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.2.1-npm-packages/lodash._baseflatten) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js deleted file mode 100644 index de0df103f480f4..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/index.js +++ /dev/null @@ -1,349 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var MAX_SAFE_INTEGER = 9007199254740991; - -/** `Object#toString` result references. */ -var argsTag = '[object Arguments]', - funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Appends the elements of `values` to `array`. - * - * @private - * @param {Array} array The array to modify. - * @param {Array} values The values to append. - * @returns {Array} Returns `array`. - */ -function arrayPush(array, values) { - var index = -1, - length = values.length, - offset = array.length; - - while (++index < length) { - array[offset + index] = values[index]; - } - return array; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var propertyIsEnumerable = objectProto.propertyIsEnumerable; - -/** - * The base implementation of `_.flatten` with support for restricting flattening. - * - * @private - * @param {Array} array The array to flatten. - * @param {number} depth The maximum recursion depth. - * @param {boolean} [predicate=isFlattenable] The function invoked per iteration. - * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks. - * @param {Array} [result=[]] The initial result value. - * @returns {Array} Returns the new flattened array. - */ -function baseFlatten(array, depth, predicate, isStrict, result) { - var index = -1, - length = array.length; - - predicate || (predicate = isFlattenable); - result || (result = []); - - while (++index < length) { - var value = array[index]; - if (depth > 0 && predicate(value)) { - if (depth > 1) { - // Recursively flatten arrays (susceptible to call stack limits). - baseFlatten(value, depth - 1, predicate, isStrict, result); - } else { - arrayPush(result, value); - } - } else if (!isStrict) { - result[result.length] = value; - } - } - return result; -} - -/** - * The base implementation of `_.property` without support for deep paths. - * - * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. - */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; - }; -} - -/** - * Gets the "length" property value of `object`. - * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. - * - * @private - * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. - */ -var getLength = baseProperty('length'); - -/** - * Checks if `value` is a flattenable `arguments` object or array. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is flattenable, else `false`. - */ -function isFlattenable(value) { - return isArray(value) || isArguments(value); -} - -/** - * Checks if `value` is likely an `arguments` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArguments(function() { return arguments; }()); - * // => true - * - * _.isArguments([1, 2, 3]); - * // => false - */ -function isArguments(value) { - // Safari 8.1 incorrectly makes `arguments.callee` enumerable in strict mode. - return isArrayLikeObject(value) && hasOwnProperty.call(value, 'callee') && - (!propertyIsEnumerable.call(value, 'callee') || objectToString.call(value) == argsTag); -} - -/** - * Checks if `value` is classified as an `Array` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @type {Function} - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isArray([1, 2, 3]); - * // => true - * - * _.isArray(document.body.children); - * // => false - * - * _.isArray('abc'); - * // => false - * - * _.isArray(_.noop); - * // => false - */ -var isArray = Array.isArray; - -/** - * Checks if `value` is array-like. A value is considered array-like if it's - * not a function and has a `value.length` that's an integer greater than or - * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is array-like, else `false`. - * @example - * - * _.isArrayLike([1, 2, 3]); - * // => true - * - * _.isArrayLike(document.body.children); - * // => true - * - * _.isArrayLike('abc'); - * // => true - * - * _.isArrayLike(_.noop); - * // => false - */ -function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); -} - -/** - * This method is like `_.isArrayLike` except that it also checks if `value` - * is an object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an array-like object, - * else `false`. - * @example - * - * _.isArrayLikeObject([1, 2, 3]); - * // => true - * - * _.isArrayLikeObject(document.body.children); - * // => true - * - * _.isArrayLikeObject('abc'); - * // => false - * - * _.isArrayLikeObject(_.noop); - * // => false - */ -function isArrayLikeObject(value) { - return isObjectLike(value) && isArrayLike(value); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is a valid array-like length. - * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. - * @example - * - * _.isLength(3); - * // => true - * - * _.isLength(Number.MIN_VALUE); - * // => false - * - * _.isLength(Infinity); - * // => false - * - * _.isLength('3'); - * // => false - */ -function isLength(value) { - return typeof value == 'number' && - value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -module.exports = baseFlatten; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json deleted file mode 100644 index cd710c8b3ab51b..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash._baseflatten/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._baseflatten@~4.2.0", - "/Users/rebecca/code/npm/node_modules/lodash.union" - ] - ], - "_from": "lodash._baseflatten@>=4.2.0 <4.3.0", - "_id": "lodash._baseflatten@4.2.1", - "_inCache": true, - "_installable": true, - "_location": "/lodash.union/lodash._baseflatten", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._baseflatten-4.2.1.tgz_1463062009548_0.7446099303197116" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseflatten", - "raw": "lodash._baseflatten@~4.2.0", - "rawSpec": "~4.2.0", - "scope": null, - "spec": ">=4.2.0 <4.3.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.union" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.2.1.tgz", - "_shasum": "54acad5e6ef53532a5b8269c0ad725470cfd9208", - "_shrinkwrap": null, - "_spec": "lodash._baseflatten@~4.2.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.union", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseFlatten` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "54acad5e6ef53532a5b8269c0ad725470cfd9208", - "tarball": "https://registry.npmjs.org/lodash._baseflatten/-/lodash._baseflatten-4.2.1.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseflatten", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.2.1" -} diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md deleted file mode 100644 index 5342ca4452531e..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.rest v4.0.3 - -The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.rest -``` - -In Node.js: -```js -var rest = require('lodash.rest'); -``` - -See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js deleted file mode 100644 index 23157864103d27..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/index.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = rest; diff --git a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json deleted file mode 100644 index 416db6c858d551..00000000000000 --- a/deps/npm/node_modules/lodash.union/node_modules/lodash.rest/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - "lodash.rest@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.union" - ] - ], - "_from": "lodash.rest@>=4.0.0 <5.0.0", - "_id": "lodash.rest@4.0.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.union/lodash.rest", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.rest-4.0.3.tgz_1463062507321_0.6458017621189356" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.rest", - "raw": "lodash.rest@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.union" - ], - "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", - "_shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "_shrinkwrap": null, - "_spec": "lodash.rest@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.union", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.rest` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "tarball": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "rest" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.rest", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/lodash.union/package.json b/deps/npm/node_modules/lodash.union/package.json index 4e89c1da97139a..1bbb3cc10e757e 100644 --- a/deps/npm/node_modules/lodash.union/package.json +++ b/deps/npm/node_modules/lodash.union/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.union@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.union@4.6.0", + "scope": null, + "escapedName": "lodash.union", + "name": "lodash.union", + "rawSpec": "4.6.0", + "spec": "4.6.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.union@latest", - "_id": "lodash.union@4.4.0", + "_from": "lodash.union@4.6.0", + "_id": "lodash.union@4.6.0", "_inCache": true, - "_installable": true, "_location": "/lodash.union", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.union-4.4.0.tgz_1463062655004_0.2674572637770325" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/lodash.union-4.6.0.tgz_1471110390292_0.8560791339259595" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.union", - "raw": "lodash.union@latest", - "rawSpec": "latest", + "raw": "lodash.union@4.6.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.union", + "name": "lodash.union", + "rawSpec": "4.6.0", + "spec": "4.6.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.4.0.tgz", - "_shasum": "22be23b4c84b49d0436e573949ad1d4a48c7fa38", + "_resolved": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz", + "_shasum": "48bb5088409f16f1821666641c44dd1aaae3cd88", "_shrinkwrap": null, - "_spec": "lodash.union@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.union@4.6.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,32 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseflatten": "~4.2.0", - "lodash._baseuniq": "~4.6.0", - "lodash.rest": "^4.0.0" - }, + "dependencies": {}, "description": "The lodash method `_.union` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "22be23b4c84b49d0436e573949ad1d4a48c7fa38", - "tarball": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.4.0.tgz" + "shasum": "48bb5088409f16f1821666641c44dd1aaae3cd88", + "tarball": "https://registry.npmjs.org/lodash.union/-/lodash.union-4.6.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -83,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.union", @@ -105,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.4.0" + "version": "4.6.0" } diff --git a/deps/npm/node_modules/lodash.uniq/README.md b/deps/npm/node_modules/lodash.uniq/README.md index f1d83df5e52d6d..a662a5e3823153 100644 --- a/deps/npm/node_modules/lodash.uniq/README.md +++ b/deps/npm/node_modules/lodash.uniq/README.md @@ -1,4 +1,4 @@ -# lodash.uniq v4.3.0 +# lodash.uniq v4.5.0 The [lodash](https://lodash.com/) method `_.uniq` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var uniq = require('lodash.uniq'); ``` -See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.3.0-npm-packages/lodash.uniq) for more details. +See the [documentation](https://lodash.com/docs#uniq) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.uniq) for more details. diff --git a/deps/npm/node_modules/lodash.uniq/index.js b/deps/npm/node_modules/lodash.uniq/index.js index d1a25d8091dc20..83fce2bc44fcc4 100644 --- a/deps/npm/node_modules/lodash.uniq/index.js +++ b/deps/npm/node_modules/lodash.uniq/index.js @@ -6,11 +6,767 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseUniq = require('lodash._baseuniq'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; + +/** Used as references for various `Number` constants. */ +var INFINITY = 1 / 0; + +/** `Object#toString` result references. */ +var funcTag = '[object Function]', + genTag = '[object GeneratorFunction]'; + +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + +/** + * Converts `set` to an array of its values. + * + * @private + * @param {Object} set The set to convert. + * @returns {Array} Returns the values. + */ +function setToArray(set) { + var index = -1, + result = Array(set.size); + + set.forEach(function(value) { + result[++index] = value; + }); + return result; +} + +/** Used for built-in method references. */ +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; + +/** + * Used to resolve the + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) + * of values. + */ +var objectToString = objectProto.toString; + +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + Set = getNative(root, 'Set'), + nativeCreate = getNative(Object, 'create'); + +/** + * Creates a hash object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.uniqBy` without support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new duplicate free array. + */ +function baseUniq(array, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + length = array.length, + isCommon = true, + result = [], + seen = result; + + if (comparator) { + isCommon = false; + includes = arrayIncludesWith; + } + else if (length >= LARGE_ARRAY_SIZE) { + var set = iteratee ? null : createSet(array); + if (set) { + return setToArray(set); + } + isCommon = false; + includes = cacheHas; + seen = new SetCache; + } + else { + seen = iteratee ? [] : result; + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var seenIndex = seen.length; + while (seenIndex--) { + if (seen[seenIndex] === computed) { + continue outer; + } + } + if (iteratee) { + seen.push(computed); + } + result.push(value); + } + else if (!includes(seen, computed, comparator)) { + if (seen !== result) { + seen.push(computed); + } + result.push(value); + } + } + return result; +} + +/** + * Creates a set object of `values`. + * + * @private + * @param {Array} values The values to add to the set. + * @returns {Object} Returns the new set. + */ +var createSet = !(Set && (1 / setToArray(new Set([,-0]))[1]) == INFINITY) ? noop : function(values) { + return new Set(values); +}; + +/** + * Gets the data for `map`. + * + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. + * + * @private + * @param {Object} object The object to query. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. + */ +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates a duplicate-free version of an array, using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons, in which only the first occurrence of each * element is kept. * @@ -31,4 +787,110 @@ function uniq(array) { : []; } +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + +/** + * Checks if `value` is classified as a `Function` object. + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. + * @example + * + * _.isFunction(_); + * // => true + * + * _.isFunction(/abc/); + * // => false + */ +function isFunction(value) { + // The use of `Object#toString` avoids issues with the `typeof` operator + // in Safari 8-9 which returns 'object' for typed array and other constructors. + var tag = isObject(value) ? objectToString.call(value) : ''; + return tag == funcTag || tag == genTag; +} + +/** + * Checks if `value` is the + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) + * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) + * + * @static + * @memberOf _ + * @since 0.1.0 + * @category Lang + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is an object, else `false`. + * @example + * + * _.isObject({}); + * // => true + * + * _.isObject([1, 2, 3]); + * // => true + * + * _.isObject(_.noop); + * // => true + * + * _.isObject(null); + * // => false + */ +function isObject(value) { + var type = typeof value; + return !!value && (type == 'object' || type == 'function'); +} + +/** + * This method returns `undefined`. + * + * @static + * @memberOf _ + * @since 2.3.0 + * @category Util + * @example + * + * _.times(2, _.noop); + * // => [undefined, undefined] + */ +function noop() { + // No operation performed. +} + module.exports = uniq; diff --git a/deps/npm/node_modules/lodash.uniq/package.json b/deps/npm/node_modules/lodash.uniq/package.json index 4ee8486f495af1..44593d7df55611 100644 --- a/deps/npm/node_modules/lodash.uniq/package.json +++ b/deps/npm/node_modules/lodash.uniq/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.uniq@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.uniq@4.5.0", + "scope": null, + "escapedName": "lodash.uniq", + "name": "lodash.uniq", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.uniq@latest", - "_id": "lodash.uniq@4.3.0", + "_from": "lodash.uniq@4.5.0", + "_id": "lodash.uniq@4.5.0", "_inCache": true, - "_installable": true, "_location": "/lodash.uniq", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.uniq-4.3.0.tgz_1463062659727_0.9107886834535748" + "tmp": "tmp/lodash.uniq-4.5.0.tgz_1471110399118_0.6918453241232783" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.uniq", - "raw": "lodash.uniq@latest", - "rawSpec": "latest", + "raw": "lodash.uniq@4.5.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.uniq", + "name": "lodash.uniq", + "rawSpec": "4.5.0", + "spec": "4.5.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.3.0.tgz", - "_shasum": "dcad810876841447d8f3ec662323c86a6d938227", + "_resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "_shasum": "d0225373aeb652adc1bc82e4945339a842754773", "_shrinkwrap": null, - "_spec": "lodash.uniq@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.uniq@4.5.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,30 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._baseuniq": "~4.6.0" - }, + "dependencies": {}, "description": "The lodash method `_.uniq` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "dcad810876841447d8f3ec662323c86a6d938227", - "tarball": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.3.0.tgz" + "shasum": "d0225373aeb652adc1bc82e4945339a842754773", + "tarball": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -81,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.uniq", @@ -103,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.3.0" + "version": "4.5.0" } diff --git a/deps/npm/node_modules/lodash.without/README.md b/deps/npm/node_modules/lodash.without/README.md index dd02c51c7c1ba7..8c00f8a4a03e62 100644 --- a/deps/npm/node_modules/lodash.without/README.md +++ b/deps/npm/node_modules/lodash.without/README.md @@ -1,4 +1,4 @@ -# lodash.without v4.2.0 +# lodash.without v4.4.0 The [lodash](https://lodash.com/) method `_.without` exported as a [Node.js](https://nodejs.org/) module. @@ -15,4 +15,4 @@ In Node.js: var without = require('lodash.without'); ``` -See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.2.0-npm-packages/lodash.without) for more details. +See the [documentation](https://lodash.com/docs#without) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.without) for more details. diff --git a/deps/npm/node_modules/lodash.without/index.js b/deps/npm/node_modules/lodash.without/index.js index 7c6954106b6af8..b75daee5fd82d8 100644 --- a/deps/npm/node_modules/lodash.without/index.js +++ b/deps/npm/node_modules/lodash.without/index.js @@ -6,8 +6,12 @@ * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */ -var baseDifference = require('lodash._basedifference'), - rest = require('lodash.rest'); + +/** Used as the size to enable large array optimizations. */ +var LARGE_ARRAY_SIZE = 200; + +/** Used to stand-in for `undefined` hash values. */ +var HASH_UNDEFINED = '__lodash_hash_undefined__'; /** Used as references for various `Number` constants. */ var MAX_SAFE_INTEGER = 9007199254740991; @@ -16,47 +20,808 @@ var MAX_SAFE_INTEGER = 9007199254740991; var funcTag = '[object Function]', genTag = '[object GeneratorFunction]'; +/** + * Used to match `RegExp` + * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns). + */ +var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; + +/** Used to detect host constructors (Safari). */ +var reIsHostCtor = /^\[object .+?Constructor\]$/; + +/** Detect free variable `global` from Node.js. */ +var freeGlobal = typeof global == 'object' && global && global.Object === Object && global; + +/** Detect free variable `self`. */ +var freeSelf = typeof self == 'object' && self && self.Object === Object && self; + +/** Used as a reference to the global object. */ +var root = freeGlobal || freeSelf || Function('return this')(); + +/** + * A faster alternative to `Function#apply`, this function invokes `func` + * with the `this` binding of `thisArg` and the arguments of `args`. + * + * @private + * @param {Function} func The function to invoke. + * @param {*} thisArg The `this` binding of `func`. + * @param {Array} args The arguments to invoke `func` with. + * @returns {*} Returns the result of `func`. + */ +function apply(func, thisArg, args) { + switch (args.length) { + case 0: return func.call(thisArg); + case 1: return func.call(thisArg, args[0]); + case 2: return func.call(thisArg, args[0], args[1]); + case 3: return func.call(thisArg, args[0], args[1], args[2]); + } + return func.apply(thisArg, args); +} + +/** + * A specialized version of `_.includes` for arrays without support for + * specifying an index to search from. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludes(array, value) { + var length = array ? array.length : 0; + return !!length && baseIndexOf(array, value, 0) > -1; +} + +/** + * This function is like `arrayIncludes` except that it accepts a comparator. + * + * @private + * @param {Array} [array] The array to inspect. + * @param {*} target The value to search for. + * @param {Function} comparator The comparator invoked per element. + * @returns {boolean} Returns `true` if `target` is found, else `false`. + */ +function arrayIncludesWith(array, value, comparator) { + var index = -1, + length = array ? array.length : 0; + + while (++index < length) { + if (comparator(value, array[index])) { + return true; + } + } + return false; +} + +/** + * A specialized version of `_.map` for arrays without support for iteratee + * shorthands. + * + * @private + * @param {Array} [array] The array to iterate over. + * @param {Function} iteratee The function invoked per iteration. + * @returns {Array} Returns the new mapped array. + */ +function arrayMap(array, iteratee) { + var index = -1, + length = array ? array.length : 0, + result = Array(length); + + while (++index < length) { + result[index] = iteratee(array[index], index, array); + } + return result; +} + +/** + * The base implementation of `_.findIndex` and `_.findLastIndex` without + * support for iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Function} predicate The function invoked per iteration. + * @param {number} fromIndex The index to search from. + * @param {boolean} [fromRight] Specify iterating from right to left. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseFindIndex(array, predicate, fromIndex, fromRight) { + var length = array.length, + index = fromIndex + (fromRight ? 1 : -1); + + while ((fromRight ? index-- : ++index < length)) { + if (predicate(array[index], index, array)) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.indexOf` without `fromIndex` bounds checks. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} value The value to search for. + * @param {number} fromIndex The index to search from. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function baseIndexOf(array, value, fromIndex) { + if (value !== value) { + return baseFindIndex(array, baseIsNaN, fromIndex); + } + var index = fromIndex - 1, + length = array.length; + + while (++index < length) { + if (array[index] === value) { + return index; + } + } + return -1; +} + +/** + * The base implementation of `_.isNaN` without support for number objects. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is `NaN`, else `false`. + */ +function baseIsNaN(value) { + return value !== value; +} + +/** + * The base implementation of `_.unary` without support for storing metadata. + * + * @private + * @param {Function} func The function to cap arguments for. + * @returns {Function} Returns the new capped function. + */ +function baseUnary(func) { + return function(value) { + return func(value); + }; +} + +/** + * Checks if a cache value for `key` exists. + * + * @private + * @param {Object} cache The cache to query. + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function cacheHas(cache, key) { + return cache.has(key); +} + +/** + * Gets the value at `key` of `object`. + * + * @private + * @param {Object} [object] The object to query. + * @param {string} key The key of the property to get. + * @returns {*} Returns the property value. + */ +function getValue(object, key) { + return object == null ? undefined : object[key]; +} + +/** + * Checks if `value` is a host object in IE < 9. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a host object, else `false`. + */ +function isHostObject(value) { + // Many host objects are `Object` objects that can coerce to strings + // despite having improperly defined `toString` methods. + var result = false; + if (value != null && typeof value.toString != 'function') { + try { + result = !!(value + ''); + } catch (e) {} + } + return result; +} + /** Used for built-in method references. */ -var objectProto = Object.prototype; +var arrayProto = Array.prototype, + funcProto = Function.prototype, + objectProto = Object.prototype; + +/** Used to detect overreaching core-js shims. */ +var coreJsData = root['__core-js_shared__']; + +/** Used to detect methods masquerading as native. */ +var maskSrcKey = (function() { + var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || ''); + return uid ? ('Symbol(src)_1.' + uid) : ''; +}()); + +/** Used to resolve the decompiled source of functions. */ +var funcToString = funcProto.toString; + +/** Used to check objects for own properties. */ +var hasOwnProperty = objectProto.hasOwnProperty; /** * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) + * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring) * of values. */ var objectToString = objectProto.toString; +/** Used to detect if a method is native. */ +var reIsNative = RegExp('^' + + funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') + .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' +); + +/** Built-in value references. */ +var splice = arrayProto.splice; + +/* Built-in method references for those with the same name as other `lodash` methods. */ +var nativeMax = Math.max; + +/* Built-in method references that are verified to be native. */ +var Map = getNative(root, 'Map'), + nativeCreate = getNative(Object, 'create'); + /** - * The base implementation of `_.property` without support for deep paths. + * Creates a hash object. * * @private - * @param {string} key The key of the property to get. - * @returns {Function} Returns the new accessor function. + * @constructor + * @param {Array} [entries] The key-value pairs to cache. */ -function baseProperty(key) { - return function(object) { - return object == null ? undefined : object[key]; +function Hash(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the hash. + * + * @private + * @name clear + * @memberOf Hash + */ +function hashClear() { + this.__data__ = nativeCreate ? nativeCreate(null) : {}; +} + +/** + * Removes `key` and its value from the hash. + * + * @private + * @name delete + * @memberOf Hash + * @param {Object} hash The hash to modify. + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function hashDelete(key) { + return this.has(key) && delete this.__data__[key]; +} + +/** + * Gets the hash value for `key`. + * + * @private + * @name get + * @memberOf Hash + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function hashGet(key) { + var data = this.__data__; + if (nativeCreate) { + var result = data[key]; + return result === HASH_UNDEFINED ? undefined : result; + } + return hasOwnProperty.call(data, key) ? data[key] : undefined; +} + +/** + * Checks if a hash value for `key` exists. + * + * @private + * @name has + * @memberOf Hash + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function hashHas(key) { + var data = this.__data__; + return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); +} + +/** + * Sets the hash `key` to `value`. + * + * @private + * @name set + * @memberOf Hash + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the hash instance. + */ +function hashSet(key, value) { + var data = this.__data__; + data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; + return this; +} + +// Add methods to `Hash`. +Hash.prototype.clear = hashClear; +Hash.prototype['delete'] = hashDelete; +Hash.prototype.get = hashGet; +Hash.prototype.has = hashHas; +Hash.prototype.set = hashSet; + +/** + * Creates an list cache object. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function ListCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the list cache. + * + * @private + * @name clear + * @memberOf ListCache + */ +function listCacheClear() { + this.__data__ = []; +} + +/** + * Removes `key` and its value from the list cache. + * + * @private + * @name delete + * @memberOf ListCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function listCacheDelete(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + return false; + } + var lastIndex = data.length - 1; + if (index == lastIndex) { + data.pop(); + } else { + splice.call(data, index, 1); + } + return true; +} + +/** + * Gets the list cache value for `key`. + * + * @private + * @name get + * @memberOf ListCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function listCacheGet(key) { + var data = this.__data__, + index = assocIndexOf(data, key); + + return index < 0 ? undefined : data[index][1]; +} + +/** + * Checks if a list cache value for `key` exists. + * + * @private + * @name has + * @memberOf ListCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function listCacheHas(key) { + return assocIndexOf(this.__data__, key) > -1; +} + +/** + * Sets the list cache `key` to `value`. + * + * @private + * @name set + * @memberOf ListCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the list cache instance. + */ +function listCacheSet(key, value) { + var data = this.__data__, + index = assocIndexOf(data, key); + + if (index < 0) { + data.push([key, value]); + } else { + data[index][1] = value; + } + return this; +} + +// Add methods to `ListCache`. +ListCache.prototype.clear = listCacheClear; +ListCache.prototype['delete'] = listCacheDelete; +ListCache.prototype.get = listCacheGet; +ListCache.prototype.has = listCacheHas; +ListCache.prototype.set = listCacheSet; + +/** + * Creates a map cache object to store key-value pairs. + * + * @private + * @constructor + * @param {Array} [entries] The key-value pairs to cache. + */ +function MapCache(entries) { + var index = -1, + length = entries ? entries.length : 0; + + this.clear(); + while (++index < length) { + var entry = entries[index]; + this.set(entry[0], entry[1]); + } +} + +/** + * Removes all key-value entries from the map. + * + * @private + * @name clear + * @memberOf MapCache + */ +function mapCacheClear() { + this.__data__ = { + 'hash': new Hash, + 'map': new (Map || ListCache), + 'string': new Hash + }; +} + +/** + * Removes `key` and its value from the map. + * + * @private + * @name delete + * @memberOf MapCache + * @param {string} key The key of the value to remove. + * @returns {boolean} Returns `true` if the entry was removed, else `false`. + */ +function mapCacheDelete(key) { + return getMapData(this, key)['delete'](key); +} + +/** + * Gets the map value for `key`. + * + * @private + * @name get + * @memberOf MapCache + * @param {string} key The key of the value to get. + * @returns {*} Returns the entry value. + */ +function mapCacheGet(key) { + return getMapData(this, key).get(key); +} + +/** + * Checks if a map value for `key` exists. + * + * @private + * @name has + * @memberOf MapCache + * @param {string} key The key of the entry to check. + * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. + */ +function mapCacheHas(key) { + return getMapData(this, key).has(key); +} + +/** + * Sets the map `key` to `value`. + * + * @private + * @name set + * @memberOf MapCache + * @param {string} key The key of the value to set. + * @param {*} value The value to set. + * @returns {Object} Returns the map cache instance. + */ +function mapCacheSet(key, value) { + getMapData(this, key).set(key, value); + return this; +} + +// Add methods to `MapCache`. +MapCache.prototype.clear = mapCacheClear; +MapCache.prototype['delete'] = mapCacheDelete; +MapCache.prototype.get = mapCacheGet; +MapCache.prototype.has = mapCacheHas; +MapCache.prototype.set = mapCacheSet; + +/** + * + * Creates an array cache object to store unique values. + * + * @private + * @constructor + * @param {Array} [values] The values to cache. + */ +function SetCache(values) { + var index = -1, + length = values ? values.length : 0; + + this.__data__ = new MapCache; + while (++index < length) { + this.add(values[index]); + } +} + +/** + * Adds `value` to the array cache. + * + * @private + * @name add + * @memberOf SetCache + * @alias push + * @param {*} value The value to cache. + * @returns {Object} Returns the cache instance. + */ +function setCacheAdd(value) { + this.__data__.set(value, HASH_UNDEFINED); + return this; +} + +/** + * Checks if `value` is in the array cache. + * + * @private + * @name has + * @memberOf SetCache + * @param {*} value The value to search for. + * @returns {number} Returns `true` if `value` is found, else `false`. + */ +function setCacheHas(value) { + return this.__data__.has(value); +} + +// Add methods to `SetCache`. +SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; +SetCache.prototype.has = setCacheHas; + +/** + * Gets the index at which the `key` is found in `array` of key-value pairs. + * + * @private + * @param {Array} array The array to inspect. + * @param {*} key The key to search for. + * @returns {number} Returns the index of the matched value, else `-1`. + */ +function assocIndexOf(array, key) { + var length = array.length; + while (length--) { + if (eq(array[length][0], key)) { + return length; + } + } + return -1; +} + +/** + * The base implementation of methods like `_.difference` without support + * for excluding multiple arrays or iteratee shorthands. + * + * @private + * @param {Array} array The array to inspect. + * @param {Array} values The values to exclude. + * @param {Function} [iteratee] The iteratee invoked per element. + * @param {Function} [comparator] The comparator invoked per element. + * @returns {Array} Returns the new array of filtered values. + */ +function baseDifference(array, values, iteratee, comparator) { + var index = -1, + includes = arrayIncludes, + isCommon = true, + length = array.length, + result = [], + valuesLength = values.length; + + if (!length) { + return result; + } + if (iteratee) { + values = arrayMap(values, baseUnary(iteratee)); + } + if (comparator) { + includes = arrayIncludesWith; + isCommon = false; + } + else if (values.length >= LARGE_ARRAY_SIZE) { + includes = cacheHas; + isCommon = false; + values = new SetCache(values); + } + outer: + while (++index < length) { + var value = array[index], + computed = iteratee ? iteratee(value) : value; + + value = (comparator || value !== 0) ? value : 0; + if (isCommon && computed === computed) { + var valuesIndex = valuesLength; + while (valuesIndex--) { + if (values[valuesIndex] === computed) { + continue outer; + } + } + result.push(value); + } + else if (!includes(values, computed, comparator)) { + result.push(value); + } + } + return result; +} + +/** + * The base implementation of `_.isNative` without bad shim checks. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is a native function, + * else `false`. + */ +function baseIsNative(value) { + if (!isObject(value) || isMasked(value)) { + return false; + } + var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; + return pattern.test(toSource(value)); +} + +/** + * The base implementation of `_.rest` which doesn't validate or coerce arguments. + * + * @private + * @param {Function} func The function to apply a rest parameter to. + * @param {number} [start=func.length-1] The start position of the rest parameter. + * @returns {Function} Returns the new function. + */ +function baseRest(func, start) { + start = nativeMax(start === undefined ? (func.length - 1) : start, 0); + return function() { + var args = arguments, + index = -1, + length = nativeMax(args.length - start, 0), + array = Array(length); + + while (++index < length) { + array[index] = args[start + index]; + } + index = -1; + var otherArgs = Array(start + 1); + while (++index < start) { + otherArgs[index] = args[index]; + } + otherArgs[start] = array; + return apply(func, this, otherArgs); }; } /** - * Gets the "length" property value of `object`. + * Gets the data for `map`. * - * **Note:** This function is used to avoid a - * [JIT bug](https://bugs.webkit.org/show_bug.cgi?id=142792) that affects - * Safari on at least iOS 8.1-8.3 ARM64. + * @private + * @param {Object} map The map to query. + * @param {string} key The reference key. + * @returns {*} Returns the map data. + */ +function getMapData(map, key) { + var data = map.__data__; + return isKeyable(key) + ? data[typeof key == 'string' ? 'string' : 'hash'] + : data.map; +} + +/** + * Gets the native function at `key` of `object`. * * @private * @param {Object} object The object to query. - * @returns {*} Returns the "length" value. + * @param {string} key The key of the method to get. + * @returns {*} Returns the function if it's native, else `undefined`. */ -var getLength = baseProperty('length'); +function getNative(object, key) { + var value = getValue(object, key); + return baseIsNative(value) ? value : undefined; +} + +/** + * Checks if `value` is suitable for use as unique object key. + * + * @private + * @param {*} value The value to check. + * @returns {boolean} Returns `true` if `value` is suitable, else `false`. + */ +function isKeyable(value) { + var type = typeof value; + return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') + ? (value !== '__proto__') + : (value === null); +} + +/** + * Checks if `func` has its source masked. + * + * @private + * @param {Function} func The function to check. + * @returns {boolean} Returns `true` if `func` is masked, else `false`. + */ +function isMasked(func) { + return !!maskSrcKey && (maskSrcKey in func); +} + +/** + * Converts `func` to its source code. + * + * @private + * @param {Function} func The function to process. + * @returns {string} Returns the source code. + */ +function toSource(func) { + if (func != null) { + try { + return funcToString.call(func); + } catch (e) {} + try { + return (func + ''); + } catch (e) {} + } + return ''; +} /** * Creates an array excluding all given values using - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) * for equality comparisons. * + * **Note:** Unlike `_.pull`, this method returns a new array. + * * @static * @memberOf _ * @since 0.1.0 @@ -67,15 +832,51 @@ var getLength = baseProperty('length'); * @see _.difference, _.xor * @example * - * _.without([1, 2, 1, 3], 1, 2); + * _.without([2, 1, 2, 3], 1, 2); * // => [3] */ -var without = rest(function(array, values) { +var without = baseRest(function(array, values) { return isArrayLikeObject(array) ? baseDifference(array, values) : []; }); +/** + * Performs a + * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero) + * comparison between two values to determine if they are equivalent. + * + * @static + * @memberOf _ + * @since 4.0.0 + * @category Lang + * @param {*} value The value to compare. + * @param {*} other The other value to compare. + * @returns {boolean} Returns `true` if the values are equivalent, else `false`. + * @example + * + * var object = { 'a': 1 }; + * var other = { 'a': 1 }; + * + * _.eq(object, object); + * // => true + * + * _.eq(object, other); + * // => false + * + * _.eq('a', 'a'); + * // => true + * + * _.eq('a', Object('a')); + * // => false + * + * _.eq(NaN, NaN); + * // => true + */ +function eq(value, other) { + return value === other || (value !== value && other !== other); +} + /** * Checks if `value` is array-like. A value is considered array-like if it's * not a function and has a `value.length` that's an integer greater than or @@ -102,7 +903,7 @@ var without = rest(function(array, values) { * // => false */ function isArrayLike(value) { - return value != null && isLength(getLength(value)) && !isFunction(value); + return value != null && isLength(value.length) && !isFunction(value); } /** @@ -142,8 +943,7 @@ function isArrayLikeObject(value) { * @since 0.1.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a function, else `false`. * @example * * _.isFunction(_); @@ -154,8 +954,7 @@ function isArrayLikeObject(value) { */ function isFunction(value) { // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. + // in Safari 8-9 which returns 'object' for typed array and other constructors. var tag = isObject(value) ? objectToString.call(value) : ''; return tag == funcTag || tag == genTag; } @@ -163,16 +962,15 @@ function isFunction(value) { /** * Checks if `value` is a valid array-like length. * - * **Note:** This function is loosely based on - * [`ToLength`](http://ecma-international.org/ecma-262/6.0/#sec-tolength). + * **Note:** This method is loosely based on + * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength). * * @static * @memberOf _ * @since 4.0.0 * @category Lang * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a valid length, - * else `false`. + * @returns {boolean} Returns `true` if `value` is a valid length, else `false`. * @example * * _.isLength(3); @@ -194,7 +992,7 @@ function isLength(value) { /** * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) + * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types) * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) * * @static diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md deleted file mode 100644 index 7426607e9735fa..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basedifference v4.5.0 - -The internal [lodash](https://lodash.com/) function `baseDifference` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basedifference -``` - -In Node.js: -```js -var baseDifference = require('lodash._basedifference'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash._basedifference) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js deleted file mode 100644 index 39b916c9befadc..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/index.js +++ /dev/null @@ -1,811 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var root = require('lodash._root'); - -/** Used as the size to enable large array optimizations. */ -var LARGE_ARRAY_SIZE = 200; - -/** Used to stand-in for `undefined` hash values. */ -var HASH_UNDEFINED = '__lodash_hash_undefined__'; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]'; - -/** - * Used to match `RegExp` - * [syntax characters](http://ecma-international.org/ecma-262/6.0/#sec-patterns). - */ -var reRegExpChar = /[\\^$.*+?()[\]{}|]/g; - -/** Used to detect host constructors (Safari). */ -var reIsHostCtor = /^\[object .+?Constructor\]$/; - -/** - * A specialized version of `_.includes` for arrays without support for - * specifying an index to search from. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludes(array, value) { - return !!array.length && baseIndexOf(array, value, 0) > -1; -} - -/** - * This function is like `arrayIncludes` except that it accepts a comparator. - * - * @private - * @param {Array} array The array to search. - * @param {*} target The value to search for. - * @param {Function} comparator The comparator invoked per element. - * @returns {boolean} Returns `true` if `target` is found, else `false`. - */ -function arrayIncludesWith(array, value, comparator) { - var index = -1, - length = array.length; - - while (++index < length) { - if (comparator(value, array[index])) { - return true; - } - } - return false; -} - -/** - * A specialized version of `_.map` for arrays without support for iteratee - * shorthands. - * - * @private - * @param {Array} array The array to iterate over. - * @param {Function} iteratee The function invoked per iteration. - * @returns {Array} Returns the new mapped array. - */ -function arrayMap(array, iteratee) { - var index = -1, - length = array.length, - result = Array(length); - - while (++index < length) { - result[index] = iteratee(array[index], index, array); - } - return result; -} - -/** - * The base implementation of `_.indexOf` without `fromIndex` bounds checks. - * - * @private - * @param {Array} array The array to search. - * @param {*} value The value to search for. - * @param {number} fromIndex The index to search from. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function baseIndexOf(array, value, fromIndex) { - if (value !== value) { - return indexOfNaN(array, fromIndex); - } - var index = fromIndex - 1, - length = array.length; - - while (++index < length) { - if (array[index] === value) { - return index; - } - } - return -1; -} - -/** - * The base implementation of `_.unary` without support for storing wrapper metadata. - * - * @private - * @param {Function} func The function to cap arguments for. - * @returns {Function} Returns the new capped function. - */ -function baseUnary(func) { - return function(value) { - return func(value); - }; -} - -/** - * Checks if a cache value for `key` exists. - * - * @private - * @param {Object} cache The cache to query. - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function cacheHas(cache, key) { - return cache.has(key); -} - -/** - * Gets the index at which the first occurrence of `NaN` is found in `array`. - * - * @private - * @param {Array} array The array to search. - * @param {number} fromIndex The index to search from. - * @param {boolean} [fromRight] Specify iterating from right to left. - * @returns {number} Returns the index of the matched `NaN`, else `-1`. - */ -function indexOfNaN(array, fromIndex, fromRight) { - var length = array.length, - index = fromIndex + (fromRight ? 0 : -1); - - while ((fromRight ? index-- : ++index < length)) { - var other = array[index]; - if (other !== other) { - return index; - } - } - return -1; -} - -/** - * Checks if `value` is a host object in IE < 9. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a host object, else `false`. - */ -function isHostObject(value) { - // Many host objects are `Object` objects that can coerce to strings - // despite having improperly defined `toString` methods. - var result = false; - if (value != null && typeof value.toString != 'function') { - try { - result = !!(value + ''); - } catch (e) {} - } - return result; -} - -/** Used for built-in method references. */ -var arrayProto = Array.prototype, - objectProto = Object.prototype; - -/** Used to resolve the decompiled source of functions. */ -var funcToString = Function.prototype.toString; - -/** Used to check objects for own properties. */ -var hasOwnProperty = objectProto.hasOwnProperty; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Used to detect if a method is native. */ -var reIsNative = RegExp('^' + - funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\$&') - .replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$' -); - -/** Built-in value references. */ -var splice = arrayProto.splice; - -/* Built-in method references that are verified to be native. */ -var Map = getNative(root, 'Map'), - nativeCreate = getNative(Object, 'create'); - -/** - * Creates a hash object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function Hash(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the hash. - * - * @private - * @name clear - * @memberOf Hash - */ -function hashClear() { - this.__data__ = nativeCreate ? nativeCreate(null) : {}; -} - -/** - * Removes `key` and its value from the hash. - * - * @private - * @name delete - * @memberOf Hash - * @param {Object} hash The hash to modify. - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function hashDelete(key) { - return this.has(key) && delete this.__data__[key]; -} - -/** - * Gets the hash value for `key`. - * - * @private - * @name get - * @memberOf Hash - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function hashGet(key) { - var data = this.__data__; - if (nativeCreate) { - var result = data[key]; - return result === HASH_UNDEFINED ? undefined : result; - } - return hasOwnProperty.call(data, key) ? data[key] : undefined; -} - -/** - * Checks if a hash value for `key` exists. - * - * @private - * @name has - * @memberOf Hash - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function hashHas(key) { - var data = this.__data__; - return nativeCreate ? data[key] !== undefined : hasOwnProperty.call(data, key); -} - -/** - * Sets the hash `key` to `value`. - * - * @private - * @name set - * @memberOf Hash - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the hash instance. - */ -function hashSet(key, value) { - var data = this.__data__; - data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value; - return this; -} - -// Add methods to `Hash`. -Hash.prototype.clear = hashClear; -Hash.prototype['delete'] = hashDelete; -Hash.prototype.get = hashGet; -Hash.prototype.has = hashHas; -Hash.prototype.set = hashSet; - -/** - * Creates an list cache object. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function ListCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the list cache. - * - * @private - * @name clear - * @memberOf ListCache - */ -function listCacheClear() { - this.__data__ = []; -} - -/** - * Removes `key` and its value from the list cache. - * - * @private - * @name delete - * @memberOf ListCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function listCacheDelete(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - return false; - } - var lastIndex = data.length - 1; - if (index == lastIndex) { - data.pop(); - } else { - splice.call(data, index, 1); - } - return true; -} - -/** - * Gets the list cache value for `key`. - * - * @private - * @name get - * @memberOf ListCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function listCacheGet(key) { - var data = this.__data__, - index = assocIndexOf(data, key); - - return index < 0 ? undefined : data[index][1]; -} - -/** - * Checks if a list cache value for `key` exists. - * - * @private - * @name has - * @memberOf ListCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function listCacheHas(key) { - return assocIndexOf(this.__data__, key) > -1; -} - -/** - * Sets the list cache `key` to `value`. - * - * @private - * @name set - * @memberOf ListCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the list cache instance. - */ -function listCacheSet(key, value) { - var data = this.__data__, - index = assocIndexOf(data, key); - - if (index < 0) { - data.push([key, value]); - } else { - data[index][1] = value; - } - return this; -} - -// Add methods to `ListCache`. -ListCache.prototype.clear = listCacheClear; -ListCache.prototype['delete'] = listCacheDelete; -ListCache.prototype.get = listCacheGet; -ListCache.prototype.has = listCacheHas; -ListCache.prototype.set = listCacheSet; - -/** - * Creates a map cache object to store key-value pairs. - * - * @private - * @constructor - * @param {Array} [entries] The key-value pairs to cache. - */ -function MapCache(entries) { - var index = -1, - length = entries ? entries.length : 0; - - this.clear(); - while (++index < length) { - var entry = entries[index]; - this.set(entry[0], entry[1]); - } -} - -/** - * Removes all key-value entries from the map. - * - * @private - * @name clear - * @memberOf MapCache - */ -function mapCacheClear() { - this.__data__ = { - 'hash': new Hash, - 'map': new (Map || ListCache), - 'string': new Hash - }; -} - -/** - * Removes `key` and its value from the map. - * - * @private - * @name delete - * @memberOf MapCache - * @param {string} key The key of the value to remove. - * @returns {boolean} Returns `true` if the entry was removed, else `false`. - */ -function mapCacheDelete(key) { - return getMapData(this, key)['delete'](key); -} - -/** - * Gets the map value for `key`. - * - * @private - * @name get - * @memberOf MapCache - * @param {string} key The key of the value to get. - * @returns {*} Returns the entry value. - */ -function mapCacheGet(key) { - return getMapData(this, key).get(key); -} - -/** - * Checks if a map value for `key` exists. - * - * @private - * @name has - * @memberOf MapCache - * @param {string} key The key of the entry to check. - * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`. - */ -function mapCacheHas(key) { - return getMapData(this, key).has(key); -} - -/** - * Sets the map `key` to `value`. - * - * @private - * @name set - * @memberOf MapCache - * @param {string} key The key of the value to set. - * @param {*} value The value to set. - * @returns {Object} Returns the map cache instance. - */ -function mapCacheSet(key, value) { - getMapData(this, key).set(key, value); - return this; -} - -// Add methods to `MapCache`. -MapCache.prototype.clear = mapCacheClear; -MapCache.prototype['delete'] = mapCacheDelete; -MapCache.prototype.get = mapCacheGet; -MapCache.prototype.has = mapCacheHas; -MapCache.prototype.set = mapCacheSet; - -/** - * - * Creates an array cache object to store unique values. - * - * @private - * @constructor - * @param {Array} [values] The values to cache. - */ -function SetCache(values) { - var index = -1, - length = values ? values.length : 0; - - this.__data__ = new MapCache; - while (++index < length) { - this.add(values[index]); - } -} - -/** - * Adds `value` to the array cache. - * - * @private - * @name add - * @memberOf SetCache - * @alias push - * @param {*} value The value to cache. - * @returns {Object} Returns the cache instance. - */ -function setCacheAdd(value) { - this.__data__.set(value, HASH_UNDEFINED); - return this; -} - -/** - * Checks if `value` is in the array cache. - * - * @private - * @name has - * @memberOf SetCache - * @param {*} value The value to search for. - * @returns {number} Returns `true` if `value` is found, else `false`. - */ -function setCacheHas(value) { - return this.__data__.has(value); -} - -// Add methods to `SetCache`. -SetCache.prototype.add = SetCache.prototype.push = setCacheAdd; -SetCache.prototype.has = setCacheHas; - -/** - * Gets the index at which the `key` is found in `array` of key-value pairs. - * - * @private - * @param {Array} array The array to search. - * @param {*} key The key to search for. - * @returns {number} Returns the index of the matched value, else `-1`. - */ -function assocIndexOf(array, key) { - var length = array.length; - while (length--) { - if (eq(array[length][0], key)) { - return length; - } - } - return -1; -} - -/** - * The base implementation of methods like `_.difference` without support - * for excluding multiple arrays or iteratee shorthands. - * - * @private - * @param {Array} array The array to inspect. - * @param {Array} values The values to exclude. - * @param {Function} [iteratee] The iteratee invoked per element. - * @param {Function} [comparator] The comparator invoked per element. - * @returns {Array} Returns the new array of filtered values. - */ -function baseDifference(array, values, iteratee, comparator) { - var index = -1, - includes = arrayIncludes, - isCommon = true, - length = array.length, - result = [], - valuesLength = values.length; - - if (!length) { - return result; - } - if (iteratee) { - values = arrayMap(values, baseUnary(iteratee)); - } - if (comparator) { - includes = arrayIncludesWith; - isCommon = false; - } - else if (values.length >= LARGE_ARRAY_SIZE) { - includes = cacheHas; - isCommon = false; - values = new SetCache(values); - } - outer: - while (++index < length) { - var value = array[index], - computed = iteratee ? iteratee(value) : value; - - value = (comparator || value !== 0) ? value : 0; - if (isCommon && computed === computed) { - var valuesIndex = valuesLength; - while (valuesIndex--) { - if (values[valuesIndex] === computed) { - continue outer; - } - } - result.push(value); - } - else if (!includes(values, computed, comparator)) { - result.push(value); - } - } - return result; -} - -/** - * Gets the data for `map`. - * - * @private - * @param {Object} map The map to query. - * @param {string} key The reference key. - * @returns {*} Returns the map data. - */ -function getMapData(map, key) { - var data = map.__data__; - return isKeyable(key) - ? data[typeof key == 'string' ? 'string' : 'hash'] - : data.map; -} - -/** - * Gets the native function at `key` of `object`. - * - * @private - * @param {Object} object The object to query. - * @param {string} key The key of the method to get. - * @returns {*} Returns the function if it's native, else `undefined`. - */ -function getNative(object, key) { - var value = object[key]; - return isNative(value) ? value : undefined; -} - -/** - * Checks if `value` is suitable for use as unique object key. - * - * @private - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is suitable, else `false`. - */ -function isKeyable(value) { - var type = typeof value; - return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean') - ? (value !== '__proto__') - : (value === null); -} - -/** - * Converts `func` to its source code. - * - * @private - * @param {Function} func The function to process. - * @returns {string} Returns the source code. - */ -function toSource(func) { - if (func != null) { - try { - return funcToString.call(func); - } catch (e) {} - try { - return (func + ''); - } catch (e) {} - } - return ''; -} - -/** - * Performs a - * [`SameValueZero`](http://ecma-international.org/ecma-262/6.0/#sec-samevaluezero) - * comparison between two values to determine if they are equivalent. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to compare. - * @param {*} other The other value to compare. - * @returns {boolean} Returns `true` if the values are equivalent, else `false`. - * @example - * - * var object = { 'user': 'fred' }; - * var other = { 'user': 'fred' }; - * - * _.eq(object, object); - * // => true - * - * _.eq(object, other); - * // => false - * - * _.eq('a', 'a'); - * // => true - * - * _.eq('a', Object('a')); - * // => false - * - * _.eq(NaN, NaN); - * // => true - */ -function eq(value, other) { - return value === other || (value !== value && other !== other); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is a native function. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is a native function, - * else `false`. - * @example - * - * _.isNative(Array.prototype.push); - * // => true - * - * _.isNative(_); - * // => false - */ -function isNative(value) { - if (!isObject(value)) { - return false; - } - var pattern = (isFunction(value) || isHostObject(value)) ? reIsNative : reIsHostCtor; - return pattern.test(toSource(value)); -} - -module.exports = baseDifference; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE deleted file mode 100644 index bcbe13d67a9621..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -The MIT License (MIT) - -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md deleted file mode 100644 index 0329abf23d6735..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._root v3.0.1 - -The internal [lodash](https://lodash.com/) function `root` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._root -``` - -In Node.js: -```js -var root = require('lodash._root'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._root) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js deleted file mode 100644 index 2d8ba0affc4d12..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/index.js +++ /dev/null @@ -1,59 +0,0 @@ -/** - * lodash 3.0.1 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -module.exports = root; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json deleted file mode 100644 index 5d911a87e3c833..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/node_modules/lodash._root/package.json +++ /dev/null @@ -1,101 +0,0 @@ -{ - "_args": [ - [ - "lodash._root@~3.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference" - ] - ], - "_from": "lodash._root@>=3.0.0 <3.1.0", - "_id": "lodash._root@3.0.1", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash._basedifference/lodash._root", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/lodash._root-3.0.1.tgz_1455615057559_0.24128212919458747" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.18", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._root", - "raw": "lodash._root@~3.0.0", - "rawSpec": "~3.0.0", - "scope": null, - "spec": ">=3.0.0 <3.1.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without/lodash._basedifference" - ], - "_resolved": "https://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz", - "_shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", - "_shrinkwrap": null, - "_spec": "lodash._root@~3.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without/node_modules/lodash._basedifference", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `root` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "fba1c4524c19ee9a5f8136b4609f017cf4ded692", - "tarball": "http://registry.npmjs.org/lodash._root/-/lodash._root-3.0.1.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash._root", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "3.0.1" -} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json deleted file mode 100644 index 59b01900207106..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash._basedifference/package.json +++ /dev/null @@ -1,103 +0,0 @@ -{ - "_args": [ - [ - "lodash._basedifference@~4.5.0", - "/Users/rebecca/code/npm/node_modules/lodash.without" - ] - ], - "_from": "lodash._basedifference@>=4.5.0 <4.6.0", - "_id": "lodash._basedifference@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash._basedifference", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash._basedifference-4.5.0.tgz_1463061998825_0.9310404139105231" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basedifference", - "raw": "lodash._basedifference@~4.5.0", - "rawSpec": "~4.5.0", - "scope": null, - "spec": ">=4.5.0 <4.6.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without" - ], - "_resolved": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.5.0.tgz", - "_shasum": "56ea7d601367bfa46cd7de115dc3daeb18837938", - "_shrinkwrap": null, - "_spec": "lodash._basedifference@~4.5.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._root": "~3.0.0" - }, - "description": "The internal lodash function `baseDifference` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "56ea7d601367bfa46cd7de115dc3daeb18837938", - "tarball": "https://registry.npmjs.org/lodash._basedifference/-/lodash._basedifference-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basedifference", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md deleted file mode 100644 index 5342ca4452531e..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.rest v4.0.3 - -The [lodash](https://lodash.com/) method `_.rest` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.rest -``` - -In Node.js: -```js -var rest = require('lodash.rest'); -``` - -See the [documentation](https://lodash.com/docs#rest) or [package source](https://github.com/lodash/lodash/blob/4.0.3-npm-packages/lodash.rest) for more details. diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js deleted file mode 100644 index 23157864103d27..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/index.js +++ /dev/null @@ -1,345 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as the `TypeError` message for "Functions" methods. */ -var FUNC_ERROR_TEXT = 'Expected a function'; - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * A faster alternative to `Function#apply`, this function invokes `func` - * with the `this` binding of `thisArg` and the arguments of `args`. - * - * @private - * @param {Function} func The function to invoke. - * @param {*} thisArg The `this` binding of `func`. - * @param {Array} args The arguments to invoke `func` with. - * @returns {*} Returns the result of `func`. - */ -function apply(func, thisArg, args) { - var length = args.length; - switch (length) { - case 0: return func.call(thisArg); - case 1: return func.call(thisArg, args[0]); - case 2: return func.call(thisArg, args[0], args[1]); - case 3: return func.call(thisArg, args[0], args[1], args[2]); - } - return func.apply(thisArg, args); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeMax = Math.max; - -/** - * Creates a function that invokes `func` with the `this` binding of the - * created function and arguments from `start` and beyond provided as - * an array. - * - * **Note:** This method is based on the - * [rest parameter](https://mdn.io/rest_parameters). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Function - * @param {Function} func The function to apply a rest parameter to. - * @param {number} [start=func.length-1] The start position of the rest parameter. - * @returns {Function} Returns the new function. - * @example - * - * var say = _.rest(function(what, names) { - * return what + ' ' + _.initial(names).join(', ') + - * (_.size(names) > 1 ? ', & ' : '') + _.last(names); - * }); - * - * say('hello', 'fred', 'barney', 'pebbles'); - * // => 'hello fred, barney, & pebbles' - */ -function rest(func, start) { - if (typeof func != 'function') { - throw new TypeError(FUNC_ERROR_TEXT); - } - start = nativeMax(start === undefined ? (func.length - 1) : toInteger(start), 0); - return function() { - var args = arguments, - index = -1, - length = nativeMax(args.length - start, 0), - array = Array(length); - - while (++index < length) { - array[index] = args[start + index]; - } - switch (start) { - case 0: return func.call(this, array); - case 1: return func.call(this, args[0], array); - case 2: return func.call(this, args[0], args[1], array); - } - var otherArgs = Array(start + 1); - index = -1; - while (++index < start) { - otherArgs[index] = args[index]; - } - otherArgs[start] = array; - return apply(func, this, otherArgs); - }; -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -module.exports = rest; diff --git a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json b/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json deleted file mode 100644 index 3564a655cb4044..00000000000000 --- a/deps/npm/node_modules/lodash.without/node_modules/lodash.rest/package.json +++ /dev/null @@ -1,105 +0,0 @@ -{ - "_args": [ - [ - "lodash.rest@^4.0.0", - "/Users/rebecca/code/npm/node_modules/lodash.without" - ] - ], - "_from": "lodash.rest@>=4.0.0 <5.0.0", - "_id": "lodash.rest@4.0.3", - "_inCache": true, - "_installable": true, - "_location": "/lodash.without/lodash.rest", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.rest-4.0.3.tgz_1463062507321_0.6458017621189356" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.rest", - "raw": "lodash.rest@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/lodash.without" - ], - "_resolved": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz", - "_shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "_shrinkwrap": null, - "_spec": "lodash.rest@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/lodash.without", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.rest` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "4c1c32c40028087250fabf70d42e0151548f48c5", - "tarball": "https://registry.npmjs.org/lodash.rest/-/lodash.rest-4.0.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "rest" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.rest", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.3" -} diff --git a/deps/npm/node_modules/lodash.without/package.json b/deps/npm/node_modules/lodash.without/package.json index 0aac3a5cb65acf..603342edad496e 100644 --- a/deps/npm/node_modules/lodash.without/package.json +++ b/deps/npm/node_modules/lodash.without/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "lodash.without@latest", - "/Users/rebecca/code/npm" + { + "raw": "lodash.without@4.4.0", + "scope": null, + "escapedName": "lodash.without", + "name": "lodash.without", + "rawSpec": "4.4.0", + "spec": "4.4.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "lodash.without@latest", - "_id": "lodash.without@4.2.0", + "_from": "lodash.without@4.4.0", + "_id": "lodash.without@4.4.0", "_inCache": true, - "_installable": true, "_location": "/lodash.without", - "_nodeVersion": "5.5.0", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.without-4.2.0.tgz_1463062688060_0.9002856267616153" + "tmp": "tmp/lodash.without-4.4.0.tgz_1471110432266_0.7884129623416811" }, "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, - "_npmVersion": "2.15.5", + "_npmVersion": "2.15.10", "_phantomChildren": {}, "_requested": { - "name": "lodash.without", - "raw": "lodash.without@latest", - "rawSpec": "latest", + "raw": "lodash.without@4.4.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "lodash.without", + "name": "lodash.without", + "rawSpec": "4.4.0", + "spec": "4.4.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.2.0.tgz", - "_shasum": "f89ec9a8ee2d7ec14f8a9cad72a3f5ee12c5a4a6", + "_resolved": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz", + "_shasum": "3cd4574a00b67bae373a94b748772640507b7aac", "_shrinkwrap": null, - "_spec": "lodash.without@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "lodash.without@4.4.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, "bugs": { @@ -47,31 +56,28 @@ }, "contributors": [ { - "email": "john.david.dalton@gmail.com", "name": "John-David Dalton", + "email": "john.david.dalton@gmail.com", "url": "http://allyoucanleet.com/" }, { - "email": "blaine.bublitz@gmail.com", "name": "Blaine Bublitz", + "email": "blaine.bublitz@gmail.com", "url": "https://github.com/phated" }, { - "email": "mathias@qiwi.be", "name": "Mathias Bynens", + "email": "mathias@qiwi.be", "url": "https://mathiasbynens.be/" } ], - "dependencies": { - "lodash._basedifference": "~4.5.0", - "lodash.rest": "^4.0.0" - }, + "dependencies": {}, "description": "The lodash method `_.without` exported as a module.", "devDependencies": {}, "directories": {}, "dist": { - "shasum": "f89ec9a8ee2d7ec14f8a9cad72a3f5ee12c5a4a6", - "tarball": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.2.0.tgz" + "shasum": "3cd4574a00b67bae373a94b748772640507b7aac", + "tarball": "https://registry.npmjs.org/lodash.without/-/lodash.without-4.4.0.tgz" }, "homepage": "https://lodash.com/", "icon": "https://lodash.com/icon.svg", @@ -82,16 +88,16 @@ "license": "MIT", "maintainers": [ { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" + "name": "jdalton", + "email": "john.david.dalton@gmail.com" }, { - "email": "mathias@qiwi.be", - "name": "mathias" + "name": "mathias", + "email": "mathias@qiwi.be" }, { - "email": "blaine@iceddev.com", - "name": "phated" + "name": "phated", + "email": "blaine@iceddev.com" } ], "name": "lodash.without", @@ -104,5 +110,5 @@ "scripts": { "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" }, - "version": "4.2.0" + "version": "4.4.0" } diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js index a5793ceccec488..584f551a6da734 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/index.js @@ -1,16 +1,16 @@ module.exports = function (args, opts) { if (!opts) opts = {}; - + var flags = { bools : {}, strings : {} }; - + [].concat(opts['boolean']).filter(Boolean).forEach(function (key) { flags.bools[key] = true; }); - + [].concat(opts.string).filter(Boolean).forEach(function (key) { flags.strings[key] = true; }); - + var aliases = {}; Object.keys(opts.alias || {}).forEach(function (key) { aliases[key] = [].concat(opts.alias[key]); @@ -20,14 +20,14 @@ module.exports = function (args, opts) { })); }); }); - + var defaults = opts['default'] || {}; - + var argv = { _ : [] }; Object.keys(flags.bools).forEach(function (key) { setArg(key, defaults[key] === undefined ? false : defaults[key]); }); - + var notFlags = []; if (args.indexOf('--') !== -1) { @@ -40,15 +40,15 @@ module.exports = function (args, opts) { ? Number(val) : val ; setKey(argv, key.split('.'), value); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), value); }); } - + for (var i = 0; i < args.length; i++) { var arg = args[i]; - + if (/^--.+=/.test(arg)) { // Using [\s\S] instead of . because js doesn't support the // 'dotall' regex modifier. See: @@ -79,23 +79,23 @@ module.exports = function (args, opts) { } else if (/^-[^-]+/.test(arg)) { var letters = arg.slice(1,-1).split(''); - + var broken = false; for (var j = 0; j < letters.length; j++) { var next = arg.slice(j+2); - + if (next === '-') { setArg(letters[j], next) continue; } - + if (/[A-Za-z]/.test(letters[j]) && /-?\d+(\.\d*)?(e-?\d+)?$/.test(next)) { setArg(letters[j], next); broken = true; break; } - + if (letters[j+1] && letters[j+1].match(/\W/)) { setArg(letters[j], arg.slice(j+2)); broken = true; @@ -105,7 +105,7 @@ module.exports = function (args, opts) { setArg(letters[j], flags.strings[letters[j]] ? '' : true); } } - + var key = arg.slice(-1)[0]; if (!broken && key !== '-') { if (args[i+1] && !/^(-|--)[^-]/.test(args[i+1]) @@ -129,17 +129,17 @@ module.exports = function (args, opts) { ); } } - + Object.keys(defaults).forEach(function (key) { if (!hasKey(argv, key.split('.'))) { setKey(argv, key.split('.'), defaults[key]); - + (aliases[key] || []).forEach(function (x) { setKey(argv, x.split('.'), defaults[key]); }); } }); - + notFlags.forEach(function(key) { argv._.push(key); }); @@ -163,7 +163,7 @@ function setKey (obj, keys, value) { if (o[key] === undefined) o[key] = {}; o = o[key]; }); - + var key = keys[keys.length - 1]; if (o[key] === undefined || typeof o[key] === 'boolean') { o[key] = value; diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js index 47e92237fb0bbc..8a90646696628e 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse.js @@ -14,7 +14,7 @@ test('parse args', function (t) { ); t.end(); }); - + test('comprehensive', function (t) { t.deepEqual( parse([ @@ -80,13 +80,13 @@ test('flag boolean value', function (t) { boolean: [ 't', 'verbose' ], default: { verbose: true } }); - + t.deepEqual(argv, { verbose: false, t: true, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -97,13 +97,13 @@ test('flag boolean default false', function (t) { boolean: ['t', 'verbose'], default: { verbose: false, t: false } }); - + t.deepEqual(argv, { verbose: false, t: false, _: ['moo'] }); - + t.deepEqual(typeof argv.verbose, 'boolean'); t.deepEqual(typeof argv.t, 'boolean'); t.end(); @@ -114,14 +114,14 @@ test('boolean groups', function (t) { var argv = parse([ '-x', '-z', 'one', 'two', 'three' ], { boolean: ['x','y','z'] }); - + t.deepEqual(argv, { x : true, y : false, z : true, _ : [ 'one', 'two', 'three' ] }); - + t.deepEqual(typeof argv.x, 'boolean'); t.deepEqual(typeof argv.y, 'boolean'); t.deepEqual(typeof argv.z, 'boolean'); @@ -131,7 +131,7 @@ test('boolean groups', function (t) { test('newlines in params' , function (t) { var args = parse([ '-s', "X\nX" ]) t.deepEqual(args, { _ : [], s : "X\nX" }); - + // reproduce in bash: // VALUE="new // line" @@ -145,7 +145,7 @@ test('strings' , function (t) { var s = parse([ '-s', '0001234' ], { string: 's' }).s; t.equal(s, '0001234'); t.equal(typeof s, 'string'); - + var x = parse([ '-x', '56' ], { string: 'x' }).x; t.equal(x, '56'); t.equal(typeof x, 'string'); @@ -222,7 +222,7 @@ test('nested dotted objects', function (t) { '--foo.quux.quibble', '5', '--foo.quux.o_O', '--beep.boop' ]); - + t.same(argv.foo, { bar : 3, baz : 4, @@ -254,9 +254,9 @@ test('boolean and alias with chainable api', function (t) { h: true, '_': [ 'derp' ] }; - + t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -295,7 +295,7 @@ test('boolean and alias using explicit true', function (t) { }; t.same(aliasedArgv, expected); - t.same(propertyArgv, expected); + t.same(propertyArgv, expected); t.end(); }); @@ -311,7 +311,7 @@ test('boolean and --x=true', function(t) { parsed = parse(['--boool', '--other=false'], { boolean: 'boool' }); - + t.same(parsed.boool, true); t.same(parsed.other, 'false'); t.end(); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js index 7c4c2abe397797..21851b036ee6d9 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js @@ -3,7 +3,7 @@ var test = require('tape'); test('parse with modifier functions' , function (t) { t.plan(1); - + var argv = parse([ '-b', '123' ], { boolean: 'b' }); t.deepEqual(argv, { b: true, _: ['123'] }); }); diff --git a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js index ac18880f1eb50c..d513a1c2529095 100644 --- a/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js +++ b/deps/npm/node_modules/mkdirp/node_modules/minimist/test/short.js @@ -43,7 +43,7 @@ test('short', function (t) { ); t.end(); }); - + test('mixed short bool and capture', function (t) { t.same( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), @@ -54,7 +54,7 @@ test('mixed short bool and capture', function (t) { ); t.end(); }); - + test('short and long', function (t) { t.deepEqual( parse([ '-h', 'localhost', '-fp', '555', 'script.js' ]), diff --git a/deps/npm/node_modules/node-gyp/CHANGELOG.md b/deps/npm/node_modules/node-gyp/CHANGELOG.md index 089ee84a4d7dbc..cb63589e24317f 100644 --- a/deps/npm/node_modules/node-gyp/CHANGELOG.md +++ b/deps/npm/node_modules/node-gyp/CHANGELOG.md @@ -1,3 +1,27 @@ +v3.4.0 2016-06-28 + +* [[`ce5fd04e94`](https://github.com/nodejs/node-gyp/commit/ce5fd04e94)] - **deps**: update minimatch version (delphiactual) [#961](https://github.com/nodejs/node-gyp/pull/961) +* [[`77383ddd85`](https://github.com/nodejs/node-gyp/commit/77383ddd85)] - Replace fs.accessSync call to fs.statSync (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`0dba4bda57`](https://github.com/nodejs/node-gyp/commit/0dba4bda57)] - **test**: add simple addon test (Richard Lau) [#955](https://github.com/nodejs/node-gyp/pull/955) +* [[`c4344b3889`](https://github.com/nodejs/node-gyp/commit/c4344b3889)] - **doc**: add --target option to README (Gibson Fahnestock) [#958](https://github.com/nodejs/node-gyp/pull/958) +* [[`cc778e9215`](https://github.com/nodejs/node-gyp/commit/cc778e9215)] - Override BUILDING_UV_SHARED, BUILDING_V8_SHARED. (Ben Noordhuis) [#915](https://github.com/nodejs/node-gyp/pull/915) +* [[`af35b2ad32`](https://github.com/nodejs/node-gyp/commit/af35b2ad32)] - Move VC++ Build Tools to Build Tools landing page. (Andrew Pardoe) [#953](https://github.com/nodejs/node-gyp/pull/953) +* [[`f31482e226`](https://github.com/nodejs/node-gyp/commit/f31482e226)] - **win**: work around __pfnDliNotifyHook2 type change (Alexis Campailla) [#952](https://github.com/nodejs/node-gyp/pull/952) +* [[`3df8222fa5`](https://github.com/nodejs/node-gyp/commit/3df8222fa5)] - Allow for npmlog@3.x (Rebecca Turner) [#950](https://github.com/nodejs/node-gyp/pull/950) +* [[`a4fa07b390`](https://github.com/nodejs/node-gyp/commit/a4fa07b390)] - More verbose error on locating msbuild.exe failure. (Mateusz Jaworski) [#930](https://github.com/nodejs/node-gyp/pull/930) +* [[`4ee31329e0`](https://github.com/nodejs/node-gyp/commit/4ee31329e0)] - **doc**: add command options to README.md (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`c8c7ca86b9`](https://github.com/nodejs/node-gyp/commit/c8c7ca86b9)] - Add --silent option for zero output. (Gibson Fahnestock) [#937](https://github.com/nodejs/node-gyp/pull/937) +* [[`ac29d23a7c`](https://github.com/nodejs/node-gyp/commit/ac29d23a7c)] - Upgrade to glob@7.0.3. (Ben Noordhuis) [#943](https://github.com/nodejs/node-gyp/pull/943) +* [[`15fd56be3d`](https://github.com/nodejs/node-gyp/commit/15fd56be3d)] - Enable V8 deprecation warnings for native modules (Matt Loring) [#920](https://github.com/nodejs/node-gyp/pull/920) +* [[`7f1c1b960c`](https://github.com/nodejs/node-gyp/commit/7f1c1b960c)] - **gyp**: improvements for android generator (Robert Chiras) [#935](https://github.com/nodejs/node-gyp/pull/935) +* [[`088082766c`](https://github.com/nodejs/node-gyp/commit/088082766c)] - Update Windows install instructions (Sara Itani) [#867](https://github.com/nodejs/node-gyp/pull/867) +* [[`625c1515f9`](https://github.com/nodejs/node-gyp/commit/625c1515f9)] - **gyp**: inherit CC/CXX for CC/CXX.host (Johan Bergström) [#908](https://github.com/nodejs/node-gyp/pull/908) +* [[`3bcb1720e4`](https://github.com/nodejs/node-gyp/commit/3bcb1720e4)] - Add support for the Python launcher on Windows (Patrick Westerhoff) [#894](https://github.com/nodejs/node-gyp/pull/894 + +v3.3.1 2016-03-04 + +* [[`a981ef847a`](https://github.com/nodejs/node-gyp/commit/a981ef847a)] - **gyp**: fix android generator (Robert Chiras) [#889](https://github.com/nodejs/node-gyp/pull/889) + v3.3.0 2016-02-16 * [[`818d854a4d`](https://github.com/nodejs/node-gyp/commit/818d854a4d)] - Introduce NODEJS_ORG_MIRROR and IOJS_ORG_MIRROR (Rod Vagg) [#878](https://github.com/nodejs/node-gyp/pull/878) @@ -19,7 +43,7 @@ v3.2.0 2015-11-25 * [[`0e2dfda1f3`](https://github.com/nodejs/node-gyp/commit/0e2dfda1f3)] - Fix test/test-options when run through `npm test`. (Ben Noordhuis) [#755](https://github.com/nodejs/node-gyp/pull/755) * [[`9bfa0876b4`](https://github.com/nodejs/node-gyp/commit/9bfa0876b4)] - Add support for AIX (Michael Dawson) [#753](https://github.com/nodejs/node-gyp/pull/753) * [[`a8d441a0a2`](https://github.com/nodejs/node-gyp/commit/a8d441a0a2)] - Update README for Windows 10 support. (Jason Williams) [#766](https://github.com/nodejs/node-gyp/pull/766) -* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) +* [[`d1d6015276`](https://github.com/nodejs/node-gyp/commit/d1d6015276)] - Update broken links and switch to HTTPS. (andrew morton) v3.1.0 2015-11-14 diff --git a/deps/npm/node_modules/node-gyp/README.md b/deps/npm/node_modules/node-gyp/README.md index dec739f16fde99..5212b124f98628 100644 --- a/deps/npm/node_modules/node-gyp/README.md +++ b/deps/npm/node_modules/node-gyp/README.md @@ -10,9 +10,9 @@ program which is removed for node `v0.8`. If you have a native addon for node th still has a `wscript` file, then you should definitely add a `binding.gyp` file to support the latest versions of node. -Multiple target versions of node are supported (i.e. `0.8`, `0.9`, `0.10`, ..., `1.0`, +Multiple target versions of node are supported (i.e. `0.8`, ..., `4`, `5`, `6`, etc.), regardless of what version of node is actually installed on your system -(`node-gyp` downloads the necessary development files for the target version). +(`node-gyp` downloads the necessary development files or headers for the target version). #### Features: @@ -42,30 +42,17 @@ You will also need to install: * You also need to install the `Command Line Tools` via Xcode. You can find this under the menu `Xcode -> Preferences -> Downloads` * This step will install `gcc` and the related toolchain containing `make` * On Windows: - * Python ([`v2.7.10`][python-v2.7.10] recommended, `v3.x.x` is __*not*__ supported) - * Make sure that you have a PYTHON environment variable, and it is set to drive:\path\to\python.exe not to a folder - * Windows XP/Vista/7: - * Microsoft Visual Studio C++ 2013 ([Express][msvc2013] version works well) - * If the install fails, try uninstalling any C++ 2010 x64&x86 Redistributable that you have installed first - * If you get errors that the 64-bit compilers are not installed you may also need the [compiler update for the Windows SDK 7.1] - * Windows 7/8: - * Microsoft Visual Studio C++ 2013 for Windows Desktop ([Express][msvc2013] version works well) - * Windows 10: - * Install the latest version of npm (3.3.6 at the time of writing) - * Install Python 2.7 from https://www.python.org/download/releases/2.7/ and make sure its on the System Path - * Install Visual Studio Community 2015 Edition. (Custom Install, Select Visual C++ during the installation) - * Set the environment variable GYP_MSVS_VERSION=2015 - * Run the command prompt as Administrator - * $ npm install (--msvs_version=2015) <-- Shouldn't be needed if you have set GYP_MSVS_VERSION env - * If the above steps have not worked or you are unsure please visit http://www.serverpals.com/blog/building-using-node-gyp-with-visual-studio-express-2015-on-windows-10-pro-x64 for a full walkthrough - * All Windows Versions - * For 64-bit builds of node and native modules you will _**also**_ need the [Windows 7 64-bit SDK][win7sdk] - * You may need to run one of the following commands if your build complains about WindowsSDKDir not being set, and you are sure you have already installed the SDK: + * Visual C++ Build Environment: + * Option 1: Install [Visual C++ Build Tools](http://landinghub.visualstudio.com/visual-cpp-build-tools) using the **Default Install** option. -``` -call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x86 -call "C:\Program Files\Microsoft SDKs\Windows\v7.1\bin\Setenv.cmd" /Release /x64 -``` + * Option 2: Install [Visual Studio 2015](https://www.visualstudio.com/products/visual-studio-community-vs) (or modify an existing installation) and select *Common Tools for Visual C++* during setup. This also works with the free Community and Express for Desktop editions. + + > :bulb: [Windows Vista / 7 only] requires [.NET Framework 4.5.1](http://www.microsoft.com/en-us/download/details.aspx?id=40773) + + * Install [Python 2.7](https://www.python.org/downloads/) (`v3.x.x` is not supported), and run `npm config set python python2.7` (or see below for further instructions on specifying the proper Python version and path.) + * Launch cmd, `npm config set msvs_version 2015` + + If the above steps didn't work for you, please visit [Microsoft's Node.js Guidelines for Windows](https://github.com/Microsoft/nodejs-guidelines/blob/master/windows-environment.md#compiling-native-addon-modules) for additional tips. If you have multiple Python versions installed, you can identify which Python version `node-gyp` uses by setting the '--python' variable: @@ -157,13 +144,43 @@ Commands | **Command** | **Description** |:--------------|:--------------------------------------------------------------- +| `help` | Shows the help dialog | `build` | Invokes `make`/`msbuild.exe` and builds the native addon | `clean` | Removes the `build` directory if it exists | `configure` | Generates project build files for the current platform | `rebuild` | Runs `clean`, `configure` and `build` all in a row -| `install` | Installs node development header files for the given version -| `list` | Lists the currently installed node development file versions -| `remove` | Removes the node development header files for the given version +| `install` | Installs node header files for the given version +| `list` | Lists the currently installed node header versions +| `remove` | Removes the node header files for the given version + + +Command Options +-------- + +`node-gyp` accepts the following command options: + +| **Command** | **Description** +|:----------------------------------|:------------------------------------------ +| `-j n`, `--jobs n` | Run make in parallel +| `--target=v6.2.1` | Node version to build for (default=process.version) +| `--silly`, `--loglevel=silly` | Log all progress to console +| `--verbose`, `--loglevel=verbose` | Log most progress to console +| `--silent`, `--loglevel=silent` | Don't log anything to console +| `debug`, `--debug` | Make Debug build (default=Release) +| `--release`, `--no-debug` | Make Release build +| `-C $dir`, `--directory=$dir` | Run command in different directory +| `--make=$make` | Override make command (e.g. gmake) +| `--thin=yes` | Enable thin static libraries +| `--arch=$arch` | Set target architecture (e.g. ia32) +| `--tarball=$path` | Get headers from a local tarball +| `--ensure` | Don't reinstall headers if already present +| `--dist-url=$url` | Download header tarball from custom URL +| `--proxy=$url` | Set HTTP proxy for downloading header tarball +| `--cafile=$cafile` | Override default CA chain (to download tarball) +| `--nodedir=$path` | Set the path to the node binary +| `--python=$path` | Set path to the python (2) binary +| `--msvs_version=$version` | Set Visual Studio version (win) +| `--solution=$solution` | Set Visual Studio Solution version (win) License diff --git a/deps/npm/node_modules/node-gyp/addon.gypi b/deps/npm/node_modules/node-gyp/addon.gypi index 552e4748d3b7e7..3be0f591bda9e3 100644 --- a/deps/npm/node_modules/node-gyp/addon.gypi +++ b/deps/npm/node_modules/node-gyp/addon.gypi @@ -10,8 +10,16 @@ '<(node_root_dir)/deps/uv/include', '<(node_root_dir)/deps/v8/include' ], + 'defines!': [ + 'BUILDING_UV_SHARED=1', # Inherited from common.gypi. + 'BUILDING_V8_SHARED=1', # Inherited from common.gypi. + ], 'defines': [ - 'NODE_GYP_MODULE_NAME=>(_target_name)' + 'NODE_GYP_MODULE_NAME=>(_target_name)', + 'USING_UV_SHARED=1', + 'USING_V8_SHARED=1', + # Warn when using deprecated V8 APIs. + 'V8_DEPRECATION_WARNINGS=1' ], 'target_conditions': [ @@ -41,7 +49,7 @@ 'conditions': [ [ 'OS=="win"', { 'sources': [ - '<(node_gyp_dir)/src/win_delay_load_hook.c', + '<(node_gyp_dir)/src/win_delay_load_hook.cc', ], 'msvs_settings': { 'VCLinkerTool': { diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py index bb9eb5f4b96775..5b26cc785a80e8 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/android.py @@ -875,6 +875,7 @@ def WriteTarget(self, spec, configs, deps, link_deps, part_of_all, self.WriteLn('LOCAL_PRELINK_MODULE := false') self.WriteLn('include $(BUILD_%sSHARED_LIBRARY)' % modifier) elif self.type == 'executable': + self.WriteLn('LOCAL_CXX_STL := libc++_static') # Executables are for build and test purposes only, so they're installed # to a directory that doesn't get included in the system image. self.WriteLn('LOCAL_MODULE_PATH := $(gyp_shared_intermediate_dir)') @@ -1080,7 +1081,7 @@ def CalculateMakefilePath(build_file, base_name): root_makefile.write('GYP_CONFIGURATION ?= %s\n' % default_configuration) root_makefile.write('GYP_VAR_PREFIX ?=\n') root_makefile.write('GYP_HOST_VAR_PREFIX ?=\n') - root_makefile.write('GYP_HOST_MULTILIB ?=\n') + root_makefile.write('GYP_HOST_MULTILIB ?= first\n') # Write out the sorted list of includes. root_makefile.write('\n') diff --git a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py index aefdac787c2408..64b9dd267b7492 100644 --- a/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py +++ b/deps/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py @@ -2065,10 +2065,10 @@ def CalculateMakefilePath(build_file, base_name): 'AR.target': GetEnvironFallback(('AR_target', 'AR'), '$(AR)'), 'CXX.target': GetEnvironFallback(('CXX_target', 'CXX'), '$(CXX)'), 'LINK.target': GetEnvironFallback(('LINK_target', 'LINK'), '$(LINK)'), - 'CC.host': GetEnvironFallback(('CC_host',), 'gcc'), - 'AR.host': GetEnvironFallback(('AR_host',), 'ar'), - 'CXX.host': GetEnvironFallback(('CXX_host',), 'g++'), - 'LINK.host': GetEnvironFallback(('LINK_host',), '$(CXX.host)'), + 'CC.host': GetEnvironFallback(('CC_host', 'CC'), 'gcc'), + 'AR.host': GetEnvironFallback(('AR_host', 'AR'), 'ar'), + 'CXX.host': GetEnvironFallback(('CXX_host', 'CXX'), 'g++'), + 'LINK.host': GetEnvironFallback(('LINK_host', 'LINK'), '$(CXX.host)'), }) build_file, _, _ = gyp.common.ParseQualifiedTarget(target_list[0]) diff --git a/deps/npm/node_modules/node-gyp/lib/build.js b/deps/npm/node_modules/node-gyp/lib/build.js index 3a3edccf872b92..22f2583694c70f 100644 --- a/deps/npm/node_modules/node-gyp/lib/build.js +++ b/deps/npm/node_modules/node-gyp/lib/build.js @@ -125,19 +125,19 @@ function build (gyp, argv, callback) { function findMsbuild () { log.verbose('could not find "msbuild.exe" in PATH - finding location in registry') - var notfoundErr = new Error('Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?') + var notfoundErr = 'Can\'t find "msbuild.exe". Do you have Microsoft Visual Studio C++ 2008+ installed?' var cmd = 'reg query "HKLM\\Software\\Microsoft\\MSBuild\\ToolsVersions" /s' if (process.arch !== 'ia32') cmd += ' /reg:32' exec(cmd, function (err, stdout, stderr) { + if (err) { + return callback(new Error(err.message + '\n' + notfoundErr)) + } var reVers = /ToolsVersions\\([^\\]+)$/i , rePath = /\r\n[ \t]+MSBuildToolsPath[ \t]+REG_SZ[ \t]+([^\r]+)/i , msbuilds = [] , r , msbuildPath - if (err) { - return callback(notfoundErr) - } stdout.split('\r\n\r\n').forEach(function(l) { if (!l) return l = l.trim() @@ -157,7 +157,7 @@ function build (gyp, argv, callback) { return (x.version < y.version ? -1 : 1) }) ;(function verifyMsbuild () { - if (!msbuilds.length) return callback(notfoundErr) + if (!msbuilds.length) return callback(new Error(notfoundErr)) msbuildPath = path.resolve(msbuilds.pop().path, 'msbuild.exe') fs.stat(msbuildPath, function (err, stat) { if (err) { @@ -165,7 +165,7 @@ function build (gyp, argv, callback) { if (msbuilds.length) { return verifyMsbuild() } else { - callback(notfoundErr) + callback(new Error(notfoundErr)) } } else { callback(err) diff --git a/deps/npm/node_modules/node-gyp/lib/configure.js b/deps/npm/node_modules/node-gyp/lib/configure.js index 4e0652961ea902..4543bce7d71ba0 100644 --- a/deps/npm/node_modules/node-gyp/lib/configure.js +++ b/deps/npm/node_modules/node-gyp/lib/configure.js @@ -1,5 +1,6 @@ module.exports = exports = configure -module.exports.test = { findPython: findPython } +module.exports.test = { findAccessibleSync: findAccessibleSync, + findPython: findPython } /** * Module dependencies. @@ -7,7 +8,6 @@ module.exports.test = { findPython: findPython } var fs = require('graceful-fs') , path = require('path') - , glob = require('glob') , log = require('npmlog') , osenv = require('osenv') , which = require('which') @@ -21,6 +21,7 @@ var fs = require('graceful-fs') , execFile = cp.execFile , win = process.platform == 'win32' , findNodeDirectory = require('./find-node-directory') + , msgFormat = require('util').format exports.usage = 'Generates ' + (win ? 'MSVC project files' : 'a Makefile') + ' for the current module' @@ -227,22 +228,21 @@ function configure (gyp, argv, callback) { // - the out/Release directory // - the out/Debug directory // - the root directory - var node_exp_file = '' + var node_exp_file = undefined if (process.platform === 'aix') { var node_root_dir = findNodeDirectory() var candidates = ['include/node/node.exp', 'out/Release/node.exp', 'out/Debug/node.exp', 'node.exp'] - for (var next = 0; next < candidates.length; next++) { - node_exp_file = path.resolve(node_root_dir, candidates[next]) - try { - fs.accessSync(node_exp_file, fs.R_OK) - // exp file found, stop looking - break - } catch (exception) { - // this candidate was not found or not readable, do nothing - } + var logprefix = 'find exports file' + node_exp_file = findAccessibleSync(logprefix, node_root_dir, candidates) + if (node_exp_file !== undefined) { + log.verbose(logprefix, 'Found exports file: %s', node_exp_file) + } else { + var msg = msgFormat('Could not find node.exp file in %s', node_root_dir) + log.error(logprefix, 'Could not find exports file') + return callback(new Error(msg)) } } @@ -311,6 +311,29 @@ function configure (gyp, argv, callback) { } +/** + * Returns the first file or directory from an array of candidates that is + * readable by the current user, or undefined if none of the candidates are + * readable. + */ +function findAccessibleSync (logprefix, dir, candidates) { + for (var next = 0; next < candidates.length; next++) { + var candidate = path.resolve(dir, candidates[next]) + try { + var fd = fs.openSync(candidate, 'r') + } catch (e) { + // this candidate was not found or not readable, do nothing + log.silly(logprefix, 'Could not open %s: %s', candidate, e.message) + continue + } + fs.closeSync(fd) + log.silly(logprefix, 'Found readable %s', candidate) + return candidate + } + + return undefined +} + function findPython (python, callback) { checkPython() @@ -325,7 +348,7 @@ function findPython (python, callback) { return checkPython() } if (win) { - guessPython() + checkPythonLauncher() } else { failNoPython() } @@ -340,6 +363,31 @@ function findPython (python, callback) { }) } + // Distributions of Python on Windows by default install with the "py.exe" + // Python launcher which is more likely to exist than the Python executable + // being in the $PATH. + // Because the Python launcher supports all versions of Python, we have to + // explicitly request a Python 2 version. This is done by supplying "-2" as + // the first command line argument. Since "py.exe -2" would be an invalid + // executable for "execFile", we have to use the launcher to figure out + // where the actual "python.exe" executable is located. + function checkPythonLauncher () { + log.verbose('could not find "' + python + '". checking python launcher') + var env = extend({}, process.env) + env.TERM = 'dumb' + + var launcherArgs = ['-2', '-c', 'import sys; print sys.executable'] + execFile('py.exe', launcherArgs, { env: env }, function (err, stdout) { + if (err) { + guessPython() + return + } + python = stdout.trim() + log.verbose('check python launcher', 'python executable found: %j', python) + checkPythonVersion() + }) + } + // Called on Windows when "python" isn't available in the current $PATH. // We're gonna check if "%SystemDrive%\python27\python.exe" exists. function guessPython () { diff --git a/deps/npm/node_modules/node-gyp/lib/node-gyp.js b/deps/npm/node_modules/node-gyp/lib/node-gyp.js index a5a332885597bf..3b8f5b0a1c2e04 100644 --- a/deps/npm/node_modules/node-gyp/lib/node-gyp.js +++ b/deps/npm/node_modules/node-gyp/lib/node-gyp.js @@ -112,6 +112,7 @@ proto.shorthands = { , j: '--jobs' , silly: '--loglevel=silly' , verbose: '--loglevel=verbose' + , silent: '--loglevel=silent' } /** diff --git a/deps/npm/node_modules/node-gyp/lib/process-release.js b/deps/npm/node_modules/node-gyp/lib/process-release.js index f5a3cca6357b6d..89eaf9be361290 100644 --- a/deps/npm/node_modules/node-gyp/lib/process-release.js +++ b/deps/npm/node_modules/node-gyp/lib/process-release.js @@ -9,7 +9,7 @@ var semver = require('semver') , bitsreV3 = /\/win-(x86|ia32|x64)\// // io.js v3.x.x shipped with "ia32" but should // have been "x86" -// Captures all the logic required to determine download URLs, local directory and +// Captures all the logic required to determine download URLs, local directory and // file names. Inputs come from command-line switches (--target, --dist-url), // `process.version` and `process.release` where it exists. function processRelease (argv, gyp, defaultVersion, defaultRelease) { diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/README.md deleted file mode 100644 index 258257ecb1901f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/README.md +++ /dev/null @@ -1,369 +0,0 @@ -[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Dependency Status](https://david-dm.org/isaacs/node-glob.svg)](https://david-dm.org/isaacs/node-glob) [![devDependency Status](https://david-dm.org/isaacs/node-glob/dev-status.svg)](https://david-dm.org/isaacs/node-glob#info=devDependencies) [![optionalDependency Status](https://david-dm.org/isaacs/node-glob/optional-status.svg)](https://david-dm.org/isaacs/node-glob#info=optionalDependencies) - -# Glob - -Match files using the patterns the shell uses, like stars and stuff. - -This is a glob implementation in JavaScript. It uses the `minimatch` -library to do its matching. - -![](oh-my-glob.gif) - -## Usage - -```javascript -var glob = require("glob") - -// options is optional -glob("**/*.js", options, function (er, files) { - // files is an array of filenames. - // If the `nonull` option is set, and nothing - // was found, then files is ["**/*.js"] - // er is an error object or null. -}) -``` - -## Glob Primer - -"Globs" are the patterns you type when you do stuff like `ls *.js` on -the command line, or put `build/*` in a `.gitignore` file. - -Before parsing the path part patterns, braced sections are expanded -into a set. Braced sections start with `{` and end with `}`, with any -number of comma-delimited sections within. Braced sections may contain -slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`. - -The following characters have special magic meaning when used in a -path portion: - -* `*` Matches 0 or more characters in a single path portion -* `?` Matches 1 character -* `[...]` Matches a range of characters, similar to a RegExp range. - If the first character of the range is `!` or `^` then it matches - any character not in the range. -* `!(pattern|pattern|pattern)` Matches anything that does not match - any of the patterns provided. -* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the - patterns provided. -* `+(pattern|pattern|pattern)` Matches one or more occurrences of the - patterns provided. -* `*(a|b|c)` Matches zero or more occurrences of the patterns provided -* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns - provided -* `**` If a "globstar" is alone in a path portion, then it matches - zero or more directories and subdirectories searching for matches. - It does not crawl symlinked directories. - -### Dots - -If a file or directory path portion has a `.` as the first character, -then it will not match any glob pattern unless that pattern's -corresponding path part also has a `.` as its first character. - -For example, the pattern `a/.*/c` would match the file at `a/.b/c`. -However the pattern `a/*/c` would not, because `*` does not start with -a dot character. - -You can make glob treat dots as normal characters by setting -`dot:true` in the options. - -### Basename Matching - -If you set `matchBase:true` in the options, and the pattern has no -slashes in it, then it will seek for any file anywhere in the tree -with a matching basename. For example, `*.js` would match -`test/simple/basic.js`. - -### Negation - -The intent for negation would be for a pattern starting with `!` to -match everything that *doesn't* match the supplied pattern. However, -the implementation is weird, and for the time being, this should be -avoided. The behavior will change or be deprecated in version 5. - -### Empty Sets - -If no matching files are found, then an empty array is returned. This -differs from the shell, where the pattern itself is returned. For -example: - - $ echo a*s*d*f - a*s*d*f - -To get the bash-style behavior, set the `nonull:true` in the options. - -### See Also: - -* `man sh` -* `man bash` (Search for "Pattern Matching") -* `man 3 fnmatch` -* `man 5 gitignore` -* [minimatch documentation](https://github.com/isaacs/minimatch) - -## glob.hasMagic(pattern, [options]) - -Returns `true` if there are any special characters in the pattern, and -`false` otherwise. - -Note that the options affect the results. If `noext:true` is set in -the options object, then `+(a|b)` will not be considered a magic -pattern. If the pattern has a brace expansion, like `a/{b/c,x/y}` -then that is considered magical, unless `nobrace:true` is set in the -options. - -## glob(pattern, [options], cb) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* `cb` {Function} - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Perform an asynchronous glob search. - -## glob.sync(pattern, [options]) - -* `pattern` {String} Pattern to be matched -* `options` {Object} -* return: {Array} filenames found matching the pattern - -Perform a synchronous glob search. - -## Class: glob.Glob - -Create a Glob object by instantiating the `glob.Glob` class. - -```javascript -var Glob = require("glob").Glob -var mg = new Glob(pattern, options, cb) -``` - -It's an EventEmitter, and starts walking the filesystem to find matches -immediately. - -### new glob.Glob(pattern, [options], [cb]) - -* `pattern` {String} pattern to search for -* `options` {Object} -* `cb` {Function} Called when an error occurs, or matches are found - * `err` {Error | null} - * `matches` {Array} filenames found matching the pattern - -Note that if the `sync` flag is set in the options, then matches will -be immediately available on the `g.found` member. - -### Properties - -* `minimatch` The minimatch object that the glob uses. -* `options` The options object passed in. -* `aborted` Boolean which is set to true when calling `abort()`. There - is no way at this time to continue a glob search after aborting, but - you can re-use the statCache to avoid having to duplicate syscalls. -* `statCache` Collection of all the stat results the glob search - performed. -* `cache` Convenience object. Each field has the following possible - values: - * `false` - Path does not exist - * `true` - Path exists - * `'DIR'` - Path exists, and is not a directory - * `'FILE'` - Path exists, and is a directory - * `[file, entries, ...]` - Path exists, is a directory, and the - array value is the results of `fs.readdir` -* `statCache` Cache of `fs.stat` results, to prevent statting the same - path multiple times. -* `symlinks` A record of which paths are symbolic links, which is - relevant in resolving `**` patterns. -* `realpathCache` An optional object which is passed to `fs.realpath` - to minimize unnecessary syscalls. It is stored on the instantiated - Glob object, and may be re-used. - -### Events - -* `end` When the matching is finished, this is emitted with all the - matches found. If the `nonull` option is set, and no match was found, - then the `matches` list contains the original pattern. The matches - are sorted, unless the `nosort` flag is set. -* `match` Every time a match is found, this is emitted with the matched. -* `error` Emitted when an unexpected error is encountered, or whenever - any fs error occurs if `options.strict` is set. -* `abort` When `abort()` is called, this event is raised. - -### Methods - -* `pause` Temporarily stop the search -* `resume` Resume the search -* `abort` Stop the search forever - -### Options - -All the options that can be passed to Minimatch can also be passed to -Glob to change pattern matching behavior. Also, some have been added, -or have glob-specific ramifications. - -All options are false by default, unless otherwise noted. - -All options are added to the Glob object, as well. - -If you are running many `glob` operations, you can pass a Glob object -as the `options` argument to a subsequent operation to shortcut some -`stat` and `readdir` calls. At the very least, you may pass in shared -`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that -parallel glob operations will be sped up by sharing information about -the filesystem. - -* `cwd` The current working directory in which to search. Defaults - to `process.cwd()`. -* `root` The place where patterns starting with `/` will be mounted - onto. Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix - systems, and `C:\` or some such on Windows.) -* `dot` Include `.dot` files in normal matches and `globstar` matches. - Note that an explicit dot in a portion of the pattern will always - match dot files. -* `nomount` By default, a pattern starting with a forward-slash will be - "mounted" onto the root setting, so that a valid filesystem path is - returned. Set this flag to disable that behavior. -* `mark` Add a `/` character to directory matches. Note that this - requires additional stat calls. -* `nosort` Don't sort the results. -* `stat` Set to true to stat *all* results. This reduces performance - somewhat, and is completely unnecessary, unless `readdir` is presumed - to be an untrustworthy indicator of file existence. -* `silent` When an unusual error is encountered when attempting to - read a directory, a warning will be printed to stderr. Set the - `silent` option to true to suppress these warnings. -* `strict` When an unusual error is encountered when attempting to - read a directory, the process will just continue on in search of - other matches. Set the `strict` option to raise an error in these - cases. -* `cache` See `cache` property above. Pass in a previously generated - cache object to save some fs calls. -* `statCache` A cache of results of filesystem information, to prevent - unnecessary stat calls. While it should not normally be necessary - to set this, you may pass the statCache from one glob() call to the - options object of another, if you know that the filesystem will not - change between calls. (See "Race Conditions" below.) -* `symlinks` A cache of known symbolic links. You may pass in a - previously generated `symlinks` object to save `lstat` calls when - resolving `**` matches. -* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead. -* `nounique` In some cases, brace-expanded patterns can result in the - same file showing up multiple times in the result set. By default, - this implementation prevents duplicates in the result set. Set this - flag to disable that behavior. -* `nonull` Set to never return an empty set, instead returning a set - containing the pattern itself. This is the default in glob(3). -* `debug` Set to enable debug logging in minimatch and glob. -* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets. -* `noglobstar` Do not match `**` against multiple filenames. (Ie, - treat it as a normal `*` instead.) -* `noext` Do not match `+(a|b)` "extglob" patterns. -* `nocase` Perform a case-insensitive match. Note: on - case-insensitive filesystems, non-magic patterns will match by - default, since `stat` and `readdir` will not raise errors. -* `matchBase` Perform a basename-only match if the pattern does not - contain any slash characters. That is, `*.js` would be treated as - equivalent to `**/*.js`, matching all js files in all directories. -* `nonegate` Suppress `negate` behavior. (See below.) -* `nocomment` Suppress `comment` behavior. (See below.) -* `nonull` Return the pattern when no matches are found. -* `nodir` Do not match directories, only files. (Note: to match - *only* directories, simply put a `/` at the end of the pattern.) -* `ignore` Add a pattern or an array of patterns to exclude matches. -* `follow` Follow symlinked directories when expanding `**` patterns. - Note that this can result in a lot of duplicate references in the - presence of cyclic links. -* `realpath` Set to true to call `fs.realpath` on all of the results. - In the case of a symlink that cannot be resolved, the full absolute - path to the matched entry is returned (though it will usually be a - broken symlink) - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between node-glob and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.3, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -Note that symlinked directories are not crawled as part of a `**`, -though their contents may match against subsequent portions of the -pattern. This prevents infinite loops and duplicates and the like. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then glob returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. - -## Windows - -**Please only use forward-slashes in glob expressions.** - -Though windows uses either `/` or `\` as its path separator, only `/` -characters are used by this glob implementation. You must use -forward-slashes **only** in glob expressions. Back-slashes will always -be interpreted as escape characters, not path separators. - -Results from absolute patterns such as `/foo/*` are mounted onto the -root setting using `path.join`. On windows, this will by default result -in `/foo/*` matching `C:\foo\bar.txt`. - -## Race Conditions - -Glob searching, by its very nature, is susceptible to race conditions, -since it relies on directory walking and such. - -As a result, it is possible that a file that exists when glob looks for -it may have been deleted or modified by the time it returns the result. - -As part of its internal implementation, this program caches all stat -and readdir calls that it makes, in order to cut down on system -overhead. However, this also makes it even more susceptible to races, -especially if the cache or statCache objects are reused between glob -calls. - -Users are thus advised not to use a glob result as a guarantee of -filesystem state in the face of rapid changes. For the vast majority -of operations, this is never a problem. - -## Contributing - -Any change to behavior (including bugfixes) must come with a test. - -Patches that fail tests or reduce performance will be rejected. - -``` -# to run tests -npm test - -# to re-generate test fixtures -npm run test-regen - -# to benchmark against bash/zsh -npm run bench - -# to profile javascript -npm run prof -``` diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/common.js b/deps/npm/node_modules/node-gyp/node_modules/glob/common.js deleted file mode 100644 index cd7c82448126f1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/common.js +++ /dev/null @@ -1,237 +0,0 @@ -exports.alphasort = alphasort -exports.alphasorti = alphasorti -exports.isAbsolute = process.platform === "win32" ? absWin : absUnix -exports.setopts = setopts -exports.ownProp = ownProp -exports.makeAbs = makeAbs -exports.finish = finish -exports.mark = mark -exports.isIgnored = isIgnored -exports.childrenIgnored = childrenIgnored - -function ownProp (obj, field) { - return Object.prototype.hasOwnProperty.call(obj, field) -} - -var path = require("path") -var minimatch = require("minimatch") -var Minimatch = minimatch.Minimatch - -function absWin (p) { - if (absUnix(p)) return true - // pull off the device/UNC bit from a windows path. - // from node's lib/path.js - var splitDeviceRe = - /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/ - var result = splitDeviceRe.exec(p) - var device = result[1] || '' - var isUnc = device && device.charAt(1) !== ':' - var isAbsolute = !!result[2] || isUnc // UNC paths are always absolute - - return isAbsolute -} - -function absUnix (p) { - return p.charAt(0) === "/" || p === "" -} - -function alphasorti (a, b) { - return a.toLowerCase().localeCompare(b.toLowerCase()) -} - -function alphasort (a, b) { - return a.localeCompare(b) -} - -function setupIgnores (self, options) { - self.ignore = options.ignore || [] - - if (!Array.isArray(self.ignore)) - self.ignore = [self.ignore] - - if (self.ignore.length) { - self.ignore = self.ignore.map(ignoreMap) - } -} - -function ignoreMap (pattern) { - var gmatcher = null - if (pattern.slice(-3) === '/**') { - var gpattern = pattern.replace(/(\/\*\*)+$/, '') - gmatcher = new Minimatch(gpattern, { nonegate: true }) - } - - return { - matcher: new Minimatch(pattern, { nonegate: true }), - gmatcher: gmatcher - } -} - -function setopts (self, pattern, options) { - if (!options) - options = {} - - // base-matching: just use globstar for that. - if (options.matchBase && -1 === pattern.indexOf("/")) { - if (options.noglobstar) { - throw new Error("base matching requires globstar") - } - pattern = "**/" + pattern - } - - self.pattern = pattern - self.strict = options.strict !== false - self.realpath = !!options.realpath - self.realpathCache = options.realpathCache || Object.create(null) - self.follow = !!options.follow - self.dot = !!options.dot - self.mark = !!options.mark - self.nodir = !!options.nodir - if (self.nodir) - self.mark = true - self.sync = !!options.sync - self.nounique = !!options.nounique - self.nonull = !!options.nonull - self.nosort = !!options.nosort - self.nocase = !!options.nocase - self.stat = !!options.stat - self.noprocess = !!options.noprocess - - self.maxLength = options.maxLength || Infinity - self.cache = options.cache || Object.create(null) - self.statCache = options.statCache || Object.create(null) - self.symlinks = options.symlinks || Object.create(null) - - setupIgnores(self, options) - - self.changedCwd = false - var cwd = process.cwd() - if (!ownProp(options, "cwd")) - self.cwd = cwd - else { - self.cwd = options.cwd - self.changedCwd = path.resolve(options.cwd) !== cwd - } - - self.root = options.root || path.resolve(self.cwd, "/") - self.root = path.resolve(self.root) - if (process.platform === "win32") - self.root = self.root.replace(/\\/g, "/") - - self.nomount = !!options.nomount - - self.minimatch = new Minimatch(pattern, options) - self.options = self.minimatch.options -} - -function finish (self) { - var nou = self.nounique - var all = nou ? [] : Object.create(null) - - for (var i = 0, l = self.matches.length; i < l; i ++) { - var matches = self.matches[i] - if (!matches || Object.keys(matches).length === 0) { - if (self.nonull) { - // do like the shell, and spit out the literal glob - var literal = self.minimatch.globSet[i] - if (nou) - all.push(literal) - else - all[literal] = true - } - } else { - // had matches - var m = Object.keys(matches) - if (nou) - all.push.apply(all, m) - else - m.forEach(function (m) { - all[m] = true - }) - } - } - - if (!nou) - all = Object.keys(all) - - if (!self.nosort) - all = all.sort(self.nocase ? alphasorti : alphasort) - - // at *some* point we statted all of these - if (self.mark) { - for (var i = 0; i < all.length; i++) { - all[i] = self._mark(all[i]) - } - if (self.nodir) { - all = all.filter(function (e) { - return !(/\/$/.test(e)) - }) - } - } - - if (self.ignore.length) - all = all.filter(function(m) { - return !isIgnored(self, m) - }) - - self.found = all -} - -function mark (self, p) { - var abs = makeAbs(self, p) - var c = self.cache[abs] - var m = p - if (c) { - var isDir = c === 'DIR' || Array.isArray(c) - var slash = p.slice(-1) === '/' - - if (isDir && !slash) - m += '/' - else if (!isDir && slash) - m = m.slice(0, -1) - - if (m !== p) { - var mabs = makeAbs(self, m) - self.statCache[mabs] = self.statCache[abs] - self.cache[mabs] = self.cache[abs] - } - } - - return m -} - -// lotta situps... -function makeAbs (self, f) { - var abs = f - if (f.charAt(0) === '/') { - abs = path.join(self.root, f) - } else if (exports.isAbsolute(f)) { - abs = f - } else if (self.changedCwd) { - abs = path.resolve(self.cwd, f) - } else if (self.realpath) { - abs = path.resolve(f) - } - return abs -} - - -// Return true, if pattern ends with globstar '**', for the accompanying parent directory. -// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents -function isIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path)) - }) -} - -function childrenIgnored (self, path) { - if (!self.ignore.length) - return false - - return self.ignore.some(function(item) { - return !!(item.gmatcher && item.gmatcher.match(path)) - }) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js b/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js deleted file mode 100644 index eac0693cc6cd33..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/glob.js +++ /dev/null @@ -1,740 +0,0 @@ -// Approach: -// -// 1. Get the minimatch set -// 2. For each pattern in the set, PROCESS(pattern, false) -// 3. Store matches per-set, then uniq them -// -// PROCESS(pattern, inGlobStar) -// Get the first [n] items from pattern that are all strings -// Join these together. This is PREFIX. -// If there is no more remaining, then stat(PREFIX) and -// add to matches if it succeeds. END. -// -// If inGlobStar and PREFIX is symlink and points to dir -// set ENTRIES = [] -// else readdir(PREFIX) as ENTRIES -// If fail, END -// -// with ENTRIES -// If pattern[n] is GLOBSTAR -// // handle the case where the globstar match is empty -// // by pruning it out, and testing the resulting pattern -// PROCESS(pattern[0..n] + pattern[n+1 .. $], false) -// // handle other cases. -// for ENTRY in ENTRIES (not dotfiles) -// // attach globstar + tail onto the entry -// // Mark that this entry is a globstar match -// PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true) -// -// else // not globstar -// for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot) -// Test ENTRY against pattern[n] -// If fails, continue -// If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $]) -// -// Caveat: -// Cache all stats and readdirs results to minimize syscall. Since all -// we ever care about is existence and directory-ness, we can just keep -// `true` for files, and [children,...] for directories, or `false` for -// things that don't exist. - -module.exports = glob - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var inherits = require('inherits') -var EE = require('events').EventEmitter -var path = require('path') -var assert = require('assert') -var globSync = require('./sync.js') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var inflight = require('inflight') -var util = require('util') -var childrenIgnored = common.childrenIgnored - -var once = require('once') - -function glob (pattern, options, cb) { - if (typeof options === 'function') cb = options, options = {} - if (!options) options = {} - - if (options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return globSync(pattern, options) - } - - return new Glob(pattern, options, cb) -} - -glob.sync = globSync -var GlobSync = glob.GlobSync = globSync.GlobSync - -// old api surface -glob.glob = glob - -glob.hasMagic = function (pattern, options_) { - var options = util._extend({}, options_) - options.noprocess = true - - var g = new Glob(pattern, options) - var set = g.minimatch.set - if (set.length > 1) - return true - - for (var j = 0; j < set[0].length; j++) { - if (typeof set[0][j] !== 'string') - return true - } - - return false -} - -glob.Glob = Glob -inherits(Glob, EE) -function Glob (pattern, options, cb) { - if (typeof options === 'function') { - cb = options - options = null - } - - if (options && options.sync) { - if (cb) - throw new TypeError('callback provided to sync glob') - return new GlobSync(pattern, options) - } - - if (!(this instanceof Glob)) - return new Glob(pattern, options, cb) - - setopts(this, pattern, options) - this._didRealPath = false - - // process each pattern in the minimatch set - var n = this.minimatch.set.length - - // The matches are stored as {: true,...} so that - // duplicates are automagically pruned. - // Later, we do an Object.keys() on these. - // Keep them as a list so we can fill in when nonull is set. - this.matches = new Array(n) - - if (typeof cb === 'function') { - cb = once(cb) - this.on('error', cb) - this.on('end', function (matches) { - cb(null, matches) - }) - } - - var self = this - var n = this.minimatch.set.length - this._processing = 0 - this.matches = new Array(n) - - this._emitQueue = [] - this._processQueue = [] - this.paused = false - - if (this.noprocess) - return this - - if (n === 0) - return done() - - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false, done) - } - - function done () { - --self._processing - if (self._processing <= 0) - self._finish() - } -} - -Glob.prototype._finish = function () { - assert(this instanceof Glob) - if (this.aborted) - return - - if (this.realpath && !this._didRealpath) - return this._realpath() - - common.finish(this) - this.emit('end', this.found) -} - -Glob.prototype._realpath = function () { - if (this._didRealpath) - return - - this._didRealpath = true - - var n = this.matches.length - if (n === 0) - return this._finish() - - var self = this - for (var i = 0; i < this.matches.length; i++) - this._realpathSet(i, next) - - function next () { - if (--n === 0) - self._finish() - } -} - -Glob.prototype._realpathSet = function (index, cb) { - var matchset = this.matches[index] - if (!matchset) - return cb() - - var found = Object.keys(matchset) - var self = this - var n = found.length - - if (n === 0) - return cb() - - var set = this.matches[index] = Object.create(null) - found.forEach(function (p, i) { - // If there's a problem with the stat, then it means that - // one or more of the links in the realpath couldn't be - // resolved. just return the abs value in that case. - p = self._makeAbs(p) - fs.realpath(p, self.realpathCache, function (er, real) { - if (!er) - set[real] = true - else if (er.syscall === 'stat') - set[p] = true - else - self.emit('error', er) // srsly wtf right here - - if (--n === 0) { - self.matches[index] = set - cb() - } - }) - }) -} - -Glob.prototype._mark = function (p) { - return common.mark(this, p) -} - -Glob.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} - -Glob.prototype.abort = function () { - this.aborted = true - this.emit('abort') -} - -Glob.prototype.pause = function () { - if (!this.paused) { - this.paused = true - this.emit('pause') - } -} - -Glob.prototype.resume = function () { - if (this.paused) { - this.emit('resume') - this.paused = false - if (this._emitQueue.length) { - var eq = this._emitQueue.slice(0) - this._emitQueue.length = 0 - for (var i = 0; i < eq.length; i ++) { - var e = eq[i] - this._emitMatch(e[0], e[1]) - } - } - if (this._processQueue.length) { - var pq = this._processQueue.slice(0) - this._processQueue.length = 0 - for (var i = 0; i < pq.length; i ++) { - var p = pq[i] - this._processing-- - this._process(p[0], p[1], p[2], p[3]) - } - } - } -} - -Glob.prototype._process = function (pattern, index, inGlobStar, cb) { - assert(this instanceof Glob) - assert(typeof cb === 'function') - - if (this.aborted) - return - - this._processing++ - if (this.paused) { - this._processQueue.push([pattern, index, inGlobStar, cb]) - return - } - - //console.error('PROCESS %d', this._processing, pattern) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // see if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index, cb) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip _processing - if (childrenIgnored(this, read)) - return cb() - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb) -} - -Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - -Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return cb() - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries) - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return cb() - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this._emitMatch(index, e) - } - // This was the last one, and no stats were needed - return cb() - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) { - if (prefix !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - this._process([e].concat(remain), index, inGlobStar, cb) - } - cb() -} - -Glob.prototype._emitMatch = function (index, e) { - if (this.aborted) - return - - if (this.matches[index][e]) - return - - if (this.paused) { - this._emitQueue.push([index, e]) - return - } - - var abs = this._makeAbs(e) - - if (this.nodir) { - var c = this.cache[abs] - if (c === 'DIR' || Array.isArray(c)) - return - } - - if (this.mark) - e = this._mark(e) - - this.matches[index][e] = true - - var st = this.statCache[abs] - if (st) - this.emit('stat', e, st) - - this.emit('match', e) -} - -Glob.prototype._readdirInGlobStar = function (abs, cb) { - if (this.aborted) - return - - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false, cb) - - var lstatkey = 'lstat\0' + abs - var self = this - var lstatcb = inflight(lstatkey, lstatcb_) - - if (lstatcb) - fs.lstat(abs, lstatcb) - - function lstatcb_ (er, lstat) { - if (er) - return cb() - - var isSym = lstat.isSymbolicLink() - self.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) { - self.cache[abs] = 'FILE' - cb() - } else - self._readdir(abs, false, cb) - } -} - -Glob.prototype._readdir = function (abs, inGlobStar, cb) { - if (this.aborted) - return - - cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb) - if (!cb) - return - - //console.error('RD %j %j', +inGlobStar, abs) - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs, cb) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return cb() - - if (Array.isArray(c)) - return cb(null, c) - } - - var self = this - fs.readdir(abs, readdirCb(this, abs, cb)) -} - -function readdirCb (self, abs, cb) { - return function (er, entries) { - if (er) - self._readdirError(abs, er, cb) - else - self._readdirEntries(abs, entries, cb) - } -} - -Glob.prototype._readdirEntries = function (abs, entries, cb) { - if (this.aborted) - return - - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - return cb(null, entries) -} - -Glob.prototype._readdirError = function (f, er, cb) { - if (this.aborted) - return - - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) return this.emit('error', er) - if (!this.silent) console.error('glob error', er) - break - } - return cb() -} - -Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) { - var self = this - this._readdir(abs, inGlobStar, function (er, entries) { - self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb) - }) -} - - -Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) { - //console.error('pgs2', prefix, remain[0], entries) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return cb() - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false, cb) - - var isSym = this.symlinks[abs] - var len = entries.length - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return cb() - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true, cb) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true, cb) - } - - cb() -} - -Glob.prototype._processSimple = function (prefix, index, cb) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var self = this - this._stat(prefix, function (er, exists) { - self._processSimple2(prefix, index, er, exists, cb) - }) -} -Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) { - - //console.error('ps2', prefix, exists) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return cb() - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this._emitMatch(index, prefix) - cb() -} - -// Returns either 'DIR', 'FILE', or false -Glob.prototype._stat = function (f, cb) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return cb() - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return cb(null, c) - - if (needDir && c === 'FILE') - return cb() - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (stat !== undefined) { - if (stat === false) - return cb(null, stat) - else { - var type = stat.isDirectory() ? 'DIR' : 'FILE' - if (needDir && type === 'FILE') - return cb() - else - return cb(null, type, stat) - } - } - - var self = this - var statcb = inflight('stat\0' + abs, lstatcb_) - if (statcb) - fs.lstat(abs, statcb) - - function lstatcb_ (er, lstat) { - if (lstat && lstat.isSymbolicLink()) { - // If it's a symlink, then treat it as the target, unless - // the target does not exist, then treat it as a file. - return fs.stat(abs, function (er, stat) { - if (er) - self._stat2(f, abs, null, lstat, cb) - else - self._stat2(f, abs, er, stat, cb) - }) - } else { - self._stat2(f, abs, er, lstat, cb) - } - } -} - -Glob.prototype._stat2 = function (f, abs, er, stat, cb) { - if (er) { - this.statCache[abs] = false - return cb() - } - - var needDir = f.slice(-1) === '/' - this.statCache[abs] = stat - - if (abs.slice(-1) === '/' && !stat.isDirectory()) - return cb(null, false, stat) - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return cb() - - return cb(null, c, stat) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md deleted file mode 100644 index d458bc2e0a6b03..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/README.md +++ /dev/null @@ -1,216 +0,0 @@ -# minimatch - -A minimal matching utility. - -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) - - -This is the matching library used internally by npm. - -It works by converting glob expressions into JavaScript `RegExp` -objects. - -## Usage - -```javascript -var minimatch = require("minimatch") - -minimatch("bar.foo", "*.foo") // true! -minimatch("bar.foo", "*.bar") // false! -minimatch("bar.foo", "*.+(bar|foo)", { debug: true }) // true, and noisy! -``` - -## Features - -Supports these glob features: - -* Brace Expansion -* Extended glob matching -* "Globstar" `**` matching - -See: - -* `man sh` -* `man bash` -* `man 3 fnmatch` -* `man 5 gitignore` - -## Minimatch Class - -Create a minimatch object by instanting the `minimatch.Minimatch` class. - -```javascript -var Minimatch = require("minimatch").Minimatch -var mm = new Minimatch(pattern, options) -``` - -### Properties - -* `pattern` The original pattern the minimatch object represents. -* `options` The options supplied to the constructor. -* `set` A 2-dimensional array of regexp or string expressions. - Each row in the - array corresponds to a brace-expanded pattern. Each item in the row - corresponds to a single path-part. For example, the pattern - `{a,b/c}/d` would expand to a set of patterns like: - - [ [ a, d ] - , [ b, c, d ] ] - - If a portion of the pattern doesn't have any "magic" in it - (that is, it's something like `"foo"` rather than `fo*o?`), then it - will be left as a string rather than converted to a regular - expression. - -* `regexp` Created by the `makeRe` method. A single regular expression - expressing the entire pattern. This is useful in cases where you wish - to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled. -* `negate` True if the pattern is negated. -* `comment` True if the pattern is a comment. -* `empty` True if the pattern is `""`. - -### Methods - -* `makeRe` Generate the `regexp` member if necessary, and return it. - Will return `false` if the pattern is invalid. -* `match(fname)` Return true if the filename matches the pattern, or - false otherwise. -* `matchOne(fileArray, patternArray, partial)` Take a `/`-split - filename, and match it against a single row in the `regExpSet`. This - method is mainly for internal use, but is exposed so that it can be - used by a glob-walker that needs to avoid excessive filesystem calls. - -All other methods are internal, and will be called as necessary. - -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - -### minimatch(path, pattern, options) - -Main export. Tests a path against the pattern using the options. - -```javascript -var isJS = minimatch(file, "*.js", { matchBase: true }) -``` - -### minimatch.filter(pattern, options) - -Returns a function that tests its -supplied argument, suitable for use with `Array.filter`. Example: - -```javascript -var javascripts = fileList.filter(minimatch.filter("*.js", {matchBase: true})) -``` - -### minimatch.match(list, pattern, options) - -Match against the list of -files, in the style of fnmatch or glob. If nothing is matched, and -options.nonull is set, then return a list containing the pattern itself. - -```javascript -var javascripts = minimatch.match(fileList, "*.js", {matchBase: true})) -``` - -### minimatch.makeRe(pattern, options) - -Make a regular expression object from the pattern. - -## Options - -All options are `false` by default. - -### debug - -Dump a ton of stuff to stderr. - -### nobrace - -Do not expand `{a,b}` and `{1..3}` brace sets. - -### noglobstar - -Disable `**` matching against multiple folder names. - -### dot - -Allow patterns to match filenames starting with a period, even if -the pattern does not explicitly have a period in that spot. - -Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot` -is set. - -### noext - -Disable "extglob" style patterns like `+(a|b)`. - -### nocase - -Perform a case-insensitive match. - -### nonull - -When a match is not found by `minimatch.match`, return a list containing -the pattern itself if this option is set. When not set, an empty list -is returned if there are no matches. - -### matchBase - -If set, then patterns without slashes will be matched -against the basename of the path if it contains slashes. For example, -`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`. - -### nocomment - -Suppress the behavior of treating `#` at the start of a pattern as a -comment. - -### nonegate - -Suppress the behavior of treating a leading `!` character as negation. - -### flipNegate - -Returns from negate expressions the same as if they were not negated. -(Ie, true on a hit, false on a miss.) - - -## Comparisons to other fnmatch/glob implementations - -While strict compliance with the existing standards is a worthwhile -goal, some discrepancies exist between minimatch and other -implementations, and are intentional. - -If the pattern starts with a `!` character, then it is negated. Set the -`nonegate` flag to suppress this behavior, and treat leading `!` -characters normally. This is perhaps relevant if you wish to start the -pattern with a negative extglob pattern like `!(a|B)`. Multiple `!` -characters at the start of a pattern will negate the pattern multiple -times. - -If a pattern starts with `#`, then it is treated as a comment, and -will not match anything. Use `\#` to match a literal `#` at the -start of a line, or set the `nocomment` flag to suppress this behavior. - -The double-star character `**` is supported by default, unless the -`noglobstar` flag is set. This is supported in the manner of bsdglob -and bash 4.1, where `**` only has special significance if it is the only -thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but -`a/**b` will not. - -If an escaped pattern has no matches, and the `nonull` flag is set, -then minimatch.match returns the pattern as-provided, rather than -interpreting the character escapes. For example, -`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than -`"*a?"`. This is akin to setting the `nullglob` option in bash, except -that it does not resolve escaped pattern characters. - -If brace expansion is not disabled, then it is performed before any -other interpretation of the glob pattern. Thus, a pattern like -`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded -**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are -checked for validity. Since those two are valid, matching proceeds. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js deleted file mode 100644 index 7d0515920e5cb3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/browser.js +++ /dev/null @@ -1,1159 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.minimatch = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"brace-expansion":2,"path":undefined}],2:[function(require,module,exports){ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - var expansions = expand(escapeBraces(str)); - return expansions.filter(identity).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0]).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - expansions.push([pre, N[j], post[k]].join('')) - } - } - - return expansions; -} - - -},{"balanced-match":3,"concat-map":4}],3:[function(require,module,exports){ -module.exports = balanced; -function balanced(a, b, str) { - var bal = 0; - var m = {}; - var ended = false; - - for (var i = 0; i < str.length; i++) { - if (a == str.substr(i, a.length)) { - if (!('start' in m)) m.start = i; - bal++; - } - else if (b == str.substr(i, b.length) && 'start' in m) { - ended = true; - bal--; - if (!bal) { - m.end = i; - m.pre = str.substr(0, m.start); - m.body = (m.end - m.start > 1) - ? str.substring(m.start + a.length, m.end) - : ''; - m.post = str.slice(m.end + b.length); - return m; - } - } - } - - // if we opened more than we closed, find the one we closed - if (bal && ended) { - var start = m.start + a.length; - m = balanced(a, b, str.substr(start)); - if (m) { - m.start += start; - m.end += start; - m.pre = str.slice(0, start) + m.pre; - } - return m; - } -} - -},{}],4:[function(require,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (Array.isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -},{}]},{},[1])(1) -}); \ No newline at end of file diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js deleted file mode 100644 index ec4c05c570c52e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/minimatch.js +++ /dev/null @@ -1,912 +0,0 @@ -module.exports = minimatch -minimatch.Minimatch = Minimatch - -var path = { sep: '/' } -try { - path = require('path') -} catch (er) {} - -var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} -var expand = require('brace-expansion') - -// any single thing other than / -// don't need to escape / when using new RegExp() -var qmark = '[^/]' - -// * => any number of characters -var star = qmark + '*?' - -// ** when dots are allowed. Anything goes, except .. and . -// not (^ or / followed by one or two dots followed by $ or /), -// followed by anything, any number of times. -var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - -// not a ^ or / followed by a dot, -// followed by anything, any number of times. -var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - -// characters that need to be escaped in RegExp. -var reSpecials = charSet('().*{}+?[]^$\\!') - -// "abc" -> { a:true, b:true, c:true } -function charSet (s) { - return s.split('').reduce(function (set, c) { - set[c] = true - return set - }, {}) -} - -// normalizes slashes. -var slashSplit = /\/+/ - -minimatch.filter = filter -function filter (pattern, options) { - options = options || {} - return function (p, i, list) { - return minimatch(p, pattern, options) - } -} - -function ext (a, b) { - a = a || {} - b = b || {} - var t = {} - Object.keys(b).forEach(function (k) { - t[k] = b[k] - }) - Object.keys(a).forEach(function (k) { - t[k] = a[k] - }) - return t -} - -minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return minimatch - - var orig = minimatch - - var m = function minimatch (p, pattern, options) { - return orig.minimatch(p, pattern, ext(def, options)) - } - - m.Minimatch = function Minimatch (pattern, options) { - return new orig.Minimatch(pattern, ext(def, options)) - } - - return m -} - -Minimatch.defaults = function (def) { - if (!def || !Object.keys(def).length) return Minimatch - return minimatch.defaults(def).Minimatch -} - -function minimatch (p, pattern, options) { - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - - // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - return false - } - - // "" only matches "" - if (pattern.trim() === '') return p === '' - - return new Minimatch(pattern, options).match(p) -} - -function Minimatch (pattern, options) { - if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options) - } - - if (typeof pattern !== 'string') { - throw new TypeError('glob pattern string required') - } - - if (!options) options = {} - pattern = pattern.trim() - - // windows support: need to use /, not \ - if (path.sep !== '/') { - pattern = pattern.split(path.sep).join('/') - } - - this.options = options - this.set = [] - this.pattern = pattern - this.regexp = null - this.negate = false - this.comment = false - this.empty = false - - // make the set of regexps etc. - this.make() -} - -Minimatch.prototype.debug = function () {} - -Minimatch.prototype.make = make -function make () { - // don't do it more than once. - if (this._made) return - - var pattern = this.pattern - var options = this.options - - // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === '#') { - this.comment = true - return - } - if (!pattern) { - this.empty = true - return - } - - // step 1: figure out negation, etc. - this.parseNegate() - - // step 2: expand braces - var set = this.globSet = this.braceExpand() - - if (options.debug) this.debug = console.error - - this.debug(this.pattern, set) - - // step 3: now we have a set, so turn each one into a series of path-portion - // matching patterns. - // These will be regexps, except in the case of "**", which is - // set to the GLOBSTAR object for globstar behavior, - // and will not contain any / characters - set = this.globParts = set.map(function (s) { - return s.split(slashSplit) - }) - - this.debug(this.pattern, set) - - // glob --> regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md deleted file mode 100644 index b0d793ed5d9016..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js deleted file mode 100644 index abe535df327354..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,190 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore deleted file mode 100644 index fd4f2b066b339e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -.DS_Store diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index dd2730cfde0cab..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md deleted file mode 100644 index 421f3aa5f951a2..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ /dev/null @@ -1,89 +0,0 @@ -# balanced-match - -Match balanced string pairs, like `{` and `}` or `` and ``. - -[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) -[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) - -[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) - -## Example - -Get the first matching pair of braces: - -```js -var balanced = require('balanced-match'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); -``` - -The matches are: - -```bash -$ node example.js -{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } -{ start: 3, - end: 9, - pre: 'pre', - body: 'first', - post: 'between{second}post' } -``` - -## API - -### var m = balanced(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -object with those keys: - -* **start** the index of the first match of `a` -* **end** the index of the matching `b` -* **pre** the preamble, `a` and `b` not included -* **body** the match, `a` and `b` not included -* **post** the postscript, `a` and `b` not included - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. - -### var r = balanced.range(a, b, str) - -For the first non-nested matching pair of `a` and `b` in `str`, return an -array with indexes: `[ , ]`. - -If there's no match, `undefined` will be returned. - -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install balanced-match -``` - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index 9ce76f480a4321..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,4 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js deleted file mode 100644 index 75f3d71cba90bc..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ /dev/null @@ -1,50 +0,0 @@ -module.exports = balanced; -function balanced(a, b, str) { - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i < str.length && i >= 0 && ! result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json deleted file mode 100644 index ac0c6aaca5848e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "_args": [ - [ - "balanced-match@^0.3.0", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "balanced-match@>=0.3.0 <0.4.0", - "_id": "balanced-match@0.3.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.2.1", - "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - "_npmVersion": "2.14.7", - "_phantomChildren": {}, - "_requested": { - "name": "balanced-match", - "raw": "balanced-match@^0.3.0", - "rawSpec": "^0.3.0", - "scope": null, - "spec": ">=0.3.0 <0.4.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/glob/minimatch/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz", - "_shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "_shrinkwrap": null, - "_spec": "balanced-match@^0.3.0", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "email": "mail@juliangruber.com", - "name": "Julian Gruber", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/balanced-match/issues" - }, - "dependencies": {}, - "description": "Match balanced character pairs, like \"{\" and \"}\"", - "devDependencies": { - "tape": "~4.2.2" - }, - "directories": {}, - "dist": { - "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" - }, - "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", - "homepage": "https://github.com/juliangruber/balanced-match", - "keywords": [ - "balanced", - "match", - "parse", - "regexp", - "test" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "juliangruber", - "email": "julian@juliangruber.com" - } - ], - "name": "balanced-match", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/balanced-match.git" - }, - "scripts": { - "test": "make test" - }, - "testling": { - "browsers": [ - "android-browser/4.2..latest", - "chrome/25..latest", - "chrome/canary", - "firefox/20..latest", - "firefox/nightly", - "ie/8..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "opera/12..latest", - "opera/next", - "safari/5.1..latest" - ], - "files": "test/*.js" - }, - "version": "0.3.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3f2a3240..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json deleted file mode 100644 index 15acbe5c07ae55..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +++ /dev/null @@ -1,109 +0,0 @@ -{ - "_args": [ - [ - "concat-map@0.0.1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ] - ], - "_from": "concat-map@0.0.1", - "_id": "concat-map@0.0.1", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion/concat-map", - "_npmUser": { - "email": "mail@substack.net", - "name": "substack" - }, - "_npmVersion": "1.3.21", - "_phantomChildren": {}, - "_requested": { - "name": "concat-map", - "raw": "concat-map@0.0.1", - "rawSpec": "0.0.1", - "scope": null, - "spec": "0.0.1", - "type": "version" - }, - "_requiredBy": [ - "/node-gyp/glob/minimatch/brace-expansion" - ], - "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "_shrinkwrap": null, - "_spec": "concat-map@0.0.1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", - "author": { - "email": "mail@substack.net", - "name": "James Halliday", - "url": "http://substack.net" - }, - "bugs": { - "url": "https://github.com/substack/node-concat-map/issues" - }, - "dependencies": {}, - "description": "concatenative mapdashery", - "devDependencies": { - "tape": "~2.4.0" - }, - "directories": { - "example": "example", - "test": "test" - }, - "dist": { - "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", - "tarball": "http://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" - }, - "homepage": "https://github.com/substack/node-concat-map", - "keywords": [ - "concat", - "concatMap", - "functional", - "higher-order", - "map" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "name": "substack", - "email": "mail@substack.net" - } - ], - "name": "concat-map", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/substack/node-concat-map.git" - }, - "scripts": { - "test": "tape test/*.js" - }, - "testling": { - "browsers": { - "chrome": [ - 10, - 22 - ], - "ff": [ - 10, - 15, - 3.5 - ], - "ie": [ - 6, - 7, - 8, - 9 - ], - "opera": [ - 12 - ], - "safari": [ - 5.1 - ] - }, - "files": "test/*.js" - }, - "version": "0.0.1" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json deleted file mode 100644 index fffa04e2966692..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - "brace-expansion@^1.0.0", - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch" - ] - ], - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/glob/minimatch/brace-expansion", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" - }, - "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "brace-expansion", - "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/glob/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", - "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "_shrinkwrap": null, - "_spec": "brace-expansion@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch", - "author": { - "email": "mail@juliangruber.com", - "name": "Julian Gruber", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "dependencies": { - "balanced-match": "^0.3.0", - "concat-map": "0.0.1" - }, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "tape": "4.4.0" - }, - "directories": {}, - "dist": { - "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" - }, - "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - { - "email": "isaacs@npmjs.com", - "name": "isaacs" - } - ], - "name": "brace-expansion", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ], - "files": "test/*.js" - }, - "version": "1.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json deleted file mode 100644 index 3dc6beb49f684a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/package.json +++ /dev/null @@ -1,63 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me" - }, - "name": "minimatch", - "description": "a glob matcher in javascript", - "version": "2.0.10", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/minimatch.git" - }, - "main": "minimatch.js", - "scripts": { - "posttest": "standard minimatch.js test/*.js", - "test": "tap test/*.js", - "prepublish": "browserify -o browser.js -e minimatch.js -s minimatch --bare" - }, - "engines": { - "node": "*" - }, - "dependencies": { - "brace-expansion": "^1.0.0" - }, - "devDependencies": { - "browserify": "^9.0.3", - "standard": "^3.7.2", - "tap": "^1.2.0" - }, - "license": "ISC", - "files": [ - "minimatch.js", - "browser.js" - ], - "gitHead": "6afb85f0c324b321f76a38df81891e562693e257", - "bugs": { - "url": "https://github.com/isaacs/minimatch/issues" - }, - "homepage": "https://github.com/isaacs/minimatch#readme", - "_id": "minimatch@2.0.10", - "_shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "_from": "minimatch@>=2.0.1 <3.0.0", - "_npmVersion": "3.1.0", - "_nodeVersion": "2.2.1", - "_npmUser": { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - "dist": { - "shasum": "8d087c39c6b38c001b97fca7ce6d0e1e80afbac7", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-2.0.10.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json b/deps/npm/node_modules/node-gyp/node_modules/glob/package.json deleted file mode 100644 index 434e4696f8fb15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/package.json +++ /dev/null @@ -1,72 +0,0 @@ -{ - "author": { - "name": "Isaac Z. Schlueter", - "email": "i@izs.me", - "url": "http://blog.izs.me/" - }, - "name": "glob", - "description": "a little globber", - "version": "4.5.3", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-glob.git" - }, - "main": "glob.js", - "files": [ - "glob.js", - "sync.js", - "common.js" - ], - "engines": { - "node": "*" - }, - "dependencies": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^2.0.1", - "once": "^1.3.0" - }, - "devDependencies": { - "mkdirp": "0", - "rimraf": "^2.2.8", - "tap": "^0.5.0", - "tick": "0.0.6" - }, - "scripts": { - "prepublish": "npm run benchclean", - "profclean": "rm -f v8.log profile.txt", - "test": "npm run profclean && tap test/*.js", - "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", - "bench": "bash benchmark.sh", - "prof": "bash prof.sh && cat profile.txt", - "benchclean": "bash benchclean.sh" - }, - "license": "ISC", - "gitHead": "a4e461ab59a837eee80a4d8dbdbf5ae1054a646f", - "bugs": { - "url": "https://github.com/isaacs/node-glob/issues" - }, - "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@4.5.3", - "_shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "_from": "glob@>=3.0.0 <4.0.0||>=4.0.0 <5.0.0", - "_npmVersion": "2.7.1", - "_nodeVersion": "1.4.2", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "c6cb73d3226c1efef04de3c56d012f03377ee15f", - "tarball": "http://registry.npmjs.org/glob/-/glob-4.5.3.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/glob/-/glob-4.5.3.tgz", - "readme": "ERROR: No README data found!" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js b/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js deleted file mode 100644 index f4f5e36d4beae3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/glob/sync.js +++ /dev/null @@ -1,457 +0,0 @@ -module.exports = globSync -globSync.GlobSync = GlobSync - -var fs = require('fs') -var minimatch = require('minimatch') -var Minimatch = minimatch.Minimatch -var Glob = require('./glob.js').Glob -var util = require('util') -var path = require('path') -var assert = require('assert') -var common = require('./common.js') -var alphasort = common.alphasort -var alphasorti = common.alphasorti -var isAbsolute = common.isAbsolute -var setopts = common.setopts -var ownProp = common.ownProp -var childrenIgnored = common.childrenIgnored - -function globSync (pattern, options) { - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - return new GlobSync(pattern, options).found -} - -function GlobSync (pattern, options) { - if (!pattern) - throw new Error('must provide pattern') - - if (typeof options === 'function' || arguments.length === 3) - throw new TypeError('callback provided to sync glob\n'+ - 'See: https://github.com/isaacs/node-glob/issues/167') - - if (!(this instanceof GlobSync)) - return new GlobSync(pattern, options) - - setopts(this, pattern, options) - - if (this.noprocess) - return this - - var n = this.minimatch.set.length - this.matches = new Array(n) - for (var i = 0; i < n; i ++) { - this._process(this.minimatch.set[i], i, false) - } - this._finish() -} - -GlobSync.prototype._finish = function () { - assert(this instanceof GlobSync) - if (this.realpath) { - var self = this - this.matches.forEach(function (matchset, index) { - var set = self.matches[index] = Object.create(null) - for (var p in matchset) { - try { - p = self._makeAbs(p) - var real = fs.realpathSync(p, this.realpathCache) - set[real] = true - } catch (er) { - if (er.syscall === 'stat') - set[self._makeAbs(p)] = true - else - throw er - } - } - }) - } - common.finish(this) -} - - -GlobSync.prototype._process = function (pattern, index, inGlobStar) { - assert(this instanceof GlobSync) - - // Get the first [n] parts of pattern that are all strings. - var n = 0 - while (typeof pattern[n] === 'string') { - n ++ - } - // now n is the index of the first one that is *not* a string. - - // See if there's anything else - var prefix - switch (n) { - // if not, then this is rather simple - case pattern.length: - this._processSimple(pattern.join('/'), index) - return - - case 0: - // pattern *starts* with some non-trivial item. - // going to readdir(cwd), but not include the prefix in matches. - prefix = null - break - - default: - // pattern has some string bits in the front. - // whatever it starts with, whether that's 'absolute' like /foo/bar, - // or 'relative' like '../baz' - prefix = pattern.slice(0, n).join('/') - break - } - - var remain = pattern.slice(n) - - // get the list of entries. - var read - if (prefix === null) - read = '.' - else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) { - if (!prefix || !isAbsolute(prefix)) - prefix = '/' + prefix - read = prefix - } else - read = prefix - - var abs = this._makeAbs(read) - - //if ignored, skip processing - if (childrenIgnored(this, read)) - return - - var isGlobStar = remain[0] === minimatch.GLOBSTAR - if (isGlobStar) - this._processGlobStar(prefix, read, abs, remain, index, inGlobStar) - else - this._processReaddir(prefix, read, abs, remain, index, inGlobStar) -} - - -GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) { - var entries = this._readdir(abs, inGlobStar) - - // if the abs isn't a dir, then nothing can match! - if (!entries) - return - - // It will only match dot entries if it starts with a dot, or if - // dot is set. Stuff like @(.foo|.bar) isn't allowed. - var pn = remain[0] - var negate = !!this.minimatch.negate - var rawGlob = pn._glob - var dotOk = this.dot || rawGlob.charAt(0) === '.' - - var matchedEntries = [] - for (var i = 0; i < entries.length; i++) { - var e = entries[i] - if (e.charAt(0) !== '.' || dotOk) { - var m - if (negate && !prefix) { - m = !e.match(pn) - } else { - m = e.match(pn) - } - if (m) - matchedEntries.push(e) - } - } - - var len = matchedEntries.length - // If there are no matched entries, then nothing matches. - if (len === 0) - return - - // if this is the last remaining pattern bit, then no need for - // an additional stat *unless* the user has specified mark or - // stat explicitly. We know they exist, since readdir returned - // them. - - if (remain.length === 1 && !this.mark && !this.stat) { - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - if (prefix) { - if (prefix.slice(-1) !== '/') - e = prefix + '/' + e - else - e = prefix + e - } - - if (e.charAt(0) === '/' && !this.nomount) { - e = path.join(this.root, e) - } - this.matches[index][e] = true - } - // This was the last one, and no stats were needed - return - } - - // now test all matched entries as stand-ins for that part - // of the pattern. - remain.shift() - for (var i = 0; i < len; i ++) { - var e = matchedEntries[i] - var newPattern - if (prefix) - newPattern = [prefix, e] - else - newPattern = [e] - this._process(newPattern.concat(remain), index, inGlobStar) - } -} - - -GlobSync.prototype._emitMatch = function (index, e) { - var abs = this._makeAbs(e) - if (this.mark) - e = this._mark(e) - - if (this.matches[index][e]) - return - - if (this.nodir) { - var c = this.cache[this._makeAbs(e)] - if (c === 'DIR' || Array.isArray(c)) - return - } - - this.matches[index][e] = true - if (this.stat) - this._stat(e) -} - - -GlobSync.prototype._readdirInGlobStar = function (abs) { - // follow all symlinked directories forever - // just proceed as if this is a non-globstar situation - if (this.follow) - return this._readdir(abs, false) - - var entries - var lstat - var stat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - // lstat failed, doesn't exist - return null - } - - var isSym = lstat.isSymbolicLink() - this.symlinks[abs] = isSym - - // If it's not a symlink or a dir, then it's definitely a regular file. - // don't bother doing a readdir in that case. - if (!isSym && !lstat.isDirectory()) - this.cache[abs] = 'FILE' - else - entries = this._readdir(abs, false) - - return entries -} - -GlobSync.prototype._readdir = function (abs, inGlobStar) { - var entries - - if (inGlobStar && !ownProp(this.symlinks, abs)) - return this._readdirInGlobStar(abs) - - if (ownProp(this.cache, abs)) { - var c = this.cache[abs] - if (!c || c === 'FILE') - return null - - if (Array.isArray(c)) - return c - } - - try { - return this._readdirEntries(abs, fs.readdirSync(abs)) - } catch (er) { - this._readdirError(abs, er) - return null - } -} - -GlobSync.prototype._readdirEntries = function (abs, entries) { - // if we haven't asked to stat everything, then just - // assume that everything in there exists, so we can avoid - // having to stat it a second time. - if (!this.mark && !this.stat) { - for (var i = 0; i < entries.length; i ++) { - var e = entries[i] - if (abs === '/') - e = abs + e - else - e = abs + '/' + e - this.cache[e] = true - } - } - - this.cache[abs] = entries - - // mark and cache dir-ness - return entries -} - -GlobSync.prototype._readdirError = function (f, er) { - // handle errors, and cache the information - switch (er.code) { - case 'ENOTDIR': // totally normal. means it *does* exist. - this.cache[this._makeAbs(f)] = 'FILE' - break - - case 'ENOENT': // not terribly unusual - case 'ELOOP': - case 'ENAMETOOLONG': - case 'UNKNOWN': - this.cache[this._makeAbs(f)] = false - break - - default: // some unusual error. Treat as failure. - this.cache[this._makeAbs(f)] = false - if (this.strict) throw er - if (!this.silent) console.error('glob error', er) - break - } -} - -GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) { - - var entries = this._readdir(abs, inGlobStar) - - // no entries means not a dir, so it can never have matches - // foo.txt/** doesn't match foo.txt - if (!entries) - return - - // test without the globstar, and with every child both below - // and replacing the globstar. - var remainWithoutGlobStar = remain.slice(1) - var gspref = prefix ? [ prefix ] : [] - var noGlobStar = gspref.concat(remainWithoutGlobStar) - - // the noGlobStar pattern exits the inGlobStar state - this._process(noGlobStar, index, false) - - var len = entries.length - var isSym = this.symlinks[abs] - - // If it's a symlink, and we're in a globstar, then stop - if (isSym && inGlobStar) - return - - for (var i = 0; i < len; i++) { - var e = entries[i] - if (e.charAt(0) === '.' && !this.dot) - continue - - // these two cases enter the inGlobStar state - var instead = gspref.concat(entries[i], remainWithoutGlobStar) - this._process(instead, index, true) - - var below = gspref.concat(entries[i], remain) - this._process(below, index, true) - } -} - -GlobSync.prototype._processSimple = function (prefix, index) { - // XXX review this. Shouldn't it be doing the mounting etc - // before doing stat? kinda weird? - var exists = this._stat(prefix) - - if (!this.matches[index]) - this.matches[index] = Object.create(null) - - // If it doesn't exist, then just mark the lack of results - if (!exists) - return - - if (prefix && isAbsolute(prefix) && !this.nomount) { - var trail = /[\/\\]$/.test(prefix) - if (prefix.charAt(0) === '/') { - prefix = path.join(this.root, prefix) - } else { - prefix = path.resolve(this.root, prefix) - if (trail) - prefix += '/' - } - } - - if (process.platform === 'win32') - prefix = prefix.replace(/\\/g, '/') - - // Mark this as a match - this.matches[index][prefix] = true -} - -// Returns either 'DIR', 'FILE', or false -GlobSync.prototype._stat = function (f) { - var abs = this._makeAbs(f) - var needDir = f.slice(-1) === '/' - - if (f.length > this.maxLength) - return false - - if (!this.stat && ownProp(this.cache, abs)) { - var c = this.cache[abs] - - if (Array.isArray(c)) - c = 'DIR' - - // It exists, but maybe not how we need it - if (!needDir || c === 'DIR') - return c - - if (needDir && c === 'FILE') - return false - - // otherwise we have to stat, because maybe c=true - // if we know it exists, but not what it is. - } - - var exists - var stat = this.statCache[abs] - if (!stat) { - var lstat - try { - lstat = fs.lstatSync(abs) - } catch (er) { - return false - } - - if (lstat.isSymbolicLink()) { - try { - stat = fs.statSync(abs) - } catch (er) { - stat = lstat - } - } else { - stat = lstat - } - } - - this.statCache[abs] = stat - - var c = stat.isDirectory() ? 'DIR' : 'FILE' - this.cache[abs] = this.cache[abs] || c - - if (needDir && c !== 'DIR') - return false - - return c -} - -GlobSync.prototype._mark = function (p) { - return common.mark(this, p) -} - -GlobSync.prototype._makeAbs = function (f) { - return common.makeAbs(this, f) -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml deleted file mode 100644 index fca8ef019405d5..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -node_js: - - 0.10 - - 0.11 diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE index 05a4010949cac3..19129e315fe593 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/LICENSE @@ -1,23 +1,15 @@ -Copyright 2009, 2010, 2011 Isaac Z. Schlueter. -All rights reserved. +The ISC License -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: +Copyright (c) Isaac Z. Schlueter and Contributors -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. -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. +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR +IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md index 5b3967ea998b01..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/README.md @@ -2,13 +2,11 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. -Eventually, it will replace the C binding in node-glob. - It works by converting glob expressions into JavaScript `RegExp` objects. @@ -39,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -84,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js index 47617868b99902..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/minimatch.js @@ -1,65 +1,44 @@ -;(function (require, exports, module, platform) { +module.exports = minimatch +minimatch.Minimatch = Minimatch -if (module) module.exports = minimatch -else exports.minimatch = minimatch +var path = { sep: '/' } +try { + path = require('path') +} catch (er) {} -if (!require) { - require = function (id) { - switch (id) { - case "sigmund": return function sigmund (obj) { - return JSON.stringify(obj) - } - case "path": return { basename: function (f) { - f = f.split(/[\/\\]/) - var e = f.pop() - if (!e) e = f.pop() - return e - }} - case "lru-cache": return function LRUCache () { - // not quite an LRU, but still space-limited. - var cache = {} - var cnt = 0 - this.set = function (k, v) { - cnt ++ - if (cnt >= 100) cache = {} - cache[k] = v - } - this.get = function (k) { return cache[k] } - } - } - } -} +var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} +var expand = require('brace-expansion') -minimatch.Minimatch = Minimatch - -var LRU = require("lru-cache") - , cache = minimatch.cache = new LRU({max: 100}) - , GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} - , sigmund = require("sigmund") +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} -var path = require("path") - // any single thing other than / - // don't need to escape / when using new RegExp() - , qmark = "[^/]" +// any single thing other than / +// don't need to escape / when using new RegExp() +var qmark = '[^/]' - // * => any number of characters - , star = qmark + "*?" +// * => any number of characters +var star = qmark + '*?' - // ** when dots are allowed. Anything goes, except .. and . - // not (^ or / followed by one or two dots followed by $ or /), - // followed by anything, any number of times. - , twoStarDot = "(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?" +// ** when dots are allowed. Anything goes, except .. and . +// not (^ or / followed by one or two dots followed by $ or /), +// followed by anything, any number of times. +var twoStarDot = '(?:(?!(?:\\\/|^)(?:\\.{1,2})($|\\\/)).)*?' - // not a ^ or / followed by a dot, - // followed by anything, any number of times. - , twoStarNoDot = "(?:(?!(?:\\\/|^)\\.).)*?" +// not a ^ or / followed by a dot, +// followed by anything, any number of times. +var twoStarNoDot = '(?:(?!(?:\\\/|^)\\.).)*?' - // characters that need to be escaped in RegExp. - , reSpecials = charSet("().*{}+?[]^$\\!") +// characters that need to be escaped in RegExp. +var reSpecials = charSet('().*{}+?[]^$\\!') // "abc" -> { a:true, b:true, c:true } function charSet (s) { - return s.split("").reduce(function (set, c) { + return s.split('').reduce(function (set, c) { set[c] = true return set }, {}) @@ -110,51 +89,41 @@ Minimatch.defaults = function (def) { return minimatch.defaults(def).Minimatch } - function minimatch (p, pattern, options) { - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } if (!options) options = {} // shortcut: comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { + if (!options.nocomment && pattern.charAt(0) === '#') { return false } // "" only matches "" - if (pattern.trim() === "") return p === "" + if (pattern.trim() === '') return p === '' return new Minimatch(pattern, options).match(p) } function Minimatch (pattern, options) { if (!(this instanceof Minimatch)) { - return new Minimatch(pattern, options, cache) + return new Minimatch(pattern, options) } - if (typeof pattern !== "string") { - throw new TypeError("glob pattern string required") + if (typeof pattern !== 'string') { + throw new TypeError('glob pattern string required') } if (!options) options = {} pattern = pattern.trim() - // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - pattern = pattern.split("\\").join("/") + // windows support: need to use /, not \ + if (path.sep !== '/') { + pattern = pattern.split(path.sep).join('/') } - // lru storage. - // these things aren't particularly big, but walking down the string - // and turning it into a regexp can get pretty costly. - var cacheKey = pattern + "\n" + sigmund(options) - var cached = minimatch.cache.get(cacheKey) - if (cached) return cached - minimatch.cache.set(cacheKey, this) - this.options = options this.set = [] this.pattern = pattern @@ -167,7 +136,7 @@ function Minimatch (pattern, options) { this.make() } -Minimatch.prototype.debug = function() {} +Minimatch.prototype.debug = function () {} Minimatch.prototype.make = make function make () { @@ -178,7 +147,7 @@ function make () { var options = this.options // empty patterns and comments match nothing. - if (!options.nocomment && pattern.charAt(0) === "#") { + if (!options.nocomment && pattern.charAt(0) === '#') { this.comment = true return } @@ -217,7 +186,7 @@ function make () { // filter out everything that didn't compile properly. set = set.filter(function (s) { - return -1 === s.indexOf(false) + return s.indexOf(false) === -1 }) this.debug(this.pattern, set) @@ -228,17 +197,17 @@ function make () { Minimatch.prototype.parseNegate = parseNegate function parseNegate () { var pattern = this.pattern - , negate = false - , options = this.options - , negateOffset = 0 + var negate = false + var options = this.options + var negateOffset = 0 if (options.nonegate) return - for ( var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === "!" - ; i ++) { + for (var i = 0, l = pattern.length + ; i < l && pattern.charAt(i) === '!' + ; i++) { negate = !negate - negateOffset ++ + negateOffset++ } if (negateOffset) this.pattern = pattern.substr(negateOffset) @@ -256,213 +225,34 @@ function parseNegate () { // a{2..}b -> a{2..}b // a{b}c -> a{b}c minimatch.braceExpand = function (pattern, options) { - return new Minimatch(pattern, options).braceExpand() + return braceExpand(pattern, options) } Minimatch.prototype.braceExpand = braceExpand -function pad(n, width, z) { - z = z || '0'; - n = n + ''; - return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n; -} - function braceExpand (pattern, options) { - options = options || this.options - pattern = typeof pattern === "undefined" + if (!options) { + if (this instanceof Minimatch) { + options = this.options + } else { + options = {} + } + } + + pattern = typeof pattern === 'undefined' ? this.pattern : pattern - if (typeof pattern === "undefined") { - throw new Error("undefined pattern") + if (typeof pattern === 'undefined') { + throw new TypeError('undefined pattern') } if (options.nobrace || - !pattern.match(/\{.*\}/)) { + !pattern.match(/\{.*\}/)) { // shortcut. no need to expand. return [pattern] } - var escaping = false - - // examples and comments refer to this crazy pattern: - // a{b,c{d,e},{f,g}h}x{y,z} - // expected: - // abxy - // abxz - // acdxy - // acdxz - // acexy - // acexz - // afhxy - // afhxz - // aghxy - // aghxz - - // everything before the first \{ is just a prefix. - // So, we pluck that off, and work with the rest, - // and then prepend it to everything we find. - if (pattern.charAt(0) !== "{") { - this.debug(pattern) - var prefix = null - for (var i = 0, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug(i, c) - if (c === "\\") { - escaping = !escaping - } else if (c === "{" && !escaping) { - prefix = pattern.substr(0, i) - break - } - } - - // actually no sets, all { were escaped. - if (prefix === null) { - this.debug("no sets") - return [pattern] - } - - var tail = braceExpand.call(this, pattern.substr(i), options) - return tail.map(function (t) { - return prefix + t - }) - } - - // now we have something like: - // {b,c{d,e},{f,g}h}x{y,z} - // walk through the set, expanding each part, until - // the set ends. then, we'll expand the suffix. - // If the set only has a single member, then'll put the {} back - - // first, handle numeric sets, since they're easier - var numset = pattern.match(/^\{(-?[0-9]+)\.\.(-?[0-9]+)\}/) - if (numset) { - this.debug("numset", numset[1], numset[2]) - var suf = braceExpand.call(this, pattern.substr(numset[0].length), options) - , start = +numset[1] - , needPadding = numset[1][0] === '0' - , startWidth = numset[1].length - , padded - , end = +numset[2] - , inc = start > end ? -1 : 1 - , set = [] - - for (var i = start; i != (end + inc); i += inc) { - padded = needPadding ? pad(i, startWidth) : i + '' - // append all the suffixes - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - set.push(padded + suf[ii]) - } - } - return set - } - - // ok, walk through the set - // We hope, somewhat optimistically, that there - // will be a } at the end. - // If the closing brace isn't found, then the pattern is - // interpreted as braceExpand("\\" + pattern) so that - // the leading \{ will be interpreted literally. - var i = 1 // skip the \{ - , depth = 1 - , set = [] - , member = "" - , sawEnd = false - , escaping = false - - function addMember () { - set.push(member) - member = "" - } - - this.debug("Entering for") - FOR: for (i = 1, l = pattern.length; i < l; i ++) { - var c = pattern.charAt(i) - this.debug("", i, c) - - if (escaping) { - escaping = false - member += "\\" + c - } else { - switch (c) { - case "\\": - escaping = true - continue - - case "{": - depth ++ - member += "{" - continue - - case "}": - depth -- - // if this closes the actual set, then we're done - if (depth === 0) { - addMember() - // pluck off the close-brace - i ++ - break FOR - } else { - member += c - continue - } - - case ",": - if (depth === 1) { - addMember() - } else { - member += c - } - continue - - default: - member += c - continue - } // switch - } // else - } // for - - // now we've either finished the set, and the suffix is - // pattern.substr(i), or we have *not* closed the set, - // and need to escape the leading brace - if (depth !== 0) { - this.debug("didn't close", pattern) - return braceExpand.call(this, "\\" + pattern, options) - } - - // x{y,z} -> ["xy", "xz"] - this.debug("set", set) - this.debug("suffix", pattern.substr(i)) - var suf = braceExpand.call(this, pattern.substr(i), options) - // ["b", "c{d,e}","{f,g}h"] -> - // [["b"], ["cd", "ce"], ["fh", "gh"]] - var addBraces = set.length === 1 - this.debug("set pre-expanded", set) - set = set.map(function (p) { - return braceExpand.call(this, p, options) - }, this) - this.debug("set expanded", set) - - - // [["b"], ["cd", "ce"], ["fh", "gh"]] -> - // ["b", "cd", "ce", "fh", "gh"] - set = set.reduce(function (l, r) { - return l.concat(r) - }) - - if (addBraces) { - set = set.map(function (s) { - return "{" + s + "}" - }) - } - - // now attach the suffixes. - var ret = [] - for (var i = 0, l = set.length; i < l; i ++) { - for (var ii = 0, ll = suf.length; ii < ll; ii ++) { - ret.push(set[i] + suf[ii]) - } - } - return ret + return expand(pattern) } // parse a component of the expanded set. @@ -479,90 +269,93 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts - if (!options.noglobstar && pattern === "**") return GLOBSTAR - if (pattern === "") return "" - - var re = "" - , hasMagic = !!options.nocase - , escaping = false - // ? => one single character - , patternListStack = [] - , plType - , stateChar - , inClass = false - , reClassStart = -1 - , classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - , patternStart = pattern.charAt(0) === "." ? "" // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? "(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))" - : "(?!\\.)" - , self = this + if (!options.noglobstar && pattern === '**') return GLOBSTAR + if (pattern === '') return '' + + var re = '' + var hasMagic = !!options.nocase + var escaping = false + // ? => one single character + var patternListStack = [] + var negativeLists = [] + var stateChar + var inClass = false + var reClassStart = -1 + var classStart = -1 + // . and .. never match anything that doesn't start with ., + // even when options.dot is set. + var patternStart = pattern.charAt(0) === '.' ? '' // anything + // not (start or / followed by . or .. followed by / or end) + : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' + : '(?!\\.)' + var self = this function clearStateChar () { if (stateChar) { // we had some state-tracking character // that wasn't consumed by this pass. switch (stateChar) { - case "*": + case '*': re += star hasMagic = true - break - case "?": + break + case '?': re += qmark hasMagic = true - break + break default: - re += "\\"+stateChar - break + re += '\\' + stateChar + break } self.debug('clearStateChar %j %j', stateChar, re) stateChar = false } } - for ( var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i ++ ) { - - this.debug("%s\t%s %s %j", pattern, i, re, c) + for (var i = 0, len = pattern.length, c + ; (i < len) && (c = pattern.charAt(i)) + ; i++) { + this.debug('%s\t%s %s %j', pattern, i, re, c) // skip over any that are escaped. if (escaping && reSpecials[c]) { - re += "\\" + c + re += '\\' + c escaping = false continue } - SWITCH: switch (c) { - case "/": + switch (c) { + case '/': // completely not allowed, even escaped. // Should already be path-split by now. return false - case "\\": + case '\\': clearStateChar() escaping = true - continue + continue // the various stateChar values // for the "extglob" stuff. - case "?": - case "*": - case "+": - case "@": - case "!": - this.debug("%s\t%s %s %j <-- stateChar", pattern, i, re, c) + case '?': + case '*': + case '+': + case '@': + case '!': + this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) // all of those are literals inside a class, except that // the glob [!a] means [^a] in regexp if (inClass) { this.debug(' in class') - if (c === "!" && i === classStart + 1) c = "^" + if (c === '!' && i === classStart + 1) c = '^' re += c continue } @@ -577,70 +370,68 @@ function parse (pattern, isSub) { // just clear the statechar *now*, rather than even diving into // the patternList stuff. if (options.noext) clearStateChar() - continue + continue - case "(": + case '(': if (inClass) { - re += "(" + re += '(' continue } if (!stateChar) { - re += "\\(" + re += '\\(' continue } - plType = stateChar - patternListStack.push({ type: plType - , start: i - 1 - , reStart: re.length }) + patternListStack.push({ + type: stateChar, + start: i - 1, + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close + }) // negation is (?:(?!js)[^/]*) - re += stateChar === "!" ? "(?:(?!" : "(?:" + re += stateChar === '!' ? '(?:(?!(?:' : '(?:' this.debug('plType %j %j', stateChar, re) stateChar = false - continue + continue - case ")": + case ')': if (inClass || !patternListStack.length) { - re += "\\)" + re += '\\)' continue } clearStateChar() hasMagic = true - re += ")" - plType = patternListStack.pop().type + var pl = patternListStack.pop() // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case "!": - re += "[^/]*?)" - break - case "?": - case "+": - case "*": re += plType - case "@": break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } - continue + pl.reEnd = re.length + continue - case "|": + case '|': if (inClass || !patternListStack.length || escaping) { - re += "\\|" + re += '\\|' escaping = false continue } clearStateChar() - re += "|" - continue + re += '|' + continue // these are mostly the same in regexp and glob - case "[": + case '[': // swallow any state-tracking char before the [ clearStateChar() if (inClass) { - re += "\\" + c + re += '\\' + c continue } @@ -648,24 +439,47 @@ function parse (pattern, isSub) { classStart = i reClassStart = re.length re += c - continue + continue - case "]": + case ']': // a right bracket shall lose its special // meaning and represent itself in // a bracket expression if it occurs // first in the list. -- POSIX.2 2.8.3.2 if (i === classStart + 1 || !inClass) { - re += "\\" + c + re += '\\' + c escaping = false continue } + // handle the case where we left a class open. + // "[z-a]" is valid, equivalent to "\[z-a\]" + if (inClass) { + // split where the last [ was, make sure we don't have + // an invalid re. if so, re-walk the contents of the + // would-be class to re-translate any characters that + // were passed through as-is + // TODO: It would probably be faster to determine this + // without a try/catch and a new RegExp, but it's tricky + // to do safely. For now, this is safe and works. + var cs = pattern.substring(classStart + 1, i) + try { + RegExp('[' + cs + ']') + } catch (er) { + // not a valid class! + var sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' + hasMagic = hasMagic || sp[1] + inClass = false + continue + } + } + // finish up the class. hasMagic = true inClass = false re += c - continue + continue default: // swallow any state char that wasn't consumed @@ -675,8 +489,8 @@ function parse (pattern, isSub) { // no need escaping = false } else if (reSpecials[c] - && !(c === "^" && inClass)) { - re += "\\" + && !(c === '^' && inClass)) { + re += '\\' } re += c @@ -684,7 +498,6 @@ function parse (pattern, isSub) { } // switch } // for - // handle the case where we left a class open. // "[abc" is valid, equivalent to "\[abc" if (inClass) { @@ -692,9 +505,9 @@ function parse (pattern, isSub) { // this is a huge pita. We now have to re-walk // the contents of the would-be class to re-translate // any characters that were passed through as-is - var cs = pattern.substr(classStart + 1) - , sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + "\\[" + sp[0] + cs = pattern.substr(classStart + 1) + sp = this.parse(cs, SUBPARSE) + re = re.substr(0, reClassStart) + '\\[' + sp[0] hasMagic = hasMagic || sp[1] } @@ -704,14 +517,14 @@ function parse (pattern, isSub) { // and escape any | chars that were passed through as-is for the regexp. // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. - var pl - while (pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. - $2 = "\\" + $2 = '\\' } // need to escape all those slashes *again*, without escaping the @@ -720,46 +533,81 @@ function parse (pattern, isSub) { // it exactly after itself. That's why this trick works. // // I am sorry that you have to see this. - return $1 + $1 + $2 + "|" + return $1 + $1 + $2 + '|' }) - this.debug("tail=%j\n %s", tail, tail) - var t = pl.type === "*" ? star - : pl.type === "?" ? qmark - : "\\" + pl.type + this.debug('tail=%j\n %s', tail, tail, pl, re) + var t = pl.type === '*' ? star + : pl.type === '?' ? qmark + : '\\' + pl.type hasMagic = true - re = re.slice(0, pl.reStart) - + t + "\\(" - + tail + re = re.slice(0, pl.reStart) + t + '\\(' + tail } // handle trailing things that only matter at the very end. clearStateChar() if (escaping) { // trailing \\ - re += "\\\\" + re += '\\\\' } // only need to apply the nodot start if the re starts with // something that could conceivably capture a dot var addPatternStart = false switch (re.charAt(0)) { - case ".": - case "[": - case "(": addPatternStart = true + case '.': + case '[': + case '(': addPatternStart = true + } + + // Hack to work around lack of negative lookbehind in JS + // A pattern like: *.!(x).!(y|z) needs to ensure that a name + // like 'a.xyz.yz' doesn't match. So, the first negative + // lookahead, has to look ALL the way ahead, to the end of + // the pattern. + for (var n = negativeLists.length - 1; n > -1; n--) { + var nl = negativeLists[n] + + var nlBefore = re.slice(0, nl.reStart) + var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) + var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + var nlAfter = re.slice(nl.reEnd) + + nlLast += nlAfter + + // Handle nested stuff like *(*.js|!(*.json)), where open parens + // mean that we should *not* include the ) in the bit that is considered + // "after" the negated section. + var openParensBefore = nlBefore.split('(').length - 1 + var cleanAfter = nlAfter + for (i = 0; i < openParensBefore; i++) { + cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') + } + nlAfter = cleanAfter + + var dollar = '' + if (nlAfter === '' && isSub !== SUBPARSE) { + dollar = '$' + } + var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast + re = newRe } // if the re is not "" at this point, then we need to make sure // it doesn't match against an empty path part. // Otherwise a/* will match a/, which it should not. - if (re !== "" && hasMagic) re = "(?=.)" + re + if (re !== '' && hasMagic) { + re = '(?=.)' + re + } - if (addPatternStart) re = patternStart + re + if (addPatternStart) { + re = patternStart + re + } // parsing just a piece of a larger pattern. if (isSub === SUBPARSE) { - return [ re, hasMagic ] + return [re, hasMagic] } // skip the regexp for non-magical patterns @@ -769,8 +617,16 @@ function parse (pattern, isSub) { return globUnescape(pattern) } - var flags = options.nocase ? "i" : "" - , regExp = new RegExp("^" + re + "$", flags) + var flags = options.nocase ? 'i' : '' + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re @@ -794,34 +650,38 @@ function makeRe () { // when you just want to work with a regex. var set = this.set - if (!set.length) return this.regexp = false + if (!set.length) { + this.regexp = false + return this.regexp + } var options = this.options var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - , flags = options.nocase ? "i" : "" + : options.dot ? twoStarDot + : twoStarNoDot + var flags = options.nocase ? 'i' : '' var re = set.map(function (pattern) { return pattern.map(function (p) { return (p === GLOBSTAR) ? twoStar - : (typeof p === "string") ? regExpEscape(p) - : p._src - }).join("\\\/") - }).join("|") + : (typeof p === 'string') ? regExpEscape(p) + : p._src + }).join('\\\/') + }).join('|') // must match entire pattern // ending in a * or ** will make it less strict. - re = "^(?:" + re + ")$" + re = '^(?:' + re + ')$' // can match anything, as long as it's not this. - if (this.negate) re = "^(?!" + re + ").*$" + if (this.negate) re = '^(?!' + re + ').*$' try { - return this.regexp = new RegExp(re, flags) + this.regexp = new RegExp(re, flags) } catch (ex) { - return this.regexp = false + this.regexp = false } + return this.regexp } minimatch.match = function (list, pattern, options) { @@ -838,25 +698,24 @@ minimatch.match = function (list, pattern, options) { Minimatch.prototype.match = match function match (f, partial) { - this.debug("match", f, this.pattern) + this.debug('match', f, this.pattern) // short-circuit in the case of busted things. // comments, etc. if (this.comment) return false - if (this.empty) return f === "" + if (this.empty) return f === '' - if (f === "/" && partial) return true + if (f === '/' && partial) return true var options = this.options // windows: need to use /, not \ - // On other platforms, \ is a valid (albeit bad) filename char. - if (platform === "win32") { - f = f.split("\\").join("/") + if (path.sep !== '/') { + f = f.split(path.sep).join('/') } // treat the test path as a set of pathparts. f = f.split(slashSplit) - this.debug(this.pattern, "split", f) + this.debug(this.pattern, 'split', f) // just ONE of the pattern sets in this.set needs to match // in order for it to be valid. If negating, then just one @@ -864,17 +723,19 @@ function match (f, partial) { // Either way, return on the first hit. var set = this.set - this.debug(this.pattern, "set", set) + this.debug(this.pattern, 'set', set) // Find the basename of the path by looking for the last non-empty segment - var filename; - for (var i = f.length - 1; i >= 0; i--) { + var filename + var i + for (i = f.length - 1; i >= 0; i--) { filename = f[i] if (filename) break } - for (var i = 0, l = set.length; i < l; i ++) { - var pattern = set[i], file = f + for (i = 0; i < set.length; i++) { + var pattern = set[i] + var file = f if (options.matchBase && pattern.length === 1) { file = [filename] } @@ -899,23 +760,20 @@ function match (f, partial) { Minimatch.prototype.matchOne = function (file, pattern, partial) { var options = this.options - this.debug("matchOne", - { "this": this - , file: file - , pattern: pattern }) + this.debug('matchOne', + { 'this': this, file: file, pattern: pattern }) - this.debug("matchOne", file.length, pattern.length) + this.debug('matchOne', file.length, pattern.length) - for ( var fi = 0 - , pi = 0 - , fl = file.length - , pl = pattern.length + for (var fi = 0, + pi = 0, + fl = file.length, + pl = pattern.length ; (fi < fl) && (pi < pl) - ; fi ++, pi ++ ) { - - this.debug("matchOne loop") + ; fi++, pi++) { + this.debug('matchOne loop') var p = pattern[pi] - , f = file[fi] + var f = file[fi] this.debug(pattern, p, f) @@ -949,7 +807,7 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // - matchOne(z/c, c) -> no // - matchOne(c, c) yes, hit var fr = fi - , pr = pi + 1 + var pr = pi + 1 if (pr === pl) { this.debug('** at the end') // a ** at the end will just swallow the rest. @@ -958,19 +816,18 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // options.dot is set. // . and .. are *never* matched by **, for explosively // exponential reasons. - for ( ; fi < fl; fi ++) { - if (file[fi] === "." || file[fi] === ".." || - (!options.dot && file[fi].charAt(0) === ".")) return false + for (; fi < fl; fi++) { + if (file[fi] === '.' || file[fi] === '..' || + (!options.dot && file[fi].charAt(0) === '.')) return false } return true } // ok, let's see if we can swallow whatever we can. - WHILE: while (fr < fl) { + while (fr < fl) { var swallowee = file[fr] - this.debug('\nglobstar while', - file, fr, pattern, pr, swallowee) + this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) // XXX remove this slice. Just pass the start index. if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { @@ -980,23 +837,24 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { } else { // can't swallow "." or ".." ever. // can only swallow ".foo" when explicitly asked. - if (swallowee === "." || swallowee === ".." || - (!options.dot && swallowee.charAt(0) === ".")) { - this.debug("dot detected!", file, fr, pattern, pr) - break WHILE + if (swallowee === '.' || swallowee === '..' || + (!options.dot && swallowee.charAt(0) === '.')) { + this.debug('dot detected!', file, fr, pattern, pr) + break } // ** swallows a segment, and continue. this.debug('globstar swallow a segment, and continue') - fr ++ + fr++ } } + // no match was found. // However, in partial mode, we can't say this is necessarily over. // If there's more *pattern* left, then if (partial) { // ran out of file - this.debug("\n>>> no match, partial?", file, fr, pattern, pr) + this.debug('\n>>> no match, partial?', file, fr, pattern, pr) if (fr === fl) return true } return false @@ -1006,16 +864,16 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // non-magic patterns just have to match exactly // patterns with magic have been turned into regexps. var hit - if (typeof p === "string") { + if (typeof p === 'string') { if (options.nocase) { hit = f.toLowerCase() === p.toLowerCase() } else { hit = f === p } - this.debug("string match", p, f, hit) + this.debug('string match', p, f, hit) } else { hit = f.match(p) - this.debug("pattern match", p, f, hit) + this.debug('pattern match', p, f, hit) } if (!hit) return false @@ -1047,27 +905,19 @@ Minimatch.prototype.matchOne = function (file, pattern, partial) { // this is only acceptable if we're on the very last // empty segment of a file with a trailing slash. // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === "") + var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') return emptyFileEnd } // should be unreachable. - throw new Error("wtf?") + throw new Error('wtf?') } - // replace stuff like \* with * function globUnescape (s) { - return s.replace(/\\(.)/g, "$1") + return s.replace(/\\(.)/g, '$1') } - function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&") + return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') } - -})( typeof require === "function" ? require : null, - this, - typeof module === "object" ? module : null, - typeof process === "object" ? process.platform : "win32" - ) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md new file mode 100644 index 00000000000000..179392978d30fe --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -0,0 +1,122 @@ +# brace-expansion + +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +as known from sh/bash, in JavaScript. + +[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) +[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) + +[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) + +## Example + +```js +var expand = require('brace-expansion'); + +expand('file-{a,b,c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('-v{,,}') +// => ['-v', '-v', '-v'] + +expand('file{0..2}.jpg') +// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] + +expand('file-{a..c}.jpg') +// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] + +expand('file{2..0}.jpg') +// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] + +expand('file{0..4..2}.jpg') +// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] + +expand('file-{a..e..2}.jpg') +// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] + +expand('file{00..10..5}.jpg') +// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] + +expand('{{A..C},{a..c}}') +// => ['A', 'B', 'C', 'a', 'b', 'c'] + +expand('ppp{,config,oe{,conf}}') +// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] +``` + +## API + +```js +var expand = require('brace-expansion'); +``` + +### var expanded = expand(str) + +Return an array of all possible and valid expansions of `str`. If none are +found, `[str]` is returned. + +Valid expansions are: + +```js +/^(.*,)+(.+)?$/ +// {a,b,...} +``` + +A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +A numeric sequence from `x` to `y` inclusive, with optional increment. +If `x` or `y` start with a leading `0`, all the numbers will be padded +to have equal length. Negative numbers and backwards iteration work too. + +```js +/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ +// {x..y[..incr]} +``` + +An alphabetic sequence from `x` to `y` inclusive, with optional increment. +`x` and `y` must be exactly one character, and if given, `incr` must be a +number. + +For compatibility reasons, the string `${` is not eligible for brace expansion. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install brace-expansion +``` + +## Contributors + +- [Julian Gruber](https://github.com/juliangruber) +- [Isaac Z. Schlueter](https://github.com/isaacs) + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js new file mode 100644 index 00000000000000..955f27c8177eb6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -0,0 +1,201 @@ +var concatMap = require('concat-map'); +var balanced = require('balanced-match'); + +module.exports = expandTop; + +var escSlash = '\0SLASH'+Math.random()+'\0'; +var escOpen = '\0OPEN'+Math.random()+'\0'; +var escClose = '\0CLOSE'+Math.random()+'\0'; +var escComma = '\0COMMA'+Math.random()+'\0'; +var escPeriod = '\0PERIOD'+Math.random()+'\0'; + +function numeric(str) { + return parseInt(str, 10) == str + ? parseInt(str, 10) + : str.charCodeAt(0); +} + +function escapeBraces(str) { + return str.split('\\\\').join(escSlash) + .split('\\{').join(escOpen) + .split('\\}').join(escClose) + .split('\\,').join(escComma) + .split('\\.').join(escPeriod); +} + +function unescapeBraces(str) { + return str.split(escSlash).join('\\') + .split(escOpen).join('{') + .split(escClose).join('}') + .split(escComma).join(',') + .split(escPeriod).join('.'); +} + + +// Basically just str.split(","), but handling cases +// where we have nested braced sections, which should be +// treated as individual members, like {a,{b,c},d} +function parseCommaParts(str) { + if (!str) + return ['']; + + var parts = []; + var m = balanced('{', '}', str); + + if (!m) + return str.split(','); + + var pre = m.pre; + var body = m.body; + var post = m.post; + var p = pre.split(','); + + p[p.length-1] += '{' + body + '}'; + var postParts = parseCommaParts(post); + if (post.length) { + p[p.length-1] += postParts.shift(); + p.push.apply(p, postParts); + } + + parts.push.apply(parts, p); + + return parts; +} + +function expandTop(str) { + if (!str) + return []; + + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + + return expand(escapeBraces(str), true).map(unescapeBraces); +} + +function identity(e) { + return e; +} + +function embrace(str) { + return '{' + str + '}'; +} +function isPadded(el) { + return /^-?0\d/.test(el); +} + +function lte(i, y) { + return i <= y; +} +function gte(i, y) { + return i >= y; +} + +function expand(str, isTop) { + var expansions = []; + + var m = balanced('{', '}', str); + if (!m || /\$$/.test(m.pre)) return [str]; + + var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); + var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); + var isSequence = isNumericSequence || isAlphaSequence; + var isOptions = /^(.*,)+(.+)?$/.test(m.body); + if (!isSequence && !isOptions) { + // {a},b} + if (m.post.match(/,.*\}/)) { + str = m.pre + '{' + m.body + escClose + m.post; + return expand(str); + } + return [str]; + } + + var n; + if (isSequence) { + n = m.body.split(/\.\./); + } else { + n = parseCommaParts(m.body); + if (n.length === 1) { + // x{{a,b}}y ==> x{a}y x{b}y + n = expand(n[0], false).map(embrace); + if (n.length === 1) { + var post = m.post.length + ? expand(m.post, false) + : ['']; + return post.map(function(p) { + return m.pre + n[0] + p; + }); + } + } + } + + // at this point, n is the parts, and we know it's not a comma set + // with a single entry. + + // no need to expand pre, since it is guaranteed to be free of brace-sets + var pre = m.pre; + var post = m.post.length + ? expand(m.post, false) + : ['']; + + var N; + + if (isSequence) { + var x = numeric(n[0]); + var y = numeric(n[1]); + var width = Math.max(n[0].length, n[1].length) + var incr = n.length == 3 + ? Math.abs(numeric(n[2])) + : 1; + var test = lte; + var reverse = y < x; + if (reverse) { + incr *= -1; + test = gte; + } + var pad = n.some(isPadded); + + N = []; + + for (var i = x; test(i, y); i += incr) { + var c; + if (isAlphaSequence) { + c = String.fromCharCode(i); + if (c === '\\') + c = ''; + } else { + c = String(i); + if (pad) { + var need = width - c.length; + if (need > 0) { + var z = new Array(need + 1).join('0'); + if (i < 0) + c = '-' + z + c.slice(1); + else + c = z + c; + } + } + } + N.push(c); + } + } else { + N = concatMap(n, function(el) { return expand(el, false) }); + } + + for (var j = 0; j < N.length; j++) { + for (var k = 0; k < post.length; k++) { + var expansion = pre + N[j] + post[k]; + if (!isTop || isSequence || expansion) + expansions.push(expansion); + } + } + + return expansions; +} + diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore new file mode 100644 index 00000000000000..ae5d8c36ac6522 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -0,0 +1,5 @@ +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md new file mode 100644 index 00000000000000..08e918c0db9a62 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -0,0 +1,91 @@ +# balanced-match + +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! + +[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) +[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) + +[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match) + +## Example + +Get the first matching pair of braces: + +```js +var balanced = require('balanced-match'); + +console.log(balanced('{', '}', 'pre{in{nested}}post')); +console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); +``` + +The matches are: + +```bash +$ node example.js +{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' } +{ start: 3, + end: 9, + pre: 'pre', + body: 'first', + post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } +``` + +## API + +### var m = balanced(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +object with those keys: + +* **start** the index of the first match of `a` +* **end** the index of the matching `b` +* **pre** the preamble, `a` and `b` not included +* **body** the match, `a` and `b` not included +* **post** the postscript, `a` and `b` not included + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. + +### var r = balanced.range(a, b, str) + +For the first non-nested matching pair of `a` and `b` in `str`, return an +array with indexes: `[ , ]`. + +If there's no match, `undefined` will be returned. + +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. + +## Installation + +With [npm](https://npmjs.org) do: + +```bash +npm install balanced-match +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js new file mode 100644 index 00000000000000..e8d8587020ca6c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -0,0 +1,58 @@ +module.exports = balanced; +function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + + var r = range(a, b, str); + + return r && { + start: r[0], + end: r[1], + pre: str.slice(0, r[0]), + body: str.slice(r[0] + a.length, r[1]), + post: str.slice(r[1] + b.length) + }; +} + +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + +balanced.range = range; +function range(a, b, str) { + var begs, beg, left, right, result; + var ai = str.indexOf(a); + var bi = str.indexOf(b, ai + 1); + var i = ai; + + if (ai >= 0 && bi > 0) { + begs = []; + left = str.length; + + while (i >= 0 && !result) { + if (i == ai) { + begs.push(i); + ai = str.indexOf(a, i + 1); + } else if (begs.length == 1) { + result = [ begs.pop(), bi ]; + } else { + beg = begs.pop(); + if (beg < left) { + left = beg; + right = bi; + } + + bi = str.indexOf(b, i + 1); + } + + i = ai < bi && ai >= 0 ? ai : bi; + } + + if (begs.length) { + result = [ left, right ]; + } + } + + return result; +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json new file mode 100644 index 00000000000000..d70555d007145d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -0,0 +1,111 @@ +{ + "_args": [ + [ + { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_id": "balanced-match@0.4.2", + "_inCache": true, + "_installable": true, + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "_requiredBy": [ + "/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "_shrinkwrap": null, + "_spec": "balanced-match@^0.4.1", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/balanced-match/issues" + }, + "dependencies": {}, + "description": "Match balanced character pairs, like \"{\" and \"}\"", + "devDependencies": { + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" + }, + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", + "homepage": "https://github.com/juliangruber/balanced-match", + "keywords": [ + "match", + "regexp", + "test", + "balanced", + "parse" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "name": "balanced-match", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/balanced-match.git" + }, + "scripts": { + "test": "make test" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "0.4.2" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json new file mode 100644 index 00000000000000..5b79dacca0bb2e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion" + ] + ], + "_from": "concat-map@0.0.1", + "_id": "concat-map@0.0.1", + "_inCache": true, + "_installable": true, + "_location": "/node-gyp/minimatch/brace-expansion/concat-map", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "_npmVersion": "1.3.21", + "_phantomChildren": {}, + "_requested": { + "raw": "concat-map@0.0.1", + "scope": null, + "escapedName": "concat-map", + "name": "concat-map", + "rawSpec": "0.0.1", + "spec": "0.0.1", + "type": "version" + }, + "_requiredBy": [ + "/node-gyp/minimatch/brace-expansion" + ], + "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "_shrinkwrap": null, + "_spec": "concat-map@0.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion", + "author": { + "name": "James Halliday", + "email": "mail@substack.net", + "url": "http://substack.net" + }, + "bugs": { + "url": "https://github.com/substack/node-concat-map/issues" + }, + "dependencies": {}, + "description": "concatenative mapdashery", + "devDependencies": { + "tape": "~2.4.0" + }, + "directories": { + "example": "example", + "test": "test" + }, + "dist": { + "shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b", + "tarball": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz" + }, + "homepage": "https://github.com/substack/node-concat-map", + "keywords": [ + "concat", + "concatMap", + "map", + "functional", + "higher-order" + ], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "name": "concat-map", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/substack/node-concat-map.git" + }, + "scripts": { + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": { + "ie": [ + 6, + 7, + 8, + 9 + ], + "ff": [ + 3.5, + 10, + 15 + ], + "chrome": [ + 10, + 22 + ], + "safari": [ + 5.1 + ], + "opera": [ + 12 + ] + } + }, + "version": "0.0.1" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js rename to deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json new file mode 100644 index 00000000000000..a936f86896c081 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch" + ] + ], + "_from": "brace-expansion@>=1.0.0 <2.0.0", + "_id": "brace-expansion@1.1.6", + "_inCache": true, + "_installable": true, + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" + }, + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "_npmVersion": "2.15.8", + "_phantomChildren": {}, + "_requested": { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/minimatch" + ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "_shrinkwrap": null, + "_spec": "brace-expansion@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/minimatch", + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "bugs": { + "url": "https://github.com/juliangruber/brace-expansion/issues" + }, + "dependencies": { + "balanced-match": "^0.4.1", + "concat-map": "0.0.1" + }, + "description": "Brace expansion as known from sh/bash", + "devDependencies": { + "tape": "^4.6.0" + }, + "directories": {}, + "dist": { + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" + }, + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", + "homepage": "https://github.com/juliangruber/brace-expansion", + "keywords": [], + "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "brace-expansion", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/brace-expansion.git" + }, + "scripts": { + "gentest": "bash test/generate.sh", + "test": "tape test/*.js" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "ie/8..latest", + "firefox/20..latest", + "firefox/nightly", + "chrome/25..latest", + "chrome/canary", + "opera/12..latest", + "opera/next", + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest", + "android-browser/4.2..latest" + ] + }, + "version": "1.1.6" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore deleted file mode 100644 index 07e6e472cc75fa..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.npmignore +++ /dev/null @@ -1 +0,0 @@ -/node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml deleted file mode 100644 index 4af02b3d17e64c..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - '0.8' - - '0.10' - - '0.12' - - 'iojs' -before_install: - - npm install -g npm@latest diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS deleted file mode 100644 index 4a0bc5033a06e7..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +++ /dev/null @@ -1,14 +0,0 @@ -# Authors, sorted by whether or not they are me -Isaac Z. Schlueter -Brian Cottingham -Carlos Brito Lage -Jesse Dailey -Kevin O'Hara -Marco Rogers -Mark Cavage -Marko Mikulicic -Nathan Rajlich -Satheesh Natesan -Trent Mick -ashleybrener -n4kz diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md deleted file mode 100644 index c06814e0414d56..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/README.md +++ /dev/null @@ -1,137 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n) { return n * 2 } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Keys should always be Strings or Numbers - -Note: this module will print warnings to `console.error` if you use a -key that is not a String or Number. Because items are stored in an -object, which coerces keys to a string, it won't go well for you if -you try to use a key that is not a unique string, it'll cause surprise -collisions. For example: - -```JavaScript -// Bad Example! Dont' do this! -var cache = LRU() -var a = {} -var b = {} -cache.set(a, 'this is a') -cache.set(b, 'this is b') -console.log(cache.get(a)) // prints: 'this is b' -``` - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n){return n.length}`. The default is - `function(n){return 1}`, which is fine if you want to store `max` - like-sized things. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `max` is optional and overrides the - cache `max` option if provided. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length()` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index 2bbe653be8ad08..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,334 +0,0 @@ -;(function () { // closure for web browsers - -if (typeof module === 'object' && module.exports) { - module.exports = LRUCache -} else { - // just set the global for non-node platforms. - this.LRUCache = LRUCache -} - -function hOP (obj, key) { - return Object.prototype.hasOwnProperty.call(obj, key) -} - -function naiveLength () { return 1 } - -var didTypeWarning = false -function typeCheckKey(key) { - if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') { - didTypeWarning = true - console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack) - } -} - -function LRUCache (options) { - if (!(this instanceof LRUCache)) - return new LRUCache(options) - - if (typeof options === 'number') - options = { max: options } - - if (!options) - options = {} - - this._max = options.max - // Kind of weird to have a default max of Infinity, but oh well. - if (!this._max || !(typeof this._max === "number") || this._max <= 0 ) - this._max = Infinity - - this._lengthCalculator = options.length || naiveLength - if (typeof this._lengthCalculator !== "function") - this._lengthCalculator = naiveLength - - this._allowStale = options.stale || false - this._maxAge = options.maxAge || null - this._dispose = options.dispose - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, "max", - { set : function (mL) { - if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity - this._max = mL - if (this._length > this._max) trim(this) - } - , get : function () { return this._max } - , enumerable : true - }) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, "lengthCalculator", - { set : function (lC) { - if (typeof lC !== "function") { - this._lengthCalculator = naiveLength - this._length = this._itemCount - for (var key in this._cache) { - this._cache[key].length = 1 - } - } else { - this._lengthCalculator = lC - this._length = 0 - for (var key in this._cache) { - this._cache[key].length = this._lengthCalculator(this._cache[key].value) - this._length += this._cache[key].length - } - } - - if (this._length > this._max) trim(this) - } - , get : function () { return this._lengthCalculator } - , enumerable : true - }) - -Object.defineProperty(LRUCache.prototype, "length", - { get : function () { return this._length } - , enumerable : true - }) - - -Object.defineProperty(LRUCache.prototype, "itemCount", - { get : function () { return this._itemCount } - , enumerable : true - }) - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - var i = 0 - var itemCount = this._itemCount - - for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) { - i++ - var hit = this._lruList[k] - if (isStale(this, hit)) { - del(this, hit) - if (!this._allowStale) hit = undefined - } - if (hit) { - fn.call(thisp, hit.value, hit.key, this) - } - } -} - -LRUCache.prototype.keys = function () { - var keys = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - keys[i++] = hit.key - } - return keys -} - -LRUCache.prototype.values = function () { - var values = new Array(this._itemCount) - var i = 0 - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - values[i++] = hit.value - } - return values -} - -LRUCache.prototype.reset = function () { - if (this._dispose && this._cache) { - for (var k in this._cache) { - this._dispose(k, this._cache[k].value) - } - } - - this._cache = Object.create(null) // hash of items by key - this._lruList = Object.create(null) // list of items in order of use recency - this._mru = 0 // most recently used - this._lru = 0 // least recently used - this._length = 0 // number of items in the list - this._itemCount = 0 -} - -LRUCache.prototype.dump = function () { - var arr = [] - var i = 0 - - for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) { - var hit = this._lruList[k] - if (!isStale(this, hit)) { - //Do not store staled hits - ++i - arr.push({ - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - }); - } - } - //arr has the most read first - return arr -} - -LRUCache.prototype.dumpLru = function () { - return this._lruList -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || this._maxAge - typeCheckKey(key) - - var now = maxAge ? Date.now() : 0 - var len = this._lengthCalculator(value) - - if (hOP(this._cache, key)) { - if (len > this._max) { - del(this, this._cache[key]) - return false - } - // dispose of the old one before overwriting - if (this._dispose) - this._dispose(key, this._cache[key].value) - - this._cache[key].now = now - this._cache[key].maxAge = maxAge - this._cache[key].value = value - this._length += (len - this._cache[key].length) - this._cache[key].length = len - this.get(key) - - if (this._length > this._max) - trim(this) - - return true - } - - var hit = new Entry(key, value, this._mru++, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > this._max) { - if (this._dispose) this._dispose(key, value) - return false - } - - this._length += hit.length - this._lruList[hit.lu] = this._cache[key] = hit - this._itemCount ++ - - if (this._length > this._max) - trim(this) - - return true -} - -LRUCache.prototype.has = function (key) { - typeCheckKey(key) - if (!hOP(this._cache, key)) return false - var hit = this._cache[key] - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - typeCheckKey(key) - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - typeCheckKey(key) - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var hit = this._lruList[this._lru] - del(this, hit) - return hit || null -} - -LRUCache.prototype.del = function (key) { - typeCheckKey(key) - del(this, this._cache[key]) -} - -LRUCache.prototype.load = function (arr) { - //reset the cache - this.reset(); - - var now = Date.now() - //A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l-- ) { - var hit = arr[l] - typeCheckKey(hit.k) - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - //the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - //dont add already expired items - if (maxAge > 0) this.set(hit.k, hit.v, maxAge) - } - } -} - -function get (self, key, doUse) { - typeCheckKey(key) - var hit = self._cache[key] - if (hit) { - if (isStale(self, hit)) { - del(self, hit) - if (!self._allowStale) hit = undefined - } else { - if (doUse) use(self, hit) - } - if (hit) hit = hit.value - } - return hit -} - -function isStale(self, hit) { - if (!hit || (!hit.maxAge && !self._maxAge)) return false - var stale = false; - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = self._maxAge && (diff > self._maxAge) - } - return stale; -} - -function use (self, hit) { - shiftLU(self, hit) - hit.lu = self._mru ++ - self._lruList[hit.lu] = hit -} - -function trim (self) { - while (self._lru < self._mru && self._length > self._max) - del(self, self._lruList[self._lru]) -} - -function shiftLU (self, hit) { - delete self._lruList[ hit.lu ] - while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++ -} - -function del (self, hit) { - if (hit) { - if (self._dispose) self._dispose(hit.key, hit.value) - self._length -= hit.length - self._itemCount -- - delete self._cache[ hit.key ] - shiftLU(self, hit) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, lu, length, now, maxAge) { - this.key = key - this.value = value - this.lu = lu - this.length = length - this.now = now - if (maxAge) this.maxAge = maxAge -} - -})() diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json deleted file mode 100644 index 411b59ea1b1f4f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/package.json +++ /dev/null @@ -1,84 +0,0 @@ -{ - "_args": [ - [ - "lru-cache@2", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" - ] - ], - "_from": "lru-cache@>=2.0.0 <3.0.0", - "_id": "lru-cache@2.7.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/minimatch/lru-cache", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "lru-cache", - "raw": "lru-cache@2", - "rawSpec": "2", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/minimatch" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz", - "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", - "_shrinkwrap": null, - "_spec": "lru-cache@2", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "dependencies": {}, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "tap": "^1.2.0", - "weak": "" - }, - "directories": {}, - "dist": { - "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz" - }, - "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714", - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "cache", - "lru", - "mru" - ], - "license": "ISC", - "main": "lib/lru-cache.js", - "maintainers": [ - { - "name": "isaacs", - "email": "isaacs@npmjs.com" - }, - { - "name": "othiym23", - "email": "ogd@aoaioxxysz.net" - } - ], - "name": "lru-cache", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "test": "tap test --gc" - }, - "version": "2.7.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js deleted file mode 100644 index b47225f109891f..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/basic.js +++ /dev/null @@ -1,396 +0,0 @@ -var test = require("tap").test - , LRU = require("../") - -test("basic", function (t) { - var cache = new LRU({max: 10}) - cache.set("key", "value") - t.equal(cache.get("key"), "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.length, 1) - t.equal(cache.max, 10) - t.end() -}) - -test("least recently set", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - cache.get("a") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), "A") - t.end() -}) - -test("del", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.del("a") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("max", function (t) { - var cache = new LRU(3) - - // test changing the max, verify that the LRU items get dropped. - cache.max = 100 - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - - // now remove the max restriction, and try again. - cache.max = "hello" - for (var i = 0; i < 100; i ++) cache.set(i, i) - t.equal(cache.length, 100) - for (var i = 0; i < 100; i ++) { - t.equal(cache.get(i), i) - } - // should trigger an immediate resize - cache.max = 3 - t.equal(cache.length, 3) - for (var i = 0; i < 97; i ++) { - t.equal(cache.get(i), undefined) - } - for (var i = 98; i < 100; i ++) { - t.equal(cache.get(i), i) - } - t.end() -}) - -test("reset", function (t) { - var cache = new LRU(10) - cache.set("a", "A") - cache.set("b", "B") - cache.reset() - t.equal(cache.length, 0) - t.equal(cache.max, 10) - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.end() -}) - - -test("basic with weighed length", function (t) { - var cache = new LRU({ - max: 100, - length: function (item) { return item.size } - }) - cache.set("key", {val: "value", size: 50}) - t.equal(cache.get("key").val, "value") - t.equal(cache.get("nada"), undefined) - t.equal(cache.lengthCalculator(cache.get("key")), 50) - t.equal(cache.length, 50) - t.equal(cache.max, 100) - t.end() -}) - - -test("weighed length item too large", function (t) { - var cache = new LRU({ - max: 10, - length: function (item) { return item.size } - }) - t.equal(cache.max, 10) - - // should fall out immediately - cache.set("key", {val: "value", size: 50}) - - t.equal(cache.length, 0) - t.equal(cache.get("key"), undefined) - t.end() -}) - -test("least recently set with weighed length", function (t) { - var cache = new LRU({ - max:8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.set("d", "DDDD") - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("c"), "CCC") - t.equal(cache.get("b"), undefined) - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("lru recently gotten with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - cache.get("a") - cache.get("b") - cache.set("d", "DDDD") - t.equal(cache.get("c"), undefined) - t.equal(cache.get("d"), "DDDD") - t.equal(cache.get("b"), "BB") - t.equal(cache.get("a"), "A") - t.end() -}) - -test("lru recently updated with weighed length", function (t) { - var cache = new LRU({ - max: 8, - length: function (item) { return item.length } - }) - cache.set("a", "A") - cache.set("b", "BB") - cache.set("c", "CCC") - t.equal(cache.length, 6) //CCC BB A - cache.set("a", "+A") - t.equal(cache.length, 7) //+A CCC BB - cache.set("b", "++BB") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("c", "oversized") - t.equal(cache.length, 6) //++BB +A - t.equal(cache.get("c"), undefined) - - cache.set("a", "oversized") - t.equal(cache.length, 4) //++BB - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "++BB") - t.end() -}) - -test("set returns proper booleans", function(t) { - var cache = new LRU({ - max: 5, - length: function (item) { return item.length } - }) - - t.equal(cache.set("a", "A"), true) - - // should return false for max exceeded - t.equal(cache.set("b", "donuts"), false) - - t.equal(cache.set("b", "B"), true) - t.equal(cache.set("c", "CCCC"), true) - t.end() -}) - -test("drop the old items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A") - - setTimeout(function () { - cache.set("b", "b") - t.equal(cache.get("a"), "A") - }, 25) - - setTimeout(function () { - cache.set("c", "C") - // timed out - t.notOk(cache.get("a")) - }, 60 + 25) - - setTimeout(function () { - t.notOk(cache.get("b")) - t.equal(cache.get("c"), "C") - }, 90) - - setTimeout(function () { - t.notOk(cache.get("c")) - t.end() - }, 155) -}) - -test("individual item can have it's own maxAge", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - cache.set("a", "A", 20) - setTimeout(function () { - t.notOk(cache.get("a")) - t.end() - }, 25) -}) - -test("individual item can have it's own maxAge > cache's", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 20 - }) - - cache.set("a", "A", 50) - setTimeout(function () { - t.equal(cache.get("a"), "A") - t.end() - }, 25) -}) - -test("disposal function", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - dispose: function (k, n) { - disposed = n - } - }) - - cache.set(1, 1) - cache.set(2, 2) - t.equal(disposed, 1) - cache.set(3, 3) - t.equal(disposed, 2) - cache.reset() - t.equal(disposed, 3) - t.end() -}) - -test("disposal function on too big of item", function(t) { - var disposed = false - var cache = new LRU({ - max: 1, - length: function (k) { - return k.length - }, - dispose: function (k, n) { - disposed = n - } - }) - var obj = [ 1, 2 ] - - t.equal(disposed, false) - cache.set("obj", obj) - t.equal(disposed, obj) - t.end() -}) - -test("has()", function(t) { - var cache = new LRU({ - max: 1, - maxAge: 10 - }) - - cache.set('foo', 'bar') - t.equal(cache.has('foo'), true) - cache.set('blu', 'baz') - t.equal(cache.has('foo'), false) - t.equal(cache.has('blu'), true) - setTimeout(function() { - t.equal(cache.has('blu'), false) - t.end() - }, 15) -}) - -test("stale", function(t) { - var cache = new LRU({ - maxAge: 10, - stale: true - }) - - cache.set('foo', 'bar') - t.equal(cache.get('foo'), 'bar') - t.equal(cache.has('foo'), true) - setTimeout(function() { - t.equal(cache.has('foo'), false) - t.equal(cache.get('foo'), 'bar') - t.equal(cache.get('foo'), undefined) - t.end() - }, 15) -}) - -test("lru update via set", function(t) { - var cache = LRU({ max: 2 }); - - cache.set('foo', 1); - cache.set('bar', 2); - cache.del('bar'); - cache.set('baz', 3); - cache.set('qux', 4); - - t.equal(cache.get('foo'), undefined) - t.equal(cache.get('bar'), undefined) - t.equal(cache.get('baz'), 3) - t.equal(cache.get('qux'), 4) - t.end() -}) - -test("least recently set w/ peek", function (t) { - var cache = new LRU(2) - cache.set("a", "A") - cache.set("b", "B") - t.equal(cache.peek("a"), "A") - cache.set("c", "C") - t.equal(cache.get("c"), "C") - t.equal(cache.get("b"), "B") - t.equal(cache.get("a"), undefined) - t.end() -}) - -test("pop the least used item", function (t) { - var cache = new LRU(3) - , last - - cache.set("a", "A") - cache.set("b", "B") - cache.set("c", "C") - - t.equal(cache.length, 3) - t.equal(cache.max, 3) - - // Ensure we pop a, c, b - cache.get("b", "B") - - last = cache.pop() - t.equal(last.key, "a") - t.equal(last.value, "A") - t.equal(cache.length, 2) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "c") - t.equal(last.value, "C") - t.equal(cache.length, 1) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last.key, "b") - t.equal(last.value, "B") - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - last = cache.pop() - t.equal(last, null) - t.equal(cache.length, 0) - t.equal(cache.max, 3) - - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js deleted file mode 100644 index 4190417cbc61d8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +++ /dev/null @@ -1,120 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('forEach', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 9 - l.forEach(function (val, key, cache) { - t.equal(cache, l) - t.equal(key, i.toString()) - t.equal(val, i.toString(2)) - i -= 1 - }) - - // get in order of most recently used - l.get(6) - l.get(8) - - var order = [ 8, 6, 9, 7, 5 ] - var i = 0 - - l.forEach(function (val, key, cache) { - var j = order[i ++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - t.end() -}) - -test('keys() and values()', function (t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - t.similar(l.keys(), ['9', '8', '7', '6', '5']) - t.similar(l.values(), ['1001', '1000', '111', '110', '101']) - - // get in order of most recently used - l.get(6) - l.get(8) - - t.similar(l.keys(), ['8', '6', '9', '7', '5']) - t.similar(l.values(), ['1000', '110', '1001', '111', '101']) - - t.end() -}) - -test('all entries are iterated over', function(t) { - var l = new LRU(5) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function (val, key, cache) { - if (i > 0) { - cache.del(key) - } - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 1) - - t.end() -}) - -test('all stale entries are removed', function(t) { - var l = new LRU({ max: 5, maxAge: -5, stale: true }) - for (var i = 0; i < 10; i ++) { - l.set(i.toString(), i.toString(2)) - } - - var i = 0 - l.forEach(function () { - i += 1 - }) - - t.equal(i, 5) - t.equal(l.keys().length, 0) - - t.end() -}) - -test('expires', function (t) { - var l = new LRU({ - max: 10, - maxAge: 50 - }) - for (var i = 0; i < 10; i++) { - l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined)) - } - - var i = 0 - var order = [ 8, 6, 4, 2, 0 ] - setTimeout(function () { - l.forEach(function (val, key, cache) { - var j = order[i++] - t.equal(cache, l) - t.equal(key, j.toString()) - t.equal(val, j.toString(2)) - }) - t.equal(i, order.length); - - setTimeout(function () { - var count = 0; - l.forEach(function (val, key, cache) { count++; }) - t.equal(0, count); - t.end() - }, 25) - - }, 26) -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js deleted file mode 100644 index b5912f6f168e5e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +++ /dev/null @@ -1,51 +0,0 @@ -#!/usr/bin/env node --expose_gc - - -var weak = require('weak'); -var test = require('tap').test -var LRU = require('../') -var l = new LRU({ max: 10 }) -var refs = 0 -function X() { - refs ++ - weak(this, deref) -} - -function deref() { - refs -- -} - -test('no leaks', function (t) { - // fill up the cache - for (var i = 0; i < 100; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var start = process.memoryUsage() - - // capture the memory - var startRefs = refs - - // do it again, but more - for (var i = 0; i < 10000; i++) { - l.set(i, new X); - // throw some gets in there, too. - if (i % 2 === 0) - l.get(i / 2) - } - - gc() - - var end = process.memoryUsage() - t.equal(refs, startRefs, 'no leaky refs') - - console.error('start: %j\n' + - 'end: %j', start, end); - t.pass(); - t.end(); -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js deleted file mode 100644 index 5fe5dc3d371f1e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/lru-cache/test/serialize.js +++ /dev/null @@ -1,215 +0,0 @@ -var test = require('tap').test -var LRU = require('../') - -test('dump', function (t) { - var cache = new LRU() - - t.equal(cache.dump().length, 0, "nothing in dump for empty cache") - - cache.set("a", "A") - cache.set("b", "B") - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.set("a", "A"); - t.deepEqual(cache.dump(), [ - { k: "a", v: "A", e: 0 }, - { k: "b", v: "B", e: 0 } - ]) - - cache.get("b"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 }, - { k: "a", v: "A", e: 0 } - ]) - - cache.del("a"); - t.deepEqual(cache.dump(), [ - { k: "b", v: "B", e: 0 } - ]) - - t.end() -}) - -test("do not dump stale items", function(t) { - var cache = new LRU({ - max: 5, - maxAge: 50 - }) - - //expires at 50 - cache.set("a", "A") - - setTimeout(function () { - //expires at 75 - cache.set("b", "B") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "b") - t.equal(s[1].k, "a") - }, 25) - - setTimeout(function () { - //expires at 110 - cache.set("c", "C") - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "c") - t.equal(s[1].k, "b") - }, 60) - - setTimeout(function () { - //expires at 130 - cache.set("d", "D", 40) - var s = cache.dump() - t.equal(s.length, 2) - t.equal(s[0].k, "d") - t.equal(s[1].k, "c") - }, 90) - - setTimeout(function () { - var s = cache.dump() - t.equal(s.length, 1) - t.equal(s[0].k, "d") - }, 120) - - setTimeout(function () { - var s = cache.dump() - t.deepEqual(s, []) - t.end() - }, 155) -}) - -test("load basic cache", function(t) { - var cache = new LRU(), - copy = new LRU() - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.deepEquals(cache.dump(), copy.dump()) - - t.end() -}) - - -test("load staled cache", function(t) { - var cache = new LRU({maxAge: 50}), - copy = new LRU({maxAge: 50}), - arr - - //expires at 50 - cache.set("a", "A") - setTimeout(function () { - //expires at 80 - cache.set("b", "B") - arr = cache.dump() - t.equal(arr.length, 2) - }, 30) - - setTimeout(function () { - copy.load(arr) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - }, 60) - - setTimeout(function () { - t.equal(copy.get("b"), undefined) - t.end() - }, 90) -}) - -test("load to other size cache", function(t) { - var cache = new LRU({max: 2}), - copy = new LRU({max: 1}) - - cache.set("a", "A") - cache.set("b", "B") - - copy.load(cache.dump()) - t.equal(copy.get("a"), undefined) - t.equal(copy.get("b"), "B") - - //update the last read from original cache - cache.get("a") - copy.load(cache.dump()) - t.equal(copy.get("a"), "A") - t.equal(copy.get("b"), undefined) - - t.end() -}) - - -test("load to other age cache", function(t) { - var cache = new LRU({maxAge: 50}), - aged = new LRU({maxAge: 100}), - simple = new LRU(), - arr, - expired - - //created at 0 - //a would be valid till 0 + 50 - cache.set("a", "A") - setTimeout(function () { - //created at 20 - //b would be valid till 20 + 50 - cache.set("b", "B") - //b would be valid till 20 + 70 - cache.set("c", "C", 70) - arr = cache.dump() - t.equal(arr.length, 3) - }, 20) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), "B") - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), "B") - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), "B") - t.equal(simple.get("c"), "C") - }, 60) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), "C") - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), "C") - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), "C") - }, 80) - - setTimeout(function () { - t.equal(cache.get("a"), undefined) - t.equal(cache.get("b"), undefined) - t.equal(cache.get("c"), undefined) - - aged.load(arr) - t.equal(aged.get("a"), undefined) - t.equal(aged.get("b"), undefined) - t.equal(aged.get("c"), undefined) - - simple.load(arr) - t.equal(simple.get("a"), undefined) - t.equal(simple.get("b"), undefined) - t.equal(simple.get("c"), undefined) - t.end() - }, 100) - -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md deleted file mode 100644 index 25a38a53fe2fea..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/README.md +++ /dev/null @@ -1,53 +0,0 @@ -# sigmund - -Quick and dirty signatures for Objects. - -This is like a much faster `deepEquals` comparison, which returns a -string key suitable for caches and the like. - -## Usage - -```javascript -function doSomething (someObj) { - var key = sigmund(someObj, maxDepth) // max depth defaults to 10 - var cached = cache.get(key) - if (cached) return cached - - var result = expensiveCalculation(someObj) - cache.set(key, result) - return result -} -``` - -The resulting key will be as unique and reproducible as calling -`JSON.stringify` or `util.inspect` on the object, but is much faster. -In order to achieve this speed, some differences are glossed over. -For example, the object `{0:'foo'}` will be treated identically to the -array `['foo']`. - -Also, just as there is no way to summon the soul from the scribblings -of a cocaine-addled psychoanalyst, there is no way to revive the object -from the signature string that sigmund gives you. In fact, it's -barely even readable. - -As with `util.inspect` and `JSON.stringify`, larger objects will -produce larger signature strings. - -Because sigmund is a bit less strict than the more thorough -alternatives, the strings will be shorter, and also there is a -slightly higher chance for collisions. For example, these objects -have the same signature: - - var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} - var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -Like a good Freudian, sigmund is most effective when you already have -some understanding of what you're looking for. It can help you help -yourself, but you must be willing to do some work as well. - -Cycles are handled, and cyclical objects are silently omitted (though -the key is included in the signature output.) - -The second argument is the maximum depth, which defaults to 10, -because that is the maximum object traversal depth covered by most -insurance carriers. diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js deleted file mode 100644 index 5acfd6d90de377..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/bench.js +++ /dev/null @@ -1,283 +0,0 @@ -// different ways to id objects -// use a req/res pair, since it's crazy deep and cyclical - -// sparseFE10 and sigmund are usually pretty close, which is to be expected, -// since they are essentially the same algorithm, except that sigmund handles -// regular expression objects properly. - - -var http = require('http') -var util = require('util') -var sigmund = require('./sigmund.js') -var sreq, sres, creq, cres, test - -http.createServer(function (q, s) { - sreq = q - sres = s - sres.end('ok') - this.close(function () { setTimeout(function () { - start() - }, 200) }) -}).listen(1337, function () { - creq = http.get({ port: 1337 }) - creq.on('response', function (s) { cres = s }) -}) - -function start () { - test = [sreq, sres, creq, cres] - // test = sreq - // sreq.sres = sres - // sreq.creq = creq - // sreq.cres = cres - - for (var i in exports.compare) { - console.log(i) - var hash = exports.compare[i]() - console.log(hash) - console.log(hash.length) - console.log('') - } - - require('bench').runMain() -} - -function customWs (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return ('' + obj).replace(/[\n ]+/g, '') - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return customWs(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + customWs(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function custom (obj, md, d) { - d = d || 0 - var to = typeof obj - if (to === 'undefined' || to === 'function' || to === null) return '' - if (d > md || !obj || to !== 'object') return '' + obj - - if (Array.isArray(obj)) { - return obj.map(function (i, _, __) { - return custom(i, md, d + 1) - }).reduce(function (a, b) { return a + b }, '') - } - - var keys = Object.keys(obj) - return keys.map(function (k, _, __) { - return k + ':' + custom(obj[k], md, d + 1) - }).reduce(function (a, b) { return a + b }, '') -} - -function sparseFE2 (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k + ':' - ch(v[k], depth + 1) - }) - soFar += '}' - } - ch(obj, 0) - return soFar -} - -function sparseFE (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - Object.keys(v).forEach(function (k, _, __) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') return - var to = typeof v[k] - if (to === 'function' || to === 'undefined') return - soFar += k - ch(v[k], depth + 1) - }) - } - ch(obj, 0) - return soFar -} - -function sparse (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k - ch(v[k], depth + 1) - } - } - ch(obj, 0) - return soFar -} - -function noCommas (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - - -function flatten (obj, maxDepth) { - var seen = [] - var soFar = '' - function ch (v, depth) { - if (depth > maxDepth) return - if (typeof v === 'function' || typeof v === 'undefined') return - if (typeof v !== 'object' || !v) { - soFar += v - return - } - if (seen.indexOf(v) !== -1 || depth === maxDepth) return - seen.push(v) - soFar += '{' - for (var k in v) { - // pseudo-private values. skip those. - if (k.charAt(0) === '_') continue - var to = typeof v[k] - if (to === 'function' || to === 'undefined') continue - soFar += k + ':' - ch(v[k], depth + 1) - soFar += ',' - } - soFar += '}' - } - ch(obj, 0) - return soFar -} - -exports.compare = -{ - // 'custom 2': function () { - // return custom(test, 2, 0) - // }, - // 'customWs 2': function () { - // return customWs(test, 2, 0) - // }, - 'JSON.stringify (guarded)': function () { - var seen = [] - return JSON.stringify(test, function (k, v) { - if (typeof v !== 'object' || !v) return v - if (seen.indexOf(v) !== -1) return undefined - seen.push(v) - return v - }) - }, - - 'flatten 10': function () { - return flatten(test, 10) - }, - - // 'flattenFE 10': function () { - // return flattenFE(test, 10) - // }, - - 'noCommas 10': function () { - return noCommas(test, 10) - }, - - 'sparse 10': function () { - return sparse(test, 10) - }, - - 'sparseFE 10': function () { - return sparseFE(test, 10) - }, - - 'sparseFE2 10': function () { - return sparseFE2(test, 10) - }, - - sigmund: function() { - return sigmund(test, 10) - }, - - - // 'util.inspect 1': function () { - // return util.inspect(test, false, 1, false) - // }, - // 'util.inspect undefined': function () { - // util.inspect(test) - // }, - // 'util.inspect 2': function () { - // util.inspect(test, false, 2, false) - // }, - // 'util.inspect 3': function () { - // util.inspect(test, false, 3, false) - // }, - // 'util.inspect 4': function () { - // util.inspect(test, false, 4, false) - // }, - // 'util.inspect Infinity': function () { - // util.inspect(test, false, Infinity, false) - // } -} - -/** results -**/ diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json deleted file mode 100644 index b1dbae0a802671..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/package.json +++ /dev/null @@ -1,85 +0,0 @@ -{ - "_args": [ - [ - "sigmund@~1.0.0", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch" - ] - ], - "_from": "sigmund@>=1.0.0 <1.1.0", - "_id": "sigmund@1.0.1", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/minimatch/sigmund", - "_nodeVersion": "2.0.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "2.10.0", - "_phantomChildren": {}, - "_requested": { - "name": "sigmund", - "raw": "sigmund@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/minimatch" - ], - "_resolved": "https://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz", - "_shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "_shrinkwrap": null, - "_spec": "sigmund@~1.0.0", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/minimatch", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/sigmund/issues" - }, - "dependencies": {}, - "description": "Quick and dirty signatures for Objects.", - "devDependencies": { - "tap": "~0.3.0" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "3ff21f198cad2175f9f3b781853fd94d0d19b590", - "tarball": "http://registry.npmjs.org/sigmund/-/sigmund-1.0.1.tgz" - }, - "gitHead": "527f97aa5bb253d927348698c0cd3bb267d098c6", - "homepage": "https://github.com/isaacs/sigmund#readme", - "keywords": [ - "data", - "key", - "object", - "psychoanalysis", - "signature" - ], - "license": "ISC", - "main": "sigmund.js", - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "name": "sigmund", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/sigmund.git" - }, - "scripts": { - "bench": "node bench.js", - "test": "tap test/*.js" - }, - "version": "1.0.1" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js deleted file mode 100644 index 82c7ab8ce995b5..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/sigmund.js +++ /dev/null @@ -1,39 +0,0 @@ -module.exports = sigmund -function sigmund (subject, maxSessions) { - maxSessions = maxSessions || 10; - var notes = []; - var analysis = ''; - var RE = RegExp; - - function psychoAnalyze (subject, session) { - if (session > maxSessions) return; - - if (typeof subject === 'function' || - typeof subject === 'undefined') { - return; - } - - if (typeof subject !== 'object' || !subject || - (subject instanceof RE)) { - analysis += subject; - return; - } - - if (notes.indexOf(subject) !== -1 || session === maxSessions) return; - - notes.push(subject); - analysis += '{'; - Object.keys(subject).forEach(function (issue, _, __) { - // pseudo-private values. skip those. - if (issue.charAt(0) === '_') return; - var to = typeof subject[issue]; - if (to === 'function' || to === 'undefined') return; - analysis += issue; - psychoAnalyze(subject[issue], session + 1); - }); - } - psychoAnalyze(subject, 0); - return analysis; -} - -// vim: set softtabstop=4 shiftwidth=4: diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js deleted file mode 100644 index 6149a80239f059..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/node_modules/sigmund/test/basic.js +++ /dev/null @@ -1,23 +0,0 @@ -var test = require('tap').test -var sigmund = require('../sigmund.js') - - -// occasionally there are duplicates -// that's an acceptable edge-case. JSON.stringify and util.inspect -// have some collision potential as well, though less, and collision -// detection is expensive. -var hash = '{abc/def/g{0h1i2{jkl' -var obj1 = {a:'b',c:/def/,g:['h','i',{j:'',k:'l'}]} -var obj2 = {a:'b',c:'/def/',g:['h','i','{jkl']} - -var obj3 = JSON.parse(JSON.stringify(obj1)) -obj3.c = /def/ -obj3.g[2].cycle = obj3 -var cycleHash = '{abc/def/g{0h1i2{jklcycle' - -test('basic', function (t) { - t.equal(sigmund(obj1), hash) - t.equal(sigmund(obj2), hash) - t.equal(sigmund(obj3), cycleHash) - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json index 2f0d2de57e663e..16b975354b41fc 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/minimatch/package.json @@ -1,67 +1,82 @@ { "_args": [ [ - "minimatch@1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp" + { + "raw": "minimatch@^3.0.2", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp" ] ], - "_from": "minimatch@>=1.0.0 <2.0.0", - "_id": "minimatch@1.0.0", + "_from": "minimatch@>=3.0.2 <4.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/node-gyp/minimatch", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "1.4.21", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", - "raw": "minimatch@1", - "rawSpec": "1", + "raw": "minimatch@^3.0.2", "scope": null, - "spec": ">=1.0.0 <2.0.0", + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", "type": "range" }, "_requiredBy": [ - "/node-gyp" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz", - "_shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, - "_spec": "minimatch@1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp", + "_spec": "minimatch@^3.0.2", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { "url": "https://github.com/isaacs/minimatch/issues" }, "dependencies": { - "lru-cache": "2", - "sigmund": "~1.0.0" + "brace-expansion": "^1.0.0" }, "description": "a glob matcher in javascript", "devDependencies": { - "tap": "" + "standard": "^3.7.2", + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "e0dd2120b49e1b724ce8d714c520822a9438576d", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-1.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" }, - "gitHead": "b374a643976eb55cdc19c60b6dd51ebe9bcc607a", - "homepage": "https://github.com/isaacs/minimatch", - "license": { - "type": "MIT", - "url": "http://github.com/isaacs/minimatch/raw/master/LICENSE" - }, + "files": [ + "minimatch.js" + ], + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", + "homepage": "https://github.com/isaacs/minimatch#readme", + "license": "ISC", "main": "minimatch.js", "maintainers": [ { @@ -77,7 +92,8 @@ "url": "git://github.com/isaacs/minimatch.git" }, "scripts": { + "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "1.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js deleted file mode 100644 index ae7ac73c775edb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/basic.js +++ /dev/null @@ -1,399 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - - -var patterns = - [ "http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - // https://github.com/isaacs/minimatch/issues/5 - , function () { - files = [ 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' - , 'a/b/.x' - , 'a/b/.x/' - , 'a/.x/b' - , '.x' - , '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b/.x/c' - , '.x/.x' ] - } - , ["**/.x/**", [ '.x/' - , '.x/a' - , '.x/a/b' - , 'a/.x/b' - , 'a/b/.x/' - , 'a/b/.x/c' - , 'a/b/.x/c/d' - , 'a/b/.x/c/d/e' ] ] - - ] - -var regexps = - [ '/^(?:(?=.)a[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:(?=.)X[^/]*?)$/', - '/^(?:\\*)$/', - '/^(?:(?=.)\\*[^/]*?)$/', - '/^(?:\\*\\*)$/', - '/^(?:(?=.)b[^/]*?\\/)$/', - '/^(?:(?=.)c[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:\\.\\.\\/(?!\\.)(?=.)[^/]*?\\/)$/', - '/^(?:s\\/(?=.)\\.\\.[^/]*?\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/1\\/)$/', - '/^(?:\\/\\^root:\\/\\{s\\/(?=.)\\^[^:][^/]*?:[^:][^/]*?:\\([^:]\\)[^/]*?\\.[^/]*?\\$\\/\u0001\\/)$/', - '/^(?:(?!\\.)(?=.)[a-c]b[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[a-y][^/]*?[^c])$/', - '/^(?:(?=.)a[^/]*?[^c])$/', - '/^(?:(?=.)a[X-]b)$/', - '/^(?:(?!\\.)(?=.)[^a-c][^/]*?)$/', - '/^(?:a\\*b\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?=.)a\\*[^/]\\/(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\\\\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\![^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.\\*)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[b]c)$/', - '/^(?:(?=.)a[^/]c)$/', - '/^(?:a\\*c)$/', - 'false', - '/^(?:(?!\\.)(?=.)[^/]*?\\/(?=.)man[^/]*?\\/(?=.)bash\\.[^/]*?)$/', - '/^(?:man\\/man1\\/bash\\.1)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?=.)a[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/]k[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/][^/]*?[^/]*?cd[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?k[^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[-abc])$/', - '/^(?:(?!\\.)(?=.)[abc-])$/', - '/^(?:\\\\)$/', - '/^(?:(?!\\.)(?=.)[\\\\])$/', - '/^(?:(?!\\.)(?=.)[\\[])$/', - '/^(?:\\[)$/', - '/^(?:(?=.)\\[(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[\\]])$/', - '/^(?:(?!\\.)(?=.)[\\]-])$/', - '/^(?:(?!\\.)(?=.)[a-z])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/])$/', - '/^(?:(?!\\.)(?=.)[^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?c)$/', - '/^(?:(?!\\.)(?=.)[^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?c[^/]*?[^/][^/]*?[^/]*?)$/', - '/^(?:(?=.)a[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/][^/][^/][^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?[^/]*?)$/', - '/^(?:\\[\\])$/', - '/^(?:\\[abc)$/', - '/^(?:(?=.)XYZ)$/i', - '/^(?:(?=.)ab[^/]*?)$/i', - '/^(?:(?!\\.)(?=.)[ia][^/][ck])$/i', - '/^(?:\\/(?!\\.)(?=.)[^/]*?|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:\\/(?!\\.)(?=.)[^/]|(?!\\.)(?=.)[^/]*?)$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?)$/', - '/^(?:a\\/(?!(?:^|\\/)\\.{1,2}(?:$|\\/))(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:a\\/(?!\\.)(?=.)[^/]*?\\/b)$/', - '/^(?:a\\/(?=.)\\.[^/]*?\\/b)$/', - '/^(?:(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\/b\\))$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?=.)\\[(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)\\[(?=.)#a[^/]*?)$/', - '/^(?:(?=.)\\+\\(a\\|[^/]*?\\|c\\\\\\\\\\|d\\\\\\\\\\|e\\\\\\\\\\\\\\\\\\|f\\\\\\\\\\\\\\\\\\|g)$/', - '/^(?:(?!\\.)(?=.)(?:a|b)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:a|(?!\\.)(?=.)[^/]*?\\(b\\|c|d\\))$/', - '/^(?:a|(?!\\.)(?=.)(?:b|c)*|(?!\\.)(?=.)(?:b|d)*)$/', - '/^(?:(?!\\.)(?=.)(?:a|b|c)*|(?!\\.)(?=.)(?:a|c)*)$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\(a\\|b\\|c\\)|(?!\\.)(?=.)[^/]*?\\(a\\|c\\))$/', - '/^(?:(?=.)a[^/]b)$/', - '/^(?:(?=.)#[^/]*?)$/', - '/^(?!^(?:(?=.)a[^/]*?)$).*$/', - '/^(?:(?=.)\\!a[^/]*?)$/', - '/^(?:(?=.)a[^/]*?)$/', - '/^(?!^(?:(?=.)\\!a[^/]*?)$).*$/', - '/^(?:(?!\\.)(?=.)[^/]*?\\.(?:(?!js)[^/]*?))$/', - '/^(?:(?:(?!(?:\\/|^)\\.).)*?\\/\\.x\\/(?:(?!(?:\\/|^)\\.).)*?)$/' ] -var re = 0; - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - patterns.forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] || {} - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var m = new mm.Minimatch(pattern, options) - var r = m.makeRe() - var expectRe = regexps[re++] - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - - t.equal(tapOpts.re, expectRe, tapOpts) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js deleted file mode 100644 index c3e19d9baf571b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/brace-expand.js +++ /dev/null @@ -1,38 +0,0 @@ -var tap = require("tap") - , minimatch = require("../") - -tap.test("brace expansion", function (t) { - // [ pattern, [expanded] ] - ; [ [ "a{b,c{d,e},{f,g}h}x{y,z}" - , [ "abxy" - , "abxz" - , "acdxy" - , "acdxz" - , "acexy" - , "acexz" - , "afhxy" - , "afhxz" - , "aghxy" - , "aghxz" ] ] - , [ "a{1..5}b" - , [ "a1b" - , "a2b" - , "a3b" - , "a4b" - , "a5b" ] ] - , [ "a{b}c", ["a{b}c"] ] - , [ "a{00..05}b" - , ["a00b" - ,"a01b" - ,"a02b" - ,"a03b" - ,"a04b" - ,"a05b" ] ] - ].forEach(function (tc) { - var p = tc[0] - , expect = tc[1] - t.equivalent(minimatch.braceExpand(p), expect, p) - }) - console.error("ending") - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js deleted file mode 100644 index 0fec4b0fad0bf8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/caching.js +++ /dev/null @@ -1,14 +0,0 @@ -var Minimatch = require("../minimatch.js").Minimatch -var tap = require("tap") -tap.test("cache test", function (t) { - var mm1 = new Minimatch("a?b") - var mm2 = new Minimatch("a?b") - t.equal(mm1, mm2, "should get the same object") - // the lru should drop it after 100 entries - for (var i = 0; i < 100; i ++) { - new Minimatch("a"+i) - } - mm2 = new Minimatch("a?b") - t.notEqual(mm1, mm2, "cache should have dropped") - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js deleted file mode 100644 index 75e05712d4c841..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/defaults.js +++ /dev/null @@ -1,274 +0,0 @@ -// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test -// -// TODO: Some of these tests do very bad things with backslashes, and will -// most likely fail badly on windows. They should probably be skipped. - -var tap = require("tap") - , globalBefore = Object.keys(global) - , mm = require("../") - , files = [ "a", "b", "c", "d", "abc" - , "abd", "abe", "bb", "bcd" - , "ca", "cb", "dd", "de" - , "bdir/", "bdir/cfile"] - , next = files.concat([ "a-b", "aXb" - , ".x", ".y" ]) - -tap.test("basic tests", function (t) { - var start = Date.now() - - // [ pattern, [matches], MM opts, files, TAP opts] - ; [ "http://www.bashcookbook.com/bashinfo" + - "/source/bash-1.14.7/tests/glob-test" - , ["a*", ["a", "abc", "abd", "abe"]] - , ["X*", ["X*"], {nonull: true}] - - // allow null glob expansion - , ["X*", []] - - // isaacs: Slightly different than bash/sh/ksh - // \\* is not un-escaped to literal "*" in a failed match, - // but it does make it get treated as a literal star - , ["\\*", ["\\*"], {nonull: true}] - , ["\\**", ["\\**"], {nonull: true}] - , ["\\*\\*", ["\\*\\*"], {nonull: true}] - - , ["b*/", ["bdir/"]] - , ["c*", ["c", "ca", "cb"]] - , ["**", files] - - , ["\\.\\./*/", ["\\.\\./*/"], {nonull: true}] - , ["s/\\..*//", ["s/\\..*//"], {nonull: true}] - - , "legendary larry crashes bashes" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"], {nonull: true}] - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/" - , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"], {nonull: true}] - - , "character classes" - , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]] - , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd", - "bdir/", "ca", "cb", "dd", "de"]] - , ["a*[^c]", ["abd", "abe"]] - , function () { files.push("a-b", "aXb") } - , ["a[X-]b", ["a-b", "aXb"]] - , function () { files.push(".x", ".y") } - , ["[^a-c]*", ["d", "dd", "de"]] - , function () { files.push("a*b/", "a*b/ooo") } - , ["a\\*b/*", ["a*b/ooo"]] - , ["a\\*?/*", ["a*b/ooo"]] - , ["*\\\\!*", [], {null: true}, ["echo !7"]] - , ["*\\!*", ["echo !7"], null, ["echo !7"]] - , ["*.\\*", ["r.*"], null, ["r.*"]] - , ["a[b]c", ["abc"]] - , ["a[\\b]c", ["abc"]] - , ["a?c", ["abc"]] - , ["a\\*c", [], {null: true}, ["abc"]] - , ["", [""], { null: true }, [""]] - - , "http://www.opensource.apple.com/source/bash/bash-23/" + - "bash/tests/glob-test" - , function () { files.push("man/", "man/man1/", "man/man1/bash.1") } - , ["*/man*/bash.*", ["man/man1/bash.1"]] - , ["man/man1/bash.1", ["man/man1/bash.1"]] - , ["a***c", ["abc"], null, ["abc"]] - , ["a*****?c", ["abc"], null, ["abc"]] - , ["?*****??", ["abc"], null, ["abc"]] - , ["*****??", ["abc"], null, ["abc"]] - , ["?*****?c", ["abc"], null, ["abc"]] - , ["?***?****c", ["abc"], null, ["abc"]] - , ["?***?****?", ["abc"], null, ["abc"]] - , ["?***?****", ["abc"], null, ["abc"]] - , ["*******c", ["abc"], null, ["abc"]] - , ["*******?", ["abc"], null, ["abc"]] - , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]] - , ["[-abc]", ["-"], null, ["-"]] - , ["[abc-]", ["-"], null, ["-"]] - , ["\\", ["\\"], null, ["\\"]] - , ["[\\\\]", ["\\"], null, ["\\"]] - , ["[[]", ["["], null, ["["]] - , ["[", ["["], null, ["["]] - , ["[*", ["[abc"], null, ["[abc"]] - , "a right bracket shall lose its special meaning and\n" + - "represent itself in a bracket expression if it occurs\n" + - "first in the list. -- POSIX.2 2.8.3.2" - , ["[]]", ["]"], null, ["]"]] - , ["[]-]", ["]"], null, ["]"]] - , ["[a-\z]", ["p"], null, ["p"]] - , ["??**********?****?", [], { null: true }, ["abc"]] - , ["??**********?****c", [], { null: true }, ["abc"]] - , ["?************c****?****", [], { null: true }, ["abc"]] - , ["*c*?**", [], { null: true }, ["abc"]] - , ["a*****c*?**", [], { null: true }, ["abc"]] - , ["a********???*******", [], { null: true }, ["abc"]] - , ["[]", [], { null: true }, ["a"]] - , ["[abc", [], { null: true }, ["["]] - - , "nocase tests" - , ["XYZ", ["xYz"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["ab*", ["ABC"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true } - , ["xYz", "ABC", "IjK"]] - - // [ pattern, [matches], MM opts, files, TAP opts] - , "onestar/twostar" - , ["{/*,*}", [], {null: true}, ["/asdf/asdf/asdf"]] - , ["{/?,*}", ["/a", "bb"], {null: true} - , ["/a", "/b/b", "/a/b/c", "bb"]] - - , "dots should not match unless requested" - , ["**", ["a/b"], {}, ["a/b", "a/.d", ".a/.d"]] - - // .. and . can only match patterns starting with ., - // even when options.dot is set. - , function () { - files = ["a/./b", "a/../b", "a/c/b", "a/.d/b"] - } - , ["a/*/b", ["a/c/b", "a/.d/b"], {dot: true}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: true}] - , ["a/*/b", ["a/c/b"], {dot:false}] - , ["a/.*/b", ["a/./b", "a/../b", "a/.d/b"], {dot: false}] - - - // this also tests that changing the options needs - // to change the cache key, even if the pattern is - // the same! - , ["**", ["a/b","a/.d",".a/.d"], { dot: true } - , [ ".a/.d", "a/.d", "a/b"]] - - , "paren sets cannot contain slashes" - , ["*(a/b)", ["*(a/b)"], {nonull: true}, ["a/b"]] - - // brace sets trump all else. - // - // invalid glob pattern. fails on bash4 and bsdglob. - // however, in this implementation, it's easier just - // to do the intuitive thing, and let brace-expansion - // actually come before parsing any extglob patterns, - // like the documentation seems to say. - // - // XXX: if anyone complains about this, either fix it - // or tell them to grow up and stop complaining. - // - // bash/bsdglob says this: - // , ["*(a|{b),c)}", ["*(a|{b),c)}"], {}, ["a", "ab", "ac", "ad"]] - // but we do this instead: - , ["*(a|{b),c)}", ["a", "ab", "ac"], {}, ["a", "ab", "ac", "ad"]] - - // test partial parsing in the presence of comment/negation chars - , ["[!a*", ["[!ab"], {}, ["[!ab", "[ab"]] - , ["[#a*", ["[#ab"], {}, ["[#ab", "[ab"]] - - // like: {a,b|c\\,d\\\|e} except it's unclosed, so it has to be escaped. - , ["+(a|*\\|c\\\\|d\\\\\\|e\\\\\\\\|f\\\\\\\\\\|g" - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g"] - , {} - , ["+(a|b\\|c\\\\|d\\\\|e\\\\\\\\|f\\\\\\\\|g", "a", "b\\c"]] - - - // crazy nested {,,} and *(||) tests. - , function () { - files = [ "a", "b", "c", "d" - , "ab", "ac", "ad" - , "bc", "cb" - , "bc,d", "c,db", "c,d" - , "d)", "(b|c", "*(b|c" - , "b|c", "b|cc", "cb|c" - , "x(a|b|c)", "x(a|c)" - , "(a|b|c)", "(a|c)"] - } - , ["*(a|{b,c})", ["a", "b", "c", "ab", "ac"]] - , ["{a,*(b|c,d)}", ["a","(b|c", "*(b|c", "d)"]] - // a - // *(b|c) - // *(b|d) - , ["{a,*(b|{c,d})}", ["a","b", "bc", "cb", "c", "d"]] - , ["*(a|{b|c,c})", ["a", "b", "c", "ab", "ac", "bc", "cb"]] - - - // test various flag settings. - , [ "*(a|{b|c,c})", ["x(a|b|c)", "x(a|c)", "(a|b|c)", "(a|c)"] - , { noext: true } ] - , ["a?b", ["x/y/acb", "acb/"], {matchBase: true} - , ["x/y/acb", "acb/", "acb/d/e", "x/y/acb/d"] ] - , ["#*", ["#a", "#b"], {nocomment: true}, ["#a", "#b", "c#d"]] - - - // begin channelling Boole and deMorgan... - , "negation tests" - , function () { - files = ["d", "e", "!ab", "!abc", "a!b", "\\!a"] - } - - // anything that is NOT a* matches. - , ["!a*", ["\\!a", "d", "e", "!ab", "!abc"]] - - // anything that IS !a* matches. - , ["!a*", ["!ab", "!abc"], {nonegate: true}] - - // anything that IS a* matches - , ["!!a*", ["a!b"]] - - // anything that is NOT !a* matches - , ["!\\!a*", ["a!b", "d", "e", "\\!a"]] - - // negation nestled within a pattern - , function () { - files = [ "foo.js" - , "foo.bar" - // can't match this one without negative lookbehind. - , "foo.js.js" - , "blar.js" - , "foo." - , "boo.js.boo" ] - } - , ["*.!(js)", ["foo.bar", "foo.", "boo.js.boo"] ] - - ].forEach(function (c) { - if (typeof c === "function") return c() - if (typeof c === "string") return t.comment(c) - - var pattern = c[0] - , expect = c[1].sort(alpha) - , options = c[2] - , f = c[3] || files - , tapOpts = c[4] || {} - - // options.debug = true - var Class = mm.defaults(options).Minimatch - var m = new Class(pattern, {}) - var r = m.makeRe() - tapOpts.re = String(r) || JSON.stringify(r) - tapOpts.files = JSON.stringify(f) - tapOpts.pattern = pattern - tapOpts.set = m.set - tapOpts.negated = m.negate - - var actual = mm.match(f, pattern, options) - actual.sort(alpha) - - t.equivalent( actual, expect - , JSON.stringify(pattern) + " " + JSON.stringify(expect) - , tapOpts ) - }) - - t.comment("time=" + (Date.now() - start) + "ms") - t.end() -}) - -tap.test("global leak test", function (t) { - var globalAfter = Object.keys(global) - t.equivalent(globalAfter, globalBefore, "no new globals, please") - t.end() -}) - -function alpha (a, b) { - return a > b ? 1 : -1 -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js b/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js deleted file mode 100644 index 6676e2629a7e99..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/minimatch/test/extglob-ending-with-state-char.js +++ /dev/null @@ -1,8 +0,0 @@ -var test = require('tap').test -var minimatch = require('../') - -test('extglob ending with statechar', function(t) { - t.notOk(minimatch('ax', 'a?(b*)')) - t.ok(minimatch('ax', '?(a*|b)')) - t.end() -}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md new file mode 100644 index 00000000000000..f549a1f3de81e3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/CHANGELOG.md @@ -0,0 +1,36 @@ +### v3.1.2 + +* Update to `gauge@1.6.0` adding support for default values for template + items. + +### v3.1.1 + +* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to + when a progress bar is enabled. In `1.x` if you didn't have a TTY the + progress bar was never shown. In `2.x` it merely defaults to disabled, + but you can enable it explicitly if you still want progress updates. + +### v3.1.0 + +* Update to `gauge@2.5.2`: + * Updates the `signal-exit` dependency which fixes an incompatibility with + the node profiler. + * Uses externalizes its ansi code generation in `console-control-strings` +* Make the default progress bar include the last line printed, colored as it + would be when printing to a tty. + +### v3.0.0 + +* Switch to `gauge@2.0.0`, for better performance, better look. +* Set stderr/stdout blocking if they're tty's, so that we can hide a + progress bar going to stderr and then safely print to stdout. Without + this the two can end up overlapping producing confusing and sometimes + corrupted output. + +### v2.0.0 + +* Make the `error` event non-fatal so that folks can use it as a prefix. + +### v1.0.0 + +* Add progress bar with `gauge@1.1.0` diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md index a57cf429d4a6fa..dba35501614e91 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/README.md @@ -98,7 +98,13 @@ Disable the use of unicode in the progress bar. ## log.setGaugeTemplate(template) -Overrides the default gauge template. +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. ## log.pause() @@ -193,3 +199,12 @@ following fields: * `prefix` {String} * `message` {String} Result of `util.format()` * `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js index 8d781f17319084..e5b70f1f80b743 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/log.js @@ -2,49 +2,76 @@ var Progress = require('are-we-there-yet') var Gauge = require('gauge') var EE = require('events').EventEmitter -var log = exports = module.exports = new EE +var log = exports = module.exports = new EE() var util = require('util') -var ansi = require('ansi') -log.cursor = ansi(process.stderr) -log.stream = process.stderr +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) this.gauge.setWriteTo(stream, stream) + }, + get: function () { + return stream + } +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} -// by default, let ansi decide based on tty-ness. -var colorEnabled = undefined log.enableColor = function () { colorEnabled = true - this.cursor.enabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } log.disableColor = function () { colorEnabled = false - this.cursor.enabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) } // default level log.level = 'info' -log.gauge = new Gauge(log.cursor) +log.gauge = new Gauge(stream, { + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''} + ] +}) + log.tracker = new Progress.TrackerGroup() // no progress bars unless asked log.progressEnabled = false -var gaugeTheme = undefined +var unicodeEnabled log.enableUnicode = function () { - gaugeTheme = Gauge.unicode - log.gauge.setTheme(gaugeTheme) + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) } log.disableUnicode = function () { - gaugeTheme = Gauge.ascii - log.gauge.setTheme(gaugeTheme) + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) } -var gaugeTemplate = undefined log.setGaugeTemplate = function (template) { - gaugeTemplate = template - log.gauge.setTemplate(gaugeTemplate) + this.gauge.setTemplate(template) } log.enableProgress = function () { @@ -95,15 +122,26 @@ trackerConstructors.forEach(function (C) { log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } }) -log.clearProgress = function () { - if (!this.progressEnabled) return - this.gauge.hide() +log.clearProgress = function (cb) { + if (!this.progressEnabled) return cb && process.nextTick(cb) + this.gauge.hide(cb) } log.showProgress = function (name, completed) { if (!this.progressEnabled) return - if (completed == null) completed = this.tracker.completed() - this.gauge.show(name, completed) + var values = {} + if (name) values.section = name + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) }.bind(log) // bind for use in tracker's on-change listener // temporarily stop emitting, but don't drop @@ -137,8 +175,8 @@ log.log = function (lvl, prefix, message) { var a = new Array(arguments.length - 2) var stack = null - for (var i = 2; i < arguments.length; i ++) { - var arg = a[i-2] = arguments[i] + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] // resolve stack traces to a plain string. if (typeof arg === 'object' && arg && @@ -181,7 +219,6 @@ log.emitLog = function (m) { if (l < this.levels[this.level]) return if (l > 0 && !isFinite(l)) return - var style = log.style[m.level] var disp = log.disp[m.level] || m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { @@ -198,38 +235,48 @@ log.emitLog = function (m) { this.showProgress() } -log.write = function (msg, style) { - if (!this.cursor) return - if (this.stream !== this.cursor.stream) { - this.cursor = ansi(this.stream, { enabled: colorEnabled }) - var options = {} - if (gaugeTheme != null) options.theme = gaugeTheme - if (gaugeTemplate != null) options.template = gaugeTemplate - this.gauge = new Gauge(options, this.cursor) +log._format = function (msg, style) { + if (!stream) return + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) settings.push(style.fg) + if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + if (style.bold) settings.push('bold') + if (style.underline) settings.push('underline') + if (style.inverse) settings.push('inverse') + if (settings.length) output += consoleControl.color(settings) + if (style.beep) output += consoleControl.beep() } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + return output +} - style = style || {} - if (style.fg) this.cursor.fg[style.fg]() - if (style.bg) this.cursor.bg[style.bg]() - if (style.bold) this.cursor.bold() - if (style.underline) this.cursor.underline() - if (style.inverse) this.cursor.inverse() - if (style.beep) this.cursor.beep() - this.cursor.write(msg).reset() +log.write = function (msg, style) { + if (!stream) return + + stream.write(this._format(msg, style)) } log.addLevel = function (lvl, n, style, disp) { if (!disp) disp = lvl this.levels[lvl] = n this.style[lvl] = style - if (!this[lvl]) this[lvl] = function () { - var a = new Array(arguments.length + 1) - a[0] = lvl - for (var i = 0; i < arguments.length; i ++) { - a[i + 1] = arguments[i] - } - return this.log.apply(this, a) - }.bind(this) + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + } this.disp[lvl] = disp } @@ -248,4 +295,4 @@ log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') log.addLevel('silent', Infinity) // allow 'error' prefix -log.on('error', function(){}) +log.on('error', function () {}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore deleted file mode 100644 index 3c3629e647f5dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md deleted file mode 100644 index aea8aaf0991e70..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/History.md +++ /dev/null @@ -1,23 +0,0 @@ - -0.3.1 / 2016-01-14 -================== - - * add MIT LICENSE file (#23, @kasicka) - * preserve chaining after redundant style-method calls (#19, @drewblaisdell) - * package: add "license" field (#16, @BenjaminTsai) - -0.3.0 / 2014-05-09 -================== - - * package: remove "test" script and "devDependencies" - * package: remove "engines" section - * pacakge: remove "bin" section - * package: beautify - * examples: remove `starwars` example (#15) - * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) - * add `.jshintrc` file - -< 0.3.0 -======= - - * Prehistoric diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE deleted file mode 100644 index 2ea4dc5efb8729..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich - -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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md deleted file mode 100644 index 6ce19403c4c466..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/README.md +++ /dev/null @@ -1,98 +0,0 @@ -ansi.js -========= -### Advanced ANSI formatting tool for Node.js - -`ansi.js` is a module for Node.js that provides an easy-to-use API for -writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to do -fancy things in a terminal window, like render text in colors, delete characters, -lines, the entire window, or hide and show the cursor, and lots more! - -#### Features: - - * 256 color support for the terminal! - * Make a beep sound from your terminal! - * Works with *any* writable `Stream` instance. - * Allows you to move the cursor anywhere on the terminal window. - * Allows you to delete existing contents from the terminal window. - * Allows you to hide and show the cursor. - * Converts CSS color codes and RGB values into ANSI escape codes. - * Low-level; you are in control of when escape codes are used, it's not abstracted. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install ansi -``` - - -Example -------- - -``` js -var ansi = require('ansi') - , cursor = ansi(process.stdout) - -// You can chain your calls forever: -cursor - .red() // Set font color to red - .bg.grey() // Set background color to grey - .write('Hello World!') // Write 'Hello World!' to stdout - .bg.reset() // Reset the bgcolor before writing the trailing \n, - // to avoid Terminal glitches - .write('\n') // And a final \n to wrap things up - -// Rendering modes are persistent: -cursor.hex('#660000').bold().underline() - -// You can use the regular logging functions, text will be green: -console.log('This is blood red, bold text') - -// To reset just the foreground color: -cursor.fg.reset() - -console.log('This will still be bold') - -// to go to a location (x,y) on the console -// note: 1-indexed, not 0-indexed: -cursor.goto(10, 5).write('Five down, ten over') - -// to clear the current line: -cursor.horizontalAbsolute(0).eraseLine().write('Starting again') - -// to go to a different column on the current line: -cursor.horizontalAbsolute(5).write('column five') - -// Clean up after yourself! -cursor.reset() -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js deleted file mode 100755 index c1ec929d0bf8a6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/beep/index.js +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env node - -/** - * Invokes the terminal "beep" sound once per second on every exact second. - */ - -process.title = 'beep' - -var cursor = require('../../')(process.stdout) - -function beep () { - cursor.beep() - setTimeout(beep, 1000 - (new Date()).getMilliseconds()) -} - -setTimeout(beep, 1000 - (new Date()).getMilliseconds()) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js deleted file mode 100755 index 6ac21ffa99f87a..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/clear/index.js +++ /dev/null @@ -1,15 +0,0 @@ -#!/usr/bin/env node - -/** - * Like GNU ncurses "clear" command. - * https://github.com/mscdex/node-ncurses/blob/master/deps/ncurses/progs/clear.c - */ - -process.title = 'clear' - -function lf () { return '\n' } - -require('../../')(process.stdout) - .write(Array.apply(null, Array(process.stdout.getWindowSize()[1])).map(lf).join('')) - .eraseData(2) - .goto(1, 1) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js deleted file mode 100755 index 50f964490ea1ea..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/cursorPosition.js +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env node - -var tty = require('tty') -var cursor = require('../')(process.stdout) - -// listen for the queryPosition report on stdin -process.stdin.resume() -raw(true) - -process.stdin.once('data', function (b) { - var match = /\[(\d+)\;(\d+)R$/.exec(b.toString()) - if (match) { - var xy = match.slice(1, 3).reverse().map(Number) - console.error(xy) - } - - // cleanup and close stdin - raw(false) - process.stdin.pause() -}) - - -// send the query position request code to stdout -cursor.queryPosition() - -function raw (mode) { - if (process.stdin.setRawMode) { - process.stdin.setRawMode(mode) - } else { - tty.setRawMode(mode) - } -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js deleted file mode 100644 index d28dbda27f93d2..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/examples/progress/index.js +++ /dev/null @@ -1,87 +0,0 @@ -#!/usr/bin/env node - -var assert = require('assert') - , ansi = require('../../') - -function Progress (stream, width) { - this.cursor = ansi(stream) - this.delta = this.cursor.newlines - this.width = width | 0 || 10 - this.open = '[' - this.close = ']' - this.complete = '█' - this.incomplete = '_' - - // initial render - this.progress = 0 -} - -Object.defineProperty(Progress.prototype, 'progress', { - get: get - , set: set - , configurable: true - , enumerable: true -}) - -function get () { - return this._progress -} - -function set (v) { - this._progress = Math.max(0, Math.min(v, 100)) - - var w = this.width - this.complete.length - this.incomplete.length - , n = w * (this._progress / 100) | 0 - , i = w - n - , com = c(this.complete, n) - , inc = c(this.incomplete, i) - , delta = this.cursor.newlines - this.delta - - assert.equal(com.length + inc.length, w) - - if (delta > 0) { - this.cursor.up(delta) - this.delta = this.cursor.newlines - } - - this.cursor - .horizontalAbsolute(0) - .eraseLine(2) - .fg.white() - .write(this.open) - .fg.grey() - .bold() - .write(com) - .resetBold() - .write(inc) - .fg.white() - .write(this.close) - .fg.reset() - .write('\n') -} - -function c (char, length) { - return Array.apply(null, Array(length)).map(function () { - return char - }).join('') -} - - - - -// Usage -var width = parseInt(process.argv[2], 10) || process.stdout.getWindowSize()[0] / 2 - , p = new Progress(process.stdout, width) - -;(function tick () { - p.progress += Math.random() * 5 - p.cursor - .eraseLine(2) - .write('Progress: ') - .bold().write(p.progress.toFixed(2)) - .write('%') - .resetBold() - .write('\n') - if (p.progress < 100) - setTimeout(tick, 100) -})() diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js deleted file mode 100644 index b1714e328995c1..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/ansi/lib/ansi.js +++ /dev/null @@ -1,405 +0,0 @@ - -/** - * References: - * - * - http://en.wikipedia.org/wiki/ANSI_escape_code - * - http://www.termsys.demon.co.uk/vtansi.htm - * - */ - -/** - * Module dependencies. - */ - -var emitNewlineEvents = require('./newlines') - , prefix = '\x1b[' // For all escape codes - , suffix = 'm' // Only for color codes - -/** - * The ANSI escape sequences. - */ - -var codes = { - up: 'A' - , down: 'B' - , forward: 'C' - , back: 'D' - , nextLine: 'E' - , previousLine: 'F' - , horizontalAbsolute: 'G' - , eraseData: 'J' - , eraseLine: 'K' - , scrollUp: 'S' - , scrollDown: 'T' - , savePosition: 's' - , restorePosition: 'u' - , queryPosition: '6n' - , hide: '?25l' - , show: '?25h' -} - -/** - * Rendering ANSI codes. - */ - -var styles = { - bold: 1 - , italic: 3 - , underline: 4 - , inverse: 7 -} - -/** - * The negating ANSI code for the rendering modes. - */ - -var reset = { - bold: 22 - , italic: 23 - , underline: 24 - , inverse: 27 -} - -/** - * The standard, styleable ANSI colors. - */ - -var colors = { - white: 37 - , black: 30 - , blue: 34 - , cyan: 36 - , green: 32 - , magenta: 35 - , red: 31 - , yellow: 33 - , grey: 90 - , brightBlack: 90 - , brightRed: 91 - , brightGreen: 92 - , brightYellow: 93 - , brightBlue: 94 - , brightMagenta: 95 - , brightCyan: 96 - , brightWhite: 97 -} - - -/** - * Creates a Cursor instance based off the given `writable stream` instance. - */ - -function ansi (stream, options) { - if (stream._ansicursor) { - return stream._ansicursor - } else { - return stream._ansicursor = new Cursor(stream, options) - } -} -module.exports = exports = ansi - -/** - * The `Cursor` class. - */ - -function Cursor (stream, options) { - if (!(this instanceof Cursor)) { - return new Cursor(stream, options) - } - if (typeof stream != 'object' || typeof stream.write != 'function') { - throw new Error('a valid Stream instance must be passed in') - } - - // the stream to use - this.stream = stream - - // when 'enabled' is false then all the functions are no-ops except for write() - this.enabled = options && options.enabled - if (typeof this.enabled === 'undefined') { - this.enabled = stream.isTTY - } - this.enabled = !!this.enabled - - // then `buffering` is true, then `write()` calls are buffered in - // memory until `flush()` is invoked - this.buffering = !!(options && options.buffering) - this._buffer = [] - - // controls the foreground and background colors - this.fg = this.foreground = new Colorer(this, 0) - this.bg = this.background = new Colorer(this, 10) - - // defaults - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - - // keep track of the number of "newlines" that get encountered - this.newlines = 0 - emitNewlineEvents(stream) - stream.on('newline', function () { - this.newlines++ - }.bind(this)) -} -exports.Cursor = Cursor - -/** - * Helper function that calls `write()` on the underlying Stream. - * Returns `this` instead of the write() return value to keep - * the chaining going. - */ - -Cursor.prototype.write = function (data) { - if (this.buffering) { - this._buffer.push(arguments) - } else { - this.stream.write.apply(this.stream, arguments) - } - return this -} - -/** - * Buffer `write()` calls into memory. - * - * @api public - */ - -Cursor.prototype.buffer = function () { - this.buffering = true - return this -} - -/** - * Write out the in-memory buffer. - * - * @api public - */ - -Cursor.prototype.flush = function () { - this.buffering = false - var str = this._buffer.map(function (args) { - if (args.length != 1) throw new Error('unexpected args length! ' + args.length); - return args[0]; - }).join(''); - this._buffer.splice(0); // empty - this.write(str); - return this -} - - -/** - * The `Colorer` class manages both the background and foreground colors. - */ - -function Colorer (cursor, base) { - this.current = null - this.cursor = cursor - this.base = base -} -exports.Colorer = Colorer - -/** - * Write an ANSI color code, ensuring that the same code doesn't get rewritten. - */ - -Colorer.prototype._setColorCode = function setColorCode (code) { - var c = String(code) - if (this.current === c) return - this.cursor.enabled && this.cursor.write(prefix + c + suffix) - this.current = c - return this -} - - -/** - * Set up the positional ANSI codes. - */ - -Object.keys(codes).forEach(function (name) { - var code = String(codes[name]) - Cursor.prototype[name] = function () { - var c = code - if (arguments.length > 0) { - c = toArray(arguments).map(Math.round).join(';') + code - } - this.enabled && this.write(prefix + c) - return this - } -}) - -/** - * Set up the functions for the rendering ANSI codes. - */ - -Object.keys(styles).forEach(function (style) { - var name = style[0].toUpperCase() + style.substring(1) - , c = styles[style] - , r = reset[style] - - Cursor.prototype[style] = function () { - if (this[name]) return this - this.enabled && this.write(prefix + c + suffix) - this[name] = true - return this - } - - Cursor.prototype['reset' + name] = function () { - if (!this[name]) return this - this.enabled && this.write(prefix + r + suffix) - this[name] = false - return this - } -}) - -/** - * Setup the functions for the standard colors. - */ - -Object.keys(colors).forEach(function (color) { - var code = colors[color] - - Colorer.prototype[color] = function () { - this._setColorCode(this.base + code) - return this.cursor - } - - Cursor.prototype[color] = function () { - return this.foreground[color]() - } -}) - -/** - * Makes a beep sound! - */ - -Cursor.prototype.beep = function () { - this.enabled && this.write('\x07') - return this -} - -/** - * Moves cursor to specific position - */ - -Cursor.prototype.goto = function (x, y) { - x = x | 0 - y = y | 0 - this.enabled && this.write(prefix + y + ';' + x + 'H') - return this -} - -/** - * Resets the color. - */ - -Colorer.prototype.reset = function () { - this._setColorCode(this.base + 39) - return this.cursor -} - -/** - * Resets all ANSI formatting on the stream. - */ - -Cursor.prototype.reset = function () { - this.enabled && this.write(prefix + '0' + suffix) - this.Bold = false - this.Italic = false - this.Underline = false - this.Inverse = false - this.foreground.current = null - this.background.current = null - return this -} - -/** - * Sets the foreground color with the given RGB values. - * The closest match out of the 216 colors is picked. - */ - -Colorer.prototype.rgb = function (r, g, b) { - var base = this.base + 38 - , code = rgb(r, g, b) - this._setColorCode(base + ';5;' + code) - return this.cursor -} - -/** - * Same as `cursor.fg.rgb(r, g, b)`. - */ - -Cursor.prototype.rgb = function (r, g, b) { - return this.foreground.rgb(r, g, b) -} - -/** - * Accepts CSS color codes for use with ANSI escape codes. - * For example: `#FF000` would be bright red. - */ - -Colorer.prototype.hex = function (color) { - return this.rgb.apply(this, hex(color)) -} - -/** - * Same as `cursor.fg.hex(color)`. - */ - -Cursor.prototype.hex = function (color) { - return this.foreground.hex(color) -} - - -// UTIL FUNCTIONS // - -/** - * Translates a 255 RGB value to a 0-5 ANSI RGV value, - * then returns the single ANSI color code to use. - */ - -function rgb (r, g, b) { - var red = r / 255 * 5 - , green = g / 255 * 5 - , blue = b / 255 * 5 - return rgb5(red, green, blue) -} - -/** - * Turns rgb 0-5 values into a single ANSI color code to use. - */ - -function rgb5 (r, g, b) { - var red = Math.round(r) - , green = Math.round(g) - , blue = Math.round(b) - return 16 + (red*36) + (green*6) + blue -} - -/** - * Accepts a hex CSS color code string (# is optional) and - * translates it into an Array of 3 RGB 0-255 values, which - * can then be used with rgb(). - */ - -function hex (color) { - var c = color[0] === '#' ? color.substring(1) : color - , r = c.substring(0, 2) - , g = c.substring(2, 4) - , b = c.substring(4, 6) - return [parseInt(r, 16), parseInt(g, 16), parseInt(b, 16)] -} - -/** - * Turns an array-like object into a real array. - */ - -function toArray (a) { - var i = 0 - , l = a.length - , rtn = [] - for (; i 0) { - var len = data.length - , i = 0 - // now try to calculate any deltas - if (typeof data == 'string') { - for (; i=0.3.1 <0.4.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/npmlog" - ], - [ - { - "name": "ansi", - "raw": "ansi@~0.3.1", - "rawSpec": "~0.3.1", - "scope": null, - "spec": ">=0.3.1 <0.4.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" - ] - ], - "_from": "ansi@~0.3.1", - "_id": "ansi@0.3.1", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/ansi", - "_nodeVersion": "5.3.0", - "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "ansi", - "raw": "ansi@~0.3.1", - "rawSpec": "~0.3.1", - "scope": null, - "spec": ">=0.3.1 <0.4.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog", - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz", - "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", - "_shrinkwrap": null, - "_spec": "ansi@~0.3.1", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", - "author": { - "email": "nathan@tootallnate.net", - "name": "Nathan Rajlich", - "url": "http://tootallnate.net" - }, - "bugs": { - "url": "https://github.com/TooTallNate/ansi.js/issues" - }, - "dependencies": {}, - "description": "Advanced ANSI formatting tool for Node.js", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21", - "tarball": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz" - }, - "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246", - "homepage": "https://github.com/TooTallNate/ansi.js#readme", - "keywords": [ - "ansi", - "formatting", - "cursor", - "color", - "terminal", - "rgb", - "256", - "stream" - ], - "license": "MIT", - "main": "./lib/ansi.js", - "maintainers": [ - { - "email": "nathan@tootallnate.net", - "name": "TooTallNate" - }, - { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - } - ], - "name": "ansi", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/ansi.js.git" - }, - "scripts": {}, - "version": "0.3.1" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md index f8789800aa784c..c41d39229244d2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json index 502a040eda0f2e..6a5ea8189c5f6f 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -2,44 +2,46 @@ "_args": [ [ { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" ], [ { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet" ] ], "_from": "delegates@^1.0.0", "_id": "delegates@1.0.0", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/are-we-there-yet/delegates", "_nodeVersion": "4.2.1", "_npmUser": { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "delegates", "raw": "delegates@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -50,7 +52,7 @@ "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", "_shrinkwrap": null, "_spec": "delegates@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet", "bugs": { "url": "https://github.com/visionmedia/node-delegates/issues" }, @@ -74,12 +76,12 @@ "license": "MIT", "maintainers": [ { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" }, { - "email": "dominic@dbarnes.info", - "name": "dominicbarnes" + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" } ], "name": "delegates", diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json index bab98d6812a80a..66ca32888b025e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -2,31 +2,32 @@ "_args": [ [ { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/npmlog" ], [ { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" ] ], "_from": "are-we-there-yet@~1.1.2", "_id": "are-we-there-yet@1.1.2", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/are-we-there-yet", "_nodeVersion": "4.2.2", "_npmOperationalInternal": { @@ -34,16 +35,17 @@ "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, "_npmVersion": "3.8.1", "_phantomChildren": {}, "_requested": { - "name": "are-we-there-yet", "raw": "are-we-there-yet@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, @@ -54,7 +56,7 @@ "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", "_shrinkwrap": null, "_spec": "are-we-there-yet@~1.1.2", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", "author": { "name": "Rebecca Turner", "url": "http://re-becca.org" @@ -82,8 +84,8 @@ "main": "index.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" } ], "name": "are-we-there-yet", diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE new file mode 100644 index 00000000000000..e756052969b780 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md new file mode 100644 index 00000000000000..f58cc8d8925060 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js new file mode 100644 index 00000000000000..bf890348ec6e35 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json new file mode 100644 index 00000000000000..581b0eb4d48f94 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/console-control-strings/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" + ] + ], + "_from": "console-control-strings@~1.1.0", + "_id": "console-control-strings@1.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/console-control-strings", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/console-control-strings-1.1.0.tgz_1466033396831_0.9470485949423164" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog", + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_shrinkwrap": null, + "_spec": "console-control-strings@~1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "dependencies": {}, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "tarball": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + }, + "files": [ + "LICENSE", + "index.js" + ], + "gitHead": "722439b4998d2964ac3d3f9ec175c008aa9b7b4b", + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "console-control-strings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore deleted file mode 100644 index df22a16c635a02..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/.npmignore +++ /dev/null @@ -1,32 +0,0 @@ -# Logs -logs -*.log - -# Runtime data -pids -*.pid -*.seed - -# Directory for instrumented libs generated by jscoverage/JSCover -lib-cov - -# Coverage directory used by tools like istanbul -coverage - -# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) -.grunt - -# Compiled binary addons (http://nodejs.org/api/addons.html) -build/Release - -# Dependency directory -# Commenting this out is preferred by some people, see -# https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git- -node_modules - -# Users Environment Variables -.lock-wscript - -# Editor cruft -*~ -.#* diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md new file mode 100644 index 00000000000000..efd08fc7c19dd7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/CHANGELOG.md @@ -0,0 +1,131 @@ +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md index 337dc9d8d45e14..bf87d189f1b5c1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/README.md @@ -15,138 +15,330 @@ gauge.pulse("this") gauge.hide() ``` -![](example.png) +![](gauge-demo.gif) -### `var gauge = new Gauge([options], [ansiStream])` +### CHANGES FROM 1.x -* **options** – *(optional)* An option object. (See [below] for details.) -* **ansiStream** – *(optional)* A stream that's been blessed by the [ansi] - module to include various commands for controlling the cursor in a terminal. +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. -[ansi]: https://www.npmjs.com/package/ansi -[below]: #theme-objects +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. Constructs a new gauge. Gauges are drawn on a single line, and are not drawn -if the current terminal isn't a tty. +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. -If you resize your terminal in a way that can be detected then the gauge -will be drawn at the new size. As a general rule, growing your terminal will -be clean, but shrinking your terminal will result in cruft as we don't have -enough information to know where what we wrote previously is now located. +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. The **options** object can have the following properties, all of which are optional: -* maxUpdateFrequency: defaults to 50 msec, the gauge will not be drawn more - than once in this period of time. This applies to `show` and `pulse` - calls, but if you `hide` and then `show` the gauge it will draw it - regardless of time since last draw. -* theme: defaults to Gauge.unicode` if the terminal supports - unicode according to [has-unicode], otherwise it defaults to `Gauge.ascii`. - Details on the [theme object](#theme-objects) are documented elsewhere. -* template: see [documentation elsewhere](#template-objects) for - defaults and details. +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. [has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates -If **ansiStream** isn't passed in, then one will be constructed from stderr -with `ansi(process.stderr)`. +#### `gauge.show(section | status, [completed])` -### `gauge.show([name, [completed]])` +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. -* **name** – *(optional)* The name of the current thing contributing to progress. Defaults to the last value used, or "". -* **completed** – *(optional)* The portion completed as a value between 0 and 1. Defaults to the last value used, or 0. +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. -If `process.stdout.isTTY` is false then this does nothing. If completed is 0 -and `gauge.pulse` has never been called, then similarly nothing will be printed. +#### `gauge.hide([cb])` -If `maxUpdateFrequency` msec haven't passed since the last call to `show` or -`pulse` then similarly, nothing will be printed. (Actually, the update is -deferred until `maxUpdateFrequency` msec have passed and if nothing else has -happened, the gauge update will happen.) +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) -### `gauge.hide()` +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. -Removes the gauge from the terminal. +#### `gauge.pulse([subsection])` -### `gauge.pulse([name])` +* **subsection** – *(optional)* The specific thing that triggered this pulse -* **name** – *(optional)* The specific thing that triggered this pulse +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. -Spins the spinner in the gauge to show output. If **name** is included then -it will be combined with the last name passed to `gauge.show` using the -subsection property of the theme (typically a right facing arrow). - -### `gauge.disable()` +#### `gauge.disable()` Hides the gauge and ignores further calls to `show` or `pulse`. -### `gauge.enable()` +#### `gauge.enable()` Shows the gauge and resumes updating when `show` or `pulse` is called. -### `gauge.setTheme(theme)` +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. -Change the active theme, will be displayed with the next show or pulse +#### `gauge.setTheme(theme)` -### `gauge.setTemplate(template)` +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` Change the active template, will be displayed with the next show or pulse -### Theme Objects +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() -There are two theme objects available as a part of the module, `Gauge.unicode` and `Gauge.ascii`. -Theme objects have the follow properties: +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. -| Property | Unicode | ASCII | -| ---------- | ------- | ----- | -| startgroup | ╢ | \| | -| endgroup | ╟ | \| | -| complete | █ | # | -| incomplete | ░ | - | -| spinner | ▀▐▄▌ | -\\\|/ | -| subsection | → | -> | +#### themes.getTheme(name) -*startgroup*, *endgroup* and *subsection* can be as many characters as you want. +Returns the theme object from this theme set named `name`. -*complete* and *incomplete* should be a single character width each. +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. -*spinner* is a list of characters to use in turn when displaying an activity -spinner. The Gauge will spin as many characters as you give here. +#### themes.setDefault([opts], themeName) -### Template Objects +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES A template is an array of objects and strings that, after being evaluated, will be turned into the gauge line. The default template is: ```javascript [ - {type: "name", separated: true, maxLength: 25, minLength: 25, align: "left"}, - {type: "spinner", separated: true}, - {type: "startgroup"}, - {type: "completionbar"}, - {type: "endgroup"} + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} ] ``` The various template elements can either be **plain strings**, in which case they will -be be included verbatum in the output. - -If the template element is an object, it can have the following keys: - -* *type* can be: - * `name` – The most recent name passed to `show`; if this is in response to a - `pulse` then the name passed to `pulse` will be appended along with the - subsection property from the theme. - * `spinner` – If you've ever called `pulse` this will be one of the characters - from the spinner property of the theme. - * `startgroup` – The `startgroup` property from the theme. - * `completionbar` – This progress bar itself - * `endgroup` – The `endgroup` property from the theme. -* *separated* – If true, the element will be separated with spaces from things on - either side (and margins count as space, so it won't be indented), but only - if its included. +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. * *maxLength* – The maximum length for this element. If its value is longer it will be truncated. * *minLength* – The minimum length for this element. If its value is shorter it @@ -155,12 +347,49 @@ If the template element is an object, it can have the following keys: as you'd expect from word processors. * *length* – Provides a single value for both *minLength* and *maxLength*. If both *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. -### Tracking Completion +### PLUMBING -If you have more than one thing going on that you want to track completion -of, you may find the related [are-we-there-yet] helpful. It's `change` -event can be wired up to the `show` method to get a more traditional -progress bar interface. +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. -[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js new file mode 100644 index 00000000000000..0b67638e0211d0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js new file mode 100644 index 00000000000000..d9914ba5335d25 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png deleted file mode 100644 index 2667cac459e177..00000000000000 Binary files a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/example.png and /dev/null differ diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/has-color.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/has-color.js new file mode 100644 index 00000000000000..e283a256f26b74 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/has-color.js @@ -0,0 +1,12 @@ +'use strict' + +module.exports = isWin32() || isColorTerm() + +function isWin32 () { + return process.platform === 'win32' +} + +function isColorTerm () { + var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i + return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/index.js new file mode 100644 index 00000000000000..7eefb9507bb47e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/index.js @@ -0,0 +1,226 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + if (options.cleanupOnExit == null || options.cleanupOnExit) { + onExit(callWith(this, this.disable)) + } + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } else if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + if (this._disabled) return + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + if (this._disabled) return + if (!this._showing) return + this._status.subsection = subsection || '' + this._status.spun ++ + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js new file mode 100644 index 00000000000000..092d0baef6698e --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js @@ -0,0 +1,32 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json new file mode 100644 index 00000000000000..7ca2bd4e108122 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "has-color@^0.1.7", + "_id": "has-color@0.1.7", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/has-color", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "_shrinkwrap": null, + "_spec": "has-color@^0.1.7", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "tarball": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "has-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.7" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md new file mode 100644 index 00000000000000..37bbd8991a6423 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md @@ -0,0 +1,30 @@ +# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +```bash +$ npm install --save has-color +``` + + +## Usage + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + + +## License + +[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md deleted file mode 100644 index 57fb585913f433..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.pad v4.4.0 - -The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.pad -``` - -In Node.js: -```js -var pad = require('lodash.pad'); -``` - -See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/4.4.0-npm-packages/lodash.pad) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js deleted file mode 100644 index 876fbb967490ae..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js +++ /dev/null @@ -1,434 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the left and right sides if it's shorter than `length`. - * Padding characters are truncated if they can't be evenly divided by `length`. - * - * @static - * @memberOf _ - * @since 3.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.pad('abc', 8); - * // => ' abc ' - * - * _.pad('abc', 8, '_-'); - * // => '_-abc_-_' - * - * _.pad('abc', 3); - * // => 'abc' - */ -function pad(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - if (!length || strLength >= length) { - return string; - } - var mid = (length - strLength) / 2; - return ( - createPadding(nativeFloor(mid), chars) + - string + - createPadding(nativeCeil(mid), chars) - ); -} - -module.exports = pad; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE deleted file mode 100644 index b054ca5a3ac7d6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json deleted file mode 100644 index 3be3e7b990dce3..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash._baseslice@>=4.0.0 <4.1.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json deleted file mode 100644 index afe25bfc79986b..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,108 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash._basetostring@>=4.12.0 <4.13.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json deleted file mode 100644 index 9b829d126b64f8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,112 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ] - ], - "_from": "lodash.tostring@>=4.0.0 <5.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.pad" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json deleted file mode 100644 index 077525ba2a9737..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.pad", - "raw": "lodash.pad@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.pad@>=4.1.0 <5.0.0", - "_id": "lodash.pad@4.4.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.pad", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.pad-4.4.0.tgz_1463062450475_0.3613762252498418" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.pad", - "raw": "lodash.pad@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz", - "_shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", - "_shrinkwrap": null, - "_spec": "lodash.pad@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.pad` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "faa38df26c0a69ec5086a82246c958e150dcb1ab", - "tarball": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-4.4.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "pad" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash.pad", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.4.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md deleted file mode 100644 index 909eef8f2215ef..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.padend v4.5.0 - -The [lodash](https://lodash.com/) method `_.padEnd` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padend -``` - -In Node.js: -```js -var padEnd = require('lodash.padend'); -``` - -See the [documentation](https://lodash.com/docs#padEnd) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padend) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js deleted file mode 100644 index 5af50372e338dd..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/index.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the right side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padEnd('abc', 6); - * // => 'abc ' - * - * _.padEnd('abc', 6, '_-'); - * // => 'abc_-_' - * - * _.padEnd('abc', 3); - * // => 'abc' - */ -function padEnd(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (string + createPadding(length - strLength, chars)) - : string; -} - -module.exports = padEnd; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE deleted file mode 100644 index b054ca5a3ac7d6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json deleted file mode 100644 index 69dbad217da375..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash._baseslice@~4.0.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json deleted file mode 100644 index 11810e229268cb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash._basetostring@~4.12.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json deleted file mode 100644 index 176ced6107ecca..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend" - ] - ], - "_from": "lodash.tostring@^4.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padend" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json deleted file mode 100644 index e00e08add68262..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padend/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.padend", - "raw": "lodash.padend@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.padend@>=4.1.0 <5.0.0", - "_id": "lodash.padend@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padend", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.padend-4.5.0.tgz_1463062451966_0.5034168094862252" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.padend", - "raw": "lodash.padend@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz", - "_shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", - "_shrinkwrap": null, - "_spec": "lodash.padend@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.padEnd` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "a289e9377ee2e6de8ba7f11f3a8eb326070b7619", - "tarball": "https://registry.npmjs.org/lodash.padend/-/lodash.padend-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "padend" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.padend", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md deleted file mode 100644 index bcc1c5aa6710e0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.padstart v4.5.0 - -The [lodash](https://lodash.com/) method `_.padStart` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.padstart -``` - -In Node.js: -```js -var padStart = require('lodash.padstart'); -``` - -See the [documentation](https://lodash.com/docs#padStart) or [package source](https://github.com/lodash/lodash/blob/4.5.0-npm-packages/lodash.padstart) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js deleted file mode 100644 index 456889536633cb..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/index.js +++ /dev/null @@ -1,428 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ -var baseSlice = require('lodash._baseslice'), - baseToString = require('lodash._basetostring'), - toString = require('lodash.tostring'); - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0, - MAX_SAFE_INTEGER = 9007199254740991, - MAX_INTEGER = 1.7976931348623157e+308, - NAN = 0 / 0; - -/** `Object#toString` result references. */ -var funcTag = '[object Function]', - genTag = '[object GeneratorFunction]', - symbolTag = '[object Symbol]'; - -/** Used to match leading and trailing whitespace. */ -var reTrim = /^\s+|\s+$/g; - -/** Used to detect bad signed hexadecimal string values. */ -var reIsBadHex = /^[-+]0x[0-9a-f]+$/i; - -/** Used to detect binary string values. */ -var reIsBinary = /^0b[01]+$/i; - -/** Used to detect octal string values. */ -var reIsOctal = /^0o[0-7]+$/i; - -/** Used to compose unicode character classes. */ -var rsAstralRange = '\\ud800-\\udfff', - rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23', - rsComboSymbolsRange = '\\u20d0-\\u20f0', - rsVarRange = '\\ufe0e\\ufe0f'; - -/** Used to compose unicode capture groups. */ -var rsAstral = '[' + rsAstralRange + ']', - rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']', - rsFitz = '\\ud83c[\\udffb-\\udfff]', - rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')', - rsNonAstral = '[^' + rsAstralRange + ']', - rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}', - rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]', - rsZWJ = '\\u200d'; - -/** Used to compose unicode regexes. */ -var reOptMod = rsModifier + '?', - rsOptVar = '[' + rsVarRange + ']?', - rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*', - rsSeq = rsOptVar + reOptMod + rsOptJoin, - rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')'; - -/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */ -var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g'); - -/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */ -var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']'); - -/** Built-in method references without a dependency on `root`. */ -var freeParseInt = parseInt; - -/** - * Gets the number of symbols in `string`. - * - * @private - * @param {string} string The string to inspect. - * @returns {number} Returns the string size. - */ -function stringSize(string) { - if (!(string && reHasComplexSymbol.test(string))) { - return string.length; - } - var result = reComplexSymbol.lastIndex = 0; - while (reComplexSymbol.test(string)) { - result++; - } - return result; -} - -/** - * Converts `string` to an array. - * - * @private - * @param {string} string The string to convert. - * @returns {Array} Returns the converted array. - */ -function stringToArray(string) { - return string.match(reComplexSymbol); -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/* Built-in method references for those with the same name as other `lodash` methods. */ -var nativeCeil = Math.ceil, - nativeFloor = Math.floor; - -/** - * The base implementation of `_.repeat` which doesn't coerce arguments. - * - * @private - * @param {string} string The string to repeat. - * @param {number} n The number of times to repeat the string. - * @returns {string} Returns the repeated string. - */ -function baseRepeat(string, n) { - var result = ''; - if (!string || n < 1 || n > MAX_SAFE_INTEGER) { - return result; - } - // Leverage the exponentiation by squaring algorithm for a faster repeat. - // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details. - do { - if (n % 2) { - result += string; - } - n = nativeFloor(n / 2); - if (n) { - string += string; - } - } while (n); - - return result; -} - -/** - * Casts `array` to a slice if it's needed. - * - * @private - * @param {Array} array The array to inspect. - * @param {number} start The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the cast slice. - */ -function castSlice(array, start, end) { - var length = array.length; - end = end === undefined ? length : end; - return (!start && end >= length) ? array : baseSlice(array, start, end); -} - -/** - * Creates the padding for `string` based on `length`. The `chars` string - * is truncated if the number of characters exceeds `length`. - * - * @private - * @param {number} length The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padding for `string`. - */ -function createPadding(length, chars) { - chars = chars === undefined ? ' ' : baseToString(chars); - - var charsLength = chars.length; - if (charsLength < 2) { - return charsLength ? baseRepeat(chars, length) : chars; - } - var result = baseRepeat(chars, nativeCeil(length / stringSize(chars))); - return reHasComplexSymbol.test(chars) - ? castSlice(stringToArray(result), 0, length).join('') - : result.slice(0, length); -} - -/** - * Checks if `value` is classified as a `Function` object. - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isFunction(_); - * // => true - * - * _.isFunction(/abc/); - * // => false - */ -function isFunction(value) { - // The use of `Object#toString` avoids issues with the `typeof` operator - // in Safari 8 which returns 'object' for typed array and weak map constructors, - // and PhantomJS 1.9 which returns 'function' for `NodeList` instances. - var tag = isObject(value) ? objectToString.call(value) : ''; - return tag == funcTag || tag == genTag; -} - -/** - * Checks if `value` is the - * [language type](http://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types) - * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`) - * - * @static - * @memberOf _ - * @since 0.1.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is an object, else `false`. - * @example - * - * _.isObject({}); - * // => true - * - * _.isObject([1, 2, 3]); - * // => true - * - * _.isObject(_.noop); - * // => true - * - * _.isObject(null); - * // => false - */ -function isObject(value) { - var type = typeof value; - return !!value && (type == 'object' || type == 'function'); -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a finite number. - * - * @static - * @memberOf _ - * @since 4.12.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted number. - * @example - * - * _.toFinite(3.2); - * // => 3.2 - * - * _.toFinite(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toFinite(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toFinite('3.2'); - * // => 3.2 - */ -function toFinite(value) { - if (!value) { - return value === 0 ? value : 0; - } - value = toNumber(value); - if (value === INFINITY || value === -INFINITY) { - var sign = (value < 0 ? -1 : 1); - return sign * MAX_INTEGER; - } - return value === value ? value : 0; -} - -/** - * Converts `value` to an integer. - * - * **Note:** This function is loosely based on - * [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger). - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to convert. - * @returns {number} Returns the converted integer. - * @example - * - * _.toInteger(3.2); - * // => 3 - * - * _.toInteger(Number.MIN_VALUE); - * // => 0 - * - * _.toInteger(Infinity); - * // => 1.7976931348623157e+308 - * - * _.toInteger('3.2'); - * // => 3 - */ -function toInteger(value) { - var result = toFinite(value), - remainder = result % 1; - - return result === result ? (remainder ? result - remainder : result) : 0; -} - -/** - * Converts `value` to a number. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {number} Returns the number. - * @example - * - * _.toNumber(3.2); - * // => 3.2 - * - * _.toNumber(Number.MIN_VALUE); - * // => 5e-324 - * - * _.toNumber(Infinity); - * // => Infinity - * - * _.toNumber('3.2'); - * // => 3.2 - */ -function toNumber(value) { - if (typeof value == 'number') { - return value; - } - if (isSymbol(value)) { - return NAN; - } - if (isObject(value)) { - var other = isFunction(value.valueOf) ? value.valueOf() : value; - value = isObject(other) ? (other + '') : other; - } - if (typeof value != 'string') { - return value === 0 ? value : +value; - } - value = value.replace(reTrim, ''); - var isBinary = reIsBinary.test(value); - return (isBinary || reIsOctal.test(value)) - ? freeParseInt(value.slice(2), isBinary ? 2 : 8) - : (reIsBadHex.test(value) ? NAN : +value); -} - -/** - * Pads `string` on the left side if it's shorter than `length`. Padding - * characters are truncated if they exceed `length`. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category String - * @param {string} [string=''] The string to pad. - * @param {number} [length=0] The padding length. - * @param {string} [chars=' '] The string used as padding. - * @returns {string} Returns the padded string. - * @example - * - * _.padStart('abc', 6); - * // => ' abc' - * - * _.padStart('abc', 6, '_-'); - * // => '_-_abc' - * - * _.padStart('abc', 3); - * // => 'abc' - */ -function padStart(string, length, chars) { - string = toString(string); - length = toInteger(length); - - var strLength = length ? stringSize(string) : 0; - return (length && strLength < length) - ? (createPadding(length - strLength, chars) + string) - : string; -} - -module.exports = padStart; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE deleted file mode 100644 index b054ca5a3ac7d6..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/LICENSE +++ /dev/null @@ -1,22 +0,0 @@ -Copyright 2012-2016 The Dojo Foundation -Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -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/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md deleted file mode 100644 index 8cd4181ccdc00d..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._baseslice v4.0.0 - -The internal [lodash](https://lodash.com/) function `baseSlice` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._baseslice -``` - -In Node.js: -```js -var baseSlice = require('lodash._baseslice'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.0.0-npm-packages/lodash._baseslice) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js deleted file mode 100644 index 59293c3d0037a8..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/index.js +++ /dev/null @@ -1,40 +0,0 @@ -/** - * lodash 4.0.0 (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright 2012-2016 The Dojo Foundation - * Based on Underscore.js 1.8.3 - * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - * Available under MIT license - */ - -/** - * The base implementation of `_.slice` without an iteratee call guard. - * - * @private - * @param {Array} array The array to slice. - * @param {number} [start=0] The start position. - * @param {number} [end=array.length] The end position. - * @returns {Array} Returns the slice of `array`. - */ -function baseSlice(array, start, end) { - var index = -1, - length = array.length; - - if (start < 0) { - start = -start > length ? 0 : (length + start); - } - end = end > length ? length : end; - if (end < 0) { - end += length; - } - length = start > end ? 0 : ((end - start) >>> 0); - start >>>= 0; - - var result = Array(length); - while (++index < length) { - result[index] = array[index + start]; - } - return result; -} - -module.exports = baseSlice; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json deleted file mode 100644 index bf0bf651135204..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._baseslice/package.json +++ /dev/null @@ -1,115 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash._baseslice@~4.0.0", - "_id": "lodash._baseslice@4.0.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash._baseslice", - "_nodeVersion": "5.4.0", - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.14.15", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._baseslice", - "raw": "lodash._baseslice@~4.0.0", - "rawSpec": "~4.0.0", - "scope": null, - "spec": ">=4.0.0 <4.1.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz", - "_shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "_shrinkwrap": null, - "_spec": "lodash._baseslice@~4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine@iceddev.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseSlice` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "f5ce1df982948ecaff63f223853415b7b9763704", - "tarball": "https://registry.npmjs.org/lodash._baseslice/-/lodash._baseslice-4.0.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._baseslice", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.0.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md deleted file mode 100644 index ba060c94dadea0..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash._basetostring v4.12.0 - -The internal [lodash](https://lodash.com/) function `baseToString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash._basetostring -``` - -In Node.js: -```js -var baseToString = require('lodash._basetostring'); -``` - -See the [package source](https://github.com/lodash/lodash/blob/4.12.0-npm-packages/lodash._basetostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js deleted file mode 100644 index d5848107499c34..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/index.js +++ /dev/null @@ -1,153 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -module.exports = baseToString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json deleted file mode 100644 index 1c42ea67ec4288..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash._basetostring/package.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash._basetostring@~4.12.0", - "_id": "lodash._basetostring@4.12.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash._basetostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash._basetostring-4.12.0.tgz_1463062033665_0.6722894972190261" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash._basetostring", - "raw": "lodash._basetostring@~4.12.0", - "rawSpec": "~4.12.0", - "scope": null, - "spec": ">=4.12.0 <4.13.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz", - "_shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "_shrinkwrap": null, - "_spec": "lodash._basetostring@~4.12.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The internal lodash function `baseToString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "9327c9dc5158866b7fa4b9d42f4638e5766dd9df", - "tarball": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-4.12.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine@iceddev.com", - "name": "phated" - } - ], - "name": "lodash._basetostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.12.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE deleted file mode 100644 index e0c69d56032d15..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/LICENSE +++ /dev/null @@ -1,47 +0,0 @@ -Copyright jQuery Foundation and other contributors - -Based on Underscore.js, copyright Jeremy Ashkenas, -DocumentCloud and Investigative Reporters & Editors - -This software consists of voluntary contributions made by many -individuals. For exact contribution history, see the revision history -available at https://github.com/lodash/lodash - -The following license applies to all parts of this software except as -documented below: - -==== - -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. - -==== - -Copyright and related rights for sample code are waived via CC0. Sample -code is defined as all source code displayed within the prose of the -documentation. - -CC0: http://creativecommons.org/publicdomain/zero/1.0/ - -==== - -Files located in the node_modules and vendor directories are externally -maintained libraries used by this software which have their own -licenses; we recommend you read them, as their terms may differ from the -terms above. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md deleted file mode 100644 index 75aa6b0699b4df..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/README.md +++ /dev/null @@ -1,18 +0,0 @@ -# lodash.tostring v4.1.3 - -The [lodash](https://lodash.com/) method `_.toString` exported as a [Node.js](https://nodejs.org/) module. - -## Installation - -Using npm: -```bash -$ {sudo -H} npm i -g npm -$ npm i --save lodash.tostring -``` - -In Node.js: -```js -var toString = require('lodash.tostring'); -``` - -See the [documentation](https://lodash.com/docs#toString) or [package source](https://github.com/lodash/lodash/blob/4.1.3-npm-packages/lodash.tostring) for more details. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js deleted file mode 100644 index 8a2cde39290e82..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/index.js +++ /dev/null @@ -1,178 +0,0 @@ -/** - * lodash (Custom Build) - * Build: `lodash modularize exports="npm" -o ./` - * Copyright jQuery Foundation and other contributors - * Released under MIT license - * Based on Underscore.js 1.8.3 - * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */ - -/** Used as references for various `Number` constants. */ -var INFINITY = 1 / 0; - -/** `Object#toString` result references. */ -var symbolTag = '[object Symbol]'; - -/** Used to determine if values are of the language type `Object`. */ -var objectTypes = { - 'function': true, - 'object': true -}; - -/** Detect free variable `exports`. */ -var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) - ? exports - : undefined; - -/** Detect free variable `module`. */ -var freeModule = (objectTypes[typeof module] && module && !module.nodeType) - ? module - : undefined; - -/** Detect free variable `global` from Node.js. */ -var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global); - -/** Detect free variable `self`. */ -var freeSelf = checkGlobal(objectTypes[typeof self] && self); - -/** Detect free variable `window`. */ -var freeWindow = checkGlobal(objectTypes[typeof window] && window); - -/** Detect `this` as the global object. */ -var thisGlobal = checkGlobal(objectTypes[typeof this] && this); - -/** - * Used as a reference to the global object. - * - * The `this` value is used if it's the global object to avoid Greasemonkey's - * restricted `window` object, otherwise the `window` object is used. - */ -var root = freeGlobal || - ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || - freeSelf || thisGlobal || Function('return this')(); - -/** - * Checks if `value` is a global object. - * - * @private - * @param {*} value The value to check. - * @returns {null|Object} Returns `value` if it's a global object, else `null`. - */ -function checkGlobal(value) { - return (value && value.Object === Object) ? value : null; -} - -/** Used for built-in method references. */ -var objectProto = Object.prototype; - -/** - * Used to resolve the - * [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring) - * of values. - */ -var objectToString = objectProto.toString; - -/** Built-in value references. */ -var Symbol = root.Symbol; - -/** Used to convert symbols to primitives and strings. */ -var symbolProto = Symbol ? Symbol.prototype : undefined, - symbolToString = symbolProto ? symbolProto.toString : undefined; - -/** - * The base implementation of `_.toString` which doesn't convert nullish - * values to empty strings. - * - * @private - * @param {*} value The value to process. - * @returns {string} Returns the string. - */ -function baseToString(value) { - // Exit early for strings to avoid a performance hit in some environments. - if (typeof value == 'string') { - return value; - } - if (isSymbol(value)) { - return symbolToString ? symbolToString.call(value) : ''; - } - var result = (value + ''); - return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result; -} - -/** - * Checks if `value` is object-like. A value is object-like if it's not `null` - * and has a `typeof` result of "object". - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is object-like, else `false`. - * @example - * - * _.isObjectLike({}); - * // => true - * - * _.isObjectLike([1, 2, 3]); - * // => true - * - * _.isObjectLike(_.noop); - * // => false - * - * _.isObjectLike(null); - * // => false - */ -function isObjectLike(value) { - return !!value && typeof value == 'object'; -} - -/** - * Checks if `value` is classified as a `Symbol` primitive or object. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to check. - * @returns {boolean} Returns `true` if `value` is correctly classified, - * else `false`. - * @example - * - * _.isSymbol(Symbol.iterator); - * // => true - * - * _.isSymbol('abc'); - * // => false - */ -function isSymbol(value) { - return typeof value == 'symbol' || - (isObjectLike(value) && objectToString.call(value) == symbolTag); -} - -/** - * Converts `value` to a string. An empty string is returned for `null` - * and `undefined` values. The sign of `-0` is preserved. - * - * @static - * @memberOf _ - * @since 4.0.0 - * @category Lang - * @param {*} value The value to process. - * @returns {string} Returns the string. - * @example - * - * _.toString(null); - * // => '' - * - * _.toString(-0); - * // => '-0' - * - * _.toString([1, 2, 3]); - * // => '1,2,3' - */ -function toString(value) { - return value == null ? '' : baseToString(value); -} - -module.exports = toString; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json deleted file mode 100644 index 32c5752c9d3706..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/node_modules/lodash.tostring/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad" - ], - [ - { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart" - ] - ], - "_from": "lodash.tostring@^4.0.0", - "_id": "lodash.tostring@4.1.3", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart/lodash.tostring", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/lodash.tostring-4.1.3.tgz_1463062634002_0.7874096168670803" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.tostring", - "raw": "lodash.tostring@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge/lodash.padstart" - ], - "_resolved": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz", - "_shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "_shrinkwrap": null, - "_spec": "lodash.tostring@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": {}, - "description": "The lodash method `_.toString` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "5697f62973f30105a76c2deb3e2d1669f04fd825", - "tarball": "https://registry.npmjs.org/lodash.tostring/-/lodash.tostring-4.1.3.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "tostring" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.tostring", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.1.3" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json deleted file mode 100644 index 57fc4ead9a08bf..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padstart/package.json +++ /dev/null @@ -1,116 +0,0 @@ -{ - "_args": [ - [ - { - "name": "lodash.padstart", - "raw": "lodash.padstart@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" - ] - ], - "_from": "lodash.padstart@>=4.1.0 <5.0.0", - "_id": "lodash.padstart@4.5.0", - "_inCache": true, - "_installable": true, - "_location": "/node-gyp/npmlog/gauge/lodash.padstart", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lodash.padstart-4.5.0.tgz_1463062453524_0.18468116875737906" - }, - "_npmUser": { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - "_npmVersion": "2.15.5", - "_phantomChildren": {}, - "_requested": { - "name": "lodash.padstart", - "raw": "lodash.padstart@^4.1.0", - "rawSpec": "^4.1.0", - "scope": null, - "spec": ">=4.1.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/node-gyp/npmlog/gauge" - ], - "_resolved": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz", - "_shasum": "3ea190f6734841c3364d279d11e056726b60a79a", - "_shrinkwrap": null, - "_spec": "lodash.padstart@^4.1.0", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", - "author": { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - "bugs": { - "url": "https://github.com/lodash/lodash/issues" - }, - "contributors": [ - { - "email": "john.david.dalton@gmail.com", - "name": "John-David Dalton", - "url": "http://allyoucanleet.com/" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "Blaine Bublitz", - "url": "https://github.com/phated" - }, - { - "email": "mathias@qiwi.be", - "name": "Mathias Bynens", - "url": "https://mathiasbynens.be/" - } - ], - "dependencies": { - "lodash._baseslice": "~4.0.0", - "lodash._basetostring": "~4.12.0", - "lodash.tostring": "^4.0.0" - }, - "description": "The lodash method `_.padStart` exported as a module.", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "3ea190f6734841c3364d279d11e056726b60a79a", - "tarball": "https://registry.npmjs.org/lodash.padstart/-/lodash.padstart-4.5.0.tgz" - }, - "homepage": "https://lodash.com/", - "icon": "https://lodash.com/icon.svg", - "keywords": [ - "lodash-modularized", - "padstart" - ], - "license": "MIT", - "maintainers": [ - { - "email": "john.david.dalton@gmail.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - }, - { - "email": "blaine.bublitz@gmail.com", - "name": "phated" - } - ], - "name": "lodash.padstart", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/lodash/lodash.git" - }, - "scripts": { - "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\"" - }, - "version": "4.5.0" -} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js new file mode 100644 index 00000000000000..508504840dc61d --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js @@ -0,0 +1,83 @@ +'use strict'; +/* eslint-disable no-unused-vars */ +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (e) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json new file mode 100644 index 00000000000000..ed10c835989889 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "object-assign@^4.1.0", + "_id": "object-assign@4.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/object-assign", + "_nodeVersion": "4.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/object-assign-4.1.0.tgz_1462212593641_0.3332549517508596" + }, + "_npmUser": { + "name": "spicyj", + "email": "ben@benalpert.com" + }, + "_npmVersion": "2.14.19", + "_phantomChildren": {}, + "_requested": { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "_shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "_shrinkwrap": null, + "_spec": "object-assign@^4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "dependencies": {}, + "description": "ES2015 Object.assign() ponyfill", + "devDependencies": { + "lodash": "^4.8.2", + "matcha": "^0.7.0", + "mocha": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "72fe21c86911758f3342fdf41c2a57860d5829bc", + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "spicyj", + "email": "ben@benalpert.com" + } + ], + "name": "object-assign", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && mocha" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md new file mode 100644 index 00000000000000..13c097734cfd18 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md @@ -0,0 +1,56 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, source, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md new file mode 100644 index 00000000000000..c12f8340c8d6c6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 00000000000000..c7e27478a3eff8 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md new file mode 100644 index 00000000000000..8ebccabecaea4c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js new file mode 100644 index 00000000000000..7dd8d917dc507b --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js @@ -0,0 +1,148 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json new file mode 100644 index 00000000000000..d43a28af458026 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "signal-exit@^3.0.0", + "_id": "signal-exit@3.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/signal-exit", + "_nodeVersion": "5.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/signal-exit-3.0.0.tgz_1465857346813_0.7961636525578797" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "_shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "dependencies": {}, + "description": "when you want to fire an event no matter how a process exits.", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.2", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^5.7.2" + }, + "directories": {}, + "dist": { + "shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "tarball": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + }, + "files": [ + "index.js", + "signals.js" + ], + "gitHead": "2bbec4e5d9f9cf1f7529b1c923d1b058e69ccf7f", + "homepage": "https://github.com/tapjs/signal-exit", + "keywords": [ + "signal", + "exit" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "signal-exit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/signal-exit.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "tap --timeout=240 ./test/*.js --cov" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js new file mode 100644 index 00000000000000..bc6f97ee606954 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js @@ -0,0 +1,52 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGBUS', + 'SIGFPE', + 'SIGHUP', + 'SIGILL', + 'SIGINT', + 'SIGSEGV', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js new file mode 100644 index 00000000000000..b9bec62440a468 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -0,0 +1,37 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js new file mode 100644 index 00000000000000..0335117977237f --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js @@ -0,0 +1,33 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (numberIsNan(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..44730ebd4101fc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/code-point-at/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width/code-point-at" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json new file mode 100644 index 00000000000000..2f4b7334796213 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "code-point-at@^1.0.0", + "_id": "code-point-at@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/code-point-at", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "_shrinkwrap": null, + "_spec": "code-point-at@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/code-point-at/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "ES2015 String#codePointAt() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", + "homepage": "https://github.com/sindresorhus/code-point-at", + "keywords": [ + "es2015", + "es6", + "ponyfill", + "polyfill", + "shim", + "string", + "str", + "code", + "point", + "at", + "codepoint", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "code-point-at", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/code-point-at.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md new file mode 100644 index 00000000000000..71e7d0931b8b0c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md @@ -0,0 +1,34 @@ +# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) + +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save code-point-at +``` + + +## Usage + +```js +var codePointAt = require('code-point-at'); + +codePointAt('🐴'); +//=> 128052 + +codePointAt('abc', 2); +//=> 99 +``` + +## API + +### codePointAt(input, [position]) + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..a0eb06f0150602 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..7b83e53a972fa4 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width/is-fullwidth-code-point", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_shrinkwrap": null, + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "tarball": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-fullwidth-code-point", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json new file mode 100644 index 00000000000000..624a60c613c5b0 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "string-width@^1.0.1", + "_id": "string-width@1.0.2", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/string-width", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge", + "/node-gyp/npmlog/gauge/wide-align" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "_shrinkwrap": null, + "_spec": "string-width@^1.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "string-width", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..1ab42c93580ecb --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md @@ -0,0 +1,42 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install --save string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore new file mode 100644 index 00000000000000..d1a6b0054bc8f3 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore @@ -0,0 +1,5 @@ +*~ +/node_modules +.#* +/.nyc_output +/coverage diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE new file mode 100644 index 00000000000000..f4be44d881b2d9 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md new file mode 100644 index 00000000000000..32f1be04f09776 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js new file mode 100644 index 00000000000000..4f94ca4cde19b5 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json new file mode 100644 index 00000000000000..6729516f83b95c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "wide-align@^1.1.0", + "_id": "wide-align@1.1.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/gauge/wide-align", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", + "_shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "_shrinkwrap": null, + "_spec": "wide-align@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/wide-align/issues" + }, + "dependencies": { + "string-width": "^1.0.1" + }, + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "devDependencies": { + "tap": "^2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "tarball": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" + }, + "gitHead": "fe3f7f210650913d5bee702d7e19938f6977bc8a", + "homepage": "https://github.com/iarna/wide-align#readme", + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "license": "ISC", + "main": "align.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "wide-align", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/wide-align.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js new file mode 100644 index 00000000000000..64e9f9dbda4697 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js @@ -0,0 +1,37 @@ +'use strict' +var test = require('tap').test +var align = require('..') + +test('align', function (t) { + t.is(align.center('abc', 10), ' abc ', 'center narrow') + t.is(align.center('古古古', 10), ' 古古古 ', 'center wide') + t.is(align.left('abc', 10), 'abc ', 'left narrow') + t.is(align.left('古古古', 10), '古古古 ', 'left wide') + t.is(align.right('abc', 10), ' abc', 'right narrow') + t.is(align.right('古古古', 10), ' 古古古', 'right wide') + + t.is(align.center('abc', 2), 'abc', 'center narrow overflow') + t.is(align.center('古古古', 4), '古古古', 'center wide overflow') + t.is(align.left('abc', 2), 'abc', 'left narrow overflow') + t.is(align.left('古古古', 4), '古古古', 'left wide overflow') + t.is(align.right('abc', 2), 'abc', 'right narrow overflow') + t.is(align.right('古古古', 4), '古古古', 'right wide overflow') + + t.is(align.left('', 5), ' ', 'left align nothing') + t.is(align.center('', 5), ' ', 'center align nothing') + t.is(align.right('', 5), ' ', 'right align nothing') + + t.is(align.left(' ', 5), ' ', 'left align whitespace') + t.is(align.center(' ', 5), ' ', 'center align whitespace') + t.is(align.right(' ', 5), ' ', 'right align whitespace') + + t.is(align.left(' ', 2), ' ', 'left align whitespace overflow') + t.is(align.center(' ', 2), ' ', 'center align whitespace overflow') + t.is(align.right(' ', 2), ' ', 'right align whitespace overflow') + + t.is(align.left('x ', 10), 'x ', 'left align whitespace mix') + t.is(align.center('x ', 10), ' x ', 'center align whitespace mix') + t.is(align.right('x ', 10), ' x', 'right align whitespace mix') + + t.end() +}) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json index 6d3424f0acbdbb..86fcce6f26980e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/package.json @@ -2,72 +2,116 @@ "_args": [ [ { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", "name": "gauge", - "raw": "gauge@~1.2.5", - "rawSpec": "~1.2.5", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "gauge@~2.6.0", "scope": null, - "spec": ">=1.2.5 <1.3.0", + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" ] ], - "_from": "gauge@>=1.2.5 <1.3.0", - "_id": "gauge@1.2.7", + "_from": "gauge@~2.6.0", + "_id": "gauge@2.6.0", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog/gauge", - "_nodeVersion": "4.2.2", + "_nodeVersion": "4.4.0", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/gauge-1.2.7.tgz_1455835409513_0.6293477965518832" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/gauge-2.6.0.tgz_1466067371972_0.20705468393862247" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": { + "strip-ansi": "3.0.1" }, - "_npmVersion": "3.7.2", - "_phantomChildren": {}, "_requested": { - "name": "gauge", - "raw": "gauge@~1.2.5", - "rawSpec": "~1.2.5", + "raw": "gauge@~2.6.0", "scope": null, - "spec": ">=1.2.5 <1.3.0", + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", "type": "range" }, "_requiredBy": [ "/node-gyp/npmlog" ], - "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz", - "_shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz", + "_shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", "_shrinkwrap": null, - "_spec": "gauge@~1.2.5", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/npmlog", + "_spec": "gauge@~2.6.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", "author": { - "email": "me@re-becca.org", - "name": "Rebecca Turner" + "name": "Rebecca Turner", + "email": "me@re-becca.org" }, "bugs": { "url": "https://github.com/iarna/gauge/issues" }, "dependencies": { - "ansi": "^0.3.0", + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-color": "^0.1.7", "has-unicode": "^2.0.0", - "lodash.pad": "^4.1.0", - "lodash.padend": "^4.1.0", - "lodash.padstart": "^4.1.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" }, "description": "A terminal based horizontal guage", "devDependencies": { - "tap": "^5.6.0" + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" }, "directories": {}, "dist": { - "shasum": "e9cec5483d3d4ee0ef44b60a7d99e4935e136d93", - "tarball": "https://registry.npmjs.org/gauge/-/gauge-1.2.7.tgz" + "shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz" }, - "gitHead": "75a7d0a4ed67489ac992ed3d211bed60376ca7c1", + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "gitHead": "d51040a71c269432c16cc542143f403a831630e6", "homepage": "https://github.com/iarna/gauge", "keywords": [ "progressbar", @@ -75,11 +119,11 @@ "gauge" ], "license": "ISC", - "main": "progress-bar.js", + "main": "index.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" } ], "name": "gauge", @@ -90,7 +134,7 @@ "url": "git+https://github.com/iarna/gauge.git" }, "scripts": { - "test": "tap test/*.js" + "test": "standard && tap test/*.js --coverage" }, - "version": "1.2.7" + "version": "2.6.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js new file mode 100644 index 00000000000000..589a9c92878ebf --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/plumbing.js @@ -0,0 +1,47 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js new file mode 100644 index 00000000000000..05e85694d755b6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js index ddfc4a44be4ded..7f8dd68be24cf0 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -1,225 +1,35 @@ -"use strict" -var hasUnicode = require("has-unicode") -var ansi = require("ansi") -var align = { - center: require("lodash.pad"), - left: require("lodash.padend"), - right: require("lodash.padstart") -} -var defaultStream = process.stderr -function isTTY() { - return process.stderr.isTTY -} -function getWritableTTYColumns() { - // Writing to the final column wraps the line - // We have to use stdout here, because Node's magic SIGWINCH handler only - // updates process.stdout, not process.stderr - return process.stdout.columns - 1 -} - -var ProgressBar = module.exports = function (options, cursor) { - if (! options) options = {} - if (! cursor && options.write) { - cursor = options - options = {} - } - if (! cursor) { - cursor = ansi(defaultStream) - } - this.cursor = cursor - this.showing = false - this.theme = options.theme || (hasUnicode() ? ProgressBar.unicode : ProgressBar.ascii) - this.template = options.template || [ - {type: "name", separated: true, length: 25}, - {type: "spinner", separated: true}, - {type: "startgroup"}, - {type: "completionbar"}, - {type: "endgroup"} +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} ] - this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency - this.lastName = "" - this.lastCompleted = 0 - this.spun = 0 - this.last = new Date(0) - - var self = this - this._handleSizeChange = function () { - if (!self.showing) return - self.hide() - self.show() - } -} -ProgressBar.prototype = {} - -ProgressBar.unicode = { - startgroup: "╢", - endgroup: "╟", - complete: "█", - incomplete: "░", - spinner: "▀▐▄▌", - subsection: "→" -} - -ProgressBar.ascii = { - startgroup: "|", - endgroup: "|", - complete: "#", - incomplete: "-", - spinner: "-\\|/", - subsection: "->" -} - -ProgressBar.prototype.setTheme = function(theme) { - this.theme = theme -} - -ProgressBar.prototype.setTemplate = function(template) { - this.template = template -} - -ProgressBar.prototype._enableResizeEvents = function() { - process.stdout.on('resize', this._handleSizeChange) -} - -ProgressBar.prototype._disableResizeEvents = function() { - process.stdout.removeListener('resize', this._handleSizeChange) -} - -ProgressBar.prototype.disable = function() { - this.hide() - this.disabled = true -} - -ProgressBar.prototype.enable = function() { - this.disabled = false - this.show() -} - -ProgressBar.prototype.hide = function() { - if (!isTTY()) return - if (this.disabled) return - this.cursor.show() - if (this.showing) this.cursor.up(1) - this.cursor.horizontalAbsolute(0).eraseLine() - this.showing = false + return renderTemplate(width, template, theme) } -var repeat = function (str, count) { - var out = "" - for (var ii=0; ii remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000000000..6650a485c49933 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js new file mode 100644 index 00000000000000..576198793c5504 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js new file mode 100644 index 00000000000000..34142ee31acc7c --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js new file mode 100644 index 00000000000000..e46f447c941d38 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js deleted file mode 100644 index 5d3e7e78fe000e..00000000000000 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/test/progress-bar.js +++ /dev/null @@ -1,176 +0,0 @@ -"use strict" -var test = require("tap").test -var ProgressBar = require("../progress-bar.js") - -var cursor = [] -var C -var bar = new ProgressBar({theme: ProgressBar.ascii, maxUpdateFrequency: 0}, C = { - show: function () { - cursor.push(["show"]) - return C - }, - hide: function () { - cursor.push(["hide"]) - return C - }, - up: function (lines) { - cursor.push(["up",lines]) - return C - }, - horizontalAbsolute: function (col) { - cursor.push(["horizontalAbsolute", col]) - return C - }, - eraseLine: function () { - cursor.push(["eraseLine"]) - return C - }, - write: function (line) { - cursor.push(["write", line]) - return C - } -}) - - -function isOutput(t, msg, output) { - var tests = [] - for (var ii = 0; ii P | |----|\n' ], - [ 'show' ] ]) -}) - -test("window resizing", function (t) { - t.plan(16) - process.stderr.isTTY = true - process.stdout.columns = 32 - bar.show("NAME", 0.1) - cursor = [] - bar.last = new Date(0) - bar.pulse() - isOutput(t, "32 columns", - [ [ 'up', 1 ], - [ 'hide' ], - [ 'horizontalAbsolute', 0 ], - [ 'write', 'NAME / |##------------------|\n' ], - [ 'show' ] ]) - - process.stdout.columns = 16 - bar.show("NAME", 0.5) - cursor = [] - bar.last = new Date(0) - bar.pulse() - isOutput(t, "16 columns", - [ [ 'up', 1 ], - [ 'hide' ], - [ 'horizontalAbsolute', 0 ], - [ 'write', 'NAME - |##--|\n' ], - [ 'show' ] ]); -}); diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js new file mode 100644 index 00000000000000..68971d5d231b07 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js new file mode 100644 index 00000000000000..eb5a4f5b5e1034 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000000000..c531bc491fbb58 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 00000000000000..03bf591923d782 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 00000000000000..836440bef7cf14 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md new file mode 100644 index 00000000000000..e93b4202b59d65 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js new file mode 100644 index 00000000000000..6f78774bb63ee6 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json new file mode 100644 index 00000000000000..1db092f9c4ee05 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/node_modules/set-blocking/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog" + ] + ], + "_from": "set-blocking@~2.0.0", + "_id": "set-blocking@2.0.0", + "_inCache": true, + "_location": "/node-gyp/npmlog/set-blocking", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/set-blocking-2.0.0.tgz_1463525966987_0.5456729622092098" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/node-gyp/npmlog" + ], + "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "_shrinkwrap": null, + "_spec": "set-blocking@~2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/npmlog", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "dependencies": {}, + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "directories": {}, + "dist": { + "shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "tarball": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + }, + "files": [ + "index.js", + "LICENSE.txt" + ], + "gitHead": "7eec10577b5fff264de477ba3b9d07f404946eff", + "homepage": "https://github.com/yargs/set-blocking#readme", + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + } + ], + "name": "set-blocking", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "version": "standard-version" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json index 7bfb84713ac3d5..83078bd19721c7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/npmlog/package.json @@ -2,96 +2,101 @@ "_args": [ [ { - "name": "npmlog", - "raw": "npmlog@0 || 1 || 2", - "rawSpec": "0 || 1 || 2", + "raw": "npmlog@0 || 1 || 2 || 3", "scope": null, - "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "0 || 1 || 2 || 3", + "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, - "/Users/rebecca/code/npm/node_modules/node-gyp" + "/Users/zkat/Documents/code/npm/node_modules/node-gyp" ] ], - "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", - "_id": "npmlog@2.0.4", + "_from": "npmlog@>=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "_id": "npmlog@3.1.2", "_inCache": true, - "_installable": true, "_location": "/node-gyp/npmlog", - "_nodeVersion": "5.10.1", + "_nodeVersion": "4.4.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/npmlog-2.0.4.tgz_1463616637725_0.461703865788877" + "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" }, "_npmUser": { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.9.6", "_phantomChildren": { - "has-unicode": "2.0.0", - "readable-stream": "2.1.3" + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", + "strip-ansi": "3.0.1" }, "_requested": { - "name": "npmlog", - "raw": "npmlog@0 || 1 || 2", - "rawSpec": "0 || 1 || 2", + "raw": "npmlog@0 || 1 || 2 || 3", "scope": null, - "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0", + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "0 || 1 || 2 || 3", + "spec": ">=0.0.0 <1.0.0||>=1.0.0 <2.0.0||>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ "/node-gyp" ], - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz", - "_shasum": "98b52530f2514ca90d09ec5b22c8846722375692", + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", + "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", "_shrinkwrap": null, - "_spec": "npmlog@0 || 1 || 2", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", + "_spec": "npmlog@0 || 1 || 2 || 3", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/npmlog/issues" }, "dependencies": { - "ansi": "~0.3.1", "are-we-there-yet": "~1.1.2", - "gauge": "~1.2.5" + "console-control-strings": "~1.1.0", + "gauge": "~2.6.0", + "set-blocking": "~2.0.0" }, "description": "logger for npm", "devDependencies": { + "standard": "~7.1.2", "tap": "~5.7.0" }, "directories": {}, "dist": { - "shasum": "98b52530f2514ca90d09ec5b22c8846722375692", - "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.4.tgz" + "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" }, "files": [ "log.js" ], - "gitHead": "3732fd4ba1ca2d47c6102343e6c3fb7e66df7fe5", + "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", "homepage": "https://github.com/npm/npmlog#readme", "license": "ISC", "main": "log.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npmlog", @@ -102,7 +107,7 @@ "url": "git+https://github.com/npm/npmlog.git" }, "scripts": { - "test": "tap test/*.js" + "test": "standard && tap test/*.js" }, - "version": "2.0.4" + "version": "3.1.2" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json index a60580a9d183e5..f037c9bfd85416 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/node_modules/ms/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "ms@0.7.1", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug" + { + "raw": "ms@0.7.1", + "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", + "spec": "0.7.1", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug" ] ], "_from": "ms@0.7.1", @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index/debug/ms", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "rauchg@gmail.com", - "name": "rauchg" + "name": "rauchg", + "email": "rauchg@gmail.com" }, "_npmVersion": "2.7.5", "_phantomChildren": {}, "_requested": { - "name": "ms", "raw": "ms@0.7.1", - "rawSpec": "0.7.1", "scope": null, + "escapedName": "ms", + "name": "ms", + "rawSpec": "0.7.1", "spec": "0.7.1", "type": "version" }, @@ -32,7 +41,7 @@ "_shasum": "9cd13c03adbff25b65effde7ce864ee952017098", "_shrinkwrap": null, "_spec": "ms@0.7.1", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug", "bugs": { "url": "https://github.com/guille/ms.js/issues" }, @@ -51,7 +60,7 @@ "directories": {}, "dist": { "shasum": "9cd13c03adbff25b65effde7ce864ee952017098", - "tarball": "http://registry.npmjs.org/ms/-/ms-0.7.1.tgz" + "tarball": "https://registry.npmjs.org/ms/-/ms-0.7.1.tgz" }, "gitHead": "713dcf26d9e6fd9dbc95affe7eff9783b7f1b909", "homepage": "https://github.com/guille/ms.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json index 758deaf8c330e0..08cc48fc547aa2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/debug/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "debug@*", - "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" + { + "raw": "debug@^2.2.0", + "scope": null, + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" ] ], - "_from": "debug@*", + "_from": "debug@>=2.2.0 <3.0.0", "_id": "debug@2.2.0", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/debug", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "2.7.4", "_phantomChildren": {}, "_requested": { - "name": "debug", - "raw": "debug@*", - "rawSpec": "*", + "raw": "debug@^2.2.0", "scope": null, - "spec": "*", + "escapedName": "debug", + "name": "debug", + "rawSpec": "^2.2.0", + "spec": ">=2.2.0 <3.0.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz", "_shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", "_shrinkwrap": null, - "_spec": "debug@*", - "_where": "/Users/rebecca/code/release/npm-3/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", + "_spec": "debug@^2.2.0", + "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", "author": { - "email": "tj@vision-media.ca", - "name": "TJ Holowaychuk" + "name": "TJ Holowaychuk", + "email": "tj@vision-media.ca" }, "browser": "./browser.js", "bugs": { @@ -43,8 +52,8 @@ }, "component": { "scripts": { - "debug/debug.js": "debug.js", - "debug/index.js": "browser.js" + "debug/index.js": "browser.js", + "debug/debug.js": "debug.js" } }, "contributors": [ @@ -65,14 +74,14 @@ "directories": {}, "dist": { "shasum": "f87057e995b1a1f6ae6a4960664137bc56f039da", - "tarball": "http://registry.npmjs.org/debug/-/debug-2.2.0.tgz" + "tarball": "https://registry.npmjs.org/debug/-/debug-2.2.0.tgz" }, "gitHead": "b38458422b5aa8aa6d286b10dfe427e8a67e2b35", "homepage": "https://github.com/visionmedia/debug", "keywords": [ "debug", - "debugger", - "log" + "log", + "debugger" ], "license": "MIT", "main": "./node.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml index 6830765b567773..0b1f5e4ae340b6 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/.travis.yml @@ -4,6 +4,7 @@ node_js: - 0.12 - v4 - v5 + - v6 notifications: email: diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES index cbedd4244bc8b6..6aebe74ada9f65 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/CHANGES @@ -1,3 +1,9 @@ +v3.1.0 -- 2016.05.17 +* Fix internals of symbol detection +* Ensure Symbol.prototype[Symbol.toPrimitive] in all cases returns primitive value + (fixes Node v6 support) +* Create native symbols whenver possible + v3.0.2 -- 2015.12.12 * Fix definition flow, so uneven state of Symbol implementation doesn't crash initialization of polyfill. See #13 diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js index 53759f32124b1c..93629d2f84768a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-implemented.js @@ -1,18 +1,17 @@ 'use strict'; +var validTypes = { object: true, symbol: true }; + module.exports = function () { var symbol; if (typeof Symbol !== 'function') return false; symbol = Symbol('test symbol'); try { String(symbol); } catch (e) { return false; } - if (typeof Symbol.iterator === 'symbol') return true; - // Return 'true' for polyfills - if (typeof Symbol.isConcatSpreadable !== 'object') return false; - if (typeof Symbol.iterator !== 'object') return false; - if (typeof Symbol.toPrimitive !== 'object') return false; - if (typeof Symbol.toStringTag !== 'object') return false; - if (typeof Symbol.unscopables !== 'object') return false; + // Return 'true' also for polyfills + if (!validTypes[typeof Symbol.iterator]) return false; + if (!validTypes[typeof Symbol.toPrimitive]) return false; + if (!validTypes[typeof Symbol.toStringTag]) return false; return true; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js index a8cb8b8681ee69..5f073a19cab7c8 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-native-implemented.js @@ -4,5 +4,5 @@ module.exports = (function () { if (typeof Symbol !== 'function') return false; - return (typeof Symbol.iterator === 'symbol'); + return (typeof Symbol() === 'symbol'); }()); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js index beeba2cb4fa23f..074cb07fb575c2 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/is-symbol.js @@ -1,5 +1,9 @@ 'use strict'; module.exports = function (x) { - return (x && ((typeof x === 'symbol') || (x['@@toStringTag'] === 'Symbol'))) || false; + if (!x) return false; + if (typeof x === 'symbol') return true; + if (!x.constructor) return false; + if (x.constructor.name !== 'Symbol') return false; + return (x[x.constructor.toStringTag] === 'Symbol'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json index b7c327850c5f13..0c7a110a4d164d 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/d/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "d@~0.1.1", + { + "raw": "d@~0.1.1", + "scope": null, + "escapedName": "d", + "name": "d", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" ] ], @@ -11,16 +19,17 @@ "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol/d", "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, "_npmVersion": "1.4.3", "_phantomChildren": {}, "_requested": { - "name": "d", "raw": "d@~0.1.1", - "rawSpec": "~0.1.1", "scope": null, + "escapedName": "d", + "name": "d", + "rawSpec": "~0.1.1", "spec": ">=0.1.1 <0.2.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "d@~0.1.1", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -51,18 +60,18 @@ "directories": {}, "dist": { "shasum": "da184c535d18d8ee7ba2aa229b914009fae11309", - "tarball": "http://registry.npmjs.org/d/-/d-0.1.1.tgz" + "tarball": "https://registry.npmjs.org/d/-/d-0.1.1.tgz" }, "homepage": "https://github.com/medikoo/d", "keywords": [ "descriptor", - "descriptors", - "ecma", - "ecmascript", "es", + "ecmascript", + "ecma", + "property", + "descriptors", "meta", - "properties", - "property" + "properties" ], "license": "MIT", "maintainers": [ diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml index e8e18ee77d88ed..39fd70e64ed706 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/.travis.yml @@ -4,6 +4,7 @@ node_js: - 0.12 - 4 - 5 + - 6 before_install: - mkdir node_modules; ln -s ../ node_modules/es5-ext diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES index 92ee5f6ef64ca9..4ecc2db0753863 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/CHANGES @@ -1,3 +1,8 @@ +v0.10.12 -- 2016.07.01 +* Ensure symbols are copied in Object.mixin +* Prevent RangeError errors in array#flatten +* Do not validate invalidate dates in validDate + v0.10.11 -- 2015.12.18 * Ensure that check for implementation of RegExp flags doesn't crash in V8 (thanks @mathiasbynens) diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md index ad09fe2317bfa7..11d8a343d57f1f 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/README.md @@ -11,7 +11,7 @@ When used in ECMAScript 6 environment, native implementation (if valid) takes pr ### Installation $ npm install es5-ext - + To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ### Usage @@ -114,7 +114,7 @@ Object.defineProperty(String.prototype, 'capitalize', { value: require('es5-ext/ configurable: true, enumerable: false, writable: true }); ``` -See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. +See [es5-extend](https://github.com/wookieb/es5-extend#es5-extend), a great utility that automatically will extend natives for you. __Important:__ Remember to __not__ extend natives in scope of generic reusable packages (e.g. ones you intend to publish to npm). Extending natives is fine __only__ if you're the _owner_ of the global scope, so e.g. in final project you lead development of. @@ -162,7 +162,7 @@ Object that represents global scope #### from(arrayLike[, mapFn[, thisArg]]) _(es5-ext/array/from)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.from). Returns array representation of _iterable_ or _arrayLike_. If _arrayLike_ is an instance of array, its copy is returned. #### generate([length[, …fill]]) _(es5-ext/array/generate)_ @@ -175,7 +175,7 @@ Returns true if object is plain array (not instance of one of the Array's extens #### of([…items]) _(es5-ext/array/of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.of). Create an array from given arguments. #### toArray(obj) _(es5-ext/array/to-array)_ @@ -190,7 +190,7 @@ Returns `obj` if it's an array, otherwise throws `TypeError` #### arr.binarySearch(compareFn) _(es5-ext/array/#/binary-search)_ -In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. +In __sorted__ list search for index of item for which _compareFn_ returns value closest to _0_. It's variant of binary search algorithm #### arr.clear() _(es5-ext/array/#/clear)_ @@ -203,7 +203,7 @@ Returns a copy of the context with all non-values (`null` or `undefined`) remove #### arr.concat() _(es5-ext/array/#/concat)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.concat). ES6's version of `concat`. Supports `isConcatSpreadable` symbol, and returns array of same type as the context. #### arr.contains(searchElement[, position]) _(es5-ext/array/#/contains)_ @@ -212,7 +212,7 @@ Whether list contains the given value. #### arr.copyWithin(target, start[, end]) _(es5-ext/array/#/copy-within)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.copywithin). #### arr.diff(other) _(es5-ext/array/#/diff)_ @@ -228,7 +228,7 @@ _egal_ version of `lastIndexOf` method. [_SameValueZero_](http://people.mozilla. #### arr.entries() _(es5-ext/array/#/entries)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.entries). Returns iterator object, which traverses the array. Each value is represented with an array, where first value is an index and second is corresponding to index value. #### arr.exclusion([…lists]]) _(es5-ext/array/#/exclusion)_ @@ -237,21 +237,21 @@ Returns the array of elements that are found only in one of the lists (either co #### arr.fill(value[, start, end]) _(es5-ext/array/#/fill)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.fill). #### arr.filter(callback[, thisArg]) _(es5-ext/array/#/filter)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.filter). ES6's version of `filter`, returns array of same type as the context. #### arr.find(predicate[, thisArg]) _(es5-ext/array/#/find)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.find). Return first element for which given function returns true #### arr.findIndex(predicate[, thisArg]) _(es5-ext/array/#/find-index)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.findindex). Return first index for which given function returns true #### arr.first() _(es5-ext/array/#/first)_ @@ -292,7 +292,7 @@ Returns true if all values in array are unique #### arr.keys() _(es5-ext/array/#/keys)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.keys). Returns iterator object, which traverses all array indexes. #### arr.last() _(es5-ext/array/#/last)_ @@ -305,7 +305,7 @@ Returns last defined index of the array #### arr.map(callback[, thisArg]) _(es5-ext/array/#/map)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.map). ES6's version of `map`, returns array of same type as the context. #### arr.remove(value[, …valuen]) _(es5-ext/array/#/remove)_ @@ -318,7 +318,7 @@ Returns array with items separated with `sep` value #### arr.slice(callback[, thisArg]) _(es5-ext/array/#/slice)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.slice). ES6's version of `slice`, returns array of same type as the context. #### arr.someRight(cb[, thisArg]) _(es5-ext/array/#/someRight)_ @@ -327,7 +327,7 @@ ES6's version of `slice`, returns array of same type as the context. #### arr.splice(callback[, thisArg]) _(es5-ext/array/#/splice)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.splice). ES6's version of `splice`, returns array of same type as the context. #### arr.uniq() _(es5-ext/array/#/uniq)_ @@ -336,12 +336,12 @@ Returns duplicate-free version of the array #### arr.values() _(es5-ext/array/#/values)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype.values). Returns iterator object which traverses all array values. #### arr[@@iterator] _(es5-ext/array/#/@@iterator)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-array.prototype-@@iterator). Returns iterator object which traverses all array values. ### Boolean Constructor extensions @@ -399,11 +399,11 @@ Formats date up to given string. Supported patterns: #### custom(message/*, code, ext*/) _(es5-ext/error/custom)_ -Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) +Creates custom error object, optinally extended with `code` and other extension properties (provided with `ext` object) #### isError(x) _(es5-ext/error/is-error)_ -Whether value is an error (instance of `Error`). +Whether value is an error (instance of `Error`). #### validError(x) _(es5-ext/error/valid-error)_ @@ -434,7 +434,7 @@ _i(x) =def x_ #### invoke(name[, …args]) _(es5-ext/function/invoke)_ Returns a function that takes an object as an argument, and applies object's -_name_ method to arguments. +_name_ method to arguments. _name_ can be name of the method or method itself. _invoke(name, …args)(object, …args2) =def object\[name\]\(…args, …args2\)_ @@ -478,7 +478,7 @@ Produces copy of given function #### fn.curry([n]) _(es5-ext/function/#/curry)_ -Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. +Invoking the function returned by this function only _n_ arguments are passed to the underlying function. If the underlying function is not saturated, the result is a function that passes all its arguments to the underlying function. If _n_ is not provided then it defaults to context function length _f.curry(4)(arg1, arg2)(arg3)(arg4) =def f(arg1, args2, arg3, arg4)_ @@ -517,93 +517,93 @@ Serializes function into two (arguments and body) string tokens. Result is plain #### acosh(x) _(es5-ext/math/acosh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.acosh). #### asinh(x) _(es5-ext/math/asinh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.asinh). #### atanh(x) _(es5-ext/math/atanh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.atanh). #### cbrt(x) _(es5-ext/math/cbrt)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cbrt). #### clz32(x) _(es5-ext/math/clz32)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.clz32). #### cosh(x) _(es5-ext/math/cosh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.cosh). #### expm1(x) _(es5-ext/math/expm1)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.expm1). #### fround(x) _(es5-ext/math/fround)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.fround). #### hypot([…values]) _(es5-ext/math/hypot)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.hypot). #### imul(x, y) _(es5-ext/math/imul)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.imul). #### log1p(x) _(es5-ext/math/log1p)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log1p). #### log2(x) _(es5-ext/math/log2)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log2). #### log10(x) _(es5-ext/math/log10)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.log10). #### sign(x) _(es5-ext/math/sign)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sign). #### sinh(x) _(es5-ext/math/sinh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.sinh). #### tanh(x) _(es5-ext/math/tanh)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.tanh). #### trunc(x) _(es5-ext/math/trunc)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-math.trunc). ### Number Constructor extensions #### EPSILON _(es5-ext/number/epsilon)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.epsilon). The difference between 1 and the smallest value greater than 1 that is representable as a Number value, which is approximately 2.2204460492503130808472633361816 x 10-16. #### isFinite(x) _(es5-ext/number/is-finite)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isfinite). Whether value is finite. Differs from global isNaN that it doesn't do type coercion. #### isInteger(x) _(es5-ext/number/is-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isinteger). Whether value is integer. #### isNaN(x) _(es5-ext/number/is-nan)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.isnan). Whether value is NaN. Differs from global isNaN that it doesn't do type coercion. #### isNumber(x) _(es5-ext/number/is-number)_ @@ -612,16 +612,16 @@ Whether given value is number #### isSafeInteger(x) _(es5-ext/number/is-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.issafeinteger). #### MAX_SAFE_INTEGER _(es5-ext/number/max-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.maxsafeinteger). The value of Number.MAX_SAFE_INTEGER is 9007199254740991. #### MIN_SAFE_INTEGER _(es5-ext/number/min-safe-integer)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-number.minsafeinteger). The value of Number.MIN_SAFE_INTEGER is -9007199254740991 (253-1). #### toInteger(x) _(es5-ext/number/to-integer)_ @@ -647,7 +647,7 @@ Pad given number with zeros. Returns string #### assign(target, source[, …sourcen]) _(es5-ext/object/assign)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign). Extend _target_ by enumerable own properties of other objects. If properties are already set on target object, they will be overwritten. #### clear(obj) _(es5-ext/object/clear)_ @@ -690,7 +690,7 @@ Whether two values are equal, using [_SameValueZero_](http://people.mozilla.org/ #### every(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/every)_ -Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. +Analogous to Array.prototype.every. Returns true if every key-value pair in this object satisfies the provided testing function. Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### filter(obj, cb[, thisArg]) _(es5-ext/object/filter)_ @@ -750,7 +750,7 @@ Search object for value #### keys(obj) _(es5-ext/object/keys)_ -[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). +[_Updated with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.keys). ES6's version of `keys`, doesn't throw on primitive input #### map(obj, cb[, thisArg]) _(es5-ext/object/map)_ @@ -773,7 +773,7 @@ Useful as an alternative for `setPrototypeOf` in environments in which it cannot #### normalizeOptions(options) _(es5-ext/object/normalize-options)_ -Normalizes options object into flat plain object. +Normalizes options object into flat plain object. Useful for functions in which we either need to keep options object for future reference or need to modify it for internal use. @@ -795,18 +795,18 @@ Serialize value into string. Differs from [JSON.stringify](https://developer.moz #### setPrototypeOf(object, proto) _(es5-ext/object/set-prototype-of)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.setprototypeof). If native version is not provided, it depends on existence of `__proto__` functionality, if it's missing, `null` instead of function is exposed. #### some(obj, cb[, thisArg[, compareFn]]) _(es5-ext/object/some)_ Analogous to Array.prototype.some Returns true if any key-value pair satisfies the provided -testing function. +testing function. Optionally _compareFn_ can be provided which assures that keys are tested in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### toArray(obj[, cb[, thisArg[, compareFn]]]) _(es5-ext/object/to-array)_ -Creates an array of results of calling a provided function on every key-value pair in this object. +Creates an array of results of calling a provided function on every key-value pair in this object. Optionally _compareFn_ can be provided which assures that results are added in given order. If provided _compareFn_ is equal to `true`, then order is alphabetical (by key). #### unserialize(str) _(es5-ext/object/unserialize)_ @@ -855,28 +855,28 @@ It's to be used as counterpart to [regExp.unicode](http://people.mozilla.org/~jo #### re.match(string) _(es5-ext/reg-exp/#/match)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.match). #### re.replace(string, replaceValue) _(es5-ext/reg-exp/#/replace)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.replace). #### re.search(string) _(es5-ext/reg-exp/#/search)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.search). #### re.split(string) _(es5-ext/reg-exp/#/search)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.split). #### re.sticky _(es5-ext/reg-exp/#/sticky/implement)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.sticky). It's a getter, so only `implement` and `is-implemented` modules are provided. #### re.unicode _(es5-ext/reg-exp/#/unicode/implement)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-regexp.prototype.unicode). It's a getter, so only `implement` and `is-implemented` modules are provided. ### String Constructor extensions @@ -937,7 +937,7 @@ Whether string contains given string. #### str.endsWith(searchString[, endPosition]) _(es5-ext/string/#/ends-with)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.endswith). Whether strings ends with given string #### str.hyphenToCamel() _(es5-ext/string/#/hyphen-to-camel)_ @@ -955,8 +955,8 @@ Return last character #### str.normalize([form]) _(es5-ext/string/#/normalize)_ -[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). -Returns the Unicode Normalization Form of a given string. +[_Introduced with ECMAScript 6_](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/normalize). +Returns the Unicode Normalization Form of a given string. Based on Matsuza's version. Code used for integrated shim can be found at [github.com/walling/unorm](https://github.com/walling/unorm/blob/master/lib/unorm.js) #### str.pad(fill[, length]) _(es5-ext/string/#/pad)_ @@ -967,7 +967,7 @@ If _length_ is negative then pad is applied from right. #### str.repeat(n) _(es5-ext/string/#/repeat)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.repeat). Repeat given string _n_ times #### str.plainReplace(search, replace) _(es5-ext/string/#/plain-replace)_ @@ -980,12 +980,12 @@ Simple `replace` version. Doesn't support regular expressions. Replaces all occu #### str.startsWith(searchString[, position]) _(es5-ext/string/#/starts-with)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype.startswith). Whether strings starts with given string #### str[@@iterator] _(es5-ext/string/#/@@iterator)_ -[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). +[_Introduced with ECMAScript 6_](http://people.mozilla.org/~jorendorff/es6-draft.html#sec-string.prototype-@@iterator). Returns iterator object which traverses all string characters (with respect to unicode symbols) ### Tests [![Build Status](https://travis-ci.org/medikoo/es5-ext.png)](https://travis-ci.org/medikoo/es5-ext) diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js index c95407d317fd3b..4bf267f2bad8d9 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/array/#/flatten.js @@ -1,12 +1,15 @@ 'use strict'; -var isArray = Array.isArray, forEach = Array.prototype.forEach - , push = Array.prototype.push; +var isArray = Array.isArray, forEach = Array.prototype.forEach; module.exports = function flatten() { var r = []; forEach.call(this, function (x) { - push.apply(r, isArray(x) ? flatten.call(x) : [x]); + if (isArray(x)) { + r = r.concat(flatten.call(x)); + } else { + r.push(x); + } }); return r; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js index 7d1a9b60d4748a..d0f1b6ce2b83a6 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/date/valid-date.js @@ -3,6 +3,6 @@ var isDate = require('./is-date'); module.exports = function (x) { - if (!isDate(x)) throw new TypeError(x + " is not a Date object"); + if (!isDate(x) || isNaN(x)) throw new TypeError(x + " is not valid Date object"); return x; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md index 30faa82bbaefaa..288373da7ab506 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/README.md @@ -4,7 +4,7 @@ ### Installation $ npm install es6-iterator - + To port it to Browser or any other (non CJS) environment, use your favorite CJS bundler. No favorite yet? Try: [Browserify](http://browserify.org/), [Webmake](https://github.com/medikoo/modules-webmake) or [Webpack](http://webpack.github.io/) ## API @@ -63,7 +63,7 @@ May also be used for _arguments_ objects: #### StringIterator(str) _(es6-iterator/string)_ -Assures proper iteration over unicode symbols. +Assures proper iteration over unicode symbols. See: http://mathiasbynens.be/notes/javascript-unicode ```javascript diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json index e4e603f6b2edf0..92a871dcfd6116 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/node_modules/es6-iterator/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "es6-iterator@2", + { + "raw": "es6-iterator@2", + "scope": null, + "escapedName": "es6-iterator", + "name": "es6-iterator", + "rawSpec": "2", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator", "_nodeVersion": "0.12.7", "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { - "name": "es6-iterator", "raw": "es6-iterator@2", - "rawSpec": "2", "scope": null, + "escapedName": "es6-iterator", + "name": "es6-iterator", + "rawSpec": "2", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "es6-iterator@2", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -56,17 +65,17 @@ "directories": {}, "dist": { "shasum": "bd968567d61635e33c0b80727613c9cb4b096bac", - "tarball": "http://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" + "tarball": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.0.tgz" }, "gitHead": "4d9445834e87780ab373b14d6791e860899e2d31", "homepage": "https://github.com/medikoo/es6-iterator#readme", "keywords": [ - "array", - "generator", "iterator", + "array", "list", + "set", "map", - "set" + "generator" ], "license": "MIT", "maintainers": [ diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js index 80b5df5e04b9b3..488523eea1d4ff 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/object/mixin.js @@ -4,16 +4,24 @@ var value = require('./valid-value') , defineProperty = Object.defineProperty , getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor - , getOwnPropertyNames = Object.getOwnPropertyNames; + , getOwnPropertyNames = Object.getOwnPropertyNames + , getOwnPropertySymbols = Object.getOwnPropertySymbols; module.exports = function (target, source) { - var error; + var error, sourceObject = Object(value(source)); target = Object(value(target)); - getOwnPropertyNames(Object(value(source))).forEach(function (name) { + getOwnPropertyNames(sourceObject).forEach(function (name) { try { defineProperty(target, name, getOwnPropertyDescriptor(source, name)); } catch (e) { error = e; } }); + if (typeof getOwnPropertySymbols === 'function') { + getOwnPropertySymbols(sourceObject).forEach(function (symbol) { + try { + defineProperty(target, symbol, getOwnPropertyDescriptor(source, symbol)); + } catch (e) { error = e; } + }); + } if (error !== undefined) throw error; return target; }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json index 597a347e96bc9f..39321320a42d50 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/package.json @@ -1,32 +1,45 @@ { "_args": [ [ - "es5-ext@~0.10.10", - "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" + { + "raw": "es5-ext@~0.10.11", + "scope": null, + "escapedName": "es5-ext", + "name": "es5-ext", + "rawSpec": "~0.10.11", + "spec": ">=0.10.11 <0.11.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol" ] ], - "_from": "es5-ext@>=0.10.10 <0.11.0", - "_id": "es5-ext@0.10.11", + "_from": "es5-ext@>=0.10.11 <0.11.0", + "_id": "es5-ext@0.10.12", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol/es5-ext", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/es5-ext-0.10.12.tgz_1467387765797_0.7073166444897652" + }, "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.5", "_phantomChildren": { "d": "0.1.1", - "es5-ext": "0.10.11", - "es6-symbol": "3.0.2" + "es5-ext": "0.10.12", + "es6-symbol": "3.1.0" }, "_requested": { - "name": "es5-ext", - "raw": "es5-ext@~0.10.10", - "rawSpec": "~0.10.10", + "raw": "es5-ext@~0.10.11", "scope": null, - "spec": ">=0.10.10 <0.11.0", + "escapedName": "es5-ext", + "name": "es5-ext", + "rawSpec": "~0.10.11", + "spec": ">=0.10.11 <0.11.0", "type": "range" }, "_requiredBy": [ @@ -34,14 +47,14 @@ "/node-gyp/path-array/array-index/es6-symbol/d", "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" ], - "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz", - "_shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", + "_resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz", + "_shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", "_shrinkwrap": null, - "_spec": "es5-ext@~0.10.10", - "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", + "_spec": "es5-ext@~0.10.11", + "_where": "/Users/zkat/Documents/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -49,7 +62,7 @@ }, "dependencies": { "es6-iterator": "2", - "es6-symbol": "~3.0.2" + "es6-symbol": "~3.1" }, "description": "ECMAScript extensions and shims", "devDependencies": { @@ -59,28 +72,28 @@ }, "directories": {}, "dist": { - "shasum": "8184c3e705a820948c2dbe043849379b1dbd0c45", - "tarball": "http://registry.npmjs.org/es5-ext/-/es5-ext-0.10.11.tgz" + "shasum": "aa84641d4db76b62abba5e45fd805ecbab140047", + "tarball": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.12.tgz" }, - "gitHead": "aba94140a6bf79ce1a448a2db8834e8c1842b527", + "gitHead": "96fddc3a327b3a28b1653af9490e3b905f127fa8", "homepage": "https://github.com/medikoo/es5-ext#readme", "keywords": [ - "addons", "ecmascript", "ecmascript5", "ecmascript6", "es5", "es6", - "ext", "extensions", + "ext", + "addons", "extras", "harmony", "javascript", "polyfill", "shim", "util", - "utilities", - "utils" + "utils", + "utilities" ], "license": "MIT", "maintainers": [ @@ -101,5 +114,5 @@ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "version": "0.10.11" + "version": "0.10.12" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js index 8b47a8158a29d3..64e35c03da0e9d 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/camel-to-hyphen.js @@ -2,4 +2,6 @@ module.exports = function (t, a) { a(t.call('razDwaTRzy4yFoo45My'), 'raz-dwa-t-rzy4y-foo45-my'); + a(t.call('razDwaTRzy4yFoo45My-'), 'raz-dwa-t-rzy4y-foo45-my-'); + a(t.call('razDwaTRzy4yFoo45My--'), 'raz-dwa-t-rzy4y-foo45-my--'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js index bd7ded4befbc7d..0118dd817319b7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/test/string/#/hyphen-to-camel.js @@ -2,4 +2,6 @@ module.exports = function (t, a) { a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa'), 'razDwaTRzy4yRtr4Tiu45Pa'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa-'), 'razDwaTRzy4yRtr4Tiu45Pa-'); + a(t.call('raz-dwa-t-rzy-4y-rtr4-tiu-45-pa--'), 'razDwaTRzy4yRtr4Tiu45Pa--'); }; diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json index f98280ca28c400..2e12775fc72035 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/package.json @@ -1,29 +1,42 @@ { "_args": [ [ - "es6-symbol@^3.0.2", + { + "raw": "es6-symbol@^3.0.2", + "scope": null, + "escapedName": "es6-symbol", + "name": "es6-symbol", + "rawSpec": "^3.0.2", + "spec": ">=3.0.2 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index" ] ], "_from": "es6-symbol@>=3.0.2 <4.0.0", - "_id": "es6-symbol@3.0.2", + "_id": "es6-symbol@3.1.0", "_inCache": true, "_installable": true, "_location": "/node-gyp/path-array/array-index/es6-symbol", - "_nodeVersion": "5.2.0", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/es6-symbol-3.1.0.tgz_1464960261964_0.3645231726113707" + }, "_npmUser": { - "email": "medikoo+npm@medikoo.com", - "name": "medikoo" + "name": "medikoo", + "email": "medikoo+npm@medikoo.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.5", "_phantomChildren": { - "es6-symbol": "3.0.2" + "es6-symbol": "3.1.0" }, "_requested": { - "name": "es6-symbol", "raw": "es6-symbol@^3.0.2", - "rawSpec": "^3.0.2", "scope": null, + "escapedName": "es6-symbol", + "name": "es6-symbol", + "rawSpec": "^3.0.2", "spec": ">=3.0.2 <4.0.0", "type": "range" }, @@ -32,14 +45,14 @@ "/node-gyp/path-array/array-index/es6-symbol/es5-ext", "/node-gyp/path-array/array-index/es6-symbol/es5-ext/es6-iterator" ], - "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz", - "_shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", + "_resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz", + "_shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", "_shrinkwrap": null, "_spec": "es6-symbol@^3.0.2", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index", "author": { - "email": "medyk@medikoo.com", "name": "Mariusz Nowak", + "email": "medyk@medikoo.com", "url": "http://www.medikoo.com/" }, "bugs": { @@ -47,7 +60,7 @@ }, "dependencies": { "d": "~0.1.1", - "es5-ext": "~0.10.10" + "es5-ext": "~0.10.11" }, "description": "ECMAScript 6 Symbol polyfill", "devDependencies": { @@ -57,20 +70,20 @@ }, "directories": {}, "dist": { - "shasum": "1e928878c6f5e63541625b4bb4df4af07d154219", - "tarball": "http://registry.npmjs.org/es6-symbol/-/es6-symbol-3.0.2.tgz" + "shasum": "94481c655e7a7cad82eba832d97d5433496d7ffa", + "tarball": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.0.tgz" }, - "gitHead": "b7da6b926c44e3745de69b17c98c00a5c84b4ebe", + "gitHead": "f84175053e9cad6a1230f3b7cc13e078c3fcc12f", "homepage": "https://github.com/medikoo/es6-symbol#readme", "keywords": [ - "ecmascript", + "symbol", + "private", + "property", "es6", + "ecmascript", "harmony", - "polyfill", "ponyfill", - "private", - "property", - "symbol" + "polyfill" ], "license": "MIT", "maintainers": [ @@ -91,5 +104,5 @@ "lint-console": "node node_modules/xlint/bin/xlint --linter=node_modules/xlint-jslint-medikoo/index.js --watch", "test": "node ./node_modules/tad/bin/tad" }, - "version": "3.0.2" + "version": "3.1.0" } diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js index 7c3c8fe90025ca..48832a5f36f59e 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/polyfill.js @@ -1,4 +1,4 @@ -// ES2015 Symbol polyfill for environments that do not support it (or partially support it_ +// ES2015 Symbol polyfill for environments that do not support it (or partially support it) 'use strict'; @@ -7,9 +7,16 @@ var d = require('d') , create = Object.create, defineProperties = Object.defineProperties , defineProperty = Object.defineProperty, objPrototype = Object.prototype - , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null); + , NativeSymbol, SymbolPolyfill, HiddenSymbol, globalSymbols = create(null) + , isNativeSafe; -if (typeof Symbol === 'function') NativeSymbol = Symbol; +if (typeof Symbol === 'function') { + NativeSymbol = Symbol; + try { + String(NativeSymbol()); + isNativeSafe = true; + } catch (ignore) {} +} var generateName = (function () { var created = create(null); @@ -45,6 +52,7 @@ HiddenSymbol = function Symbol(description) { module.exports = SymbolPolyfill = function Symbol(description) { var symbol; if (this instanceof Symbol) throw new TypeError('TypeError: Symbol is not a constructor'); + if (isNativeSafe) return NativeSymbol(description); symbol = create(HiddenSymbol.prototype); description = (description === undefined ? '' : String(description)); return defineProperties(symbol, { @@ -91,8 +99,11 @@ defineProperties(SymbolPolyfill.prototype, { toString: d(function () { return 'Symbol (' + validateSymbol(this).__description__ + ')'; }), valueOf: d(function () { return validateSymbol(this); }) }); -defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', - function () { return validateSymbol(this); })); +defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toPrimitive, d('', function () { + var symbol = validateSymbol(this); + if (typeof symbol === 'symbol') return symbol; + return symbol.toString(); +})); defineProperty(SymbolPolyfill.prototype, SymbolPolyfill.toStringTag, d('c', 'Symbol')); // Proper implementaton of toPrimitive and toStringTag for returned symbol instances diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js index 83fb5e9253677b..8b657905de57d7 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/test/polyfill.js @@ -18,8 +18,10 @@ module.exports = function (T, a) { x = {}; x[symbol] = 'foo'; - a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, - value: 'foo', writable: true }); + if (typeof symbol !== 'symbol') { + a.deep(Object.getOwnPropertyDescriptor(x, symbol), { configurable: true, enumerable: false, + value: 'foo', writable: true }); + } symbol = T.for('marko'); a(isSymbol(symbol), true); a(T.for('marko'), symbol); diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json index dd33e385601890..a4e27587fa7aa1 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "array-index@^1.0.0", + { + "raw": "array-index@^1.0.0", + "scope": null, + "escapedName": "array-index", + "name": "array-index", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array/array-index", "_nodeVersion": "5.3.0", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "array-index", "raw": "array-index@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "array-index", + "name": "array-index", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "array-index@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp/node_modules/path-array", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://tootallnate.net" }, "bugs": { @@ -50,7 +59,7 @@ "directories": {}, "dist": { "shasum": "ec56a749ee103e4e08c790b9c353df16055b97f9", - "tarball": "http://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/array-index/-/array-index-1.0.0.tgz" }, "engines": { "node": "*" @@ -58,11 +67,11 @@ "gitHead": "4b3cc059c70eefd8ef2a0d4213d681b671eb3d11", "homepage": "https://github.com/TooTallNate/array-index#readme", "keywords": [ + "index", "array", "getter", - "index", - "proxy", - "setter" + "setter", + "proxy" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json index e69958df330685..df328efaf55c3a 100644 --- a/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json +++ b/deps/npm/node_modules/node-gyp/node_modules/path-array/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "path-array@^1.0.0", + { + "raw": "path-array@^1.0.0", + "scope": null, + "escapedName": "path-array", + "name": "path-array", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/node-gyp" ] ], @@ -12,16 +20,17 @@ "_location": "/node-gyp/path-array", "_nodeVersion": "5.3.0", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "path-array", "raw": "path-array@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "path-array", + "name": "path-array", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "path-array@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/node-gyp", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, "bugs": { @@ -51,14 +60,14 @@ "directories": {}, "dist": { "shasum": "7e2f0f35f07a2015122b868b7eac0eb2c4fec271", - "tarball": "http://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" + "tarball": "https://registry.npmjs.org/path-array/-/path-array-1.0.1.tgz" }, "gitHead": "d249bd897661ca60720218edabbfeaa73c67778a", "homepage": "https://github.com/TooTallNate/node-path-array", "keywords": [ "PATH", - "array", - "env" + "env", + "array" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index bbbc22ce91b18a..8b68bc3213db9c 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -1,49 +1,55 @@ { "_args": [ [ - "node-gyp@3.3.1", - "/Users/rebecca/code/npm" + { + "raw": "node-gyp@latest", + "scope": null, + "escapedName": "node-gyp", + "name": "node-gyp", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "node-gyp@3.3.1", - "_id": "node-gyp@3.3.1", + "_from": "node-gyp@latest", + "_id": "node-gyp@3.4.0", "_inCache": true, "_installable": true, "_location": "/node-gyp", - "_nodeVersion": "6.0.0-pre", + "_nodeVersion": "6.2.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/node-gyp-3.3.1.tgz_1457115144174_0.4018901875242591" + "tmp": "tmp/node-gyp-3.4.0.tgz_1467079381888_0.1804589256644249" }, "_npmUser": { - "email": "info@bnoordhuis.nl", - "name": "bnoordhuis" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": { - "inflight": "1.0.4", - "inherits": "2.0.1", - "once": "1.3.3" + "name": "rvagg", + "email": "rod@vagg.org" }, + "_npmVersion": "3.9.3", + "_phantomChildren": {}, "_requested": { - "name": "node-gyp", - "raw": "node-gyp@3.3.1", - "rawSpec": "3.3.1", + "raw": "node-gyp@latest", "scope": null, - "spec": "3.3.1", - "type": "version" + "escapedName": "node-gyp", + "name": "node-gyp", + "rawSpec": "latest", + "spec": "latest", + "type": "tag" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz", - "_shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", + "_resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz", + "_shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", "_shrinkwrap": null, - "_spec": "node-gyp@3.3.1", - "_where": "/Users/rebecca/code/npm", + "_spec": "node-gyp@latest", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://tootallnate.net" }, "bin": { @@ -54,12 +60,12 @@ }, "dependencies": { "fstream": "^1.0.0", - "glob": "3 || 4", + "glob": "^7.0.3", "graceful-fs": "^4.1.2", - "minimatch": "1", + "minimatch": "^3.0.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", - "npmlog": "0 || 1 || 2", + "npmlog": "0 || 1 || 2 || 3", "osenv": "0", "path-array": "^1.0.0", "request": "2", @@ -70,17 +76,20 @@ }, "description": "Node.js native addon build tool", "devDependencies": { + "bindings": "~1.2.1", + "nan": "^2.0.0", + "require-inject": "~1.3.0", "tape": "~4.2.0" }, "directories": {}, "dist": { - "shasum": "80f7b6d7c2f9c0495ba42c518a670c99bdf6e4a0", - "tarball": "http://registry.npmjs.org/node-gyp/-/node-gyp-3.3.1.tgz" + "shasum": "dda558393b3ecbbe24c9e6b8703c71194c63fa36", + "tarball": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.4.0.tgz" }, "engines": { "node": ">= 0.8.0" }, - "gitHead": "1dcf356ca7b658789447108b29a985c00ffcf0f5", + "gitHead": "d460084b241c427655497a1de4ed351a13ffb47f", "homepage": "https://github.com/nodejs/node-gyp#readme", "installVersion": 9, "keywords": [ @@ -96,28 +105,28 @@ "main": "./lib/node-gyp.js", "maintainers": [ { - "email": "nathan@tootallnate.net", - "name": "TooTallNate" + "name": "TooTallNate", + "email": "nathan@tootallnate.net" }, { - "email": "info@bnoordhuis.nl", - "name": "bnoordhuis" + "name": "bnoordhuis", + "email": "info@bnoordhuis.nl" }, { - "email": "fishrock123@rocketmail.com", - "name": "fishrock123" + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" } ], "name": "node-gyp", @@ -131,5 +140,5 @@ "scripts": { "test": "tape test/test-*" }, - "version": "3.3.1" + "version": "3.4.0" } diff --git a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c deleted file mode 100644 index b1e170aa13bd95..00000000000000 --- a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.c +++ /dev/null @@ -1,36 +0,0 @@ -/* - * When this file is linked to a DLL, it sets up a delay-load hook that - * intervenes when the DLL is trying to load 'node.exe' or 'iojs.exe' - * dynamically. Instead of trying to locate the .exe file it'll just return - * a handle to the process image. - * - * This allows compiled addons to work when node.exe or iojs.exe is renamed. - */ - -#ifdef _MSC_VER - -#ifndef WIN32_LEAN_AND_MEAN -#define WIN32_LEAN_AND_MEAN -#endif - -#include - -#include -#include - -static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { - HMODULE m; - if (event != dliNotePreLoadLibrary) - return NULL; - - if (_stricmp(info->szDll, "iojs.exe") != 0 && - _stricmp(info->szDll, "node.exe") != 0) - return NULL; - - m = GetModuleHandle(NULL); - return (FARPROC) m; -} - -PfnDliHook __pfnDliNotifyHook2 = load_exe_hook; - -#endif diff --git a/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc new file mode 100644 index 00000000000000..e75954b605101a --- /dev/null +++ b/deps/npm/node_modules/node-gyp/src/win_delay_load_hook.cc @@ -0,0 +1,36 @@ +/* + * When this file is linked to a DLL, it sets up a delay-load hook that + * intervenes when the DLL is trying to load 'node.exe' or 'iojs.exe' + * dynamically. Instead of trying to locate the .exe file it'll just return + * a handle to the process image. + * + * This allows compiled addons to work when node.exe or iojs.exe is renamed. + */ + +#ifdef _MSC_VER + +#ifndef WIN32_LEAN_AND_MEAN +#define WIN32_LEAN_AND_MEAN +#endif + +#include + +#include +#include + +static FARPROC WINAPI load_exe_hook(unsigned int event, DelayLoadInfo* info) { + HMODULE m; + if (event != dliNotePreLoadLibrary) + return NULL; + + if (_stricmp(info->szDll, "iojs.exe") != 0 && + _stricmp(info->szDll, "node.exe") != 0) + return NULL; + + m = GetModuleHandle(NULL); + return (FARPROC) m; +} + +decltype(__pfnDliNotifyHook2) __pfnDliNotifyHook2 = load_exe_hook; + +#endif diff --git a/deps/npm/node_modules/node-gyp/test/test-addon.js b/deps/npm/node_modules/node-gyp/test/test-addon.js new file mode 100644 index 00000000000000..c2a71f44985fda --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-addon.js @@ -0,0 +1,28 @@ +'use strict' + +var test = require('tape') +var execFile = require('child_process').execFile +var path = require('path') +var addonPath = path.resolve(__dirname, 'node_modules', 'hello_world') +var nodeGyp = path.resolve(__dirname, '..', 'bin', 'node-gyp.js') + +test('build simple addon', function (t) { + t.plan(3) + + // Set the loglevel otherwise the output disappears when run via 'npm test' + var cmd = [nodeGyp, 'rebuild', '-C', addonPath, '--loglevel=verbose'] + var proc = execFile(process.execPath, cmd, function (err, stdout, stderr) { + var logLines = stderr.toString().trim().split(/\r?\n/) + var lastLine = logLines[logLines.length-1] + t.strictEqual(err, null) + t.strictEqual(lastLine, 'gyp info ok', 'should end in ok') + try { + var binding = require('hello_world') + t.strictEqual(binding.hello(), 'world') + } catch (error) { + t.error(error, 'load module') + } + }) + proc.stdout.setEncoding('utf-8') + proc.stderr.setEncoding('utf-8') +}) diff --git a/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js b/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js new file mode 100644 index 00000000000000..d336243dd0d7b7 --- /dev/null +++ b/deps/npm/node_modules/node-gyp/test/test-find-accessible-sync.js @@ -0,0 +1,86 @@ +'use strict' + +var test = require('tape') +var path = require('path') +var requireInject = require('require-inject') +var configure = requireInject('../lib/configure', { + 'graceful-fs': { + 'closeSync': function (fd) { return undefined }, + 'openSync': function (path) { + if (readableFiles.some(function (f) { return f === path} )) { + return 0 + } else { + var error = new Error('ENOENT - not found') + throw error + } + } + } +}) + +var dir = path.sep + 'testdir' +var readableFile = 'readable_file' +var anotherReadableFile = 'another_readable_file' +var readableFileInDir = 'somedir' + path.sep + readableFile +var readableFiles = [ + path.resolve(dir, readableFile), + path.resolve(dir, anotherReadableFile), + path.resolve(dir, readableFileInDir) +] + +test('find accessible - empty array', function (t) { + t.plan(1) + + var candidates = [] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + +test('find accessible - single item array, readable', function (t) { + t.plan(1) + + var candidates = [ readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - single item array, readable in subdir', function (t) { + t.plan(1) + + var candidates = [ readableFileInDir ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFileInDir)) +}) + +test('find accessible - single item array, unreadable', function (t) { + t.plan(1) + + var candidates = [ 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, no matches', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', 'unreadable_file' ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, undefined) +}) + + +test('find accessible - multi item array, single match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, readableFile)) +}) + +test('find accessible - multi item array, return first match', function (t) { + t.plan(1) + + var candidates = [ 'non_existent_file', anotherReadableFile, readableFile ] + var found = configure.test.findAccessibleSync('test', dir, candidates) + t.strictEqual(found, path.resolve(dir, anotherReadableFile)) +}) diff --git a/deps/npm/node_modules/npm-package-arg/.travis.yml b/deps/npm/node_modules/npm-package-arg/.travis.yml index e5a5a8b9ec5683..d8ce5e1a74d48f 100644 --- a/deps/npm/node_modules/npm-package-arg/.travis.yml +++ b/deps/npm/node_modules/npm-package-arg/.travis.yml @@ -7,3 +7,4 @@ node_js: - "0.10" sudo: false script: "npm test" + diff --git a/deps/npm/node_modules/npm-registry-client/.travis.yml b/deps/npm/node_modules/npm-registry-client/.travis.yml index 3669bc76e06c05..2993ae58c9afbe 100644 --- a/deps/npm/node_modules/npm-registry-client/.travis.yml +++ b/deps/npm/node_modules/npm-registry-client/.travis.yml @@ -1,9 +1,9 @@ language: node_js node_js: - - "0.12" + - "4" + - "6" - "0.10" - - "0.8" - - iojs + - "0.12" script: "npm test" sudo: false before_install: diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index 2caa3643708f80..9d81f4df39e0dd 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -259,6 +259,8 @@ caching logic directly. * `etag` {String} The cached ETag. Optional. * `lastModified` {String} The cached Last-Modified timestamp. Optional. * `follow` {Boolean} Follow 302/301 responses. Optional (default: true). + * `streaming` {Boolean} Stream the request body as it comes, handling error + responses in a non-streaming way. * `auth` {Credentials} Optional. * `cb` {Function} * `error` {Error | null} diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index 13e61debfd4acb..9bf1c3066d1463 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -153,8 +153,9 @@ function putNext (registry, newVersion, root, current, auth, cb) { case 'dist-tags': case 'versions': case '_attachments': - for (var j in root[i]) + for (var j in root[i]) { current[i][j] = root[i][j] + } break // ignore these diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 567fc8dbe42b16..04be044d6a0e27 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -92,7 +92,16 @@ function regRequest (uri, params, cb_) { } function makeRequest (uri, params, cb_) { - var cb = once(cb_) + var socket + var cb = once(function (er, parsed, raw, response) { + if (socket) { + // The socket might be returned to a pool for re-use, so don’t keep + // the 'error' listener from here attached. + socket.removeListener('error', cb) + } + + return cb_(er, parsed, raw, response) + }) var parsed = url.parse(uri) var headers = {} @@ -146,13 +155,42 @@ function makeRequest (uri, params, cb_) { this.log.http('request', params.method, parsed.href || '/') var done = requestDone.call(this, params.method, uri, cb) - var req = request(opts, decodeResponseBody(done)) + var req = request(opts, params.streaming ? undefined : decodeResponseBody(done)) req.on('error', cb) + + // This should not be necessary, as the HTTP implementation in Node + // passes errors occurring on the socket to the request itself. Being overly + // cautious comes at a low cost, though. req.on('socket', function (s) { - s.on('error', cb) + socket = s + socket.on('error', cb) }) + if (params.streaming) { + req.on('response', function (response) { + if (response.statusCode >= 400) { + var parts = [] + response.on('data', function (data) { + parts.push(data) + }) + response.on('end', function () { + decodeResponseBody(done)(null, response, Buffer.concat(parts)) + }) + } else { + response.on('end', function () { + // don't ever re-use connections that had server errors. + // those sockets connect to the Bad Place! + if (response.socket && response.statusCode > 500) { + response.socket.destroy() + } + }) + + return cb(null, response) + } + }) + } + if (params.body && (params.body instanceof Stream)) { params.body.pipe(req) } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE index 1e836b4760025f..99c130e1de3427 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/LICENSE @@ -2,23 +2,23 @@ The MIT License Copyright (c) 2013 Max Ogden -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, +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 +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 +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/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js index b55ae7e03dbd38..b16ad1343f560d 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/index.js @@ -73,6 +73,10 @@ function isArrayish (arr) { return /Array\]$/.test(Object.prototype.toString.call(arr)) } +function isBufferish (p) { + return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function') +} + function stringConcat (parts) { var strings = [] var needsToString = false @@ -82,8 +86,10 @@ function stringConcat (parts) { strings.push(p) } else if (Buffer.isBuffer(p)) { strings.push(p) + } else if (isBufferish(p)) { + strings.push(new Buffer(p)) } else { - strings.push(Buffer(p)) + strings.push(new Buffer(String(p))) } } if (Buffer.isBuffer(parts[0])) { @@ -101,10 +107,11 @@ function bufferConcat (parts) { var p = parts[i] if (Buffer.isBuffer(p)) { bufs.push(p) - } else if (typeof p === 'string' || isArrayish(p) - || (p && typeof p.subarray === 'function')) { - bufs.push(Buffer(p)) - } else bufs.push(Buffer(String(p))) + } else if (isBufferish(p)) { + bufs.push(new Buffer(p)) + } else { + bufs.push(new Buffer(String(p))) + } } return Buffer.concat(bufs) } @@ -121,7 +128,7 @@ function u8Concat (parts) { var len = 0 for (var i = 0; i < parts.length; i++) { if (typeof parts[i] === 'string') { - parts[i] = Buffer(parts[i]) + parts[i] = new Buffer(parts[i]) } len += parts[i].length } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md index 1a67c48cd031b5..86b95a3bf6df4e 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/README.md @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.markdown). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js index e57dabdcebc9c1..425950f9fc9ed7 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/node_modules/typedarray/test/server/undef_globals.js @@ -11,7 +11,7 @@ test('u8a without globals', function (t) { vm.runInNewContext(src, c); var TA = c.module.exports; var ua = new(TA.Uint8Array)(5); - + t.equal(ua.length, 5); ua[1] = 256 + 55; t.equal(ua[1], 55); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json index 5a3f8b401e4449..7c8b5de3b43c93 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/package.json @@ -1,43 +1,109 @@ { - "name": "concat-stream", - "version": "1.5.1", - "description": "writable stream that concatenates strings or binary data and calls a callback with the result", - "tags": [ - "stream", - "simple", - "util", - "utility" + "_args": [ + [ + { + "raw": "concat-stream@^1.5.2", + "scope": null, + "escapedName": "concat-stream", + "name": "concat-stream", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" + ] + ], + "_from": "concat-stream@>=1.5.2 <2.0.0", + "_id": "concat-stream@1.5.2", + "_inCache": true, + "_location": "/npm-registry-client/concat-stream", + "_nodeVersion": "4.4.3", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/concat-stream-1.5.2.tgz_1472715196934_0.010375389130786061" + }, + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "2.15.9", + "_phantomChildren": { + "inherits": "2.0.3" + }, + "_requested": { + "raw": "concat-stream@^1.5.2", + "scope": null, + "escapedName": "concat-stream", + "name": "concat-stream", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client" ], + "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz", + "_shasum": "708978624d856af41a5a741defdd261da752c266", + "_shrinkwrap": null, + "_spec": "concat-stream@^1.5.2", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", "author": { "name": "Max Ogden", "email": "max@maxogden.com" }, - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/maxogden/concat-stream.git" - }, "bugs": { "url": "http://github.com/maxogden/concat-stream/issues" }, + "dependencies": { + "inherits": "~2.0.1", + "readable-stream": "~2.0.0", + "typedarray": "~0.0.5" + }, + "description": "writable stream that concatenates strings or binary data and calls a callback with the result", + "devDependencies": { + "tape": "~2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "708978624d856af41a5a741defdd261da752c266", + "tarball": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.2.tgz" + }, "engines": [ "node >= 0.8" ], - "main": "index.js", "files": [ "index.js" ], - "scripts": { - "test": "tape test/*.js test/server/*.js" - }, + "gitHead": "731fedd137eae89d066c249fdca070f8f16afbb8", + "homepage": "https://github.com/maxogden/concat-stream#readme", "license": "MIT", - "dependencies": { - "inherits": "~2.0.1", - "typedarray": "~0.0.5", - "readable-stream": "~2.0.0" + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + { + "name": "maxogden", + "email": "max@maxogden.com" + } + ], + "name": "concat-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/maxogden/concat-stream.git" }, - "devDependencies": { - "tape": "~2.3.2" + "scripts": { + "test": "tape test/*.js test/server/*.js" }, + "tags": [ + "stream", + "simple", + "util", + "utility" + ], "testling": { "files": "test/*.js", "browsers": [ @@ -54,28 +120,5 @@ "android-browser/4.2..latest" ] }, - "gitHead": "522adc12d82f57c691a5f946fbc8ba08718dcdcb", - "homepage": "https://github.com/maxogden/concat-stream#readme", - "_id": "concat-stream@1.5.1", - "_shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", - "_from": "concat-stream@>=1.4.6 <2.0.0", - "_npmVersion": "2.14.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "maxogden", - "email": "max@maxogden.com" - }, - "dist": { - "shasum": "f3b80acf9e1f48e3875c0688b41b6c31602eea1c", - "tarball": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz" - }, - "maintainers": [ - { - "name": "maxogden", - "email": "max@maxogden.com" - } - ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.5.1.tgz", - "readme": "ERROR: No README data found!" + "version": "1.5.2" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md index fdfbc40b47e256..8ad4197c9ed9a6 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/concat-stream/readme.md @@ -77,7 +77,7 @@ var concat = require('concat-stream') Return a `writable` stream that will fire `cb(data)` with all of the data that was written to the stream. Data can be written to `writable` as strings, -Buffers, arrays of byte integers, and Uint8Arrays. +Buffers, arrays of byte integers, and Uint8Arrays. By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason. @@ -89,6 +89,8 @@ By default `concat-stream` will give you back the same data type as the type of If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`. +If nothing is written to `writable` then `data` will be an empty array `[]`. + # error handling `concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md new file mode 100644 index 00000000000000..f549a1f3de81e3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/CHANGELOG.md @@ -0,0 +1,36 @@ +### v3.1.2 + +* Update to `gauge@1.6.0` adding support for default values for template + items. + +### v3.1.1 + +* Update to `gauge@1.5.3` to fix to `1.x` compatibility when it comes to + when a progress bar is enabled. In `1.x` if you didn't have a TTY the + progress bar was never shown. In `2.x` it merely defaults to disabled, + but you can enable it explicitly if you still want progress updates. + +### v3.1.0 + +* Update to `gauge@2.5.2`: + * Updates the `signal-exit` dependency which fixes an incompatibility with + the node profiler. + * Uses externalizes its ansi code generation in `console-control-strings` +* Make the default progress bar include the last line printed, colored as it + would be when printing to a tty. + +### v3.0.0 + +* Switch to `gauge@2.0.0`, for better performance, better look. +* Set stderr/stdout blocking if they're tty's, so that we can hide a + progress bar going to stderr and then safely print to stdout. Without + this the two can end up overlapping producing confusing and sometimes + corrupted output. + +### v2.0.0 + +* Make the `error` event non-fatal so that folks can use it as a prefix. + +### v1.0.0 + +* Add progress bar with `gauge@1.1.0` diff --git a/deps/npm/node_modules/node-gyp/node_modules/glob/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/LICENSE similarity index 100% rename from deps/npm/node_modules/node-gyp/node_modules/glob/LICENSE rename to deps/npm/node_modules/npm-registry-client/node_modules/npmlog/LICENSE diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md new file mode 100644 index 00000000000000..dba35501614e91 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/README.md @@ -0,0 +1,210 @@ +# npmlog + +The logger util that npm uses. + +This logger is very basic. It does the logging for npm. It supports +custom levels and colored output. + +By default, logs are written to stderr. If you want to send log messages +to outputs other than streams, then you can change the `log.stream` +member, or you can just listen to the events that it emits, and do +whatever you want with them. + +# Basic Usage + +``` +var log = require('npmlog') + +// additional stuff ---------------------------+ +// message ----------+ | +// prefix ----+ | | +// level -+ | | | +// v v v v + log.info('fyi', 'I have a kitty cat: %j', myKittyCat) +``` + +## log.level + +* {String} + +The level to display logs at. Any logs at or above this level will be +displayed. The special level `silent` will prevent anything from being +displayed ever. + +## log.record + +* {Array} + +An array of all the log messages that have been entered. + +## log.maxRecordSize + +* {Number} + +The maximum number of records to keep. If log.record gets bigger than +10% over this value, then it is sliced down to 90% of this value. + +The reason for the 10% window is so that it doesn't have to resize a +large array on every log entry. + +## log.prefixStyle + +* {Object} + +A style object that specifies how prefixes are styled. (See below) + +## log.headingStyle + +* {Object} + +A style object that specifies how the heading is styled. (See below) + +## log.heading + +* {String} Default: "" + +If set, a heading that is printed at the start of every line. + +## log.stream + +* {Stream} Default: `process.stderr` + +The stream where output is written. + +## log.enableColor() + +Force colors to be used on all messages, regardless of the output +stream. + +## log.disableColor() + +Disable colors on all messages. + +## log.enableProgress() + +Enable the display of log activity spinner and progress bar + +## log.disableProgress() + +Disable the display of a progress bar + +## log.enableUnicode() + +Force the unicode theme to be used for the progress bar. + +## log.disableUnicode() + +Disable the use of unicode in the progress bar. + +## log.setGaugeTemplate(template) + +Set a template for outputting the progress bar. See the [gauge documentation] for details. + +[gauge documentation]: https://npmjs.com/package/gauge + +## log.setGaugeThemeset(themes) + +Select a themeset to pick themes from for the progress bar. See the [gauge documentation] for details. + +## log.pause() + +Stop emitting messages to the stream, but do not drop them. + +## log.resume() + +Emit all buffered messages that were written while paused. + +## log.log(level, prefix, message, ...) + +* `level` {String} The level to emit the message at +* `prefix` {String} A string prefix. Set to "" to skip. +* `message...` Arguments to `util.format` + +Emit a log message at the specified level. + +## log\[level](prefix, message, ...) + +For example, + +* log.silly(prefix, message, ...) +* log.verbose(prefix, message, ...) +* log.info(prefix, message, ...) +* log.http(prefix, message, ...) +* log.warn(prefix, message, ...) +* log.error(prefix, message, ...) + +Like `log.log(level, prefix, message, ...)`. In this way, each level is +given a shorthand, so you can do `log.info(prefix, message)`. + +## log.addLevel(level, n, style, disp) + +* `level` {String} Level indicator +* `n` {Number} The numeric level +* `style` {Object} Object with fg, bg, inverse, etc. +* `disp` {String} Optional replacement for `level` in the output. + +Sets up a new level with a shorthand function and so forth. + +Note that if the number is `Infinity`, then setting the level to that +will cause all log messages to be suppressed. If the number is +`-Infinity`, then the only way to show it is to enable all log messages. + +## log.newItem(name, todo, weight) + +* `name` {String} Optional; progress item name. +* `todo` {Number} Optional; total amount of work to be done. Default 0. +* `weight` {Number} Optional; the weight of this item relative to others. Default 1. + +This adds a new `are-we-there-yet` item tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `Tracker` object. + +## log.newStream(name, todo, weight) + +This adds a new `are-we-there-yet` stream tracker to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerStream` object. + +## log.newGroup(name, weight) + +This adds a new `are-we-there-yet` tracker group to the progress tracker. The +object returned has the `log[level]` methods but is otherwise an +`are-we-there-yet` `TrackerGroup` object. + +# Events + +Events are all emitted with the message object. + +* `log` Emitted for all messages +* `log.` Emitted for all messages with the `` level. +* `` Messages with prefixes also emit their prefix as an event. + +# Style Objects + +Style objects can have the following fields: + +* `fg` {String} Color for the foreground text +* `bg` {String} Color for the background +* `bold`, `inverse`, `underline` {Boolean} Set the associated property +* `bell` {Boolean} Make a noise (This is pretty annoying, probably.) + +# Message Objects + +Every log event is emitted with a message object, and the `log.record` +list contains all of them that have been created. They have the +following fields: + +* `id` {Number} +* `level` {String} +* `prefix` {String} +* `message` {String} Result of `util.format()` +* `messageRaw` {Array} Arguments to `util.format()` + +# Blocking TTYs + +We use [`set-blocking`](https://npmjs.com/package/set-blocking) to set +stderr and stdout blocking if they are tty's and have the setBlocking call. +This is a work around for an issue in early versions of Node.js 6.x, which +made stderr and stdout non-blocking on OSX. (They are always blocking +Windows and were never blocking on Linux.) `npmlog` needs them to be blocking +so that it can allow output to stdout and stderr to be interlaced. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js new file mode 100644 index 00000000000000..e5b70f1f80b743 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/log.js @@ -0,0 +1,298 @@ +'use strict' +var Progress = require('are-we-there-yet') +var Gauge = require('gauge') +var EE = require('events').EventEmitter +var log = exports = module.exports = new EE() +var util = require('util') + +var setBlocking = require('set-blocking') +var consoleControl = require('console-control-strings') + +setBlocking(true) +var stream = process.stderr +Object.defineProperty(log, 'stream', { + set: function (newStream) { + stream = newStream + if (this.gauge) this.gauge.setWriteTo(stream, stream) + }, + get: function () { + return stream + } +}) + +// by default, decide based on tty-ness. +var colorEnabled +log.useColor = function () { + return colorEnabled != null ? colorEnabled : stream.isTTY +} + +log.enableColor = function () { + colorEnabled = true + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} +log.disableColor = function () { + colorEnabled = false + this.gauge.setTheme({hasColor: colorEnabled, hasUnicode: unicodeEnabled}) +} + +// default level +log.level = 'info' + +log.gauge = new Gauge(stream, { + theme: {hasColor: log.useColor()}, + template: [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', default: ''}, + ':', + {type: 'logline', kerning: 1, default: ''} + ] +}) + +log.tracker = new Progress.TrackerGroup() + +// no progress bars unless asked +log.progressEnabled = false + +var unicodeEnabled + +log.enableUnicode = function () { + unicodeEnabled = true + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.disableUnicode = function () { + unicodeEnabled = false + this.gauge.setTheme({hasColor: this.useColor(), hasUnicode: unicodeEnabled}) +} + +log.setGaugeThemeset = function (themes) { + this.gauge.setThemeset(themes) +} + +log.setGaugeTemplate = function (template) { + this.gauge.setTemplate(template) +} + +log.enableProgress = function () { + if (this.progressEnabled) return + this.progressEnabled = true + if (this._pause) return + this.tracker.on('change', this.showProgress) + this.gauge.enable() + this.showProgress() +} + +log.disableProgress = function () { + if (!this.progressEnabled) return + this.clearProgress() + this.progressEnabled = false + this.tracker.removeListener('change', this.showProgress) + this.gauge.disable() +} + +var trackerConstructors = ['newGroup', 'newItem', 'newStream'] + +var mixinLog = function (tracker) { + // mixin the public methods from log into the tracker + // (except: conflicts and one's we handle specially) + Object.keys(log).forEach(function (P) { + if (P[0] === '_') return + if (trackerConstructors.filter(function (C) { return C === P }).length) return + if (tracker[P]) return + if (typeof log[P] !== 'function') return + var func = log[P] + tracker[P] = function () { + return func.apply(log, arguments) + } + }) + // if the new tracker is a group, make sure any subtrackers get + // mixed in too + if (tracker instanceof Progress.TrackerGroup) { + trackerConstructors.forEach(function (C) { + var func = tracker[C] + tracker[C] = function () { return mixinLog(func.apply(tracker, arguments)) } + }) + } + return tracker +} + +// Add tracker constructors to the top level log object +trackerConstructors.forEach(function (C) { + log[C] = function () { return mixinLog(this.tracker[C].apply(this.tracker, arguments)) } +}) + +log.clearProgress = function (cb) { + if (!this.progressEnabled) return cb && process.nextTick(cb) + this.gauge.hide(cb) +} + +log.showProgress = function (name, completed) { + if (!this.progressEnabled) return + var values = {} + if (name) values.section = name + var last = log.record[log.record.length - 1] + if (last) { + values.subsection = last.prefix + var disp = log.disp[last.level] || last.level + var logline = this._format(disp, log.style[last.level]) + if (last.prefix) logline += ' ' + this._format(last.prefix, this.prefixStyle) + logline += ' ' + last.message.split(/\r?\n/)[0] + values.logline = logline + } + values.completed = completed || this.tracker.completed() + this.gauge.show(values) +}.bind(log) // bind for use in tracker's on-change listener + +// temporarily stop emitting, but don't drop +log.pause = function () { + this._paused = true +} + +log.resume = function () { + if (!this._paused) return + this._paused = false + + var b = this._buffer + this._buffer = [] + b.forEach(function (m) { + this.emitLog(m) + }, this) + if (this.progressEnabled) this.enableProgress() +} + +log._buffer = [] + +var id = 0 +log.record = [] +log.maxRecordSize = 10000 +log.log = function (lvl, prefix, message) { + var l = this.levels[lvl] + if (l === undefined) { + return this.emit('error', new Error(util.format( + 'Undefined log level: %j', lvl))) + } + + var a = new Array(arguments.length - 2) + var stack = null + for (var i = 2; i < arguments.length; i++) { + var arg = a[i - 2] = arguments[i] + + // resolve stack traces to a plain string. + if (typeof arg === 'object' && arg && + (arg instanceof Error) && arg.stack) { + arg.stack = stack = arg.stack + '' + } + } + if (stack) a.unshift(stack + '\n') + message = util.format.apply(util, a) + + var m = { id: id++, + level: lvl, + prefix: String(prefix || ''), + message: message, + messageRaw: a } + + this.emit('log', m) + this.emit('log.' + lvl, m) + if (m.prefix) this.emit(m.prefix, m) + + this.record.push(m) + var mrs = this.maxRecordSize + var n = this.record.length - mrs + if (n > mrs / 10) { + var newSize = Math.floor(mrs * 0.9) + this.record = this.record.slice(-1 * newSize) + } + + this.emitLog(m) +}.bind(log) + +log.emitLog = function (m) { + if (this._paused) { + this._buffer.push(m) + return + } + if (this.progressEnabled) this.gauge.pulse(m.prefix) + var l = this.levels[m.level] + if (l === undefined) return + if (l < this.levels[this.level]) return + if (l > 0 && !isFinite(l)) return + + var disp = log.disp[m.level] || m.level + this.clearProgress() + m.message.split(/\r?\n/).forEach(function (line) { + if (this.heading) { + this.write(this.heading, this.headingStyle) + this.write(' ') + } + this.write(disp, log.style[m.level]) + var p = m.prefix || '' + if (p) this.write(' ') + this.write(p, this.prefixStyle) + this.write(' ' + line + '\n') + }, this) + this.showProgress() +} + +log._format = function (msg, style) { + if (!stream) return + + var output = '' + if (this.useColor()) { + style = style || {} + var settings = [] + if (style.fg) settings.push(style.fg) + if (style.bg) settings.push('bg' + style.bg[0].toUpperCase() + style.bg.slice(1)) + if (style.bold) settings.push('bold') + if (style.underline) settings.push('underline') + if (style.inverse) settings.push('inverse') + if (settings.length) output += consoleControl.color(settings) + if (style.beep) output += consoleControl.beep() + } + output += msg + if (this.useColor()) { + output += consoleControl.color('reset') + } + return output +} + +log.write = function (msg, style) { + if (!stream) return + + stream.write(this._format(msg, style)) +} + +log.addLevel = function (lvl, n, style, disp) { + if (!disp) disp = lvl + this.levels[lvl] = n + this.style[lvl] = style + if (!this[lvl]) { + this[lvl] = function () { + var a = new Array(arguments.length + 1) + a[0] = lvl + for (var i = 0; i < arguments.length; i++) { + a[i + 1] = arguments[i] + } + return this.log.apply(this, a) + }.bind(this) + } + this.disp[lvl] = disp +} + +log.prefixStyle = { fg: 'magenta' } +log.headingStyle = { fg: 'white', bg: 'black' } + +log.style = {} +log.levels = {} +log.disp = {} +log.addLevel('silly', -Infinity, { inverse: true }, 'sill') +log.addLevel('verbose', 1000, { fg: 'blue', bg: 'black' }, 'verb') +log.addLevel('info', 2000, { fg: 'green' }) +log.addLevel('http', 3000, { fg: 'green', bg: 'black' }) +log.addLevel('warn', 4000, { fg: 'black', bg: 'yellow' }, 'WARN') +log.addLevel('error', 5000, { fg: 'red', bg: 'black' }, 'ERR!') +log.addLevel('silent', Infinity) + +// allow 'error' prefix +log.on('error', function () {}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore new file mode 100644 index 00000000000000..bc818974f8633f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore @@ -0,0 +1,5 @@ +*~ +.#* +node_modules +coverage +.nyc_output diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md new file mode 100644 index 00000000000000..e990b86ddfb416 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/CHANGES.md @@ -0,0 +1,19 @@ +Hi, figured we could actually use a changelog now: + +## 1.1.1 2016-01-29 + +* Fix a typo in stream completion tracker + +## 1.1.0 2016-01-29 + +* Rewrote completion percent computation to be low impact– no more walking a + tree of completion groups every time we need this info. Previously, with + medium sized tree of completion groups, even a relatively modest number of + calls to the top level `completed()` method would result in absurd numbers + of calls overall as it walked down the tree. We now, instead, keep track as + we bubble up changes, so the computation is limited to when data changes and + to the depth of that one branch, instead of _every_ node. (Plus, we were already + incurring _this_ cost, since we already bubbled out changes.) +* Moved different tracker types out to their own files. +* Made tests test for TOO MANY events too. +* Standarized the source code formatting diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE new file mode 100644 index 00000000000000..af4588069db82d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE @@ -0,0 +1,5 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md new file mode 100644 index 00000000000000..c41d39229244d2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -0,0 +1,194 @@ +are-we-there-yet +---------------- + +Track complex hiearchies of asynchronous task completion statuses. This is +intended to give you a way of recording and reporting the progress of the big +recursive fan-out and gather type workflows that are so common in async. + +What you do with this completion data is up to you, but the most common use case is to +feed it to one of the many progress bar modules. + +Most progress bar modules include a rudamentary version of this, but my +needs were more complex. + +Usage +===== + +```javascript +var TrackerGroup = require("are-we-there-yet").TrackerGroup + +var top = new TrackerGroup("program") + +var single = top.newItem("one thing", 100) +single.completeWork(20) + +console.log(top.completed()) // 0.2 + +fs.stat("file", function(er, stat) { + if (er) throw er + var stream = top.newStream("file", stat.size) + console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete + // and 50% * 20% == 10% + fs.createReadStream("file").pipe(stream).on("data", function (chunk) { + // do stuff with chunk + }) + top.on("change", function (name) { + // called each time a chunk is read from "file" + // top.completed() will start at 0.1 and fill up to 0.6 as the file is read + }) +}) +``` + +Shared Methods +============== + +All tracker objects described below have the following methods, they, along +with the event comprise the interface for consumers of tracker objects. + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. + +* tracker.finish() + +Marks the tracker as completed. With a TrackerGroup this marks all of its +components as completed. + +Marks all of the components of this tracker as finished, which in turn means +that `tracker.completed()` for this will now be 1. + +This will result in one or more `change` events being emitted. + +Events +====== + +All tracker objects emit `change` events with the following arguments: + +``` +function (name, completed, tracker) +``` + +`name` is the name of the tracker that originally emitted the event, +or if it didn't have one, the first containing tracker group that had one. + +`completed` is the percent complete (as returned by `tracker.completed()` method). + +`tracker` is the tracker object that you are listening for events on. + +TrackerGroup +============ + +* var tracker = new TrackerGroup(**name**) + + * **name** *(optional)* - The name of this tracker group, used in change + notifications if the component updating didn't have a name. Defaults to undefined. + +Creates a new empty tracker aggregation group. These are trackers whose +completion status is determined by the completion status of other trackers. + +* tracker.addUnit(**otherTracker**, **weight**) + + * **otherTracker** - Any of the other are-we-there-yet tracker objects + * **weight** *(optional)* - The weight to give the tracker, defaults to 1. + +Adds the **otherTracker** to this aggregation group. The weight determines +how long you expect this tracker to take to complete in proportion to other +units. So for instance, if you add one tracker with a weight of 1 and +another with a weight of 2, you're saying the second will take twice as long +to complete as the first. As such, the first will account for 33% of the +completion of this tracker and the second will account for the other 67%. + +Returns **otherTracker**. + +* var subGroup = tracker.newGroup(**name**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subGroup = tracker.addUnit(new TrackerGroup(name), weight) +``` + +* var subItem = tracker.newItem(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subItem = tracker.addUnit(new Tracker(name, todo), weight) +``` + +* var subStream = tracker.newStream(**name**, **todo**, **weight**) + +The above is exactly equivalent to: + +```javascript + var subStream = tracker.addUnit(new TrackerStream(name, todo), weight) +``` + +* console.log( tracker.debug() ) + +Returns a tree showing the completion of this tracker group and all of its +children, including recursively entering all of the children. + +Tracker +======= + +* var tracker = new Tracker(**name**, **todo**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **todo** *(optional)* The amount of work todo (a number). Defaults to 0. + +Ordinarily these are constructed as a part of a tracker group (via +`newItem`). + +* var completed = tracker.completed() + +Returns the ratio of completed work to work to be done. Range of 0 to 1. If +total work to be done is 0 then it will return 0. + +* tracker.addWork(**todo**) + + * **todo** A number to add to the amount of work to be done. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. + +* tracker.completeWork(**completed**) + + * **completed** A number to add to the work complete + +Increase the amount of work complete, thus increasing the completion percentage. +Will never increase the work completed past the amount of work todo. That is, +percentages > 100% are not allowed. Triggers a `change` event. + +* tracker.finish() + +Marks this tracker as finished, tracker.completed() will now be 1. Triggers +a `change` event. + +TrackerStream +============= + +* var tracker = new TrackerStream(**name**, **size**, **options**) + + * **name** *(optional)* The name of this counter to report in change + events. Defaults to undefined. + * **size** *(optional)* The number of bytes being sent through this stream. + * **options** *(optional)* A hash of stream options + +The tracker stream object is a pass through stream that updates an internal +tracker object each time a block passes through. It's intended to track +downloads, file extraction and other related activities. You use it by piping +your data source into it and then using it as your data source. + +If your data has a length attribute then that's used as the amount of work +completed when the chunk is passed through. If it does not (eg, object +streams) then each chunk counts as completing 1 unit of work, so your size +should be the total number of objects being streamed. + +* tracker.addWork(**todo**) + + * **todo** Increase the expected overall size by **todo** bytes. + +Increases the amount of work to be done, thus decreasing the completion +percentage. Triggers a `change` event. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js new file mode 100644 index 00000000000000..57d8743fdad177 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/index.js @@ -0,0 +1,4 @@ +'use strict' +exports.TrackerGroup = require('./tracker-group.js') +exports.Tracker = require('./tracker.js') +exports.TrackerStream = require('./tracker-stream.js') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore new file mode 100644 index 00000000000000..c2658d7d1b3184 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/.npmignore @@ -0,0 +1 @@ +node_modules/ diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md new file mode 100644 index 00000000000000..25959eab67b840 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md @@ -0,0 +1,22 @@ + +1.0.0 / 2015-12-14 +================== + + * Merge pull request #12 from kasicka/master + * Add license text + +0.1.0 / 2014-10-17 +================== + + * adds `.fluent()` to api + +0.0.3 / 2014-01-13 +================== + + * fix receiver for .method() + +0.0.2 / 2014-01-13 +================== + + * Object.defineProperty() sucks + * Initial commit diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License new file mode 100644 index 00000000000000..60de60addbe7e9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License @@ -0,0 +1,20 @@ +Copyright (c) 2015 TJ Holowaychuk + +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/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile new file mode 100644 index 00000000000000..a9dcfd50dbdb22 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Makefile @@ -0,0 +1,8 @@ + +test: + @./node_modules/.bin/mocha \ + --require should \ + --reporter spec \ + --bail + +.PHONY: test \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md new file mode 100644 index 00000000000000..ab8cf4ace15939 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/Readme.md @@ -0,0 +1,94 @@ + +# delegates + + Node method and accessor delegation utilty. + +## Installation + +``` +$ npm install delegates +``` + +## Example + +```js +var delegate = require('delegates'); + +... + +delegate(proto, 'request') + .method('acceptsLanguages') + .method('acceptsEncodings') + .method('acceptsCharsets') + .method('accepts') + .method('is') + .access('querystring') + .access('idempotent') + .access('socket') + .access('length') + .access('query') + .access('search') + .access('status') + .access('method') + .access('path') + .access('body') + .access('host') + .access('url') + .getter('subdomains') + .getter('protocol') + .getter('header') + .getter('stale') + .getter('fresh') + .getter('secure') + .getter('ips') + .getter('ip') +``` + +# API + +## Delegate(proto, prop) + +Creates a delegator instance used to configure using the `prop` on the given +`proto` object. (which is usually a prototype) + +## Delegate#method(name) + +Allows the given method `name` to be accessed on the host. + +## Delegate#getter(name) + +Creates a "getter" for the property with the given `name` on the delegated +object. + +## Delegate#setter(name) + +Creates a "setter" for the property with the given `name` on the delegated +object. + +## Delegate#access(name) + +Creates an "accessor" (ie: both getter *and* setter) for the property with the +given `name` on the delegated object. + +## Delegate#fluent(name) + +A unique type of "accessor" that works for a "fluent" API. When called as a +getter, the method returns the expected value. However, if the method is called +with a value, it will return itself so it can be chained. For example: + +```js +delegate(proto, 'request') + .fluent('query') + +// getter +var q = request.query(); + +// setter (chainable) +request + .query({ a: 1 }) + .query({ b: 2 }); +``` + +# License + + MIT diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js new file mode 100644 index 00000000000000..17c222d52935c6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/index.js @@ -0,0 +1,121 @@ + +/** + * Expose `Delegator`. + */ + +module.exports = Delegator; + +/** + * Initialize a delegator. + * + * @param {Object} proto + * @param {String} target + * @api public + */ + +function Delegator(proto, target) { + if (!(this instanceof Delegator)) return new Delegator(proto, target); + this.proto = proto; + this.target = target; + this.methods = []; + this.getters = []; + this.setters = []; + this.fluents = []; +} + +/** + * Delegate method `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.method = function(name){ + var proto = this.proto; + var target = this.target; + this.methods.push(name); + + proto[name] = function(){ + return this[target][name].apply(this[target], arguments); + }; + + return this; +}; + +/** + * Delegator accessor `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.access = function(name){ + return this.getter(name).setter(name); +}; + +/** + * Delegator getter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.getter = function(name){ + var proto = this.proto; + var target = this.target; + this.getters.push(name); + + proto.__defineGetter__(name, function(){ + return this[target][name]; + }); + + return this; +}; + +/** + * Delegator setter `name`. + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.setter = function(name){ + var proto = this.proto; + var target = this.target; + this.setters.push(name); + + proto.__defineSetter__(name, function(val){ + return this[target][name] = val; + }); + + return this; +}; + +/** + * Delegator fluent accessor + * + * @param {String} name + * @return {Delegator} self + * @api public + */ + +Delegator.prototype.fluent = function (name) { + var proto = this.proto; + var target = this.target; + this.fluents.push(name); + + proto[name] = function(val){ + if ('undefined' != typeof val) { + this[target][name] = val; + return this; + } else { + return this[target][name]; + } + }; + + return this; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json new file mode 100644 index 00000000000000..8c2c0ef2c310d3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json @@ -0,0 +1,96 @@ +{ + "_args": [ + [ + { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/are-we-there-yet" + ], + [ + { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet" + ] + ], + "_from": "delegates@^1.0.0", + "_id": "delegates@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/are-we-there-yet/delegates", + "_nodeVersion": "4.2.1", + "_npmUser": { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "delegates@^1.0.0", + "scope": null, + "escapedName": "delegates", + "name": "delegates", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/are-we-there-yet" + ], + "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "_shrinkwrap": null, + "_spec": "delegates@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet", + "bugs": { + "url": "https://github.com/visionmedia/node-delegates/issues" + }, + "dependencies": {}, + "description": "delegate methods and accessors to another property", + "devDependencies": { + "mocha": "*", + "should": "*" + }, + "directories": {}, + "dist": { + "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a", + "tarball": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz" + }, + "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49", + "homepage": "https://github.com/visionmedia/node-delegates#readme", + "keywords": [ + "delegate", + "delegation" + ], + "license": "MIT", + "maintainers": [ + { + "name": "tjholowaychuk", + "email": "tj@vision-media.ca" + }, + { + "name": "dominicbarnes", + "email": "dominic@dbarnes.info" + } + ], + "name": "delegates", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/visionmedia/node-delegates.git" + }, + "scripts": {}, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js new file mode 100644 index 00000000000000..7b6e3d4df19d90 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/test/index.js @@ -0,0 +1,94 @@ + +var assert = require('assert'); +var delegate = require('..'); + +describe('.method(name)', function(){ + it('should delegate methods', function(){ + var obj = {}; + + obj.request = { + foo: function(bar){ + assert(this == obj.request); + return bar; + } + }; + + delegate(obj, 'request').method('foo'); + + obj.foo('something').should.equal('something'); + }) +}) + +describe('.getter(name)', function(){ + it('should delegate getters', function(){ + var obj = {}; + + obj.request = { + get type() { + return 'text/html'; + } + } + + delegate(obj, 'request').getter('type'); + + obj.type.should.equal('text/html'); + }) +}) + +describe('.setter(name)', function(){ + it('should delegate setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').setter('type'); + + obj.type = 'hey'; + obj.request.type.should.equal('HEY'); + }) +}) + +describe('.access(name)', function(){ + it('should delegate getters and setters', function(){ + var obj = {}; + + obj.request = { + get type() { + return this._type.toUpperCase(); + }, + + set type(val) { + this._type = val; + } + } + + delegate(obj, 'request').access('type'); + + obj.type = 'hey'; + obj.type.should.equal('HEY'); + }) +}) + +describe('.fluent(name)', function () { + it('should delegate in a fluent fashion', function () { + var obj = { + settings: { + env: 'development' + } + }; + + delegate(obj, 'settings').fluent('env'); + + obj.env().should.equal('development'); + obj.env('production').should.equal(obj); + obj.settings.env.should.equal('production'); + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json new file mode 100644 index 00000000000000..f4fba2ad433a2c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/package.json @@ -0,0 +1,102 @@ +{ + "_args": [ + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "are-we-there-yet@~1.1.2", + "_id": "are-we-there-yet@1.1.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/are-we-there-yet", + "_nodeVersion": "4.2.2", + "_npmOperationalInternal": { + "host": "packages-13-west.internal.npmjs.com", + "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.8.1", + "_phantomChildren": {}, + "_requested": { + "raw": "are-we-there-yet@~1.1.2", + "scope": null, + "escapedName": "are-we-there-yet", + "name": "are-we-there-yet", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz", + "_shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "_shrinkwrap": null, + "_spec": "are-we-there-yet@~1.1.2", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "url": "http://re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/are-we-there-yet/issues" + }, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.0 || ^1.1.13" + }, + "description": "Keep track of the overall completion of many dispirate processes", + "devDependencies": { + "standard": "^6.0.8", + "tap": "^5.7.0" + }, + "directories": {}, + "dist": { + "shasum": "80e470e95a084794fe1899262c5667c6e88de1b3", + "tarball": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.2.tgz" + }, + "gitHead": "dd5706e2204cb681e78031d0ffe156ed4cc75823", + "homepage": "https://github.com/iarna/are-we-there-yet", + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "are-we-there-yet", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/are-we-there-yet.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js new file mode 100644 index 00000000000000..2aa7c05c5864fa --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/lib/test-event.js @@ -0,0 +1,29 @@ +'use strict' +var util = require('util') + +module.exports = function (obj, event, next) { + var timeout = setTimeout(gotTimeout, 10) + obj.once(event, gotResult) + + function gotTimeout () { + obj.removeListener(event, gotResult) + next(new Error('Timeout listening for ' + event)) + } + var result = [] + function gotResult () { + result = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + timeout = setTimeout(gotNoMoreResults, 10) + obj.once(event, gotTooManyResults) + } + function gotNoMoreResults () { + obj.removeListener(event, gotTooManyResults) + var args = [null].concat(result) + next.apply(null, args) + } + function gotTooManyResults () { + var secondResult = Array.prototype.slice.call(arguments) + clearTimeout(timeout) + next(new Error('Got too many results, first ' + util.inspect(result) + ' and then ' + util.inspect(secondResult))) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js new file mode 100644 index 00000000000000..374c7739d0c011 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/tracker.js @@ -0,0 +1,57 @@ +'use strict' +var test = require('tap').test +var Tracker = require('../index.js').Tracker + +var testEvent = require('./lib/test-event.js') + +var name = 'test' + +test('initialization', function (t) { + var simple = new Tracker(name) + + t.is(simple.completed(), 0, 'Nothing todo is 0 completion') + t.done() +}) + +var track +var todo = 100 +test('completion', function (t) { + track = new Tracker(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + testEvent(track, 'change', afterCompleteWork) + + track.completeWork(todo) + t.is(track.completed(), 1, 'completeWork: 100% completed') + + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'completeWork: on change event fired') + t.is(onChangeName, name, 'completeWork: on change emits the correct name') + t.done() + } +}) + +test('add more work', function (t) { + testEvent(track, 'change', afterAddWork) + track.addWork(todo) + t.is(track.completed(), 0.5, 'addWork: 50% completed') + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(onChangeName, name, 'addWork: on change emits the correct name') + t.done() + } +}) + +test('complete more work', function (t) { + track.completeWork(200) + t.is(track.completed(), 1, 'completeWork: Over completion is still only 100% complete') + t.done() +}) + +test('finish is always 100%', function (t) { + var finishtest = new Tracker(name, todo) + finishtest.completeWork(50) + finishtest.finish() + t.is(finishtest.completed(), 1, 'finish: Explicitly finishing moves to 100%') + t.done() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js new file mode 100644 index 00000000000000..799a7670b65934 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackergroup.js @@ -0,0 +1,96 @@ +'use strict' +var test = require('tap').test +var TrackerGroup = require('../index.js').TrackerGroup +var testEvent = require('./lib/test-event.js') + +test('TrackerGroup', function (t) { + var name = 'test' + + var track = new TrackerGroup(name) + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + testEvent(track, 'change', afterFinishEmpty) + track.finish() + var a, b + function afterFinishEmpty (er, onChangeName, completion) { + t.is(er, null, 'finishEmpty: on change event fired') + t.is(onChangeName, name, 'finishEmpty: on change emits the correct name') + t.is(completion, 1, 'finishEmpty: passed through completion was correct') + t.is(track.completed(), 1, 'finishEmpty: Finishing an empty group actually finishes it') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 1) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'Initially empty') + testEvent(track, 'change', afterCompleteWork) + a.completeWork(5) + } + function afterCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'on change event fired') + t.is(onChangeName, 'a', 'on change emits the correct name') + t.is(completion, 0.25, 'Complete half of one is a quarter overall') + t.is(track.completed(), 0.25, 'Complete half of one is a quarter overall') + testEvent(track, 'change', afterFinishAll) + track.finish() + } + function afterFinishAll (er, onChangeName, completion) { + t.is(er, null, 'finishAll: on change event fired') + t.is(onChangeName, name, 'finishAll: on change emits the correct name') + t.is(completion, 1, 'Finishing everything ') + t.is(track.completed(), 1, 'Finishing everything ') + + track = new TrackerGroup(name) + a = track.newItem('a', 10, 2) + b = track.newItem('b', 10, 1) + t.is(track.completed(), 0, 'weighted: Initially empty') + testEvent(track, 'change', afterWeightedCompleteWork) + a.completeWork(5) + } + function afterWeightedCompleteWork (er, onChangeName, completion) { + t.is(er, null, 'weighted: on change event fired') + t.is(onChangeName, 'a', 'weighted: on change emits the correct name') + t.is(Math.floor(completion * 100), 33, 'weighted: Complete half of double weighted') + t.is(Math.floor(track.completed() * 100), 33, 'weighted: Complete half of double weighted') + testEvent(track, 'change', afterWeightedFinishAll) + track.finish() + } + function afterWeightedFinishAll (er, onChangeName, completion) { + t.is(er, null, 'weightedFinishAll: on change event fired') + t.is(onChangeName, name, 'weightedFinishAll: on change emits the correct name') + t.is(completion, 1, 'weightedFinishaAll: Finishing everything ') + t.is(track.completed(), 1, 'weightedFinishaAll: Finishing everything ') + + track = new TrackerGroup(name) + a = track.newGroup('a', 10) + b = track.newGroup('b', 10) + var a1 = a.newItem('a.1', 10) + a1.completeWork(5) + t.is(track.completed(), 0.25, 'nested: Initially quarter done') + testEvent(track, 'change', afterNestedComplete) + b.finish() + } + function afterNestedComplete (er, onChangeName, completion) { + t.is(er, null, 'nestedComplete: on change event fired') + t.is(onChangeName, 'b', 'nestedComplete: on change emits the correct name') + t.is(completion, 0.75, 'nestedComplete: Finishing everything ') + t.is(track.completed(), 0.75, 'nestedComplete: Finishing everything ') + t.end() + } +}) + +test('cycles', function (t) { + var track = new TrackerGroup('top') + testCycle(track, track) + var layer1 = track.newGroup('layer1') + testCycle(layer1, track) + t.end() + + function testCycle (addTo, toAdd) { + try { + addTo.addUnit(toAdd) + t.fail(toAdd.name) + } catch (ex) { + console.log(ex) + t.pass(toAdd.name) + } + } +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js new file mode 100644 index 00000000000000..65f04b03769190 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/test/trackerstream.js @@ -0,0 +1,51 @@ +'use strict' +var test = require('tap').test +var util = require('util') +var stream = require('readable-stream') +var TrackerStream = require('../index.js').TrackerStream +var testEvent = require('./lib/test-event.js') + +var Sink = function () { + stream.Writable.apply(this, arguments) +} +util.inherits(Sink, stream.Writable) +Sink.prototype._write = function (data, encoding, cb) { + cb() +} + +test('TrackerStream', function (t) { + t.plan(9) + + var name = 'test' + var track = new TrackerStream(name) + + t.is(track.completed(), 0, 'Nothing todo is 0 completion') + + var todo = 10 + track = new TrackerStream(name, todo) + t.is(track.completed(), 0, 'Nothing done is 0 completion') + + track.pipe(new Sink()) + + testEvent(track, 'change', afterCompleteWork) + track.write('0123456789') + function afterCompleteWork (er, onChangeName) { + t.is(er, null, 'write: on change event fired') + t.is(onChangeName, name, 'write: on change emits the correct name') + t.is(track.completed(), 1, 'write: 100% completed') + + testEvent(track, 'change', afterAddWork) + track.addWork(10) + } + function afterAddWork (er, onChangeName) { + t.is(er, null, 'addWork: on change event fired') + t.is(track.completed(), 0.5, 'addWork: 50% completed') + + testEvent(track, 'change', afterAllWork) + track.write('ABCDEFGHIJKLMNOPQRST') + } + function afterAllWork (er) { + t.is(er, null, 'allWork: on change event fired') + t.is(track.completed(), 1, 'allWork: 100% completed') + } +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js new file mode 100644 index 00000000000000..6f436875578a7a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-base.js @@ -0,0 +1,11 @@ +'use strict' +var EventEmitter = require('events').EventEmitter +var util = require('util') + +var trackerId = 0 +var TrackerBase = module.exports = function (name) { + EventEmitter.call(this) + this.id = ++trackerId + this.name = name +} +util.inherits(TrackerBase, EventEmitter) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js new file mode 100644 index 00000000000000..9759e1226db046 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-group.js @@ -0,0 +1,107 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') +var Tracker = require('./tracker.js') +var TrackerStream = require('./tracker-stream.js') + +var TrackerGroup = module.exports = function (name) { + TrackerBase.call(this, name) + this.parentGroup = null + this.trackers = [] + this.completion = {} + this.weight = {} + this.totalWeight = 0 + this.finished = false + this.bubbleChange = bubbleChange(this) +} +util.inherits(TrackerGroup, TrackerBase) + +function bubbleChange (trackerGroup) { + return function (name, completed, tracker) { + trackerGroup.completion[tracker.id] = completed + if (trackerGroup.finished) return + trackerGroup.emit('change', name || trackerGroup.name, trackerGroup.completed(), trackerGroup) + } +} + +TrackerGroup.prototype.nameInTree = function () { + var names = [] + var from = this + while (from) { + names.unshift(from.name) + from = from.parentGroup + } + return names.join('/') +} + +TrackerGroup.prototype.addUnit = function (unit, weight) { + if (unit.addUnit) { + var toTest = this + while (toTest) { + if (unit === toTest) { + throw new Error( + 'Attempted to add tracker group ' + + unit.name + ' to tree that already includes it ' + + this.nameInTree(this)) + } + toTest = toTest.parentGroup + } + unit.parentGroup = this + } + this.weight[unit.id] = weight || 1 + this.totalWeight += this.weight[unit.id] + this.trackers.push(unit) + this.completion[unit.id] = unit.completed() + unit.on('change', this.bubbleChange) + if (!this.finished) this.emit('change', unit.name, this.completion[unit.id], unit) + return unit +} + +TrackerGroup.prototype.completed = function () { + if (this.trackers.length === 0) return 0 + var valPerWeight = 1 / this.totalWeight + var completed = 0 + for (var ii = 0; ii < this.trackers.length; ii++) { + var trackerId = this.trackers[ii].id + completed += valPerWeight * this.weight[trackerId] * this.completion[trackerId] + } + return completed +} + +TrackerGroup.prototype.newGroup = function (name, weight) { + return this.addUnit(new TrackerGroup(name), weight) +} + +TrackerGroup.prototype.newItem = function (name, todo, weight) { + return this.addUnit(new Tracker(name, todo), weight) +} + +TrackerGroup.prototype.newStream = function (name, todo, weight) { + return this.addUnit(new TrackerStream(name, todo), weight) +} + +TrackerGroup.prototype.finish = function () { + this.finished = true + if (!this.trackers.length) this.addUnit(new Tracker(), 1, true) + for (var ii = 0; ii < this.trackers.length; ii++) { + var tracker = this.trackers[ii] + tracker.finish() + tracker.removeListener('change', this.bubbleChange) + } + this.emit('change', this.name, 1, this) +} + +var buffer = ' ' +TrackerGroup.prototype.debug = function (depth) { + depth = depth || 0 + var indent = depth ? buffer.substr(0, depth) : '' + var output = indent + (this.name || 'top') + ': ' + this.completed() + '\n' + this.trackers.forEach(function (tracker) { + if (tracker instanceof TrackerGroup) { + output += tracker.debug(depth + 1) + } else { + output += indent + ' ' + tracker.name + ': ' + tracker.completed() + '\n' + } + }) + return output +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js new file mode 100644 index 00000000000000..fb9598ed4e9c31 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker-stream.js @@ -0,0 +1,35 @@ +'use strict' +var util = require('util') +var stream = require('readable-stream') +var delegate = require('delegates') +var Tracker = require('./tracker.js') + +var TrackerStream = module.exports = function (name, size, options) { + stream.Transform.call(this, options) + this.tracker = new Tracker(name, size) + this.name = name + this.id = this.tracker.id + this.tracker.on('change', delegateChange(this)) +} +util.inherits(TrackerStream, stream.Transform) + +function delegateChange (trackerStream) { + return function (name, completion, tracker) { + trackerStream.emit('change', name, completion, trackerStream) + } +} + +TrackerStream.prototype._transform = function (data, encoding, cb) { + this.tracker.completeWork(data.length ? data.length : 1) + this.push(data) + cb() +} + +TrackerStream.prototype._flush = function (cb) { + this.tracker.finish() + cb() +} + +delegate(TrackerStream.prototype, 'tracker') + .method('completed') + .method('addWork') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js new file mode 100644 index 00000000000000..68c2339b45409a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/are-we-there-yet/tracker.js @@ -0,0 +1,30 @@ +'use strict' +var util = require('util') +var TrackerBase = require('./tracker-base.js') + +var Tracker = module.exports = function (name, todo) { + TrackerBase.call(this, name) + this.workDone = 0 + this.workTodo = todo || 0 +} +util.inherits(Tracker, TrackerBase) + +Tracker.prototype.completed = function () { + return this.workTodo === 0 ? 0 : this.workDone / this.workTodo +} + +Tracker.prototype.addWork = function (work) { + this.workTodo += work + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.completeWork = function (work) { + this.workDone += work + if (this.workDone > this.workTodo) this.workDone = this.workTodo + this.emit('change', this.name, this.completed(), this) +} + +Tracker.prototype.finish = function () { + this.workTodo = this.workDone = 1 + this.emit('change', this.name, 1, this) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE new file mode 100644 index 00000000000000..e756052969b780 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md new file mode 100644 index 00000000000000..f58cc8d8925060 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/README.md @@ -0,0 +1,145 @@ +# Console Control Strings + +A library of cross-platform tested terminal/console command strings for +doing things like color and cursor positioning. This is a subset of both +ansi and vt100. All control codes included work on both Windows & Unix-like +OSes, except where noted. + +## Usage + +```js +var consoleControl = require('console-control-strings') + +console.log(consoleControl.color('blue','bgRed', 'bold') + 'hi there' + consoleControl.color('reset')) +process.stdout.write(consoleControl.goto(75, 10)) +``` + +## Why Another? + +There are tons of libraries similar to this one. I wanted one that was: + +1. Very clear about compatibility goals. +2. Could emit, for instance, a start color code without an end one. +3. Returned strings w/o writing to streams. +4. Was not weighed down with other unrelated baggage. + +## Functions + +### var code = consoleControl.up(_num = 1_) + +Returns the escape sequence to move _num_ lines up. + +### var code = consoleControl.down(_num = 1_) + +Returns the escape sequence to move _num_ lines down. + +### var code = consoleControl.forward(_num = 1_) + +Returns the escape sequence to move _num_ lines righ. + +### var code = consoleControl.back(_num = 1_) + +Returns the escape sequence to move _num_ lines left. + +### var code = consoleControl.nextLine(_num = 1_) + +Returns the escape sequence to move _num_ lines down and to the beginning of +the line. + +### var code = consoleControl.previousLine(_num = 1_) + +Returns the escape sequence to move _num_ lines up and to the beginning of +the line. + +### var code = consoleControl.eraseData() + +Returns the escape sequence to erase everything from the current cursor +position to the bottom right of the screen. This is line based, so it +erases the remainder of the current line and all following lines. + +### var code = consoleControl.eraseLine() + +Returns the escape sequence to erase to the end of the current line. + +### var code = consoleControl.goto(_x_, _y_) + +Returns the escape sequence to move the cursor to the designated position. +Note that the origin is _1, 1_ not _0, 0_. + +### var code = consoleControl.gotoSOL() + +Returns the escape sequence to move the cursor to the beginning of the +current line. (That is, it returns a carriage return, `\r`.) + +### var code = consoleControl.beep() + +Returns the escape sequence to cause the termianl to beep. (That is, it +returns unicode character `\x0007`, a Control-G.) + +### var code = consoleControl.hideCursor() + +Returns the escape sequence to hide the cursor. + +### var code = consoleControl.showCursor() + +Returns the escape sequence to show the cursor. + +### var code = consoleControl.color(_colors = []_) + +### var code = consoleControl.color(_color1_, _color2_, _…_, _colorn_) + +Returns the escape sequence to set the current terminal display attributes +(mostly colors). Arguments can either be a list of attributes or an array +of attributes. The difference between passing in an array or list of colors +and calling `.color` separately for each one, is that in the former case a +single escape sequence will be produced where as in the latter each change +will have its own distinct escape sequence. Each attribute can be one of: + +* Reset: + * **reset** – Reset all attributes to the terminal default. +* Styles: + * **bold** – Display text as bold. In some terminals this means using a + bold font, in others this means changing the color. In some it means + both. + * **italic** – Display text as italic. This is not available in most Windows terminals. + * **underline** – Underline text. This is not available in most Windows Terminals. + * **inverse** – Invert the foreground and background colors. + * **stopBold** – Do not display text as bold. + * **stopItalic** – Do not display text as italic. + * **stopUnderline** – Do not underline text. + * **stopInverse** – Do not invert foreground and background. +* Colors: + * **white** + * **black** + * **blue** + * **cyan** + * **green** + * **magenta** + * **red** + * **yellow** + * **grey** / **brightBlack** + * **brightRed** + * **brightGreen** + * **brightYellow** + * **brightBlue** + * **brightMagenta** + * **brightCyan** + * **brightWhite** +* Background Colors: + * **bgWhite** + * **bgBlack** + * **bgBlue** + * **bgCyan** + * **bgGreen** + * **bgMagenta** + * **bgRed** + * **bgYellow** + * **bgGrey** / **bgBrightBlack** + * **bgBrightRed** + * **bgBrightGreen** + * **bgBrightYellow** + * **bgBrightBlue** + * **bgBrightMagenta** + * **bgBrightCyan** + * **bgBrightWhite** + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js new file mode 100644 index 00000000000000..bf890348ec6e35 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/index.js @@ -0,0 +1,125 @@ +'use strict' + +// These tables borrowed from `ansi` + +var prefix = '\x1b[' + +exports.up = function up (num) { + return prefix + (num || '') + 'A' +} + +exports.down = function down (num) { + return prefix + (num || '') + 'B' +} + +exports.forward = function forward (num) { + return prefix + (num || '') + 'C' +} + +exports.back = function back (num) { + return prefix + (num || '') + 'D' +} + +exports.nextLine = function nextLine (num) { + return prefix + (num || '') + 'E' +} + +exports.previousLine = function previousLine (num) { + return prefix + (num || '') + 'F' +} + +exports.horizontalAbsolute = function horizontalAbsolute (num) { + if (num == null) throw new Error('horizontalAboslute requires a column to position to') + return prefix + num + 'G' +} + +exports.eraseData = function eraseData () { + return prefix + 'J' +} + +exports.eraseLine = function eraseLine () { + return prefix + 'K' +} + +exports.goto = function (x, y) { + return prefix + y + ';' + x + 'H' +} + +exports.gotoSOL = function () { + return '\r' +} + +exports.beep = function () { + return '\x07' +} + +exports.hideCursor = function hideCursor () { + return prefix + '?25l' +} + +exports.showCursor = function showCursor () { + return prefix + '?25h' +} + +var colors = { + reset: 0, +// styles + bold: 1, + italic: 3, + underline: 4, + inverse: 7, +// resets + stopBold: 22, + stopItalic: 23, + stopUnderline: 24, + stopInverse: 27, +// colors + white: 37, + black: 30, + blue: 34, + cyan: 36, + green: 32, + magenta: 35, + red: 31, + yellow: 33, + bgWhite: 47, + bgBlack: 40, + bgBlue: 44, + bgCyan: 46, + bgGreen: 42, + bgMagenta: 45, + bgRed: 41, + bgYellow: 43, + + grey: 90, + brightBlack: 90, + brightRed: 91, + brightGreen: 92, + brightYellow: 93, + brightBlue: 94, + brightMagenta: 95, + brightCyan: 96, + brightWhite: 97, + + bgGrey: 100, + bgBrightBlack: 100, + bgBrightRed: 101, + bgBrightGreen: 102, + bgBrightYellow: 103, + bgBrightBlue: 104, + bgBrightMagenta: 105, + bgBrightCyan: 106, + bgBrightWhite: 107 +} + +exports.color = function color (colorWith) { + if (arguments.length !== 1 || !Array.isArray(colorWith)) { + colorWith = Array.prototype.slice.call(arguments) + } + return prefix + colorWith.map(colorNameToCode).join(';') + 'm' +} + +function colorNameToCode (color) { + if (colors[color] != null) return colors[color] + throw new Error('Unknown color or style name: ' + color) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json new file mode 100644 index 00000000000000..a76eecadec37e9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/console-control-strings/package.json @@ -0,0 +1,108 @@ +{ + "_args": [ + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "console-control-strings@~1.1.0", + "_id": "console-control-strings@1.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/console-control-strings", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/console-control-strings-1.1.0.tgz_1466033396831_0.9470485949423164" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": {}, + "_requested": { + "raw": "console-control-strings@~1.1.0", + "scope": null, + "escapedName": "console-control-strings", + "name": "console-control-strings", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog", + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "_shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "_shrinkwrap": null, + "_spec": "console-control-strings@~1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/console-control-strings/issues" + }, + "dependencies": {}, + "description": "A library of cross-platform tested terminal/console command strings for doing things like color and cursor positioning. This is a subset of both ansi and vt100. All control codes included work on both Windows & Unix-like OSes, except where noted.", + "devDependencies": { + "standard": "^7.1.2", + "tap": "^5.7.2" + }, + "directories": { + "test": "test" + }, + "dist": { + "shasum": "3d7cf4464db6446ea644bf4b39507f9851008e8e", + "tarball": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz" + }, + "files": [ + "LICENSE", + "index.js" + ], + "gitHead": "722439b4998d2964ac3d3f9ec175c008aa9b7b4b", + "homepage": "https://github.com/iarna/console-control-strings#readme", + "keywords": [], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "console-control-strings", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/console-control-strings.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md new file mode 100644 index 00000000000000..efd08fc7c19dd7 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/CHANGELOG.md @@ -0,0 +1,131 @@ +### v2.6.0 + +* Bug fix: Don't run the code associated with `enable`/`disable` if the gauge + is already enabled or disabled respectively. This prevents leaking event + listeners, amongst other weirdness. +* New feature: Template items can have default values that will be used if no + value was otherwise passed in. + +### v2.5.3 + +* Default to `enabled` only if we have a tty. Users can always override + this by passing in the `enabled` option explicitly or by calling calling + `gauge.enable()`. + +### v2.5.2 + +* Externalized `./console-strings.js` into `console-control-strings`. + +### v2.5.1 + +* Update to `signal-exit@3.0.0`, which fixes a compatibility bug with the + node profiler. +* [#39](https://github.com/iarna/gauge/pull/39) Fix tests on 0.10 and add + a missing devDependency. ([@helloyou2012](https://github.com/helloyou2012)) + +### v2.5.0 + +* Add way to programmatically fetch a list of theme names in a themeset + (`Themeset.getThemeNames`). + +### v2.4.0 + +* Add support for setting themesets on existing gauge objects. +* Add post-IO callback to `gauge.hide()` as it is somtetimes necessary when + your terminal is interleaving output from multiple filehandles (ie, stdout + & stderr). + +### v2.3.1 + +* Fix a refactor bug in setTheme where it wasn't accepting the various types + of args it should. + +### v2.3.0 + +#### FEATURES + +* Add setTemplate & setTheme back in. +* Add support for named themes, you can now ask for things like 'colorASCII' + and 'brailleSpinner'. Of course, you can still pass in theme objects. + Additionally you can now pass in an object with `hasUnicode`, `hasColor` and + `platform` keys in order to override our guesses as to those values when + selecting a default theme from the themeset. +* Make the output stream optional (it defaults to `process.stderr` now). +* Add `setWriteTo(stream[, tty])` to change the output stream and, + optionally, tty. + +#### BUG FIXES & REFACTORING + +* Abort the display phase early if we're supposed to be hidden and we are. +* Stop printing a bunch of spaces at the end of lines, since we're already + using an erase-to-end-of-line code anyway. +* The unicode themes were missing the subsection separator. + +### v2.2.1 + +* Fix image in readme + +### v2.2.0 + +* All new themes API– reference themes by name and pass in custom themes and + themesets (themesets get platform support autodetection done on them to + select the best theme). Theme mixins let you add features to all existing + themes. +* Much, much improved test coverage. + +### v2.1.0 + +* Got rid of ░ in the default platform, noUnicode, hasColor theme. Thanks + to @yongtw123 for pointing out this had snuck in. +* Fiddled with the demo output to make it easier to see the spinner spin. Also + added prints before each platforms test output. +* I forgot to include `signal-exit` in our deps. <.< Thank you @KenanY for + finding this. Then I was lazy and made a new commit instead of using his + PR. Again, thank you for your patience @KenenY. +* Drastically speed up travis testing. +* Add a small javascript demo (demo.js) for showing off the various themes + (and testing them on diff platforms). +* Change: The subsection separator from ⁄ and / (different chars) to >. +* Fix crasher: A show or pulse without a label would cause the template renderer + to complain about a missing value. +* New feature: Add the ability to disable the clean-up-on-exit behavior. + Not something I expect to be widely desirable, but important if you have + multiple distinct gauge instances in your app. +* Use our own color support detection. + The `has-color` module proved too magic for my needs, making assumptions + as to which stream we write to and reading command line arguments. + +### v2.0.0 + +This is a major rewrite of the internals. Externally there are fewer +changes: + +* On node>0.8 gauge object now prints updates at a fixed rate. This means + that when you call `show` it may wate up to `updateInterval` ms before it + actually prints an update. You override this behavior with the + `fixedFramerate` option. +* The gauge object now keeps the cursor hidden as long as it's enabled and + shown. +* The constructor's arguments have changed, now it takes a mandatory output + stream and an optional options object. The stream no longer needs to be + an `ansi`ified stream, although it can be if you want (but we won't make + use of its special features). +* Previously the gauge was disabled by default if `process.stdout` wasn't a + tty. Now it always defaults to enabled. If you want the previous + behavior set the `enabled` option to `process.stdout.isTTY`. +* The constructor's options have changed– see the docs for details. +* Themes are entirely different. If you were using a custom theme, or + referring to one directly (eg via `Gauge.unicode` or `Gauge.ascii`) then + you'll need to change your code. You can get the equivalent of the latter + with: + ``` + var themes = require('gauge/themes') + var unicodeTheme = themes(true, true) // returns the color unicode theme for your platform + ``` + The default themes no longer use any ambiguous width characters, so even + if you choose to display those as wide your progress bar should still + display correctly. +* Templates are entirely different and if you were using a custom one, you + should consult the documentation to learn how to recreate it. If you were + using the default, be aware that it has changed and the result looks quite + a bit different. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE new file mode 100644 index 00000000000000..e756052969b780 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/LICENSE @@ -0,0 +1,13 @@ +Copyright (c) 2014, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md new file mode 100644 index 00000000000000..bf87d189f1b5c1 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/README.md @@ -0,0 +1,395 @@ +gauge +===== + +A nearly stateless terminal based horizontal gauge / progress bar. + +```javascript +var Gauge = require("gauge") + +var gauge = new Gauge() + +gauge.show("test", 0.20) + +gauge.pulse("this") + +gauge.hide() +``` + +![](gauge-demo.gif) + + +### CHANGES FROM 1.x + +Gauge 2.x is breaking release, please see the [changelog] for details on +what's changed if you were previously a user of this module. + +[changelog]: CHANGELOG.md + +### THE GAUGE CLASS + +This is the typical interface to the module– it provides a pretty +fire-and-forget interface to displaying your status information. + +``` +var Gauge = require("gauge") + +var gauge = new Gauge([stream], [options]) +``` + +* **stream** – *(optional, default STDERR)* A stream that progress bar + updates are to be written to. Gauge honors backpressure and will pause + most writing if it is indicated. +* **options** – *(optional)* An option object. + +Constructs a new gauge. Gauges are drawn on a single line, and are not drawn +if **stream** isn't a tty and a tty isn't explicitly provided. + +If **stream** is a terminal or if you pass in **tty** to **options** then we +will detect terminal resizes and redraw to fit. We do this by watching for +`resize` events on the tty. (To work around a bug in verisons of Node prior +to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to +larger window sizes will be clean, but shrinking the window will always +result in some cruft. + +**IMPORTANT:** If you prevously were passing in a non-tty stream but you still +want output (for example, a stream wrapped by the `ansi` module) then you +need to pass in the **tty** option below, as `gauge` needs access to +the underlying tty in order to do things like terminal resizes and terminal +width detection. + +The **options** object can have the following properties, all of which are +optional: + +* **updateInterval**: How often gauge updates should be drawn, in miliseconds. +* **fixedFramerate**: Defaults to false on node 0.8, true on everything + else. When this is true a timer is created to trigger once every + `updateInterval` ms, when false, updates are printed as soon as they come + in but updates more often than `updateInterval` are ignored. The reason + 0.8 doesn't have this set to true is that it can't `unref` its timer and + so it would stop your program from exiting– if you want to use this + feature with 0.8 just make sure you call `gauge.disable()` before you + expect your program to exit. +* **themes**: A themeset to use when selecting the theme to use. Defaults + to `gauge/themes`, see the [themes] documentation for details. +* **theme**: Select a theme for use, it can be a: + * Theme object, in which case the **themes** is not used. + * The name of a theme, which will be looked up in the current *themes* + object. + * A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + + If no theme is selected then a default is picked using a combination of our + best guesses at your OS, color support and unicode support. +* **template**: Describes what you want your gauge to look like. The + default is what npm uses. Detailed [documentation] is later in this + document. +* **hideCursor**: Defaults to true. If true, then the cursor will be hidden + while the gauge is displayed. +* **tty**: The tty that you're ultimately writing to. Defaults to the same + as **stream**. This is used for detecting the width of the terminal and + resizes. The width used is `tty.columns - 1`. If no tty is available then + a width of `79` is assumed. +* **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true + the gauge starts enabled. If disabled then all update commands are + ignored and no gauge will be printed until you call `.enable()`. +* **Plumbing**: The class to use to actually generate the gauge for + printing. This defaults to `require('gauge/plumbing')` and ordinarly you + shouldn't need to override this. +* **cleanupOnExit**: Defaults to true. Ordinarily we register an exit + handler to make sure your cursor is turned back on and the progress bar + erased when your process exits, even if you Ctrl-C out or otherwise exit + unexpectedly. You can disable this and it won't register the exit handler. + +[has-unicode]: https://www.npmjs.com/package/has-unicode +[themes]: #themes +[documentation]: #templates + +#### `gauge.show(section | status, [completed])` + +The first argument is either the section, the name of the current thing +contributing to progress, or an object with keys like **section**, +**subsection** & **completed** (or any others you have types for in a custom +template). If you don't want to update or set any of these you can pass +`null` and it will be ignored. + +The second argument is the percent completed as a value between 0 and 1. +Without it, completion is just not updated. You'll also note that completion +can be passed in as part of a status object as the first argument. If both +it and the completed argument are passed in, the completed argument wins. + +#### `gauge.hide([cb])` + +Removes the gauge from the terminal. Optionally, callback `cb` after IO has +had an opportunity to happen (currently this just means after `setImmediate` +has called back.) + +It turns out this is important when you're pausing the progress bar on one +filehandle and printing to another– otherwise (with a big enough print) node +can end up printing the "end progress bar" bits to the progress bar filehandle +while other stuff is printing to another filehandle. These getting interleaved +can cause corruption in some terminals. + +#### `gauge.pulse([subsection])` + +* **subsection** – *(optional)* The specific thing that triggered this pulse + +Spins the spinner in the gauge to show output. If **subsection** is +included then it will be combined with the last name passed to `gauge.show`. + +#### `gauge.disable()` + +Hides the gauge and ignores further calls to `show` or `pulse`. + +#### `gauge.enable()` + +Shows the gauge and resumes updating when `show` or `pulse` is called. + +#### `gauge.setThemeset(themes)` + +Change the themeset to select a theme from. The same as the `themes` option +used in the constructor. The theme will be reselected from this themeset. + +#### `gauge.setTheme(theme)` + +Change the active theme, will be displayed with the next show or pulse. This can be: + +* Theme object, in which case the **themes** is not used. +* The name of a theme, which will be looked up in the current *themes* + object. +* A configuration object with any of `hasUnicode`, `hasColor` or + `platform` keys, which if wlll be used to override our guesses when making + a default theme selection. + +If no theme is selected then a default is picked using a combination of our +best guesses at your OS, color support and unicode support. + +#### `gauge.setTemplate(template)` + +Change the active template, will be displayed with the next show or pulse + +### Tracking Completion + +If you have more than one thing going on that you want to track completion +of, you may find the related [are-we-there-yet] helpful. It's `change` +event can be wired up to the `show` method to get a more traditional +progress bar interface. + +[are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet + +### THEMES + +``` +var themes = require('gauge/themes') + +// fetch the default color unicode theme for this platform +var ourTheme = themes({hasUnicode: true, hasColor: true}) + +// fetch the default non-color unicode theme for osx +var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'}) + +// create a new theme based on the color ascii theme for this platform +// that brackets the progress bar with arrows +var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), { + preProgressbar: '→', + postProgressbar: '←' +}) +``` + +The object returned by `gauge/themes` is an instance of the `ThemeSet` class. + +``` +var ThemeSet = require('gauge/theme-set') +var themes = new ThemeSet() +// or +var themes = require('gauge/themes') +var mythemes = themes.newThemeset() // creates a new themeset based on the default themes +``` + +#### themes(opts) +#### themes.getDefault(opts) + +Theme objects are a function that fetches the default theme based on +platform, unicode and color support. + +Options is an object with the following properties: + +* **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is + available then a non-unicode theme will be used. +* **hasColor** - If true, fetch a color theme, if no color theme is + available a non-color theme will be used. +* **platform** (optional) - Defaults to `process.platform`. If no + platform match is available then `fallback` is used instead. + +If no compatible theme can be found then an error will be thrown with a +`code` of `EMISSINGTHEME`. + +#### themes.addTheme(themeName, themeObj) +#### themes.addTheme(themeName, [parentTheme], newTheme) + +Adds a named theme to the themeset. You can pass in either a theme object, +as returned by `themes.newTheme` or the arguments you'd pass to +`themes.newTheme`. + +#### themes.getThemeNames() + +Return a list of all of the names of the themes in this themeset. Suitable +for use in `themes.getTheme(…)`. + +#### themes.getTheme(name) + +Returns the theme object from this theme set named `name`. + +If `name` does not exist in this themeset an error will be thrown with +a `code` of `EMISSINGTHEME`. + +#### themes.setDefault([opts], themeName) + +`opts` is an object with the following properties. + +* **platform** - Defaults to `'fallback'`. If your theme is platform + specific, specify that here with the platform from `process.platform`, eg, + `win32`, `darwin`, etc. +* **hasUnicode** - Defaults to `false`. If your theme uses unicode you + should set this to true. +* **hasColor** - Defaults to `false`. If your theme uses color you should + set this to true. + +`themeName` is the name of the theme (as given to `addTheme`) to use for +this set of `opts`. + +#### themes.newTheme([parentTheme,] newTheme) + +Create a new theme object based on `parentTheme`. If no `parentTheme` is +provided then a minimal parentTheme that defines functions for rendering the +activity indicator (spinner) and progress bar will be defined. (This +fallback parent is defined in `gauge/base-theme`.) + +newTheme should be a bare object– we'll start by discussing the properties +defined by the default themes: + +* **preProgressbar** - displayed prior to the progress bar, if the progress + bar is displayed. +* **postProgressbar** - displayed after the progress bar, if the progress bar + is displayed. +* **progressBarTheme** - The subtheme passed through to the progress bar + renderer, it's an object with `complete` and `remaining` properties + that are the strings you want repeated for those sections of the progress + bar. +* **activityIndicatorTheme** - The theme for the activity indicator (spinner), + this can either be a string, in which each character is a different step, or + an array of strings. +* **preSubsection** - Displayed as a separator between the `section` and + `subsection` when the latter is printed. + +More generally, themes can have any value that would be a valid value when rendering +templates. The properties in the theme are used when their name matches a type in +the template. Their values can be: + +* **strings & numbers** - They'll be included as is +* **function (values, theme, width)** - Should return what you want in your output. + *values* is an object with values provided via `gauge.show`, + *theme* is the theme specific to this item (see below) or this theme object, + and *width* is the number of characters wide your result should be. + +There are a couple of special prefixes: + +* **pre** - Is shown prior to the property, if its displayed. +* **post** - Is shown after the property, if its displayed. + +And one special suffix: + +* **Theme** - Its value is passed to a function-type item as the theme. + +#### themes.addToAllThemes(theme) + +This *mixes-in* `theme` into all themes currently defined. It also adds it +to the default parent theme for this themeset, so future themes added to +this themeset will get the values from `theme` by default. + +#### themes.newThemeset() + +Copy the current themeset into a new one. This allows you to easily inherit +one themeset from another. + +### TEMPLATES + +A template is an array of objects and strings that, after being evaluated, +will be turned into the gauge line. The default template is: + +```javascript +[ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} +] +``` + +The various template elements can either be **plain strings**, in which case they will +be be included verbatum in the output, or objects with the following properties: + +* *type* can be any of the following plus any keys you pass into `gauge.show` plus + any keys you have on a custom theme. + * `section` – What big thing you're working on now. + * `subsection` – What component of that thing is currently working. + * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme` + from your active theme. + * `progressbar` – A progress bar representing your current `completed` + using the `progressbarTheme` from your active theme. +* *kerning* – Number of spaces that must be between this item and other + items, if this item is displayed at all. +* *maxLength* – The maximum length for this element. If its value is longer it + will be truncated. +* *minLength* – The minimum length for this element. If its value is shorter it + will be padded according to the *align* value. +* *align* – (Default: left) Possible values "left", "right" and "center". Works + as you'd expect from word processors. +* *length* – Provides a single value for both *minLength* and *maxLength*. If both + *length* and *minLength or *maxLength* are specifed then the latter take precedence. +* *value* – A literal value to use for this template item. +* *default* – A default value to use for this template item if a value + wasn't otherwise passed in. + +### PLUMBING + +This is the super simple, assume nothing, do no magic internals used by gauge to +implement its ordinary interface. + +``` +var Plumbing = require('gauge/plumbing') +var gauge = new Plumbing(theme, template, width) +``` + +* **theme**: The theme to use. +* **template**: The template to use. +* **width**: How wide your gauge should be + +#### `gauge.setTheme(theme)` + +Change the active theme. + +#### `gauge.setTemplate(template)` + +Change the active template. + +#### `gauge.setWidth(width)` + +Change the width to render at. + +#### `gauge.hide()` + +Return the string necessary to hide the progress bar + +#### `gauge.hideCursor()` + +Return a string to hide the cursor. + +#### `gauge.showCursor()` + +Return a string to show the cursor. + +#### `gauge.show(status)` + +Using `status` for values, render the provided template with the theme and return +a string that is suitable for printing to update the gauge. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js new file mode 100644 index 00000000000000..0b67638e0211d0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/base-theme.js @@ -0,0 +1,14 @@ +'use strict' +var spin = require('./spin.js') +var progressBar = require('./progress-bar.js') + +module.exports = { + activityIndicator: function (values, theme, width) { + if (values.spun == null) return + return spin(theme, values.spun) + }, + progressbar: function (values, theme, width) { + if (values.completed == null) return + return progressBar(theme, width, values.completed) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js new file mode 100644 index 00000000000000..d9914ba5335d25 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/error.js @@ -0,0 +1,24 @@ +'use strict' +var util = require('util') + +var User = exports.User = function User (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, User) + err.code = 'EGAUGE' + return err +} + +exports.MissingTemplateValue = function MissingTemplateValue (item, values) { + var err = new User(util.format('Missing template value "%s"', item.type)) + Error.captureStackTrace(err, MissingTemplateValue) + err.template = item + err.values = values + return err +} + +exports.Internal = function Internal (msg) { + var err = new Error(msg) + Error.captureStackTrace(err, Internal) + err.code = 'EGAUGEINTERNAL' + return err +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js new file mode 100644 index 00000000000000..e283a256f26b74 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/has-color.js @@ -0,0 +1,12 @@ +'use strict' + +module.exports = isWin32() || isColorTerm() + +function isWin32 () { + return process.platform === 'win32' +} + +function isColorTerm () { + var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i + return !!process.env.COLORTERM || termHasColor.test(process.env.TERM) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js new file mode 100644 index 00000000000000..7eefb9507bb47e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/index.js @@ -0,0 +1,226 @@ +'use strict' +var Plumbing = require('./plumbing.js') +var hasUnicode = require('has-unicode') +var hasColor = require('./has-color.js') +var onExit = require('signal-exit') +var defaultThemes = require('./themes') +var setInterval = require('./set-interval.js') +var process = require('./process.js') +var setImmediate = require('./set-immediate') + +module.exports = Gauge + +function callWith (obj, method) { + return function () { + return method.call(obj) + } +} + +function Gauge (arg1, arg2) { + var options, writeTo + if (arg1 && arg1.write) { + writeTo = arg1 + options = arg2 || {} + } else if (arg2 && arg2.write) { + writeTo = arg2 + options = arg1 || {} + } else { + writeTo = process.stderr + options = arg1 || arg2 || {} + } + + this._status = { + spun: 0, + section: '', + subsection: '' + } + this._paused = false // are we paused for back pressure? + this._disabled = true // are all progress bar updates disabled? + this._showing = false // do we WANT the progress bar on screen + this._onScreen = false // IS the progress bar on screen + this._needsRedraw = false // should we print something at next tick? + this._hideCursor = options.hideCursor == null ? true : options.hideCursor + this._fixedFramerate = options.fixedFramerate == null + ? !(/^v0\.8\./.test(process.version)) + : options.fixedFramerate + this._lastUpdateAt = null + this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval + + this._themes = options.themes || defaultThemes + this._theme = options.theme + var theme = this._computeTheme(options.theme) + var template = options.template || [ + {type: 'progressbar', length: 20}, + {type: 'activityIndicator', kerning: 1, length: 1}, + {type: 'section', kerning: 1, default: ''}, + {type: 'subsection', kerning: 1, default: ''} + ] + this.setWriteTo(writeTo, options.tty) + var PlumbingClass = options.Plumbing || Plumbing + this._gauge = new PlumbingClass(theme, template, this.getWidth()) + + this._$$doRedraw = callWith(this, this._doRedraw) + this._$$handleSizeChange = callWith(this, this._handleSizeChange) + + if (options.cleanupOnExit == null || options.cleanupOnExit) { + onExit(callWith(this, this.disable)) + } + + if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) { + this.enable() + } else { + this.disable() + } +} +Gauge.prototype = {} + +Gauge.prototype.setTemplate = function (template) { + this._gauge.setTemplate(template) + if (this._showing) this._requestRedraw() +} + +Gauge.prototype._computeTheme = function (theme) { + if (!theme) theme = {} + if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) { + var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode + var useColor = theme.hasColor == null ? hasColor : theme.hasColor + theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform}) + } else if (typeof theme === 'string') { + theme = this._themes.getTheme(theme) + } + return theme +} + +Gauge.prototype.setThemeset = function (themes) { + this._themes = themes + this.setTheme(this._theme) +} + +Gauge.prototype.setTheme = function (theme) { + this._gauge.setTheme(this._computeTheme(theme)) + if (this._showing) this._requestRedraw() + this._theme = theme +} + +Gauge.prototype._requestRedraw = function () { + this._needsRedraw = true + if (!this._fixedFramerate) this._doRedraw() +} + +Gauge.prototype.getWidth = function () { + return ((this._tty && this._tty.columns) || 80) - 1 +} + +Gauge.prototype.setWriteTo = function (writeTo, tty) { + var enabled = !this._disabled + if (enabled) this.disable() + this._writeTo = writeTo + this._tty = tty || + (writeTo === process.stderr && process.stdout.isTTY && process.stdout) || + (writeTo.isTTY && writeTo) || + this._tty + if (this._gauge) this._gauge.setWidth(this.getWidth()) + if (enabled) this.enable() +} + +Gauge.prototype.enable = function () { + if (!this._disabled) return + this._disabled = false + if (this._tty) this._enableEvents() + if (this._showing) this.show() +} + +Gauge.prototype.disable = function () { + if (this._disabled) return + if (this._showing) { + this._lastUpdateAt = null + this._showing = false + this._doRedraw() + this._showing = true + } + this._disabled = true + if (this._tty) this._disableEvents() +} + +Gauge.prototype._enableEvents = function () { + this._tty.on('resize', this._$$handleSizeChange) + if (this._fixedFramerate) { + this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval) + if (this.redrawTracker.unref) this.redrawTracker.unref() + } +} + +Gauge.prototype._disableEvents = function () { + this._tty.removeListener('resize', this._$$handleSizeChange) + if (this._fixedFramerate) clearInterval(this.redrawTracker) +} + +Gauge.prototype.hide = function (cb) { + if (this._disabled) return cb && process.nextTick(cb) + if (!this._showing) return cb && process.nextTick(cb) + this._showing = false + this._doRedraw() + cb && setImmediate(cb) +} + +Gauge.prototype.show = function (section, completed) { + if (this._disabled) return + this._showing = true + if (typeof section === 'string') { + this._status.section = section + } else if (typeof section === 'object') { + var sectionKeys = Object.keys(section) + for (var ii = 0; ii < sectionKeys.length; ++ii) { + var key = sectionKeys[ii] + this._status[key] = section[key] + } + } + if (completed != null) this._status.completed = completed + this._requestRedraw() +} + +Gauge.prototype.pulse = function (subsection) { + if (this._disabled) return + if (!this._showing) return + this._status.subsection = subsection || '' + this._status.spun ++ + this._requestRedraw() +} + +Gauge.prototype._handleSizeChange = function () { + this._gauge.setWidth(this._tty.columns - 1) + this._requestRedraw() +} + +Gauge.prototype._doRedraw = function () { + if (this._disabled || this._paused) return + if (!this._fixedFramerate) { + var now = Date.now() + if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return + this._lastUpdateAt = now + } + if (!this._showing && this._onScreen) { + this._onScreen = false + var result = this._gauge.hide() + if (this._hideCursor) { + result += this._gauge.showCursor() + } + return this._writeTo.write(result) + } + if (!this._showing && !this._onScreen) return + if (this._showing && !this._onScreen) { + this._onScreen = true + this._needsRedraw = true + if (this._hideCursor) { + this._writeTo.write(this._gauge.hideCursor()) + } + } + if (!this._needsRedraw) return + if (!this._writeTo.write(this._gauge.show(this._status))) { + this._paused = true + this._writeTo.on('drain', callWith(this, function () { + this._paused = false + this._doRedraw() + })) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js new file mode 100644 index 00000000000000..092d0baef6698e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/index.js @@ -0,0 +1,32 @@ +'use strict'; +module.exports = (function () { + if (process.argv.indexOf('--no-color') !== -1) { + return false; + } + + if (process.argv.indexOf('--color') !== -1) { + return true; + } + + if (process.stdout && !process.stdout.isTTY) { + return false; + } + + if (process.platform === 'win32') { + return true; + } + + if ('COLORTERM' in process.env) { + return true; + } + + if (process.env.TERM === 'dumb') { + return false; + } + + if (/^screen|^xterm|^vt100|color|ansi|cygwin|linux/i.test(process.env.TERM)) { + return true; + } + + return false; +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json new file mode 100644 index 00000000000000..8e08278c65bea0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/package.json @@ -0,0 +1,117 @@ +{ + "_args": [ + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "has-color@^0.1.7", + "_id": "has-color@0.1.7", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/has-color", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "1.4.6", + "_phantomChildren": {}, + "_requested": { + "raw": "has-color@^0.1.7", + "scope": null, + "escapedName": "has-color", + "name": "has-color", + "rawSpec": "^0.1.7", + "spec": ">=0.1.7 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz", + "_shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "_shrinkwrap": null, + "_spec": "has-color@^0.1.7", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/has-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*" + }, + "directories": {}, + "dist": { + "shasum": "67144a5260c34fc3cca677d041daf52fe7b78b2f", + "tarball": "https://registry.npmjs.org/has-color/-/has-color-0.1.7.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "homepage": "https://github.com/sindresorhus/has-color", + "keywords": [ + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "ansi", + "styles", + "tty", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "support", + "capability", + "detect" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "has-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/has-color.git" + }, + "scripts": { + "test": "mocha" + }, + "version": "0.1.7" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md new file mode 100644 index 00000000000000..37bbd8991a6423 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/has-color/readme.md @@ -0,0 +1,30 @@ +# has-color [![Build Status](https://travis-ci.org/sindresorhus/has-color.svg?branch=master)](https://travis-ci.org/sindresorhus/has-color) + +> Detect whether a terminal supports color. + +Used in the terminal color module [chalk](https://github.com/sindresorhus/chalk). + + +## Install + +```bash +$ npm install --save has-color +``` + + +## Usage + +```js +var hasColor = require('has-color'); + +if (hasColor) { + console.log('Terminal supports color.'); +} +``` + +It obeys the `--color` and `--no-color` CLI flags. + + +## License + +[MIT](http://opensource.org/licenses/MIT) © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js new file mode 100644 index 00000000000000..508504840dc61d --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/index.js @@ -0,0 +1,83 @@ +'use strict'; +/* eslint-disable no-unused-vars */ +var hasOwnProperty = Object.prototype.hasOwnProperty; +var propIsEnumerable = Object.prototype.propertyIsEnumerable; + +function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); +} + +function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (e) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } +} + +module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (Object.getOwnPropertySymbols) { + symbols = Object.getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json new file mode 100644 index 00000000000000..16651a0ab52da2 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/package.json @@ -0,0 +1,126 @@ +{ + "_args": [ + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "object-assign@^4.1.0", + "_id": "object-assign@4.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/object-assign", + "_nodeVersion": "4.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/object-assign-4.1.0.tgz_1462212593641_0.3332549517508596" + }, + "_npmUser": { + "name": "spicyj", + "email": "ben@benalpert.com" + }, + "_npmVersion": "2.14.19", + "_phantomChildren": {}, + "_requested": { + "raw": "object-assign@^4.1.0", + "scope": null, + "escapedName": "object-assign", + "name": "object-assign", + "rawSpec": "^4.1.0", + "spec": ">=4.1.0 <5.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz", + "_shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "_shrinkwrap": null, + "_spec": "object-assign@^4.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/object-assign/issues" + }, + "dependencies": {}, + "description": "ES2015 Object.assign() ponyfill", + "devDependencies": { + "lodash": "^4.8.2", + "matcha": "^0.7.0", + "mocha": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "7a3b3d0e98063d43f4c03f2e8ae6cd51a86883a0", + "tarball": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "72fe21c86911758f3342fdf41c2a57860d5829bc", + "homepage": "https://github.com/sindresorhus/object-assign#readme", + "keywords": [ + "object", + "assign", + "extend", + "properties", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "prollyfill", + "polyfill", + "shim", + "browser" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "spicyj", + "email": "ben@benalpert.com" + } + ], + "name": "object-assign", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/object-assign.git" + }, + "scripts": { + "bench": "matcha bench.js", + "test": "xo && mocha" + }, + "version": "4.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md new file mode 100644 index 00000000000000..13c097734cfd18 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/object-assign/readme.md @@ -0,0 +1,56 @@ +# object-assign [![Build Status](https://travis-ci.org/sindresorhus/object-assign.svg?branch=master)](https://travis-ci.org/sindresorhus/object-assign) + +> ES2015 [`Object.assign()`](http://www.2ality.com/2014/01/object-assign.html) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save object-assign +``` + + +## Usage + +```js +const objectAssign = require('object-assign'); + +objectAssign({foo: 0}, {bar: 1}); +//=> {foo: 0, bar: 1} + +// multiple sources +objectAssign({foo: 0}, {bar: 1}, {baz: 2}); +//=> {foo: 0, bar: 1, baz: 2} + +// overwrites equal keys +objectAssign({foo: 0}, {foo: 1}, {foo: 2}); +//=> {foo: 2} + +// ignores null and undefined sources +objectAssign({foo: 0}, null, {bar: 1}, undefined); +//=> {foo: 0, bar: 1} +``` + + +## API + +### objectAssign(target, source, [source, ...]) + +Assigns enumerable own properties of `source` objects to the `target` object and returns the `target` object. Additional `source` objects will overwrite previous ones. + + +## Resources + +- [ES2015 spec - Object.assign](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-object.assign) + + +## Related + +- [deep-assign](https://github.com/sindresorhus/deep-assign) - Recursive `Object.assign()` + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md new file mode 100644 index 00000000000000..c12f8340c8d6c6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/CHANGELOG.md @@ -0,0 +1,17 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [3.0.0](https://github.com/tapjs/signal-exit/compare/v2.1.2...v3.0.0) (2016-06-13) + + +### Bug Fixes + +* get our test suite running on Windows ([#23](https://github.com/tapjs/signal-exit/issues/23)) ([6f3eda8](https://github.com/tapjs/signal-exit/commit/6f3eda8)) +* hooking SIGPROF was interfering with profilers see [#21](https://github.com/tapjs/signal-exit/issues/21) ([#24](https://github.com/tapjs/signal-exit/issues/24)) ([1248a4c](https://github.com/tapjs/signal-exit/commit/1248a4c)) + + +### BREAKING CHANGES + +* signal-exit no longer wires into SIGPROF diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt new file mode 100644 index 00000000000000..c7e27478a3eff8 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2015, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md new file mode 100644 index 00000000000000..8ebccabecaea4c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/README.md @@ -0,0 +1,40 @@ +# signal-exit + +[![Build Status](https://travis-ci.org/tapjs/signal-exit.png)](https://travis-ci.org/tapjs/signal-exit) +[![Coverage](https://coveralls.io/repos/tapjs/signal-exit/badge.svg?branch=master)](https://coveralls.io/r/tapjs/signal-exit?branch=master) +[![NPM version](https://img.shields.io/npm/v/signal-exit.svg)](https://www.npmjs.com/package/signal-exit) +[![Windows Tests](https://img.shields.io/appveyor/ci/bcoe/signal-exit/master.svg?label=Windows%20Tests)](https://ci.appveyor.com/project/bcoe/signal-exit) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +When you want to fire an event no matter how a process exits: + +* reaching the end of execution. +* explicitly having `process.exit(code)` called. +* having `process.kill(pid, sig)` called. +* receiving a fatal signal from outside the process + +Use `signal-exit`. + +```js +var onExit = require('signal-exit') + +onExit(function (code, signal) { + console.log('process exited!') +}) +``` + +## API + +`var remove = onExit(function (code, signal) {}, options)` + +The return value of the function is a function that will remove the +handler. + +Note that the function *only* fires for signals if the signal would +cause the proces to exit. That is, there are no other listeners, and +it is a fatal signal. + +## Options + +* `alwaysLast`: Run this handler after any other signal or exit + handlers. This causes `process.emit` to be monkeypatched. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js new file mode 100644 index 00000000000000..7dd8d917dc507b --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/index.js @@ -0,0 +1,148 @@ +// Note: since nyc uses this module to output coverage, any lines +// that are in the direct sync flow of nyc's outputCoverage are +// ignored, since we can never get coverage for them. +var assert = require('assert') +var signals = require('./signals.js') + +var EE = require('events') +/* istanbul ignore if */ +if (typeof EE !== 'function') { + EE = EE.EventEmitter +} + +var emitter +if (process.__signal_exit_emitter__) { + emitter = process.__signal_exit_emitter__ +} else { + emitter = process.__signal_exit_emitter__ = new EE() + emitter.count = 0 + emitter.emitted = {} +} + +module.exports = function (cb, opts) { + assert.equal(typeof cb, 'function', 'a callback must be provided for exit handler') + + if (loaded === false) { + load() + } + + var ev = 'exit' + if (opts && opts.alwaysLast) { + ev = 'afterexit' + } + + var remove = function () { + emitter.removeListener(ev, cb) + if (emitter.listeners('exit').length === 0 && + emitter.listeners('afterexit').length === 0) { + unload() + } + } + emitter.on(ev, cb) + + return remove +} + +module.exports.unload = unload +function unload () { + if (!loaded) { + return + } + loaded = false + + signals.forEach(function (sig) { + try { + process.removeListener(sig, sigListeners[sig]) + } catch (er) {} + }) + process.emit = originalProcessEmit + process.reallyExit = originalProcessReallyExit + emitter.count -= 1 +} + +function emit (event, code, signal) { + if (emitter.emitted[event]) { + return + } + emitter.emitted[event] = true + emitter.emit(event, code, signal) +} + +// { : , ... } +var sigListeners = {} +signals.forEach(function (sig) { + sigListeners[sig] = function listener () { + // If there are no other listeners, an exit is coming! + // Simplest way: remove us and then re-send the signal. + // We know that this will kill the process, so we can + // safely emit now. + var listeners = process.listeners(sig) + if (listeners.length === emitter.count) { + unload() + emit('exit', null, sig) + /* istanbul ignore next */ + emit('afterexit', null, sig) + /* istanbul ignore next */ + process.kill(process.pid, sig) + } + } +}) + +module.exports.signals = function () { + return signals +} + +module.exports.load = load + +var loaded = false + +function load () { + if (loaded) { + return + } + loaded = true + + // This is the number of onSignalExit's that are in play. + // It's important so that we can count the correct number of + // listeners on signals, and don't wait for the other one to + // handle it instead of us. + emitter.count += 1 + + signals = signals.filter(function (sig) { + try { + process.on(sig, sigListeners[sig]) + return true + } catch (er) { + return false + } + }) + + process.emit = processEmit + process.reallyExit = processReallyExit +} + +var originalProcessReallyExit = process.reallyExit +function processReallyExit (code) { + process.exitCode = code || 0 + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + /* istanbul ignore next */ + originalProcessReallyExit.call(process, process.exitCode) +} + +var originalProcessEmit = process.emit +function processEmit (ev, arg) { + if (ev === 'exit') { + if (arg !== undefined) { + process.exitCode = arg + } + var ret = originalProcessEmit.apply(this, arguments) + emit('exit', process.exitCode, null) + /* istanbul ignore next */ + emit('afterexit', process.exitCode, null) + return ret + } else { + return originalProcessEmit.apply(this, arguments) + } +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json new file mode 100644 index 00000000000000..19e71fd5ff9fde --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "signal-exit@^3.0.0", + "_id": "signal-exit@3.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/signal-exit", + "_nodeVersion": "5.1.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/signal-exit-3.0.0.tgz_1465857346813_0.7961636525578797" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "3.3.12", + "_phantomChildren": {}, + "_requested": { + "raw": "signal-exit@^3.0.0", + "scope": null, + "escapedName": "signal-exit", + "name": "signal-exit", + "rawSpec": "^3.0.0", + "spec": ">=3.0.0 <4.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz", + "_shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "_shrinkwrap": null, + "_spec": "signal-exit@^3.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/tapjs/signal-exit/issues" + }, + "dependencies": {}, + "description": "when you want to fire an event no matter how a process exits.", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.2", + "nyc": "^6.4.4", + "standard": "^7.1.2", + "standard-version": "^2.3.0", + "tap": "^5.7.2" + }, + "directories": {}, + "dist": { + "shasum": "3c0543b65d7b4fbc60b6cd94593d9bf436739be8", + "tarball": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.0.tgz" + }, + "files": [ + "index.js", + "signals.js" + ], + "gitHead": "2bbec4e5d9f9cf1f7529b1c923d1b058e69ccf7f", + "homepage": "https://github.com/tapjs/signal-exit", + "keywords": [ + "signal", + "exit" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + { + "name": "isaacs", + "email": "isaacs@npmjs.com" + } + ], + "name": "signal-exit", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tapjs/signal-exit.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "release": "standard-version", + "test": "tap --timeout=240 ./test/*.js --cov" + }, + "version": "3.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js new file mode 100644 index 00000000000000..bc6f97ee606954 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/signal-exit/signals.js @@ -0,0 +1,52 @@ +// This is not the set of all possible signals. +// +// It IS, however, the set of all signals that trigger +// an exit on either Linux or BSD systems. Linux is a +// superset of the signal names supported on BSD, and +// the unknown signals just fail to register, so we can +// catch that easily enough. +// +// Don't bother with SIGKILL. It's uncatchable, which +// means that we can't fire any callbacks anyway. +// +// If a user does happen to register a handler on a non- +// fatal signal like SIGWINCH or something, and then +// exit, it'll end up firing `process.emit('exit')`, so +// the handler will be fired anyway. +module.exports = [ + 'SIGABRT', + 'SIGALRM', + 'SIGBUS', + 'SIGFPE', + 'SIGHUP', + 'SIGILL', + 'SIGINT', + 'SIGSEGV', + 'SIGTERM' +] + +if (process.platform !== 'win32') { + module.exports.push( + 'SIGVTALRM', + 'SIGXCPU', + 'SIGXFSZ', + 'SIGUSR2', + 'SIGTRAP', + 'SIGSYS', + 'SIGQUIT', + 'SIGIOT' + // should detect profiler and enable/disable accordingly. + // see #21 + // 'SIGPROF' + ) +} + +if (process.platform === 'linux') { + module.exports.push( + 'SIGIO', + 'SIGPOLL', + 'SIGPWR', + 'SIGSTKFLT', + 'SIGUNUSED' + ) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js new file mode 100644 index 00000000000000..b9bec62440a468 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -0,0 +1,37 @@ +'use strict'; +var stripAnsi = require('strip-ansi'); +var codePointAt = require('code-point-at'); +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +// https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1345 +module.exports = function (str) { + if (typeof str !== 'string' || str.length === 0) { + return 0; + } + + var width = 0; + + str = stripAnsi(str); + + for (var i = 0; i < str.length; i++) { + var code = codePointAt(str, i); + + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + + // surrogates + if (code >= 0x10000) { + i++; + } + + if (isFullwidthCodePoint(code)) { + width += 2; + } else { + width++; + } + } + + return width; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js new file mode 100644 index 00000000000000..0335117977237f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/index.js @@ -0,0 +1,33 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (str, pos) { + if (str === null || str === undefined) { + throw TypeError(); + } + + str = String(str); + + var size = str.length; + var i = pos ? Number(pos) : 0; + + if (numberIsNan(i)) { + i = 0; + } + + if (i < 0 || i >= size) { + return undefined; + } + + var first = str.charCodeAt(i); + + if (first >= 0xD800 && first <= 0xDBFF && size > i + 1) { + var second = str.charCodeAt(i + 1); + + if (second >= 0xDC00 && second <= 0xDFFF) { + return (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; + } + } + + return first; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..362803be0df21e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width/code-point-at" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json new file mode 100644 index 00000000000000..d602d507a66c07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/package.json @@ -0,0 +1,116 @@ +{ + "_args": [ + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "code-point-at@^1.0.0", + "_id": "code-point-at@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/code-point-at", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "code-point-at@^1.0.0", + "scope": null, + "escapedName": "code-point-at", + "name": "code-point-at", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", + "_shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "_shrinkwrap": null, + "_spec": "code-point-at@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/code-point-at/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "ES2015 String#codePointAt() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "f69b192d3f7d91e382e4b71bddb77878619ab0c6", + "tarball": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "c2ffa4064718b37c84c73a633abeeed5b486a469", + "homepage": "https://github.com/sindresorhus/code-point-at", + "keywords": [ + "es2015", + "es6", + "ponyfill", + "polyfill", + "shim", + "string", + "str", + "code", + "point", + "at", + "codepoint", + "unicode" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "code-point-at", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/code-point-at.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md new file mode 100644 index 00000000000000..71e7d0931b8b0c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at/readme.md @@ -0,0 +1,34 @@ +# code-point-at [![Build Status](https://travis-ci.org/sindresorhus/code-point-at.svg?branch=master)](https://travis-ci.org/sindresorhus/code-point-at) + +> ES2015 [`String#codePointAt()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/codePointAt) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save code-point-at +``` + + +## Usage + +```js +var codePointAt = require('code-point-at'); + +codePointAt('🐴'); +//=> 128052 + +codePointAt('abc', 2); +//=> 99 +``` + +## API + +### codePointAt(input, [position]) + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js new file mode 100644 index 00000000000000..a7d3e3855f1c24 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/index.js @@ -0,0 +1,46 @@ +'use strict'; +var numberIsNan = require('number-is-nan'); + +module.exports = function (x) { + if (numberIsNan(x)) { + return false; + } + + // https://github.com/nodejs/io.js/blob/cff7300a578be1b10001f2d967aaedc88aee6402/lib/readline.js#L1369 + + // code points are derived from: + // http://www.unix.org/Public/UNIDATA/EastAsianWidth.txt + if (x >= 0x1100 && ( + x <= 0x115f || // Hangul Jamo + 0x2329 === x || // LEFT-POINTING ANGLE BRACKET + 0x232a === x || // RIGHT-POINTING ANGLE BRACKET + // CJK Radicals Supplement .. Enclosed CJK Letters and Months + (0x2e80 <= x && x <= 0x3247 && x !== 0x303f) || + // Enclosed CJK Letters and Months .. CJK Unified Ideographs Extension A + 0x3250 <= x && x <= 0x4dbf || + // CJK Unified Ideographs .. Yi Radicals + 0x4e00 <= x && x <= 0xa4c6 || + // Hangul Jamo Extended-A + 0xa960 <= x && x <= 0xa97c || + // Hangul Syllables + 0xac00 <= x && x <= 0xd7a3 || + // CJK Compatibility Ideographs + 0xf900 <= x && x <= 0xfaff || + // Vertical Forms + 0xfe10 <= x && x <= 0xfe19 || + // CJK Compatibility Forms .. Small Form Variants + 0xfe30 <= x && x <= 0xfe6b || + // Halfwidth and Fullwidth Forms + 0xff01 <= x && x <= 0xff60 || + 0xffe0 <= x && x <= 0xffe6 || + // Kana Supplement + 0x1b000 <= x && x <= 0x1b001 || + // Enclosed Ideographic Supplement + 0x1f200 <= x && x <= 0x1f251 || + // CJK Unified Ideographs Extension B .. Tertiary Ideographic Plane + 0x20000 <= x && x <= 0x3fffd)) { + return true; + } + + return false; +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js new file mode 100644 index 00000000000000..79be4b9cb8c3bc --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/index.js @@ -0,0 +1,4 @@ +'use strict'; +module.exports = Number.isNaN || function (x) { + return x !== x; +}; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license new file mode 100644 index 00000000000000..654d0bfe943437 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/license @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) Sindre Sorhus (sindresorhus.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. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json new file mode 100644 index 00000000000000..3b853d672bca99 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/code-point-at" + ], + [ + { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point" + ] + ], + "_from": "number-is-nan@^1.0.0", + "_id": "number-is-nan@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point/number-is-nan", + "_nodeVersion": "0.12.3", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "number-is-nan@^1.0.0", + "scope": null, + "escapedName": "number-is-nan", + "name": "number-is-nan", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point" + ], + "_resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", + "_shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "_shrinkwrap": null, + "_spec": "number-is-nan@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/number-is-nan/issues" + }, + "dependencies": {}, + "description": "ES6 Number.isNaN() ponyfill", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "c020f529c5282adfdd233d91d4b181c3d686dc4b", + "tarball": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "0f394b1bc33185c40304363b209e3f0588dbeeb3", + "homepage": "https://github.com/sindresorhus/number-is-nan#readme", + "keywords": [ + "es6", + "es2015", + "ecmascript", + "harmony", + "ponyfill", + "polyfill", + "shim", + "number", + "is", + "nan", + "not" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "number-is-nan", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/number-is-nan.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md new file mode 100644 index 00000000000000..93d851a14f1ac5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/node_modules/number-is-nan/readme.md @@ -0,0 +1,30 @@ +# number-is-nan [![Build Status](https://travis-ci.org/sindresorhus/number-is-nan.svg?branch=master)](https://travis-ci.org/sindresorhus/number-is-nan) + +> ES6 [`Number.isNaN()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/isNaN) ponyfill + +> Ponyfill: A polyfill that doesn't overwrite the native method + + +## Install + +``` +$ npm install --save number-is-nan +``` + + +## Usage + +```js +var numberIsNan = require('number-is-nan'); + +numberIsNan(NaN); +//=> true + +numberIsNan('unicorn'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json new file mode 100644 index 00000000000000..983c888760840f --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/package.json @@ -0,0 +1,120 @@ +{ + "_args": [ + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ], + [ + { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width" + ] + ], + "_from": "is-fullwidth-code-point@^1.0.0", + "_id": "is-fullwidth-code-point@1.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width/is-fullwidth-code-point", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "is-fullwidth-code-point@^1.0.0", + "scope": null, + "escapedName": "is-fullwidth-code-point", + "name": "is-fullwidth-code-point", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge/string-width" + ], + "_resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "_shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "_shrinkwrap": null, + "_spec": "is-fullwidth-code-point@^1.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/is-fullwidth-code-point/issues" + }, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "description": "Check if the character represented by a given Unicode code point is fullwidth", + "devDependencies": { + "ava": "0.0.4", + "code-point-at": "^1.0.0" + }, + "directories": {}, + "dist": { + "shasum": "ef9e31386f031a7f0d643af82fde50c457ef00cb", + "tarball": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "f2152d357f41f82785436d428e4f8ede143b7548", + "homepage": "https://github.com/sindresorhus/is-fullwidth-code-point", + "keywords": [ + "fullwidth", + "full-width", + "full", + "width", + "unicode", + "character", + "char", + "string", + "str", + "codepoint", + "code", + "point", + "is", + "detect", + "check" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "is-fullwidth-code-point", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/is-fullwidth-code-point.git" + }, + "scripts": { + "test": "node test.js" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md new file mode 100644 index 00000000000000..4936464b1b4155 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/node_modules/is-fullwidth-code-point/readme.md @@ -0,0 +1,39 @@ +# is-fullwidth-code-point [![Build Status](https://travis-ci.org/sindresorhus/is-fullwidth-code-point.svg?branch=master)](https://travis-ci.org/sindresorhus/is-fullwidth-code-point) + +> Check if the character represented by a given [Unicode code point](https://en.wikipedia.org/wiki/Code_point) is [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) + + +## Install + +``` +$ npm install --save is-fullwidth-code-point +``` + + +## Usage + +```js +var isFullwidthCodePoint = require('is-fullwidth-code-point'); + +isFullwidthCodePoint('谢'.codePointAt()); +//=> true + +isFullwidthCodePoint('a'.codePointAt()); +//=> false +``` + + +## API + +### isFullwidthCodePoint(input) + +#### input + +Type: `number` + +[Code point](https://en.wikipedia.org/wiki/Code_point) of a character. + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json new file mode 100644 index 00000000000000..3f8334f0294200 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -0,0 +1,136 @@ +{ + "_args": [ + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "string-width@^1.0.1", + "_id": "string-width@1.0.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/string-width", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.15.5", + "_phantomChildren": {}, + "_requested": { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge", + "/npm-registry-client/npmlog/gauge/wide-align" + ], + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "_shrinkwrap": null, + "_spec": "string-width@^1.0.1", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "sindresorhus.com" + }, + "bugs": { + "url": "https://github.com/sindresorhus/string-width/issues" + }, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "description": "Get the visual width of a string - the number of columns required to display it", + "devDependencies": { + "ava": "*", + "xo": "*" + }, + "directories": {}, + "dist": { + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" + }, + "engines": { + "node": ">=0.10.0" + }, + "files": [ + "index.js" + ], + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "homepage": "https://github.com/sindresorhus/string-width#readme", + "keywords": [ + "string", + "str", + "character", + "char", + "unicode", + "width", + "visual", + "column", + "columns", + "fullwidth", + "full-width", + "full", + "ansi", + "escape", + "codes", + "cli", + "command-line", + "terminal", + "console", + "cjk", + "chinese", + "japanese", + "korean", + "fixed-width" + ], + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "name": "string-width", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/string-width.git" + }, + "scripts": { + "test": "xo && ava" + }, + "version": "1.0.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md new file mode 100644 index 00000000000000..1ab42c93580ecb --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md @@ -0,0 +1,42 @@ +# string-width [![Build Status](https://travis-ci.org/sindresorhus/string-width.svg?branch=master)](https://travis-ci.org/sindresorhus/string-width) + +> Get the visual width of a string - the number of columns required to display it + +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. + +Useful to be able to measure the actual width of command-line output. + + +## Install + +``` +$ npm install --save string-width +``` + + +## Usage + +```js +const stringWidth = require('string-width'); + +stringWidth('古'); +//=> 2 + +stringWidth('\u001b[1m古\u001b[22m'); +//=> 2 + +stringWidth('a'); +//=> 1 +``` + + +## Related + +- [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module +- [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string + + +## License + +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore new file mode 100644 index 00000000000000..d1a6b0054bc8f3 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/.npmignore @@ -0,0 +1,5 @@ +*~ +/node_modules +.#* +/.nyc_output +/coverage diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE new file mode 100644 index 00000000000000..f4be44d881b2d9 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/LICENSE @@ -0,0 +1,14 @@ +Copyright (c) 2015, Rebecca Turner + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted, provided that the above +copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR +ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF +OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md new file mode 100644 index 00000000000000..32f1be04f09776 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/README.md @@ -0,0 +1,47 @@ +wide-align +---------- + +A wide-character aware text alignment function for use in terminals / on the +console. + +### Usage + +``` +var align = require('wide-align') + +// Note that if you view this on a unicode console, all of the slashes are +// aligned. This is because on a console, all narrow characters are +// an en wide and all wide characters are an em. In browsers, this isn't +// held to and wide characters like "古" can be less than two narrow +// characters even with a fixed width font. + +console.log(align.center('abc', 10)) // ' abc ' +console.log(align.center('古古古', 10)) // ' 古古古 ' +console.log(align.left('abc', 10)) // 'abc ' +console.log(align.left('古古古', 10)) // '古古古 ' +console.log(align.right('abc', 10)) // ' abc' +console.log(align.right('古古古', 10)) // ' 古古古' +``` + +### Functions + +#### `align.center(str, length)` → `str` + +Returns *str* with spaces added to both sides such that that it is *length* +chars long and centered in the spaces. + +#### `align.left(str, length)` → `str` + +Returns *str* with spaces to the right such that it is *length* chars long. + +### `align.right(str, length)` → `str` + +Returns *str* with spaces to the left such that it is *length* chars long. + +### Origins + +These functions were originally taken from +[cliui](https://npmjs.com/package/cliui). Changes include switching to the +MUCH faster pad generation function from +[lodash](https://npmjs.com/package/lodash), making center alignment pad +both sides and adding left alignment. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js new file mode 100644 index 00000000000000..4f94ca4cde19b5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/align.js @@ -0,0 +1,65 @@ +'use strict' +var stringWidth = require('string-width') + +exports.center = alignCenter +exports.left = alignLeft +exports.right = alignRight + +// lodash's way of generating pad characters. + +function createPadding (width) { + var result = '' + var string = ' ' + var n = width + do { + if (n % 2) { + result += string; + } + n = Math.floor(n / 2); + string += string; + } while (n); + + return result; +} + +function alignLeft (str, width) { + var trimmed = str.trimRight() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return trimmed + padding +} + +function alignRight (str, width) { + var trimmed = str.trimLeft() + if (trimmed.length === 0 && str.length >= width) return str + var padding = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + padding = createPadding(width - strWidth) + } + + return padding + trimmed +} + +function alignCenter (str, width) { + var trimmed = str.trim() + if (trimmed.length === 0 && str.length >= width) return str + var padLeft = '' + var padRight = '' + var strWidth = stringWidth(trimmed) + + if (strWidth < width) { + var padLeftBy = parseInt((width - strWidth) / 2, 10) + padLeft = createPadding(padLeftBy) + padRight = createPadding(width - (strWidth + padLeftBy)) + } + + return padLeft + trimmed + padRight +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json new file mode 100644 index 00000000000000..bdc7bfa6a4b7e5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/package.json @@ -0,0 +1,105 @@ +{ + "_args": [ + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" + ], + [ + { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge" + ] + ], + "_from": "wide-align@^1.1.0", + "_id": "wide-align@1.1.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge/wide-align", + "_nodeVersion": "4.2.2", + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.5.3", + "_phantomChildren": {}, + "_requested": { + "raw": "wide-align@^1.1.0", + "scope": null, + "escapedName": "wide-align", + "name": "wide-align", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog/gauge" + ], + "_resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz", + "_shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "_shrinkwrap": null, + "_spec": "wide-align@^1.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org", + "url": "http://re-becca.org/" + }, + "bugs": { + "url": "https://github.com/iarna/wide-align/issues" + }, + "dependencies": { + "string-width": "^1.0.1" + }, + "description": "A wide-character aware text alignment function for use on the console or with fixed width fonts.", + "devDependencies": { + "tap": "^2.3.2" + }, + "directories": {}, + "dist": { + "shasum": "40edde802a71fea1f070da3e62dcda2e7add96ad", + "tarball": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.0.tgz" + }, + "gitHead": "fe3f7f210650913d5bee702d7e19938f6977bc8a", + "homepage": "https://github.com/iarna/wide-align#readme", + "keywords": [ + "wide", + "double", + "unicode", + "cjkv", + "pad", + "align" + ], + "license": "ISC", + "main": "align.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "wide-align", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/wide-align.git" + }, + "scripts": { + "test": "tap --coverage test/*.js" + }, + "version": "1.1.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js new file mode 100644 index 00000000000000..64e9f9dbda4697 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/node_modules/wide-align/test/align.js @@ -0,0 +1,37 @@ +'use strict' +var test = require('tap').test +var align = require('..') + +test('align', function (t) { + t.is(align.center('abc', 10), ' abc ', 'center narrow') + t.is(align.center('古古古', 10), ' 古古古 ', 'center wide') + t.is(align.left('abc', 10), 'abc ', 'left narrow') + t.is(align.left('古古古', 10), '古古古 ', 'left wide') + t.is(align.right('abc', 10), ' abc', 'right narrow') + t.is(align.right('古古古', 10), ' 古古古', 'right wide') + + t.is(align.center('abc', 2), 'abc', 'center narrow overflow') + t.is(align.center('古古古', 4), '古古古', 'center wide overflow') + t.is(align.left('abc', 2), 'abc', 'left narrow overflow') + t.is(align.left('古古古', 4), '古古古', 'left wide overflow') + t.is(align.right('abc', 2), 'abc', 'right narrow overflow') + t.is(align.right('古古古', 4), '古古古', 'right wide overflow') + + t.is(align.left('', 5), ' ', 'left align nothing') + t.is(align.center('', 5), ' ', 'center align nothing') + t.is(align.right('', 5), ' ', 'right align nothing') + + t.is(align.left(' ', 5), ' ', 'left align whitespace') + t.is(align.center(' ', 5), ' ', 'center align whitespace') + t.is(align.right(' ', 5), ' ', 'right align whitespace') + + t.is(align.left(' ', 2), ' ', 'left align whitespace overflow') + t.is(align.center(' ', 2), ' ', 'center align whitespace overflow') + t.is(align.right(' ', 2), ' ', 'right align whitespace overflow') + + t.is(align.left('x ', 10), 'x ', 'left align whitespace mix') + t.is(align.center('x ', 10), ' x ', 'center align whitespace mix') + t.is(align.right('x ', 10), ' x', 'right align whitespace mix') + + t.end() +}) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json new file mode 100644 index 00000000000000..209c6b4125f198 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/package.json @@ -0,0 +1,140 @@ +{ + "_args": [ + [ + { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "gauge@~2.6.0", + "_id": "gauge@2.6.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/gauge", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/gauge-2.6.0.tgz_1466067371972_0.20705468393862247" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.2", + "_phantomChildren": { + "strip-ansi": "3.0.1" + }, + "_requested": { + "raw": "gauge@~2.6.0", + "scope": null, + "escapedName": "gauge", + "name": "gauge", + "rawSpec": "~2.6.0", + "spec": ">=2.6.0 <2.7.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz", + "_shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "_shrinkwrap": null, + "_spec": "gauge@~2.6.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Rebecca Turner", + "email": "me@re-becca.org" + }, + "bugs": { + "url": "https://github.com/iarna/gauge/issues" + }, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-color": "^0.1.7", + "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" + }, + "description": "A terminal based horizontal guage", + "devDependencies": { + "readable-stream": "^2.0.6", + "require-inject": "^1.4.0", + "standard": "^7.1.2", + "tap": "^5.7.2", + "through2": "^2.0.0" + }, + "directories": {}, + "dist": { + "shasum": "d35301ad18e96902b4751dcbbe40f4218b942a46", + "tarball": "https://registry.npmjs.org/gauge/-/gauge-2.6.0.tgz" + }, + "files": [ + "base-theme.js", + "CHANGELOG.md", + "error.js", + "has-color.js", + "index.js", + "LICENSE", + "package.json", + "plumbing.js", + "process.js", + "progress-bar.js", + "README.md", + "render-template.js", + "set-immediate.js", + "set-interval.js", + "spin.js", + "template-item.js", + "theme-set.js", + "themes.js", + "wide-truncate.js" + ], + "gitHead": "d51040a71c269432c16cc542143f403a831630e6", + "homepage": "https://github.com/iarna/gauge", + "keywords": [ + "progressbar", + "progress", + "gauge" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + } + ], + "name": "gauge", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/iarna/gauge.git" + }, + "scripts": { + "test": "standard && tap test/*.js --coverage" + }, + "version": "2.6.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js new file mode 100644 index 00000000000000..589a9c92878ebf --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/plumbing.js @@ -0,0 +1,47 @@ +'use strict' +var consoleControl = require('console-control-strings') +var renderTemplate = require('./render-template.js') +var validate = require('aproba') + +var Plumbing = module.exports = function (theme, template, width) { + if (!width) width = 80 + validate('OAN', [theme, template, width]) + this.showing = false + this.theme = theme + this.width = width + this.template = template +} +Plumbing.prototype = {} + +Plumbing.prototype.setTheme = function (theme) { + validate('O', [theme]) + this.theme = theme +} + +Plumbing.prototype.setTemplate = function (template) { + validate('A', [template]) + this.template = template +} + +Plumbing.prototype.setWidth = function (width) { + validate('N', [width]) + this.width = width +} + +Plumbing.prototype.hide = function () { + return consoleControl.gotoSOL() + consoleControl.eraseLine() +} + +Plumbing.prototype.hideCursor = consoleControl.hideCursor + +Plumbing.prototype.showCursor = consoleControl.showCursor + +Plumbing.prototype.show = function (status) { + var values = Object.create(this.theme) + for (var key in status) { + values[key] = status[key] + } + + return renderTemplate(this.width, this.template, values).trim() + + consoleControl.eraseLine() + consoleControl.gotoSOL() +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js new file mode 100644 index 00000000000000..05e85694d755b6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/process.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = process diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js new file mode 100644 index 00000000000000..7f8dd68be24cf0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/progress-bar.js @@ -0,0 +1,35 @@ +'use strict' +var validate = require('aproba') +var renderTemplate = require('./render-template.js') +var wideTruncate = require('./wide-truncate') +var stringWidth = require('string-width') + +module.exports = function (theme, width, completed) { + validate('ONN', [theme, width, completed]) + if (completed < 0) completed = 0 + if (completed > 1) completed = 1 + if (width <= 0) return '' + var sofar = Math.round(width * completed) + var rest = width - sofar + var template = [ + {type: 'complete', value: repeat(theme.complete, sofar), length: sofar}, + {type: 'remaining', value: repeat(theme.remaining, rest), length: rest} + ] + return renderTemplate(width, template, theme) +} + +// lodash's way of repeating +function repeat (string, width) { + var result = '' + var n = width + do { + if (n % 2) { + result += string + } + n = Math.floor(n / 2) + /*eslint no-self-assign: 0*/ + string += string + } while (n && stringWidth(result) < width) + + return wideTruncate(result, width) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js new file mode 100644 index 00000000000000..3261bfbe6f4be5 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/render-template.js @@ -0,0 +1,181 @@ +'use strict' +var align = require('wide-align') +var validate = require('aproba') +var objectAssign = require('object-assign') +var wideTruncate = require('./wide-truncate') +var error = require('./error') +var TemplateItem = require('./template-item') + +function renderValueWithValues (values) { + return function (item) { + return renderValue(item, values) + } +} + +var renderTemplate = module.exports = function (width, template, values) { + var items = prepareItems(width, template, values) + var rendered = items.map(renderValueWithValues(values)).join('') + return align.left(wideTruncate(rendered, width), width) +} + +function preType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'pre' + cappedTypeName +} + +function postType (item) { + var cappedTypeName = item.type[0].toUpperCase() + item.type.slice(1) + return 'post' + cappedTypeName +} + +function hasPreOrPost (item, values) { + if (!item.type) return + return values[preType(item)] || values[postType(item)] +} + +function generatePreAndPost (baseItem, parentValues) { + var item = objectAssign({}, baseItem) + var values = Object.create(parentValues) + var template = [] + var pre = preType(item) + var post = postType(item) + if (values[pre]) { + template.push({value: values[pre]}) + values[pre] = null + } + item.minLength = null + item.length = null + item.maxLength = null + template.push(item) + values[item.type] = values[item.type] + if (values[post]) { + template.push({value: values[post]}) + values[post] = null + } + return function ($1, $2, length) { + return renderTemplate(length, template, values) + } +} + +function prepareItems (width, template, values) { + function cloneAndObjectify (item, index, arr) { + var cloned = new TemplateItem(item, width) + var type = cloned.type + if (cloned.value == null) { + if (!(type in values)) { + if (cloned.default == null) { + throw new error.MissingTemplateValue(cloned, values) + } else { + cloned.value = cloned.default + } + } else { + cloned.value = values[type] + } + } + if (cloned.value == null || cloned.value === '') return null + cloned.index = index + cloned.first = index === 0 + cloned.last = index === arr.length - 1 + if (hasPreOrPost(cloned, values)) cloned.value = generatePreAndPost(cloned, values) + return cloned + } + + var output = template.map(cloneAndObjectify).filter(function (item) { return item != null }) + + var outputLength = 0 + var remainingSpace = width + var variableCount = output.length + + function consumeSpace (length) { + if (length > remainingSpace) length = remainingSpace + outputLength += length + remainingSpace -= length + } + + function finishSizing (item, length) { + if (item.finished) throw new error.Internal('Tried to finish template item that was already finished') + if (length === Infinity) throw new error.Internal('Length of template item cannot be infinity') + if (length != null) item.length = length + item.minLength = null + item.maxLength = null + --variableCount + item.finished = true + if (item.length == null) item.length = item.getBaseLength() + if (item.length == null) throw new error.Internal('Finished template items must have a length') + consumeSpace(item.getLength()) + } + + output.forEach(function (item) { + if (!item.kerning) return + var prevPadRight = item.first ? 0 : output[item.index - 1].padRight + if (!item.first && prevPadRight < item.kerning) item.padLeft = item.kerning - prevPadRight + if (!item.last) item.padRight = item.kerning + }) + + // Finish any that have a fixed (literal or intuited) length + output.forEach(function (item) { + if (item.getBaseLength() == null) return + finishSizing(item) + }) + + var resized = 0 + var resizing + var hunkSize + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.maxLength) return + if (item.getMaxLength() < hunkSize) { + finishSizing(item, item.maxLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining maxLength') + + resized = 0 + do { + resizing = false + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + if (!item.minLength) return + if (item.getMinLength() >= hunkSize) { + finishSizing(item, item.minLength) + resizing = true + } + }) + } while (resizing && resized++ < output.length) + if (resizing) throw new error.Internal('Resize loop iterated too many times while determining minLength') + + hunkSize = Math.round(remainingSpace / variableCount) + output.forEach(function (item) { + if (item.finished) return + finishSizing(item, hunkSize) + }) + + return output +} + +function renderFunction (item, values, length) { + validate('OON', arguments) + if (item.type) { + return item.value(values, values[item.type + 'Theme'] || {}, length) + } else { + return item.value(values, {}, length) + } +} + +function renderValue (item, values) { + var length = item.getBaseLength() + var value = typeof item.value === 'function' ? renderFunction(item, values, length) : item.value + if (value == null || value === '') return '' + var alignWith = align[item.align] || align.left + var leftPadding = item.padLeft ? align.left('', item.padLeft) : '' + var rightPadding = item.padRight ? align.right('', item.padRight) : '' + var truncated = wideTruncate(String(value), length) + var aligned = alignWith(truncated, length) + return leftPadding + aligned + rightPadding +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js new file mode 100644 index 00000000000000..6650a485c49933 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-immediate.js @@ -0,0 +1,7 @@ +'use strict' +var process = require('./process') +try { + module.exports = setImmediate +} catch (ex) { + module.exports = process.nextTick +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js new file mode 100644 index 00000000000000..576198793c5504 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/set-interval.js @@ -0,0 +1,3 @@ +'use strict' +// this exists so we can replace it during testing +module.exports = setInterval diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js new file mode 100644 index 00000000000000..34142ee31acc7c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/spin.js @@ -0,0 +1,5 @@ +'use strict' + +module.exports = function spin (spinstr, spun) { + return spinstr[spun % spinstr.length] +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js new file mode 100644 index 00000000000000..e46f447c941d38 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/template-item.js @@ -0,0 +1,73 @@ +'use strict' +var stringWidth = require('string-width') + +module.exports = TemplateItem + +function isPercent (num) { + if (typeof num !== 'string') return false + return num.slice(-1) === '%' +} + +function percent (num) { + return Number(num.slice(0, -1)) / 100 +} + +function TemplateItem (values, outputLength) { + this.overallOutputLength = outputLength + this.finished = false + this.type = null + this.value = null + this.length = null + this.maxLength = null + this.minLength = null + this.kerning = null + this.align = 'left' + this.padLeft = 0 + this.padRight = 0 + this.index = null + this.first = null + this.last = null + if (typeof values === 'string') { + this.value = values + } else { + for (var prop in values) this[prop] = values[prop] + } + // Realize percents + if (isPercent(this.length)) { + this.length = Math.round(this.overallOutputLength * percent(this.length)) + } + if (isPercent(this.minLength)) { + this.minLength = Math.round(this.overallOutputLength * percent(this.minLength)) + } + if (isPercent(this.maxLength)) { + this.maxLength = Math.round(this.overallOutputLength * percent(this.maxLength)) + } + return this +} + +TemplateItem.prototype = {} + +TemplateItem.prototype.getBaseLength = function () { + var length = this.length + if (length == null && typeof this.value === 'string' && this.maxLength == null && this.minLength == null) { + length = stringWidth(this.value) + } + return length +} + +TemplateItem.prototype.getLength = function () { + var length = this.getBaseLength() + if (length == null) return null + return length + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMaxLength = function () { + if (this.maxLength == null) return null + return this.maxLength + this.padLeft + this.padRight +} + +TemplateItem.prototype.getMinLength = function () { + if (this.minLength == null) return null + return this.minLength + this.padLeft + this.padRight +} + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js new file mode 100644 index 00000000000000..68971d5d231b07 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/theme-set.js @@ -0,0 +1,115 @@ +'use strict' +var objectAssign = require('object-assign') + +module.exports = function () { + return ThemeSetProto.newThemeSet() +} + +var ThemeSetProto = {} + +ThemeSetProto.baseTheme = require('./base-theme.js') + +ThemeSetProto.newTheme = function (parent, theme) { + if (!theme) { + theme = parent + parent = this.baseTheme + } + return objectAssign({}, parent, theme) +} + +ThemeSetProto.getThemeNames = function () { + return Object.keys(this.themes) +} + +ThemeSetProto.addTheme = function (name, parent, theme) { + this.themes[name] = this.newTheme(parent, theme) +} + +ThemeSetProto.addToAllThemes = function (theme) { + var themes = this.themes + Object.keys(themes).forEach(function (name) { + objectAssign(themes[name], theme) + }) + objectAssign(this.baseTheme, theme) +} + +ThemeSetProto.getTheme = function (name) { + if (!this.themes[name]) throw this.newMissingThemeError(name) + return this.themes[name] +} + +ThemeSetProto.setDefault = function (opts, name) { + if (name == null) { + name = opts + opts = {} + } + var platform = opts.platform == null ? 'fallback' : opts.platform + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!this.defaults[platform]) this.defaults[platform] = {true: {}, false: {}} + this.defaults[platform][hasUnicode][hasColor] = name +} + +ThemeSetProto.getDefault = function (opts) { + if (!opts) opts = {} + var platformName = opts.platform || process.platform + var platform = this.defaults[platformName] || this.defaults.fallback + var hasUnicode = !!opts.hasUnicode + var hasColor = !!opts.hasColor + if (!platform) throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + if (!platform[hasUnicode][hasColor]) { + if (hasUnicode && hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (hasUnicode && hasColor && platform[!hasUnicode][!hasColor]) { + hasUnicode = false + hasColor = false + } else if (hasUnicode && !hasColor && platform[!hasUnicode][hasColor]) { + hasUnicode = false + } else if (!hasUnicode && hasColor && platform[hasUnicode][!hasColor]) { + hasColor = false + } else if (platform === this.defaults.fallback) { + throw this.newMissingDefaultThemeError(platformName, hasUnicode, hasColor) + } + } + if (platform[hasUnicode][hasColor]) { + return this.getTheme(platform[hasUnicode][hasColor]) + } else { + return this.getDefault(objectAssign({}, opts, {platform: 'fallback'})) + } +} + +ThemeSetProto.newMissingThemeError = function newMissingThemeError (name) { + var err = new Error('Could not find a gauge theme named "' + name + '"') + Error.captureStackTrace.call(err, newMissingThemeError) + err.theme = name + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newMissingDefaultThemeError = function newMissingDefaultThemeError (platformName, hasUnicode, hasColor) { + var err = new Error( + 'Could not find a gauge theme for your platform/unicode/color use combo:\n' + + ' platform = ' + platformName + '\n' + + ' hasUnicode = ' + hasUnicode + '\n' + + ' hasColor = ' + hasColor) + Error.captureStackTrace.call(err, newMissingDefaultThemeError) + err.platform = platformName + err.hasUnicode = hasUnicode + err.hasColor = hasColor + err.code = 'EMISSINGTHEME' + return err +} + +ThemeSetProto.newThemeSet = function () { + var themeset = function (opts) { + return themeset.getDefault(opts) + } + return objectAssign(themeset, ThemeSetProto, { + themes: objectAssign({}, this.themes), + baseTheme: objectAssign({}, this.baseTheme), + defaults: JSON.parse(JSON.stringify(this.defaults || {})) + }) +} + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js new file mode 100644 index 00000000000000..eb5a4f5b5e1034 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/themes.js @@ -0,0 +1,54 @@ +'use strict' +var consoleControl = require('console-control-strings') +var ThemeSet = require('./theme-set.js') + +var themes = module.exports = new ThemeSet() + +themes.addTheme('ASCII', { + preProgressbar: '[', + postProgressbar: ']', + progressbarTheme: { + complete: '#', + remaining: '.' + }, + activityIndicatorTheme: '-\\|/', + preSubsection: '>' +}) + +themes.addTheme('colorASCII', themes.getTheme('ASCII'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '.', + postRemaining: consoleControl.color('reset') + } +}) + +themes.addTheme('brailleSpinner', { + preProgressbar: '⸨', + postProgressbar: '⸩', + progressbarTheme: { + complete: '░', + remaining: '⠂' + }, + activityIndicatorTheme: '⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏', + preSubsection: '>' +}) + +themes.addTheme('colorBrailleSpinner', themes.getTheme('brailleSpinner'), { + progressbarTheme: { + preComplete: consoleControl.color('inverse'), + complete: ' ', + postComplete: consoleControl.color('stopInverse'), + preRemaining: consoleControl.color('brightBlack'), + remaining: '░', + postRemaining: consoleControl.color('reset') + } +}) + +themes.setDefault({}, 'ASCII') +themes.setDefault({hasColor: true}, 'colorASCII') +themes.setDefault({platform: 'darwin', hasUnicode: true}, 'brailleSpinner') +themes.setDefault({platform: 'darwin', hasUnicode: true, hasColor: true}, 'colorBrailleSpinner') diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js new file mode 100644 index 00000000000000..c531bc491fbb58 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/gauge/wide-truncate.js @@ -0,0 +1,25 @@ +'use strict' +var stringWidth = require('string-width') +var stripAnsi = require('strip-ansi') + +module.exports = wideTruncate + +function wideTruncate (str, target) { + if (stringWidth(str) === 0) return str + if (target <= 0) return '' + if (stringWidth(str) <= target) return str + + // We compute the number of bytes of ansi sequences here and add + // that to our initial truncation to ensure that we don't slice one + // that we want to keep in half. + var noAnsi = stripAnsi(str) + var ansiSize = str.length + noAnsi.length + var truncated = str.slice(0, target + ansiSize) + + // we have to shrink the result to account for our ansi sequence buffer + // (if an ansi sequence was truncated) and double width characters. + while (stringWidth(truncated) > target) { + truncated = truncated.slice(0, -1) + } + return truncated +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md new file mode 100644 index 00000000000000..03bf591923d782 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/CHANGELOG.md @@ -0,0 +1,26 @@ +# Change Log + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + + +# [2.0.0](https://github.com/yargs/set-blocking/compare/v1.0.0...v2.0.0) (2016-05-17) + + +### Features + +* add an isTTY check ([#3](https://github.com/yargs/set-blocking/issues/3)) ([66ce277](https://github.com/yargs/set-blocking/commit/66ce277)) + + +### BREAKING CHANGES + +* stdio/stderr will not be set to blocking if isTTY === false + + + + +# 1.0.0 (2016-05-14) + + +### Features + +* implemented shim for stream._handle.setBlocking ([6bde0c0](https://github.com/yargs/set-blocking/commit/6bde0c0)) diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt new file mode 100644 index 00000000000000..836440bef7cf14 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/LICENSE.txt @@ -0,0 +1,14 @@ +Copyright (c) 2016, Contributors + +Permission to use, copy, modify, and/or distribute this software +for any purpose with or without fee is hereby granted, provided +that the above copyright notice and this permission notice +appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES +WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE +LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES +OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md new file mode 100644 index 00000000000000..e93b4202b59d65 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/README.md @@ -0,0 +1,31 @@ +# set-blocking + +[![Build Status](https://travis-ci.org/yargs/set-blocking.svg)](https://travis-ci.org/yargs/set-blocking) +[![NPM version](https://img.shields.io/npm/v/set-blocking.svg)](https://www.npmjs.com/package/set-blocking) +[![Coverage Status](https://coveralls.io/repos/yargs/set-blocking/badge.svg?branch=)](https://coveralls.io/r/yargs/set-blocking?branch=master) +[![Standard Version](https://img.shields.io/badge/release-standard%20version-brightgreen.svg)](https://github.com/conventional-changelog/standard-version) + +set blocking `stdio` and `stderr` ensuring that terminal output does not truncate. + +```js +const setBlocking = require('set-blocking') +setBlocking(true) +console.log(someLargeStringToOutput) +``` + +## Historical Context/Word of Warning + +This was created as a shim to address the bug discussed in [node #6456](https://github.com/nodejs/node/issues/6456). This bug crops up on +newer versions of Node.js (`0.12+`), truncating terminal output. + +You should be mindful of the side-effects caused by using `set-blocking`: + +* if your module sets blocking to `true`, it will effect other modules + consuming your library. In [yargs](https://github.com/yargs/yargs/blob/master/yargs.js#L653) we only call + `setBlocking(true)` once we already know we are about to call `process.exit(code)`. +* this patch will not apply to subprocesses spawned with `isTTY = true`, this is + the [default `spawn()` behavior](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options). + +## License + +ISC diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js new file mode 100644 index 00000000000000..6f78774bb63ee6 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/index.js @@ -0,0 +1,7 @@ +module.exports = function (blocking) { + [process.stdout, process.stderr].forEach(function (stream) { + if (stream._handle && stream.isTTY && typeof stream._handle.setBlocking === 'function') { + stream._handle.setBlocking(blocking) + } + }) +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json new file mode 100644 index 00000000000000..bbfac3e6ca4e90 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/node_modules/set-blocking/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog" + ], + [ + { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog" + ] + ], + "_from": "set-blocking@~2.0.0", + "_id": "set-blocking@2.0.0", + "_inCache": true, + "_location": "/npm-registry-client/npmlog/set-blocking", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/set-blocking-2.0.0.tgz_1463525966987_0.5456729622092098" + }, + "_npmUser": { + "name": "bcoe", + "email": "ben@npmjs.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "set-blocking@~2.0.0", + "scope": null, + "escapedName": "set-blocking", + "name": "set-blocking", + "rawSpec": "~2.0.0", + "spec": ">=2.0.0 <2.1.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client/npmlog" + ], + "_resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "_shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "_shrinkwrap": null, + "_spec": "set-blocking@~2.0.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client/node_modules/npmlog", + "author": { + "name": "Ben Coe", + "email": "ben@npmjs.com" + }, + "bugs": { + "url": "https://github.com/yargs/set-blocking/issues" + }, + "dependencies": {}, + "description": "set blocking stdio and stderr ensuring that terminal output does not truncate", + "devDependencies": { + "chai": "^3.5.0", + "coveralls": "^2.11.9", + "mocha": "^2.4.5", + "nyc": "^6.4.4", + "standard": "^7.0.1", + "standard-version": "^2.2.1" + }, + "directories": {}, + "dist": { + "shasum": "045f9782d011ae9a6803ddd382b24392b3d890f7", + "tarball": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz" + }, + "files": [ + "index.js", + "LICENSE.txt" + ], + "gitHead": "7eec10577b5fff264de477ba3b9d07f404946eff", + "homepage": "https://github.com/yargs/set-blocking#readme", + "keywords": [ + "flush", + "terminal", + "blocking", + "shim", + "stdio", + "stderr" + ], + "license": "ISC", + "main": "index.js", + "maintainers": [ + { + "name": "bcoe", + "email": "ben@npmjs.com" + } + ], + "name": "set-blocking", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/yargs/set-blocking.git" + }, + "scripts": { + "coverage": "nyc report --reporter=text-lcov | coveralls", + "pretest": "standard", + "test": "nyc mocha ./test/*.js", + "version": "standard-version" + }, + "version": "2.0.0" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json new file mode 100644 index 00000000000000..a66e8ce1c4685e --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/npmlog/package.json @@ -0,0 +1,113 @@ +{ + "_args": [ + [ + { + "raw": "npmlog@~2.0.0 || ~3.1.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "~2.0.0 || ~3.1.0", + "spec": ">=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" + ] + ], + "_from": "npmlog@>=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "_id": "npmlog@3.1.2", + "_inCache": true, + "_location": "/npm-registry-client/npmlog", + "_nodeVersion": "4.4.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" + }, + "_npmUser": { + "name": "iarna", + "email": "me@re-becca.org" + }, + "_npmVersion": "3.9.6", + "_phantomChildren": { + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", + "strip-ansi": "3.0.1" + }, + "_requested": { + "raw": "npmlog@~2.0.0 || ~3.1.0", + "scope": null, + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "~2.0.0 || ~3.1.0", + "spec": ">=2.0.0 <2.1.0||>=3.1.0 <3.2.0", + "type": "range" + }, + "_requiredBy": [ + "/npm-registry-client" + ], + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", + "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "_shrinkwrap": null, + "_spec": "npmlog@~2.0.0 || ~3.1.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "bugs": { + "url": "https://github.com/npm/npmlog/issues" + }, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.6.0", + "set-blocking": "~2.0.0" + }, + "description": "logger for npm", + "devDependencies": { + "standard": "~7.1.2", + "tap": "~5.7.0" + }, + "directories": {}, + "dist": { + "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" + }, + "files": [ + "log.js" + ], + "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", + "homepage": "https://github.com/npm/npmlog#readme", + "license": "ISC", + "main": "log.js", + "maintainers": [ + { + "name": "iarna", + "email": "me@re-becca.org" + }, + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" + }, + { + "name": "zkat", + "email": "kat@sykosomatic.org" + } + ], + "name": "npmlog", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/npm/npmlog.git" + }, + "scripts": { + "test": "standard && tap test/*.js" + }, + "version": "3.1.2" +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile index 98e7167bbe359f..eee21a99dfc9ec 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile @@ -19,3 +19,4 @@ release-patch: test npm publish .PHONY: test + diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md index 09d9c8a81bf121..eee05f7bb61537 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md @@ -57,8 +57,10 @@ var operation = retry.operation({ ### retry.operation([options]) -Creates a new `RetryOperation` object. See the `retry.timeouts()` function -below for available `options`. +Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions: + +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. ### retry.timeouts([options]) @@ -76,7 +78,7 @@ milliseconds. If `options` is an array, a copy of that array is returned. The formula used to calculate the individual timeouts is: ``` -var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) ``` Have a look at [this article][article] for a better explanation of approach. @@ -118,19 +120,27 @@ an array of method names which need to be wrapped. ``` retry.wrap(obj) -retry.wrap(obj, ['method1', 'method2']); +retry.wrap(obj, ['method1', 'method2']) -retry.wrap(obj, {retries: 3}); +retry.wrap(obj, {retries: 3}) -retry.wrap(obj, {retries: 3}, ['method1', 'method2']); +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) ``` The `options` object can take any options that the usual call to `retry.operation` can take. -### new RetryOperation(timeouts) +### new RetryOperation(timeouts, [options]) Creates a new `RetryOperation` where `timeouts` is an array where each value is a timeout given in milliseconds. +Available options: +* `forever`: Whether to retry forever, defaults to `false`. +* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`. + +If `forever` is true, the following changes happen: +* `RetryOperation.errors()` will only output an array of one item: the last error. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. + #### retryOperation.errors() Returns an array of all errors that have been passed to @@ -157,11 +167,11 @@ Whenever your retry operation takes longer than `timeout` to execute, the timeou #### retryOperation.try(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.start(fn) -This is an alias for `retryOperation.attempt(fn)`. This is deprecated. +This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead. #### retryOperation.retry(error) @@ -171,6 +181,10 @@ has been reached. Otherwise it returns `true`, and retries the operation after the timeout for the current attempt number. +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + #### retryOperation.attempts() Returns an int representing the number of attempts it took to call `fn` before it was successful. @@ -180,13 +194,19 @@ Returns an int representing the number of attempts it took to call `fn` before i retry is licensed under the MIT license. -#Changelog +# Changelog + +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + +0.8.0 Implementing retry.wrap. -0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). +0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). -0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. +0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called. -0.5.0 Some minor refactorings. +0.5.0 Some minor refactoring. 0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it. diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js index d6351e9d05bb33..446729b6f9af6b 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js @@ -28,4 +28,4 @@ faultTolerantResolve('nodejs.org', function(err, errors, addresses) { console.warn('addresses:'); console.log(addresses); -}); +}); \ No newline at end of file diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js new file mode 100644 index 00000000000000..e1ceafeebafc51 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js index 94685652c426fd..77428cfd0006fa 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js @@ -1,10 +1,11 @@ var RetryOperation = require('./retry_operation'); exports.operation = function(options) { - var retryForever = false; - if (options && options.forever === true) retryForever = true; var timeouts = exports.timeouts(options); - return new RetryOperation(timeouts, retryForever); + return new RetryOperation(timeouts, { + forever: options && options.forever, + unref: options && options.unref + }); }; exports.timeouts = function(options) { @@ -32,6 +33,10 @@ exports.timeouts = function(options) { timeouts.push(this.createTimeout(i, opts)); } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js index 52b895544e6a58..2b3db8e1776973 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js @@ -1,5 +1,11 @@ -function RetryOperation(timeouts, retryForever) { +function RetryOperation(timeouts, options) { + // Compatibility for the old (timeouts, retryForever) signature + if (typeof options === 'boolean') { + options = { forever: options }; + } + this._timeouts = timeouts; + this._options = options || {}; this._fn = null; this._errors = []; this._attempts = 1; @@ -7,12 +13,21 @@ function RetryOperation(timeouts, retryForever) { this._operationTimeoutCb = null; this._timeout = null; - if (!!retryForever) { + if (this._options.forever) { this._cachedTimeouts = this._timeouts.slice(0); } } module.exports = RetryOperation; +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); @@ -37,18 +52,26 @@ RetryOperation.prototype.retry = function(err) { } var self = this; - setTimeout(function() { + var timer = setTimeout(function() { self._attempts++; if (self._operationTimeoutCb) { self._timeout = setTimeout(function() { self._operationTimeoutCb(self._attempts); }, self._operationTimeout); + + if (this._options.unref) { + self._timeout.unref(); + } } self._fn(self._attempts); }, timeout); + if (this._options.unref) { + timer.unref(); + } + return true; }; diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json index c274f9d6a7047c..0ba214a6fd0a14 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json @@ -1,41 +1,53 @@ { "_args": [ [ - "retry@^0.8.0", - "/Users/rebecca/code/npm/node_modules/npm-registry-client" + { + "raw": "retry@^0.10.0", + "scope": null, + "escapedName": "retry", + "name": "retry", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client" ] ], - "_from": "retry@>=0.8.0 <0.9.0", - "_id": "retry@0.8.0", + "_from": "retry@>=0.10.0 <0.11.0", + "_id": "retry@0.10.0", "_inCache": true, - "_installable": true, "_location": "/npm-registry-client/retry", - "_nodeVersion": "0.10.33", + "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, "_npmUser": { - "email": "tim@debuggable.com", - "name": "tim-kos" + "name": "tim-kos", + "email": "tim@debuggable.com" }, "_npmVersion": "2.1.7", "_phantomChildren": {}, "_requested": { - "name": "retry", - "raw": "retry@^0.8.0", - "rawSpec": "^0.8.0", + "raw": "retry@^0.10.0", "scope": null, - "spec": ">=0.8.0 <0.9.0", + "escapedName": "retry", + "name": "retry", + "rawSpec": "^0.10.0", + "spec": ">=0.10.0 <0.11.0", "type": "range" }, "_requiredBy": [ "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz", - "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", "_shrinkwrap": null, - "_spec": "retry@^0.8.0", - "_where": "/Users/rebecca/code/npm/node_modules/npm-registry-client", + "_spec": "retry@^0.10.0", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npm-registry-client", "author": { - "email": "tim@debuggable.com", "name": "Tim Koschützki", + "email": "tim@debuggable.com", "url": "http://debuggable.com/" }, "bugs": { @@ -51,13 +63,13 @@ "lib": "./lib" }, "dist": { - "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz" + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" }, "engines": { "node": "*" }, - "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd", + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", "homepage": "https://github.com/tim-kos/node-retry", "license": "MIT", "main": "index", @@ -75,5 +87,5 @@ "url": "git://github.com/tim-kos/node-retry.git" }, "scripts": {}, - "version": "0.8.0" + "version": "0.10.0" } diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000000000..b41307cb529f12 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js index cecfa3b7310013..916936424f073b 100644 --- a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js @@ -104,3 +104,73 @@ var retry = require(common.dir.lib + '/retry'); fn(); })(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index 20ff75226d8a8e..51ff6bebb24ddd 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -2,106 +2,106 @@ "_args": [ [ { - "name": "npm-registry-client", - "raw": "npm-registry-client@latest", - "rawSpec": "latest", + "raw": "npm-registry-client@7.2.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npm-registry-client", + "name": "npm-registry-client", + "rawSpec": "7.2.1", + "spec": "7.2.1", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "npm-registry-client@latest", - "_id": "npm-registry-client@7.1.2", + "_from": "npm-registry-client@7.2.1", + "_id": "npm-registry-client@7.2.1", "_inCache": true, - "_installable": true, "_location": "/npm-registry-client", - "_nodeVersion": "4.4.0", + "_nodeVersion": "6.3.1", "_npmOperationalInternal": { "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-registry-client-7.1.2.tgz_1466040796551_0.645394338760525" + "tmp": "tmp/npm-registry-client-7.2.1.tgz_1472871043942_0.2117650501895696" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, - "_npmVersion": "3.9.2", + "_npmVersion": "3.10.7", "_phantomChildren": { - "inherits": "2.0.1" + "inherits": "2.0.3" }, "_requested": { - "name": "npm-registry-client", - "raw": "npm-registry-client@latest", - "rawSpec": "latest", + "raw": "npm-registry-client@7.2.1", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npm-registry-client", + "name": "npm-registry-client", + "rawSpec": "7.2.1", + "spec": "7.2.1", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.1.2.tgz", - "_shasum": "ddf243a2bd149d35172fe680aff40dfa20054bc3", + "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz", + "_shasum": "c792266b088cc313f8525e7e35248626c723db75", "_shrinkwrap": null, - "_spec": "npm-registry-client@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "npm-registry-client@7.2.1", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { "url": "https://github.com/npm/npm-registry-client/issues" }, "dependencies": { - "chownr": "^1.0.1", - "concat-stream": "^1.4.6", - "graceful-fs": "^4.1.2", - "mkdirp": "^0.5.0", + "concat-stream": "^1.5.2", + "graceful-fs": "^4.1.6", "normalize-package-data": "~1.0.1 || ^2.0.0", "npm-package-arg": "^3.0.0 || ^4.0.0", "npmlog": "~2.0.0 || ~3.1.0", - "once": "^1.3.0", - "request": "^2.47.0", - "retry": "^0.8.0", - "rimraf": "2", + "once": "^1.3.3", + "request": "^2.74.0", + "retry": "^0.10.0", "semver": "2 >=2.2.1 || 3.x || 4 || 5", "slide": "^1.1.3" }, "description": "Client for the npm registry", "devDependencies": { - "negotiator": "^0.4.9", - "nock": "^0.56.0", - "readable-stream": "^2.0.2", - "standard": "^4.0.0", - "tap": "^1.2.0" + "negotiator": "^0.6.1", + "nock": "^8.0.0", + "readable-stream": "^2.1.5", + "rimraf": "^2.5.4", + "standard": "^8.0.0", + "tap": "^7.0.0" }, "directories": {}, "dist": { - "shasum": "ddf243a2bd149d35172fe680aff40dfa20054bc3", - "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.1.2.tgz" + "shasum": "c792266b088cc313f8525e7e35248626c723db75", + "tarball": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-7.2.1.tgz" }, - "gitHead": "0b595c4769f314a12661d537a328cf4e5658a00f", + "gitHead": "debec76884db8092c2c7a21ab5b4ed083f8ce2c9", "homepage": "https://github.com/npm/npm-registry-client#readme", "license": "ISC", "main": "index.js", "maintainers": [ { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npm-registry-client", @@ -115,5 +115,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "7.1.2" + "version": "7.2.1" } diff --git a/deps/npm/node_modules/npm-registry-client/test/00-setup.js b/deps/npm/node_modules/npm-registry-client/test/00-setup.js index 747768fb85f8c4..fb9585a4285d8f 100644 --- a/deps/npm/node_modules/npm-registry-client/test/00-setup.js +++ b/deps/npm/node_modules/npm-registry-client/test/00-setup.js @@ -1,8 +1,9 @@ -var tap = require('tap') +var join = require('path').join var rimraf = require('rimraf') +var tap = require('tap') tap.test('setup', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { if (er) throw er t.pass('cache cleaned') t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js index a432da85811955..ca6983a1ba5a4a 100644 --- a/deps/npm/node_modules/npm-registry-client/test/config-defaults.js +++ b/deps/npm/node_modules/npm-registry-client/test/config-defaults.js @@ -33,7 +33,7 @@ test('config defaults', function (t) { }) test('missing HTTPS proxy defaults to HTTP proxy', function (t) { - var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' }}) + var client = common.freshClient({ proxy: { http: 'http://proxy.npm:8088/' } }) t.equal(client.config.proxy.http, 'http://proxy.npm:8088/', 'HTTP proxy set') t.equal(client.config.proxy.http, client.config.proxy.https, 'HTTP === HTTPS') diff --git a/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js b/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js new file mode 100644 index 00000000000000..72aeea0beb7d55 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/fetch-streaming.js @@ -0,0 +1,58 @@ +var test = require('tap').test +var concat = require('concat-stream') + +var server = require('./lib/server.js') +var common = require('./lib/common.js') +var client = common.freshClient() + +var testData = JSON.stringify({test: true}) +var errorData = JSON.stringify({error: 'it went bad'}) + +test('streaming fetch', function (t) { + server.expect('/test', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(200, { + 'content-type': 'application/json' + }) + + res.end(testData) + }) + + server.expect('/error', function (req, res) { + t.equal(req.method, 'GET', 'got expected method') + + res.writeHead(401, { + 'content-type': 'application/json' + }) + + res.end(errorData) + }) + + client.fetch( + 'http://localhost:1337/test', + { streaming: true }, + function (er, res) { + t.ifError(er, 'loaded successfully') + + var sink = concat(function (data) { + t.deepEqual(data.toString(), testData) + client.fetch( + 'http://localhost:1337/error', + { streaming: true }, + function (er, res) { + t.ok(er, 'got an error') + server.close() + t.end() + } + ) + }) + + res.on('error', function (error) { + t.ifError(error, 'no errors on stream') + }) + + res.pipe(sink) + } + ) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/initialize.js b/deps/npm/node_modules/npm-registry-client/test/initialize.js index 3856b67b45e0f8..4a97bd5fdf94c0 100644 --- a/deps/npm/node_modules/npm-registry-client/test/initialize.js +++ b/deps/npm/node_modules/npm-registry-client/test/initialize.js @@ -83,7 +83,7 @@ test('referer set on client', function (t) { }) test('initializing with proxy explicitly disabled', function (t) { - var client = new Client({ proxy: { http: false }}) + var client = new Client({ proxy: { http: false } }) var options = client.initialize( 'http://localhost:1337/', 'GET', @@ -96,7 +96,7 @@ test('initializing with proxy explicitly disabled', function (t) { }) test('initializing with proxy undefined', function (t) { - var client = new Client({ proxy: { http: undefined }}) + var client = new Client({ proxy: { http: undefined } }) var options = client.initialize( 'http://localhost:1337/', 'GET', diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js index 78e543f699a168..ea48d3014988ec 100644 --- a/deps/npm/node_modules/npm-registry-client/test/lib/common.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -10,6 +10,14 @@ if (!global.setImmediate || !require('timers').setImmediate) { } } +// See https://github.com/npm/npm-registry-client/pull/142 for background. +// Note: `process.on('warning')` only works with Node >= 6. +process.on('warning', function (warning) { + if (/Possible EventEmitter memory leak detected/.test(warning.message)) { + throw new Error('There should not be any EventEmitter memory leaks') + } +}) + module.exports = { port: server.port, registry: REGISTRY, diff --git a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js index 35253c7acd7226..16e4ee8a1d449c 100644 --- a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js +++ b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js @@ -1,8 +1,9 @@ -var tap = require('tap') +var join = require('path').join var rimraf = require('rimraf') +var tap = require('tap') tap.test('teardown', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { + rimraf(join(__dirname, 'fixtures', 'cache'), function (er) { if (er) throw er t.pass('cache cleaned') t.end() diff --git a/deps/npm/node_modules/npm-user-validate/npm-user-validate.js b/deps/npm/node_modules/npm-user-validate/npm-user-validate.js index c9da9cd1c90f0e..3a645ec9329acd 100644 --- a/deps/npm/node_modules/npm-user-validate/npm-user-validate.js +++ b/deps/npm/node_modules/npm-user-validate/npm-user-validate.js @@ -4,7 +4,7 @@ exports.username = username var requirements = exports.requirements = { username: { - length: 'Name length must be less than or equal to 576 characters long', + length: 'Name length must be less than or equal to 214 characters long', lowerCase: 'Name must be lowercase', urlSafe: 'Name may not contain non-url-safe chars', dot: 'Name may not start with "."' @@ -28,7 +28,7 @@ function username (un) { return new Error(requirements.username.dot) } - if (un.length > 576) { + if (un.length > 214) { return new Error(requirements.username.length) } diff --git a/deps/npm/node_modules/npm-user-validate/package.json b/deps/npm/node_modules/npm-user-validate/package.json index 84204f8a4b1dd0..e6707430b7a97d 100644 --- a/deps/npm/node_modules/npm-user-validate/package.json +++ b/deps/npm/node_modules/npm-user-validate/package.json @@ -2,50 +2,50 @@ "_args": [ [ { - "raw": "npm-user-validate@latest", + "raw": "npm-user-validate@0.1.5", "scope": null, "escapedName": "npm-user-validate", "name": "npm-user-validate", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" }, "/Users/rebecca/code/npm" ] ], - "_from": "npm-user-validate@latest", - "_id": "npm-user-validate@0.1.4", + "_from": "npm-user-validate@0.1.5", + "_id": "npm-user-validate@0.1.5", "_inCache": true, "_installable": true, "_location": "/npm-user-validate", "_nodeVersion": "5.11.0", "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/npm-user-validate-0.1.4.tgz_1466105686124_0.06683815410360694" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/npm-user-validate-0.1.5.tgz_1466436459441_0.15483755711466074" }, "_npmUser": { "name": "aredridel", "email": "aria@npmjs.com" }, - "_npmVersion": "3.9.6", + "_npmVersion": "3.10.1", "_phantomChildren": {}, "_requested": { - "raw": "npm-user-validate@latest", + "raw": "npm-user-validate@0.1.5", "scope": null, "escapedName": "npm-user-validate", "name": "npm-user-validate", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "0.1.5", + "spec": "0.1.5", + "type": "version" }, "_requiredBy": [ "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.4.tgz", - "_shasum": "18fcbe53cf921eb8e6339314665b187955b1a837", + "_resolved": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz", + "_shasum": "52465d50c2d20294a57125b996baedbf56c5004b", "_shrinkwrap": null, - "_spec": "npm-user-validate@latest", + "_spec": "npm-user-validate@0.1.5", "_where": "/Users/rebecca/code/npm", "author": { "name": "Robert Kowalski", @@ -61,10 +61,10 @@ }, "directories": {}, "dist": { - "shasum": "18fcbe53cf921eb8e6339314665b187955b1a837", - "tarball": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.4.tgz" + "shasum": "52465d50c2d20294a57125b996baedbf56c5004b", + "tarball": "https://registry.npmjs.org/npm-user-validate/-/npm-user-validate-0.1.5.tgz" }, - "gitHead": "ab804940b6846f8cc63f87692cea85b1906c967a", + "gitHead": "688552a47e6c22cd07206894dcd21b9d7a37ee56", "homepage": "https://github.com/npm/npm-user-validate#readme", "keywords": [ "npm", @@ -97,5 +97,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "0.1.4" + "version": "0.1.5" } diff --git a/deps/npm/node_modules/npm-user-validate/test/username.test.js b/deps/npm/node_modules/npm-user-validate/test/username.test.js index 83528eec82a76d..aa0e6b33def686 100644 --- a/deps/npm/node_modules/npm-user-validate/test/username.test.js +++ b/deps/npm/node_modules/npm-user-validate/test/username.test.js @@ -22,15 +22,15 @@ test('username may not start with "."', function (t) { t.end() }) -test('username may not be longer than 576 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-venison-capicola--brisket-leberkas-pork-beef-ribs-kevin-short-ribs-tail-bresaola-ham--rump-fatback-short-ribs-frankfurter-boudin--turkey-cupim-tri-tip-pork-chop-landjaeger-frankfurter-ham-hock---kielbasa-sausage-sirloin-short-loin-bacon-tenderloin-biltong-spare-ribs-cow-beef-ribs-tongue-cupim-filet-mignon-drumstick--pork-chop-tenderloin-brisket-pork-belly-leberkas-and-a-pickle') +test('username may not be longer than 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-and-pickle') t.type(err, 'object') - t.match(err.message, /less than or equal to 576/) + t.match(err.message, /less than or equal to 214/) t.end() }); -test('username may be as long as 576 characters', function (t) { - var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-venison-capicola--brisket-leberkas-pork-beef-ribs-kevin-short-ribs-tail-bresaola-ham--rump-fatback-short-ribs-frankfurter-boudin--turkey-cupim-tri-tip-pork-chop-landjaeger-frankfurter-ham-hock---kielbasa-sausage-sirloin-short-loin-bacon-tenderloin-biltong-spare-ribs-cow-beef-ribs-tongue-cupim-filet-mignon-drumstick--pork-chop-tenderloin-brisket-pork-belly-leberkas-beef') +test('username may be as long as 214 characters', function (t) { + var err = v('bacon-ipsum-dolor-amet-tongue-short-loin-landjaeger-tenderloin-ball-tip-pork-loin-porchetta-pig-pork-chop-beef-ribs-pork-belly--shankle-t-bone-turducken-tongue-landjaeger-pork-loin-beef-chicken-short-loin-porchetta') t.type(err, 'null') t.end() }); diff --git a/deps/npm/node_modules/npmlog/log.js b/deps/npm/node_modules/npmlog/log.js index e5b70f1f80b743..bf894fb7a63423 100644 --- a/deps/npm/node_modules/npmlog/log.js +++ b/deps/npm/node_modules/npmlog/log.js @@ -219,7 +219,9 @@ log.emitLog = function (m) { if (l < this.levels[this.level]) return if (l > 0 && !isFinite(l)) return - var disp = log.disp[m.level] || m.level + // If 'disp' is null or undefined, use the lvl as a default + // Allows: '', 0 as valid disp + var disp = log.disp[m.level] != null ? log.disp[m.level] : m.level this.clearProgress() m.message.split(/\r?\n/).forEach(function (line) { if (this.heading) { @@ -264,7 +266,8 @@ log.write = function (msg, style) { } log.addLevel = function (lvl, n, style, disp) { - if (!disp) disp = lvl + // If 'disp' is null or undefined, use the lvl as a default + if (disp == null) disp = lvl this.levels[lvl] = n this.style[lvl] = style if (!this[lvl]) { diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md index f8789800aa784c..c41d39229244d2 100644 --- a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md +++ b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md @@ -25,7 +25,7 @@ single.completeWork(20) console.log(top.completed()) // 0.2 fs.stat("file", function(er, stat) { - if (er) throw er + if (er) throw er var stream = top.newStream("file", stat.size) console.log(top.completed()) // now 0.1 as single is 50% of the job and is 20% complete // and 50% * 20% == 10% diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js index aa2f839b6dd2ce..b9bec62440a468 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/index.js @@ -16,6 +16,11 @@ module.exports = function (str) { for (var i = 0; i < str.length; i++) { var code = codePointAt(str, i); + // ignore control characters + if (code <= 0x1f || (code >= 0x7f && code <= 0x9f)) { + continue; + } + // surrogates if (code >= 0x10000) { i++; diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json index 662efc0b1e6e8b..ee7bc6c9f340de 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/package.json @@ -1,27 +1,39 @@ { "_args": [ [ - "string-width@^1.0.1", - "/Users/rebecca/code/npm-with-new-gauge/node_modules/npmlog/node_modules/gauge" + { + "raw": "string-width@^1.0.1", + "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", + "spec": ">=1.0.1 <2.0.0", + "type": "range" + }, + "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge" ] ], "_from": "string-width@>=1.0.1 <2.0.0", - "_id": "string-width@1.0.1", + "_id": "string-width@1.0.2", "_inCache": true, - "_installable": true, "_location": "/npmlog/gauge/string-width", - "_nodeVersion": "0.12.5", + "_nodeVersion": "4.4.5", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/string-width-1.0.2.tgz_1471188233009_0.6573935742489994" + }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, - "_npmVersion": "2.11.2", + "_npmVersion": "2.15.5", "_phantomChildren": {}, "_requested": { - "name": "string-width", "raw": "string-width@^1.0.1", - "rawSpec": "^1.0.1", "scope": null, + "escapedName": "string-width", + "name": "string-width", + "rawSpec": "^1.0.1", "spec": ">=1.0.1 <2.0.0", "type": "range" }, @@ -29,14 +41,14 @@ "/npmlog/gauge", "/npmlog/gauge/wide-align" ], - "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "_shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", + "_resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "_shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", "_shrinkwrap": null, "_spec": "string-width@^1.0.1", - "_where": "/Users/rebecca/code/npm-with-new-gauge/node_modules/npmlog/node_modules/gauge", + "_where": "/Users/zkat/Documents/code/npm/node_modules/npmlog/node_modules/gauge", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -49,12 +61,13 @@ }, "description": "Get the visual width of a string - the number of columns required to display it", "devDependencies": { - "ava": "0.0.4" + "ava": "*", + "xo": "*" }, "directories": {}, "dist": { - "shasum": "c92129b6f1d7f52acf9af424a26e3864a05ceb0a", - "tarball": "http://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz" + "shasum": "118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3", + "tarball": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz" }, "engines": { "node": ">=0.10.0" @@ -62,8 +75,8 @@ "files": [ "index.js" ], - "gitHead": "f279cfd14835f0a3c8df69ba18e9a3960156e135", - "homepage": "https://github.com/sindresorhus/string-width", + "gitHead": "282cf3d53918a92cc3ee0778dcf938039bcbc47b", + "homepage": "https://github.com/sindresorhus/string-width#readme", "keywords": [ "string", "str", @@ -93,8 +106,8 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], "name": "string-width", @@ -105,7 +118,7 @@ "url": "git+https://github.com/sindresorhus/string-width.git" }, "scripts": { - "test": "node test.js" + "test": "xo && ava" }, - "version": "1.0.1" + "version": "1.0.2" } diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md index a7737a986c5736..1ab42c93580ecb 100644 --- a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md +++ b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/string-width/readme.md @@ -2,7 +2,7 @@ > Get the visual width of a string - the number of columns required to display it -Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. +Some Unicode characters are [fullwidth](https://en.wikipedia.org/wiki/Halfwidth_and_fullwidth_forms) and use double the normal width. [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) are stripped and doesn't affect the width. Useful to be able to measure the actual width of command-line output. @@ -17,7 +17,7 @@ $ npm install --save string-width ## Usage ```js -var stringWidth = require('string-width'); +const stringWidth = require('string-width'); stringWidth('古'); //=> 2 @@ -34,8 +34,9 @@ stringWidth('a'); - [string-width-cli](https://github.com/sindresorhus/string-width-cli) - CLI for this module - [string-length](https://github.com/sindresorhus/string-length) - Get the real length of a string +- [widest-line](https://github.com/sindresorhus/widest-line) - Get the visual width of the widest line in a string ## License -MIT © [Sindre Sorhus](http://sindresorhus.com) +MIT © [Sindre Sorhus](https://sindresorhus.com) diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json index 85211951f6951b..3f314d7916cf57 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -2,57 +2,58 @@ "_args": [ [ { - "name": "npmlog", - "raw": "npmlog@latest", - "rawSpec": "latest", + "raw": "npmlog@4.0.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "4.0.0", + "spec": "4.0.0", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "npmlog@latest", - "_id": "npmlog@3.1.2", + "_from": "npmlog@4.0.0", + "_id": "npmlog@4.0.0", "_inCache": true, - "_installable": true, "_location": "/npmlog", - "_nodeVersion": "4.4.0", + "_nodeVersion": "5.10.1", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/npmlog-3.1.2.tgz_1466073052641_0.36111341998912394" + "tmp": "tmp/npmlog-4.0.0.tgz_1468888150556_0.3835553650278598" }, "_npmUser": { - "email": "me@re-becca.org", - "name": "iarna" + "name": "zkat", + "email": "kat@sykosomatic.org" }, - "_npmVersion": "3.9.6", + "_npmVersion": "3.10.4", "_phantomChildren": { - "aproba": "1.0.3", - "has-unicode": "2.0.0", - "readable-stream": "2.1.3", + "aproba": "1.0.4", + "has-unicode": "2.0.1", + "readable-stream": "2.1.4", "strip-ansi": "3.0.1" }, "_requested": { - "name": "npmlog", - "raw": "npmlog@latest", - "rawSpec": "latest", + "raw": "npmlog@4.0.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "npmlog", + "name": "npmlog", + "rawSpec": "4.0.0", + "spec": "4.0.0", + "type": "version" }, "_requiredBy": [ - "/", - "/npm-registry-client" + "#USER", + "/" ], - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz", - "_shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", + "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.0.tgz", + "_shasum": "e094503961c70c1774eb76692080e8d578a9f88f", "_shrinkwrap": null, - "_spec": "npmlog@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "npmlog@4.0.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -71,32 +72,32 @@ }, "directories": {}, "dist": { - "shasum": "2d46fa874337af9498a2f12bb43d8d0be4a36873", - "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-3.1.2.tgz" + "shasum": "e094503961c70c1774eb76692080e8d578a9f88f", + "tarball": "https://registry.npmjs.org/npmlog/-/npmlog-4.0.0.tgz" }, "files": [ "log.js" ], - "gitHead": "444e237743fa1339cb91bea2d3f16f710be56984", + "gitHead": "3ca8823fdfa66f54c72adde3fd2c4e0237e6302b", "homepage": "https://github.com/npm/npmlog#readme", "license": "ISC", "main": "log.js", "maintainers": [ { - "email": "me@re-becca.org", - "name": "iarna" + "name": "iarna", + "email": "me@re-becca.org" }, { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "othiym23", + "email": "ogd@aoaioxxysz.net" }, { - "email": "kat@sykosomatic.org", - "name": "zkat" + "name": "zkat", + "email": "kat@sykosomatic.org" } ], "name": "npmlog", @@ -109,5 +110,5 @@ "scripts": { "test": "standard && tap test/*.js" }, - "version": "3.1.2" + "version": "4.0.0" } diff --git a/deps/npm/node_modules/once/README.md b/deps/npm/node_modules/once/README.md index a2981ea0705196..1f1ffca9330e3c 100644 --- a/deps/npm/node_modules/once/README.md +++ b/deps/npm/node_modules/once/README.md @@ -49,3 +49,31 @@ function load (cb) { }) } ``` + +## `once.strict(func)` + +Throw an error if the function is called twice. + +Some functions are expected to be called only once. Using `once` for them would +potentially hide logical errors. + +In the example below, the `greet` function has to call the callback only once: + +```javascript +function greet (name, cb) { + // return is missing from the if statement + // when no name is passed, the callback is called twice + if (!name) cb('Hello anonymous') + cb('Hello ' + name) +} + +function log (msg) { + console.log(msg) +} + +// this will print 'Hello anonymous' but the logical error will be missed +greet(null, once(msg)) + +// once.strict will print 'Hello anonymous' and throw an error when the callback will be called the second time +greet(null, once.strict(msg)) +``` diff --git a/deps/npm/node_modules/once/once.js b/deps/npm/node_modules/once/once.js index 2e1e721bfecec3..235406736d9d94 100644 --- a/deps/npm/node_modules/once/once.js +++ b/deps/npm/node_modules/once/once.js @@ -1,5 +1,6 @@ var wrappy = require('wrappy') module.exports = wrappy(once) +module.exports.strict = wrappy(onceStrict) once.proto = once(function () { Object.defineProperty(Function.prototype, 'once', { @@ -8,6 +9,13 @@ once.proto = once(function () { }, configurable: true }) + + Object.defineProperty(Function.prototype, 'onceStrict', { + value: function () { + return onceStrict(this) + }, + configurable: true + }) }) function once (fn) { @@ -19,3 +27,16 @@ function once (fn) { f.called = false return f } + +function onceStrict (fn) { + var f = function () { + if (f.called) + throw new Error(f.onceError) + f.called = true + return f.value = fn.apply(this, arguments) + } + var name = fn.name || 'Function wrapped with `once`' + f.onceError = name + " shouldn't be called more than once" + f.called = false + return f +} diff --git a/deps/npm/node_modules/once/package.json b/deps/npm/node_modules/once/package.json index f5fd8173cb19c3..1be563b51bf3ca 100644 --- a/deps/npm/node_modules/once/package.json +++ b/deps/npm/node_modules/once/package.json @@ -1,50 +1,64 @@ { "_args": [ [ - "once@~1.3.3", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "once@1.4.0", + "scope": null, + "escapedName": "once", + "name": "once", + "rawSpec": "1.4.0", + "spec": "1.4.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "once@>=1.3.3 <1.4.0", - "_id": "once@1.3.3", + "_from": "once@1.4.0", + "_id": "once@1.4.0", "_inCache": true, - "_installable": true, "_location": "/once", - "_nodeVersion": "4.0.0", + "_nodeVersion": "6.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/once-1.4.0.tgz_1473196269128_0.537820661207661" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "once", - "raw": "once@~1.3.3", - "rawSpec": "~1.3.3", + "raw": "once@1.4.0", "scope": null, - "spec": ">=1.3.3 <1.4.0", - "type": "range" + "escapedName": "once", + "name": "once", + "rawSpec": "1.4.0", + "spec": "1.4.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/glob", "/inflight", - "/node-gyp/glob", + "/init-package-json/glob", "/npm-registry-client", + "/read-package-json/glob", "/read-package-tree", "/readdir-scoped-modules", - "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del/globby/glob", - "/standard/standard-engine/eslint/inquirer/run-async", - "/tap/nyc/istanbul" + "/standard/eslint/file-entry-cache/flat-cache/del/globby/glob", + "/standard/eslint/glob", + "/standard/eslint/inquirer/run-async" ], - "_resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "_shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", + "_resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "_shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", "_shrinkwrap": null, - "_spec": "once@~1.3.3", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "once@1.4.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -55,23 +69,23 @@ }, "description": "Run a function exactly one time", "devDependencies": { - "tap": "^1.2.0" + "tap": "^7.0.1" }, "directories": { "test": "test" }, "dist": { - "shasum": "b2e261557ce4c314ec8304f3fa82663e4297ca20", - "tarball": "http://registry.npmjs.org/once/-/once-1.3.3.tgz" + "shasum": "583b1aa775961d4b113ac17d9c50baef9dd76bd1", + "tarball": "https://registry.npmjs.org/once/-/once-1.4.0.tgz" }, "files": [ "once.js" ], - "gitHead": "2ad558657e17fafd24803217ba854762842e4178", + "gitHead": "0e614d9f5a7e6f0305c625f6b581f6d80b33b8a6", "homepage": "https://github.com/isaacs/once#readme", "keywords": [ - "function", "once", + "function", "one", "single" ], @@ -93,5 +107,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "1.3.3" + "version": "1.4.0" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md index d458bc2e0a6b03..ad72b8133eaf5e 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/README.md @@ -2,7 +2,7 @@ A minimal matching utility. -[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch) +[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.svg)](http://travis-ci.org/isaacs/minimatch) This is the matching library used internally by npm. @@ -37,7 +37,7 @@ See: ## Minimatch Class -Create a minimatch object by instanting the `minimatch.Minimatch` class. +Create a minimatch object by instantiating the `minimatch.Minimatch` class. ```javascript var Minimatch = require("minimatch").Minimatch @@ -82,13 +82,6 @@ var mm = new Minimatch(pattern, options) All other methods are internal, and will be called as necessary. -## Functions - -The top-level exported function has a `cache` property, which is an LRU -cache set to store 100 items. So, calling these methods repeatedly -with the same pattern and options will use the same Minimatch object, -saving the cost of parsing it multiple times. - ### minimatch(path, pattern, options) Main export. Tests a path against the pattern using the options. diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js index ec4c05c570c52e..5b5f8cf444de21 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/minimatch.js @@ -9,6 +9,14 @@ try { var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {} var expand = require('brace-expansion') +var plTypes = { + '!': { open: '(?:(?!(?:', close: '))[^/]*?)'}, + '?': { open: '(?:', close: ')?' }, + '+': { open: '(?:', close: ')+' }, + '*': { open: '(?:', close: ')*' }, + '@': { open: '(?:', close: ')' } +} + // any single thing other than / // don't need to escape / when using new RegExp() var qmark = '[^/]' @@ -235,7 +243,7 @@ function braceExpand (pattern, options) { ? this.pattern : pattern if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') + throw new TypeError('undefined pattern') } if (options.nobrace || @@ -261,6 +269,10 @@ function braceExpand (pattern, options) { Minimatch.prototype.parse = parse var SUBPARSE = {} function parse (pattern, isSub) { + if (pattern.length > 1024 * 64) { + throw new TypeError('pattern is too long') + } + var options = this.options // shortcuts @@ -273,7 +285,6 @@ function parse (pattern, isSub) { // ? => one single character var patternListStack = [] var negativeLists = [] - var plType var stateChar var inClass = false var reClassStart = -1 @@ -372,11 +383,12 @@ function parse (pattern, isSub) { continue } - plType = stateChar patternListStack.push({ - type: plType, + type: stateChar, start: i - 1, - reStart: re.length + reStart: re.length, + open: plTypes[stateChar].open, + close: plTypes[stateChar].close }) // negation is (?:(?!js)[^/]*) re += stateChar === '!' ? '(?:(?!(?:' : '(?:' @@ -392,24 +404,14 @@ function parse (pattern, isSub) { clearStateChar() hasMagic = true - re += ')' var pl = patternListStack.pop() - plType = pl.type // negation is (?:(?!js)[^/]*) // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway + re += pl.close + if (pl.type === '!') { + negativeLists.push(pl) } + pl.reEnd = re.length continue case '|': @@ -516,9 +518,10 @@ function parse (pattern, isSub) { // Go through and escape them, taking care not to double-escape any // | chars that were already escaped. for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) + var tail = re.slice(pl.reStart + pl.open.length) + this.debug('setting tail', re, pl) // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { + tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function (_, $1, $2) { if (!$2) { // the | isn't already escaped, so escape it. $2 = '\\' @@ -533,7 +536,7 @@ function parse (pattern, isSub) { return $1 + $1 + $2 + '|' }) - this.debug('tail=%j\n %s', tail, tail) + this.debug('tail=%j\n %s', tail, tail, pl, re) var t = pl.type === '*' ? star : pl.type === '?' ? qmark : '\\' + pl.type @@ -615,7 +618,15 @@ function parse (pattern, isSub) { } var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) + try { + var regExp = new RegExp('^' + re + '$', flags) + } catch (er) { + // If it was an invalid regular expression, then it can't match + // anything. This trick looks for a character after the end of + // the string, which is of course impossible, except in multi-line + // mode, but it's not a /m regex. + return new RegExp('$.') + } regExp._glob = pattern regExp._src = re diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546af2368e1..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md index b0d793ed5d9016..179392978d30fe 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md @@ -1,6 +1,6 @@ # brace-expansion -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), +[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), as known from sh/bash, in JavaScript. [![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js deleted file mode 100644 index 36cde4de5c114b..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,7 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js index abe535df327354..955f27c8177eb6 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js @@ -66,6 +66,16 @@ function expandTop(str) { if (!str) return []; + // I don't know why Bash 4.3 does this, but it does. + // Anything starting with {} will have the first two bytes preserved + // but *only* at the top level, so {},a}b will not expand to anything, + // but a{},b}c will be expanded to [a}c,abc]. + // One could argue that this is a bug in Bash, but since the goal of + // this module is to match Bash's rules, we escape a leading {} + if (str.substr(0, 2) === '{}') { + str = '\\{\\}' + str.substr(2); + } + return expand(escapeBraces(str), true).map(unescapeBraces); } @@ -188,3 +198,4 @@ function expand(str, isTop) { return expansions; } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore index fd4f2b066b339e..ae5d8c36ac6522 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore @@ -1,2 +1,5 @@ -node_modules -.DS_Store +test +.gitignore +.travis.yml +Makefile +example.js diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml deleted file mode 100644 index 6e5919de39a312..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile deleted file mode 100644 index dd2730cfde0cab..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @node_modules/.bin/tape test/*.js - -.PHONY: test diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md index 421f3aa5f951a2..08e918c0db9a62 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md @@ -1,6 +1,6 @@ # balanced-match -Match balanced string pairs, like `{` and `}` or `` and ``. +Match balanced string pairs, like `{` and `}` or `` and ``. Supports regular expressions as well! [![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match) [![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match) @@ -16,6 +16,7 @@ var balanced = require('balanced-match'); console.log(balanced('{', '}', 'pre{in{nested}}post')); console.log(balanced('{', '}', 'pre{first}between{second}post')); +console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post')); ``` The matches are: @@ -28,6 +29,7 @@ $ node example.js pre: 'pre', body: 'first', post: 'between{second}post' } +{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' } ``` ## API @@ -45,7 +47,7 @@ object with those keys: If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`. ### var r = balanced.range(a, b, str) @@ -54,7 +56,7 @@ array with indexes: `[ , ]`. If there's no match, `undefined` will be returned. -If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]`. +If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`. ## Installation diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js deleted file mode 100644 index 9ce76f480a4321..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +++ /dev/null @@ -1,4 +0,0 @@ -var balanced = require('./'); - -console.log(balanced('{', '}', 'pre{in{nested}}post')); -console.log(balanced('{', '}', 'pre{first}between{second}post')); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js index 75f3d71cba90bc..e8d8587020ca6c 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js @@ -1,5 +1,8 @@ module.exports = balanced; function balanced(a, b, str) { + if (a instanceof RegExp) a = maybeMatch(a, str); + if (b instanceof RegExp) b = maybeMatch(b, str); + var r = range(a, b, str); return r && { @@ -11,6 +14,11 @@ function balanced(a, b, str) { }; } +function maybeMatch(reg, str) { + var m = str.match(reg); + return m ? m[0] : null; +} + balanced.range = range; function range(a, b, str) { var begs, beg, left, right, result; @@ -22,7 +30,7 @@ function range(a, b, str) { begs = []; left = str.length; - while (i < str.length && i >= 0 && ! result) { + while (i >= 0 && !result) { if (i == ai) { begs.push(i); ai = str.indexOf(a, i + 1); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json index 24523f3bb16b79..743afb08f4aced 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json @@ -1,43 +1,54 @@ { "_args": [ [ - "balanced-match@^0.3.0", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" - ], - [ - "balanced-match@^0.3.0", + { + "raw": "balanced-match@^0.4.1", + "scope": null, + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion" ] ], - "_from": "balanced-match@>=0.3.0 <0.4.0", - "_id": "balanced-match@0.3.0", + "_from": "balanced-match@>=0.4.1 <0.5.0", + "_id": "balanced-match@0.4.2", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch/brace-expansion/balanced-match", - "_nodeVersion": "4.2.1", + "_location": "/minimatch/brace-expansion/balanced-match", + "_nodeVersion": "4.4.7", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/balanced-match-0.4.2.tgz_1468834991581_0.6590619895141572" + }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "balanced-match", - "raw": "balanced-match@^0.3.0", - "rawSpec": "^0.3.0", + "raw": "balanced-match@^0.4.1", "scope": null, - "spec": ">=0.3.0 <0.4.0", + "escapedName": "balanced-match", + "name": "balanced-match", + "rawSpec": "^0.4.1", + "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob/minimatch/brace-expansion" + "/minimatch/brace-expansion" ], + "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz", + "_shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", "_shrinkwrap": null, - "_spec": "balanced-match@^0.3.0", + "_spec": "balanced-match@^0.4.1", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -46,14 +57,14 @@ "dependencies": {}, "description": "Match balanced character pairs, like \"{\" and \"}\"", "devDependencies": { - "tape": "~4.2.2" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "a91cdd1ebef1a86659e70ff4def01625fc2d6756", - "tarball": "http://registry.npmjs.org/balanced-match/-/balanced-match-0.3.0.tgz" + "shasum": "cb3f3e3c732dc0f01ee70b403f302e61d7709838", + "tarball": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.4.2.tgz" }, - "gitHead": "a7114b0986554787e90b7ac595a043ca75ea77e5", + "gitHead": "57c2ea29d89a2844ae3bdcc637c6e2cbb73725e2", "homepage": "https://github.com/juliangruber/balanced-match", "keywords": [ "match", @@ -66,8 +77,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "balanced-match", @@ -81,6 +92,7 @@ "test": "make test" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -93,8 +105,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "0.3.0" + "version": "0.4.2" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js deleted file mode 100644 index f5e98e3f2a3240..00000000000000 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +++ /dev/null @@ -1,84 +0,0 @@ -var test = require('tape'); -var balanced = require('..'); - -test('balanced', function(t) { - t.deepEqual(balanced('{', '}', 'pre{in{nest}}post'), { - start: 3, - end: 12, - pre: 'pre', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', '{{{{{{{{{in}post'), { - start: 8, - end: 11, - pre: '{{{{{{{{', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body{in}post'), { - start: 8, - end: 11, - pre: 'pre{body', - body: 'in', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre}{in{nest}}post'), { - start: 4, - end: 13, - pre: 'pre}', - body: 'in{nest}', - post: 'post' - }); - t.deepEqual(balanced('{', '}', 'pre{body}between{body2}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'body', - post: 'between{body2}post' - }); - t.notOk(balanced('{', '}', 'nope'), 'should be notOk'); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 3, - end: 19, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('', '', 'preinnestpost'), { - start: 7, - end: 23, - pre: 'pre', - body: 'innest', - post: 'post' - }); - t.deepEqual(balanced('{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 9, - pre: 'pre', - body: '{in}', - post: 'post' - }); - t.deepEqual(balanced('{{{', '}}', 'pre{{{in}}}post'), { - start: 3, - end: 8, - pre: 'pre', - body: 'in', - post: '}post' - }); - t.deepEqual(balanced('{', '}', 'pre{{first}in{second}post'), { - start: 4, - end: 10, - pre: 'pre{', - body: 'first', - post: 'in{second}post' - }); - t.deepEqual(balanced('', 'prepost'), { - start: 3, - end: 4, - pre: 'pre', - body: '', - post: 'post' - }); - t.end(); -}); diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json index 94b5f9c010285d..e1ab2e2c7095db 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json @@ -1,78 +1,85 @@ { "_args": [ [ - "brace-expansion@^1.0.0", - "/Users/rebecca/code/npm/node_modules/glob/node_modules/minimatch" - ], - [ - "brace-expansion@^1.0.0", + { + "raw": "brace-expansion@^1.0.0", + "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch" ] ], "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.3", + "_id": "brace-expansion@1.1.6", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch/brace-expansion", - "_nodeVersion": "5.5.0", + "_location": "/minimatch/brace-expansion", + "_nodeVersion": "4.4.7", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/brace-expansion-1.1.6.tgz_1469047715600_0.9362958471756428" }, "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "brace-expansion", "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", "scope": null, + "escapedName": "brace-expansion", + "name": "brace-expansion", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob/minimatch" + "/minimatch" ], + "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz", + "_shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", "_shrinkwrap": null, "_spec": "brace-expansion@^1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { "url": "https://github.com/juliangruber/brace-expansion/issues" }, "dependencies": { - "balanced-match": "^0.3.0", + "balanced-match": "^0.4.1", "concat-map": "0.0.1" }, "description": "Brace expansion as known from sh/bash", "devDependencies": { - "tape": "4.4.0" + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" + "shasum": "7197d7eaa9b87e648390ea61fc66c84427420df9", + "tarball": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.6.tgz" }, - "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", + "gitHead": "791262fa06625e9c5594cde529a21d82086af5f2", "homepage": "https://github.com/juliangruber/brace-expansion", "keywords": [], "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" } ], "name": "brace-expansion", @@ -87,6 +94,7 @@ "test": "tape test/*.js" }, "testling": { + "files": "test/*.js", "browsers": [ "ie/8..latest", "firefox/20..latest", @@ -99,8 +107,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test/*.js" + ] }, - "version": "1.1.3" + "version": "1.1.6" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json index c2f6fff778e6df..46bf2540ca4cc1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/minimatch/package.json @@ -1,43 +1,55 @@ { "_args": [ [ - "minimatch@2 || 3", - "/Users/rebecca/code/npm/node_modules/glob" - ], - [ - "minimatch@2 || 3", + { + "raw": "minimatch@2 || 3", + "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", + "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob" ] ], "_from": "minimatch@>=2.0.0 <3.0.0||>=3.0.0 <4.0.0", - "_id": "minimatch@3.0.0", + "_id": "minimatch@3.0.3", "_inCache": true, "_installable": true, - "_location": "/read-package-json/glob/minimatch", - "_nodeVersion": "4.0.0", + "_location": "/minimatch", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/minimatch-3.0.3.tgz_1470678322731_0.1892083385027945" + }, "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "minimatch", "raw": "minimatch@2 || 3", - "rawSpec": "2 || 3", "scope": null, + "escapedName": "minimatch", + "name": "minimatch", + "rawSpec": "2 || 3", "spec": ">=2.0.0 <3.0.0||>=3.0.0 <4.0.0", "type": "range" }, "_requiredBy": [ - "/read-package-json/glob" + "#USER", + "/" ], + "_resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz", + "_shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", "_shrinkwrap": null, "_spec": "minimatch@2 || 3", "_where": "/Users/rebecca/code/npm/node_modules/read-package-json/node_modules/glob", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me" }, "bugs": { @@ -49,12 +61,12 @@ "description": "a glob matcher in javascript", "devDependencies": { "standard": "^3.7.2", - "tap": "^1.2.0" + "tap": "^5.6.0" }, "directories": {}, "dist": { - "shasum": "5236157a51e4f004c177fb3c527ff7dd78f0ef83", - "tarball": "http://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz" + "shasum": "2a4e4090b96b2db06a9d7df01055a62a77c9b774", + "tarball": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.3.tgz" }, "engines": { "node": "*" @@ -62,14 +74,14 @@ "files": [ "minimatch.js" ], - "gitHead": "270dbea567f0af6918cb18103e98c612aa717a20", + "gitHead": "eed89491bd4a4e6bc463aac0dfb5c29ef0d1dc13", "homepage": "https://github.com/isaacs/minimatch#readme", "license": "ISC", "main": "minimatch.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "minimatch", @@ -83,5 +95,5 @@ "posttest": "standard minimatch.js test/*.js", "test": "tap test/*.js" }, - "version": "3.0.0" + "version": "3.0.3" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE index c3d2eb3550079b..e637724b3bc595 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/LICENSE @@ -19,3 +19,4 @@ 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/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE index 5c93f456546877..5a8e332545f667 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/LICENSE @@ -11,3 +11,4 @@ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md index 3d61083fb04dd0..85d52a2dcea030 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/README.md @@ -240,3 +240,4 @@ JSON.stringify will split this into 15 lines, and it's hard to read. Yet again, this feature comes with a performance hit, so if user experience matters to you more than performance, use this module. If your JSON will be consumed by machines, use JSON.stringify instead. As a rule of thumb, if you use "space" argument to indent your JSON, you'd better use this module instead. + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js index 39303b0969081c..9b0f9af01cd9e8 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/analyze.js @@ -89,3 +89,4 @@ module.exports.analyze = function analyzeJSON(input, options) { return result } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js index af1a01a03d062b..cfab8691fc9aba 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/document.js @@ -482,3 +482,4 @@ module.exports.Document = Document module.exports.update = function updateJSON(source, new_value, options) { return Document(source, options).update(new_value).toString() } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js index 025007f63b7060..0c9fbe68809cd0 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/parse.js @@ -762,3 +762,4 @@ module.exports.tokenize = function tokenizeJSON(input, options) { tokens.data = module.exports.parse(input, options) return tokens } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js index e76af2efe8e06a..232229ecc8af20 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/stringify.js @@ -380,3 +380,4 @@ module.exports.stringify = function stringifyJSON(object, options, _space) { return _stringify(object, options, 0, '') } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js index dd4752c73a4078..a8476b6c4630e1 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/lib/utils.js @@ -43,3 +43,4 @@ module.exports.middleware = function() { throw Error('this function is removed, use express-json5 instead') } } + diff --git a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml index 828163ddc4524c..fdbb5372d4bcde 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml +++ b/deps/npm/node_modules/read-package-json/node_modules/json-parse-helpfulerror/node_modules/jju/package.yaml @@ -43,3 +43,4 @@ publishConfig: license: type: WTFPL url: http://www.wtfpl.net/txt/copying/ + diff --git a/deps/npm/node_modules/readable-stream/.travis.yml b/deps/npm/node_modules/readable-stream/.travis.yml index ae0156a9bbb156..84504c98f55d05 100644 --- a/deps/npm/node_modules/readable-stream/.travis.yml +++ b/deps/npm/node_modules/readable-stream/.travis.yml @@ -7,9 +7,6 @@ notifications: email: false matrix: fast_finish: true - allow_failures: - - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" include: - node_js: '0.8' env: TASK=test @@ -29,6 +26,8 @@ matrix: env: TASK=test - node_js: 5 env: TASK=test + - node_js: 6 + env: TASK=test - node_js: 5 env: TASK=browser BROWSER_NAME=android BROWSER_VERSION="4.0..latest" - node_js: 5 @@ -39,10 +38,6 @@ matrix: env: TASK=browser BROWSER_NAME=chrome BROWSER_VERSION="-3..latest" - node_js: 5 env: TASK=browser BROWSER_NAME=firefox BROWSER_VERSION="-3..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=ipad BROWSER_VERSION="6.0..latest" - - node_js: 5 - env: TASK=browser BROWSER_NAME=iphone BROWSER_VERSION="6.0..latest" - node_js: 5 env: TASK=browser BROWSER_NAME=safari BROWSER_VERSION="5..latest" - node_js: 5 diff --git a/deps/npm/node_modules/readable-stream/README.md b/deps/npm/node_modules/readable-stream/README.md index ae9e3363c8e8a3..9fb4feaaa12419 100644 --- a/deps/npm/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/readable-stream/README.md @@ -1,6 +1,6 @@ # readable-stream -***Node-core v6.1.0 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) +***Node-core v6.3.1 streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream) [![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/) @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.md). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/readable-stream/doc/stream.md b/deps/npm/node_modules/readable-stream/doc/stream.md index c907ca0e7b726a..fc269c8e38f829 100644 --- a/deps/npm/node_modules/readable-stream/doc/stream.md +++ b/deps/npm/node_modules/readable-stream/doc/stream.md @@ -2,61 +2,123 @@ Stability: 2 - Stable -A stream is an abstract interface implemented by various objects in -Node.js. For example a [request to an HTTP server][http-incoming-message] is a -stream, as is [`process.stdout`][]. Streams are readable, writable, or both. All -streams are instances of [`EventEmitter`][]. +A stream is an abstract interface for working with streaming data in Node.js. +The `stream` module provides a base API that makes it easy to build objects +that implement the stream interface. -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for [Readable][] streams, [Writable][] -streams, [Duplex][] streams, and [Transform][] streams. +There are many stream objects provided by Node.js. For instance, a +[request to an HTTP server][http-incoming-message] and [`process.stdout`][] +are both stream instances. -This document is split up into 3 sections: +Streams can be readable, writable, or both. All streams are instances of +[`EventEmitter`][]. -1. The first section explains the parts of the API that you need to be - aware of to use streams in your programs. -2. The second section explains the parts of the API that you need to - use if you implement your own custom streams yourself. The API is designed to - make this easy for you to do. -3. The third section goes into more depth about how streams work, - including some of the internal mechanisms and functions that you - should probably not modify unless you definitely know what you are - doing. +The `stream` module can be accessed using: +```js +const stream = require('stream'); +``` -## API for Stream Consumers +While it is important for all Node.js users to understand how streams works, +the `stream` module itself is most useful for developer's that are creating new +types of stream instances. Developer's who are primarily *consuming* stream +objects will rarely (if ever) have need to use the `stream` module directly. + +## Organization of this document + +This document is divided into two primary sections and third section for +additional notes. The first section explains the elements of the stream API that +are required to *use* streams within an application. The second section explains +the elements of the API that are required to *implement* new types of streams. + +## Types of Streams + +There are four fundamental stream types within Node.js: + +* [Readable][] - streams from which data can be read (for example + [`fs.createReadStream()`][]). +* [Writable][] - streams to which data can be written (for example + [`fs.createWriteStream()`][]). +* [Duplex][] - streams that are both Readable and Writable (for example + [`net.Socket`][]). +* [Transform][] - Duplex streams that can modify or transform the data as it + is written and read (for example [`zlib.createDeflate()`][]). + +### Object Mode + +All streams created by Node.js APIs operate exclusively on strings and `Buffer` +objects. It is possible, however, for stream implementations to work with other +types of JavaScript values (with the exception of `null` which serves a special +purpose within streams). Such streams are considered to operate in "object +mode". + +Stream instances are switched into object mode using the `objectMode` option +when the stream is created. Attempting to switch an existing stream into +object mode is not safe. + +### Buffering -Streams can be either [Readable][], [Writable][], or both ([Duplex][]). +Both [Writable][] and [Readable][] streams will store data in an internal +buffer that can be retrieved using `writable._writableState.getBuffer()` or +`readable._readableState.buffer`, respectively. + +The amount of data potentially buffered depends on the `highWaterMark` option +passed into the streams constructor. For normal streams, the `highWaterMark` +option specifies a total number of bytes. For streams operating in object mode, +the `highWaterMark` specifies a total number of objects. + +Data is buffered in Readable streams when the implementation calls +[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not +call [`stream.read()`][stream-read], the data will sit in the internal +queue until it is consumed. -All streams are EventEmitters, but they also have other custom methods -and properties depending on whether they are Readable, Writable, or -Duplex. +Once the total size of the internal read buffer reaches the threshold specified +by `highWaterMark`, the stream will temporarily stop reading data from the +underlying resource until the data currently buffered can be consumed (that is, +the stream will stop calling the internal `readable._read()` method that is +used to fill the read buffer). + +Data is buffered in Writable streams when the +[`writable.write(chunk)`][stream-write] method is called repeatedly. While the +total size of the internal write buffer is below the threshold set by +`highWaterMark`, calls to `writable.write()` will return `true`. Once the +the size of the internal buffer reaches or exceeds the `highWaterMark`, `false` +will be returned. + +A key goal of the `stream` API, and in particular the [`stream.pipe()`] method, +is to limit the buffering of data to acceptable levels such that sources and +destinations of differing speeds will not overwhelm the available memory. + +Because [Duplex][] and [Transform][] streams are both Readable and Writable, +each maintain *two* separate internal buffers used for reading and writing, +allowing each side to operate independently of the other while maintaining an +appropriate and efficient flow of data. For example, [`net.Socket`][] instances +are [Duplex][] streams whose Readable side allows consumption of data received +*from* the socket and whose Writable side allows writing data *to* the socket. +Because data may be written to the socket at a faster or slower rate than data +is received, it is important each side operate (and buffer) independently of +the other. -If a stream is both Readable and Writable, then it implements all of -the methods and events. So, a [Duplex][] or [Transform][] stream is -fully described by this API, though their implementation may be -somewhat different. +## API for Stream Consumers -It is not necessary to implement Stream interfaces in order to consume -streams in your programs. If you **are** implementing streaming -interfaces in your own program, please also refer to -[API for Stream Implementors][]. + -Almost all Node.js programs, no matter how simple, use Streams in some -way. Here is an example of using Streams in an Node.js program: +Almost all Node.js applications, no matter how simple, use streams in some +manner. The following is an example of using streams in a Node.js application +that implements an HTTP server: ```js const http = require('http'); -var server = http.createServer( (req, res) => { +const server = http.createServer( (req, res) => { // req is an http.IncomingMessage, which is a Readable Stream // res is an http.ServerResponse, which is a Writable Stream - var body = ''; - // we want to get the data as utf8 strings - // If you don't set an encoding, then you'll get Buffer objects + let body = ''; + // Get the data as utf8 strings. + // If an encoding is not set, Buffer objects will be received. req.setEncoding('utf8'); // Readable streams emit 'data' events once a listener is added @@ -64,10 +126,10 @@ var server = http.createServer( (req, res) => { body += chunk; }); - // the end event tells you that you have entire body + // the end event indicates that the entire body has been received req.on('end', () => { try { - var data = JSON.parse(body); + const data = JSON.parse(body); } catch (er) { // uh oh! bad json! res.statusCode = 400; @@ -90,60 +152,308 @@ server.listen(1337); // error: Unexpected token o ``` -### Class: stream.Duplex +[Writable][] streams (such as `res` in the example) expose methods such as +`write()` and `end()` that are used to write data onto the stream. -Duplex streams are streams that implement both the [Readable][] and -[Writable][] interfaces. +[Readable][] streams use the [`EventEmitter`][] API for notifying application +code when data is available to be read off the stream. That available data can +be read from the stream in multiple ways. -Examples of Duplex streams include: +Both [Writable][] and [Readable][] streams use the [`EventEmitter`][] API in +various ways to communicate the current state of the stream. -* [TCP sockets][] +[Duplex][] and [Transform][] streams are both [Writable][] and [Readable][]. + +Applications that are either writing data to or consuming data from a stream +are not required to implement the stream interfaces directly and will generally +have no reason to call `require('stream')`. + +Developers wishing to implement new types of streams should refer to the +section [API for Stream Implementers][]. + +### Writable Streams + +Writable streams are an abstraction for a *destination* to which data is +written. + +Examples of [Writable][] streams include: + +* [HTTP requests, on the client][] +* [HTTP responses, on the server][] +* [fs write streams][] * [zlib streams][zlib] * [crypto streams][crypto] +* [TCP sockets][] +* [child process stdin][] +* [`process.stdout`][], [`process.stderr`][] + +*Note*: Some of these examples are actually [Duplex][] streams that implement +the [Writable][] interface. + +All [Writable][] streams implement the interface defined by the +`stream.Writable` class. + +While specific instances of [Writable][] streams may differ in various ways, +all Writable streams follow the same fundamental usage pattern as illustrated +in the example below: + +```js +const myStream = getWritableStreamSomehow(); +myStream.write('some data'); +myStream.write('some more data'); +myStream.end('done writing data'); +``` -### Class: stream.Readable +#### Class: stream.Writable + -The Readable stream interface is the abstraction for a *source* of -data that you are reading from. In other words, data comes *out* of a -Readable stream. +##### Event: 'close' + -A Readable stream will not start emitting data until you indicate that -you are ready to receive it. +The `'close'` event is emitted when the stream and any of its underlying +resources (a file descriptor, for example) have been closed. The event indicates +that no more events will be emitted, and no further computation will occur. -Readable streams have two "modes": a **flowing mode** and a **paused -mode**. When in flowing mode, data is read from the underlying system -and provided to your program as fast as possible. In paused mode, you -must explicitly call [`stream.read()`][stream-read] to get chunks of data out. -Streams start out in paused mode. +Not all Writable streams will emit the `'close'` event. -**Note**: If no data event handlers are attached, and there are no -[`stream.pipe()`][] destinations, and the stream is switched into flowing -mode, then data will be lost. +##### Event: 'drain' + -You can switch to flowing mode by doing any of the following: +If a call to [`stream.write(chunk)`][stream-write] returns `false`, the +`'drain'` event will be emitted when it is appropriate to resume writing data +to the stream. -* Adding a [`'data'`][] event handler to listen for data. -* Calling the [`stream.resume()`][stream-resume] method to explicitly open the - flow. -* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. +```js +// Write the data to the supplied writable stream one million times. +// Be attentive to back-pressure. +function writeOneMillionTimes(writer, data, encoding, callback) { + let i = 1000000; + write(); + function write() { + var ok = true; + do { + i--; + if (i === 0) { + // last time! + writer.write(data, encoding, callback); + } else { + // see if we should continue, or wait + // don't pass the callback, because we're not done yet. + ok = writer.write(data, encoding); + } + } while (i > 0 && ok); + if (i > 0) { + // had to stop early! + // write some more once it drains + writer.once('drain', write); + } + } +} +``` -You can switch back to paused mode by doing either of the following: +##### Event: 'error' + -* If there are no pipe destinations, by calling the - [`stream.pause()`][stream-pause] method. -* If there are pipe destinations, by removing any [`'data'`][] event - handlers, and removing all pipe destinations by calling the - [`stream.unpipe()`][] method. +* {Error} + +The `'error'` event is emitted if an error occurred while writing or piping +data. The listener callback is passed a single `Error` argument when called. + +*Note*: The stream is not closed when the `'error'` event is emitted. + +##### Event: 'finish' + + +The `'finish'` event is emitted after the [`stream.end()`][stream-end] method +has been called, and all data has been flushed to the underlying system. + +```js +const writer = getWritableStreamSomehow(); +for (var i = 0; i < 100; i ++) { + writer.write('hello, #${i}!\n'); +} +writer.end('This is the end\n'); +writer.on('finish', () => { + console.error('All writes are now complete.'); +}); +``` + +##### Event: 'pipe' + + +* `src` {stream.Readable} source stream that is piping to this writable + +The `'pipe'` event is emitted when the [`stream.pipe()`][] method is called on +a readable stream, adding this writable to its set of destinations. + +```js +const writer = getWritableStreamSomehow(); +const reader = getReadableStreamSomehow(); +writer.on('pipe', (src) => { + console.error('something is piping into the writer'); + assert.equal(src, reader); +}); +reader.pipe(writer); +``` + +##### Event: 'unpipe' + + +* `src` {[Readable][] Stream} The source stream that + [unpiped][`stream.unpipe()`] this writable + +The `'unpipe'` event is emitted when the [`stream.unpipe()`][] method is called +on a [Readable][] stream, removing this [Writable][] from its set of +destinations. + +```js +const writer = getWritableStreamSomehow(); +const reader = getReadableStreamSomehow(); +writer.on('unpipe', (src) => { + console.error('Something has stopped piping into the writer.'); + assert.equal(src, reader); +}); +reader.pipe(writer); +reader.unpipe(writer); +``` + +##### writable.cork() + + +The `writable.cork()` method forces all written data to be buffered in memory. +The buffered data will be flushed when either the [`stream.uncork()`][] or +[`stream.end()`][stream-end] methods are called. + +The primary intent of `writable.cork()` is to avoid a situation where writing +many small chunks of data to a stream do not cause an backup in the internal +buffer that would have an adverse impact on performance. In such situations, +implementations that implement the `writable._writev()` method can perform +buffered writes in a more optimized manner. + +##### writable.end([chunk][, encoding][, callback]) + + +* `chunk` {String|Buffer|any} Optional data to write. For streams not operating + in object mode, `chunk` must be a string or a `Buffer`. For object mode + streams, `chunk` may be any JavaScript value other than `null`. +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Optional callback for when the stream is finished + +Calling the `writable.end()` method signals that no more data will be written +to the [Writable][]. The optional `chunk` and `encoding` arguments allow one +final additional chunk of data to be written immediately before closing the +stream. If provided, the optional `callback` function is attached as a listener +for the [`'finish'`][] event. + +Calling the [`stream.write()`][stream-write] method after calling +[`stream.end()`][stream-end] will raise an error. + +```js +// write 'hello, ' and then end with 'world!' +const file = fs.createWriteStream('example.txt'); +file.write('hello, '); +file.end('world!'); +// writing more now is not allowed! +``` + +##### writable.setDefaultEncoding(encoding) + + +* `encoding` {String} The new default encoding +* Return: `this` + +The `writable.setDefaultEncoding()` method sets the default `encoding` for a +[Writable][] stream. + +##### writable.uncork() + + +The `writable.uncork()` method flushes all data buffered since +[`stream.cork()`][] was called. + +When using `writable.cork()` and `writable.uncork()` to manage the buffering +of writes to a stream, it is recommended that calls to `writable.uncork()` be +deferred using `process.nextTick()`. Doing so allows batching of all +`writable.write()` calls that occur within a given Node.js event loop phase. + +```js +stream.cork(); +stream.write('some '); +stream.write('data '); +process.nextTick(() => stream.uncork()); +``` + +If the `writable.cork()` method is called multiple times on a stream, the same +number of calls to `writable.uncork()` must be called to flush the buffered +data. + +``` +stream.cork(); +stream.write('some '); +stream.cork(); +stream.write('data '); +process.nextTick(() => { + stream.uncork(); + // The data will not be flushed until uncork() is called a second time. + stream.uncork(); +}); +``` + +##### writable.write(chunk[, encoding][, callback]) + + +* `chunk` {String|Buffer} The data to write +* `encoding` {String} The encoding, if `chunk` is a String +* `callback` {Function} Callback for when this chunk of data is flushed +* Returns: {Boolean} `false` if the stream wishes for the calling code to + wait for the `'drain'` event to be emitted before continuing to write + additional data; otherwise `true`. + +The `writable.write()` method writes some data to the stream, and calls the +supplied `callback` once the data has been fully handled. If an error +occurs, the `callback` *may or may not* be called with the error as its +first argument. To reliably detect write errors, add a listener for the +`'error'` event. + +The return value indicates whether the written `chunk` was buffered internally +and the buffer has exceeded the `highWaterMark` configured when the stream was +created. If `false` is returned, further attempts to write data to the stream +should be paused until the `'drain'` event is emitted. -Note that, for backwards compatibility reasons, removing [`'data'`][] -event handlers will **not** automatically pause the stream. Also, if -there are piped destinations, then calling [`stream.pause()`][stream-pause] will -not guarantee that the stream will *remain* paused once those -destinations drain and ask for more data. +A Writable stream in object mode will always ignore the `encoding` argument. -Examples of readable streams include: +### Readable Streams + +Readable streams are an abstraction for a *source* from which data is +consumed. + +Examples of Readable streams include: * [HTTP responses, on the client][http-incoming-message] * [HTTP requests, on the server][http-incoming-message] @@ -154,89 +464,208 @@ Examples of readable streams include: * [child process stdout and stderr][] * [`process.stdin`][] -#### Event: 'close' +All [Readable][] streams implement the interface defined by the +`stream.Readable` class. + +#### Two Modes + +Readable streams effectively operate in one of two modes: flowing and paused. + +When in flowing mode, data is read from the underlying system automatically +and provided to an application as quickly as possible using events via the +[`EventEmitter`][] interface. + +In paused mode, the [`stream.read()`][stream-read] method must be called +explicitly to read chunks of data from the stream. + +All [Readable][] streams begin in paused mode but can be switched to flowing +mode in one of the following ways: + +* Adding a [`'data'`][] event handler. +* Calling the [`stream.resume()`][stream-resume] method. +* Calling the [`stream.pipe()`][] method to send the data to a [Writable][]. + +The Readable can switch back to paused mode using one of the following: + +* If there are no pipe destinations, by calling the + [`stream.pause()`][stream-pause] method. +* If there are pipe destinations, by removing any [`'data'`][] event + handlers, and removing all pipe destinations by calling the + [`stream.unpipe()`][] method. + +The important concept to remember is that a Readable will not generate data +until a mechanism for either consuming or ignoring that data is provided. If +the consuming mechanism is disabled or taken away, the Readable will *attempt* +to stop generating the data. + +*Note*: For backwards compatibility reasons, removing [`'data'`][] event +handlers will **not** automatically pause the stream. Also, if there are piped +destinations, then calling [`stream.pause()`][stream-pause] will not guarantee +that the stream will *remain* paused once those destinations drain and ask for +more data. + +*Note*: If a [Readable][] is switched into flowing mode and there are no +consumers available handle the data, that data will be lost. This can occur, +for instance, when the `readable.resume()` method is called without a listener +attached to the `'data'` event, or when a `'data'` event handler is removed +from the stream. + +#### Three States + +The "two modes" of operation for a Readable stream are a simplified abstraction +for the more complicated internal state management that is happening within the +Readable stream implementation. + +Specifically, at any given point in time, every Readable is in one of three +possible states: + +* `readable._readableState.flowing = null` +* `readable._readableState.flowing = false` +* `readable._readableState.flowing = true` + +When `readable._readableState.flowing` is `null`, no mechanism for consuming the +streams data is provided so the stream will not generate its data. + +Attaching a listener for the `'data'` event, calling the `readable.pipe()` +method, or calling the `readable.resume()` method will switch +`readable._readableState.flowing` to `true`, causing the Readable to begin +actively emitting events as data is generated. + +Calling `readable.pause()`, `readable.unpipe()`, or receiving "back pressure" +will cause the `readable._readableState.flowing` to be set as `false`, +temporarily halting the flowing of events but *not* halting the generation of +data. + +While `readable._readableState.flowing` is `false`, data may be accumulating +within the streams internal buffer. + +#### Choose One -Emitted when the stream and any of its underlying resources (a file -descriptor, for example) have been closed. The event indicates that -no more events will be emitted, and no further computation will occur. +The Readable stream API evolved across multiple Node.js versions and provides +multiple methods of consuming stream data. In general, developers should choose +*one* of the methods of consuming data and *should never* use multiple methods +to consume data from a single stream. -Not all streams will emit the `'close'` event as the `'close'` event is -optional. +Use of the `readable.pipe()` method is recommended for most users as it has been +implemented to provide the easiest way of consuming stream data. Developers that +require more fine-grained control over the transfer and generation of data can +use the [`EventEmitter`][] and `readable.pause()`/`readable.resume()` APIs. -#### Event: 'data' +#### Class: stream.Readable + -* `chunk` {Buffer|String} The chunk of data. + + +##### Event: 'close' + + +The `'close'` event is emitted when the stream and any of its underlying +resources (a file descriptor, for example) have been closed. The event indicates +that no more events will be emitted, and no further computation will occur. + +Not all [Readable][] streams will emit the `'close'` event. -Attaching a `'data'` event listener to a stream that has not been -explicitly paused will switch the stream into flowing mode. Data will -then be passed as soon as it is available. +##### Event: 'data' + -If you just want to get all the data out of the stream as fast as -possible, this is the best way to do so. +* `chunk` {Buffer|String|any} The chunk of data. For streams that are not + operating in object mode, the chunk will be either a string or `Buffer`. + For streams that are in object mode, the chunk can be any JavaScript value + other than `null`. + +The `'data'` event is emitted whenever the stream is relinquishing ownership of +a chunk of data to a consumer. This may occur whenever the stream is switched +in flowing mode by calling `readable.pipe()`, `readable.resume()`, or by +attaching a listener callback to the `'data'` event. The `'data'` event will +also be emitted whenever the `readable.read()` method is called and a chunk of +data is available to be returned. + +Attaching a `'data'` event listener to a stream that has not been explicitly +paused will switch the stream into flowing mode. Data will then be passed as +soon as it is available. + +The listener callback will be passed the chunk of data as a string if a default +encoding has been specified for the stream using the +`readable.setEncoding()` method; otherwise the data will be passed as a +`Buffer`. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); }); ``` -#### Event: 'end' +##### Event: 'end' + -This event fires when there will be no more data to read. +The `'end'` event is emitted when there is no more data to be consumed from +the stream. -Note that the `'end'` event **will not fire** unless the data is -completely consumed. This can be done by switching into flowing mode, -or by calling [`stream.read()`][stream-read] repeatedly until you get to the -end. +*Note*: The `'end'` event **will not be emitted** unless the data is +completely consumed. This can be accomplished by switching the stream into +flowing mode, or by calling [`stream.read()`][stream-read] repeatedly until +all data has been consumed. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); }); readable.on('end', () => { - console.log('there will be no more data.'); + console.log('There will be no more data.'); }); ``` -#### Event: 'error' +##### Event: 'error' + * {Error} -Emitted if there was an error receiving data. +The `'error'` event may be emitted by a Readable implementation at any time. +Typically, this may occur if the underlying stream in unable to generate data +due to an underlying internal failure, or when a stream implementation attempts +to push an invalid chunk of data. -#### Event: 'readable' +The listener callback will be passed a single `Error` object. -When a chunk of data can be read from the stream, it will emit a -`'readable'` event. +##### Event: 'readable' + -In some cases, listening for a `'readable'` event will cause some data -to be read into the internal buffer from the underlying system, if it -hadn't already. +The `'readable'` event is emitted when there is data available to be read from +the stream. In some cases, attaching a listener for the `'readable'` event will +cause some amount of data to be read into an internal buffer. ```javascript -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('readable', () => { // there is some data to read now }); ``` +The `'readable'` event will also be emitted once the end of the stream data +has been reached but before the `'end'` event is emitted. -Once the internal buffer is drained, a `'readable'` event will fire -again when more data is available. - -The `'readable'` event is not emitted in the "flowing" mode with the -sole exception of the last one, on end-of-stream. - -The `'readable'` event indicates that the stream has new information: -either new data is available or the end of the stream has been reached. -In the former case, [`stream.read()`][stream-read] will return that data. In the -latter case, [`stream.read()`][stream-read] will return null. For instance, in -the following example, `foo.txt` is an empty file: +Effectively, the `'readable'` event indicates that the stream has new +information: either new data is available or the end of the stream has been +reached. In the former case, [`stream.read()`][stream-read] will return the +available data. In the latter case, [`stream.read()`][stream-read] will return +`null`. For instance, in the following example, `foo.txt` is an empty file: ```js const fs = require('fs'); -var rr = fs.createReadStream('foo.txt'); +const rr = fs.createReadStream('foo.txt'); rr.on('readable', () => { console.log('readable:', rr.read()); }); @@ -253,16 +682,23 @@ readable: null end ``` -#### readable.isPaused() +*Note*: In general, the `readable.pipe()` and `'data'` event mechanisms are +preferred over the use of the `'readable'` event. + +##### readable.isPaused() + * Return: {Boolean} -This method returns whether or not the `readable` has been **explicitly** -paused by client code (using [`stream.pause()`][stream-pause] without a -corresponding [`stream.resume()`][stream-resume]). +The `readable.isPaused()` method returns the current operating state of the +Readable. This is used primarily by the mechanism that underlies the +`readable.pipe()` method. In most typical cases, there will be no reason to +use this method directly. ```js -var readable = new stream.Readable +const readable = new stream.Readable readable.isPaused() // === false readable.pause() @@ -271,68 +707,71 @@ readable.resume() readable.isPaused() // === false ``` -#### readable.pause() +##### readable.pause() + * Return: `this` -This method will cause a stream in flowing mode to stop emitting -[`'data'`][] events, switching out of flowing mode. Any data that becomes -available will remain in the internal buffer. +The `readable.pause()` method will cause a stream in flowing mode to stop +emitting [`'data'`][] events, switching out of flowing mode. Any data that +becomes available will remain in the internal buffer. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('data', (chunk) => { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); readable.pause(); - console.log('there will be no more data for 1 second'); + console.log('There will be no additional data for 1 second.'); setTimeout(() => { - console.log('now data will start flowing again'); + console.log('Now data will start flowing again.'); readable.resume(); }, 1000); }); ``` -#### readable.pipe(destination[, options]) +##### readable.pipe(destination[, options]) + * `destination` {stream.Writable} The destination for writing data * `options` {Object} Pipe options - * `end` {Boolean} End the writer when the reader ends. Default = `true` + * `end` {Boolean} End the writer when the reader ends. Defaults to `true`. -This method pulls all the data out of a readable stream, and writes it -to the supplied destination, automatically managing the flow so that -the destination is not overwhelmed by a fast readable stream. +The `readable.pipe()` method attaches a [Writable][] stream to the `readable`, +causing it to switch automatically into flowing mode and push all of its data +to the attached [Writable][]. The flow of data will be automatically managed so +that the destination Writable stream is not overwhelmed by a faster Readable +stream. -Multiple destinations can be piped to safely. +The following example pipes all of the data from the `readable` into a file +named `file.txt`: ```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); +const readable = getReadableStreamSomehow(); +const writable = fs.createWriteStream('file.txt'); // All the data from readable goes into 'file.txt' readable.pipe(writable); ``` +It is possible to attach multiple Writable streams to a single Readable stream. -This function returns the destination stream, so you can set up pipe -chains like so: +The `readable.pipe()` method returns a reference to the *destination* stream +making it possible to set up chains of piped streams: ```js -var r = fs.createReadStream('file.txt'); -var z = zlib.createGzip(); -var w = fs.createWriteStream('file.txt.gz'); +const r = fs.createReadStream('file.txt'); +const z = zlib.createGzip(); +const w = fs.createWriteStream('file.txt.gz'); r.pipe(z).pipe(w); ``` -For example, emulating the Unix `cat` command: - -```js -process.stdin.pipe(process.stdout); -``` - -By default [`stream.end()`][stream-end] is called on the destination when the -source stream emits [`'end'`][], so that `destination` is no longer writable. -Pass `{ end: false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. +By default, [`stream.end()`][stream-end] is called on the destination Writable +stream when the source Readable stream emits [`'end'`][], so that the +destination is no longer writable. To disable this default behavior, the `end` +option can be passed as `false`, causing the destination stream to remain open, +as illustrated in the following example: ```js reader.pipe(writer, { end: false }); @@ -341,88 +780,115 @@ reader.on('end', () => { }); ``` -Note that [`process.stderr`][] and [`process.stdout`][] are never closed until -the process exits, regardless of the specified options. +One important caveat is that if the Readable stream emits an error during +processing, the Writable destination *is not closed* automatically. If an +error occurs, it will be necessary to *manually* close each stream in order +to prevent memory leaks. + +*Note*: The [`process.stderr`][] and [`process.stdout`][] Writable streams are +never closed until the Node.js process exits, regardless of the specified +options. -#### readable.read([size]) +##### readable.read([size]) + * `size` {Number} Optional argument to specify how much data to read. * Return {String|Buffer|Null} -The `read()` method pulls some data out of the internal buffer and -returns it. If there is no data available, then it will return -`null`. +The `readable.read()` method pulls some data out of the internal buffer and +returns it. If no data available to be read, `null` is returned. By default, +the data will be returned as a `Buffer` object unless an encoding has been +specified using the `readable.setEncoding()` method or the stream is operating +in object mode. -If you pass in a `size` argument, then it will return that many -bytes. If `size` bytes are not available, then it will return `null`, -unless we've ended, in which case it will return the data remaining -in the buffer. +The optional `size` argument specifies a specific number of bytes to read. If +`size` bytes are not available to be read, `null` will be returned *unless* +the stream has ended, in which case all of the data remaining in the internal +buffer will be returned (*even if it exceeds `size` bytes*). -If you do not specify a `size` argument, then it will return all the -data in the internal buffer. +If the `size` argument is not specified, all of the data contained in the +internal buffer will be returned. -This method should only be called in paused mode. In flowing mode, -this method is called automatically until the internal buffer is -drained. +The `readable.read()` method should only be called on Readable streams operating +in paused mode. In flowing mode, `readable.read()` is called automatically until +the internal buffer is fully drained. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.on('readable', () => { var chunk; while (null !== (chunk = readable.read())) { - console.log('got %d bytes of data', chunk.length); + console.log(`Received ${chunk.length} bytes of data.`); } }); ``` -If this method returns a data chunk, then it will also trigger the -emission of a [`'data'`][] event. +In general, it is recommended that developers avoid the use of the `'readable'` +event and the `readable.read()` method in favor of using either +`readable.pipe()` or the `'data'` event. -Note that calling [`stream.read([size])`][stream-read] after the [`'end'`][] -event has been triggered will return `null`. No runtime error will be raised. +A Readable stream in object mode will always return a single item from +a call to [`readable.read(size)`][stream-read], regardless of the value of the +`size` argument. + +*Note:* If the `readable.read()` method returns a chunk of data, a `'data'` +event will also be emitted. -#### readable.resume() +*Note*: Calling [`stream.read([size])`][stream-read] after the [`'end'`][] +event has been emitted will return `null`. No runtime error will be raised. + +##### readable.resume() + * Return: `this` -This method will cause the readable stream to resume emitting [`'data'`][] -events. +The `readable.resume()` method causes an explicitly paused Readable stream to +resume emitting [`'data'`][] events, switching the stream into flowing mode. -This method will switch the stream into flowing mode. If you do *not* -want to consume the data from a stream, but you *do* want to get to -its [`'end'`][] event, you can call [`stream.resume()`][stream-resume] to open -the flow of data. +The `readable.resume()` method can be used to fully consume the data from a +stream without actually processing any of that data as illustrated in the +following example: ```js -var readable = getReadableStreamSomehow(); -readable.resume(); -readable.on('end', () => { - console.log('got to the end, but did not read anything'); -}); +getReadableStreamSomehow() + .resume() + .on('end', () => { + console.log('Reached the end, but did not read anything.'); + }); ``` -#### readable.setEncoding(encoding) +##### readable.setEncoding(encoding) + * `encoding` {String} The encoding to use. * Return: `this` -Call this function to cause the stream to return strings of the specified -encoding instead of Buffer objects. For example, if you do -`readable.setEncoding('utf8')`, then the output data will be interpreted as -UTF-8 data, and returned as strings. If you do `readable.setEncoding('hex')`, -then the data will be encoded in hexadecimal string format. +The `readable.setEncoding()` method sets the default character encoding for +data read from the Readable stream. -This properly handles multi-byte characters that would otherwise be -potentially mangled if you simply pulled the Buffers directly and -called [`buf.toString(encoding)`][] on them. If you want to read the data -as strings, always use this method. +Setting an encoding causes the stream data +to be returned as string of the specified encoding rather than as `Buffer` +objects. For instance, calling `readable.setEncoding('utf8')` will cause the +output data will be interpreted as UTF-8 data, and passed as strings. Calling +`readable.setEncoding('hex')` will cause the data to be encoded in hexadecimal +string format. -Also you can disable any encoding at all with `readable.setEncoding(null)`. -This approach is very useful if you deal with binary data or with large -multi-byte strings spread out over multiple chunks. +The Readable stream will properly handle multi-byte characters delivered through +the stream that would otherwise become improperly decoded if simply pulled from +the stream as `Buffer` objects. + +Encoding can be disabled by calling `readable.setEncoding(null)`. This approach +is useful when working with binary data or with large multi-byte strings spread +out over multiple chunks. ```js -var readable = getReadableStreamSomehow(); +const readable = getReadableStreamSomehow(); readable.setEncoding('utf8'); readable.on('data', (chunk) => { assert.equal(typeof chunk, 'string'); @@ -430,47 +896,53 @@ readable.on('data', (chunk) => { }); ``` -#### readable.unpipe([destination]) +##### readable.unpipe([destination]) + * `destination` {stream.Writable} Optional specific stream to unpipe -This method will remove the hooks set up for a previous [`stream.pipe()`][] -call. +The `readable.unpipe()` method detaches a Writable stream previously attached +using the [`stream.pipe()`][] method. -If the destination is not specified, then all pipes are removed. +If the `destination` is not specified, then *all* pipes are detached. -If the destination is specified, but no pipe is set up for it, then -this is a no-op. +If the `destination` is specified, but no pipe is set up for it, then +the method does nothing. ```js -var readable = getReadableStreamSomehow(); -var writable = fs.createWriteStream('file.txt'); +const readable = getReadableStreamSomehow(); +const writable = fs.createWriteStream('file.txt'); // All the data from readable goes into 'file.txt', // but only for the first second readable.pipe(writable); setTimeout(() => { - console.log('stop writing to file.txt'); + console.log('Stop writing to file.txt'); readable.unpipe(writable); - console.log('manually close the file stream'); + console.log('Manually close the file stream'); writable.end(); }, 1000); ``` -#### readable.unshift(chunk) +##### readable.unshift(chunk) + * `chunk` {Buffer|String} Chunk of data to unshift onto the read queue -This is useful in certain cases where a stream is being consumed by a -parser, which needs to "un-consume" some data that it has -optimistically pulled out of the source, so that the stream can be -passed on to some other party. +The `readable.unshift()` method pushes a chunk of data back into the internal +buffer. This is useful in certain situations where a stream is being consumed by +code that needs to "un-consume" some amount of data that it has optimistically +pulled out of the source, so that the data can be passed on to some other party. -Note that `stream.unshift(chunk)` cannot be called after the [`'end'`][] event -has been triggered; a runtime error will be raised. +*Note*: The `stream.unshift(chunk)` method cannot be called after the +[`'end'`][] event has been emitted or a runtime error will be thrown. -If you find that you must often call `stream.unshift(chunk)` in your -programs, consider implementing a [Transform][] stream instead. (See [API -for Stream Implementors][].) +Developers using `stream.unshift()` often should consider switching to +use of a [Transform][] stream instead. See the [API for Stream Implementers][] +section for more information. ```js // Pull off a header delimited by \n\n @@ -480,7 +952,7 @@ const StringDecoder = require('string_decoder').StringDecoder; function parseHeader(stream, callback) { stream.on('error', callback); stream.on('readable', onReadable); - var decoder = new StringDecoder('utf8'); + const decoder = new StringDecoder('utf8'); var header = ''; function onReadable() { var chunk; @@ -490,8 +962,8 @@ function parseHeader(stream, callback) { // found the header boundary var split = str.split(/\n\n/); header += split.shift(); - var remaining = split.join('\n\n'); - var buf = Buffer.from(remaining, 'utf8'); + const remaining = split.join('\n\n'); + const buf = Buffer.from(remaining, 'utf8'); if (buf.length) stream.unshift(buf); stream.removeListener('error', callback); @@ -507,30 +979,34 @@ function parseHeader(stream, callback) { } ``` -Note that, unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` +*Note*: Unlike [`stream.push(chunk)`][stream-push], `stream.unshift(chunk)` will not end the reading process by resetting the internal reading state of the -stream. This can cause unexpected results if `unshift()` is called during a -read (i.e. from within a [`stream._read()`][stream-_read] implementation on a -custom stream). Following the call to `unshift()` with an immediate -[`stream.push('')`][stream-push] will reset the reading state appropriately, -however it is best to simply avoid calling `unshift()` while in the process of -performing a read. - -#### readable.wrap(stream) +stream. This can cause unexpected results if `readable.unshift()` is called +during a read (i.e. from within a [`stream._read()`][stream-_read] +implementation on a custom stream). Following the call to `readable.unshift()` +with an immediate [`stream.push('')`][stream-push] will reset the reading state +appropriately, however it is best to simply avoid calling `readable.unshift()` +while in the process of performing a read. + +##### readable.wrap(stream) + * `stream` {Stream} An "old style" readable stream Versions of Node.js prior to v0.10 had streams that did not implement the -entire Streams API as it is today. (See [Compatibility][] for -more information.) +entire `stream` module API as it is currently defined. (See [Compatibility][] +for more information.) -If you are using an older Node.js library that emits [`'data'`][] events and -has a [`stream.pause()`][stream-pause] method that is advisory only, then you -can use the `wrap()` method to create a [Readable][] stream that uses the old -stream as its data source. +When using an older Node.js library that emits [`'data'`][] events and has a +[`stream.pause()`][stream-pause] method that is advisory only, the +`readable.wrap()` method can be used to create a [Readable][] stream that uses +the old stream as its data source. -You will very rarely ever need to call this function, but it exists -as a convenience for interacting with old Node.js programs and libraries. +It will rarely be necessary to use `readable.wrap()` but the method has been +provided as a convenience for interacting with older Node.js applications and +libraries. For example: @@ -545,210 +1021,65 @@ myReader.on('readable', () => { }); ``` -### Class: stream.Transform +### Duplex and Transform Streams -Transform streams are [Duplex][] streams where the output is in some way -computed from the input. They implement both the [Readable][] and +#### Class: stream.Duplex + + + + +Duplex streams are streams that implement both the [Readable][] and [Writable][] interfaces. -Examples of Transform streams include: +Examples of Duplex streams include: +* [TCP sockets][] * [zlib streams][zlib] * [crypto streams][crypto] -### Class: stream.Writable +#### Class: stream.Transform + -The Writable stream interface is an abstraction for a *destination* -that you are writing data *to*. +Transform streams are [Duplex][] streams where the output is in some way +related to the input. Like all [Duplex][] streams, Transform streams +implement both the [Readable][] and [Writable][] interfaces. -Examples of writable streams include: +Examples of Transform streams include: -* [HTTP requests, on the client][] -* [HTTP responses, on the server][] -* [fs write streams][] * [zlib streams][zlib] * [crypto streams][crypto] -* [TCP sockets][] -* [child process stdin][] -* [`process.stdout`][], [`process.stderr`][] -#### Event: 'close' -Emitted when the stream and any of its underlying resources (a file descriptor, -for example) have been closed. The event indicates that no more events will be -emitted, and no further computation will occur. +## API for Stream Implementers -Not all streams will emit the `'close'` event as the `'close'` event is -optional. + -#### Event: 'drain' +The `stream` module API has been designed to make it possible to easily +implement streams using JavaScript's prototypical inheritance model. -If a [`stream.write(chunk)`][stream-write] call returns `false`, then the -`'drain'` event will indicate when it is appropriate to begin writing more data -to the stream. +First, a stream developer would declare a new JavaScript class that extends one +of the four basic stream classes (`stream.Writable`, `stream.Readable`, +`stream.Duplex`, or `stream.Transform`), making sure the call the appropriate +parent class constructor: ```js -// Write the data to the supplied writable stream one million times. -// Be attentive to back-pressure. -function writeOneMillionTimes(writer, data, encoding, callback) { - var i = 1000000; - write(); - function write() { - var ok = true; - do { - i -= 1; - if (i === 0) { - // last time! - writer.write(data, encoding, callback); - } else { - // see if we should continue, or wait - // don't pass the callback, because we're not done yet. - ok = writer.write(data, encoding); - } - } while (i > 0 && ok); - if (i > 0) { - // had to stop early! - // write some more once it drains - writer.once('drain', write); - } - } -} -``` - -#### Event: 'error' - -* {Error} - -Emitted if there was an error when writing or piping data. - -#### Event: 'finish' - -When the [`stream.end()`][stream-end] method has been called, and all data has -been flushed to the underlying system, this event is emitted. +const Writable = require('stream').Writable; -```javascript -var writer = getWritableStreamSomehow(); -for (var i = 0; i < 100; i ++) { - writer.write('hello, #${i}!\n'); +class MyWritable extends Writable { + constructor(options) { + super(options); + } } -writer.end('this is the end\n'); -writer.on('finish', () => { - console.error('all writes are now complete.'); -}); ``` -#### Event: 'pipe' - -* `src` {stream.Readable} source stream that is piping to this writable - -This is emitted whenever the [`stream.pipe()`][] method is called on a readable -stream, adding this writable to its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('pipe', (src) => { - console.error('something is piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -``` - -#### Event: 'unpipe' - -* `src` {[Readable][] Stream} The source stream that - [unpiped][`stream.unpipe()`] this writable - -This is emitted whenever the [`stream.unpipe()`][] method is called on a -readable stream, removing this writable from its set of destinations. - -```js -var writer = getWritableStreamSomehow(); -var reader = getReadableStreamSomehow(); -writer.on('unpipe', (src) => { - console.error('something has stopped piping into the writer'); - assert.equal(src, reader); -}); -reader.pipe(writer); -reader.unpipe(writer); -``` - -#### writable.cork() - -Forces buffering of all writes. - -Buffered data will be flushed either at [`stream.uncork()`][] or at -[`stream.end()`][stream-end] call. - -#### writable.end([chunk][, encoding][, callback]) - -* `chunk` {String|Buffer} Optional data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Optional callback for when the stream is finished - -Call this method when no more data will be written to the stream. If supplied, -the callback is attached as a listener on the [`'finish'`][] event. - -Calling [`stream.write()`][stream-write] after calling -[`stream.end()`][stream-end] will raise an error. - -```js -// write 'hello, ' and then end with 'world!' -var file = fs.createWriteStream('example.txt'); -file.write('hello, '); -file.end('world!'); -// writing more now is not allowed! -``` - -#### writable.setDefaultEncoding(encoding) - -* `encoding` {String} The new default encoding -* Return: `this` - -Sets the default encoding for a writable stream. - -#### writable.uncork() - -Flush all data, buffered since [`stream.cork()`][] call. - -#### writable.write(chunk[, encoding][, callback]) - -* `chunk` {String|Buffer} The data to write -* `encoding` {String} The encoding, if `chunk` is a String -* `callback` {Function} Callback for when this chunk of data is flushed -* Returns: {Boolean} `true` if the data was handled completely. - -This method writes some data to the underlying system, and calls the -supplied callback once the data has been fully handled. If an error -occurs, the callback may or may not be called with the error as its -first argument. To detect write errors, listen for the `'error'` event. - -The return value indicates if you should continue writing right now. -If the data had to be buffered internally, then it will return -`false`. Otherwise, it will return `true`. - -This return value is strictly advisory. You MAY continue to write, -even if it returns `false`. However, writes will be buffered in -memory, so it is best not to do this excessively. Instead, wait for -the [`'drain'`][] event before writing more data. - - -## API for Stream Implementors - - - -To implement any sort of stream, the pattern is the same: - -1. Extend the appropriate parent class in your own subclass. (The - [`util.inherits()`][] method is particularly helpful for this.) -2. Call the appropriate parent class constructor in your constructor, - to be sure that the internal mechanisms are set up properly. -3. Implement one or more specific methods, as detailed below. - -The class to extend and the method(s) to implement depend on the sort -of stream class you are writing: +The new stream class must then implement one or more specific methods, depending +on the type of stream being created, as detailed in the chart below: @@ -769,7 +1100,7 @@ of stream class you are writing:

    Reading only

    -

    [Readable](#stream_class_stream_readable_1)

    +

    [Readable](#stream_class_stream_readable)

    [_read][stream-_read]

    @@ -780,7 +1111,7 @@ of stream class you are writing:

    Writing only

    -

    [Writable](#stream_class_stream_writable_1)

    +

    [Writable](#stream_class_stream_writable)

    [_write][stream-_write], [_writev][stream-_writev]

    @@ -791,7 +1122,7 @@ of stream class you are writing:

    Reading and writing

    -

    [Duplex](#stream_class_stream_duplex_1)

    +

    [Duplex](#stream_class_stream_duplex)

    [_read][stream-_read], [_write][stream-_write], [_writev][stream-_writev]

    @@ -802,7 +1133,7 @@ of stream class you are writing:

    Operate on written data, then read the result

    -

    [Transform](#stream_class_stream_transform_1)

    +

    [Transform](#stream_class_stream_transform)

    [_transform][stream-_transform], [_flush][stream-_flush]

    @@ -810,726 +1141,731 @@ of stream class you are writing:
    -In your implementation code, it is very important to never call the methods -described in [API for Stream Consumers][]. Otherwise, you can potentially cause -adverse side effects in programs that consume your streaming interfaces. - -### Class: stream.Duplex +*Note*: The implementation code for a stream should *never* call the "public" +methods of a stream that are intended for use by consumers (as described in +the [API for Stream Consumers][] section). Doing so may lead to adverse +side effects in application code consuming the stream. - - -A "duplex" stream is one that is both Readable and Writable, such as a TCP -socket connection. +### Simplified Construction -Note that `stream.Duplex` is an abstract class designed to be extended -with an underlying implementation of the [`stream._read(size)`][stream-_read] -and [`stream._write(chunk, encoding, callback)`][stream-_write] methods as you -would with a Readable or Writable stream class. +For many simple cases, it is possible to construct a stream without relying on +inheritance. This can be accomplished by directly creating instances of the +`stream.Writable`, `stream.Readable`, `stream.Duplex` or `stream.Transform` +objects and passing appropriate methods as constructor options. -Since JavaScript doesn't have multiple prototypal inheritance, this class -prototypally inherits from Readable, and then parasitically from Writable. It is -thus up to the user to implement both the low-level -[`stream._read(n)`][stream-_read] method as well as the low-level -[`stream._write(chunk, encoding, callback)`][stream-_write] method on extension -duplex classes. +For example: -#### new stream.Duplex(options) +```js +const Writable = require('stream').Writable; -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `allowHalfOpen` {Boolean} Default = `true`. If set to `false`, then - the stream will automatically end the readable side when the - writable side ends and vice versa. - * `readableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for readable side of the stream. Has no effect if `objectMode` - is `true`. - * `writableObjectMode` {Boolean} Default = `false`. Sets `objectMode` - for writable side of the stream. Has no effect if `objectMode` - is `true`. +const myWritable = new Writable({ + write(chunk, encoding, callback) { + // ... + } +}); +``` -In classes that extend the Duplex class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +### Implementing a Writable Stream -### Class: stream.PassThrough +The `stream.Writable` class is extended to implement a [Writable][] stream. -This is a trivial implementation of a [Transform][] stream that simply -passes the input bytes across to the output. Its purpose is mainly -for examples and testing, but there are occasionally use cases where -it can come in handy as a building block for novel sorts of streams. +Custom Writable streams *must* call the `new stream.Writable([options])` +constructor and implement the `writable._write()` method. The +`writable._writev()` method *may* also be implemented. -### Class: stream.Readable +#### Constructor: new stream.Writable([options]) - +* `options` {Object} + * `highWaterMark` {Number} Buffer level when + [`stream.write()`][stream-write] starts returning `false`. Defaults to + `16384` (16kb), or `16` for `objectMode` streams. + * `decodeStrings` {Boolean} Whether or not to decode strings into + Buffers before passing them to [`stream._write()`][stream-_write]. + Defaults to `true` + * `objectMode` {Boolean} Whether or not the + [`stream.write(anyObj)`][stream-write] is a valid operation. When set, + it becomes possible to write JavaScript values other than string or + `Buffer` if supported by the stream implementation. Defaults to `false` + * `write` {Function} Implementation for the + [`stream._write()`][stream-_write] method. + * `writev` {Function} Implementation for the + [`stream._writev()`][stream-_writev] method. -`stream.Readable` is an abstract class designed to be extended with an -underlying implementation of the [`stream._read(size)`][stream-_read] method. +For example: -Please see [API for Stream Consumers][] for how to consume -streams in your programs. What follows is an explanation of how to -implement Readable streams in your programs. +```js +const Writable = require('stream').Writable; -#### new stream.Readable([options]) +class MyWritable extends Writable { + constructor(options) { + // Calls the stream.Writable() constructor + super(options); + } +} +``` -* `options` {Object} - * `highWaterMark` {Number} The maximum number of bytes to store in - the internal buffer before ceasing to read from the underlying - resource. Default = `16384` (16kb), or `16` for `objectMode` streams - * `encoding` {String} If specified, then buffers will be decoded to - strings using the specified encoding. Default = `null` - * `objectMode` {Boolean} Whether this stream should behave - as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns - a single value instead of a Buffer of size n. Default = `false` - * `read` {Function} Implementation for the [`stream._read()`][stream-_read] - method. +Or, when using pre-ES6 style constructors: -In classes that extend the Readable class, make sure to call the -Readable constructor so that the buffering settings can be properly -initialized. +```js +const Writable = require('stream').Writable; +const util = require('util'); -#### readable.\_read(size) +function MyWritable(options) { + if (!(this instanceof MyWritable)) + return new MyWritable(options); + Writable.call(this, options); +} +util.inherits(MyWritable, Writable); +``` -* `size` {Number} Number of bytes to read asynchronously +Or, using the Simplified Constructor approach: -Note: **Implement this method, but do NOT call it directly.** - -This method is prefixed with an underscore because it is internal to the -class that defines it and should only be called by the internal Readable -class methods. All Readable stream implementations must provide a \_read -method to fetch data from the underlying resource. - -When `_read()` is called, if data is available from the resource, the `_read()` -implementation should start pushing that data into the read queue by calling -[`this.push(dataChunk)`][stream-push]. `_read()` should continue reading from -the resource and pushing data until push returns `false`, at which point it -should stop reading from the resource. Only when `_read()` is called again after -it has stopped should it start reading more data from the resource and pushing -that data onto the queue. - -Note: once the `_read()` method is called, it will not be called again until -the [`stream.push()`][stream-push] method is called. - -The `size` argument is advisory. Implementations where a "read" is a -single call that returns data can use this to know how much data to -fetch. Implementations where that is not relevant, such as TCP or -TLS, may ignore this argument, and simply provide data whenever it -becomes available. There is no need, for example to "wait" until -`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. +```js +const Writable = require('stream').Writable; -#### readable.push(chunk[, encoding]) +const myWritable = new Writable({ + write(chunk, encoding, callback) { + // ... + }, + writev(chunks, callback) { + // ... + } +}); +``` +#### writable.\_write(chunk, encoding, callback) -* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue -* `encoding` {String} Encoding of String chunks. Must be a valid - Buffer encoding, such as `'utf8'` or `'ascii'` -* return {Boolean} Whether or not more pushes should be performed +* `chunk` {Buffer|String} The chunk to be written. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then `encoding` is the + character encoding of that string. If chunk is a `Buffer`, or if the + stream is operating in object mode, `encoding` may be ignored. +* `callback` {Function} Call this function (optionally with an error + argument) when processing is complete for the supplied chunk. -Note: **This method should be called by Readable implementors, NOT -by consumers of Readable streams.** +All Writable stream implementations must provide a +[`writable._write()`][stream-_write] method to send data to the underlying +resource. -If a value other than null is passed, The `push()` method adds a chunk of data -into the queue for subsequent stream processors to consume. If `null` is -passed, it signals the end of the stream (EOF), after which no more data -can be written. +*Note*: [Transform][] streams provide their own implementation of the +[`writable._write()`][stream-_write]. -The data added with `push()` can be pulled out by calling the -[`stream.read()`][stream-read] method when the [`'readable'`][] event fires. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Writable +class methods only. -This API is designed to be as flexible as possible. For example, -you may be wrapping a lower-level source which has some sort of -pause/resume mechanism, and a data callback. In those cases, you -could wrap the low-level source object by doing something like this: +The `callback` method must be called to signal either that the write completed +successfully or failed with an error. The first argument passed to the +`callback` must be the `Error` object if the call failed or `null` if the +write succeeded. -```js -// source is an object with readStop() and readStart() methods, -// and an `ondata` member that gets called when it has data, and -// an `onend` member that gets called when the data is over. +It is important to note that all calls to `writable.write()` that occur between +the time `writable._write()` is called and the `callback` is called will cause +the written data to be buffered. Once the `callback` is invoked, the stream will +emit a `'drain'` event. If a stream implementation is capable of processing +multiple chunks of data at once, the `writable._writev()` method should be +implemented. -util.inherits(SourceWrapper, Readable); +If the `decodeStrings` property is set in the constructor options, then +`chunk` may be a string rather than a Buffer, and `encoding` will +indicate the character encoding of the string. This is to support +implementations that have an optimized handling for certain string +data encodings. If the `decodeStrings` property is explicitly set to `false`, +the `encoding` argument can be safely ignored, and `chunk` will always be a +`Buffer`. -function SourceWrapper(options) { - Readable.call(this, options); +The `writable._write()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - this._source = getLowlevelSourceObject(); +#### writable.\_writev(chunks, callback) - // Every time there's data, we push it into the internal buffer. - this._source.ondata = (chunk) => { - // if push() returns false, then we need to stop reading from source - if (!this.push(chunk)) - this._source.readStop(); - }; +* `chunks` {Array} The chunks to be written. Each chunk has following + format: `{ chunk: ..., encoding: ... }`. +* `callback` {Function} A callback function (optionally with an error + argument) to be invoked when processing is complete for the supplied chunks. - // When the source ends, we push the EOF-signaling `null` chunk - this._source.onend = () => { - this.push(null); - }; -} +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Writable +class methods only. -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -SourceWrapper.prototype._read = function(size) { - this._source.readStart(); -}; -``` +The `writable._writev()` method may be implemented in addition to +`writable._write()` in stream implementations that are capable of processing +multiple chunks of data at once. If implemented, the method will be called with +all chunks of data currently buffered in the write queue. -#### Example: A Counting Stream +The `writable._writev()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - +#### Errors While Writing -This is a basic example of a Readable stream. It emits the numerals -from 1 to 1,000,000 in ascending order, and then ends. +It is recommended that errors occurring during the processing of the +`writable._write()` and `writable._writev()` methods are reported by invoking +the callback and passing the error as the first argument. This will cause an +`'error'` event to be emitted by the Writable. Throwing an Error from within +`writable._write()` can result in expected and inconsistent behavior depending +on how the stream is being used. Using the callback ensures consistent and +predictable handling of errors. ```js -const Readable = require('stream').Readable; -const util = require('util'); -util.inherits(Counter, Readable); - -function Counter(opt) { - Readable.call(this, opt); - this._max = 1000000; - this._index = 1; -} +const Writable = require('stream').Writable; -Counter.prototype._read = function() { - var i = this._index++; - if (i > this._max) - this.push(null); - else { - var str = '' + i; - var buf = Buffer.from(str, 'ascii'); - this.push(buf); +const myWritable = new Writable({ + write(chunk, encoding, callback) { + if (chunk.toString().indexOf('a') >= 0) { + callback(new Error('chunk is invalid')); + } else { + callback(); + } } -}; +}); ``` -#### Example: SimpleProtocol v1 (Sub-optimal) +#### An Example Writable Stream -This is similar to the `parseHeader` function described -[here](#stream_readable_unshift_chunk), but implemented as a custom stream. -Also, note that this implementation does not convert the incoming data to a -string. - -However, this would be better implemented as a [Transform][] stream. See -[SimpleProtocol v2][] for a better implementation. +The following illustrates a rather simplistic (and somewhat pointless) custom +Writable stream implementation. While this specific Writable stream instance +is not of any real particular usefulness, the example illustrates each of the +required elements of a custom [Writable][] stream instance: ```js -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// NOTE: This can be done more simply as a Transform stream! -// Using Readable directly for this is sub-optimal. See the -// alternative example below under the Transform section. +const Writable = require('stream').Writable; -const Readable = require('stream').Readable; -const util = require('util'); +class MyWritable extends Writable { + constructor(options) { + super(options); + } -util.inherits(SimpleProtocol, Readable); + _write(chunk, encoding, callback) { + if (chunk.toString().indexOf('a') >= 0) { + callback(new Error('chunk is invalid')); + } else { + callback(); + } + } +} +``` -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(source, options); +### Implementing a Readable Stream - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; +The `stream.Readable` class is extended to implement a [Readable][] stream. - // source is a readable stream, such as a socket or file - this._source = source; +Custom Readable streams *must* call the `new stream.Readable([options])` +constructor and implement the `readable._read()` method. - source.on('end', () => { - this.push(null); - }); +#### new stream.Readable([options]) - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', () => { - this.read(0); - }); +* `options` {Object} + * `highWaterMark` {Number} The maximum number of bytes to store in + the internal buffer before ceasing to read from the underlying + resource. Defaults to `16384` (16kb), or `16` for `objectMode` streams + * `encoding` {String} If specified, then buffers will be decoded to + strings using the specified encoding. Defaults to `null` + * `objectMode` {Boolean} Whether this stream should behave + as a stream of objects. Meaning that [`stream.read(n)`][stream-read] returns + a single value instead of a Buffer of size n. Defaults to `false` + * `read` {Function} Implementation for the [`stream._read()`][stream-_read] + method. - this._rawHeader = []; - this.header = null; -} +For example: -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } +```js +const Readable = require('stream').Readable; - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - // calling unshift by itself does not reset the reading state - // of the stream; since we're inside _read, doing an additional - // push('') will reset the state appropriately. - this.push(''); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); +class MyReadable extends Readable { + constructor(options) { + // Calls the stream.Readable(options) constructor + super(options); } -}; - -// Usage: -// var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. +} ``` -### Class: stream.Transform +Or, when using pre-ES6 style constructors: -A "transform" stream is a duplex stream where the output is causally -connected in some way to the input, such as a [zlib][] stream or a -[crypto][] stream. +```js +const Readable = require('stream').Readable; +const util = require('util'); -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will produce output -that is either much smaller or much larger than its input. +function MyReadable(options) { + if (!(this instanceof MyReadable)) + return new MyReadable(options); + Readable.call(this, options); +} +util.inherits(MyReadable, Readable); +``` -Rather than implement the [`stream._read()`][stream-_read] and -[`stream._write()`][stream-_write] methods, Transform classes must implement the -[`stream._transform()`][stream-_transform] method, and may optionally -also implement the [`stream._flush()`][stream-_flush] method. (See below.) +Or, using the Simplified Constructor approach: -#### new stream.Transform([options]) +```js +const Readable = require('stream').Readable; -* `options` {Object} Passed to both Writable and Readable - constructors. Also has the following fields: - * `transform` {Function} Implementation for the - [`stream._transform()`][stream-_transform] method. - * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] - method. +const myReadable = new Readable({ + read(size) { + // ... + } +}); +``` -In classes that extend the Transform class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +#### readable.\_read(size) -#### Events: 'finish' and 'end' +* `size` {Number} Number of bytes to read asynchronously -The [`'finish'`][] and [`'end'`][] events are from the parent Writable -and Readable classes respectively. The `'finish'` event is fired after -[`stream.end()`][stream-end] is called and all chunks have been processed by -[`stream._transform()`][stream-_transform], `'end'` is fired after all data has -been output which is after the callback in [`stream._flush()`][stream-_flush] -has been called. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. -#### transform.\_flush(callback) +All Readable stream implementations must provide an implementation of the +`readable._read()` method to fetch data from the underlying resource. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done flushing any remaining data. +When `readable._read()` is called, if data is available from the resource, the +implementation should begin pushing that data into the read queue using the +[`this.push(dataChunk)`][stream-push] method. `_read()` should continue reading +from the resource and pushing data until `readable.push()` returns `false`. Only +when `_read()` is called again after it has stopped should it resume pushing +additional data onto the queue. -Note: **This function MUST NOT be called directly.** It MAY be implemented -by child classes, and if so, will be called by the internal Transform -class methods only. +*Note*: Once the `readable._read()` method has been called, it will not be +called again until the [`readable.push()`][stream-push] method is called. -In some cases, your transform operation may need to emit a bit more -data at the end of the stream. For example, a `Zlib` compression -stream will store up some internal state so that it can optimally -compress the output. At the end, however, it needs to do the best it -can with what is left, so that the data will be complete. +The `size` argument is advisory. For implementations where a "read" is a +single operation that returns data can use the `size` argument to determine how +much data to fetch. Other implementations may ignore this argument and simply +provide data whenever it becomes available. There is no need to "wait" until +`size` bytes are available before calling [`stream.push(chunk)`][stream-push]. -In those cases, you can implement a `_flush()` method, which will be -called at the very end, after all the written data is consumed, but -before emitting [`'end'`][] to signal the end of the readable side. Just -like with [`stream._transform()`][stream-_transform], call -`transform.push(chunk)` zero or more times, as appropriate, and call `callback` -when the flush operation is complete. +The `readable._read()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +#### readable.push(chunk[, encoding]) -#### transform.\_transform(chunk, encoding, callback) +* `chunk` {Buffer|Null|String} Chunk of data to push into the read queue +* `encoding` {String} Encoding of String chunks. Must be a valid + Buffer encoding, such as `'utf8'` or `'ascii'` +* Returns {Boolean} `true` if additional chunks of data may continued to be + pushed; `false` otherwise. -* `chunk` {Buffer|String} The chunk to be transformed. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument and data) when you are done processing the supplied chunk. +When `chunk` is a `Buffer` or `string`, the `chunk` of data will be added to the +internal queue for users of the stream to consume. Passing `chunk` as `null` +signals the end of the stream (EOF), after which no more data can be written. -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. +When the Readable is operating in paused mode, the data added with +`readable.push()` can be read out by calling the +[`readable.read()`][stream-read] method when the [`'readable'`][] event is +emitted. -All Transform stream implementations must provide a `_transform()` -method to accept input and produce output. +When the Readable is operating in flowing mode, the data added with +`readable.push()` will be delivered by emitting a `'data'` event. -`_transform()` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. +The `readable.push()` method is designed to be as flexible as possible. For +example, when wrapping a lower-level source that provides some form of +pause/resume mechanism, and a data callback, the low-level source can be wrapped +by the custom Readable instance as illustrated in the following example: -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. +```js +// source is an object with readStop() and readStart() methods, +// and an `ondata` member that gets called when it has data, and +// an `onend` member that gets called when the data is over. -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. If you supply a second argument to the callback -it will be passed to the push method. In other words the following are -equivalent: +class SourceWrapper extends Readable { + constructor(options) { + super(options); -```js -transform.prototype._transform = function (data, encoding, callback) { - this.push(data); - callback(); -}; + this._source = getLowlevelSourceObject(); -transform.prototype._transform = function (data, encoding, callback) { - callback(null, data); -}; + // Every time there's data, push it into the internal buffer. + this._source.ondata = (chunk) => { + // if push() returns false, then stop reading from source + if (!this.push(chunk)) + this._source.readStop(); + }; + + // When the source ends, push the EOF-signaling `null` chunk + this._source.onend = () => { + this.push(null); + }; + } + // _read will be called when the stream wants to pull more data in + // the advisory size argument is ignored in this case. + _read(size) { + this._source.readStart(); + } +} ``` +*Note*: The `readable.push()` method is intended be called only by Readable +Implementers, and only from within the `readable._read()` method. -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +#### Errors While Reading -#### Example: `SimpleProtocol` parser v2 +It is recommended that errors occurring during the processing of the +`readable._read()` method are emitted using the `'error'` event rather than +being thrown. Throwing an Error from within `readable._read()` can result in +expected and inconsistent behavior depending on whether the stream is operating +in flowing or paused mode. Using the `'error'` event ensures consistent and +predictable handling of errors. -The example [here](#stream_example_simpleprotocol_v1_sub_optimal) of a simple -protocol parser can be implemented simply by using the higher level -[Transform][] stream class, similar to the `parseHeader` and `SimpleProtocol -v1` examples. +```js +const Readable = require('stream').Readable; -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node.js stream -approach. +const myReadable = new Readable({ + read(size) { + if (checkSomeErrorCondition()) { + process.nextTick(() => this.emit('error', err)); + return; + } + // do some work + } +}); +``` -```javascript -const util = require('util'); -const Transform = require('stream').Transform; -util.inherits(SimpleProtocol, Transform); +#### An Example Counting Stream -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); + - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} +The following is a basic example of a Readable stream that emits the numerals +from 1 to 1,000,000 in ascending order, and then ends. -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } +```js +const Readable = require('stream').Readable; - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); +class Counter extends Readable { + constructor(opt) { + super(opt); + this._max = 1000000; + this._index = 1; + } - // now, because we got some extra data, emit this first. - this.push(chunk.slice(split)); + _read() { + var i = this._index++; + if (i > this._max) + this.push(null); + else { + var str = '' + i; + var buf = Buffer.from(str, 'ascii'); + this.push(buf); } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(chunk); } - done(); -}; - -// Usage: -// var parser = new SimpleProtocol(); -// source.pipe(parser) -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. +} ``` -### Class: stream.Writable +### Implementing a Duplex Stream - +A [Duplex][] stream is one that implements both [Readable][] and [Writable][], +such as a TCP socket connection. -`stream.Writable` is an abstract class designed to be extended with an -underlying implementation of the -[`stream._write(chunk, encoding, callback)`][stream-_write] method. +Because Javascript does not have support for multiple inheritance, the +`stream.Duplex` class is extended to implement a [Duplex][] stream (as opposed +to extending the `stream.Readable` *and* `stream.Writable` classes). -Please see [API for Stream Consumers][] for how to consume -writable streams in your programs. What follows is an explanation of -how to implement Writable streams in your programs. +*Note*: The `stream.Duplex` class prototypically inherits from `stream.Readable` +and parasitically from `stream.Writable`. -#### new stream.Writable([options]) +Custom Duplex streams *must* call the `new stream.Duplex([options])` +constructor and implement *both* the `readable._read()` and +`writable._write()` methods. -* `options` {Object} - * `highWaterMark` {Number} Buffer level when - [`stream.write()`][stream-write] starts returning `false`. Default = `16384` - (16kb), or `16` for `objectMode` streams. - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to [`stream._write()`][stream-_write]. - Default = `true` - * `objectMode` {Boolean} Whether or not the - [`stream.write(anyObj)`][stream-write] is a valid operation. If set you can - write arbitrary data instead of only `Buffer` / `String` data. - Default = `false` - * `write` {Function} Implementation for the - [`stream._write()`][stream-_write] method. - * `writev` {Function} Implementation for the - [`stream._writev()`][stream-_writev] method. +#### new stream.Duplex(options) -In classes that extend the Writable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `allowHalfOpen` {Boolean} Defaults to `true`. If set to `false`, then + the stream will automatically end the readable side when the + writable side ends and vice versa. + * `readableObjectMode` {Boolean} Defaults to `false`. Sets `objectMode` + for readable side of the stream. Has no effect if `objectMode` + is `true`. + * `writableObjectMode` {Boolean} Defaults to `false`. Sets `objectMode` + for writable side of the stream. Has no effect if `objectMode` + is `true`. -#### writable.\_write(chunk, encoding, callback) +For example: -* `chunk` {Buffer|String} The chunk to be written. Will **always** - be a buffer unless the `decodeStrings` option was set to `false`. -* `encoding` {String} If the chunk is a string, then this is the - encoding type. If chunk is a buffer, then this is the special - value - 'buffer', ignore it in this case. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. +```js +const Duplex = require('stream').Duplex; -All Writable stream implementations must provide a -[`stream._write()`][stream-_write] method to send data to the underlying -resource. +class MyDuplex extends Duplex { + constructor(options) { + super(options); + } +} +``` -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Writable -class methods only. +Or, when using pre-ES6 style constructors: -Call the callback using the standard `callback(error)` pattern to -signal that the write completed successfully or with an error. +```js +const Duplex = require('stream').Duplex; +const util = require('util'); -If the `decodeStrings` flag is set in the constructor options, then -`chunk` may be a string rather than a Buffer, and `encoding` will -indicate the sort of string that it is. This is to support -implementations that have an optimized handling for certain string -data encodings. If you do not explicitly set the `decodeStrings` -option to `false`, then you can safely ignore the `encoding` argument, -and assume that `chunk` will always be a Buffer. +function MyDuplex(options) { + if (!(this instanceof MyDuplex)) + return new MyDuplex(options); + Duplex.call(this, options); +} +util.inherits(MyDuplex, Duplex); +``` -This method is prefixed with an underscore because it is internal to -the class that defines it, and should not be called directly by user -programs. However, you **are** expected to override this method in -your own extension classes. +Or, using the Simplified Constructor approach: -#### writable.\_writev(chunks, callback) +```js +const Duplex = require('stream').Duplex; -* `chunks` {Array} The chunks to be written. Each chunk has following - format: `{ chunk: ..., encoding: ... }`. -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunks. +const myDuplex = new Duplex({ + read(size) { + // ... + }, + write(chunk, encoding, callback) { + // ... + } +}); +``` -Note: **This function MUST NOT be called directly.** It may be -implemented by child classes, and called by the internal Writable -class methods only. +#### An Example Duplex Stream -This function is completely optional to implement. In most cases it is -unnecessary. If implemented, it will be called with all the chunks -that are buffered in the write queue. +The following illustrates a simple example of a Duplex stream that wraps a +hypothetical lower-level source object to which data can be written, and +from which data can be read, albeit using an API that is not compatible with +Node.js streams. +The following illustrates a simple example of a Duplex stream that buffers +incoming written data via the [Writable][] interface that is read back out +via the [Readable][] interface. +```js +const Duplex = require('stream').Duplex; +const kSource = Symbol('source'); -## Simplified Constructor API +class MyDuplex extends Duplex { + constructor(source, options) { + super(options); + this[kSource] = source; + } - + _write(chunk, encoding, callback) { + // The underlying source only deals with strings + if (Buffer.isBuffer(chunk)) + chunk = chunk.toString(encoding); + this[kSource].writeSomeData(chunk, encoding); + callback(); + } + + _read(size) { + this[kSource].fetchSomeData(size, (data, encoding) => { + this.push(Buffer.from(data, encoding)); + }); + } +} +``` -In simple cases there is now the added benefit of being able to construct a -stream without inheritance. +The most important aspect of a Duplex stream is that the Readable and Writable +sides operate independently of one another despite co-existing within a single +object instance. -This can be done by passing the appropriate methods as constructor options: +#### Object Mode Duplex Streams -Examples: +For Duplex streams, `objectMode` can be set exclusively for either the Readable +or Writable side using the `readableObjectMode` and `writableObjectMode` options +respectively. -### Duplex +In the following example, for instance, a new Transform stream (which is a +type of [Duplex][] stream) is created that has an object mode Writable side +that accepts JavaScript numbers that are converted to hexidecimal strings on +the Readable side. ```js -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood +const Transform = require('stream').Transform; - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - write: function(chunk, encoding, next) { - // sets this._write under the hood +// All Transform streams are also Duplex Streams +const myTransform = new Transform({ + writableObjectMode: true, + + transform(chunk, encoding, callback) { + // Coerce the chunk to a number if necessary + chunk |= 0; - // An optional error can be passed as the first argument - next() + // Transform the chunk into something else. + const data = chunk.toString(16); + + // Push the data onto the readable queue. + callback(null, '0'.repeat(data.length % 2) + data); } }); -// or +myTransform.setEncoding('ascii'); +myTransform.on('data', (chunk) => console.log(chunk)); -var duplex = new stream.Duplex({ - read: function(n) { - // sets this._read under the hood +myTransform.write(1); + // Prints: 01 +myTransform.write(10); + // Prints: 0a +myTransform.write(100); + // Prints: 64 +``` - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); - }, - writev: function(chunks, next) { - // sets this._writev under the hood +### Implementing a Transform Stream - // An optional error can be passed as the first argument - next() - } -}); -``` +A [Transform][] stream is a [Duplex][] stream where the output is computed +in some way from the input. Examples include [zlib][] streams or [crypto][] +streams that compress, encrypt, or decrypt data. + +*Note*: There is no requirement that the output be the same size as the input, +the same number of chunks, or arrive at the same time. For example, a +Hash stream will only ever have a single chunk of output which is +provided when the input is ended. A `zlib` stream will produce output +that is either much smaller or much larger than its input. + +The `stream.Transform` class is extended to implement a [Transform][] stream. + +The `stream.Transform` class prototypically inherits from `stream.Duplex` and +implements its own versions of the `writable._write()` and `readable._read()` +methods. Custom Transform implementations *must* implement the +[`transform._transform()`][stream-_transform] method and *may* also implement +the [`transform._flush()`][stream-_flush] method. + +*Note*: Care must be taken when using Transform streams in that data written +to the stream can cause the Writable side of the stream to become paused if +the output on the Readable side is not consumed. + +#### new stream.Transform([options]) + +* `options` {Object} Passed to both Writable and Readable + constructors. Also has the following fields: + * `transform` {Function} Implementation for the + [`stream._transform()`][stream-_transform] method. + * `flush` {Function} Implementation for the [`stream._flush()`][stream-_flush] + method. -### Readable +For example: ```js -var readable = new stream.Readable({ - read: function(n) { - // sets this._read under the hood +const Transform = require('stream').Transform; - // push data onto the read queue, passing null - // will signal the end of the stream (EOF) - this.push(chunk); +class MyTransform extends Transform { + constructor(options) { + super(options); } -}); +} ``` -### Transform +Or, when using pre-ES6 style constructors: ```js -var transform = new stream.Transform({ - transform: function(chunk, encoding, next) { - // sets this._transform under the hood +const Transform = require('stream').Transform; +const util = require('util'); - // generate output as many times as needed - // this.push(chunk); +function MyTransform(options) { + if (!(this instanceof MyTransform)) + return new MyTransform(options); + Transform.call(this, options); +} +util.inherits(MyTransform, Transform); +``` - // call when the current chunk is consumed - next(); - }, - flush: function(done) { - // sets this._flush under the hood +Or, using the Simplified Constructor approach: - // generate output as many times as needed - // this.push(chunk); +```js +const Transform = require('stream').Transform; - done(); +const myTransform = new Transform({ + transform(chunk, encoding, callback) { + // ... } }); ``` -### Writable +#### Events: 'finish' and 'end' -```js -var writable = new stream.Writable({ - write: function(chunk, encoding, next) { - // sets this._write under the hood +The [`'finish'`][] and [`'end'`][] events are from the `stream.Writable` +and `stream.Readable` classes, respectively. The `'finish'` event is emitted +after [`stream.end()`][stream-end] is called and all chunks have been processed +by [`stream._transform()`][stream-_transform]. The `'end'` event is emitted +after all data has been output, which occurs after the callback in +[`transform._flush()`][stream-_flush] has been called. - // An optional error can be passed as the first argument - next() - } -}); +#### transform.\_flush(callback) -// or +* `callback` {Function} A callback function (optionally with an error + argument) to be called when remaining data has been flushed. -var writable = new stream.Writable({ - writev: function(chunks, next) { - // sets this._writev under the hood +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. - // An optional error can be passed as the first argument - next() - } -}); -``` +In some cases, a transform operation may need to emit an additional bit of +data at the end of the stream. For example, a `zlib` compression stream will +store an amount of internal state used to optimally compress the output. When +the stream ends, however, that additional data needs to be flushed so that the +compressed data will be complete. -## Streams: Under the Hood +Custom [Transform][] implementations *may* implement the `transform._flush()` +method. This will be called when there is no more written data to be consumed, +but before the [`'end'`][] event is emitted signaling the end of the +[Readable][] stream. - +Within the `transform._flush()` implementation, the `readable.push()` method +may be called zero or more times, as appropriate. The `callback` function must +be called when the flush operation is complete. -### Buffering +The `transform._flush()` method is prefixed with an underscore because it is +internal to the class that defines it, and should never be called directly by +user programs. - +#### transform.\_transform(chunk, encoding, callback) -Both Writable and Readable streams will buffer data on an internal -object which can be retrieved from `_writableState.getBuffer()` or -`_readableState.buffer`, respectively. +* `chunk` {Buffer|String} The chunk to be transformed. Will **always** + be a buffer unless the `decodeStrings` option was set to `false`. +* `encoding` {String} If the chunk is a string, then this is the + encoding type. If chunk is a buffer, then this is the special + value - 'buffer', ignore it in this case. +* `callback` {Function} A callback function (optionally with an error + argument and data) to be called after the supplied `chunk` has been + processed. -The amount of data that will potentially be buffered depends on the -`highWaterMark` option which is passed into the constructor. +*Note*: **This function MUST NOT be called by application code directly.** It +should be implemented by child classes, and called only by the internal Readable +class methods only. -Buffering in Readable streams happens when the implementation calls -[`stream.push(chunk)`][stream-push]. If the consumer of the Stream does not -call [`stream.read()`][stream-read], then the data will sit in the internal -queue until it is consumed. +All Transform stream implementations must provide a `_transform()` +method to accept input and produce output. The `transform._transform()` +implementation handles the bytes being written, computes an output, then passes +that output off to the readable portion using the `readable.push()` method. + +The `transform.push()` method may be called zero or more times to generate +output from a single input chunk, depending on how much is to be output +as a result of the chunk. -Buffering in Writable streams happens when the user calls -[`stream.write(chunk)`][stream-write] repeatedly, even when it returns `false`. +It is possible that no output is generated from any given chunk of input data. -The purpose of streams, especially with the [`stream.pipe()`][] method, is to -limit the buffering of data to acceptable levels, so that sources and -destinations of varying speed will not overwhelm the available memory. +The `callback` function must be called only when the current chunk is completely +consumed. The first argument passed to the `callback` must be an `Error` object +if an error occurred while processing the input or `null` otherwise. If a second +argument is passed to the `callback`, it will be forwarded on to the +`readable.push()` method. In other words the following are equivalent: + +```js +transform.prototype._transform = function (data, encoding, callback) { + this.push(data); + callback(); +}; + +transform.prototype._transform = function (data, encoding, callback) { + callback(null, data); +}; +``` + +The `transform._transform()` method is prefixed with an underscore because it +is internal to the class that defines it, and should never be called directly by +user programs. + +#### Class: stream.PassThrough + +The `stream.PassThrough` class is a trivial implementation of a [Transform][] +stream that simply passes the input bytes across to the output. Its purpose is +primarily for examples and testing, but there are some use cases where +`stream.PassThrough` is useful as a building block for novel sorts of streams. + +## Additional Notes + + ### Compatibility with Older Node.js Versions @@ -1538,26 +1874,26 @@ destinations of varying speed will not overwhelm the available memory. In versions of Node.js prior to v0.10, the Readable stream interface was simpler, but also less powerful and less useful. -* Rather than waiting for you to call the [`stream.read()`][stream-read] method, - [`'data'`][] events would start emitting immediately. If you needed to do - some I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. +* Rather than waiting for calls the [`stream.read()`][stream-read] method, + [`'data'`][] events would begin emitting immediately. Applications that + would need to perform some amount of work to decide how to handle data + were required to store read data into buffers so the data would not be lost. * The [`stream.pause()`][stream-pause] method was advisory, rather than - guaranteed. This meant that you still had to be prepared to receive - [`'data'`][] events even when the stream was in a paused state. - -In Node.js v0.10, the [Readable][] class was added. -For backwards compatibility with older Node.js programs, Readable streams -switch into "flowing mode" when a [`'data'`][] event handler is added, or -when the [`stream.resume()`][stream-resume] method is called. The effect is -that, even if you are not using the new [`stream.read()`][stream-read] method -and [`'readable'`][] event, you no longer have to worry about losing + guaranteed. This meant that it was still necessary to be prepared to receive + [`'data'`][] events *even when the stream was in a paused state*. + +In Node.js v0.10, the [Readable][] class was added. For backwards compatibility +with older Node.js programs, Readable streams switch into "flowing mode" when a +[`'data'`][] event handler is added, or when the +[`stream.resume()`][stream-resume] method is called. The effect is that, even +when not using the new [`stream.read()`][stream-read] method and +[`'readable'`][] event, it is no longer necessary to worry about losing [`'data'`][] chunks. -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: +While most applications will continue to function normally, this introduces an +edge case in the following conditions: -* No [`'data'`][] event handler is added. +* No [`'data'`][] event listener is added. * The [`stream.resume()`][stream-resume] method is never called. * The stream is not piped to any writable destination. @@ -1570,25 +1906,25 @@ net.createServer((socket) => { // we add an 'end' method, but never consume the data socket.on('end', () => { // It will never get here. - socket.end('I got your message (but didnt read it)\n'); + socket.end('The message was received but was not processed.\n'); }); }).listen(1337); ``` In versions of Node.js prior to v0.10, the incoming message data would be -simply discarded. However, in Node.js v0.10 and beyond, -the socket will remain paused forever. +simply discarded. However, in Node.js v0.10 and beyond, the socket remains +paused forever. The workaround in this situation is to call the -[`stream.resume()`][stream-resume] method to start the flow of data: +[`stream.resume()`][stream-resume] method to begin the flow of data: ```js // Workaround net.createServer((socket) => { socket.on('end', () => { - socket.end('I got your message (but didnt read it)\n'); + socket.end('The message was received but was not processed.\n'); }); // start the flow of data, discarding it. @@ -1599,159 +1935,66 @@ net.createServer((socket) => { In addition to new Readable streams switching into flowing mode, pre-v0.10 style streams can be wrapped in a Readable class using the -[`stream.wrap()`][] method. - - -### Object Mode - - - -Normally, Streams operate on Strings and Buffers exclusively. - -Streams that are in **object mode** can emit generic JavaScript values -other than Buffers and Strings. - -A Readable stream in object mode will always return a single item from -a call to [`stream.read(size)`][stream-read], regardless of what the size -argument is. - -A Writable stream in object mode will always ignore the `encoding` -argument to [`stream.write(data, encoding)`][stream-write]. - -The special value `null` still retains its special value for object -mode streams. That is, for object mode readable streams, `null` as a -return value from [`stream.read()`][stream-read] indicates that there is no more -data, and [`stream.push(null)`][stream-push] will signal the end of stream data -(`EOF`). +[`readable.wrap()`][`stream.wrap()`] method. -No streams in Node.js core are object mode streams. This pattern is only -used by userland streaming libraries. -You should set `objectMode` in your stream child class constructor on -the options object. Setting `objectMode` mid-stream is not safe. +### `readable.read(0)` -For Duplex streams `objectMode` can be set exclusively for readable or -writable side with `readableObjectMode` and `writableObjectMode` -respectively. These options can be used to implement parsers and -serializers with Transform streams. - -```js -const util = require('util'); -const StringDecoder = require('string_decoder').StringDecoder; -const Transform = require('stream').Transform; -util.inherits(JSONParseStream, Transform); - -// Gets \n-delimited JSON string data, and emits the parsed objects -function JSONParseStream() { - if (!(this instanceof JSONParseStream)) - return new JSONParseStream(); - - Transform.call(this, { readableObjectMode : true }); - - this._buffer = ''; - this._decoder = new StringDecoder('utf8'); -} - -JSONParseStream.prototype._transform = function(chunk, encoding, cb) { - this._buffer += this._decoder.write(chunk); - // split on newlines - var lines = this._buffer.split(/\r?\n/); - // keep the last partial line buffered - this._buffer = lines.pop(); - for (var l = 0; l < lines.length; l++) { - var line = lines[l]; - try { - var obj = JSON.parse(line); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; - -JSONParseStream.prototype._flush = function(cb) { - // Just handle any leftover - var rem = this._buffer.trim(); - if (rem) { - try { - var obj = JSON.parse(rem); - } catch (er) { - this.emit('error', er); - return; - } - // push the parsed object out to the readable consumer - this.push(obj); - } - cb(); -}; -``` - -### `stream.read(0)` - -There are some cases where you want to trigger a refresh of the +There are some cases where it is necessary to trigger a refresh of the underlying readable stream mechanisms, without actually consuming any -data. In that case, you can call `stream.read(0)`, which will always -return null. +data. In such cases, it is possible to call `readable.read(0)`, which will +always return `null`. If the internal read buffer is below the `highWaterMark`, and the stream is not currently reading, then calling `stream.read(0)` will trigger a low-level [`stream._read()`][stream-_read] call. -There is almost never a need to do this. However, you will see some -cases in Node.js's internals where this is done, particularly in the +While most applications will almost never need to do this, there are +situations within Node.js where this is done, particularly in the Readable stream class internals. -### `stream.push('')` - -Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an -interesting side effect. Because it *is* a call to -[`stream.push()`][stream-push], it will end the `reading` process. However, it -does *not* add any data to the readable buffer, so there's nothing for -a user to consume. +### `readable.push('')` -Very rarely, there are cases where you have no data to provide now, -but the consumer of your stream (or, perhaps, another bit of your own -code) will know when to check again, by calling [`stream.read(0)`][stream-read]. -In those cases, you *may* call `stream.push('')`. +Use of `readable.push('')` is not recommended. -So far, the only use case for this functionality is in the -[`tls.CryptoStream`][] class, which is deprecated in Node.js/io.js v1.0. If you -find that you have to use `stream.push('')`, please consider another -approach, because it almost certainly indicates that something is -horribly wrong. +Pushing a zero-byte string or `Buffer` to a stream that is not in object mode +has an interesting side effect. Because it *is* a call to +[`readable.push()`][stream-push], the call will end the reading process. +However, because the argument is an empty string, no data is added to the +readable buffer so there is nothing for a user to consume. [`'data'`]: #stream_event_data [`'drain'`]: #stream_event_drain [`'end'`]: #stream_event_end [`'finish'`]: #stream_event_finish [`'readable'`]: #stream_event_readable -[`buf.toString(encoding)`]: https://nodejs.org/docs/v6.1.0/api/buffer.html#buffer_buf_tostring_encoding_start_end -[`EventEmitter`]: https://nodejs.org/docs/v6.1.0/api/events.html#events_class_eventemitter -[`process.stderr`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stderr -[`process.stdin`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdin -[`process.stdout`]: https://nodejs.org/docs/v6.1.0/api/process.html#process_process_stdout +[`buf.toString(encoding)`]: https://nodejs.org/docs/v6.3.1/api/buffer.html#buffer_buf_tostring_encoding_start_end +[`EventEmitter`]: https://nodejs.org/docs/v6.3.1/api/events.html#events_class_eventemitter +[`process.stderr`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stderr +[`process.stdin`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stdin +[`process.stdout`]: https://nodejs.org/docs/v6.3.1/api/process.html#process_process_stdout [`stream.cork()`]: #stream_writable_cork [`stream.pipe()`]: #stream_readable_pipe_destination_options [`stream.uncork()`]: #stream_writable_uncork [`stream.unpipe()`]: #stream_readable_unpipe_destination [`stream.wrap()`]: #stream_readable_wrap_stream -[`tls.CryptoStream`]: https://nodejs.org/docs/v6.1.0/api/tls.html#tls_class_cryptostream -[`util.inherits()`]: https://nodejs.org/docs/v6.1.0/api/util.html#util_util_inherits_constructor_superconstructor +[`tls.CryptoStream`]: https://nodejs.org/docs/v6.3.1/api/tls.html#tls_class_cryptostream [API for Stream Consumers]: #stream_api_for_stream_consumers -[API for Stream Implementors]: #stream_api_for_stream_implementors -[child process stdin]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdin -[child process stdout and stderr]: https://nodejs.org/docs/v6.1.0/api/child_process.html#child_process_child_stdout +[API for Stream Implementers]: #stream_api_for_stream_implementers +[child process stdin]: https://nodejs.org/docs/v6.3.1/api/child_process.html#child_process_child_stdin +[child process stdout and stderr]: https://nodejs.org/docs/v6.3.1/api/child_process.html#child_process_child_stdout [Compatibility]: #stream_compatibility_with_older_node_js_versions [crypto]: crypto.html [Duplex]: #stream_class_stream_duplex -[fs read streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_readstream -[fs write streams]: https://nodejs.org/docs/v6.1.0/api/fs.html#fs_class_fs_writestream -[HTTP requests, on the client]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_clientrequest -[HTTP responses, on the server]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_serverresponse -[http-incoming-message]: https://nodejs.org/docs/v6.1.0/api/http.html#http_class_http_incomingmessage +[fs read streams]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_class_fs_readstream +[fs write streams]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_class_fs_writestream +[`fs.createReadStream()`]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_fs_createreadstream_path_options +[`fs.createWriteStream()`]: https://nodejs.org/docs/v6.3.1/api/fs.html#fs_fs_createwritestream_path_options +[`net.Socket`]: https://nodejs.org/docs/v6.3.1/api/net.html#net_class_net_socket +[`zlib.createDeflate()`]: https://nodejs.org/docs/v6.3.1/api/zlib.html#zlib_zlib_createdeflate_options +[HTTP requests, on the client]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_clientrequest +[HTTP responses, on the server]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_serverresponse +[http-incoming-message]: https://nodejs.org/docs/v6.3.1/api/http.html#http_class_http_incomingmessage [Object mode]: #stream_object_mode [Readable]: #stream_class_stream_readable [SimpleProtocol v2]: #stream_example_simpleprotocol_parser_v2 @@ -1766,7 +2009,7 @@ horribly wrong. [stream-read]: #stream_readable_read_size [stream-resume]: #stream_readable_resume [stream-write]: #stream_writable_write_chunk_encoding_callback -[TCP sockets]: https://nodejs.org/docs/v6.1.0/api/net.html#net_class_net_socket +[TCP sockets]: https://nodejs.org/docs/v6.3.1/api/net.html#net_class_net_socket [Transform]: #stream_class_stream_transform [Writable]: #stream_class_stream_writable [zlib]: zlib.html diff --git a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js index 79914fa684cbb1..208cc65f1cca99 100644 --- a/deps/npm/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/readable-stream/lib/_stream_readable.js @@ -51,21 +51,21 @@ if (debugUtil && debugUtil.debuglog) { } /**/ +var BufferList = require('./internal/streams/BufferList'); var StringDecoder; util.inherits(Readable, Stream); -var hasPrependListener = typeof EE.prototype.prependListener === 'function'; - function prependListener(emitter, event, fn) { - if (hasPrependListener) return emitter.prependListener(event, fn); - - // This is a brutally ugly hack to make sure that our error handler - // is attached before any userland ones. NEVER DO THIS. This is here - // only because this code needs to continue to work with older versions - // of Node.js that do not include the prependListener() method. The goal - // is to eventually remove this hack. - if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + if (typeof emitter.prependListener === 'function') { + return emitter.prependListener(event, fn); + } else { + // This is a hack to make sure that our error handler is attached before any + // userland ones. NEVER DO THIS. This is here only because this code needs + // to continue to work with older versions of Node.js that do not include + // the prependListener() method. The goal is to eventually remove this hack. + if (!emitter._events || !emitter._events[event]) emitter.on(event, fn);else if (isArray(emitter._events[event])) emitter._events[event].unshift(fn);else emitter._events[event] = [fn, emitter._events[event]]; + } } var Duplex; @@ -89,7 +89,10 @@ function ReadableState(options, stream) { // cast to ints. this.highWaterMark = ~ ~this.highWaterMark; - this.buffer = []; + // A linked list is used to store data chunks instead of an array because the + // linked list can remove elements from the beginning faster than + // array.shift() + this.buffer = new BufferList(); this.length = 0; this.pipes = null; this.pipesCount = 0; @@ -252,7 +255,8 @@ function computeNewHighWaterMark(n) { if (n >= MAX_HWM) { n = MAX_HWM; } else { - // Get the next highest power of 2 + // Get the next highest power of 2 to prevent increasing hwm excessively in + // tiny amounts n--; n |= n >>> 1; n |= n >>> 2; @@ -264,44 +268,34 @@ function computeNewHighWaterMark(n) { return n; } +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function howMuchToRead(n, state) { - if (state.length === 0 && state.ended) return 0; - - if (state.objectMode) return n === 0 ? 0 : 1; - - if (n === null || isNaN(n)) { - // only flow one buffer at a time - if (state.flowing && state.buffer.length) return state.buffer[0].length;else return state.length; + if (n <= 0 || state.length === 0 && state.ended) return 0; + if (state.objectMode) return 1; + if (n !== n) { + // Only flow one buffer at a time + if (state.flowing && state.length) return state.buffer.head.data.length;else return state.length; } - - if (n <= 0) return 0; - - // If we're asking for more than the target buffer level, - // then raise the water mark. Bump up to the next highest - // power of 2, to prevent increasing it excessively in tiny - // amounts. + // If we're asking for more than the current hwm, then raise the hwm. if (n > state.highWaterMark) state.highWaterMark = computeNewHighWaterMark(n); - - // don't have that much. return null, unless we've ended. - if (n > state.length) { - if (!state.ended) { - state.needReadable = true; - return 0; - } else { - return state.length; - } + if (n <= state.length) return n; + // Don't have enough + if (!state.ended) { + state.needReadable = true; + return 0; } - - return n; + return state.length; } // you can override either this method, or the async _read(n) below. Readable.prototype.read = function (n) { debug('read', n); + n = parseInt(n, 10); var state = this._readableState; var nOrig = n; - if (typeof n !== 'number' || n > 0) state.emittedReadable = false; + if (n !== 0) state.emittedReadable = false; // if we're doing read(0) to trigger a readable event, but we // already have a bunch of data in the buffer, then just trigger @@ -357,9 +351,7 @@ Readable.prototype.read = function (n) { if (state.ended || state.reading) { doRead = false; debug('reading or ended', doRead); - } - - if (doRead) { + } else if (doRead) { debug('do read'); state.reading = true; state.sync = true; @@ -368,28 +360,29 @@ Readable.prototype.read = function (n) { // call internal read method this._read(state.highWaterMark); state.sync = false; + // If _read pushed data synchronously, then `reading` will be false, + // and we need to re-evaluate how much data we can return to the user. + if (!state.reading) n = howMuchToRead(nOrig, state); } - // If _read pushed data synchronously, then `reading` will be false, - // and we need to re-evaluate how much data we can return to the user. - if (doRead && !state.reading) n = howMuchToRead(nOrig, state); - var ret; if (n > 0) ret = fromList(n, state);else ret = null; if (ret === null) { state.needReadable = true; n = 0; + } else { + state.length -= n; } - state.length -= n; - - // If we have nothing in the buffer, then we want to know - // as soon as we *do* get something into the buffer. - if (state.length === 0 && !state.ended) state.needReadable = true; + if (state.length === 0) { + // If we have nothing in the buffer, then we want to know + // as soon as we *do* get something into the buffer. + if (!state.ended) state.needReadable = true; - // If we tried to read() past the EOF, then emit end on the next tick. - if (nOrig !== n && state.ended && state.length === 0) endReadable(this); + // If we tried to read() past the EOF, then emit end on the next tick. + if (nOrig !== n && state.ended) endReadable(this); + } if (ret !== null) this.emit('data', ret); @@ -537,11 +530,17 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if (state.awaitDrain && (!dest._writableState || dest._writableState.needDrain)) ondrain(); } + // If the user pushes more data while we're writing to dest then we'll end up + // in ondata again. However, we only want to increase awaitDrain once because + // dest will only emit one 'drain' event for the multiple writes. + // => Introduce a guard on increasing awaitDrain. + var increasedAwaitDrain = false; src.on('data', ondata); function ondata(chunk) { debug('ondata'); + increasedAwaitDrain = false; var ret = dest.write(chunk); - if (false === ret) { + if (false === ret && !increasedAwaitDrain) { // If the user unpiped during `dest.write()`, it is possible // to get stuck in a permanently paused state if that write // also returned false. @@ -549,6 +548,7 @@ Readable.prototype.pipe = function (dest, pipeOpts) { if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) { debug('false write response, pause', src._readableState.awaitDrain); src._readableState.awaitDrain++; + increasedAwaitDrain = true; } src.pause(); } @@ -662,18 +662,14 @@ Readable.prototype.unpipe = function (dest) { Readable.prototype.on = function (ev, fn) { var res = Stream.prototype.on.call(this, ev, fn); - // If listening to data, and it has not explicitly been paused, - // then call resume to start the flow of data on the next tick. - if (ev === 'data' && false !== this._readableState.flowing) { - this.resume(); - } - - if (ev === 'readable' && !this._readableState.endEmitted) { + if (ev === 'data') { + // Start flowing on next tick if stream isn't explicitly paused + if (this._readableState.flowing !== false) this.resume(); + } else if (ev === 'readable') { var state = this._readableState; - if (!state.readableListening) { - state.readableListening = true; + if (!state.endEmitted && !state.readableListening) { + state.readableListening = state.needReadable = true; state.emittedReadable = false; - state.needReadable = true; if (!state.reading) { processNextTick(nReadingNextTick, this); } else if (state.length) { @@ -717,6 +713,7 @@ function resume_(stream, state) { } state.resumeScheduled = false; + state.awaitDrain = 0; stream.emit('resume'); flow(stream); if (state.flowing && !state.reading) stream.read(0); @@ -735,11 +732,7 @@ Readable.prototype.pause = function () { function flow(stream) { var state = stream._readableState; debug('flow', state.flowing); - if (state.flowing) { - do { - var chunk = stream.read(); - } while (null !== chunk && state.flowing); - } + while (state.flowing && stream.read() !== null) {} } // wrap an old-style stream as the async data source. @@ -810,50 +803,101 @@ Readable._fromList = fromList; // Pluck off n bytes from an array of buffers. // Length is the combined lengths of all the buffers in the list. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. function fromList(n, state) { - var list = state.buffer; - var length = state.length; - var stringMode = !!state.decoder; - var objectMode = !!state.objectMode; - var ret; - - // nothing in the list, definitely empty. - if (list.length === 0) return null; + // nothing buffered + if (state.length === 0) return null; - if (length === 0) ret = null;else if (objectMode) ret = list.shift();else if (!n || n >= length) { - // read it all, truncate the array. - if (stringMode) ret = list.join('');else if (list.length === 1) ret = list[0];else ret = Buffer.concat(list, length); - list.length = 0; + var ret; + if (state.objectMode) ret = state.buffer.shift();else if (!n || n >= state.length) { + // read it all, truncate the list + if (state.decoder) ret = state.buffer.join('');else if (state.buffer.length === 1) ret = state.buffer.head.data;else ret = state.buffer.concat(state.length); + state.buffer.clear(); } else { - // read just some of it. - if (n < list[0].length) { - // just take a part of the first list item. - // slice is the same for buffers and strings. - var buf = list[0]; - ret = buf.slice(0, n); - list[0] = buf.slice(n); - } else if (n === list[0].length) { - // first list is a perfect match - ret = list.shift(); - } else { - // complex case. - // we have enough to cover it, but it spans past the first buffer. - if (stringMode) ret = '';else ret = bufferShim.allocUnsafe(n); - - var c = 0; - for (var i = 0, l = list.length; i < l && c < n; i++) { - var _buf = list[0]; - var cpy = Math.min(n - c, _buf.length); + // read part of list + ret = fromListPartial(n, state.buffer, state.decoder); + } - if (stringMode) ret += _buf.slice(0, cpy);else _buf.copy(ret, c, 0, cpy); + return ret; +} - if (cpy < _buf.length) list[0] = _buf.slice(cpy);else list.shift(); +// Extracts only enough buffered data to satisfy the amount requested. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function fromListPartial(n, list, hasStrings) { + var ret; + if (n < list.head.data.length) { + // slice is the same for buffers and strings + ret = list.head.data.slice(0, n); + list.head.data = list.head.data.slice(n); + } else if (n === list.head.data.length) { + // first chunk is a perfect match + ret = list.shift(); + } else { + // result spans more than one buffer + ret = hasStrings ? copyFromBufferString(n, list) : copyFromBuffer(n, list); + } + return ret; +} - c += cpy; +// Copies a specified amount of characters from the list of buffered data +// chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBufferString(n, list) { + var p = list.head; + var c = 1; + var ret = p.data; + n -= ret.length; + while (p = p.next) { + var str = p.data; + var nb = n > str.length ? str.length : n; + if (nb === str.length) ret += str;else ret += str.slice(0, n); + n -= nb; + if (n === 0) { + if (nb === str.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = str.slice(nb); } + break; } + ++c; } + list.length -= c; + return ret; +} +// Copies a specified amount of bytes from the list of buffered data chunks. +// This function is designed to be inlinable, so please take care when making +// changes to the function body. +function copyFromBuffer(n, list) { + var ret = bufferShim.allocUnsafe(n); + var p = list.head; + var c = 1; + p.data.copy(ret); + n -= p.data.length; + while (p = p.next) { + var buf = p.data; + var nb = n > buf.length ? buf.length : n; + buf.copy(ret, ret.length - n, 0, nb); + n -= nb; + if (n === 0) { + if (nb === buf.length) { + ++c; + if (p.next) list.head = p.next;else list.head = list.tail = null; + } else { + list.head = p; + p.data = buf.slice(nb); + } + break; + } + ++c; + } + list.length -= c; return ret; } diff --git a/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js new file mode 100644 index 00000000000000..e4bfcf02dc8bbf --- /dev/null +++ b/deps/npm/node_modules/readable-stream/lib/internal/streams/BufferList.js @@ -0,0 +1,64 @@ +'use strict'; + +var Buffer = require('buffer').Buffer; +/**/ +var bufferShim = require('buffer-shims'); +/**/ + +module.exports = BufferList; + +function BufferList() { + this.head = null; + this.tail = null; + this.length = 0; +} + +BufferList.prototype.push = function (v) { + var entry = { data: v, next: null }; + if (this.length > 0) this.tail.next = entry;else this.head = entry; + this.tail = entry; + ++this.length; +}; + +BufferList.prototype.unshift = function (v) { + var entry = { data: v, next: this.head }; + if (this.length === 0) this.tail = entry; + this.head = entry; + ++this.length; +}; + +BufferList.prototype.shift = function () { + if (this.length === 0) return; + var ret = this.head.data; + if (this.length === 1) this.head = this.tail = null;else this.head = this.head.next; + --this.length; + return ret; +}; + +BufferList.prototype.clear = function () { + this.head = this.tail = null; + this.length = 0; +}; + +BufferList.prototype.join = function (s) { + if (this.length === 0) return ''; + var p = this.head; + var ret = '' + p.data; + while (p = p.next) { + ret += s + p.data; + }return ret; +}; + +BufferList.prototype.concat = function (n) { + if (this.length === 0) return bufferShim.alloc(0); + if (this.length === 1) return this.head.data; + var ret = bufferShim.allocUnsafe(n >>> 0); + var p = this.head; + var i = 0; + while (p) { + p.data.copy(ret, i); + i += p.data.length; + p = p.next; + } + return ret; +}; \ No newline at end of file diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/readable-stream/package.json b/deps/npm/node_modules/readable-stream/package.json index 1932ad2ac7a3f8..6cdacd2f62da22 100644 --- a/deps/npm/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/readable-stream/package.json @@ -2,26 +2,25 @@ "_args": [ [ { - "raw": "readable-stream@latest", + "raw": "readable-stream@2.1.5", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "2.1.5", + "spec": "2.1.5", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "readable-stream@latest", - "_id": "readable-stream@2.1.4", + "_from": "readable-stream@2.1.5", + "_id": "readable-stream@2.1.5", "_inCache": true, - "_installable": true, "_location": "/readable-stream", - "_nodeVersion": "5.11.0", + "_nodeVersion": "5.12.0", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/readable-stream-2.1.4.tgz_1463679605032_0.6917394688352942" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/readable-stream-2.1.5.tgz_1471463532993_0.15824943827465177" }, "_npmUser": { "name": "cwmma", @@ -30,29 +29,30 @@ "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { - "raw": "readable-stream@latest", + "raw": "readable-stream@2.1.5", "scope": null, "escapedName": "readable-stream", "name": "readable-stream", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "2.1.5", + "spec": "2.1.5", + "type": "version" }, "_requiredBy": [ "#USER", "/", "/fs-write-stream-atomic", "/node-gyp/npmlog/are-we-there-yet", + "/npm-registry-client/npmlog/are-we-there-yet", "/npmlog/are-we-there-yet", "/sha", "/tap", "/tap/tap-parser" ], - "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz", - "_shasum": "70b9791c6fcb8480db44bd155a0f6bb58f172468", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz", + "_shasum": "66fa8b720e1438b364681f2ad1a63c618448c9d0", "_shrinkwrap": null, - "_spec": "readable-stream@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "readable-stream@2.1.5", + "_where": "/Users/zkat/Documents/code/npm", "browser": { "util": false }, @@ -71,18 +71,18 @@ "description": "Streams3, a user-land copy of the stream library from Node.js", "devDependencies": { "assert": "~1.4.0", + "babel-polyfill": "^6.9.1", "nyc": "^6.4.0", "tap": "~0.7.1", "tape": "~4.5.1", - "zuul": "~3.9.0", - "zuul-ngrok": "^4.0.0" + "zuul": "~3.10.0" }, "directories": {}, "dist": { - "shasum": "70b9791c6fcb8480db44bd155a0f6bb58f172468", - "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.4.tgz" + "shasum": "66fa8b720e1438b364681f2ad1a63c618448c9d0", + "tarball": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.1.5.tgz" }, - "gitHead": "7752832fba237929388dea6c96911a0a6379abfc", + "gitHead": "758c8b3845af855fde736b6a7f58a15fba00d1e7", "homepage": "https://github.com/nodejs/readable-stream#readme", "keywords": [ "readable", @@ -122,12 +122,12 @@ "url": "git://github.com/nodejs/readable-stream.git" }, "scripts": { - "browser": "npm run write-zuul && zuul -- test/browser.js", + "browser": "npm run write-zuul && zuul --browser-retries 2 -- test/browser.js", "cover": "nyc npm test", - "local": "zuul --local -- test/browser.js", + "local": "zuul --local 3000 --no-coverage -- test/browser.js", "report": "nyc report --reporter=lcov", "test": "tap test/parallel/*.js test/ours/*.js", - "write-zuul": "printf \"ui: tape\ntunnel: ngrok\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" + "write-zuul": "printf \"ui: tape\nbrowsers:\n - name: $BROWSER_NAME\n version: $BROWSER_VERSION\n\">.zuul.yml" }, - "version": "2.1.4" + "version": "2.1.5" } diff --git a/deps/npm/node_modules/request/.travis.yml b/deps/npm/node_modules/request/.travis.yml index e5d9bde26263c5..6f2d753b615f83 100644 --- a/deps/npm/node_modules/request/.travis.yml +++ b/deps/npm/node_modules/request/.travis.yml @@ -1,13 +1,15 @@ + language: node_js node_js: - node + - 4 - 0.12 - 0.10 after_script: - npm run test-cov - - cat ./coverage/lcov.info | codecov + - codecov - cat ./coverage/lcov.info | coveralls webhooks: diff --git a/deps/npm/node_modules/request/CHANGELOG.md b/deps/npm/node_modules/request/CHANGELOG.md index ce6826f2f65228..2b5d17765a8c1d 100644 --- a/deps/npm/node_modules/request/CHANGELOG.md +++ b/deps/npm/node_modules/request/CHANGELOG.md @@ -1,5 +1,24 @@ ## Change Log +### v2.74.0 (2016/07/22) +- [#2295](https://github.com/request/request/pull/2295) Update tough-cookie to 2.3.0 (@stash-sfdc) +- [#2280](https://github.com/request/request/pull/2280) Update karma-tap to version 2.0.1 🚀 (@greenkeeperio-bot) + +### v2.73.0 (2016/07/09) +- [#2240](https://github.com/request/request/pull/2240) Remove connectionErrorHandler to fix #1903 (@zarenner) +- [#2251](https://github.com/request/request/pull/2251) tape@4.6.0 breaks build 🚨 (@greenkeeperio-bot) +- [#2225](https://github.com/request/request/pull/2225) Update docs (@ArtskydJ) +- [#2203](https://github.com/request/request/pull/2203) Update browserify to version 13.0.1 🚀 (@greenkeeperio-bot) +- [#2275](https://github.com/request/request/pull/2275) Update karma to version 1.1.1 🚀 (@greenkeeperio-bot) +- [#2204](https://github.com/request/request/pull/2204) Add codecov.yml and disable PR comments (@simov) +- [#2212](https://github.com/request/request/pull/2212) Fix link to http.IncomingMessage documentation (@nazieb) +- [#2208](https://github.com/request/request/pull/2208) Update to form-data RC4 and pass null values to it (@simov) +- [#2207](https://github.com/request/request/pull/2207) Move aws4 require statement to the top (@simov) +- [#2199](https://github.com/request/request/pull/2199) Update karma-coverage to version 1.0.0 🚀 (@greenkeeperio-bot) +- [#2206](https://github.com/request/request/pull/2206) Update qs to version 6.2.0 🚀 (@greenkeeperio-bot) +- [#2205](https://github.com/request/request/pull/2205) Use server-destory to close hanging sockets in tests (@simov) +- [#2200](https://github.com/request/request/pull/2200) Update karma-cli to version 1.0.0 🚀 (@greenkeeperio-bot) + ### v2.72.0 (2016/04/17) - [#2176](https://github.com/request/request/pull/2176) Do not try to pipe Gzip responses with no body (@simov) - [#2175](https://github.com/request/request/pull/2175) Add 'delete' alias for the 'del' API method (@simov, @MuhanZou) @@ -53,7 +72,7 @@ - [#1902](https://github.com/request/request/pull/1902) node-uuid@1.4.7 breaks build 🚨 (@greenkeeperio-bot) - [#1894](https://github.com/request/request/pull/1894) Fix tunneling after redirection from https (Original: #1881) (@simov, @falms) - [#1893](https://github.com/request/request/pull/1893) Update eslint to version 1.9.0 🚀 (@greenkeeperio-bot) -- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @Bloutiouf) +- [#1852](https://github.com/request/request/pull/1852) Update eslint to version 1.7.3 🚀 (@simov, @greenkeeperio-bot, @paulomcnally, @michelsalib, @arbaaz, @vladimirich, @LoicMahieu, @JoshWillik, @jzaefferer, @ryanwholey, @djchie, @thisconnect, @mgenereu, @acroca, @Sebmaster, @KoltesDigital) - [#1876](https://github.com/request/request/pull/1876) Implement loose matching for har mime types (@simov) - [#1875](https://github.com/request/request/pull/1875) Update bluebird to version 3.0.2 🚀 (@simov, @greenkeeperio-bot) - [#1871](https://github.com/request/request/pull/1871) Update browserify to version 12.0.1 🚀 (@greenkeeperio-bot) @@ -64,7 +83,7 @@ - [#1857](https://github.com/request/request/pull/1857) Fix Referer header to point to the original host name (@simov) - [#1850](https://github.com/request/request/pull/1850) Update karma-coverage to version 0.5.3 🚀 (@greenkeeperio-bot) - [#1847](https://github.com/request/request/pull/1847) Use node's latest version when building (@simov) -- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@Bloutiouf) +- [#1836](https://github.com/request/request/pull/1836) Tunnel: fix wrong property name (@KoltesDigital) - [#1820](https://github.com/request/request/pull/1820) Set href as request.js uses it (@mgenereu) - [#1840](https://github.com/request/request/pull/1840) Update http-signature to version 1.0.2 🚀 (@greenkeeperio-bot) - [#1845](https://github.com/request/request/pull/1845) Update istanbul to version 0.4.0 🚀 (@greenkeeperio-bot) @@ -114,8 +133,7 @@ - [#1687](https://github.com/request/request/pull/1687) Fix caseless bug - content-type not being set for multipart/form-data (@simov, @garymathews) ### v2.59.0 (2015/07/20) -- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. - Forever option defaults to using http(s).Agent in node 0.12+ (@simov) +- [#1671](https://github.com/request/request/pull/1671) Add tests and docs for using the agent, agentClass, agentOptions and forever options. Forever option defaults to using http(s).Agent in node 0.12+ (@simov) - [#1679](https://github.com/request/request/pull/1679) Fix - do not remove OAuth param when using OAuth realm (@simov, @jhalickman) - [#1668](https://github.com/request/request/pull/1668) updated dependencies (@deamme) - [#1656](https://github.com/request/request/pull/1656) Fix form method (@simov) @@ -182,7 +200,7 @@ - [#1460](https://github.com/request/request/pull/1460) localAddress or proxy config is lost when redirecting (@simov, @0x4139) - [#1453](https://github.com/request/request/pull/1453) Test on Node.js 0.12 and io.js with allowed failures (@nicolasmccurdy, @demohi) - [#1426](https://github.com/request/request/pull/1426) Fixing tests to pass on io.js and node 0.12 (only test-https.js stiff failing) (@mikeal) -- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimonz) +- [#1446](https://github.com/request/request/pull/1446) Missing HTTP referer header with redirects Fixes #1038 (@simov, @guimon) - [#1428](https://github.com/request/request/pull/1428) Deprecate Node v0.8.x (@nylen) - [#1436](https://github.com/request/request/pull/1436) Add ability to set a requester without setting default options (@tikotzky) - [#1435](https://github.com/request/request/pull/1435) dry up verb methods (@sethpollack) @@ -310,7 +328,7 @@ - [#1131](https://github.com/request/request/pull/1131) Update pool documentation (@FredKSchott) - [#1143](https://github.com/request/request/pull/1143) Rewrite all tests to use tape (@nylen) - [#1137](https://github.com/request/request/pull/1137) Add ability to specifiy querystring lib in options. (@jgrund) -- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@cappslock) +- [#1138](https://github.com/request/request/pull/1138) allow hostname and port in place of host on uri (@slimelabs) - [#1134](https://github.com/request/request/pull/1134) Fix multiple redirects and `self.followRedirect` (@blakeembrey) - [#1130](https://github.com/request/request/pull/1130) documentation fix: add note about npm test for contributing (@FredKSchott) - [#1120](https://github.com/request/request/pull/1120) Support/refactor request setup tunnel (@seanstrom) @@ -479,28 +497,20 @@ - [#596](https://github.com/request/request/pull/596) Global agent is being used when pool is specified (@Cauldrath) - [#594](https://github.com/request/request/pull/594) Emit complete event when there is no callback (@RomainLK) - [#601](https://github.com/request/request/pull/601) Fixed a small typo (@michalstanko) - -### v2.23.0 (2013/07/23) - [#589](https://github.com/request/request/pull/589) Prevent setting headers after they are sent (@geek) - [#587](https://github.com/request/request/pull/587) Global cookie jar disabled by default (@threepointone) - -### v2.22.0 (2013/07/05) - [#544](https://github.com/request/request/pull/544) Update http-signature version. (@davidlehn) - [#581](https://github.com/request/request/pull/581) Fix spelling of "ignoring." (@bigeasy) - [#568](https://github.com/request/request/pull/568) use agentOptions to create agent when specified in request (@SamPlacette) - [#564](https://github.com/request/request/pull/564) Fix redirections (@criloz) - [#541](https://github.com/request/request/pull/541) The exported request function doesn't have an auth method (@tschaub) - [#542](https://github.com/request/request/pull/542) Expose Request class (@regality) - -### v2.21.0 (2013/04/30) - [#536](https://github.com/request/request/pull/536) Allow explicitly empty user field for basic authentication. (@mikeando) - [#532](https://github.com/request/request/pull/532) fix typo (@fredericosilva) - [#497](https://github.com/request/request/pull/497) Added redirect event (@Cauldrath) - [#503](https://github.com/request/request/pull/503) Fix basic auth for passwords that contain colons (@tonistiigi) - [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421) - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka) - -### v2.20.0 (2013/04/22) - [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421) - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421) - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun) diff --git a/deps/npm/node_modules/request/README.md b/deps/npm/node_modules/request/README.md index cf9072a21a229a..81ecac50999a34 100644 --- a/deps/npm/node_modules/request/README.md +++ b/deps/npm/node_modules/request/README.md @@ -67,7 +67,7 @@ Request can also `pipe` to itself. When doing so, `content-type` and `content-le request.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png')) ``` -Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage). +Request emits a "response" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](https://nodejs.org/api/http.html#http_class_http_incomingmessage). ```js request @@ -601,7 +601,6 @@ var options = { key: fs.readFileSync(keyFile), passphrase: 'password', ca: fs.readFileSync(caFile) - } }; request.get(options); @@ -819,7 +818,7 @@ default in Linux can be anywhere from 20-120 seconds][linux-timeout]). The callback argument gets 3 arguments: 1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object) -2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object +2. An [`http.IncomingMessage`](https://nodejs.org/api/http.html#http_class_http_incomingmessage) object 3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied) [back to top](#table-of-contents) diff --git a/deps/npm/node_modules/request/codecov.yml b/deps/npm/node_modules/request/codecov.yml new file mode 100644 index 00000000000000..acd3f33ceb5d2b --- /dev/null +++ b/deps/npm/node_modules/request/codecov.yml @@ -0,0 +1,2 @@ + +comment: false diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js index 54766a13518173..ac72093083975c 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/index.js +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/index.js @@ -27,7 +27,7 @@ var crypto = require('crypto') * Valid keys. */ -var keys = +var keys = [ 'acl' , 'location' , 'logging' @@ -66,7 +66,7 @@ module.exports.authorization = authorization * @param {Object} options * @return {String} * @api private - */ + */ function hmacSha1 (options) { return crypto.createHmac('sha1', options.secret).update(options.message).digest('base64') @@ -75,8 +75,8 @@ function hmacSha1 (options) { module.exports.hmacSha1 = hmacSha1 /** - * Create a base64 sha1 HMAC for `options`. - * + * Create a base64 sha1 HMAC for `options`. + * * @param {Object} options * @return {String} * @api private @@ -89,10 +89,10 @@ function sign (options) { module.exports.sign = sign /** - * Create a base64 sha1 HMAC for `options`. + * Create a base64 sha1 HMAC for `options`. * * Specifically to be used with S3 presigned URLs - * + * * @param {Object} options * @return {String} * @api private @@ -108,7 +108,7 @@ module.exports.signQuery= signQuery * Return a string for sign() with the given `options`. * * Spec: - * + * * \n * \n * \n @@ -124,7 +124,7 @@ module.exports.signQuery= signQuery function stringToSign (options) { var headers = options.amazonHeaders || '' if (headers) headers += '\n' - var r = + var r = [ options.verb , options.md5 , options.contentType @@ -140,7 +140,7 @@ module.exports.queryStringToSign = stringToSign * for S3 presigned URLs * * Spec: - * + * * \n * * diff --git a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json index 0fe40d0b6e88b3..9ece6179c9d282 100644 --- a/deps/npm/node_modules/request/node_modules/aws-sign2/package.json +++ b/deps/npm/node_modules/request/node_modules/aws-sign2/package.json @@ -1,49 +1,82 @@ { + "_args": [ + [ + { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "aws-sign2@>=0.6.0 <0.7.0", + "_id": "aws-sign2@0.6.0", + "_inCache": true, + "_installable": true, + "_location": "/request/aws-sign2", + "_nodeVersion": "4.1.2", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + "_npmVersion": "2.14.4", + "_phantomChildren": {}, + "_requested": { + "raw": "aws-sign2@~0.6.0", + "scope": null, + "escapedName": "aws-sign2", + "name": "aws-sign2", + "rawSpec": "~0.6.0", + "spec": ">=0.6.0 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", + "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "_shrinkwrap": null, + "_spec": "aws-sign2@~0.6.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, - "name": "aws-sign2", - "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", - "version": "0.6.0", - "repository": { - "url": "git+https://github.com/mikeal/aws-sign.git" + "bugs": { + "url": "https://github.com/mikeal/aws-sign/issues" }, - "license": "Apache-2.0", - "main": "index.js", "dependencies": {}, + "description": "AWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.", "devDependencies": {}, - "optionalDependencies": {}, + "directories": {}, + "dist": { + "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", + "tarball": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + }, "engines": { "node": "*" }, "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec", - "bugs": { - "url": "https://github.com/mikeal/aws-sign/issues" - }, "homepage": "https://github.com/mikeal/aws-sign#readme", - "_id": "aws-sign2@0.6.0", - "scripts": {}, - "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "_from": "aws-sign2@>=0.6.0 <0.7.0", - "_npmVersion": "2.14.4", - "_nodeVersion": "4.1.2", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", "email": "mikeal.rogers@gmail.com" } ], - "dist": { - "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f", - "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz" + "name": "aws-sign2", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/aws-sign.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": {}, + "version": "0.6.0" } diff --git a/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md index ec663e9237ec5e..6c55da80528c74 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/README.md +++ b/deps/npm/node_modules/request/node_modules/aws4/README.md @@ -511,3 +511,4 @@ committed and subsequently extracted this code. Also thanks to the [official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving me a start on implementing the v4 signature. + diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js index 71e08bbc17c9d1..cbe5dc90494efe 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/aws4.js +++ b/deps/npm/node_modules/request/node_modules/aws4/aws4.js @@ -2,7 +2,7 @@ var aws4 = exports, url = require('url'), querystring = require('querystring'), crypto = require('crypto'), - lru = require('lru-cache'), + lru = require('./lru'), credentialsCache = lru(1000) // http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html diff --git a/deps/npm/node_modules/request/node_modules/aws4/lru.js b/deps/npm/node_modules/request/node_modules/aws4/lru.js new file mode 100644 index 00000000000000..333f66a4436ec4 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/aws4/lru.js @@ -0,0 +1,96 @@ +module.exports = function(size) { + return new LruCache(size) +} + +function LruCache(size) { + this.capacity = size | 0 + this.map = Object.create(null) + this.list = new DoublyLinkedList() +} + +LruCache.prototype.get = function(key) { + var node = this.map[key] + if (node == null) return undefined + this.used(node) + return node.val +} + +LruCache.prototype.set = function(key, val) { + var node = this.map[key] + if (node != null) { + node.val = val + } else { + if (!this.capacity) this.prune() + if (!this.capacity) return false + node = new DoublyLinkedNode(key, val) + this.map[key] = node + this.capacity-- + } + this.used(node) + return true +} + +LruCache.prototype.used = function(node) { + this.list.moveToFront(node) +} + +LruCache.prototype.prune = function() { + var node = this.list.pop() + if (node != null) { + delete this.map[node.key] + this.capacity++ + } +} + + +function DoublyLinkedList() { + this.firstNode = null + this.lastNode = null +} + +DoublyLinkedList.prototype.moveToFront = function(node) { + if (this.firstNode == node) return + + this.remove(node) + + if (this.firstNode == null) { + this.firstNode = node + this.lastNode = node + node.prev = null + node.next = null + } else { + node.prev = null + node.next = this.firstNode + node.next.prev = node + this.firstNode = node + } +} + +DoublyLinkedList.prototype.pop = function() { + var lastNode = this.lastNode + if (lastNode != null) { + this.remove(lastNode) + } + return lastNode +} + +DoublyLinkedList.prototype.remove = function(node) { + if (this.firstNode == node) { + this.firstNode = node.next + } else if (node.prev != null) { + node.prev.next = node.next + } + if (this.lastNode == node) { + this.lastNode = node.prev + } else if (node.next != null) { + node.next.prev = node.prev + } +} + + +function DoublyLinkedNode(key, val) { + this.key = key + this.val = val + this.prev = null + this.next = null +} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md deleted file mode 100644 index 1bc7b03f3ea731..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md +++ /dev/null @@ -1,142 +0,0 @@ -# lru cache - -A cache object that deletes the least-recently-used items. - -[![Build Status](https://travis-ci.org/isaacs/node-lru-cache.svg?branch=master)](https://travis-ci.org/isaacs/node-lru-cache) [![Coverage Status](https://coveralls.io/repos/isaacs/node-lru-cache/badge.svg?service=github)](https://coveralls.io/github/isaacs/node-lru-cache) - -## Usage: - -```javascript -var LRU = require("lru-cache") - , options = { max: 500 - , length: function (n, key) { return n * 2 + key.length } - , dispose: function (key, n) { n.close() } - , maxAge: 1000 * 60 * 60 } - , cache = LRU(options) - , otherCache = LRU(50) // sets just the max size - -cache.set("key", "value") -cache.get("key") // "value" - -// non-string keys ARE fully supported -var someObject = {} -cache.set(someObject, 'a value') -cache.set('[object Object]', 'a different value') -assert.equal(cache.get(someObject), 'a value') - -cache.reset() // empty the cache -``` - -If you put more stuff in it, then items will fall out. - -If you try to put an oversized thing in it, then it'll fall out right -away. - -## Options - -* `max` The maximum size of the cache, checked by applying the length - function to all values in the cache. Not setting this is kind of - silly, since that's the whole purpose of this lib, but it defaults - to `Infinity`. -* `maxAge` Maximum age in ms. Items are not pro-actively pruned out - as they age, but if you try to get an item that is too old, it'll - drop it and return undefined instead of giving it to you. -* `length` Function that is used to calculate the length of stored - items. If you're storing strings or buffers, then you probably want - to do something like `function(n, key){return n.length}`. The default is - `function(){return 1}`, which is fine if you want to store `max` - like-sized things. They item is passed as the first argument, and - the key is passed as the second argumnet. -* `dispose` Function that is called on items when they are dropped - from the cache. This can be handy if you want to close file - descriptors or do other cleanup tasks when items are no longer - accessible. Called with `key, value`. It's called *before* - actually removing the item from the internal cache, so if you want - to immediately put it back in, you'll have to do that in a - `nextTick` or `setTimeout` callback or it won't do anything. -* `stale` By default, if you set a `maxAge`, it'll only actually pull - stale items out of the cache when you `get(key)`. (That is, it's - not pre-emptively doing a `setTimeout` or anything.) If you set - `stale:true`, it'll return the stale value before deleting it. If - you don't set this, then it'll return `undefined` when you try to - get a stale entry, as if it had already been deleted. - -## API - -* `set(key, value, maxAge)` -* `get(key) => value` - - Both of these will update the "recently used"-ness of the key. - They do what you think. `maxAge` is optional and overrides the - cache `maxAge` option if provided. - - If the key is not found, `get()` will return `undefined`. - - The key and val can be any value. - -* `peek(key)` - - Returns the key value (or `undefined` if not found) without - updating the "recently used"-ness of the key. - - (If you find yourself using this a lot, you *might* be using the - wrong sort of data structure, but there are some use cases where - it's handy.) - -* `del(key)` - - Deletes a key out of the cache. - -* `reset()` - - Clear the cache entirely, throwing away all values. - -* `has(key)` - - Check if a key is in the cache, without updating the recent-ness - or deleting it for being stale. - -* `forEach(function(value,key,cache), [thisp])` - - Just like `Array.prototype.forEach`. Iterates over all the keys - in the cache, in order of recent-ness. (Ie, more recently used - items are iterated over first.) - -* `rforEach(function(value,key,cache), [thisp])` - - The same as `cache.forEach(...)` but items are iterated over in - reverse order. (ie, less recently used items are iterated over - first.) - -* `keys()` - - Return an array of the keys in the cache. - -* `values()` - - Return an array of the values in the cache. - -* `length` - - Return total length of objects in cache taking into account - `length` options function. - -* `itemCount` - - Return total quantity of objects currently in cache. Note, that - `stale` (see options) items are returned as part of this item - count. - -* `dump()` - - Return an array of the cache entries ready for serialization and usage - with 'destinationCache.load(arr)`. - -* `load(cacheEntriesArray)` - - Loads another cache entries array, obtained with `sourceCache.dump()`, - into the cache. The destination cache is reset before loading new entries - -* `prune()` - - Manually iterates over the entire cache proactively pruning old entries diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js deleted file mode 100644 index e98ef78a53dc79..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +++ /dev/null @@ -1,469 +0,0 @@ -module.exports = LRUCache - -// This will be a proper iterable 'Map' in engines that support it, -// or a fakey-fake PseudoMap in older versions. -var Map = require('pseudomap') -var util = require('util') - -// A linked list to keep track of recently-used-ness -var Yallist = require('yallist') - -// use symbols if possible, otherwise just _props -var symbols = {} -var hasSymbol = typeof Symbol === 'function' -var makeSymbol -/* istanbul ignore if */ -if (hasSymbol) { - makeSymbol = function (key) { - return Symbol.for(key) - } -} else { - makeSymbol = function (key) { - return '_' + key - } -} - -function priv (obj, key, val) { - var sym - if (symbols[key]) { - sym = symbols[key] - } else { - sym = makeSymbol(key) - symbols[key] = sym - } - if (arguments.length === 2) { - return obj[sym] - } else { - obj[sym] = val - return val - } -} - -function naiveLength () { return 1 } - -// lruList is a yallist where the head is the youngest -// item, and the tail is the oldest. the list contains the Hit -// objects as the entries. -// Each Hit object has a reference to its Yallist.Node. This -// never changes. -// -// cache is a Map (or PseudoMap) that matches the keys to -// the Yallist.Node object. -function LRUCache (options) { - if (!(this instanceof LRUCache)) { - return new LRUCache(options) - } - - if (typeof options === 'number') { - options = { max: options } - } - - if (!options) { - options = {} - } - - var max = priv(this, 'max', options.max) - // Kind of weird to have a default max of Infinity, but oh well. - if (!max || - !(typeof max === 'number') || - max <= 0) { - priv(this, 'max', Infinity) - } - - var lc = options.length || naiveLength - if (typeof lc !== 'function') { - lc = naiveLength - } - priv(this, 'lengthCalculator', lc) - - priv(this, 'allowStale', options.stale || false) - priv(this, 'maxAge', options.maxAge || 0) - priv(this, 'dispose', options.dispose) - this.reset() -} - -// resize the cache when the max changes. -Object.defineProperty(LRUCache.prototype, 'max', { - set: function (mL) { - if (!mL || !(typeof mL === 'number') || mL <= 0) { - mL = Infinity - } - priv(this, 'max', mL) - trim(this) - }, - get: function () { - return priv(this, 'max') - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'allowStale', { - set: function (allowStale) { - priv(this, 'allowStale', !!allowStale) - }, - get: function () { - return priv(this, 'allowStale') - }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'maxAge', { - set: function (mA) { - if (!mA || !(typeof mA === 'number') || mA < 0) { - mA = 0 - } - priv(this, 'maxAge', mA) - trim(this) - }, - get: function () { - return priv(this, 'maxAge') - }, - enumerable: true -}) - -// resize the cache when the lengthCalculator changes. -Object.defineProperty(LRUCache.prototype, 'lengthCalculator', { - set: function (lC) { - if (typeof lC !== 'function') { - lC = naiveLength - } - if (lC !== priv(this, 'lengthCalculator')) { - priv(this, 'lengthCalculator', lC) - priv(this, 'length', 0) - priv(this, 'lruList').forEach(function (hit) { - hit.length = priv(this, 'lengthCalculator').call(this, hit.value, hit.key) - priv(this, 'length', priv(this, 'length') + hit.length) - }, this) - } - trim(this) - }, - get: function () { return priv(this, 'lengthCalculator') }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'length', { - get: function () { return priv(this, 'length') }, - enumerable: true -}) - -Object.defineProperty(LRUCache.prototype, 'itemCount', { - get: function () { return priv(this, 'lruList').length }, - enumerable: true -}) - -LRUCache.prototype.rforEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = priv(this, 'lruList').tail; walker !== null;) { - var prev = walker.prev - forEachStep(this, fn, walker, thisp) - walker = prev - } -} - -function forEachStep (self, fn, node, thisp) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!priv(self, 'allowStale')) { - hit = undefined - } - } - if (hit) { - fn.call(thisp, hit.value, hit.key, self) - } -} - -LRUCache.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = priv(this, 'lruList').head; walker !== null;) { - var next = walker.next - forEachStep(this, fn, walker, thisp) - walker = next - } -} - -LRUCache.prototype.keys = function () { - return priv(this, 'lruList').toArray().map(function (k) { - return k.key - }, this) -} - -LRUCache.prototype.values = function () { - return priv(this, 'lruList').toArray().map(function (k) { - return k.value - }, this) -} - -LRUCache.prototype.reset = function () { - if (priv(this, 'dispose') && - priv(this, 'lruList') && - priv(this, 'lruList').length) { - priv(this, 'lruList').forEach(function (hit) { - priv(this, 'dispose').call(this, hit.key, hit.value) - }, this) - } - - priv(this, 'cache', new Map()) // hash of items by key - priv(this, 'lruList', new Yallist()) // list of items in order of use recency - priv(this, 'length', 0) // length of items in the list -} - -LRUCache.prototype.dump = function () { - return priv(this, 'lruList').map(function (hit) { - if (!isStale(this, hit)) { - return { - k: hit.key, - v: hit.value, - e: hit.now + (hit.maxAge || 0) - } - } - }, this).toArray().filter(function (h) { - return h - }) -} - -LRUCache.prototype.dumpLru = function () { - return priv(this, 'lruList') -} - -LRUCache.prototype.inspect = function (n, opts) { - var str = 'LRUCache {' - var extras = false - - var as = priv(this, 'allowStale') - if (as) { - str += '\n allowStale: true' - extras = true - } - - var max = priv(this, 'max') - if (max && max !== Infinity) { - if (extras) { - str += ',' - } - str += '\n max: ' + util.inspect(max, opts) - extras = true - } - - var maxAge = priv(this, 'maxAge') - if (maxAge) { - if (extras) { - str += ',' - } - str += '\n maxAge: ' + util.inspect(maxAge, opts) - extras = true - } - - var lc = priv(this, 'lengthCalculator') - if (lc && lc !== naiveLength) { - if (extras) { - str += ',' - } - str += '\n length: ' + util.inspect(priv(this, 'length'), opts) - extras = true - } - - var didFirst = false - priv(this, 'lruList').forEach(function (item) { - if (didFirst) { - str += ',\n ' - } else { - if (extras) { - str += ',\n' - } - didFirst = true - str += '\n ' - } - var key = util.inspect(item.key).split('\n').join('\n ') - var val = { value: item.value } - if (item.maxAge !== maxAge) { - val.maxAge = item.maxAge - } - if (lc !== naiveLength) { - val.length = item.length - } - if (isStale(this, item)) { - val.stale = true - } - - val = util.inspect(val, opts).split('\n').join('\n ') - str += key + ' => ' + val - }) - - if (didFirst || extras) { - str += '\n' - } - str += '}' - - return str -} - -LRUCache.prototype.set = function (key, value, maxAge) { - maxAge = maxAge || priv(this, 'maxAge') - - var now = maxAge ? Date.now() : 0 - var len = priv(this, 'lengthCalculator').call(this, value, key) - - if (priv(this, 'cache').has(key)) { - if (len > priv(this, 'max')) { - del(this, priv(this, 'cache').get(key)) - return false - } - - var node = priv(this, 'cache').get(key) - var item = node.value - - // dispose of the old one before overwriting - if (priv(this, 'dispose')) { - priv(this, 'dispose').call(this, key, item.value) - } - - item.now = now - item.maxAge = maxAge - item.value = value - priv(this, 'length', priv(this, 'length') + (len - item.length)) - item.length = len - this.get(key) - trim(this) - return true - } - - var hit = new Entry(key, value, len, now, maxAge) - - // oversized objects fall out of cache automatically. - if (hit.length > priv(this, 'max')) { - if (priv(this, 'dispose')) { - priv(this, 'dispose').call(this, key, value) - } - return false - } - - priv(this, 'length', priv(this, 'length') + hit.length) - priv(this, 'lruList').unshift(hit) - priv(this, 'cache').set(key, priv(this, 'lruList').head) - trim(this) - return true -} - -LRUCache.prototype.has = function (key) { - if (!priv(this, 'cache').has(key)) return false - var hit = priv(this, 'cache').get(key).value - if (isStale(this, hit)) { - return false - } - return true -} - -LRUCache.prototype.get = function (key) { - return get(this, key, true) -} - -LRUCache.prototype.peek = function (key) { - return get(this, key, false) -} - -LRUCache.prototype.pop = function () { - var node = priv(this, 'lruList').tail - if (!node) return null - del(this, node) - return node.value -} - -LRUCache.prototype.del = function (key) { - del(this, priv(this, 'cache').get(key)) -} - -LRUCache.prototype.load = function (arr) { - // reset the cache - this.reset() - - var now = Date.now() - // A previous serialized cache has the most recent items first - for (var l = arr.length - 1; l >= 0; l--) { - var hit = arr[l] - var expiresAt = hit.e || 0 - if (expiresAt === 0) { - // the item was created without expiration in a non aged cache - this.set(hit.k, hit.v) - } else { - var maxAge = expiresAt - now - // dont add already expired items - if (maxAge > 0) { - this.set(hit.k, hit.v, maxAge) - } - } - } -} - -LRUCache.prototype.prune = function () { - var self = this - priv(this, 'cache').forEach(function (value, key) { - get(self, key, false) - }) -} - -function get (self, key, doUse) { - var node = priv(self, 'cache').get(key) - if (node) { - var hit = node.value - if (isStale(self, hit)) { - del(self, node) - if (!priv(self, 'allowStale')) hit = undefined - } else { - if (doUse) { - priv(self, 'lruList').unshiftNode(node) - } - } - if (hit) hit = hit.value - } - return hit -} - -function isStale (self, hit) { - if (!hit || (!hit.maxAge && !priv(self, 'maxAge'))) { - return false - } - var stale = false - var diff = Date.now() - hit.now - if (hit.maxAge) { - stale = diff > hit.maxAge - } else { - stale = priv(self, 'maxAge') && (diff > priv(self, 'maxAge')) - } - return stale -} - -function trim (self) { - if (priv(self, 'length') > priv(self, 'max')) { - for (var walker = priv(self, 'lruList').tail; - priv(self, 'length') > priv(self, 'max') && walker !== null;) { - // We know that we're about to delete this one, and also - // what the next least recently used key will be, so just - // go ahead and set it now. - var prev = walker.prev - del(self, walker) - walker = prev - } - } -} - -function del (self, node) { - if (node) { - var hit = node.value - if (priv(self, 'dispose')) { - priv(self, 'dispose').call(this, hit.key, hit.value) - } - priv(self, 'length', priv(self, 'length') - hit.length) - priv(self, 'cache').delete(hit.key) - priv(self, 'lruList').removeNode(node) - } -} - -// classy, since V8 prefers predictable objects. -function Entry (key, value, length, now, maxAge) { - this.key = key - this.value = value - this.length = length - this.now = now - this.maxAge = maxAge || 0 -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md deleted file mode 100644 index 778bf01dfaaf9f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# pseudomap - -A thing that is a lot like ES6 `Map`, but without iterators, for use -in environments where `for..of` syntax and `Map` are not available. - -If you need iterators, or just in general a more faithful polyfill to -ES6 Maps, check out [es6-map](http://npm.im/es6-map). - -If you are in an environment where `Map` is supported, then that will -be returned instead, unless `process.env.TEST_PSEUDOMAP` is set. - -You can use any value as keys, and any value as data. Setting again -with the identical key will overwrite the previous value. - -Internally, data is stored on an `Object.create(null)` style object. -The key is coerced to a string to generate the key on the internal -data-bag object. The original key used is stored along with the data. - -In the event of a stringified-key collision, a new key is generated by -appending an increasing number to the stringified-key until finding -either the intended key or an empty spot. - -Note that because object traversal order of plain objects is not -guaranteed to be identical to insertion order, the insertion order -guarantee of `Map.prototype.forEach` is not guaranteed in this -implementation. However, in all versions of Node.js and V8 where this -module works, `forEach` does traverse data in insertion order. - -## API - -Most of the [Map -API](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map), -with the following exceptions: - -1. A `Map` object is not an iterator. -2. `values`, `keys`, and `entries` methods are not implemented, - because they return iterators. -3. The argument to the constructor can be an Array of `[key, value]` - pairs, or a `Map` or `PseudoMap` object. But, since iterators - aren't used, passing any plain-old iterator won't initialize the - map properly. - -## USAGE - -Use just like a regular ES6 Map. - -```javascript -var PseudoMap = require('pseudomap') - -// optionally provide a pseudomap, or an array of [key,value] pairs -// as the argument to initialize the map with -var myMap = new PseudoMap() - -myMap.set(1, 'number 1') -myMap.set('1', 'string 1') -var akey = {} -var bkey = {} -myMap.set(akey, { some: 'data' }) -myMap.set(bkey, { some: 'other data' }) -``` diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js deleted file mode 100644 index 7db15994612fd9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/map.js +++ /dev/null @@ -1,9 +0,0 @@ -if (process.env.npm_package_name === 'pseudomap' && - process.env.npm_lifecycle_script === 'test') - process.env.TEST_PSEUDOMAP = 'true' - -if (typeof Map === 'function' && !process.env.TEST_PSEUDOMAP) { - module.exports = Map -} else { - module.exports = require('./pseudomap') -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json deleted file mode 100644 index 8e1129b8d3bd5f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "pseudomap@^1.0.1", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" - ] - ], - "_from": "pseudomap@>=1.0.1 <2.0.0", - "_id": "pseudomap@1.0.2", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache/pseudomap", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "pseudomap", - "raw": "pseudomap@^1.0.1", - "rawSpec": "^1.0.1", - "scope": null, - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "_shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "_shrinkwrap": null, - "_spec": "pseudomap@^1.0.1", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/pseudomap/issues" - }, - "dependencies": {}, - "description": "A thing that is a lot like ES6 `Map`, but without iterators, for use in environments where `for..of` syntax and `Map` are not available.", - "devDependencies": { - "tap": "^2.3.1" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "f052a28da70e618917ef0a8ac34c1ae5a68286b3", - "tarball": "http://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz" - }, - "gitHead": "b6dc728207a0321ede6479e34506d3e0e13a940b", - "homepage": "https://github.com/isaacs/pseudomap#readme", - "license": "ISC", - "main": "map.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "pseudomap", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/pseudomap.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.2" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js deleted file mode 100644 index 25a21d829e8b3f..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/pseudomap.js +++ /dev/null @@ -1,113 +0,0 @@ -var hasOwnProperty = Object.prototype.hasOwnProperty - -module.exports = PseudoMap - -function PseudoMap (set) { - if (!(this instanceof PseudoMap)) // whyyyyyyy - throw new TypeError("Constructor PseudoMap requires 'new'") - - this.clear() - - if (set) { - if ((set instanceof PseudoMap) || - (typeof Map === 'function' && set instanceof Map)) - set.forEach(function (value, key) { - this.set(key, value) - }, this) - else if (Array.isArray(set)) - set.forEach(function (kv) { - this.set(kv[0], kv[1]) - }, this) - else - throw new TypeError('invalid argument') - } -} - -PseudoMap.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - Object.keys(this._data).forEach(function (k) { - if (k !== 'size') - fn.call(thisp, this._data[k].value, this._data[k].key) - }, this) -} - -PseudoMap.prototype.has = function (k) { - return !!find(this._data, k) -} - -PseudoMap.prototype.get = function (k) { - var res = find(this._data, k) - return res && res.value -} - -PseudoMap.prototype.set = function (k, v) { - set(this._data, k, v) -} - -PseudoMap.prototype.delete = function (k) { - var res = find(this._data, k) - if (res) { - delete this._data[res._index] - this._data.size-- - } -} - -PseudoMap.prototype.clear = function () { - var data = Object.create(null) - data.size = 0 - - Object.defineProperty(this, '_data', { - value: data, - enumerable: false, - configurable: true, - writable: false - }) -} - -Object.defineProperty(PseudoMap.prototype, 'size', { - get: function () { - return this._data.size - }, - set: function (n) {}, - enumerable: true, - configurable: true -}) - -PseudoMap.prototype.values = -PseudoMap.prototype.keys = -PseudoMap.prototype.entries = function () { - throw new Error('iterators are not implemented in this version') -} - -// Either identical, or both NaN -function same (a, b) { - return a === b || a !== a && b !== b -} - -function Entry (k, v, i) { - this.key = k - this.value = v - this._index = i -} - -function find (data, k) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) - return data[key] - } -} - -function set (data, k, v) { - for (var i = 0, s = '_' + k, key = s; - hasOwnProperty.call(data, key); - key = s + i++) { - if (same(data[key].key, k)) { - data[key].value = v - return - } - } - data.size++ - data[key] = new Entry(k, v, key) -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js deleted file mode 100644 index 4378e4541e9a14..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/pseudomap/test/basic.js +++ /dev/null @@ -1,86 +0,0 @@ -var t = require('tap') - -process.env.TEST_PSEUDOMAP = 'true' - -var PM = require('../') -runTests(PM) - -// if possible, verify that Map also behaves the same way -if (typeof Map === 'function') - runTests(Map) - - -function runTests (Map) { - t.throws(Map) - - var m = new Map() - - t.equal(m.size, 0) - - m.set(1, '1 string') - t.equal(m.get(1), '1 string') - t.equal(m.size, 1) - m.size = 1000 - t.equal(m.size, 1) - m.size = 0 - t.equal(m.size, 1) - - m = new Map([[1, 'number 1'], ['1', 'string 1']]) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - m = new Map(m) - t.equal(m.get(1), 'number 1') - t.equal(m.get('1'), 'string 1') - t.equal(m.size, 2) - - var akey = {} - var bkey = {} - m.set(akey, { some: 'data' }) - m.set(bkey, { some: 'other data' }) - t.same(m.get(akey), { some: 'data' }) - t.same(m.get(bkey), { some: 'other data' }) - t.equal(m.size, 4) - - var x = /x/ - var y = /x/ - m.set(x, 'x regex') - m.set(y, 'y regex') - t.equal(m.get(x), 'x regex') - m.set(x, 'x again') - t.equal(m.get(x), 'x again') - t.equal(m.size, 6) - - m.set(NaN, 'not a number') - t.equal(m.get(NaN), 'not a number') - m.set(NaN, 'it is a ' + typeof NaN) - t.equal(m.get(NaN), 'it is a number') - m.set('NaN', 'stringie nan') - t.equal(m.get(NaN), 'it is a number') - t.equal(m.get('NaN'), 'stringie nan') - t.equal(m.size, 8) - - m.delete(NaN) - t.equal(m.get(NaN), undefined) - t.equal(m.size, 7) - - var expect = [ - { value: 'number 1', key: 1 }, - { value: 'string 1', key: '1' }, - { value: { some: 'data' }, key: {} }, - { value: { some: 'other data' }, key: {} }, - { value: 'x again', key: /x/ }, - { value: 'y regex', key: /x/ }, - { value: 'stringie nan', key: 'NaN' } - ] - var actual = [] - - m.forEach(function (value, key) { - actual.push({ value: value, key: key }) - }) - t.same(actual, expect) - - m.clear() - t.equal(m.size, 0) -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore deleted file mode 100644 index 534108e3f481cf..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml deleted file mode 100644 index 9c1a7b6ccd2c9e..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -sudo: false -language: node_js -node_js: - - '0.10' - - '0.12' - - '4' - - '5' diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md deleted file mode 100644 index 5f51e6f1e53405..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/CONTRIBUTING.md +++ /dev/null @@ -1,4 +0,0 @@ -1. The whole API is public. No underscore-prefixed pretend-private - things or hidden Object.create magic mumbo jumbo here. Plain old - objects that are created from constructors. -2. 100% test coverage must be maintained. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE deleted file mode 100644 index 19129e315fe593..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md deleted file mode 100644 index f5861018696688..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/README.md +++ /dev/null @@ -1,204 +0,0 @@ -# yallist - -Yet Another Linked List - -There are many doubly-linked list implementations like it, but this -one is mine. - -For when an array would be too big, and a Map can't be iterated in -reverse order. - - -[![Build Status](https://travis-ci.org/isaacs/yallist.svg?branch=master)](https://travis-ci.org/isaacs/yallist) [![Coverage Status](https://coveralls.io/repos/isaacs/yallist/badge.svg?service=github)](https://coveralls.io/github/isaacs/yallist) - -## basic usage - -```javascript -var yallist = require('yallist') -var myList = yallist.create([1, 2, 3]) -myList.push('foo') -myList.unshift('bar') -// of course pop() and shift() are there, too -console.log(myList.toArray()) // ['bar', 1, 2, 3, 'foo'] -myList.forEach(function (k) { - // walk the list head to tail -}) -myList.forEachReverse(function (k, index, list) { - // walk the list tail to head -}) -var myDoubledList = myList.map(function (k) { - return k + k -}) -// now myDoubledList contains ['barbar', 2, 4, 6, 'foofoo'] -// mapReverse is also a thing -var myDoubledListReverse = myList.mapReverse(function (k) { - return k + k -}) // ['foofoo', 6, 4, 2, 'barbar'] - -var reduced = myList.reduce(function (set, entry) { - set += entry - return set -}, 'start') -console.log(reduced) // 'startfoo123bar' -``` - -## api - -The whole API is considered "public". - -Functions with the same name as an Array method work more or less the -same way. - -There's reverse versions of most things because that's the point. - -### Yallist - -Default export, the class that holds and manages a list. - -Call it with either a forEach-able (like an array) or a set of -arguments, to initialize the list. - -The Array-ish methods all act like you'd expect. No magic length, -though, so if you change that it won't automatically prune or add -empty spots. - -### Yallist.create(..) - -Alias for Yallist function. Some people like factories. - -#### yallist.head - -The first node in the list - -#### yallist.tail - -The last node in the list - -#### yallist.length - -The number of nodes in the list. (Change this at your peril. It is -not magic like Array length.) - -#### yallist.toArray() - -Convert the list to an array. - -#### yallist.forEach(fn, [thisp]) - -Call a function on each item in the list. - -#### yallist.forEachReverse(fn, [thisp]) - -Call a function on each item in the list, in reverse order. - -#### yallist.get(n) - -Get the data at position `n` in the list. If you use this a lot, -probably better off just using an Array. - -#### yallist.getReverse(n) - -Get the data at position `n`, counting from the tail. - -#### yallist.map(fn, thisp) - -Create a new Yallist with the result of calling the function on each -item. - -#### yallist.mapReverse(fn, thisp) - -Same as `map`, but in reverse. - -#### yallist.pop() - -Get the data from the list tail, and remove the tail from the list. - -#### yallist.push(item, ...) - -Insert one or more items to the tail of the list. - -#### yallist.reduce(fn, initialValue) - -Like Array.reduce. - -#### yallist.reduceReverse - -Like Array.reduce, but in reverse. - -#### yallist.reverse - -Reverse the list in place. - -#### yallist.shift() - -Get the data from the list head, and remove the head from the list. - -#### yallist.slice([from], [to]) - -Just like Array.slice, but returns a new Yallist. - -#### yallist.sliceReverse([from], [to]) - -Just like yallist.slice, but the result is returned in reverse. - -#### yallist.toArray() - -Create an array representation of the list. - -#### yallist.toArrayReverse() - -Create a reversed array representation of the list. - -#### yallist.unshift(item, ...) - -Insert one or more items to the head of the list. - -#### yallist.unshiftNode(node) - -Move a Node object to the front of the list. (That is, pull it out of -wherever it lives, and make it the new head.) - -If the node belongs to a different list, then that list will remove it -first. - -#### yallist.pushNode(node) - -Move a Node object to the end of the list. (That is, pull it out of -wherever it lives, and make it the new tail.) - -If the node belongs to a list already, then that list will remove it -first. - -#### yallist.removeNode(node) - -Remove a node from the list, preserving referential integrity of head -and tail and other nodes. - -Will throw an error if you try to have a list remove a node that -doesn't belong to it. - -### Yallist.Node - -The class that holds the data and is actually the list. - -Call with `var n = new Node(value, previousNode, nextNode)` - -Note that if you do direct operations on Nodes themselves, it's very -easy to get into weird states where the list is broken. Be careful :) - -#### node.next - -The next node in the list. - -#### node.prev - -The previous node in the list. - -#### node.value - -The data the node contains. - -#### node.list - -The list to which this node belongs. (Null if it does not belong to -any list.) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json deleted file mode 100644 index a1c290b52f3392..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/package.json +++ /dev/null @@ -1,77 +0,0 @@ -{ - "_args": [ - [ - "yallist@^2.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache" - ] - ], - "_from": "yallist@>=2.0.0 <3.0.0", - "_id": "yallist@2.0.0", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache/yallist", - "_nodeVersion": "4.0.0", - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.3.2", - "_phantomChildren": {}, - "_requested": { - "name": "yallist", - "raw": "yallist@^2.0.0", - "rawSpec": "^2.0.0", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4/lru-cache" - ], - "_resolved": "https://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz", - "_shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", - "_shrinkwrap": null, - "_spec": "yallist@^2.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter", - "url": "http://blog.izs.me/" - }, - "bugs": { - "url": "https://github.com/isaacs/yallist/issues" - }, - "dependencies": {}, - "description": "Yet Another Linked List", - "devDependencies": { - "tap": "^2.3.2" - }, - "directories": { - "test": "test" - }, - "dist": { - "shasum": "306c543835f09ee1a4cb23b7bce9ab341c91cdd4", - "tarball": "http://registry.npmjs.org/yallist/-/yallist-2.0.0.tgz" - }, - "gitHead": "702eaba87deefa9f8fc2f8e36cb225bc2141fdc3", - "homepage": "https://github.com/isaacs/yallist#readme", - "license": "ISC", - "main": "yallist.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "yallist", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/isaacs/yallist.git" - }, - "scripts": { - "test": "tap test/*.js --cov" - }, - "version": "2.0.0" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js deleted file mode 100644 index 3c8d1f48d904a2..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/test/basic.js +++ /dev/null @@ -1,188 +0,0 @@ -var t = require('tap') -var Yallist = require('../yallist.js') - -var y = new Yallist(1,2,3,4,5) -var z = new Yallist([1,2,3,4,5]) -t.similar(y, z, 'build from single list or args') - -function add10 (i) { - return i + 10 -} -t.similar(y.map(add10).toArray(), [11, 12, 13, 14, 15]) -t.similar(y.mapReverse(add10).toArray(), [15, 14, 13, 12, 11]) - -t.similar(y.map(add10).toArrayReverse(), [15, 14, 13, 12, 11]) -t.isa(Yallist(1,2,3), 'Yallist') -t.equal(y.push(6, 7, 8), 8) -t.similar(y.toArray(), [1, 2, 3, 4, 5, 6, 7, 8]) -y.pop() -y.shift() -y.unshift(100) - -var expect = [100, 2, 3, 4, 5, 6, 7] -var expectReverse = [ 7, 6, 5, 4, 3, 2, 100 ] - -t.similar(y.toArray(), expect) -t.equal(y.length, y.toArray().length) - -t.test(function forEach (t) { - t.plan(y.length * 2) - y.forEach(function (item, i, list) { - t.equal(item, expect[i]) - t.equal(list, y) - }) -}) - -t.test(function forEach (t) { - t.plan(y.length * 5) - var n = 0 - y.forEachReverse(function (item, i, list) { - t.equal(item, expectReverse[n]) - t.equal(item, expect[i]) - t.equal(item, y.get(i)) - t.equal(item, y.getReverse(n)) - n += 1 - t.equal(list, y) - }) -}) - -t.equal(y.getReverse(100), undefined) - -t.equal(y.get(9999), undefined) - - -function sum (a, b) { return a + b } -t.equal(y.reduce(sum), 127) -t.equal(y.reduce(sum, 100), 227) -t.equal(y.reduceReverse(sum), 127) -t.equal(y.reduceReverse(sum, 100), 227) - -t.equal(Yallist().pop(), undefined) -t.equal(Yallist().shift(), undefined) - -var x = Yallist() -x.unshift(1) -t.equal(x.length, 1) -t.similar(x.toArray(), [1]) - -// verify that y.toArray() returns an array and if we create a -// new Yallist from that array, we get a list matching -t.similar(Yallist(y.toArray()), y) -t.similar(Yallist.apply(null, y.toArray()), y) - -t.throws(function () { - new Yallist().reduce(function () {}) -}, {}, new TypeError('Reduce of empty list with no initial value')) -t.throws(function () { - new Yallist().reduceReverse(function () {}) -}, {}, new TypeError('Reduce of empty list with no initial value')) - -var z = y.reverse() -t.equal(z, y) -t.similar(y.toArray(), expectReverse) -y.reverse() -t.similar(y.toArray(), expect) - -var a = Yallist(1,2,3,4,5,6) -var cases = [ - [ [2, 4], [3, 4] ], - [ [2, -4], [] ], - [ [2, -2], [3, 4] ], - [ [1, -2], [2, 3, 4] ], - [ [-1, -2], [] ], - [ [-5, -2], [2, 3, 4] ], - [ [-99, 2], [1, 2] ], - [ [5, 99], [6] ], - [ [], [1,2,3,4,5,6] ] -] -t.test('slice', function (t) { - t.plan(cases.length) - cases.forEach(function (c) { - t.test(JSON.stringify(c), function (t) { - t.similar(a.slice.apply(a, c[0]), Yallist(c[1])) - t.similar([].slice.apply(a.toArray(), c[0]), c[1]) - t.end() - }) - }) -}) - -t.test('sliceReverse', function (t) { - t.plan(cases.length) - cases.forEach(function (c) { - var rev = c[1].slice().reverse() - t.test(JSON.stringify([c[0], rev]), function (t) { - t.similar(a.sliceReverse.apply(a, c[0]), Yallist(rev)) - t.similar([].slice.apply(a.toArray(), c[0]).reverse(), rev) - t.end() - }) - }) -}) - -var inserter = Yallist(1,2,3,4,5) -inserter.unshiftNode(inserter.head.next) -t.similar(inserter.toArray(), [2,1,3,4,5]) -inserter.unshiftNode(inserter.tail) -t.similar(inserter.toArray(), [5,2,1,3,4]) -inserter.unshiftNode(inserter.head) -t.similar(inserter.toArray(), [5,2,1,3,4]) - -var single = Yallist(1) -single.unshiftNode(single.head) -t.similar(single.toArray(), [1]) - -inserter = Yallist(1,2,3,4,5) -inserter.pushNode(inserter.tail.prev) -t.similar(inserter.toArray(), [1,2,3,5,4]) -inserter.pushNode(inserter.head) -t.similar(inserter.toArray(), [2,3,5,4,1]) -inserter.unshiftNode(inserter.head) -t.similar(inserter.toArray(), [2,3,5,4,1]) - -single = Yallist(1) -single.pushNode(single.tail) -t.similar(single.toArray(), [1]) - -var swiped = Yallist(9,8,7) -inserter.unshiftNode(swiped.head.next) -t.similar(inserter.toArray(), [8,2,3,5,4,1]) -t.similar(swiped.toArray(), [9,7]) - -swiped = Yallist(9,8,7) -inserter.pushNode(swiped.head.next) -t.similar(inserter.toArray(), [8,2,3,5,4,1,8]) -t.similar(swiped.toArray(), [9,7]) - -swiped.unshiftNode(Yallist.Node(99)) -t.similar(swiped.toArray(), [99,9,7]) -swiped.pushNode(Yallist.Node(66)) -t.similar(swiped.toArray(), [99,9,7,66]) - -var e = Yallist() -e.unshiftNode(Yallist.Node(1)) -t.same(e.toArray(), [1]) -e = Yallist() -e.pushNode(Yallist.Node(1)) -t.same(e.toArray(), [1]) - -// steal them back, don't break the lists -swiped.unshiftNode(inserter.head) -t.same(swiped, Yallist(8,99,9,7,66)) -t.same(inserter, Yallist(2,3,5,4,1,8)) -swiped.unshiftNode(inserter.tail) -t.same(inserter, Yallist(2,3,5,4,1)) -t.same(swiped, Yallist(8,8,99,9,7,66)) - - -t.throws(function remove_foreign_node () { - e.removeNode(swiped.head) -}, {}, new Error('removing node which does not belong to this list')) -t.throws(function remove_unlisted_node () { - e.removeNode(Yallist.Node('nope')) -}, {}, new Error('removing node which does not belong to this list')) - -e = Yallist(1,2) -e.removeNode(e.head) -t.same(e, Yallist(2)) -e = Yallist(1,2) -e.removeNode(e.tail) -t.same(e, Yallist(1)) diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js deleted file mode 100644 index fb60fc2878b438..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/node_modules/yallist/yallist.js +++ /dev/null @@ -1,360 +0,0 @@ -module.exports = Yallist - -Yallist.Node = Node -Yallist.create = Yallist - -function Yallist (list) { - var self = this - if (!(self instanceof Yallist)) { - self = new Yallist() - } - - self.tail = null - self.head = null - self.length = 0 - - if (list && typeof list.forEach === 'function') { - list.forEach(function (item) { - self.push(item) - }) - } else if (arguments.length > 0) { - for (var i = 0, l = arguments.length; i < l; i++) { - self.push(arguments[i]) - } - } - - return self -} - -Yallist.prototype.removeNode = function (node) { - if (node.list !== this) { - throw new Error('removing node which does not belong to this list') - } - - var next = node.next - var prev = node.prev - - if (next) { - next.prev = prev - } - - if (prev) { - prev.next = next - } - - if (node === this.head) { - this.head = next - } - if (node === this.tail) { - this.tail = prev - } - - node.list.length -- - node.next = null - node.prev = null - node.list = null -} - -Yallist.prototype.unshiftNode = function (node) { - if (node === this.head) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var head = this.head - node.list = this - node.next = head - if (head) { - head.prev = node - } - - this.head = node - if (!this.tail) { - this.tail = node - } - this.length ++ -} - -Yallist.prototype.pushNode = function (node) { - if (node === this.tail) { - return - } - - if (node.list) { - node.list.removeNode(node) - } - - var tail = this.tail - node.list = this - node.prev = tail - if (tail) { - tail.next = node - } - - this.tail = node - if (!this.head) { - this.head = node - } - this.length ++ -} - -Yallist.prototype.push = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - push(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.unshift = function () { - for (var i = 0, l = arguments.length; i < l; i++) { - unshift(this, arguments[i]) - } - return this.length -} - -Yallist.prototype.pop = function () { - if (!this.tail) - return undefined - - var res = this.tail.value - this.tail = this.tail.prev - this.tail.next = null - this.length -- - return res -} - -Yallist.prototype.shift = function () { - if (!this.head) - return undefined - - var res = this.head.value - this.head = this.head.next - this.head.prev = null - this.length -- - return res -} - -Yallist.prototype.forEach = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.head, i = 0; walker !== null; i++) { - fn.call(thisp, walker.value, i, this) - walker = walker.next - } -} - -Yallist.prototype.forEachReverse = function (fn, thisp) { - thisp = thisp || this - for (var walker = this.tail, i = this.length - 1; walker !== null; i--) { - fn.call(thisp, walker.value, i, this) - walker = walker.prev - } -} - -Yallist.prototype.get = function (n) { - for (var i = 0, walker = this.head; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.next - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.getReverse = function (n) { - for (var i = 0, walker = this.tail; walker !== null && i < n; i++) { - // abort out of the list early if we hit a cycle - walker = walker.prev - } - if (i === n && walker !== null) { - return walker.value - } -} - -Yallist.prototype.map = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.head; walker !== null; ) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.next - } - return res -} - -Yallist.prototype.mapReverse = function (fn, thisp) { - thisp = thisp || this - var res = new Yallist() - for (var walker = this.tail; walker !== null;) { - res.push(fn.call(thisp, walker.value, this)) - walker = walker.prev - } - return res -} - -Yallist.prototype.reduce = function (fn, initial) { - var acc - var walker = this.head - if (arguments.length > 1) { - acc = initial - } else if (this.head) { - walker = this.head.next - acc = this.head.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = 0; walker !== null; i++) { - acc = fn(acc, walker.value, i) - walker = walker.next - } - - return acc -} - -Yallist.prototype.reduceReverse = function (fn, initial) { - var acc - var walker = this.tail - if (arguments.length > 1) { - acc = initial - } else if (this.tail) { - walker = this.tail.prev - acc = this.tail.value - } else { - throw new TypeError('Reduce of empty list with no initial value') - } - - for (var i = this.length - 1; walker !== null; i--) { - acc = fn(acc, walker.value, i) - walker = walker.prev - } - - return acc -} - -Yallist.prototype.toArray = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.head; walker !== null; i++) { - arr[i] = walker.value - walker = walker.next - } - return arr -} - -Yallist.prototype.toArrayReverse = function () { - var arr = new Array(this.length) - for (var i = 0, walker = this.tail; walker !== null; i++) { - arr[i] = walker.value - walker = walker.prev - } - return arr -} - -Yallist.prototype.slice = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = 0, walker = this.head; walker !== null && i < from; i++) { - walker = walker.next - } - for (; walker !== null && i < to; i++, walker = walker.next) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.sliceReverse = function (from, to) { - to = to || this.length - if (to < 0) { - to += this.length - } - from = from || 0 - if (from < 0) { - from += this.length - } - var ret = new Yallist() - if (to < from || to < 0) { - return ret - } - if (from < 0) { - from = 0 - } - if (to > this.length) { - to = this.length - } - for (var i = this.length, walker = this.tail; walker !== null && i > to; i--) { - walker = walker.prev - } - for (; walker !== null && i > from; i--, walker = walker.prev) { - ret.push(walker.value) - } - return ret -} - -Yallist.prototype.reverse = function () { - var head = this.head - var tail = this.tail - for (var walker = head; walker !== null; walker = walker.prev) { - var p = walker.prev - walker.prev = walker.next - walker.next = p - } - this.head = tail - this.tail = head - return this -} - -function push (self, item) { - self.tail = new Node(item, self.tail, null, self) - if (!self.head) { - self.head = self.tail - } - self.length ++ -} - -function unshift (self, item) { - self.head = new Node(item, null, self.head, self) - if (!self.tail) { - self.tail = self.head - } - self.length ++ -} - -function Node (value, prev, next, list) { - if (!(this instanceof Node)) { - return new Node(value, prev, next, list) - } - - this.list = list - this.value = value - - if (prev) { - prev.next = this - this.prev = prev - } else { - this.prev = null - } - - if (next) { - next.prev = this - this.next = next - } else { - this.next = null - } -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json deleted file mode 100644 index fafc088e725c0c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json +++ /dev/null @@ -1,95 +0,0 @@ -{ - "_args": [ - [ - "lru-cache@^4.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4" - ] - ], - "_from": "lru-cache@>=4.0.0 <5.0.0", - "_id": "lru-cache@4.0.1", - "_inCache": true, - "_installable": true, - "_location": "/request/aws4/lru-cache", - "_nodeVersion": "5.6.0", - "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/lru-cache-4.0.1.tgz_1458667372415_0.8005518841091543" - }, - "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" - }, - "_npmVersion": "3.7.3", - "_phantomChildren": {}, - "_requested": { - "name": "lru-cache", - "raw": "lru-cache@^4.0.0", - "rawSpec": "^4.0.0", - "scope": null, - "spec": ">=4.0.0 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/aws4" - ], - "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz", - "_shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", - "_shrinkwrap": null, - "_spec": "lru-cache@^4.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/aws4", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter" - }, - "bugs": { - "url": "https://github.com/isaacs/node-lru-cache/issues" - }, - "dependencies": { - "pseudomap": "^1.0.1", - "yallist": "^2.0.0" - }, - "description": "A cache object that deletes the least-recently-used items.", - "devDependencies": { - "standard": "^5.4.1", - "tap": "^5.1.1" - }, - "directories": {}, - "dist": { - "shasum": "1343955edaf2e37d9b9e7ee7241e27c4b9fb72be", - "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-4.0.1.tgz" - }, - "files": [ - "lib/lru-cache.js" - ], - "gitHead": "6cd8c8a43cf56c585bdb696faae94f9836cb9e28", - "homepage": "https://github.com/isaacs/node-lru-cache#readme", - "keywords": [ - "mru", - "lru", - "cache" - ], - "license": "ISC", - "main": "lib/lru-cache.js", - "maintainers": [ - { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" - } - ], - "name": "lru-cache", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/isaacs/node-lru-cache.git" - }, - "scripts": { - "posttest": "standard test/*.js lib/*.js", - "test": "tap test --branches=100 --functions=100 --lines=100 --statements=100" - }, - "version": "4.0.1" -} diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json index 5e7ae9de2d0e92..7151d7aae931f2 100644 --- a/deps/npm/node_modules/request/node_modules/aws4/package.json +++ b/deps/npm/node_modules/request/node_modules/aws4/package.json @@ -1,53 +1,60 @@ { "_args": [ [ - "aws4@^1.2.1", + { + "raw": "aws4@^1.2.1", + "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", + "spec": ">=1.2.1 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "aws4@>=1.2.1 <2.0.0", - "_id": "aws4@1.3.2", + "_id": "aws4@1.4.1", "_inCache": true, "_installable": true, "_location": "/request/aws4", - "_nodeVersion": "4.3.1", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/aws4-1.3.2.tgz_1456871543899_0.13955276948399842" + "tmp": "tmp/aws4-1.4.1.tgz_1462643218465_0.6527479749638587" }, "_npmUser": { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" }, - "_npmVersion": "2.14.21", + "_npmVersion": "2.15.4", "_phantomChildren": {}, "_requested": { - "name": "aws4", "raw": "aws4@^1.2.1", - "rawSpec": "^1.2.1", "scope": null, + "escapedName": "aws4", + "name": "aws4", + "rawSpec": "^1.2.1", "spec": ">=1.2.1 <2.0.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz", - "_shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", + "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz", + "_shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", "_shrinkwrap": null, "_spec": "aws4@^1.2.1", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "michael.hart.au@gmail.com", "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", "url": "http://github.com/mhart" }, "bugs": { "url": "https://github.com/mhart/aws4/issues" }, - "dependencies": { - "lru-cache": "^4.0.0" - }, + "dependencies": {}, "description": "Signs and prepares requests using AWS Signature Version 4", "devDependencies": { "mocha": "^2.4.5", @@ -55,10 +62,10 @@ }, "directories": {}, "dist": { - "shasum": "d39e0bee412ced0e8ed94a23e314f313a95b9fd1", - "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.3.2.tgz" + "shasum": "fde7d5292466d230e5ee0f4e038d9dfaab08fc61", + "tarball": "https://registry.npmjs.org/aws4/-/aws4-1.4.1.tgz" }, - "gitHead": "e899db3aacbf2a034398f7dd483345dc793e8d72", + "gitHead": "f126d3ff80be1ddde0fc6b50bb51a7f199547e81", "homepage": "https://github.com/mhart/aws4#readme", "keywords": [ "amazon", @@ -116,8 +123,8 @@ "main": "aws4.js", "maintainers": [ { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" } ], "name": "aws4", @@ -130,5 +137,5 @@ "scripts": { "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list" }, - "version": "1.3.2" + "version": "1.4.1" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md index 1a67c48cd031b5..86b95a3bf6df4e 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/README.md @@ -21,7 +21,7 @@ Node-core, including [documentation](doc/stream.markdown). If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html). -As of version 2.0.0 **readable-stream** uses semantic versioning. +As of version 2.0.0 **readable-stream** uses semantic versioning. # Streams WG Team Members diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md index c141a99c26c638..83275f192e4077 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md @@ -56,3 +56,5 @@ simpler stream creation * add isPaused/isFlowing * add new docs section * move isPaused to that section + + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json index 1be49d90f5f82a..14b70d3d29b7d0 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "core-util-is@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "core-util-is@~1.0.0", + { + "raw": "core-util-is@~1.0.0", + "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/core-util-is", "_nodeVersion": "4.0.0", "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, "_npmVersion": "3.3.2", "_phantomChildren": {}, "_requested": { - "name": "core-util-is", "raw": "core-util-is@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "core-util-is", + "name": "core-util-is", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", "_shrinkwrap": null, "_spec": "core-util-is@~1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bugs": { @@ -51,7 +58,7 @@ "directories": {}, "dist": { "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7", - "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz" }, "gitHead": "a177da234df5638b363ddc15fa324619a38577c8", "homepage": "https://github.com/isaacs/core-util-is#readme", @@ -70,8 +77,8 @@ "main": "lib/util.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "core-util-is", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile index 0ecc29c402c243..787d56e1e982e4 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/Makefile @@ -3,3 +3,4 @@ test: @node_modules/.bin/tape test.js .PHONY: test + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json index b8f76c40e4102d..6510f4eef73f77 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "isarray@~1.0.0", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "isarray@~1.0.0", + { + "raw": "isarray@~1.0.0", + "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/isarray", "_nodeVersion": "5.1.0", "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "isarray", "raw": "isarray@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "isarray", + "name": "isarray", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "_shasum": "bb935d48582cba168c06834957a54a3e07124f11", "_shrinkwrap": null, "_spec": "isarray@~1.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "mail@juliangruber.com", "name": "Julian Gruber", + "email": "mail@juliangruber.com", "url": "http://juliangruber.com" }, "bugs": { @@ -51,7 +58,7 @@ "directories": {}, "dist": { "shasum": "bb935d48582cba168c06834957a54a3e07124f11", - "tarball": "http://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz" }, "gitHead": "2a23a281f369e9ae06394c0fb4d2381355a6ba33", "homepage": "https://github.com/juliangruber/isarray", @@ -64,8 +71,8 @@ "main": "index.js", "maintainers": [ { - "email": "julian@juliangruber.com", - "name": "juliangruber" + "name": "juliangruber", + "email": "julian@juliangruber.com" } ], "name": "isarray", @@ -79,6 +86,7 @@ "test": "tape test.js" }, "testling": { + "files": "test.js", "browsers": [ "ie/8..latest", "firefox/17..latest", @@ -91,8 +99,7 @@ "ipad/6.0..latest", "iphone/6.0..latest", "android-browser/4.2..latest" - ], - "files": "test.js" + ] }, "version": "1.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js index f7f7bcd19fec56..e0c3444d85d5c7 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/isarray/test.js @@ -17,3 +17,4 @@ test('is array', function(t){ t.end(); }); + diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js index 571c276783c779..a4f40f845faa65 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/index.js @@ -8,13 +8,36 @@ if (!process.version || module.exports = process.nextTick; } -function nextTick(fn) { - var args = new Array(arguments.length - 1); - var i = 0; - while (i < args.length) { - args[i++] = arguments[i]; +function nextTick(fn, arg1, arg2, arg3) { + if (typeof fn !== 'function') { + throw new TypeError('"callback" argument must be a function'); + } + var len = arguments.length; + var args, i; + switch (len) { + case 0: + case 1: + return process.nextTick(fn); + case 2: + return process.nextTick(function afterTickOne() { + fn.call(null, arg1); + }); + case 3: + return process.nextTick(function afterTickTwo() { + fn.call(null, arg1, arg2); + }); + case 4: + return process.nextTick(function afterTickThree() { + fn.call(null, arg1, arg2, arg3); + }); + default: + args = new Array(len - 1); + i = 0; + while (i < args.length) { + args[i++] = arguments[i]; + } + return process.nextTick(function afterTick() { + fn.apply(null, args); + }); } - process.nextTick(function afterTick() { - fn.apply(null, args); - }); } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json index bae43acf21c1ba..e100c0e08fbdd5 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json @@ -1,37 +1,48 @@ { "_args": [ [ - "process-nextick-args@~1.0.6", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "process-nextick-args@~1.0.6", + { + "raw": "process-nextick-args@~1.0.6", + "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", + "spec": ">=1.0.6 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], "_from": "process-nextick-args@>=1.0.6 <1.1.0", - "_id": "process-nextick-args@1.0.6", + "_id": "process-nextick-args@1.0.7", "_inCache": true, "_installable": true, "_location": "/request/bl/readable-stream/process-nextick-args", - "_nodeVersion": "4.1.1", + "_nodeVersion": "5.11.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/process-nextick-args-1.0.7.tgz_1462394251778_0.36989671061746776" + }, "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" }, - "_npmVersion": "2.14.4", + "_npmVersion": "3.8.6", "_phantomChildren": {}, "_requested": { - "name": "process-nextick-args", "raw": "process-nextick-args@~1.0.6", - "rawSpec": "~1.0.6", "scope": null, + "escapedName": "process-nextick-args", + "name": "process-nextick-args", + "rawSpec": "~1.0.6", "spec": ">=1.0.6 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz", + "_shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", "_shrinkwrap": null, "_spec": "process-nextick-args@~1.0.6", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", @@ -46,17 +57,17 @@ }, "directories": {}, "dist": { - "shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05", - "tarball": "http://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.6.tgz" + "shasum": "150e20b756590ad3f91093f25a4f2ad8bff30ba3", + "tarball": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-1.0.7.tgz" }, - "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78", + "gitHead": "5c00899ab01dd32f93ad4b5743da33da91404f39", "homepage": "https://github.com/calvinmetcalf/process-nextick-args", "license": "MIT", "main": "index.js", "maintainers": [ { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" } ], "name": "process-nextick-args", @@ -69,5 +80,5 @@ "scripts": { "test": "node test.js" }, - "version": "1.0.6" + "version": "1.0.7" } diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json index 977e5976d64923..a4cb8bc4a9d151 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "string_decoder@~0.10.x", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "string_decoder@~0.10.x", + { + "raw": "string_decoder@~0.10.x", + "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~0.10.x", + "spec": ">=0.10.0 <0.11.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -15,22 +19,25 @@ "_installable": true, "_location": "/request/bl/readable-stream/string_decoder", "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, "_npmVersion": "1.4.23", "_phantomChildren": {}, "_requested": { - "name": "string_decoder", "raw": "string_decoder@~0.10.x", - "rawSpec": "~0.10.x", "scope": null, + "escapedName": "string_decoder", + "name": "string_decoder", + "rawSpec": "~0.10.x", "spec": ">=0.10.0 <0.11.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", "_shrinkwrap": null, "_spec": "string_decoder@~0.10.x", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", @@ -45,7 +52,7 @@ "directories": {}, "dist": { "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94", - "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" + "tarball": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz" }, "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0", "homepage": "https://github.com/rvagg/string_decoder", @@ -59,12 +66,12 @@ "main": "index.js", "maintainers": [ { - "email": "mail@substack.net", - "name": "substack" + "name": "substack", + "email": "mail@substack.net" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" } ], "name": "string_decoder", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json index 63869c0e04c12b..14eb7c631cb4fc 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json @@ -1,11 +1,15 @@ { "_args": [ [ - "util-deprecate@~1.0.1", - "/Users/rebecca/code/npm/node_modules/readable-stream" - ], - [ - "util-deprecate@~1.0.1", + { + "raw": "util-deprecate@~1.0.1", + "scope": null, + "escapedName": "util-deprecate", + "name": "util-deprecate", + "rawSpec": "~1.0.1", + "spec": ">=1.0.1 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream" ] ], @@ -16,28 +20,31 @@ "_location": "/request/bl/readable-stream/util-deprecate", "_nodeVersion": "4.1.2", "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { - "name": "util-deprecate", "raw": "util-deprecate@~1.0.1", - "rawSpec": "~1.0.1", "scope": null, + "escapedName": "util-deprecate", + "name": "util-deprecate", + "rawSpec": "~1.0.1", "spec": ">=1.0.1 <1.1.0", "type": "range" }, "_requiredBy": [ "/request/bl/readable-stream" ], + "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", "_shrinkwrap": null, "_spec": "util-deprecate@~1.0.1", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/bl/node_modules/readable-stream", "author": { - "email": "nathan@tootallnate.net", "name": "Nathan Rajlich", + "email": "nathan@tootallnate.net", "url": "http://n8.io/" }, "browser": "browser.js", @@ -50,7 +57,7 @@ "directories": {}, "dist": { "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf", - "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz" }, "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4", "homepage": "https://github.com/TooTallNate/util-deprecate", @@ -65,8 +72,8 @@ "main": "node.js", "maintainers": [ { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" } ], "name": "util-deprecate", diff --git a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json index f818ebf1b62108..27ef41cb1c1743 100644 --- a/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "readable-stream@~2.0.5", + { + "raw": "readable-stream@~2.0.5", + "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~2.0.5", + "spec": ">=2.0.5 <2.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/bl" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/readable-stream-2.0.6.tgz_1457893507709_0.369257491780445" }, "_npmUser": { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" }, "_npmVersion": "3.6.0", "_phantomChildren": {}, "_requested": { - "name": "readable-stream", "raw": "readable-stream@~2.0.5", - "rawSpec": "~2.0.5", "scope": null, + "escapedName": "readable-stream", + "name": "readable-stream", + "rawSpec": "~2.0.5", "spec": ">=2.0.5 <2.1.0", "type": "range" }, @@ -73,20 +82,20 @@ "main": "readable.js", "maintainers": [ { - "email": "isaacs@npmjs.com", - "name": "isaacs" + "name": "isaacs", + "email": "isaacs@npmjs.com" }, { - "email": "nathan@tootallnate.net", - "name": "tootallnate" + "name": "tootallnate", + "email": "nathan@tootallnate.net" }, { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, { - "email": "calvin.metcalf@gmail.com", - "name": "cwmma" + "name": "cwmma", + "email": "calvin.metcalf@gmail.com" } ], "name": "readable-stream", diff --git a/deps/npm/node_modules/request/node_modules/bl/package.json b/deps/npm/node_modules/request/node_modules/bl/package.json index 09ebb7b7413344..47862b0b623691 100644 --- a/deps/npm/node_modules/request/node_modules/bl/package.json +++ b/deps/npm/node_modules/request/node_modules/bl/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "bl@~1.1.2", + { + "raw": "bl@~1.1.2", + "scope": null, + "escapedName": "bl", + "name": "bl", + "rawSpec": "~1.1.2", + "spec": ">=1.1.2 <1.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], @@ -16,16 +24,19 @@ "tmp": "tmp/bl-1.1.2.tgz_1455246621698_0.6300242957659066" }, "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" }, "_npmVersion": "3.3.12", - "_phantomChildren": {}, + "_phantomChildren": { + "inherits": "2.0.1" + }, "_requested": { - "name": "bl", "raw": "bl@~1.1.2", - "rawSpec": "~1.1.2", "scope": null, + "escapedName": "bl", + "name": "bl", + "rawSpec": "~1.1.2", "spec": ">=1.1.2 <1.2.0", "type": "range" }, @@ -71,8 +82,8 @@ "main": "bl.js", "maintainers": [ { - "email": "rod@vagg.org", - "name": "rvagg" + "name": "rvagg", + "email": "rod@vagg.org" } ], "name": "bl", diff --git a/deps/npm/node_modules/request/node_modules/caseless/package.json b/deps/npm/node_modules/request/node_modules/caseless/package.json index 2cd79ea01ab69b..7470678232df15 100644 --- a/deps/npm/node_modules/request/node_modules/caseless/package.json +++ b/deps/npm/node_modules/request/node_modules/caseless/package.json @@ -1,43 +1,73 @@ { - "name": "caseless", - "version": "0.11.0", - "description": "Caseless object set/get/has, very useful when working with HTTP headers.", - "main": "index.js", - "scripts": { - "test": "node test.js" + "_args": [ + [ + { + "raw": "caseless@~0.11.0", + "scope": null, + "escapedName": "caseless", + "name": "caseless", + "rawSpec": "~0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "caseless@>=0.11.0 <0.12.0", + "_id": "caseless@0.11.0", + "_inCache": true, + "_installable": true, + "_location": "/request/caseless", + "_nodeVersion": "1.8.1", + "_npmUser": { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mikeal/caseless.git" + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "caseless@~0.11.0", + "scope": null, + "escapedName": "caseless", + "name": "caseless", + "rawSpec": "~0.11.0", + "spec": ">=0.11.0 <0.12.0", + "type": "range" }, - "keywords": [ - "headers", - "http", - "caseless" + "_requiredBy": [ + "/request" ], - "test": "node test.js", + "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", + "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "_shrinkwrap": null, + "_spec": "caseless@~0.11.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com" }, - "license": "Apache-2.0", "bugs": { "url": "https://github.com/mikeal/caseless/issues" }, + "dependencies": {}, + "description": "Caseless object set/get/has, very useful when working with HTTP headers.", "devDependencies": { "tape": "^2.10.2" }, + "directories": {}, + "dist": { + "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", + "tarball": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + }, "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5", "homepage": "https://github.com/mikeal/caseless#readme", - "_id": "caseless@0.11.0", - "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "_from": "caseless@>=0.11.0 <0.12.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.8.1", - "_npmUser": { - "name": "mikeal", - "email": "mikeal.rogers@gmail.com" - }, + "keywords": [ + "headers", + "http", + "caseless" + ], + "license": "Apache-2.0", + "main": "index.js", "maintainers": [ { "name": "mikeal", @@ -52,11 +82,16 @@ "email": "simeonvelichkov@gmail.com" } ], - "dist": { - "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7", - "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz" + "name": "caseless", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mikeal/caseless.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test.js" + }, + "test": "node test.js", + "version": "0.11.0" } diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile index 2d7580746d0b84..b4ff85a33b6eb4 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/Makefile @@ -4,3 +4,4 @@ test: @./test/run.js .PHONY: test + diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json index 8ac66b814c8162..cec42698168d6d 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json @@ -1,53 +1,79 @@ { + "_args": [ + [ + { + "raw": "delayed-stream@~1.0.0", + "scope": null, + "escapedName": "delayed-stream", + "name": "delayed-stream", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/combined-stream" + ] + ], + "_from": "delayed-stream@>=1.0.0 <1.1.0", + "_id": "delayed-stream@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/combined-stream/delayed-stream", + "_nodeVersion": "1.6.4", + "_npmUser": { + "name": "apechimp", + "email": "apeherder@gmail.com" + }, + "_npmVersion": "2.8.3", + "_phantomChildren": {}, + "_requested": { + "raw": "delayed-stream@~1.0.0", + "scope": null, + "escapedName": "delayed-stream", + "name": "delayed-stream", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request/combined-stream" + ], + "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", + "_shrinkwrap": null, + "_spec": "delayed-stream@~1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/combined-stream", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, + "bugs": { + "url": "https://github.com/felixge/node-delayed-stream/issues" + }, "contributors": [ { "name": "Mike Atkins", "email": "apeherder@gmail.com" } ], - "name": "delayed-stream", - "description": "Buffers events from a stream until you are ready to handle them.", - "license": "MIT", - "version": "1.0.0", - "homepage": "https://github.com/felixge/node-delayed-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-delayed-stream.git" - }, - "main": "./lib/delayed_stream", - "engines": { - "node": ">=0.4.0" - }, - "scripts": { - "test": "make test" - }, "dependencies": {}, + "description": "Buffers events from a stream until you are ready to handle them.", "devDependencies": { "fake": "0.2.0", "far": "0.0.1" }, - "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", - "bugs": { - "url": "https://github.com/felixge/node-delayed-stream/issues" - }, - "_id": "delayed-stream@1.0.0", - "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", - "_from": "delayed-stream@>=1.0.0 <1.1.0", - "_npmVersion": "2.8.3", - "_nodeVersion": "1.6.4", - "_npmUser": { - "name": "apechimp", - "email": "apeherder@gmail.com" - }, + "directories": {}, "dist": { "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619", - "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz" }, + "engines": { + "node": ">=0.4.0" + }, + "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84", + "homepage": "https://github.com/felixge/node-delayed-stream", + "license": "MIT", + "main": "./lib/delayed_stream", "maintainers": [ { "name": "felixge", @@ -58,7 +84,15 @@ "email": "apeherder@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "delayed-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-delayed-stream.git" + }, + "scripts": { + "test": "make test" + }, + "version": "1.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/combined-stream/package.json b/deps/npm/node_modules/request/node_modules/combined-stream/package.json index e0cd160ff6dbe5..3dec78c0f97955 100644 --- a/deps/npm/node_modules/request/node_modules/combined-stream/package.json +++ b/deps/npm/node_modules/request/node_modules/combined-stream/package.json @@ -1,48 +1,75 @@ { + "_args": [ + [ + { + "raw": "combined-stream@~1.0.5", + "scope": null, + "escapedName": "combined-stream", + "name": "combined-stream", + "rawSpec": "~1.0.5", + "spec": ">=1.0.5 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "combined-stream@>=1.0.5 <1.1.0", + "_id": "combined-stream@1.0.5", + "_inCache": true, + "_installable": true, + "_location": "/request/combined-stream", + "_nodeVersion": "0.12.4", + "_npmUser": { + "name": "alexindigo", + "email": "iam@alexindigo.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "combined-stream@~1.0.5", + "scope": null, + "escapedName": "combined-stream", + "name": "combined-stream", + "rawSpec": "~1.0.5", + "spec": ">=1.0.5 <1.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request", + "/request/form-data" + ], + "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", + "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", + "_shrinkwrap": null, + "_spec": "combined-stream@~1.0.5", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Felix Geisendörfer", "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, - "name": "combined-stream", - "description": "A stream that emits multiple other streams one after another.", - "version": "1.0.5", - "homepage": "https://github.com/felixge/node-combined-stream", - "repository": { - "type": "git", - "url": "git://github.com/felixge/node-combined-stream.git" - }, - "main": "./lib/combined_stream", - "scripts": { - "test": "node test/run.js" - }, - "engines": { - "node": ">= 0.8" + "bugs": { + "url": "https://github.com/felixge/node-combined-stream/issues" }, "dependencies": { "delayed-stream": "~1.0.0" }, + "description": "A stream that emits multiple other streams one after another.", "devDependencies": { "far": "~0.0.7" }, - "license": "MIT", - "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", - "bugs": { - "url": "https://github.com/felixge/node-combined-stream/issues" - }, - "_id": "combined-stream@1.0.5", - "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "_from": "combined-stream@>=1.0.5 <1.1.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.12.4", - "_npmUser": { - "name": "alexindigo", - "email": "iam@alexindigo.com" - }, + "directories": {}, "dist": { "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009", - "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + "tarball": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz" + }, + "engines": { + "node": ">= 0.8" }, + "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7", + "homepage": "https://github.com/felixge/node-combined-stream", + "license": "MIT", + "main": "./lib/combined_stream", "maintainers": [ { "name": "felixge", @@ -61,7 +88,15 @@ "email": "apeherder@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz", - "readme": "ERROR: No README data found!" + "name": "combined-stream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/felixge/node-combined-stream.git" + }, + "scripts": { + "test": "node test/run.js" + }, + "version": "1.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/extend/.jscs.json b/deps/npm/node_modules/request/node_modules/extend/.jscs.json index 59faa8bd9f6c60..7e84b282bb1763 100644 --- a/deps/npm/node_modules/request/node_modules/extend/.jscs.json +++ b/deps/npm/node_modules/request/node_modules/extend/.jscs.json @@ -101,3 +101,4 @@ "requirePaddingNewLinesAfterUseStrict": true } + diff --git a/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md index 2874d2ecda1861..ee0cfd6adb5a2e 100644 --- a/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/extend/CHANGELOG.md @@ -66,3 +66,4 @@ 1.0.0 / 2012-04-08 ================== * Initial commit + diff --git a/deps/npm/node_modules/request/node_modules/extend/LICENSE b/deps/npm/node_modules/request/node_modules/extend/LICENSE index 92d41503d32ec1..e16d6a56ca64e2 100644 --- a/deps/npm/node_modules/request/node_modules/extend/LICENSE +++ b/deps/npm/node_modules/request/node_modules/extend/LICENSE @@ -20,3 +20,4 @@ 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/deps/npm/node_modules/request/node_modules/extend/README.md b/deps/npm/node_modules/request/node_modules/extend/README.md index 3a47b21880fa94..632fb0f96fd347 100644 --- a/deps/npm/node_modules/request/node_modules/extend/README.md +++ b/deps/npm/node_modules/request/node_modules/extend/README.md @@ -59,3 +59,4 @@ Ported to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jon [deps-url]: https://david-dm.org/justmoon/node-extend [dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg [dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies + diff --git a/deps/npm/node_modules/request/node_modules/extend/component.json b/deps/npm/node_modules/request/node_modules/extend/component.json index 0f76b59305b7bc..1500a2f3718182 100644 --- a/deps/npm/node_modules/request/node_modules/extend/component.json +++ b/deps/npm/node_modules/request/node_modules/extend/component.json @@ -29,3 +29,4 @@ "jscs": "~1.6.2" } } + diff --git a/deps/npm/node_modules/request/node_modules/extend/index.js b/deps/npm/node_modules/request/node_modules/extend/index.js index 2f957482eef381..f5ec75d52f5f61 100644 --- a/deps/npm/node_modules/request/node_modules/extend/index.js +++ b/deps/npm/node_modules/request/node_modules/extend/index.js @@ -83,3 +83,4 @@ module.exports = function extend() { // Return the modified object return target; }; + diff --git a/deps/npm/node_modules/request/node_modules/extend/package.json b/deps/npm/node_modules/request/node_modules/extend/package.json index c8c7cac9967924..cbcd8ee4a8172d 100644 --- a/deps/npm/node_modules/request/node_modules/extend/package.json +++ b/deps/npm/node_modules/request/node_modules/extend/package.json @@ -1,20 +1,54 @@ { - "name": "extend", + "_args": [ + [ + { + "raw": "extend@~3.0.0", + "scope": null, + "escapedName": "extend", + "name": "extend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "extend@>=3.0.0 <3.1.0", + "_id": "extend@3.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/extend", + "_nodeVersion": "2.3.1", + "_npmUser": { + "name": "ljharb", + "email": "ljharb@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "extend@~3.0.0", + "scope": null, + "escapedName": "extend", + "name": "extend", + "rawSpec": "~3.0.0", + "spec": ">=3.0.0 <3.1.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", + "_shrinkwrap": null, + "_spec": "extend@~3.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Stefan Thomas", "email": "justmoon@members.fsf.org", "url": "http://www.justmoon.net" }, - "version": "3.0.0", - "description": "Port of jQuery.extend for node.js and the browser", - "main": "index", - "scripts": { - "test": "npm run lint && node test/index.js && npm run coverage-quiet", - "coverage": "covert test/index.js", - "coverage-quiet": "covert test/index.js --quiet", - "lint": "npm run jscs && npm run eslint", - "jscs": "jscs *.js */*.js", - "eslint": "eslint *.js */*.js" + "bugs": { + "url": "https://github.com/justmoon/node-extend/issues" }, "contributors": [ { @@ -22,41 +56,28 @@ "url": "https://github.com/ljharb" } ], - "keywords": [ - "extend", - "clone", - "merge" - ], - "repository": { - "type": "git", - "url": "git+https://github.com/justmoon/node-extend.git" - }, "dependencies": {}, + "description": "Port of jQuery.extend for node.js and the browser", "devDependencies": { - "tape": "^4.0.0", "covert": "^1.1.0", + "eslint": "^0.24.0", "jscs": "^1.13.1", - "eslint": "^0.24.0" - }, - "license": "MIT", - "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", - "bugs": { - "url": "https://github.com/justmoon/node-extend/issues" - }, - "homepage": "https://github.com/justmoon/node-extend#readme", - "_id": "extend@3.0.0", - "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "_from": "extend@>=3.0.0 <3.1.0", - "_npmVersion": "2.11.3", - "_nodeVersion": "2.3.1", - "_npmUser": { - "name": "ljharb", - "email": "ljharb@gmail.com" + "tape": "^4.0.0" }, + "directories": {}, "dist": { "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4", - "tarball": "http://registry.npmjs.org/extend/-/extend-3.0.0.tgz" + "tarball": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz" }, + "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d", + "homepage": "https://github.com/justmoon/node-extend#readme", + "keywords": [ + "extend", + "clone", + "merge" + ], + "license": "MIT", + "main": "index", "maintainers": [ { "name": "justmoon", @@ -67,7 +88,20 @@ "email": "ljharb@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "readme": "ERROR: No README data found!" + "name": "extend", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/justmoon/node-extend.git" + }, + "scripts": { + "coverage": "covert test/index.js", + "coverage-quiet": "covert test/index.js --quiet", + "eslint": "eslint *.js */*.js", + "jscs": "jscs *.js */*.js", + "lint": "npm run jscs && npm run eslint", + "test": "npm run lint && node test/index.js && npm run coverage-quiet" + }, + "version": "3.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/index.js b/deps/npm/node_modules/request/node_modules/forever-agent/index.js index d7276fd97391c6..416c7abd709233 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/forever-agent/index.js @@ -6,8 +6,8 @@ var util = require('util') , net = require('net') , tls = require('tls') , AgentSSL = require('https').Agent - -function getConnectionName(host, port) { + +function getConnectionName(host, port) { var name = '' if (typeof host === 'string') { name = host + ':' + port @@ -16,7 +16,7 @@ function getConnectionName(host, port) { name = host.host + ':' + host.port + ':' + (host.localAddress ? (host.localAddress + ':') : ':') } return name -} +} function ForeverAgent(options) { var self = this @@ -34,7 +34,7 @@ function ForeverAgent(options) { } else if (self.sockets[name].length < self.minSockets) { if (!self.freeSockets[name]) self.freeSockets[name] = [] self.freeSockets[name].push(socket) - + // if an error happens while we don't use the socket anyway, meh, throw the socket away var onIdleError = function() { socket.destroy() @@ -60,7 +60,7 @@ ForeverAgent.prototype.createConnection = net.createConnection ForeverAgent.prototype.addRequestNoreuse = Agent.prototype.addRequest ForeverAgent.prototype.addRequest = function(req, host, port) { var name = getConnectionName(host, port) - + if (typeof host !== 'string') { var options = host port = options.port @@ -89,7 +89,7 @@ ForeverAgent.prototype.removeSocket = function(s, name, host, port) { delete this.sockets[name] delete this.requests[name] } - + if (this.freeSockets[name]) { var index = this.freeSockets[name].indexOf(s) if (index !== -1) { diff --git a/deps/npm/node_modules/request/node_modules/forever-agent/package.json b/deps/npm/node_modules/request/node_modules/forever-agent/package.json index 1d672c1c9a885e..58acb7700b6a5b 100644 --- a/deps/npm/node_modules/request/node_modules/forever-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/forever-agent/package.json @@ -1,31 +1,89 @@ { + "_args": [ + [ + { + "raw": "forever-agent@~0.6.1", + "scope": null, + "escapedName": "forever-agent", + "name": "forever-agent", + "rawSpec": "~0.6.1", + "spec": ">=0.6.1 <0.7.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "forever-agent@>=0.6.1 <0.7.0", + "_id": "forever-agent@0.6.1", + "_inCache": true, + "_installable": true, + "_location": "/request/forever-agent", + "_npmUser": { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + }, + "_npmVersion": "1.4.28", + "_phantomChildren": {}, + "_requested": { + "raw": "forever-agent@~0.6.1", + "scope": null, + "escapedName": "forever-agent", + "name": "forever-agent", + "rawSpec": "~0.6.1", + "spec": ">=0.6.1 <0.7.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "_shrinkwrap": null, + "_spec": "forever-agent@~0.6.1", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Mikeal Rogers", "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, - "name": "forever-agent", - "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", - "version": "0.6.1", - "license": "Apache-2.0", - "repository": { - "url": "git+https://github.com/mikeal/forever-agent.git" + "bugs": { + "url": "https://github.com/mikeal/forever-agent/issues" }, - "main": "index.js", "dependencies": {}, + "description": "HTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.", "devDependencies": {}, - "optionalDependencies": {}, + "directories": {}, + "dist": { + "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", + "tarball": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz" + }, "engines": { "node": "*" }, - "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/mikeal/forever-agent/issues" + "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d", + "homepage": "https://github.com/mikeal/forever-agent", + "license": "Apache-2.0", + "main": "index.js", + "maintainers": [ + { + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" + }, + { + "name": "nylen", + "email": "jnylen@gmail.com" + }, + { + "name": "simov", + "email": "simeonvelichkov@gmail.com" + } + ], + "name": "forever-agent", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "url": "git+https://github.com/mikeal/forever-agent.git" }, - "homepage": "https://github.com/mikeal/forever-agent#readme", - "_id": "forever-agent@0.6.1", - "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91", - "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "_from": "forever-agent@>=0.6.1 <0.7.0" + "scripts": {}, + "version": "0.6.1" } diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md index fcb2b2c0c90711..f15e08121b2ecb 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md @@ -80,7 +80,7 @@ Bug Fixes: Bug Fix: -- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) +- Small regression with synchronous iterator behavior in `eachSeries` with a 1-element array. Before 1.1.0, `eachSeries`'s callback was called on the same tick, which this patch restores. In 2.0.0, it will be called on the next tick. (#782) # v1.1.0 @@ -92,7 +92,7 @@ New Features: - Optimized `map`, `eachOf`, and `waterfall` families of functions - Passing a `null` or `undefined` array to `map`, `each`, `parallel` and families will be treated as an empty array (#667). - The callback is now optional for the composed results of `compose` and `seq`. (#618) -- Reduced file size by 4kb, (minified version by 1kb) +- Reduced file size by 4kb, (minified version by 1kb) - Added code coverage through `nyc` and `coveralls` (#768) Bug Fixes: diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md index 3a0f017719b309..316c40505c7ff3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md @@ -1448,7 +1448,7 @@ __Arguments__ * `opts` - Can be either an object with `times` and `interval` or a number. * `times` - The number of attempts to make before giving up. The default is `5`. * `interval` - The time to wait between retries, in milliseconds. The default is `0`. - * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. + * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`. * `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)` which must be called when finished, passing `err` (which can be `null`) and the `result` of the function's execution, and (2) a `results` object, containing the results of @@ -1466,14 +1466,14 @@ async.retry(3, apiMethod, function(err, result) { ``` ```js -// try calling apiMethod 3 times, waiting 200 ms between each retry +// try calling apiMethod 3 times, waiting 200 ms between each retry async.retry({times: 3, interval: 200}, apiMethod, function(err, result) { // do something with the result }); ``` ```js -// try calling apiMethod the default 5 times no delay between each retry +// try calling apiMethod the default 5 times no delay between each retry async.retry(apiMethod, function(err, result) { // do something with the result }); @@ -1792,7 +1792,7 @@ async.waterfall([ return db.model.create(contents); }), function (model, next) { - // `model` is the instantiated model object. + // `model` is the instantiated model object. // If there was an error, this function would be skipped. } ], callback) diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js index ee0a268e6d7932..31e7620fb6ffb3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js @@ -1090,7 +1090,7 @@ var memoized = _restParam(function memoized(args) { var callback = args.pop(); var key = hasher.apply(null, args); - if (has.call(memo, key)) { + if (has.call(memo, key)) { async.setImmediate(function () { callback.apply(null, memo[key]); }); diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js index ee0a268e6d7932..31e7620fb6ffb3 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js @@ -1090,7 +1090,7 @@ var memoized = _restParam(function memoized(args) { var callback = args.pop(); var key = hasher.apply(null, args); - if (has.call(memo, key)) { + if (has.call(memo, key)) { async.setImmediate(function () { callback.apply(null, memo[key]); }); diff --git a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json index 97921ec00b0378..88b1fa0c84661f 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "async@^1.4.0", + { + "raw": "async@^1.5.2", + "scope": null, + "escapedName": "async", + "name": "async", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/form-data" ] ], - "_from": "async@>=1.4.0 <2.0.0", + "_from": "async@>=1.5.2 <2.0.0", "_id": "async@1.5.2", "_inCache": true, "_installable": true, "_location": "/request/form-data/async", "_nodeVersion": "4.2.3", "_npmUser": { - "email": "alexander.early@gmail.com", - "name": "aearly" + "name": "aearly", + "email": "alexander.early@gmail.com" }, "_npmVersion": "3.5.2", "_phantomChildren": {}, "_requested": { - "name": "async", - "raw": "async@^1.4.0", - "rawSpec": "^1.4.0", + "raw": "async@^1.5.2", "scope": null, - "spec": ">=1.4.0 <2.0.0", + "escapedName": "async", + "name": "async", + "rawSpec": "^1.5.2", + "spec": ">=1.5.2 <2.0.0", "type": "range" }, "_requiredBy": [ @@ -31,7 +40,7 @@ "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a", "_shrinkwrap": null, - "_spec": "async@^1.4.0", + "_spec": "async@^1.5.2", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/form-data", "author": { "name": "Caolan McMahon" @@ -69,31 +78,31 @@ "directories": {}, "dist": { "shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a", - "tarball": "http://registry.npmjs.org/async/-/async-1.5.2.tgz" + "tarball": "https://registry.npmjs.org/async/-/async-1.5.2.tgz" }, "files": [ + "lib", "dist/async.js", - "dist/async.min.js", - "lib" + "dist/async.min.js" ], "gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c", "homepage": "https://github.com/caolan/async#readme", "jam": { - "categories": [ - "Utilities" - ], + "main": "lib/async.js", "include": [ - "LICENSE", + "lib/async.js", "README.md", - "lib/async.js" + "LICENSE" ], - "main": "lib/async.js" + "categories": [ + "Utilities" + ] }, "keywords": [ "async", "callback", - "module", - "utility" + "utility", + "module" ], "license": "MIT", "main": "lib/async.js", @@ -137,13 +146,13 @@ }, "version": "1.5.2", "volo": { + "main": "lib/async.js", "ignore": [ "**/.*", - "bower_components", "node_modules", + "bower_components", "test", "tests" - ], - "main": "lib/async.js" + ] } } diff --git a/deps/npm/node_modules/request/node_modules/form-data/package.json b/deps/npm/node_modules/request/node_modules/form-data/package.json index 8977f984e81a7e..5c4375edfe0207 100644 --- a/deps/npm/node_modules/request/node_modules/form-data/package.json +++ b/deps/npm/node_modules/request/node_modules/form-data/package.json @@ -1,11 +1,19 @@ { "_args": [ [ - "form-data@~1.0.0-rc3", + { + "raw": "form-data@~1.0.0-rc4", + "scope": null, + "escapedName": "form-data", + "name": "form-data", + "rawSpec": "~1.0.0-rc4", + "spec": ">=1.0.0-rc4 <1.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "form-data@>=1.0.0-rc3 <1.1.0", + "_from": "form-data@>=1.0.0-rc4 <1.1.0", "_id": "form-data@1.0.0-rc4", "_inCache": true, "_installable": true, @@ -16,17 +24,18 @@ "tmp": "tmp/form-data-1.0.0-rc4.tgz_1458059747097_0.14101114077493548" }, "_npmUser": { - "email": "iam@alexindigo.com", - "name": "alexindigo" + "name": "alexindigo", + "email": "iam@alexindigo.com" }, "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { - "name": "form-data", - "raw": "form-data@~1.0.0-rc3", - "rawSpec": "~1.0.0-rc3", + "raw": "form-data@~1.0.0-rc4", "scope": null, - "spec": ">=1.0.0-rc3 <1.1.0", + "escapedName": "form-data", + "name": "form-data", + "rawSpec": "~1.0.0-rc4", + "spec": ">=1.0.0-rc4 <1.1.0", "type": "range" }, "_requiredBy": [ @@ -35,11 +44,11 @@ "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc4.tgz", "_shasum": "05ac6bc22227b43e4461f488161554699d4f8b5e", "_shrinkwrap": null, - "_spec": "form-data@~1.0.0-rc3", + "_spec": "form-data@~1.0.0-rc4", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "felix@debuggable.com", "name": "Felix Geisendörfer", + "email": "felix@debuggable.com", "url": "http://debuggable.com/" }, "browser": "./lib/browser", @@ -79,28 +88,28 @@ "main": "./lib/form_data", "maintainers": [ { - "email": "felix@debuggable.com", - "name": "felixge" + "name": "felixge", + "email": "felix@debuggable.com" }, { - "email": "igor@buran.us", - "name": "idralyuk" + "name": "idralyuk", + "email": "igor@buran.us" }, { - "email": "iam@alexindigo.com", - "name": "alexindigo" + "name": "alexindigo", + "email": "iam@alexindigo.com" }, { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "dtyree77@gmail.com", - "name": "celer" + "name": "celer", + "email": "dtyree77@gmail.com" }, { - "email": "pierceydylan@gmail.com", - "name": "dylanpiercey" + "name": "dylanpiercey", + "email": "pierceydylan@gmail.com" } ], "name": "form-data", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json index 98f45803886225..cfca2b9295a374 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "ansi-styles@^2.2.1", + { + "raw": "ansi-styles@^2.2.1", + "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", + "spec": ">=2.2.1 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/ansi-styles-2.2.1.tgz_1459197317833_0.9694824463222176" }, "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, "_npmVersion": "3.8.3", "_phantomChildren": {}, "_requested": { - "name": "ansi-styles", "raw": "ansi-styles@^2.2.1", - "rawSpec": "^2.2.1", "scope": null, + "escapedName": "ansi-styles", + "name": "ansi-styles", + "rawSpec": "^2.2.1", "spec": ">=2.2.1 <3.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "ansi-styles@^2.2.1", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -88,8 +97,8 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" } ], "name": "ansi-styles", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json index 13999335413ffb..187d3126611a4d 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "escape-string-regexp@^1.0.2", + { + "raw": "escape-string-regexp@^1.0.2", + "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", + "spec": ">=1.0.2 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/escape-string-regexp-1.0.5.tgz_1456059312074_0.7245344955008477" }, "_npmUser": { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "name": "jbnicolai", + "email": "jappelman@xebia.com" }, "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { - "name": "escape-string-regexp", "raw": "escape-string-regexp@^1.0.2", - "rawSpec": "^1.0.2", "scope": null, + "escapedName": "escape-string-regexp", + "name": "escape-string-regexp", + "rawSpec": "^1.0.2", "spec": ">=1.0.2 <2.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "escape-string-regexp@^1.0.2", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { - "email": "sindresorhus@gmail.com", "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bugs": { @@ -54,7 +63,7 @@ "directories": {}, "dist": { "shasum": "1b61c0562190a8dff6ae3bb2cf0200ca130b86d4", - "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" + "tarball": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz" }, "engines": { "node": ">=0.8.0" @@ -79,12 +88,12 @@ "license": "MIT", "maintainers": [ { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, { - "email": "jappelman@xebia.com", - "name": "jbnicolai" + "name": "jbnicolai", + "email": "jappelman@xebia.com" } ], "name": "escape-string-regexp", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json index 15f623780f02e6..8ecf94571f78cf 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json @@ -1,38 +1,75 @@ { - "name": "has-ansi", - "version": "2.0.0", - "description": "Check if a string has ANSI escape codes", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/has-ansi.git" + "_args": [ + [ + { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" + ] + ], + "_from": "has-ansi@>=2.0.0 <3.0.0", + "_id": "has-ansi@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk/has-ansi", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "has-ansi@^2.0.0", + "scope": null, + "escapedName": "has-ansi", + "name": "has-ansi", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" }, + "_requiredBy": [ + "/request/har-validator/chalk" + ], + "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", + "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "_shrinkwrap": null, + "_spec": "has-ansi@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], + "bugs": { + "url": "https://github.com/sindresorhus/has-ansi/issues" + }, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "description": "Check if a string has ANSI escape codes", + "devDependencies": { + "ava": "0.0.4" + }, + "directories": {}, + "dist": { + "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", + "tarball": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz" + }, "engines": { "node": ">=0.10.0" }, - "scripts": { - "test": "node test.js" - }, "files": [ "index.js" ], + "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9", + "homepage": "https://github.com/sindresorhus/has-ansi", "keywords": [ "ansi", "styles", @@ -57,20 +94,26 @@ "pattern", "has" ], - "dependencies": { - "ansi-regex": "^2.0.0" - }, - "devDependencies": { - "ava": "0.0.4" + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "has-ansi", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/sindresorhus/has-ansi.git" }, - "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/sindresorhus/has-ansi/issues" + "scripts": { + "test": "node test.js" }, - "homepage": "https://github.com/sindresorhus/has-ansi#readme", - "_id": "has-ansi@2.0.0", - "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91", - "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz", - "_from": "has-ansi@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json index c43b7aa8c3a54f..cd92886ca2db99 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json @@ -1,38 +1,74 @@ { - "name": "supports-color", - "version": "2.0.0", - "description": "Detect whether a terminal supports color", - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/chalk/supports-color.git" + "_args": [ + [ + { + "raw": "supports-color@^2.0.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk" + ] + ], + "_from": "supports-color@>=2.0.0 <3.0.0", + "_id": "supports-color@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/chalk/supports-color", + "_nodeVersion": "0.12.5", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "_npmVersion": "2.11.2", + "_phantomChildren": {}, + "_requested": { + "raw": "supports-color@^2.0.0", + "scope": null, + "escapedName": "supports-color", + "name": "supports-color", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" }, + "_requiredBy": [ + "/request/har-validator/chalk" + ], + "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "_shrinkwrap": null, + "_spec": "supports-color@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/chalk", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, - "maintainers": [ - { - "name": "Sindre Sorhus", - "email": "sindresorhus@gmail.com", - "url": "sindresorhus.com" - }, - { - "name": "Joshua Appelman", - "email": "jappelman@xebia.com", - "url": "jbnicolai.com" - } - ], + "bugs": { + "url": "https://github.com/chalk/supports-color/issues" + }, + "dependencies": {}, + "description": "Detect whether a terminal supports color", + "devDependencies": { + "mocha": "*", + "require-uncached": "^1.0.2" + }, + "directories": {}, + "dist": { + "shasum": "535d045ce6b6363fa40117084629995e9df324c7", + "tarball": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz" + }, "engines": { "node": ">=0.8.0" }, - "scripts": { - "test": "mocha" - }, "files": [ "index.js" ], + "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588", + "homepage": "https://github.com/chalk/supports-color", "keywords": [ "color", "colour", @@ -53,18 +89,26 @@ "capability", "detect" ], - "devDependencies": { - "mocha": "*", - "require-uncached": "^1.0.2" + "license": "MIT", + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + { + "name": "jbnicolai", + "email": "jappelman@xebia.com" + } + ], + "name": "supports-color", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/chalk/supports-color.git" }, - "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n", - "readmeFilename": "readme.md", - "bugs": { - "url": "https://github.com/chalk/supports-color/issues" + "scripts": { + "test": "mocha" }, - "homepage": "https://github.com/chalk/supports-color#readme", - "_id": "supports-color@2.0.0", - "_shasum": "535d045ce6b6363fa40117084629995e9df324c7", - "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "_from": "supports-color@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json index cf2ae5bd38d3b4..a29160d3a292b1 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "chalk@^1.1.1", + { + "raw": "chalk@^1.1.1", + "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", + "spec": ">=1.1.1 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,18 +24,19 @@ "tmp": "tmp/chalk-1.1.3.tgz_1459210604109_0.3892582862172276" }, "_npmUser": { - "email": "i.am.qix@gmail.com", - "name": "qix" + "name": "qix", + "email": "i.am.qix@gmail.com" }, "_npmVersion": "2.14.2", "_phantomChildren": { "ansi-regex": "2.0.0" }, "_requested": { - "name": "chalk", "raw": "chalk@^1.1.1", - "rawSpec": "^1.1.1", "scope": null, + "escapedName": "chalk", + "name": "chalk", + "rawSpec": "^1.1.1", "spec": ">=1.1.1 <2.0.0", "type": "range" }, @@ -99,16 +108,16 @@ "license": "MIT", "maintainers": [ { - "email": "i.am.qix@gmail.com", - "name": "qix" + "name": "qix", + "email": "i.am.qix@gmail.com" }, { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" }, { - "email": "sindresorhus+unicorn@gmail.com", - "name": "unicorn" + "name": "unicorn", + "email": "sindresorhus+unicorn@gmail.com" } ], "name": "chalk", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md index 60eb67599e5288..08b9e4cb94ab58 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/Readme.md @@ -6,7 +6,7 @@ [![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander) [![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) - The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander). + The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander). [API documentation](http://tj.github.com/commander.js/) @@ -95,7 +95,7 @@ program .option('-s --size ', 'Pizza size', /^(large|medium|small)$/i, 'medium') .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i) .parse(process.argv); - + console.log(' size: %j', program.size); console.log(' drink: %j', program.drink); ``` @@ -171,7 +171,7 @@ program .parse(process.argv); ``` -When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. +When `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools. The commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`. Options can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified. @@ -188,7 +188,7 @@ You can enable `--harmony` option in two ways: The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free: -``` +``` $ ./examples/pizza --help Usage: pizza [options] @@ -348,3 +348,4 @@ More Demos can be found in the [examples](https://github.com/tj/commander.js/tre ## License MIT + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js index 8ed463c34ab385..a19c05d2e3dd91 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/index.js @@ -1107,3 +1107,4 @@ function exists(file) { return false; } } + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE index 50d1e5c666c05b..d1f842f0bb2722 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/LICENSE @@ -19,3 +19,4 @@ 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/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js index c4a79d1afad211..7e9fc70f0ac251 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/index.js @@ -8,3 +8,5 @@ exports.readlinkSync = function (p) { return p; } }; + + diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json index 64d7d644dbcb59..19f11158e6b99a 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json @@ -1,31 +1,84 @@ { - "name": "graceful-readlink", - "version": "1.0.1", - "description": "graceful fs.readlink", - "main": "index.js", - "repository": { - "type": "git", - "url": "git://github.com/zhiyelee/graceful-readlink.git" + "_args": [ + [ + { + "raw": "graceful-readlink@>= 1.0.0", + "scope": null, + "escapedName": "graceful-readlink", + "name": "graceful-readlink", + "rawSpec": ">= 1.0.0", + "spec": ">=1.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/commander" + ] + ], + "_from": "graceful-readlink@>=1.0.0", + "_id": "graceful-readlink@1.0.1", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/commander/graceful-readlink", + "_nodeVersion": "0.11.14", + "_npmUser": { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + }, + "_npmVersion": "2.1.17", + "_phantomChildren": {}, + "_requested": { + "raw": "graceful-readlink@>= 1.0.0", + "scope": null, + "escapedName": "graceful-readlink", + "name": "graceful-readlink", + "rawSpec": ">= 1.0.0", + "spec": ">=1.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/commander" + ], + "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", + "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", + "_shrinkwrap": null, + "_spec": "graceful-readlink@>= 1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/commander", + "author": { + "name": "zhiyelee" }, - "homepage": "https://github.com/zhiyelee/graceful-readlink", "bugs": { "url": "https://github.com/zhiyelee/graceful-readlink/issues" }, + "dependencies": {}, + "description": "graceful fs.readlink", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", + "tarball": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz" + }, + "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5", + "homepage": "https://github.com/zhiyelee/graceful-readlink", "keywords": [ "fs.readlink", "readlink" ], - "author": { - "name": "zhiyelee" - }, "license": "MIT", + "main": "index.js", + "maintainers": [ + { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + } + ], + "name": "graceful-readlink", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/zhiyelee/graceful-readlink.git" + }, "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, - "readme": "# graceful-readlink\n[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n\n\n## Usage\n\n```js\nvar readlinkSync = require('graceful-readlink').readlinkSync;\nconsole.log(readlinkSync(f));\n// output\n// the file pointed to when `f` is a symbolic link\n// the `f` itself when `f` is not a symbolic link\n```\n## Licence\n\nMIT License\n", - "readmeFilename": "README.md", - "_id": "graceful-readlink@1.0.1", - "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725", - "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "_from": "graceful-readlink@>=1.0.0" + "version": "1.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json index ccc77e036e4994..591bfdf33de61a 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json @@ -1,56 +1,82 @@ { - "name": "commander", - "version": "2.9.0", - "description": "the complete solution for node.js command-line programs", - "keywords": [ - "command", - "option", - "parser" + "_args": [ + [ + { + "raw": "commander@^2.9.0", + "scope": null, + "escapedName": "commander", + "name": "commander", + "rawSpec": "^2.9.0", + "spec": ">=2.9.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" + ] ], + "_from": "commander@>=2.9.0 <3.0.0", + "_id": "commander@2.9.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/commander", + "_nodeVersion": "0.12.7", + "_npmUser": { + "name": "zhiyelee", + "email": "zhiyelee@gmail.com" + }, + "_npmVersion": "2.11.3", + "_phantomChildren": {}, + "_requested": { + "raw": "commander@^2.9.0", + "scope": null, + "escapedName": "commander", + "name": "commander", + "rawSpec": "^2.9.0", + "spec": ">=2.9.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator" + ], + "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", + "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", + "_shrinkwrap": null, + "_spec": "commander@^2.9.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", "author": { "name": "TJ Holowaychuk", "email": "tj@vision-media.ca" }, - "license": "MIT", - "repository": { - "type": "git", - "url": "git+https://github.com/tj/commander.js.git" + "bugs": { + "url": "https://github.com/tj/commander.js/issues" + }, + "dependencies": { + "graceful-readlink": ">= 1.0.0" }, + "description": "the complete solution for node.js command-line programs", "devDependencies": { "should": ">= 0.0.1", "sinon": ">=1.17.1" }, - "scripts": { - "test": "make test" + "directories": {}, + "dist": { + "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", + "tarball": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz" }, - "main": "index", "engines": { "node": ">= 0.6.x" }, "files": [ "index.js" ], - "dependencies": { - "graceful-readlink": ">= 1.0.0" - }, "gitHead": "b2aad7a8471d434593a85306aa73777a526e9f75", - "bugs": { - "url": "https://github.com/tj/commander.js/issues" - }, "homepage": "https://github.com/tj/commander.js#readme", - "_id": "commander@2.9.0", - "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", - "_from": "commander@>=2.8.1 <3.0.0", - "_npmVersion": "2.11.3", - "_nodeVersion": "0.12.7", - "_npmUser": { - "name": "zhiyelee", - "email": "zhiyelee@gmail.com" - }, - "dist": { - "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4", - "tarball": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz" - }, + "keywords": [ + "command", + "option", + "parser" + ], + "license": "MIT", + "main": "index", "maintainers": [ { "name": "tjholowaychuk", @@ -65,7 +91,15 @@ "email": "zhiyelee@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "readme": "ERROR: No README data found!" + "name": "commander", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/tj/commander.js.git" + }, + "scripts": { + "test": "make test" + }, + "version": "2.9.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json index e2bc77284d01bc..329219aec9a943 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json @@ -1,15 +1,64 @@ { - "name": "generate-function", - "version": "2.0.0", + "_args": [ + [ + { + "raw": "generate-function@^2.0.0", + "scope": null, + "escapedName": "generate-function", + "name": "generate-function", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-function@>=2.0.0 <3.0.0", + "_id": "generate-function@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-function", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "generate-function@^2.0.0", + "scope": null, + "escapedName": "generate-function", + "name": "generate-function", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", + "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "_shrinkwrap": null, + "_spec": "generate-function@^2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-function/issues" + }, + "dependencies": {}, "description": "Module that helps you write generated functions in Node", - "main": "index.js", - "scripts": { - "test": "tape test.js" + "devDependencies": { + "tape": "^2.13.4" }, - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-function.git" + "directories": {}, + "dist": { + "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", + "tarball": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz" }, + "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149", + "homepage": "https://github.com/mafintosh/generate-function", "keywords": [ "generate", "code", @@ -17,21 +66,23 @@ "function", "performance" ], - "author": { - "name": "Mathias Buus" - }, "license": "MIT", - "bugs": { - "url": "https://github.com/mafintosh/generate-function/issues" + "main": "index.js", + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-function", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-function.git" }, - "homepage": "https://github.com/mafintosh/generate-function", - "devDependencies": { - "tape": "^2.13.4" + "scripts": { + "test": "tape test.js" }, - "readme": "# generate-function\n\nModule that helps you write generated functions in Node\n\n```\nnpm install generate-function\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)\n\n## Disclamer\n\nWriting code that generates code is hard.\nYou should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).\n\n## Usage\n\n``` js\nvar genfun = require('generate-function')\n\nvar addNumber = function(val) {\n var fn = genfun()\n ('function add(n) {')\n ('return n + %d', val) // supports format strings to insert values\n ('}')\n\n return fn.toFunction() // will compile the function\n}\n\nvar add2 = addNumber(2)\n\nconsole.log('1+2=', add2(1))\nconsole.log(add2.toString()) // prints the generated function\n```\n\nIf you need to close over variables in your generated function pass them to `toFunction(scope)`\n\n``` js\nvar multiply = function(a, b) {\n return a * b\n}\n\nvar addAndMultiplyNumber = function(val) {\n var fn = genfun()\n ('function(n) {')\n ('if (typeof n !== \"number\") {') // ending a line with { will indent the source\n ('throw new Error(\"argument should be a number\")')\n ('}')\n ('var result = multiply(%d, n+%d)', val, val)\n ('return result')\n ('}')\n\n // use fn.toString() if you want to see the generated source\n\n return fn.toFunction({\n multiply: multiply\n })\n}\n\nvar addAndMultiply2 = addAndMultiplyNumber(2)\n\nconsole.log('(3 + 2) * 2 =', addAndMultiply2(3))\n```\n\n## Related\n\nSee [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that\ncan be used to reference an object property\n\n## License\n\nMIT", - "readmeFilename": "README.md", - "_id": "generate-function@2.0.0", - "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74", - "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz", - "_from": "generate-function@>=2.0.0 <3.0.0" + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md index 9846a8bb9fc51b..ef1d00b62f8022 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/README.md @@ -16,7 +16,7 @@ Install ------- npm install is-property - + ### `require("is-property")(str)` Checks if str is a property diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json index 41225e266e4c80..13c59a3483c979 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json @@ -1,22 +1,67 @@ { - "name": "is-property", - "version": "1.0.2", - "description": "Tests if a JSON property can be accessed using . syntax", - "main": "is-property.js", - "directories": { - "test": "test" + "_args": [ + [ + { + "raw": "is-property@^1.0.0", + "scope": null, + "escapedName": "is-property", + "name": "is-property", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property" + ] + ], + "_from": "is-property@>=1.0.0 <2.0.0", + "_id": "is-property@1.0.2", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-object-property/is-property", + "_nodeVersion": "0.10.26", + "_npmUser": { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + }, + "_npmVersion": "2.1.4", + "_phantomChildren": {}, + "_requested": { + "raw": "is-property@^1.0.0", + "scope": null, + "escapedName": "is-property", + "name": "is-property", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid/generate-object-property" + ], + "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", + "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "_shrinkwrap": null, + "_spec": "is-property@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property", + "author": { + "name": "Mikola Lysenko" + }, + "bugs": { + "url": "https://github.com/mikolalysenko/is-property/issues" }, "dependencies": {}, + "description": "Tests if a JSON property can be accessed using . syntax", "devDependencies": { "tape": "~1.0.4" }, - "scripts": { - "test": "tap test/*.js" + "directories": { + "test": "test" }, - "repository": { - "type": "git", - "url": "git://github.com/mikolalysenko/is-property.git" + "dist": { + "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", + "tarball": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz" }, + "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", + "homepage": "https://github.com/mikolalysenko/is-property", "keywords": [ "is", "property", @@ -26,19 +71,23 @@ ".", "[]" ], - "author": { - "name": "Mikola Lysenko" - }, "license": "MIT", - "readmeFilename": "README.md", - "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50", - "bugs": { - "url": "https://github.com/mikolalysenko/is-property/issues" + "main": "is-property.js", + "maintainers": [ + { + "name": "mikolalysenko", + "email": "mikolalysenko@gmail.com" + } + ], + "name": "is-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/mikolalysenko/is-property.git" }, - "readme": "is-property\n===========\nTests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[\" ... \"])\n\nExample\n-------\n\n```javascript\nvar isProperty = require(\"is-property\")\n\nconsole.log(isProperty(\"foo\")) //Prints true\nconsole.log(isProperty(\"0\")) //Prints false\n```\n\nInstall\n-------\n\n npm install is-property\n \n### `require(\"is-property\")(str)`\nChecks if str is a property\n\n* `str` is a string which we will test if it is a property or not\n\n**Returns** true or false depending if str is a property\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License", - "homepage": "https://github.com/mikolalysenko/is-property#readme", - "_id": "is-property@1.0.2", - "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84", - "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz", - "_from": "is-property@>=1.0.0 <2.0.0" + "scripts": { + "test": "tap test/*.js" + }, + "version": "1.0.2" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json index 0d018abfa04521..ad1db2fc767506 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json @@ -1,34 +1,85 @@ { - "name": "generate-object-property", - "version": "1.2.0", - "description": "Generate safe JS code that can used to reference a object property", - "repository": { - "type": "git", - "url": "git+https://github.com/mafintosh/generate-object-property.git" + "_args": [ + [ + { + "raw": "generate-object-property@^1.1.0", + "scope": null, + "escapedName": "generate-object-property", + "name": "generate-object-property", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "generate-object-property@>=1.1.0 <2.0.0", + "_id": "generate-object-property@1.2.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/generate-object-property", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, - "devDependencies": { - "tape": "^2.13.0" + "_npmVersion": "2.9.0", + "_phantomChildren": {}, + "_requested": { + "raw": "generate-object-property@^1.1.0", + "scope": null, + "escapedName": "generate-object-property", + "name": "generate-object-property", + "rawSpec": "^1.1.0", + "spec": ">=1.1.0 <2.0.0", + "type": "range" }, - "scripts": { - "test": "tape test.js" + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" + ], + "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", + "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "_shrinkwrap": null, + "_spec": "generate-object-property@^1.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "author": { + "name": "Mathias Buus", + "url": "@mafintosh" + }, + "bugs": { + "url": "https://github.com/mafintosh/generate-object-property/issues" }, "dependencies": { "is-property": "^1.0.0" }, - "bugs": { - "url": "https://github.com/mafintosh/generate-object-property/issues" + "description": "Generate safe JS code that can used to reference a object property", + "devDependencies": { + "tape": "^2.13.0" }, + "directories": {}, + "dist": { + "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", + "tarball": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz" + }, + "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c", "homepage": "https://github.com/mafintosh/generate-object-property", + "license": "MIT", "main": "index.js", - "author": { - "name": "Mathias Buus", - "url": "@mafintosh" + "maintainers": [ + { + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" + } + ], + "name": "generate-object-property", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mafintosh/generate-object-property.git" }, - "license": "MIT", - "readme": "# generate-object-property\n\nGenerate safe JS code that can used to reference a object property\n\n\tnpm install generate-object-property\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)\n\n## Usage\n\n``` js\nvar gen = require('generate-object-property');\nconsole.log(gen('a','b')); // prints a.b\nconsole.log(gen('a', 'foo-bar')); // prints a[\"foo-bar\"]\n```\n\n## License\n\nMIT", - "readmeFilename": "README.md", - "_id": "generate-object-property@1.2.0", - "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0", - "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz", - "_from": "generate-object-property@>=1.1.0 <2.0.0" + "scripts": { + "test": "tape test.js" + }, + "version": "1.2.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json index 4b0677650bcd69..c90dcced7caae7 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json @@ -1,49 +1,75 @@ { - "name": "jsonpointer", - "description": "Simple JSON Addressing.", - "tags": [ - "util", - "simple", - "util", - "utility" + "_args": [ + [ + { + "raw": "jsonpointer@2.0.0", + "scope": null, + "escapedName": "jsonpointer", + "name": "jsonpointer", + "rawSpec": "2.0.0", + "spec": "2.0.0", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + ] + ], + "_from": "jsonpointer@2.0.0", + "_id": "jsonpointer@2.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/har-validator/is-my-json-valid/jsonpointer", + "_nodeVersion": "0.10.36", + "_npmUser": { + "name": "marcbachmann", + "email": "marc.brookman@gmail.com" + }, + "_npmVersion": "2.10.1", + "_phantomChildren": {}, + "_requested": { + "raw": "jsonpointer@2.0.0", + "scope": null, + "escapedName": "jsonpointer", + "name": "jsonpointer", + "rawSpec": "2.0.0", + "spec": "2.0.0", + "type": "version" + }, + "_requiredBy": [ + "/request/har-validator/is-my-json-valid" ], - "version": "2.0.0", + "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", + "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "_shrinkwrap": null, + "_spec": "jsonpointer@2.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", "author": { "name": "Jan Lehnardt", "email": "jan@apache.org" }, + "bugs": { + "url": "http://github.com/janl/node-jsonpointer/issues" + }, "contributors": [ { "name": "Joe Hildebrand", "email": "joe-github@cursive.net" } ], - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" - }, - "bugs": { - "url": "http://github.com/janl/node-jsonpointer/issues" + "dependencies": {}, + "description": "Simple JSON Addressing.", + "devDependencies": {}, + "directories": {}, + "dist": { + "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", + "tarball": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" }, "engines": { "node": ">=0.6.0" }, - "main": "./jsonpointer", - "scripts": { - "test": "node test.js" - }, - "license": "MIT", "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8", "homepage": "https://github.com/janl/node-jsonpointer#readme", - "_id": "jsonpointer@2.0.0", - "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "_from": "jsonpointer@2.0.0", - "_npmVersion": "2.10.1", - "_nodeVersion": "0.10.36", - "_npmUser": { - "name": "marcbachmann", - "email": "marc.brookman@gmail.com" - }, + "license": "MIT", + "main": "./jsonpointer", "maintainers": [ { "name": "jan", @@ -54,11 +80,21 @@ "email": "marc.brookman@gmail.com" } ], - "dist": { - "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9", - "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz" + "name": "jsonpointer", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+ssh://git@github.com/janl/node-jsonpointer.git" }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz", - "readme": "ERROR: No README data found!" + "scripts": { + "test": "node test.js" + }, + "tags": [ + "util", + "simple", + "util", + "utility" + ], + "version": "2.0.0" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json index f16c4235fb1fbb..87e47bd4ff9b36 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "xtend@^4.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" + { + "raw": "xtend@^4.0.0", + "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "^4.0.0", + "spec": ">=4.0.0 <5.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid" ] ], "_from": "xtend@>=4.0.0 <5.0.0", @@ -12,16 +20,17 @@ "_location": "/request/har-validator/is-my-json-valid/xtend", "_nodeVersion": "0.10.32", "_npmUser": { - "email": "raynos2@gmail.com", - "name": "raynos" + "name": "raynos", + "email": "raynos2@gmail.com" }, "_npmVersion": "2.14.1", "_phantomChildren": {}, "_requested": { - "name": "xtend", "raw": "xtend@^4.0.0", - "rawSpec": "^4.0.0", "scope": null, + "escapedName": "xtend", + "name": "xtend", + "rawSpec": "^4.0.0", "spec": ">=4.0.0 <5.0.0", "type": "range" }, @@ -32,14 +41,14 @@ "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af", "_shrinkwrap": null, "_spec": "xtend@^4.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid", "author": { - "email": "raynos2@gmail.com", - "name": "Raynos" + "name": "Raynos", + "email": "raynos2@gmail.com" }, "bugs": { - "email": "raynos2@gmail.com", - "url": "https://github.com/Raynos/xtend/issues" + "url": "https://github.com/Raynos/xtend/issues", + "email": "raynos2@gmail.com" }, "contributors": [ { @@ -57,7 +66,7 @@ "directories": {}, "dist": { "shasum": "a5c6d532be656e23db820efb943a1f04998d63af", - "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" + "tarball": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz" }, "engines": { "node": ">=0.4" @@ -65,12 +74,12 @@ "gitHead": "23dc302a89756da89c1897bc732a752317e35390", "homepage": "https://github.com/Raynos/xtend", "keywords": [ - "array", "extend", "merge", - "object", "options", - "opts" + "opts", + "object", + "array" ], "license": "MIT", "main": "immutable", @@ -91,19 +100,19 @@ "test": "node test" }, "testling": { + "files": "test.js", "browsers": [ - "chrome/22..latest", - "chrome/canary", + "ie/7..latest", "firefox/16..latest", "firefox/nightly", - "ie/7..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", + "chrome/22..latest", + "chrome/canary", "opera/12..latest", "opera/next", - "safari/5.1..latest" - ], - "files": "test.js" + "safari/5.1..latest", + "ipad/6.0..latest", + "iphone/6.0..latest" + ] }, "version": "4.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json index 97fba32e742564..aedffd1037d5fc 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "is-my-json-valid@^2.12.4", + { + "raw": "is-my-json-valid@^2.12.4", + "scope": null, + "escapedName": "is-my-json-valid", + "name": "is-my-json-valid", + "rawSpec": "^2.12.4", + "spec": ">=2.12.4 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/is-my-json-valid-2.13.1.tgz_1456180270224_0.17748022079467773" }, "_npmUser": { - "email": "mathiasbuus@gmail.com", - "name": "mafintosh" + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, "_npmVersion": "2.14.7", "_phantomChildren": {}, "_requested": { - "name": "is-my-json-valid", "raw": "is-my-json-valid@^2.12.4", - "rawSpec": "^2.12.4", "scope": null, + "escapedName": "is-my-json-valid", + "name": "is-my-json-valid", + "rawSpec": "^2.12.4", "spec": ">=2.12.4 <3.0.0", "type": "range" }, @@ -56,7 +65,7 @@ "directories": {}, "dist": { "shasum": "d55778a82feb6b0963ff4be111d5d1684e890707", - "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" + "tarball": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.13.1.tgz" }, "gitHead": "5bacc71441750bc6e79829abcfc21d4f2f0c4396", "homepage": "https://github.com/mafintosh/is-my-json-valid", @@ -70,20 +79,20 @@ "main": "index.js", "maintainers": [ { - "email": "freeall@gmail.com", - "name": "freeall" + "name": "freeall", + "email": "freeall@gmail.com" }, { - "email": "mathiasbuus@gmail.com", - "name": "mafintosh" + "name": "mafintosh", + "email": "mathiasbuus@gmail.com" }, { - "email": "w@tson.dk", - "name": "watson" + "name": "watson", + "email": "w@tson.dk" }, { - "email": "i@yoshuawuyts.com", - "name": "yoshuawuyts" + "name": "yoshuawuyts", + "email": "i@yoshuawuyts.com" } ], "name": "is-my-json-valid", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json index f66690fe1bbff5..cbb7f46bf8bc5b 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/test/json-schema-draft4/not.json @@ -74,7 +74,7 @@ "description": "forbidden property", "schema": { "properties": { - "foo": { + "foo": { "not": {} } } diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json index 8cebb11e4c5584..c034b70c549182 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "pinkie@^2.0.0", + { + "raw": "pinkie@^2.0.0", + "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise" ] ], @@ -12,16 +20,17 @@ "_location": "/request/har-validator/pinkie-promise/pinkie", "_nodeVersion": "4.2.4", "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" }, "_npmVersion": "2.14.12", "_phantomChildren": {}, "_requested": { - "name": "pinkie", "raw": "pinkie@^2.0.0", - "rawSpec": "^2.0.0", "scope": null, + "escapedName": "pinkie", + "name": "pinkie", + "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -34,8 +43,8 @@ "_spec": "pinkie@^2.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise", "author": { - "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, "bugs": { @@ -54,7 +63,7 @@ "directories": {}, "dist": { "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870", - "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" + "tarball": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz" }, "engines": { "node": ">=0.10.0" @@ -73,8 +82,8 @@ "license": "MIT", "maintainers": [ { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" } ], "name": "pinkie", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md index 54747f60cc538b..1565f95889661b 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md @@ -51,7 +51,7 @@ Returns new instance of `Promise`. ##### executor -*Required* +*Required* Type: `function` Function with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it. diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json index 438996b7ea8bf1..b09c56001ed8dc 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "pinkie-promise@^2.0.0", + { + "raw": "pinkie-promise@^2.0.0", + "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator" ] ], @@ -16,16 +24,17 @@ "tmp": "tmp/pinkie-promise-2.0.1.tgz_1460309839126_0.3422858319245279" }, "_npmUser": { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" }, "_npmVersion": "2.14.20", "_phantomChildren": {}, "_requested": { - "name": "pinkie-promise", "raw": "pinkie-promise@^2.0.0", - "rawSpec": "^2.0.0", "scope": null, + "escapedName": "pinkie-promise", + "name": "pinkie-promise", + "rawSpec": "^2.0.0", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -38,8 +47,8 @@ "_spec": "pinkie-promise@^2.0.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/har-validator", "author": { - "email": "floatdrop@gmail.com", "name": "Vsevolod Strukchinsky", + "email": "floatdrop@gmail.com", "url": "github.com/floatdrop" }, "bugs": { @@ -76,8 +85,8 @@ "license": "MIT", "maintainers": [ { - "email": "floatdrop@gmail.com", - "name": "floatdrop" + "name": "floatdrop", + "email": "floatdrop@gmail.com" } ], "name": "pinkie-promise", diff --git a/deps/npm/node_modules/request/node_modules/har-validator/package.json b/deps/npm/node_modules/request/node_modules/har-validator/package.json index 76f57480e6e320..269c1490cd81a9 100644 --- a/deps/npm/node_modules/request/node_modules/har-validator/package.json +++ b/deps/npm/node_modules/request/node_modules/har-validator/package.json @@ -1,31 +1,40 @@ { "_args": [ [ - "har-validator@~2.0.2", + { + "raw": "har-validator@~2.0.6", + "scope": null, + "escapedName": "har-validator", + "name": "har-validator", + "rawSpec": "~2.0.6", + "spec": ">=2.0.6 <2.1.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "har-validator@>=2.0.2 <2.1.0", + "_from": "har-validator@>=2.0.6 <2.1.0", "_id": "har-validator@2.0.6", "_inCache": true, "_installable": true, "_location": "/request/har-validator", "_nodeVersion": "5.2.0", "_npmUser": { - "email": "ahmad@ahmadnassri.com", - "name": "ahmadnassri" + "name": "ahmadnassri", + "email": "ahmad@ahmadnassri.com" }, "_npmVersion": "3.3.12", "_phantomChildren": { "ansi-regex": "2.0.0", - "strip-ansi": "3.0.0" + "strip-ansi": "3.0.1" }, "_requested": { - "name": "har-validator", - "raw": "har-validator@~2.0.2", - "rawSpec": "~2.0.2", + "raw": "har-validator@~2.0.6", "scope": null, - "spec": ">=2.0.2 <2.1.0", + "escapedName": "har-validator", + "name": "har-validator", + "rawSpec": "~2.0.6", + "spec": ">=2.0.6 <2.1.0", "type": "range" }, "_requiredBy": [ @@ -34,11 +43,11 @@ "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz", "_shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", "_shrinkwrap": null, - "_spec": "har-validator@~2.0.2", + "_spec": "har-validator@~2.0.6", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "ahmad@ahmadnassri.com", "name": "Ahmad Nassri", + "email": "ahmad@ahmadnassri.com", "url": "https://www.ahmadnassri.com/" }, "bin": { @@ -66,7 +75,7 @@ "directories": {}, "dist": { "shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d", - "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" + "tarball": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz" }, "echint": { "ignore": [ @@ -83,9 +92,9 @@ "gitHead": "92ccddad2e5d13e6e32c764e06c347d67805b211", "homepage": "https://github.com/ahmadnassri/har-validator", "keywords": [ - "archive", "har", "http", + "archive", "validate", "validator" ], diff --git a/deps/npm/node_modules/request/node_modules/hawk/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/.npmignore index ab108bf92f34a7..70febc05e4f360 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/.npmignore @@ -17,3 +17,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml index 77795c6a9b47df..047f7e3d5e1e39 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/.travis.yml @@ -2,3 +2,4 @@ language: node_js node_js: - 0.10 + diff --git a/deps/npm/node_modules/request/node_modules/hawk/README.md b/deps/npm/node_modules/request/node_modules/hawk/README.md index 63725034fc5e72..4aff23f3a3f7c5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/README.md +++ b/deps/npm/node_modules/request/node_modules/hawk/README.md @@ -75,12 +75,12 @@ and the server. ## Replay Protection -Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more -than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when +Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more +than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when making requests. This gives the server enough information to prevent replay attacks. The nonce is generated by the client, and is a string unique across all requests with the same timestamp and -key identifier combination. +key identifier combination. The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks. @@ -373,7 +373,7 @@ and for a finite period of time. Both the client and server can issue bewit cred credentials as the client to maintain clear traceability as to who issued which credentials. In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within -the granted access timeframe. +the granted access timeframe. ## Bewit Usage Example @@ -496,7 +496,7 @@ which can often affect how the request body is interpreted by the server. If the or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the `ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC. -The response authentication, when performed, only covers the response payload, content-type, and the request information +The response authentication, when performed, only covers the response payload, content-type, and the request information provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or any other response header field (e.g. Location) which can affect the client's behaviour. diff --git a/deps/npm/node_modules/request/node_modules/hawk/example/usage.js b/deps/npm/node_modules/request/node_modules/hawk/example/usage.js index 64fe17674a5753..13b860b4c5ad8a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/example/usage.js +++ b/deps/npm/node_modules/request/node_modules/hawk/example/usage.js @@ -75,3 +75,4 @@ credentialsFunc('dh37fgj492je', function (err, credentials) { process.exit(0); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js index f9ae69171343bd..b3e8649e3a6215 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/client.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/client.js @@ -364,3 +364,6 @@ exports.message = function (host, port, message, options) { return result; }; + + + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js index 911b906aabdaed..a883882c8c538c 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/index.js @@ -12,3 +12,4 @@ exports.uri = { authenticate: exports.server.authenticateBewit, getBewit: exports.client.getBewit }; + diff --git a/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js b/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js index 2da3343904aeab..28a35118ff8c00 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/hawk/lib/utils.js @@ -181,3 +181,4 @@ exports.unauthorized = function (message, attributes) { return Boom.unauthorized(message, 'Hawk', attributes); }; + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml index 7a64dd2210cb10..dd1b24f13ac1f8 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/.travis.yml @@ -5,3 +5,4 @@ node_js: - 4.0 sudo: false + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json index 42749188a596be..c95a8315cc02fa 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "boom@2.x.x", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/hawk" + { + "raw": "boom@2.x.x", + "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" ] ], "_from": "boom@>=2.0.0 <3.0.0", @@ -12,16 +20,17 @@ "_location": "/request/hawk/boom", "_nodeVersion": "0.10.40", "_npmUser": { - "email": "arbretz@gmail.com", - "name": "arb" + "name": "arb", + "email": "arbretz@gmail.com" }, "_npmVersion": "2.11.1", "_phantomChildren": {}, "_requested": { - "name": "boom", "raw": "boom@2.x.x", - "rawSpec": "2.x.x", "scope": null, + "escapedName": "boom", + "name": "boom", + "rawSpec": "2.x.x", "spec": ">=2.0.0 <3.0.0", "type": "range" }, @@ -33,7 +42,7 @@ "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", "_shrinkwrap": null, "_spec": "boom@2.x.x", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/hawk", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", "bugs": { "url": "https://github.com/hapijs/boom/issues" }, @@ -48,7 +57,7 @@ "directories": {}, "dist": { "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "tarball": "http://registry.npmjs.org/boom/-/boom-2.10.1.tgz" + "tarball": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz" }, "engines": { "node": ">=0.10.40" diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml index 7a64dd2210cb10..dd1b24f13ac1f8 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/.travis.yml @@ -5,3 +5,4 @@ node_js: - 4.0 sudo: false + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js index c8a046d7433235..f385870ee68e3a 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/lib/index.js @@ -64,3 +64,5 @@ exports.fixedTimeComparison = function (a, b) { return (mismatch === 0); }; + + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json index c65fd094047c73..6783bde465e7e6 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json @@ -1,50 +1,75 @@ { - "name": "cryptiles", - "description": "General purpose crypto utilities", - "version": "2.0.5", - "repository": { - "type": "git", - "url": "git://github.com/hapijs/cryptiles.git" + "_args": [ + [ + { + "raw": "cryptiles@2.x.x", + "scope": null, + "escapedName": "cryptiles", + "name": "cryptiles", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "cryptiles@>=2.0.0 <3.0.0", + "_id": "cryptiles@2.0.5", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/cryptiles", + "_nodeVersion": "4.0.0", + "_npmUser": { + "name": "hueniverse", + "email": "eran@hammer.io" }, - "main": "lib/index.js", - "keywords": [ - "cryptography", - "security", - "utilites" + "_npmVersion": "2.14.2", + "_phantomChildren": {}, + "_requested": { + "raw": "cryptiles@2.x.x", + "scope": null, + "escapedName": "cryptiles", + "name": "cryptiles", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk" ], - "engines": { - "node": ">=0.10.40" + "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", + "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", + "_shrinkwrap": null, + "_spec": "cryptiles@2.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/cryptiles/issues" }, "dependencies": { "boom": "2.x.x" }, + "description": "General purpose crypto utilities", "devDependencies": { "code": "1.x.x", "lab": "5.x.x" }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html" - }, - "license": "BSD-3-Clause", - "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649", - "bugs": { - "url": "https://github.com/hapijs/cryptiles/issues" - }, - "homepage": "https://github.com/hapijs/cryptiles#readme", - "_id": "cryptiles@2.0.5", - "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", - "_from": "cryptiles@>=2.0.0 <3.0.0", - "_npmVersion": "2.14.2", - "_nodeVersion": "4.0.0", - "_npmUser": { - "name": "hueniverse", - "email": "eran@hammer.io" - }, + "directories": {}, "dist": { "shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8", - "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + "tarball": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz" + }, + "engines": { + "node": ">=0.10.40" }, + "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649", + "homepage": "https://github.com/hapijs/cryptiles#readme", + "keywords": [ + "cryptography", + "security", + "utilites" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", "maintainers": [ { "name": "hueniverse", @@ -55,7 +80,16 @@ "email": "ceejceej@gmail.com" } ], - "directories": {}, - "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz", - "readme": "ERROR: No README data found!" + "name": "cryptiles", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/cryptiles.git" + }, + "scripts": { + "test": "lab -a code -t 100 -L", + "test-cov-html": "lab -a code -r html -o coverage.html" + }, + "version": "2.0.5" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json index 6e76778c7aa5f3..1dbb2af39eefa6 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json @@ -1,36 +1,97 @@ { - "name": "hoek", - "description": "General purpose node utilities", - "version": "2.16.3", - "repository": { - "type": "git", - "url": "git://github.com/hapijs/hoek.git" + "_args": [ + [ + { + "raw": "hoek@2.x.x", + "scope": null, + "escapedName": "hoek", + "name": "hoek", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "hoek@>=2.0.0 <3.0.0", + "_id": "hoek@2.16.3", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/hoek", + "_nodeVersion": "4.1.0", + "_npmUser": { + "name": "nlf", + "email": "quitlahok@gmail.com" }, - "main": "lib/index.js", - "keywords": [ - "utilities" + "_npmVersion": "3.3.3", + "_phantomChildren": {}, + "_requested": { + "raw": "hoek@2.x.x", + "scope": null, + "escapedName": "hoek", + "name": "hoek", + "rawSpec": "2.x.x", + "spec": ">=2.0.0 <3.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk", + "/request/hawk/boom", + "/request/hawk/sntp" ], - "engines": { - "node": ">=0.10.40" + "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", + "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", + "_shrinkwrap": null, + "_spec": "hoek@2.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", + "bugs": { + "url": "https://github.com/hapijs/hoek/issues" }, "dependencies": {}, + "description": "General purpose node utilities", "devDependencies": { "code": "1.x.x", "lab": "5.x.x" }, + "directories": {}, + "dist": { + "shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", + "tarball": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz" + }, + "engines": { + "node": ">=0.10.40" + }, + "gitHead": "20f36e85616264d4b73a64a374803175213a9121", + "homepage": "https://github.com/hapijs/hoek#readme", + "keywords": [ + "utilities" + ], + "license": "BSD-3-Clause", + "main": "lib/index.js", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + { + "name": "wyatt", + "email": "wpreul@gmail.com" + }, + { + "name": "nlf", + "email": "quitlahok@gmail.com" + } + ], + "name": "hoek", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hapijs/hoek.git" + }, "scripts": { "test": "lab -a code -t 100 -L", "test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html" }, - "license": "BSD-3-Clause", - "readme": "![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png)\n\nUtility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).\n\n[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\n# Table of Contents\n\n* [Introduction](#introduction \"Introduction\")\n* [Object](#object \"Object\")\n * [clone](#cloneobj \"clone\")\n * [cloneWithShallow](#clonewithshallowobj-keys \"cloneWithShallow\")\n * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\n * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride \"applyToDefaults\")\n * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys \"applyToDefaultsWithShallow\")\n * [deepEqual](#deepequala-b \"deepEqual\")\n * [unique](#uniquearray-key \"unique\")\n * [mapToObject](#maptoobjectarray-key \"mapToObject\")\n * [intersect](#intersectarray1-array2 \"intersect\")\n * [contain](#containref-values-options \"contain\")\n * [flatten](#flattenarray-target \"flatten\")\n * [reach](#reachobj-chain-options \"reach\")\n * [reachTemplate](#reachtemplateobj-template-options \"reachTemplate\")\n * [transform](#transformobj-transform-options \"transform\")\n * [shallow](#shallowobj \"shallow\")\n * [stringify](#stringifyobj \"stringify\")\n* [Timer](#timer \"Timer\")\n* [Bench](#bench \"Bench\")\n* [Binary Encoding/Decoding](#binary-encodingdecoding \"Binary Encoding/Decoding\")\n * [base64urlEncode](#base64urlencodevalue \"binary64urlEncode\")\n * [base64urlDecode](#base64urldecodevalue \"binary64urlDecode\")\n* [Escaping Characters](#escaping-characters \"Escaping Characters\")\n * [escapeHtml](#escapehtmlstring \"escapeHtml\")\n * [escapeHeaderAttribute](#escapeheaderattributeattribute \"escapeHeaderAttribute\")\n * [escapeRegex](#escaperegexstring \"escapeRegex\")\n* [Errors](#errors \"Errors\")\n * [assert](#assertcondition-message \"assert\")\n * [abort](#abortmessage \"abort\")\n * [displayStack](#displaystackslice \"displayStack\")\n * [callStack](#callstackslice \"callStack\")\n* [Function](#function \"Function\")\n * [nextTick](#nexttickfn \"nextTick\")\n * [once](#oncefn \"once\")\n * [ignore](#ignore \"ignore\")\n* [Miscellaneous](#miscellaneous \"Miscellaneous\")\n * [uniqueFilename](#uniquefilenamepath-extension \"uniqueFilename\")\n * [isAbsolutePath](#isabsolutepathpath-platform \"isAbsolutePath\")\n * [isInteger](#isintegervalue \"isInteger\")\n\n\n\n# Introduction\n\nThe *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.\n\nFor example, to use Hoek to set configuration with default options:\n```javascript\nvar Hoek = require('hoek');\n\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true};\n\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\n\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\n```\n\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.\n\n## Object\n\nHoek provides several helpful methods for objects and arrays.\n\n### clone(obj)\n\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.clone(nestedObj);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 123456\nconsole.log(copy.x.b); // results in 100\n```\n\n### cloneWithShallow(obj, keys)\nkeys is an array of key names to shallow copy\n\nThis method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.\n\n```javascript\n\nvar nestedObj = {\n w: /^something$/ig,\n x: {\n a: [1, 2, 3],\n b: 123456,\n c: new Date()\n },\n y: 'y',\n z: new Date()\n };\n\nvar copy = Hoek.cloneWithShallow(nestedObj, ['x']);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y); // results in 'y'\nconsole.log(nestedObj.x.b); // results in 100\nconsole.log(copy.x.b); // results in 100\n```\n\n### merge(target, source, isNullOverride, isMergeArrays)\nisNullOverride, isMergeArrays default to true\n\nMerge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.\nMerge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.\n\n\n```javascript\n\nvar target = {a: 1, b : 2};\nvar source = {a: 0, c: 5};\nvar source2 = {a: null, c: 5};\n\nHoek.merge(target, source); // results in {a: 0, b: 2, c: 5}\nHoek.merge(target, source2); // results in {a: null, b: 2, c: 5}\nHoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\n\nvar targetArray = [1, 2, 3];\nvar sourceArray = [4, 5];\n\nHoek.merge(targetArray, sourceArray); // results in [1, 2, 3, 4, 5]\nHoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]\n```\n\n### applyToDefaults(defaults, options, isNullOverride)\nisNullOverride defaults to false\n\nApply options to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options); // results in { host: \"localhost\", port: 8080 }\n```\n\nApply options with a null value to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { host: null, port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }\n```\n\n### applyToDefaultsWithShallow(defaults, options, keys)\nkeys is an array of key names to shallow copy\n\nApply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.\n\n```javascript\n\nvar defaults = {\n server: {\n host: \"localhost\",\n port: 8000\n },\n name: 'example'\n };\n\nvar options = { server: { port: 8080 } };\n\nvar config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' }\n```\n\n### deepEqual(b, a, [options])\n\nPerforms a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`\n\n```javascript\nHoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true\nHoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true\nHoek.deepEqual(Object.create(null), {}); //results in false\n```\n\n### unique(array, key)\n\nRemove duplicate items from Array\n\n```javascript\n\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\n\nvar newArray = Hoek.unique(array); // results in [1,2,3,4,5,6]\n\narray = [{id: 1}, {id: 1}, {id: 2}];\n\nnewArray = Hoek.unique(array, \"id\"); // results in [{id: 1}, {id: 2}]\n```\n\n### mapToObject(array, key)\n\nConvert an Array into an Object\n\n```javascript\n\nvar array = [1,2,3];\nvar newObject = Hoek.mapToObject(array); // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\n\narray = [{id: 1}, {id: 2}];\nnewObject = Hoek.mapToObject(array, \"id\"); // results in [{\"id\": 1}, {\"id\": 2}]\n```\n\n### intersect(array1, array2)\n\nFind the common unique items in two arrays\n\n```javascript\n\nvar array1 = [1, 2, 3];\nvar array2 = [1, 4, 5];\n\nvar newArray = Hoek.intersect(array1, array2); // results in [1]\n```\n\n### contain(ref, values, [options])\n\nTests if the reference value contains the provided values where:\n- `ref` - the reference string, array, or object.\n- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,\n an array of key names, or an object with key-value pairs to compare.\n- `options` - an optional object with the following optional settings:\n - `deep` - if `true`, performed a deep comparison of the values.\n - `once` - if `true`, allows only one occurrence of each value.\n - `only` - if `true`, does not allow values not explicitly listed.\n - `part` - if `true`, allows partial match of the values (at least one must always match).\n\nNote: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).\nAlso, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.\n\n```javascript\nHoek.contain('aaa', 'a', { only: true });\t\t\t\t\t\t\t// true\nHoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true });\t\t\t\t// true\nHoek.contain([1, 2, 2], [1, 2], { once: true });\t\t\t\t\t// false\nHoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true\n```\n\n### flatten(array, [target])\n\nFlatten an array\n\n```javascript\n\nvar array = [1, [2, 3]];\n\nvar flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]\n\narray = [1, [2, 3]];\ntarget = [4, [5]];\n\nflattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]\n```\n\n### reach(obj, chain, [options])\n\nConverts an object key chain string to reference\n\n- `options` - optional settings\n - `separator` - string to split chain path on, defaults to '.'\n - `default` - value to return if the path or value is not present, default is `undefined`\n - `strict` - if `true`, will throw an error on missing member, default is `false`\n - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.\n\nA chain including negative numbers will work like negative indices on an\narray.\n\nIf chain is `null`, `undefined` or `false`, the object itself will be returned.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reach(obj, chain); // returns 1\n\nvar chain = 'a.b.-1';\nvar obj = {a : {b : [2,3,6]}};\n\nHoek.reach(obj, chain); // returns 6\n```\n\n### reachTemplate(obj, template, [options])\n\nReplaces string parameters (`{name}`) with their corresponding object key values by applying the\n(`reach()`)[#reachobj-chain-options] method where:\n\n- `obj` - the context object used for key lookup.\n- `template` - a string containing `{}` parameters.\n- `options` - optional (`reach()`)[#reachobj-chain-options] options.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'\n```\n\n### transform(obj, transform, [options])\n\nTransforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects.\n\n```javascript\nvar source = {\n address: {\n one: '123 main street',\n two: 'PO Box 1234'\n },\n title: 'Warehouse',\n state: 'CA'\n};\n\nvar result = Hoek.transform(source, {\n 'person.address.lineOne': 'address.one',\n 'person.address.lineTwo': 'address.two',\n 'title': 'title',\n 'person.address.region': 'state'\n});\n// Results in\n// {\n// person: {\n// address: {\n// lineOne: '123 main street',\n// lineTwo: 'PO Box 1234',\n// region: 'CA'\n// }\n// },\n// title: 'Warehouse'\n// }\n```\n\n### shallow(obj)\n\nPerforms a shallow copy by copying the references of all the top level children where:\n- `obj` - the object to be copied.\n\n```javascript\nvar shallow = Hoek.shallow({ a: { b: 1 } });\n```\n\n### stringify(obj)\n\nConverts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught\nand reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in\nerror message) without the need to worry about invalid conversion.\n\n```javascript\nvar a = {};\na.b = a;\nHoek.stringify(a);\t\t// Returns '[Cannot display object: Converting circular structure to JSON]'\n```\n\n# Timer\n\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n\n```javascript\n\nvar timerObj = new Hoek.Timer();\nconsole.log(\"Time is now: \" + timerObj.ts);\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds');\n```\n\n\n# Bench\n\nSame as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display\nhuman-readable timestamps. More accurate for benchmarking or internal timers.\n\n# Binary Encoding/Decoding\n\n### base64urlEncode(value)\n\nEncodes value in Base64 or URL encoding\n\n### base64urlDecode(value)\n\nDecodes data in Base64 or URL encoding.\n# Escaping Characters\n\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\n\n```javascript\n\ninternals.htmlEscaped = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n};\n```\n\n### escapeHtml(string)\n\n```javascript\n\nvar string = ' hey ';\nvar escapedString = Hoek.escapeHtml(string); // returns <html> hey </html>\n```\n\n### escapeHeaderAttribute(attribute)\n\nEscape attribute value for use in HTTP header\n\n```javascript\n\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"'); //returns I said \\\"go w\\\\o me\\\"\n```\n\n\n### escapeRegex(string)\n\nEscape string for Regex construction\n\n```javascript\n\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,'); // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\n```\n\n# Errors\n\n### assert(condition, message)\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, 'a should equal b'); // Throws 'a should equal b'\n```\n\nNote that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, new Error('a should equal b')); // Throws the given error object\n```\n\n### abort(message)\n\nFirst checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,\ndisplays most recent stack and then exits process.\n\n\n\n### displayStack(slice)\n\nDisplays the trace stack\n\n```javascript\n\nvar stack = Hoek.displayStack();\nconsole.log(stack); // returns something like:\n\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\n 'Module._compile (module.js:449:26)',\n 'Module._extensions..js (module.js:467:10)',\n 'Module.load (module.js:356:32)',\n 'Module._load (module.js:312:12)',\n 'Module.runMain (module.js:492:10)',\n 'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\n```\n\n### callStack(slice)\n\nReturns a trace stack array.\n\n```javascript\n\nvar stack = Hoek.callStack();\nconsole.log(stack); // returns something like:\n\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\n [ 'module.js', 449, 26, 'Module._compile', false ],\n [ 'module.js', 467, 10, 'Module._extensions..js', false ],\n [ 'module.js', 356, 32, 'Module.load', false ],\n [ 'module.js', 312, 12, 'Module._load', false ],\n [ 'module.js', 492, 10, 'Module.runMain', false ],\n [ 'node.js',\n 244,\n 9,\n 'startup.processNextTick.process._tickCallback',\n false ] ]\n```\n\n## Function\n\n### nextTick(fn)\n\nReturns a new function that wraps `fn` in `process.nextTick`.\n\n```javascript\n\nvar myFn = function () {\n console.log('Do this later');\n};\n\nvar nextFn = Hoek.nextTick(myFn);\n\nnextFn();\nconsole.log('Do this first');\n\n// Results in:\n//\n// Do this first\n// Do this later\n```\n\n### once(fn)\n\nReturns a new function that can be run multiple times, but makes sure `fn` is only run once.\n\n```javascript\n\nvar myFn = function () {\n console.log('Ran myFn');\n};\n\nvar onceFn = Hoek.once(myFn);\nonceFn(); // results in \"Ran myFn\"\nonceFn(); // results in undefined\n```\n\n### ignore\n\nA simple no-op function. It does nothing at all.\n\n## Miscellaneous\n\n### uniqueFilename(path, extension)\n`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.\n\nReturns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.\n\n```javascript\nvar result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in \"full/path/test/modules/{random}.txt\"\n```\n\n### isAbsolutePath(path, [platform])\n\nDetermines whether `path` is an absolute path. Returns `true` or `false`.\n\n- `path` - A file path to test for whether it is absolute or not.\n- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`.\n\n### isInteger(value)\n\nCheck `value` to see if it is an integer. Returns true/false.\n\n```javascript\nvar result = Hoek.isInteger('23')\n```\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hapijs/hoek/issues" - }, - "homepage": "https://github.com/hapijs/hoek#readme", - "_id": "hoek@2.16.3", - "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed", - "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz", - "_from": "hoek@>=2.0.0 <3.0.0" + "version": "2.16.3" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore index b0939eabe34d2d..77ba16cb055ca5 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.npmignore @@ -15,3 +15,4 @@ config.json */*/._* coverage.* lib-cov + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml index 77795c6a9b47df..047f7e3d5e1e39 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/.travis.yml @@ -2,3 +2,4 @@ language: node_js node_js: - 0.10 + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile index 43189de8e3577e..417fd93708605f 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/Makefile @@ -1,8 +1,9 @@ test: @node node_modules/lab/bin/lab -test-cov: +test-cov: @node node_modules/lab/bin/lab -t 100 -m 3000 test-cov-html: @node node_modules/lab/bin/lab -r html -o coverage.html .PHONY: test test-cov test-cov-html + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md index ec5c1a14af19ff..98a6e025dba0b5 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/README.md @@ -65,3 +65,4 @@ Sntp.start(function () { Sntp.stop(); }); ``` + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js index 58f3cf93e036ff..0303f6dcfa7623 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/offset.js @@ -13,3 +13,4 @@ Sntp.offset(function (err, offset) { console.log(offset); // Identical (served from cache) }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js index ff2589f75ebb33..bd70d0e6a516f4 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/examples/time.js @@ -22,3 +22,4 @@ Sntp.time(options, function (err, time) { console.log('Local clock is off by: ' + time.t + ' milliseconds'); process.exit(0); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json index 9ae1b926efae26..08c207b1a82726 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json @@ -1,49 +1,99 @@ { - "name": "sntp", - "description": "SNTP Client", - "version": "1.0.9", + "_args": [ + [ + { + "raw": "sntp@1.x.x", + "scope": null, + "escapedName": "sntp", + "name": "sntp", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk" + ] + ], + "_from": "sntp@>=1.0.0 <2.0.0", + "_id": "sntp@1.0.9", + "_inCache": true, + "_installable": true, + "_location": "/request/hawk/sntp", + "_npmUser": { + "name": "hueniverse", + "email": "eran@hueniverse.com" + }, + "_npmVersion": "1.4.23", + "_phantomChildren": {}, + "_requested": { + "raw": "sntp@1.x.x", + "scope": null, + "escapedName": "sntp", + "name": "sntp", + "rawSpec": "1.x.x", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/hawk" + ], + "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", + "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", + "_shrinkwrap": null, + "_spec": "sntp@1.x.x", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/hawk", "author": { "name": "Eran Hammer", "email": "eran@hammer.io", "url": "http://hueniverse.com" }, - "contributors": [], - "repository": { - "type": "git", - "url": "git://github.com/hueniverse/sntp.git" - }, - "main": "index", - "keywords": [ - "sntp", - "ntp", - "time" - ], - "engines": { - "node": ">=0.8.0" + "bugs": { + "url": "https://github.com/hueniverse/sntp/issues" }, + "contributors": [], "dependencies": { "hoek": "2.x.x" }, + "description": "SNTP Client", "devDependencies": { "lab": "4.x.x" }, - "scripts": { - "test": "make test-cov" + "directories": {}, + "dist": { + "shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", + "tarball": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz" }, + "engines": { + "node": ">=0.8.0" + }, + "gitHead": "ee2e35284f684609990681734d39010cd356d7da", + "homepage": "https://github.com/hueniverse/sntp", + "keywords": [ + "sntp", + "ntp", + "time" + ], "licenses": [ { "type": "BSD", "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE" } ], - "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n host: 'nist1-sj.ustiming.org', // Defaults to pool.ntp.org\n port: 123, // Defaults to 123 (NTP)\n resolveReference: true, // Default to false (not resolving)\n timeout: 1000 // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n if (err) {\n console.log('Failed: ' + err.message);\n process.exit(1);\n }\n\n console.log('Local clock is off by: ' + time.t + ' milliseconds');\n process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n console.log(offset); // New (served fresh)\n\n // Request offset again\n\n Sntp.offset(function (err, offset) {\n\n console.log(offset); // Identical (served from cache)\n });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now(); // System time without offset\n\nSntp.start(function () {\n\n var now = Sntp.now(); // With offset\n Sntp.stop();\n});\n```\n\n", - "readmeFilename": "README.md", - "bugs": { - "url": "https://github.com/hueniverse/sntp/issues" + "main": "index", + "maintainers": [ + { + "name": "hueniverse", + "email": "eran@hueniverse.com" + } + ], + "name": "sntp", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git://github.com/hueniverse/sntp.git" }, - "homepage": "https://github.com/hueniverse/sntp#readme", - "_id": "sntp@1.0.9", - "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198", - "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz", - "_from": "sntp@>=1.0.0 <2.0.0" + "scripts": { + "test": "make test-cov" + }, + "version": "1.0.9" } diff --git a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js index 2b8a1c256e8fe5..f1d1cdabf5bb66 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js +++ b/deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/test/index.js @@ -432,3 +432,4 @@ describe('SNTP', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/package.json b/deps/npm/node_modules/request/node_modules/hawk/package.json index 4bae96efecbfc7..fb9176edbe4437 100644 --- a/deps/npm/node_modules/request/node_modules/hawk/package.json +++ b/deps/npm/node_modules/request/node_modules/hawk/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "hawk@~3.1.0", + { + "raw": "hawk@~3.1.3", + "scope": null, + "escapedName": "hawk", + "name": "hawk", + "rawSpec": "~3.1.3", + "spec": ">=3.1.3 <3.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "hawk@>=3.1.0 <3.2.0", + "_from": "hawk@>=3.1.3 <3.2.0", "_id": "hawk@3.1.3", "_inCache": true, "_installable": true, "_location": "/request/hawk", "_nodeVersion": "5.4.1", "_npmUser": { - "email": "eran@hammer.io", - "name": "hueniverse" + "name": "hueniverse", + "email": "eran@hammer.io" }, "_npmVersion": "3.3.12", "_phantomChildren": {}, "_requested": { - "name": "hawk", - "raw": "hawk@~3.1.0", - "rawSpec": "~3.1.0", + "raw": "hawk@~3.1.3", "scope": null, - "spec": ">=3.1.0 <3.2.0", + "escapedName": "hawk", + "name": "hawk", + "rawSpec": "~3.1.3", + "spec": ">=3.1.3 <3.2.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz", "_shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4", "_shrinkwrap": null, - "_spec": "hawk@~3.1.0", + "_spec": "hawk@~3.1.3", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "eran@hammer.io", "name": "Eran Hammer", + "email": "eran@hammer.io", "url": "http://hueniverse.com" }, "browser": "./lib/browser.js", @@ -57,7 +66,7 @@ "directories": {}, "dist": { "shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4", - "tarball": "http://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" + "tarball": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz" }, "engines": { "node": ">=0.10.32" @@ -65,10 +74,10 @@ "gitHead": "2f0b93b34ed9b0ebc865838ef70c6a4035591430", "homepage": "https://github.com/hueniverse/hawk#readme", "keywords": [ - "authentication", - "hawk", "http", - "scheme" + "authentication", + "scheme", + "hawk" ], "license": "BSD-3-Clause", "main": "lib/index.js", diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/readme.js b/deps/npm/node_modules/request/node_modules/hawk/test/readme.js index 7a343f5e219c61..a466264667ee64 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/readme.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/readme.js @@ -92,3 +92,4 @@ describe('README', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/server.js b/deps/npm/node_modules/request/node_modules/hawk/test/server.js index 0fdf13d435913e..1d3405a9ecc11e 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/server.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/server.js @@ -1326,3 +1326,4 @@ describe('Server', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/hawk/test/uri.js b/deps/npm/node_modules/request/node_modules/hawk/test/uri.js index 3dc8e6a1c51042..f3c6ba2d629a65 100755 --- a/deps/npm/node_modules/request/node_modules/hawk/test/uri.js +++ b/deps/npm/node_modules/request/node_modules/hawk/test/uri.js @@ -835,3 +835,4 @@ describe('Uri', function () { }); }); }); + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md index 3e4b13881e0de4..6f69444ba6a0f6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md @@ -27,7 +27,7 @@ - First semver release. - #36: Ensure verifySignature does not leak useful timing information -- #42: Bring the library up to the latest version of the spec (including the +- #42: Bring the library up to the latest version of the spec (including the request-target changes) - Support for ECDSA keys and signatures. - Now uses `sshpk` for key parsing, validation and conversion. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json index b596b28af873e0..411084732a6649 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "assert-plus@^0.2.0", + { + "raw": "assert-plus@^0.2.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", + "spec": ">=0.2.0 <0.3.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], @@ -12,23 +20,22 @@ "_location": "/request/http-signature/assert-plus", "_nodeVersion": "0.10.36", "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "_npmVersion": "3.3.8", "_phantomChildren": {}, "_requested": { - "name": "assert-plus", "raw": "assert-plus@^0.2.0", - "rawSpec": "^0.2.0", "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^0.2.0", "spec": ">=0.2.0 <0.3.0", "type": "range" }, "_requiredBy": [ - "/request/http-signature", - "/request/http-signature/sshpk", - "/request/http-signature/sshpk/dashdash" + "/request/http-signature" ], "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz", "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", @@ -36,8 +43,8 @@ "_spec": "assert-plus@^0.2.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, "bugs": { "url": "https://github.com/mcavage/node-assert-plus/issues" @@ -77,7 +84,7 @@ "directories": {}, "dist": { "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz" }, "engines": { "node": ">=0.8" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md index 75bc4f025c8c32..ab3a66417a6fa6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/CHANGES.md @@ -4,6 +4,11 @@ None yet. +## v1.3.0 (2016-06-22) + +* #14 add safer version of hasOwnProperty() +* #15 forEachKey() should ignore inherited properties + ## v1.2.2 (2015-10-15) * #11 NPM package shouldn't include any code that does `require('JSV')` diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md index b502b2d3a4d7e4..7303642e016487 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/README.md @@ -19,14 +19,23 @@ Returns whether two objects are equal. Returns true if the given object has no properties and false otherwise. This is O(1) (unlike `Object.keys(obj).length === 0`, which is O(N)). +### hasKey(obj, key) + +Returns true if the given object has an enumerable, non-inherited property +called `key`. [For information on enumerability and ownership of properties, see +the MDN +documentation.](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Enumerability_and_ownership_of_properties) ### forEachKey(obj, callback) -Like Array.forEach, but iterates properties of an object rather than elements -of an array. Equivalent to: +Like Array.forEach, but iterates enumerable, owned properties of an object +rather than elements of an array. Equivalent to: - for (var key in obj) - callback(key, obj[key]); + for (var key in obj) { + if (Object.prototype.hasOwnProperty.call(obj, key)) { + callback(key, obj[key]); + } + } ### flattenObject(obj, depth) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js index 5ee46889223915..26c3ba1c076f3f 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/lib/jsprim.js @@ -15,6 +15,7 @@ var mod_jsonschema = require('json-schema'); exports.deepCopy = deepCopy; exports.deepEqual = deepEqual; exports.isEmpty = isEmpty; +exports.hasKey = hasKey; exports.forEachKey = forEachKey; exports.pluck = pluck; exports.flattenObject = flattenObject; @@ -122,10 +123,19 @@ function isEmpty(obj) return (true); } +function hasKey(obj, key) +{ + mod_assert.equal(typeof (key), 'string'); + return (Object.prototype.hasOwnProperty.call(obj, key)); +} + function forEachKey(obj, callback) { - for (var key in obj) - callback(key, obj[key]); + for (var key in obj) { + if (hasKey(obj, key)) { + callback(key, obj[key]); + } + } } function pluck(obj, key) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf index eabe9650f5e489..03f787ffbdee4e 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/jsl.node.conf @@ -1,5 +1,5 @@ # -# Configuration File for JavaScript Lint +# Configuration File for JavaScript Lint # # This configuration file can be used to lint a collection of scripts, or to enable # or disable warnings for scripts that are linted via the command line. @@ -134,3 +134,4 @@ # To add a set of files, use "+process FileName", "+process Folder\Path\*.js", # or "+process Folder\Path\*.htm". # + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json index 660308afc6d2b8..2fd7273a9038dc 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "extsprintf@1.0.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "extsprintf@1.0.2", + "scope": null, + "escapedName": "extsprintf", + "name": "extsprintf", + "rawSpec": "1.0.2", + "spec": "1.0.2", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "extsprintf@1.0.2", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/extsprintf", "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "name": "extsprintf", "raw": "extsprintf@1.0.2", - "rawSpec": "1.0.2", "scope": null, + "escapedName": "extsprintf", + "name": "extsprintf", + "rawSpec": "1.0.2", "spec": "1.0.2", "type": "version" }, @@ -32,7 +41,7 @@ "_shasum": "e1080e0658e300b06294990cc70e1502235fd550", "_shrinkwrap": null, "_spec": "extsprintf@1.0.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-extsprintf/issues" }, @@ -42,7 +51,7 @@ "directories": {}, "dist": { "shasum": "e1080e0658e300b06294990cc70e1502235fd550", - "tarball": "http://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz" }, "engines": [ "node >=0.6.0" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md index 78b81d39683251..4de0124476e98c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/README.md @@ -1,5 +1,5 @@ JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator). -Code is licensed under the AFL or BSD license as part of the Persevere +Code is licensed under the AFL or BSD license as part of the Persevere project which is administered under the Dojo foundation, and all contributions require a Dojo CLA. \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema index 36a85ccd244926..de80b918b671c7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-00/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "dot-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-00/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref index 5d1f76b6a694a4..3a872a71c973dc 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links index cbef326dd3de5b..8a5e7807250cf9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/links @@ -2,28 +2,28 @@ "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-00/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema index d452b023ee484a..9aa2fbc57a4054 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-00/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-00/hyper-schema#", "id" : "http://json-schema.org/draft-00/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,136 +12,136 @@ "optional" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1 }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "maxDecimal" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -149,7 +149,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema index b0fb5e157ef9bd..3f6c6cc2c012df 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-01/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "dot-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-01/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref index cbac1ba2e53286..4d26174ef17ad9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links index ebc7b7b58b1326..52430a5d94ac75 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/links @@ -2,28 +2,28 @@ "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-01/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema index a0f3801f840cca..7a208e680e631b 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-01/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-01/hyper-schema#", "id" : "http://json-schema.org/draft-01/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,136 +12,136 @@ "optional" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1 }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "maxDecimal" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -149,7 +149,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema index 0771e2b31e8eef..4ec1b7569137c3 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/hyper-schema @@ -8,61 +8,61 @@ "items" : {"$ref" : "http://json-schema.org/draft-02/links#"}, "optional" : true }, - + "fragmentResolution" : { "type" : "string", "optional" : true, "default" : "slash-delimited" }, - + "root" : { "type" : "boolean", "optional" : true, "default" : false }, - + "readonly" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pathStart" : { "type" : "string", "optional" : true, "format" : "uri" }, - + "mediaType" : { "type" : "string", "optional" : true, "format" : "media-type" }, - + "alternate" : { "type" : "array", "items" : {"$ref" : "#"}, "optional" : true } }, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "slash-delimited", "extends" : {"$ref" : "http://json-schema.org/draft-02/schema#"} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref index 1a6c56d04b665a..6526c394556665 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/json-ref#", - + "items" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" }, - + { "href" : "{id}", "rel" : "self" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links index dacc53a1a4adb6..1b176178a2c333 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/links @@ -2,30 +2,30 @@ "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string" }, - + "rel" : { "type" : "string" }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET", "optional" : true }, - + "enctype" : { "type" : "string", "requires" : "method", "optional" : true }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-02/hyper-schema#"}, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema index a4998abea2065e..61b8de15483962 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-02/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-02/hyper-schema#", "id" : "http://json-schema.org/draft-02/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -13,131 +13,131 @@ "uniqueItems" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "optional" : true, "default" : {} }, - + "optional" : { "type" : "boolean", "optional" : true, "default" : false }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "optional" : true, "default" : {} }, - + "requires" : { "type" : ["string", {"$ref" : "#"}], "optional" : true }, - + "minimum" : { "type" : "number", "optional" : true }, - + "maximum" : { "type" : "number", "optional" : true }, - + "minimumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "minimum", "default" : true }, - + "maximumCanEqual" : { "type" : "boolean", "optional" : true, "requires" : "maximum", "default" : true }, - + "minItems" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "optional" : true, "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "optional" : true, "default" : false }, - + "pattern" : { "type" : "string", "optional" : true, "format" : "regex" }, - + "minLength" : { "type" : "integer", "optional" : true, "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer", "optional" : true }, - + "enum" : { "type" : "array", "optional" : true, "minItems" : 1, "uniqueItems" : true }, - + "title" : { "type" : "string", "optional" : true }, - + "description" : { "type" : "string", "optional" : true }, - + "format" : { "type" : "string", "optional" : true }, - + "contentEncoding" : { "type" : "string", "optional" : true }, - + "default" : { "type" : "any", "optional" : true }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, @@ -145,14 +145,14 @@ "optional" : true, "default" : 1 }, - + "disallow" : { "type" : ["string", "array"], "items" : {"type" : "string"}, "optional" : true, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -160,7 +160,7 @@ "default" : {} } }, - + "optional" : true, "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar index d8fb5335f081b4..463cfb314b6431 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/calendar @@ -12,12 +12,12 @@ "type":"string", "required":true }, - "location" : { - "type" : "string" + "location" : { + "type" : "string" }, "url" : { - "type" : "string", - "format" : "url" + "type" : "string", + "format" : "url" }, "dtend" : { "format" : "date-time", @@ -47,3 +47,7 @@ "geo" : { "$ref" : "http://json-schema.org/draft-03/geo" } } } + + + + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces index 84ebf83a993f6d..288a19856b7263 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/examples/interfaces @@ -6,18 +6,18 @@ "type":"object", "description":"This defines the set of methods available to the class instances", "additionalProperties":{ - "type":"object", - "description":"The definition of the method", - "properties":{ - "parameters":{ - "type":"array", - "description":"The set of parameters that should be passed to the method when it is called", - "items":{"$ref":"#"}, - "required": true - }, - "returns":{"$ref":"#"} - } + "type":"object", + "description":"The definition of the method", + "properties":{ + "parameters":{ + "type":"array", + "description":"The set of parameters that should be passed to the method when it is called", + "items":{"$ref":"#"}, + "required": true + }, + "returns":{"$ref":"#"} + } } - } + } } } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref index 388476323a08ab..7e491a8e882347 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/json-ref @@ -1,26 +1,26 @@ { "$schema" : "http://json-schema.org/draft-03/hyper-schema#", "id" : "http://json-schema.org/draft-03/json-ref#", - + "additionalItems" : {"$ref" : "#"}, "additionalProperties" : {"$ref" : "#"}, - + "links" : [ { "href" : "{id}", "rel" : "self" }, - + { "href" : "{$ref}", "rel" : "full" }, - + { "href" : "{$schema}", "rel" : "describedby" } ], - + "fragmentResolution" : "dot-delimited" } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links index 3dbcdba73cc4e8..6b0a85a6295b25 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/links @@ -2,31 +2,31 @@ "$schema" : "http://json-schema.org/draft-03/hyper-schema#", "id" : "http://json-schema.org/draft-03/links#", "type" : "object", - + "properties" : { "href" : { "type" : "string", "required" : true, "format" : "link-description-object-template" }, - + "rel" : { "type" : "string", "required" : true }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET" }, - + "enctype" : { "type" : "string", "requires" : "method" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-03/hyper-schema#"} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema index 361456d8a7e89e..55ae47d808c0ab 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-03/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-03/schema#", "id" : "http://json-schema.org/draft-03/schema#", "type" : "object", - + "properties" : { "type" : { "type" : ["string", "array"], @@ -12,40 +12,40 @@ "uniqueItems" : true, "default" : "any" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "patternProperties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "additionalItems" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "required" : { "type" : "boolean", "default" : false }, - + "dependencies" : { "type" : "object", "additionalProperties" : { @@ -56,85 +56,85 @@ }, "default" : {} }, - + "minimum" : { "type" : "number" }, - + "maximum" : { "type" : "number" }, - + "exclusiveMinimum" : { "type" : "boolean", "default" : false }, - + "exclusiveMaximum" : { "type" : "boolean", "default" : false }, - + "minItems" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "default" : false }, - + "pattern" : { "type" : "string", "format" : "regex" }, - + "minLength" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer" }, - + "enum" : { "type" : "array", "minItems" : 1, "uniqueItems" : true }, - + "default" : { "type" : "any" }, - + "title" : { "type" : "string" }, - + "description" : { "type" : "string" }, - + "format" : { "type" : "string" }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, "exclusiveMinimum" : true, "default" : 1 }, - + "disallow" : { "type" : ["string", "array"], "items" : { @@ -142,33 +142,33 @@ }, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "id" : { "type" : "string", "format" : "uri" }, - + "$ref" : { "type" : "string", "format" : "uri" }, - + "$schema" : { "type" : "string", "format" : "uri" } }, - + "dependencies" : { "exclusiveMinimum" : "minimum", "exclusiveMaximum" : "maximum" }, - + "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links index 7cf7c92c20965c..de272cc4513d0a 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/links @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-04/hyper-schema#", "id" : "http://json-schema.org/draft-04/links#", "type" : "object", - + "properties" : { "rel" : { "type" : "string" @@ -15,26 +15,26 @@ "template" : { "type" : "string" }, - + "targetSchema" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"}, - + "method" : { "type" : "string", "default" : "GET" }, - + "enctype" : { "type" : "string" }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "http://json-schema.org/draft-04/hyper-schema#"} } }, - + "required" : ["rel", "href"], - + "dependencies" : { "enctype" : "method" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema index e9c90699fda128..598951e57d2eb7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-04/schema @@ -2,7 +2,7 @@ "$schema" : "http://json-schema.org/draft-04/schema#", "id" : "http://json-schema.org/draft-04/schema#", "type" : "object", - + "properties" : { "type" : { "type" : [ @@ -10,19 +10,19 @@ "id" : "#simple-type", "type" : "string", "enum" : ["object", "array", "string", "number", "boolean", "null", "any"] - }, + }, "array" ], "items" : { "type" : [ - {"$ref" : "#simple-type"}, + {"$ref" : "#simple-type"}, {"$ref" : "#"} ] }, "uniqueItems" : true, "default" : "any" }, - + "disallow" : { "type" : ["string", "array"], "items" : { @@ -30,7 +30,7 @@ }, "uniqueItems" : true }, - + "extends" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, @@ -42,108 +42,108 @@ "minItems" : 1, "uniqueItems" : true }, - + "minimum" : { "type" : "number" }, - + "maximum" : { "type" : "number" }, - + "exclusiveMinimum" : { "type" : "boolean", "default" : false }, - + "exclusiveMaximum" : { "type" : "boolean", "default" : false }, - + "divisibleBy" : { "type" : "number", "minimum" : 0, "exclusiveMinimum" : true, "default" : 1 }, - + "minLength" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxLength" : { "type" : "integer" }, - + "pattern" : { "type" : "string" }, - + "items" : { "type" : [{"$ref" : "#"}, "array"], "items" : {"$ref" : "#"}, "default" : {} }, - + "additionalItems" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "minItems" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxItems" : { "type" : "integer", "minimum" : 0 }, - + "uniqueItems" : { "type" : "boolean", "default" : false }, - + "properties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "patternProperties" : { "type" : "object", "additionalProperties" : {"$ref" : "#"}, "default" : {} }, - + "additionalProperties" : { "type" : [{"$ref" : "#"}, "boolean"], "default" : {} }, - + "minProperties" : { "type" : "integer", "minimum" : 0, "default" : 0 }, - + "maxProperties" : { "type" : "integer", "minimum" : 0 }, - + "required" : { "type" : "array", "items" : { "type" : "string" } }, - + "dependencies" : { "type" : "object", "additionalProperties" : { @@ -154,36 +154,36 @@ }, "default" : {} }, - + "id" : { "type" : "string" }, - + "$ref" : { "type" : "string" }, - + "$schema" : { "type" : "string" }, - + "title" : { "type" : "string" }, - + "description" : { "type" : "string" }, - + "default" : { "type" : "any" } }, - + "dependencies" : { "exclusiveMinimum" : "minimum", "exclusiveMaximum" : "maximum" }, - + "default" : {} } \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml index 1cf715910b5a83..c28f40dcd6ee44 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-03.xml @@ -24,7 +24,7 @@ A JSON Media Type for Describing the Structure and Meaning of JSON Documents - + SitePen (USA)
    @@ -37,7 +37,7 @@ kris@sitepen.com
    - +
    @@ -48,7 +48,7 @@ gary.court@gmail.com
    - + Internet Engineering Task Force JSON @@ -58,59 +58,59 @@ Notation Hyper Schema Hypermedia - + - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119.
    - + - +
    - JSON Schema defines the media type "application/schema+json" for + JSON Schema defines the media type "application/schema+json" for describing the structure of other - JSON documents. JSON Schema is JSON-based and includes facilities + JSON documents. JSON Schema is JSON-based and includes facilities for describing the structure of JSON documents in terms of allowable values, descriptions, and interpreting relations with other resources. - JSON Schema format is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary + JSON Schema format is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary concerned with describing a JSON structure and specifying valid elements in the structure. The second definition is the Hyper Schema specification which is intended define elements in a structure that can be interpreted as hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of + Hyper Schema builds on JSON Schema to describe the hyperlink structure of other JSON documents and elements of interaction. This allows user agents to be able to successfully navigate JSON documents based on their schemas. @@ -118,12 +118,12 @@ Cumulatively JSON Schema acts as a meta-document that can be used to define the required type and constraints on property values, as well as define the meaning of the property values for the purpose of describing a resource and determining hyperlinks - within the representation. + within the representation.
    An example JSON Schema that describes products might look like: - - This schema defines the properties of the instance JSON documents, + This schema defines the properties of the instance JSON documents, the required properties (id, name, and price), as well as an optional property (tags). This also defines the link relations of the instance JSON documents.
    - +
    - For this specification, schema will be used to denote a JSON Schema - definition, and an instance refers to a JSON value that the schema + For this specification, schema will be used to denote a JSON Schema + definition, and an instance refers to a JSON value that the schema will be describing and validating.
    - +
    The JSON Schema media type does not attempt to dictate the structure of JSON @@ -194,7 +194,7 @@ This specification is protocol agnostic. The underlying protocol (such as HTTP) should sufficiently define the semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of + representations linked to by JSON representations, and modification of those resources. The goal of this format is to sufficiently describe JSON structures such that one can utilize existing information available in existing JSON @@ -203,7 +203,7 @@
    - +
    JSON Schema instances are correlated to their schema by the "describedby" @@ -217,22 +217,22 @@ representation and messages may retain the self-descriptive characteristic, avoiding the need for out-of-band information about instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection + relation to the schema that describes the meaning of a JSON instance's (or collection of instances) structure. A MIME type parameter named "profile" or a relation of "describedby" (which could be defined by a Link header) may be used: - +
    -
    - + or if the content is being transferred by a protocol (such as HTTP) that provides headers, a Link header can be used: - +
    ; rel="describedby" ]]>
    - - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is defined by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. When collections contain heterogeneous - instances, the "pathStart" attribute MAY be specified in the - schema to disambiguate which schema should be applied for each item in the + + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is defined by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. When collections contain heterogeneous + instances, the "pathStart" attribute MAY be specified in the + schema to disambiguate which schema should be applied for each item in the collection. However, ultimately, the mechanism for referencing a schema is up to the media type of the instance documents (if they choose to specify that schemas can be referenced).
    - +
    - JSON Schemas can themselves be described using JSON Schemas. + JSON Schemas can themselves be described using JSON Schemas. A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-03/schema for the draft-03 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema or http://json-schema.org/draft-03/hyper-schema. All schemas used within a protocol with media type definitions SHOULD include a MIME parameter that refers to the self-descriptive hyper schema or another schema that extends this hyper schema: - +
    - @@ -277,15 +277,15 @@ Content-Type: application/json;
    - +
    - A JSON Schema is a JSON Object that defines various attributes + A JSON Schema is a JSON Object that defines various attributes (including usage and valid values) of a JSON value. JSON Schema has recursive capabilities; there are a number of elements in the structure that allow for nested JSON Schemas. - +
    An example JSON Schema definition could look like: @@ -307,15 +307,15 @@ Content-Type: application/json; ]]>
    - + A JSON Schema object may have any of the following properties, called schema attributes (all attributes are optional): - +
    - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. This attribute can take one of two forms: @@ -332,19 +332,19 @@ Content-Type: application/json; Value MUST be null. Note this is mainly for purpose of being able use union types to define nullability. If this type is not included in a union, null values are not allowed (the primitives listed above do not allow nulls on their own). Value MAY be of any type including null. - - If the property is not defined or is not in this list, then any type of value is acceptable. - Other type values MAY be used for custom purposes, but minimal validators of the specification + + If the property is not defined or is not in this list, then any type of value is acceptable. + Other type values MAY be used for custom purposes, but minimal validators of the specification implementation can allow any instance value on unknown type values. - + An array of two or more simple type definitions. Each item in the array MUST be a simple type definition or a schema. - The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. + The instance value is valid if it is of the same type as one of the simple type definitions, or valid by one of the schemas, in the array. - +
    For example, a schema that defines if an instance can be a string or a number would be: @@ -355,38 +355,38 @@ Content-Type: application/json; ]]>
    - +
    This attribute is an object with property definitions that define the valid values of instance object property values. When the instance value is an object, the property values of the instance object MUST conform to the property definitions in this object. In this object, each property definition's value MUST be a schema, and the property's name MUST be the name of the instance property that it defines. The instance property value MUST be valid according to the schema from the property definition. Properties are considered unordered, the order of the instance properties MAY be in any order.
    - +
    This attribute is an object that defines the schema for a set of property names of an object instance. The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value.
    - +
    This attribute defines a schema for all properties that are not explicitly defined in an object type definition. If specified, the value MUST be a schema or a boolean. If false is provided, no additional properties are allowed beyond the properties defined in the schema. The default value is an empty schema which allows any value for additional properties.
    - +
    This attribute defines the allowed items in an instance array, and MUST be a schema or an array of schemas. The default value is an empty schema which allows any value for items in the instance array. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST conform to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute using the same rules as "additionalProperties" for objects.
    - +
    This provides a definition for additional items in an array instance when tuple definitions of the items is provided. This can be false to indicate additional items in the array are not allowed, or it can be a schema that defines the schema of the additional items.
    - +
    This attribute indicates if the instance must have a value, and not be undefined. This is false by default, making the instance optional.
    - +
    This attribute is an object that defines the requirements of a property on an instance object. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). The dependency value can take one of two forms: - + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. @@ -398,36 +398,36 @@ Content-Type: application/json;
    - +
    This attribute defines the minimum value of the instance property when the type of the instance value is a number.
    - +
    This attribute defines the maximum value of the instance property when the type of the instance value is a number.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value.
    - +
    This attribute defines the minimum number of values in an array when the array is the instance value.
    - +
    This attribute defines the maximum number of values in an array when the array is the instance value.
    - +
    This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). Two instance are consider equal if they are both of the same type and: - + are null; or are booleans/numbers/strings and have the same value; or @@ -436,41 +436,41 @@ Content-Type: application/json;
    - +
    When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5
    - +
    When the instance value is a string, this defines the minimum length of the string.
    - +
    When the instance value is a string, this defines the maximum length of the string.
    - +
    This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems".
    - +
    This attribute defines the default value of the instance when the instance is undefined.
    - +
    This attribute is a string that provides a short description of the instance property.
    - +
    This attribute is a string that provides a full description of the of purpose the instance property.
    - +
    This property defines the type of data, content type, or microformat to be expected in the instance property values. A format attribute MAY be one of the values listed below, and if so, SHOULD adhere to the semantics describing for the format. A format SHOULD only be used to give meaning to primitive types (string, integer, number, or boolean). Validators MAY (but are not required to) validate that the instance values conform to a format. - + The following formats are predefined: - + This SHOULD be a date in ISO 8601 format of YYYY-MM-DDThh:mm:ssZ in UTC time. This is the recommended form of date/timestamp. This SHOULD be a date in the format of YYYY-MM-DD. It is recommended that you use the "date-time" format instead of "date" unless you need to transfer only the date part. @@ -487,18 +487,18 @@ Content-Type: application/json; This SHOULD be a host-name. - + Additional custom formats MAY be created. These custom formats MAY be expressed as an URI, and this URI MAY reference a schema of that format.
    - +
    This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0.
    - +
    This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid.
    - +
    The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. @@ -506,7 +506,7 @@ Content-Type: application/json; instance against all constraints in the extending schema as well as the extended schema(s). More optimized implementations that merge schemas are possible, but are not required. Some examples of using "extends": - +
    - +
    - +
    This attribute defines the current URI of this schema (this attribute is @@ -553,28 +553,28 @@ Content-Type: application/json; is also used to construct relative references such as for $ref.
    - +
    - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema.
    - +
    - This attribute defines a URI of a JSON Schema that is the schema of the current schema. + This attribute defines a URI of a JSON Schema that is the schema of the current schema. When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - + - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes.
    - +
    The following attributes are specified in addition to those @@ -586,28 +586,28 @@ Content-Type: application/json; essentially describes plain JSON (no constraints on the structures). Addition of attributes provides additive information for user agents. - +
    - The value of the links property MUST be an array, where each item + The value of the links property MUST be an array, where each item in the array is a link description object which describes the link relations of the instances. - +
    - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the instances of the schema, and can be parameterized by the instance values. The link description format can be used on its own in regular (non-schema documents), and use of this format can be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: http://json-schema.org/links (latest version) or http://json-schema.org/draft-03/links (draft-03 version). - +
    The value of the "href" link description property @@ -615,19 +615,19 @@ Content-Type: application/json; of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 and MAY be a relative URI. The base URI to be used for relative resolution SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance object, if property values exist for the corresponding variables in the template (otherwise they MAY be provided from alternate sources, like user input). - + Instance property values SHOULD be substituted into the URIs where matching braces ('{', '}') are found surrounding zero or more characters, creating an expanded URI. Instance property value substitutions are resolved by using the text between the braces to denote the property name - from the instance to get the value to substitute. - + from the instance to get the value to substitute. +
    For example, if an href value is defined: @@ -637,7 +637,7 @@ http://somesite.com/{id} Then it would be resolved by replace the value of the "id" property value from the instance object.
    - +
    If the value of the "id" property was "45", the expanded URI would be: @@ -646,23 +646,23 @@ http://somesite.com/45 ]]>
    - - If matching braces are found with the string "@" (no quotes) between the braces, then the + + If matching braces are found with the string "@" (no quotes) between the braces, then the actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, + This should only be used in situations where the instance is a scalar (string, boolean, or number), and not for objects or arrays.
    - +
    - The value of the "rel" property indicates the name of the + The value of the "rel" property indicates the name of the relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - + If the relation value is "self", when this property is encountered in @@ -670,15 +670,15 @@ http://somesite.com/45 treated as a full representation of the target resource identified by the specified URI. - + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - + This relation indicates that the target of the link SHOULD be treated as the root or the body of the representation for the @@ -688,7 +688,7 @@ http://somesite.com/45 - + The following relations are applicable for schemas (the schema as the "from" resource in the relation): @@ -697,7 +697,7 @@ http://somesite.com/45 This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - +
    For example, if a schema is defined: @@ -718,7 +718,7 @@ http://somesite.com/45 ]]>
    - +
    And if a collection of instance resource's JSON representation was retrieved: @@ -742,37 +742,37 @@ GET /Resource/ The "children" collection would be located at "/Resource/?upId=thing".
    - +
    This property value is a schema that defines the expected structure of the JSON representation of the target of the link.
    - +
    - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a means for submitting extra (often user supplied) information to send to a server. - +
    - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). This defaults to "GET".
    - +
    If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be + supports for querying or posting to the collection of instances at the target + resource. The query can be suffixed to the target URI to query the collection with property-based constraints on the resources that SHOULD be returned from the server or used to post data to the resource (depending on the method). - +
    For example, with the following schema: @@ -793,7 +793,7 @@ GET /Resource/ This indicates that the client can query the server for instances that have a specific name.
    - +
    For example: @@ -803,23 +803,23 @@ GET /Resource/
    - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is the default media type.
    - +
    This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string + request (for a GET request, this schema would define the properties for the query string and for a POST request, this would define the body).
    - +
    This property indicates the fragment resolution protocol to use for @@ -829,12 +829,12 @@ GET /Resource/ protocol is "slash-delimited", which is defined below. Other fragment resolution protocols MAY be used, but are not defined in this document. - + The fragment identifier is based on RFC 2396, Sec 5, and defines the mechanism for resolving references to entities within a document. - +
    With the slash-delimited fragment resolution protocol, the fragment @@ -852,15 +852,15 @@ GET /Resource/ item in array the array with the index defined by the next property reference token (which MUST be a number). The target is successively updated for each property reference token, until the entire fragment has - been traversed. + been traversed. - + - Property names SHOULD be URI-encoded. In particular, any "/" in a - property name MUST be encoded to avoid being interpreted as a property + Property names SHOULD be URI-encoded. In particular, any "/" in a + property name MUST be encoded to avoid being interpreted as a property delimiter. - +
    For example, for the following JSON representation: @@ -879,7 +879,7 @@ GET /Resource/ ]]>
    - +
    The following fragment identifiers would be resolved: @@ -889,10 +889,10 @@ fragment identifier resolution # self, the root of the resource itself #/foo the object referred to by the foo property #/foo/another%20prop the object referred to by the "another prop" - property of the object referred to by the + property of the object referred to by the "foo" property #/foo/another%20prop/baz the string referred to by the value of "baz" - property of the "another prop" property of + property of the "another prop" property of the object referred to by the "foo" property #/foo/anArray/0 the first object in the "anArray" array ]]> @@ -900,61 +900,61 @@ fragment identifier resolution
    - +
    - The dot-delimited fragment resolution protocol is the same as - slash-delimited fragment resolution protocol except that the "." character - (\x2E) is used as the delimiter between property names (instead of "/") and + The dot-delimited fragment resolution protocol is the same as + slash-delimited fragment resolution protocol except that the "." character + (\x2E) is used as the delimiter between property names (instead of "/") and the path does not need to start with a ".". For example, #.foo and #foo are a valid fragment identifiers for referencing the value of the foo propery.
    - +
    This attribute indicates that the instance property SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server.
    - +
    If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property.
    - +
    - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, and is relative to the instance's URI. - + - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable to all the instances for which it is referenced.
    - +
    This attribute defines the media type of the instance representations that this schema is defining.
    - +
    - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent + is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource + equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link. - +
    For example, if a hyper schema was defined: @@ -968,7 +968,7 @@ fragment identifier resolution ]]>
    - +
    And a resource was requested from somesite.com: @@ -1005,22 +1005,22 @@ Content-Type: application/json; profile=/schema-for-this-data
    - +
    The proposed MIME media type for JSON Schema is "application/schema+json". Type name: application Subtype name: schema+json Required parameters: profile - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the meta-schema). Normally the value would be http://json-schema.org/draft-03/hyper-schema, but it is allowable to use other schemas that extend the hyper schema's meta- schema. Optional parameters: pretty The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - +
    This registry is maintained by IANA per RFC 4287 and this specification adds @@ -1032,7 +1032,7 @@ Content-Type: application/json; profile=/schema-for-this-data
    - + @@ -1080,7 +1080,7 @@ Content-Type: application/json; profile=/schema-for-this-data Added "$ref" and "$schema" attributes. - + Replaced "maxDecimal" attribute with "divisibleBy" attribute. @@ -1090,13 +1090,13 @@ Content-Type: application/json; profile=/schema-for-this-data Added "targetSchema" attribute to link description object. - + Fixed category and updates from template. - + Initial draft. @@ -1105,7 +1105,7 @@ Content-Type: application/json; profile=/schema-for-this-data - +
    diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml index 22fb3290df1472..f9c1ea5a0c00a2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/draft-zyp-json-schema-04.xml @@ -23,7 +23,7 @@ A JSON Media Type for Describing the Structure and Meaning of JSON Documents - + SitePen (USA)
    @@ -36,7 +36,7 @@ kris@sitepen.com
    - +
    @@ -47,7 +47,7 @@ gary.court@gmail.com
    - + Internet Engineering Task Force JSON @@ -57,48 +57,48 @@ Notation Hyper Schema Hypermedia - + - JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", - a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema defines the media type "application/schema+json", + a JSON based format for defining the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - JSON (JavaScript Object Notation) Schema is a JSON media type for defining - the structure of JSON data. JSON Schema provides a contract for what JSON - data is required for a given application and how to interact with it. JSON - Schema is intended to define validation, documentation, hyperlink - navigation, and interaction control of JSON data. + JSON (JavaScript Object Notation) Schema is a JSON media type for defining + the structure of JSON data. JSON Schema provides a contract for what JSON + data is required for a given application and how to interact with it. JSON + Schema is intended to define validation, documentation, hyperlink + navigation, and interaction control of JSON data.
    - +
    - - - The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", + + The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119. - + - The terms "JSON", "JSON text", "JSON value", "member", "element", "object", - "array", "number", "string", "boolean", "true", "false", and "null" in this + The terms "JSON", "JSON text", "JSON value", "member", "element", "object", + "array", "number", "string", "boolean", "true", "false", and "null" in this document are to be interpreted as defined in RFC 4627. - + This specification also uses the following defined terms: - + A JSON Schema object. Equivalent to "JSON value" as defined in RFC 4627. @@ -108,35 +108,35 @@
    - +
    - JSON Schema defines the media type "application/schema+json" for - describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities + JSON Schema defines the media type "application/schema+json" for + describing the structure of JSON text. JSON Schemas are also written in JSON and includes facilities for describing the structure of JSON in terms of allowable values, descriptions, and interpreting relations with other resources. - This document is organized into several separate definitions. The first - definition is the core schema specification. This definition is primary + This document is organized into several separate definitions. The first + definition is the core schema specification. This definition is primary concerned with describing a JSON structure and specifying valid elements in the structure. The second definition is the Hyper Schema specification which is intended to define elements in a structure that can be interpreted as hyperlinks. - Hyper Schema builds on JSON Schema to describe the hyperlink structure of + Hyper Schema builds on JSON Schema to describe the hyperlink structure of JSON values. This allows user agents to be able to successfully navigate documents containing JSON based on their schemas. - Cumulatively JSON Schema acts as meta-JSON that can be used to define the + Cumulatively JSON Schema acts as meta-JSON that can be used to define the required type and constraints on JSON values, as well as define the meaning of the JSON values for the purpose of describing a resource and determining - hyperlinks within the representation. + hyperlinks within the representation.
    An example JSON Schema that describes products might look like: - - This schema defines the properties of the instance, + This schema defines the properties of the instance, the required properties (id, name, and price), as well as an optional property (tags). This also defines the link relations of the instance.
    - +
    The JSON Schema media type does not attempt to dictate the structure of JSON @@ -195,7 +195,7 @@ This specification is protocol agnostic. The underlying protocol (such as HTTP) should sufficiently define the semantics of the client-server interface, the retrieval of resource - representations linked to by JSON representations, and modification of + representations linked to by JSON representations, and modification of those resources. The goal of this format is to sufficiently describe JSON structures such that one can utilize existing information available in existing JSON @@ -204,35 +204,35 @@
    - +
    JSON values are correlated to their schema by the "describedby" relation, where the schema is the target of the relation. JSON values MUST be of the "application/json" media type or - any other subtype. Consequently, dictating how a JSON value should + any other subtype. Consequently, dictating how a JSON value should specify the relation to the schema is beyond the normative scope of this document since this document specifically defines the JSON Schema media type, and no other. It is RECOMMNENDED that JSON values specify their schema so that user agents can interpret the instance and retain the self-descriptive characteristics. This avoides the need for out-of-band information about instance data. Two approaches are recommended for declaring the - relation to the schema that describes the meaning of a JSON instance's (or collection + relation to the schema that describes the meaning of a JSON instance's (or collection of instances) structure. A MIME type parameter named "profile" or a relation of "describedby" (which could be specified by a Link header) may be used: - +
    -
    - + or if the content is being transferred by a protocol (such as HTTP) that provides headers, a Link header can be used: - +
    ; rel="describedby" ]]>
    - - Instances MAY specify multiple schemas, to indicate all the schemas that - are applicable to the data, and the data SHOULD be valid by all the schemas. - The instance data MAY have multiple schemas - that it is described by (the instance data SHOULD be valid for those schemas). - Or if the document is a collection of instances, the collection MAY contain - instances from different schemas. The mechanism for referencing a schema is - determined by the media type of the instance (if it provides a method for + + Instances MAY specify multiple schemas, to indicate all the schemas that + are applicable to the data, and the data SHOULD be valid by all the schemas. + The instance data MAY have multiple schemas + that it is described by (the instance data SHOULD be valid for those schemas). + Or if the document is a collection of instances, the collection MAY contain + instances from different schemas. The mechanism for referencing a schema is + determined by the media type of the instance (if it provides a method for referencing schemas).
    - +
    - JSON Schemas can themselves be described using JSON Schemas. + JSON Schemas can themselves be described using JSON Schemas. A self-describing JSON Schema for the core JSON Schema can - be found at http://json-schema.org/schema for the latest version or - http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema - self-description can be found at http://json-schema.org/hyper-schema + be found at http://json-schema.org/schema for the latest version or + http://json-schema.org/draft-04/schema for the draft-04 version. The hyper schema + self-description can be found at http://json-schema.org/hyper-schema or http://json-schema.org/draft-04/hyper-schema. All schemas used within a protocol with a media type specified SHOULD include a MIME parameter that refers to the self-descriptive hyper schema or another schema that extends this hyper schema: - +
    - @@ -273,15 +273,15 @@ Content-Type: application/json;
    - +
    - A JSON Schema is a JSON object that defines various attributes + A JSON Schema is a JSON object that defines various attributes (including usage and valid values) of a JSON value. JSON Schema has recursive capabilities; there are a number of elements in the structure that allow for nested JSON Schemas. - +
    An example JSON Schema could look like: @@ -305,17 +305,17 @@ Content-Type: application/json; ]]>
    - + A JSON Schema object MAY have any of the following optional properties: - + - +
    - This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. + This attribute defines what the primitive type or the schema of the instance MUST be in order to validate. This attribute can take one of two forms: @@ -332,16 +332,16 @@ Content-Type: application/json; Instance MAY be of any type, including null. - + An array of one or more simple or schema types. - The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. + The instance value is valid if it is of the same type as one of the simple types, or valid by one of the schemas, in the array. - - If this attribute is not specified, then all value types are accepted. + + If this attribute is not specified, then all value types are accepted. - +
    For example, a schema that defines if an instance can be a string or a number would be: @@ -352,37 +352,37 @@ Content-Type: application/json; ]]>
    - +
    This attribute is an object with properties that specify the schemas for the properties of the instance object. - In this attribute's object, each property value MUST be a schema. + In this attribute's object, each property value MUST be a schema. When the instance value is an object, the value of the instance's properties MUST be valid according to the schemas with the same property names specified in this attribute. Objects are unordered, so therefore the order of the instance properties or attribute properties MUST NOT determine validation success.
    - +
    - This attribute is an object that defines the schema for a set of property names of an object instance. - The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. + This attribute is an object that defines the schema for a set of property names of an object instance. + The name of each property of this attribute's object is a regular expression pattern in the ECMA 262/Perl 5 format, while the value is a schema. If the pattern matches the name of a property on the instance object, the value of the instance's property MUST be valid against the pattern name's schema value.
    - +
    - This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. + This attribute specifies how any instance property that is not explicitly defined by either the "properties" or "patternProperties" attributes (hereafter referred to as "additional properties") is handled. If specified, the value MUST be a schema or a boolean. If a schema is provided, then all additional properties MUST be valid according to the schema. If false is provided, then no additional properties are allowed. The default value is an empty schema, which allows any value for additional properties.
    - +
    This attribute provides the allowed items in an array instance. If specified, this attribute MUST be a schema or an array of schemas. When this attribute value is a schema and the instance value is an array, then all the items in the array MUST be valid according to the schema. When this attribute value is an array of schemas and the instance value is an array, each position in the instance array MUST be valid according to the schema in the corresponding position for this array. This called tuple typing. When tuple typing is used, additional items are allowed, disallowed, or constrained by the "additionalItems" attribute the same way as "additionalProperties" for objects is.
    - +
    This attribute specifies how any item in the array instance that is not explicitly defined by "items" (hereafter referred to as "additional items") is handled. If specified, the value MUST be a schema or a boolean. If a schema is provided: @@ -395,16 +395,16 @@ Content-Type: application/json; If false is provided, then any additional items in the array are not allowed. The default value is an empty schema, which allows any value for additional items.
    - +
    This attribute is an array of strings that defines all the property names that must exist on the object instance.
    - +
    This attribute is an object that specifies the requirements of a property on an object instance. If an object instance has a property with the same name as a property in this attribute's object, then the instance must be valid against the attribute's property value (hereafter referred to as the "dependency value"). The dependency value can take one of two forms: - + If the dependency value is a string, then the instance object MUST have a property with the same name as the dependency value. @@ -416,44 +416,44 @@ Content-Type: application/json;
    - +
    This attribute defines the minimum value of the instance property when the type of the instance value is a number.
    - +
    This attribute defines the maximum value of the instance property when the type of the instance value is a number.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "minimum" attribute. This is false by default, meaning the instance value can be greater then or equal to the minimum value.
    - +
    This attribute indicates if the value of the instance (if the instance is a number) can not equal the number defined by the "maximum" attribute. This is false by default, meaning the instance value can be less then or equal to the maximum value.
    - +
    This attribute defines the minimum number of values in an array when the array is the instance value.
    - +
    This attribute defines the maximum number of values in an array when the array is the instance value.
    - +
    This attribute defines the minimum number of properties required on an object instance.
    - +
    This attribute defines the maximum number of properties the object instance can have.
    - +
    This attribute indicates that all items in an array instance MUST be unique (contains no two identical values). Two instance are consider equal if they are both of the same type and: - + are null; or are booleans/numbers/strings and have the same value; or @@ -462,43 +462,43 @@ Content-Type: application/json;
    - +
    When the instance value is a string, this provides a regular expression that a string instance MUST match in order to be valid. Regular expressions SHOULD follow the regular expression specification from ECMA 262/Perl 5
    - +
    When the instance value is a string, this defines the minimum length of the string.
    - +
    When the instance value is a string, this defines the maximum length of the string.
    - +
    This provides an enumeration of all possible values that are valid for the instance property. This MUST be an array, and each item in the array represents a possible value for the instance value. If this attribute is defined, the instance value MUST be one of the values in the array in order for the schema to be valid. Comparison of enum values uses the same algorithm as defined in "uniqueItems".
    - +
    This attribute defines the default value of the instance when the instance is undefined.
    - +
    This attribute is a string that provides a short description of the instance property.
    - +
    This attribute is a string that provides a full description of the of purpose the instance property.
    - +
    This attribute defines what value the number instance must be divisible by with no remainder (the result of the division must be an integer.) The value of this attribute SHOULD NOT be 0.
    - +
    This attribute takes the same values as the "type" attribute, however if the instance matches the type or if this value is an array and the instance matches any type or schema in the array, then this instance is not valid.
    - +
    The value of this property MUST be another schema which will provide a base schema which the current schema will inherit from. The inheritance rules are such that any instance that is valid according to the current schema MUST be valid according to the referenced schema. This MAY also be an array, in which case, the instance MUST be valid for all the schemas in the array. A schema that extends another schema MAY define additional attributes, constrain existing attributes, or add other constraints. @@ -506,7 +506,7 @@ Content-Type: application/json; instance against all constraints in the extending schema as well as the extended schema(s). More optimized implementations that merge schemas are possible, but are not required. Some examples of using "extends": - +
    - +
    - +
    This attribute defines the current URI of this schema (this attribute is @@ -553,28 +553,28 @@ Content-Type: application/json; is also used to construct relative references such as for $ref.
    - +
    - This attribute defines a URI of a schema that contains the full representation of this schema. - When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. + This attribute defines a URI of a schema that contains the full representation of this schema. + When a validator encounters this attribute, it SHOULD replace the current schema with the schema referenced by the value's URI (if known and available) and re-validate the instance. This URI MAY be relative or absolute, and relative URIs SHOULD be resolved against the URI of the current schema.
    - +
    - This attribute defines a URI of a JSON Schema that is the schema of the current schema. + This attribute defines a URI of a JSON Schema that is the schema of the current schema. When this attribute is defined, a validator SHOULD use the schema referenced by the value's URI (if known and available) when resolving Hyper Schemalinks. - + - A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. + A validator MAY use this attribute's value to determine which version of JSON Schema the current schema is written in, and provide the appropriate validation features and behavior. Therefore, it is RECOMMENDED that all schema authors include this attribute in their schemas to prevent conflicts with future JSON Schema specification changes.
    - +
    The following attributes are specified in addition to those @@ -586,30 +586,30 @@ Content-Type: application/json; essentially describes plain JSON (no constraints on the structures). Addition of attributes provides additive information for user agents. - +
    - The value of the links property MUST be an array, where each item + The value of the links property MUST be an array, where each item in the array is a link description object which describes the link relations of the instances. - + - +
    - A link description object is used to describe link relations. In - the context of a schema, it defines the link relations of the + A link description object is used to describe link relations. In + the context of a schema, it defines the link relations of the instances of the schema, and can be parameterized by the instance - values. The link description format can be used without JSON Schema, + values. The link description format can be used without JSON Schema, and use of this format can be declared by referencing the normative link description - schema as the the schema for the data structure that uses the - links. The URI of the normative link description schema is: + schema as the the schema for the data structure that uses the + links. The URI of the normative link description schema is: http://json-schema.org/links (latest version) or http://json-schema.org/draft-04/links (draft-04 version). - +
    The value of the "href" link description property @@ -617,19 +617,19 @@ Content-Type: application/json; of the instance property SHOULD be resolved as a URI-Reference per RFC 3986 and MAY be a relative URI. The base URI to be used for relative resolution SHOULD be the URI used to retrieve the instance object (not the schema) - when used within a schema. Also, when links are used within a schema, the URI - SHOULD be parametrized by the property values of the instance + when used within a schema. Also, when links are used within a schema, the URI + SHOULD be parametrized by the property values of the instance object, if property values exist for the corresponding variables in the template (otherwise they MAY be provided from alternate sources, like user input). - + Instance property values SHOULD be substituted into the URIs where matching braces ('{', '}') are found surrounding zero or more characters, creating an expanded URI. Instance property value substitutions are resolved by using the text between the braces to denote the property name - from the instance to get the value to substitute. - + from the instance to get the value to substitute. +
    For example, if an href value is defined: @@ -639,7 +639,7 @@ http://somesite.com/{id} Then it would be resolved by replace the value of the "id" property value from the instance object.
    - +
    If the value of the "id" property was "45", the expanded URI would be: @@ -648,23 +648,23 @@ http://somesite.com/45 ]]>
    - - If matching braces are found with the string "@" (no quotes) between the braces, then the + + If matching braces are found with the string "@" (no quotes) between the braces, then the actual instance value SHOULD be used to replace the braces, rather than a property value. - This should only be used in situations where the instance is a scalar (string, + This should only be used in situations where the instance is a scalar (string, boolean, or number), and not for objects or arrays.
    - +
    - The value of the "rel" property indicates the name of the + The value of the "rel" property indicates the name of the relation to the target resource. The relation to the target SHOULD be interpreted as specifically from the instance object that the schema (or sub-schema) applies to, not just the top level resource that contains the object within its hierarchy. If a resource JSON representation contains a sub object with a property interpreted as a link, that sub-object holds the relation with the target. A relation to target from the top level resource MUST be indicated with the schema describing the top level JSON representation. - + Relationship definitions SHOULD NOT be media type dependent, and users are encouraged to utilize existing accepted relation definitions, including those in existing relation registries (see RFC 4287). However, we define these relations here for clarity of normative interpretation within the context of JSON hyper schema defined relations: - + If the relation value is "self", when this property is encountered in @@ -672,15 +672,15 @@ http://somesite.com/45 treated as a full representation of the target resource identified by the specified URI. - + This indicates that the target of the link is the full representation for the instance object. The object that contains this link possibly may not be the full representation. - + This indicates the target of the link is the schema for the instance object. This MAY be used to specifically denote the schemas of objects within a JSON object hierarchy, facilitating polymorphic type data structures. - + This relation indicates that the target of the link SHOULD be treated as the root or the body of the representation for the @@ -690,7 +690,7 @@ http://somesite.com/45 - + The following relations are applicable for schemas (the schema as the "from" resource in the relation): @@ -699,7 +699,7 @@ http://somesite.com/45 This indicates a target to use for creating new instances of a schema. This link definition SHOULD be a submission link with a non-safe method (like POST). - +
    For example, if a schema is defined: @@ -720,7 +720,7 @@ http://somesite.com/45 ]]>
    - +
    And if a collection of instance resource's JSON representation was retrieved: @@ -744,41 +744,41 @@ GET /Resource/ The "children" collection would be located at "/Resource/?upId=thing".
    - +
    This property value is a string that defines the templating language used in the "href" attribute. If no templating language is defined, then the default Link Description Object templating langauge is used.
    - +
    This property value is a schema that defines the expected structure of the JSON representation of the target of the link.
    - +
    - The following properties also apply to link definition objects, and - provide functionality analogous to HTML forms, in providing a + The following properties also apply to link definition objects, and + provide functionality analogous to HTML forms, in providing a means for submitting extra (often user supplied) information to send to a server. - +
    - This attribute defines which method can be used to access the target resource. - In an HTTP environment, this would be "GET" or "POST" (other HTTP methods - such as "PUT" and "DELETE" have semantics that are clearly implied by - accessed resources, and do not need to be defined here). + This attribute defines which method can be used to access the target resource. + In an HTTP environment, this would be "GET" or "POST" (other HTTP methods + such as "PUT" and "DELETE" have semantics that are clearly implied by + accessed resources, and do not need to be defined here). This defaults to "GET".
    - +
    If present, this property indicates a query media type format that the server - supports for querying or posting to the collection of instances at the target - resource. The query can be + supports for querying or posting to the collection of instances at the target + resource. The query can be suffixed to the target URI to query the collection with property-based constraints on the resources that SHOULD be returned from the server or used to post data to the resource (depending on the method). - +
    For example, with the following schema: @@ -799,7 +799,7 @@ GET /Resource/ This indicates that the client can query the server for instances that have a specific name.
    - +
    For example: @@ -809,23 +809,23 @@ GET /Resource/
    - If no enctype or method is specified, only the single URI specified by - the href property is defined. If the method is POST, "application/json" is + If no enctype or method is specified, only the single URI specified by + the href property is defined. If the method is POST, "application/json" is the default media type.
    - +
    This attribute contains a schema which defines the acceptable structure of the submitted - request (for a GET request, this schema would define the properties for the query string + request (for a GET request, this schema would define the properties for the query string and for a POST request, this would define the body).
    - +
    This property indicates the fragment resolution protocol to use for @@ -835,62 +835,62 @@ GET /Resource/ protocol is "json-pointer", which is defined below. Other fragment resolution protocols MAY be used, but are not defined in this document. - + The fragment identifier is based on RFC 3986, Sec 5, and defines the mechanism for resolving references to entities within a document. - +
    The "json-pointer" fragment resolution protocol uses a JSON Pointer to resolve fragment identifiers in URIs within instance representations.
    - + - +
    This attribute indicates that the instance value SHOULD NOT be changed. Attempts by a user agent to modify the value of this property are expected to be rejected by a server.
    - +
    If the instance property value is a string, this attribute defines that the string SHOULD be interpreted as binary data and decoded using the encoding named by this schema property. RFC 2045, Sec 6.1 lists the possible values for this property.
    - +
    - This attribute is a URI that defines what the instance's URI MUST start with in order to validate. - The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, + This attribute is a URI that defines what the instance's URI MUST start with in order to validate. + The value of the "pathStart" attribute MUST be resolved as per RFC 3986, Sec 5, and is relative to the instance's URI. - + - When multiple schemas have been referenced for an instance, the user agent - can determine if this schema is applicable for a particular instance by + When multiple schemas have been referenced for an instance, the user agent + can determine if this schema is applicable for a particular instance by determining if the URI of the instance begins with the the value of the "pathStart" - attribute. If the URI of the instance does not start with this URI, - or if another schema specifies a starting URI that is longer and also matches the - instance, this schema SHOULD NOT be applied to the instance. Any schema - that does not have a pathStart attribute SHOULD be considered applicable + attribute. If the URI of the instance does not start with this URI, + or if another schema specifies a starting URI that is longer and also matches the + instance, this schema SHOULD NOT be applied to the instance. Any schema + that does not have a pathStart attribute SHOULD be considered applicable to all the instances for which it is referenced.
    - +
    This attribute defines the media type of the instance representations that this schema is defining.
    - +
    - This specification is a sub-type of the JSON format, and - consequently the security considerations are generally the same as RFC 4627. + This specification is a sub-type of the JSON format, and + consequently the security considerations are generally the same as RFC 4627. However, an additional issue is that when link relation of "self" - is used to denote a full representation of an object, the user agent + is used to denote a full representation of an object, the user agent SHOULD NOT consider the representation to be the authoritative representation of the resource denoted by the target URI if the target URI is not - equivalent to or a sub-path of the the URI used to request the resource + equivalent to or a sub-path of the the URI used to request the resource representation which contains the target URI with the "self" link. - +
    For example, if a hyper schema was defined: @@ -904,7 +904,7 @@ GET /Resource/ ]]>
    - +
    And a resource was requested from somesite.com: @@ -941,22 +941,22 @@ Content-Type: application/json; profile=/schema-for-this-data
    - +
    The proposed MIME media type for JSON Schema is "application/schema+json". Type name: application Subtype name: schema+json Required parameters: profile - The value of the profile parameter SHOULD be a URI (relative or absolute) that - refers to the schema used to define the structure of this structure (the + The value of the profile parameter SHOULD be a URI (relative or absolute) that + refers to the schema used to define the structure of this structure (the meta-schema). Normally the value would be http://json-schema.org/draft-04/hyper-schema, but it is allowable to use other schemas that extend the hyper schema's meta- schema. Optional parameters: pretty The value of the pretty parameter MAY be true or false to indicate if additional whitespace has been included to make the JSON representation easier to read. - +
    This registry is maintained by IANA per RFC 4287 and this specification adds @@ -968,7 +968,7 @@ Content-Type: application/json; profile=/schema-for-this-data
    - + @@ -1019,7 +1019,7 @@ Content-Type: application/json; profile=/schema-for-this-data Improved wording of many sections.
    - + Added example and verbiage to "extends" attribute. @@ -1043,7 +1043,7 @@ Content-Type: application/json; profile=/schema-for-this-data Added "$ref" and "$schema" attributes. - + Replaced "maxDecimal" attribute with "divisibleBy" attribute. @@ -1053,13 +1053,13 @@ Content-Type: application/json; profile=/schema-for-this-data Added "targetSchema" attribute to link description object. - + Fixed category and updates from template. - + Initial draft. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js index 60b38233344cf6..5b1bbbfdd61c8d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/links.js @@ -1,4 +1,4 @@ -/** +/** * JSON Schema link handler * Copyright (c) 2007 Kris Zyp SitePen (www.sitepen.com) * Licensed under the MIT (MIT-LICENSE.txt) license. @@ -11,11 +11,11 @@ exports.getLink = function(relation, instance, schema){ // gets the URI of the link for the given relation based on the instance and schema // for example: // getLink( - // "brother", - // {"brother_id":33}, + // "brother", + // {"brother_id":33}, // {links:[{rel:"brother", href:"Brother/{brother_id}"}]}) -> // "Brother/33" - var links = schema.__linkTemplates; + var links = schema.__linkTemplates; if(!links){ links = {}; var schemaLinks = schema.links; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js index 53c7233cc83613..97cbbf6fa34603 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/lib/validate.js @@ -194,8 +194,8 @@ var validate = exports._validate = function(/*Any*/instance,/*Object*/schema,/*O if(typeof instance != 'object' || instance instanceof Array){ errors.push({property:path,message:"an object is required"}); } - - for(var i in objTypeDef){ + + for(var i in objTypeDef){ if(objTypeDef.hasOwnProperty(i)){ var value = instance[i]; // skip _not_ specified properties diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json index ff4eeb116747e8..b77d8b34664b20 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "json-schema@0.2.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "json-schema@0.2.2", + "scope": null, + "escapedName": "json-schema", + "name": "json-schema", + "rawSpec": "0.2.2", + "spec": "0.2.2", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "json-schema@0.2.2", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/json-schema", "_npmUser": { - "email": "kriszyp@gmail.com", - "name": "kriszyp" + "name": "kriszyp", + "email": "kriszyp@gmail.com" }, "_npmVersion": "1.1.59", "_phantomChildren": {}, "_requested": { - "name": "json-schema", "raw": "json-schema@0.2.2", - "rawSpec": "0.2.2", "scope": null, + "escapedName": "json-schema", + "name": "json-schema", + "rawSpec": "0.2.2", "spec": "0.2.2", "type": "version" }, @@ -31,7 +40,7 @@ "_shasum": "50354f19f603917c695f70b85afa77c3b0f23506", "_shrinkwrap": null, "_spec": "json-schema@0.2.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "author": { "name": "Kris Zyp" }, @@ -48,7 +57,7 @@ }, "dist": { "shasum": "50354f19f603917c695f70b85afa77c3b0f23506", - "tarball": "http://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" + "tarball": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz" }, "homepage": "https://github.com/kriszyp/json-schema#readme", "keywords": [ diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md index 3393baeecb0337..e9b5497851cc45 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/README.md @@ -41,7 +41,7 @@ request handler that stats a file and fails if it doesn't exist: fs.stat(filename, function (err) { if (err) /* Annotate the "stat" error with what we were doing. */ - return (callback(new verror.VError(err, + return (callback(new verror.VError(err, 'failed to check "%s"', filename))); /* ... */ @@ -49,14 +49,14 @@ request handler that stats a file and fails if it doesn't exist: } function handleRequest(filename, callback) { - checkFile('/nonexistent', function (err) { - if (err) { - /* Annotate the "checkFile" error with what we were doing. */ - return (callback(new verror.VError(err, 'request failed'))); - } - - /* ... */ - }); + checkFile('/nonexistent', function (err) { + if (err) { + /* Annotate the "checkFile" error with what we were doing. */ + return (callback(new verror.VError(err, 'request failed'))); + } + + /* ... */ + }); } handleRequest('/nonexistent', function (err) { diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf index 9b19899be678b9..bd724a2c784030 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/jsl.node.conf @@ -1,5 +1,5 @@ # -# Configuration File for JavaScript Lint +# Configuration File for JavaScript Lint # # This configuration file can be used to lint a collection of scripts, or to enable # or disable warnings for scripts that are linted via the command line. @@ -136,3 +136,4 @@ # To add a set of files, use "+process FileName", "+process Folder\Path\*.js", # or "+process Folder\Path\*.htm". # + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json index d1cd81287b3ec4..888fea03ebf0ec 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "verror@1.3.6", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" + { + "raw": "verror@1.3.6", + "scope": null, + "escapedName": "verror", + "name": "verror", + "rawSpec": "1.3.6", + "spec": "1.3.6", + "type": "version" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim" ] ], "_from": "verror@1.3.6", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/jsprim/verror", "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, "_npmVersion": "1.1.65", "_phantomChildren": {}, "_requested": { - "name": "verror", "raw": "verror@1.3.6", - "rawSpec": "1.3.6", "scope": null, + "escapedName": "verror", + "name": "verror", + "rawSpec": "1.3.6", "spec": "1.3.6", "type": "version" }, @@ -31,7 +40,7 @@ "_shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", "_shrinkwrap": null, "_spec": "verror@1.3.6", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim", "bugs": { "url": "https://github.com/davepacheco/node-verror/issues" }, @@ -43,7 +52,7 @@ "directories": {}, "dist": { "shasum": "cff5df12946d297d2baaefaa2689e25be01c005c", - "tarball": "http://registry.npmjs.org/verror/-/verror-1.3.6.tgz" + "tarball": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz" }, "engines": [ "node >=0.6.0" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json index c172f623371be1..e7c32411843366 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json @@ -1,38 +1,51 @@ { "_args": [ [ - "jsprim@^1.2.2", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature" + { + "raw": "jsprim@^1.2.2", + "scope": null, + "escapedName": "jsprim", + "name": "jsprim", + "rawSpec": "^1.2.2", + "spec": ">=1.2.2 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], "_from": "jsprim@>=1.2.2 <2.0.0", - "_id": "jsprim@1.2.2", + "_id": "jsprim@1.3.0", "_inCache": true, "_installable": true, "_location": "/request/http-signature/jsprim", - "_nodeVersion": "0.12.2", + "_nodeVersion": "0.12.7", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/jsprim-1.3.0.tgz_1466708163640_0.5282344303559512" + }, "_npmUser": { - "email": "dap@cs.brown.edu", - "name": "dap" + "name": "dap", + "email": "dap@cs.brown.edu" }, - "_npmVersion": "2.7.4", + "_npmVersion": "2.11.3", "_phantomChildren": {}, "_requested": { - "name": "jsprim", "raw": "jsprim@^1.2.2", - "rawSpec": "^1.2.2", "scope": null, + "escapedName": "jsprim", + "name": "jsprim", + "rawSpec": "^1.2.2", "spec": ">=1.2.2 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature" ], - "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz", - "_shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1", + "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz", + "_shasum": "ce2e1bef835204b4f3099928c602f8b6ae615650", "_shrinkwrap": null, "_spec": "jsprim@^1.2.2", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", "bugs": { "url": "https://github.com/davepacheco/node-jsprim/issues" }, @@ -45,14 +58,14 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1", - "tarball": "http://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz" + "shasum": "ce2e1bef835204b4f3099928c602f8b6ae615650", + "tarball": "https://registry.npmjs.org/jsprim/-/jsprim-1.3.0.tgz" }, "engines": [ "node >=0.6.0" ], - "gitHead": "0e709876c35eddfe4c1f95104ac3c4abfc9dab84", - "homepage": "https://github.com/davepacheco/node-jsprim", + "gitHead": "694edcb22e2291c21f6c2a23907bf02e1edbfdf4", + "homepage": "https://github.com/davepacheco/node-jsprim#readme", "license": "MIT", "main": "./lib/jsprim.js", "maintainers": [ @@ -69,5 +82,5 @@ "url": "git://github.com/davepacheco/node-jsprim.git" }, "scripts": {}, - "version": "1.2.2" + "version": "1.3.0" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml index 54692343d99003..c3394c258fc2aa 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.travis.yml @@ -1,11 +1,11 @@ language: node_js node_js: - - "4.2" + - "5.10" + - "4.4" - "4.1" - "0.12" - "0.10" - - "0.8" before_install: - "make check" after_success: - - '[ "${TRAVIS_NODE_VERSION}" = "4.2" ] && make codecovio' + - '[ "${TRAVIS_NODE_VERSION}" = "4.4" ] && make codecovio' diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md index bc34d48a49fd3d..00a4055204f14c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/README.md @@ -4,7 +4,7 @@ sshpk Parse, convert, fingerprint and use SSH keys (both public and private) in pure node -- no `ssh-keygen` or other external dependencies. -Supports RSA, DSA, ECDSA (nistp-\*) and ED25519 key types, in PEM (PKCS#1, +Supports RSA, DSA, ECDSA (nistp-\*) and ED25519 key types, in PEM (PKCS#1, PKCS#8) and OpenSSH formats. This library has been extracted from @@ -111,7 +111,7 @@ Usage ## Public keys -### `parseKey(data[, format = 'auto'[, name]])` +### `parseKey(data[, format = 'auto'[, options]])` Parses a key from a given data format and returns a new `Key` object. @@ -124,10 +124,14 @@ Parameters - `ssh`: standard OpenSSH format, - `pkcs1`, `pkcs8`: variants of `pem` - `rfc4253`: raw OpenSSH wire format - - `openssh`: new post-OpenSSH 6.5 internal format, produced by + - `openssh`: new post-OpenSSH 6.5 internal format, produced by `ssh-keygen -o` -- `name` -- Optional name for the key being parsed (eg. the filename that - was opened). Used to generate Error messages +- `options` -- Optional Object, extra options, with keys: + - `filename` -- Optional String, name for the key being parsed + (eg. the filename that was opened). Used to generate + Error messages + - `passphrase` -- Optional String, encryption passphrase used to decrypt an + encrypted PEM file ### `Key.isKey(obj)` @@ -212,7 +216,7 @@ to call this function on other keys will yield an `Error`. ## Private keys -### `parsePrivateKey(data[, format = 'auto'[, name]])` +### `parsePrivateKey(data[, format = 'auto'[, options]])` Parses a private key from a given data format and returns a new `PrivateKey` object. @@ -223,12 +227,16 @@ Parameters - `format` -- String name of format to use, valid options are: - `auto`: choose automatically from all below - `pem`: supports both PKCS#1 and PKCS#8 - - `ssh`, `openssh`: new post-OpenSSH 6.5 internal format, produced by + - `ssh`, `openssh`: new post-OpenSSH 6.5 internal format, produced by `ssh-keygen -o` - `pkcs1`, `pkcs8`: variants of `pem` - `rfc4253`: raw OpenSSH wire format -- `name` -- Optional name for the key being parsed (eg. the filename that - was opened). Used to generate Error messages +- `options` -- Optional Object, extra options, with keys: + - `filename` -- Optional String, name for the key being parsed + (eg. the filename that was opened). Used to generate + Error messages + - `passphrase` -- Optional String, encryption passphrase used to decrypt an + encrypted PEM file ### `PrivateKey.isPrivateKey(obj)` @@ -261,7 +269,7 @@ a Buffer. Parameters -- `format` -- String name of format to use, valid options are listed under +- `format` -- String name of format to use, valid options are listed under `parsePrivateKey`. Note that ED25519 keys default to `openssh` format instead (as they have no `pkcs1` representation). @@ -393,6 +401,206 @@ Parameters Same as `this.toBuffer(format).toString('base64')`. +## Certificates + +`sshpk` includes basic support for parsing certificates in X.509 (PEM) format +and the OpenSSH certificate format. This feature is intended to be used mainly +to access basic metadata about certificates, extract public keys from them, and +also to generate simple self-signed certificates from an existing key. + +Notably, there is no implementation of CA chain-of-trust verification, and no +support for key usage restrictions (or other kinds of restrictions). Please do +the security world a favour, and DO NOT use this code for certificate +verification in the traditional X.509 CA chain style. + +### `parseCertificate(data, format)` + +Parameters + + - `data` -- a Buffer or String + - `format` -- a String, format to use, one of `'openssh'`, `'pem'` (X.509 in a + PEM wrapper), or `'x509'` (raw DER encoded) + +### `createSelfSignedCertificate(subject, privateKey[, options])` + +Parameters + + - `subject` -- an Identity, the subject of the certificate + - `privateKey` -- a PrivateKey, the key of the subject: will be used both to be + placed in the certificate and also to sign it (since this is + a self-signed certificate) + - `options` -- optional Object, with keys: + - `lifetime` -- optional Number, lifetime of the certificate from now in + seconds + - `validFrom`, `validUntil` -- optional Dates, beginning and end of + certificate validity period. If given + `lifetime` will be ignored + - `serial` -- optional Buffer, the serial number of the certificate + +### `createCertificate(subject, key, issuer, issuerKey[, options])` + +Parameters + + - `subject` -- an Identity, the subject of the certificate + - `key` -- a Key, the public key of the subject + - `issuer` -- an Identity, the issuer of the certificate who will sign it + - `issuerKey` -- a PrivateKey, the issuer's private key for signing + - `options` -- optional Object, with keys: + - `lifetime` -- optional Number, lifetime of the certificate from now in + seconds + - `validFrom`, `validUntil` -- optional Dates, beginning and end of + certificate validity period. If given + `lifetime` will be ignored + - `serial` -- optional Buffer, the serial number of the certificate + +### `Certificate#subjects` + +Array of `Identity` instances describing the subject of this certificate. + +### `Certificate#issuer` + +The `Identity` of the Certificate's issuer (signer). + +### `Certificate#subjectKey` + +The public key of the subject of the certificate, as a `Key` instance. + +### `Certificate#issuerKey` + +The public key of the signing issuer of this certificate, as a `Key` instance. +May be `undefined` if the issuer's key is unknown (e.g. on an X509 certificate). + +### `Certificate#serial` + +The serial number of the certificate. As this is normally a 64-bit or wider +integer, it is returned as a Buffer. + +### `Certificate#isExpired([when])` + +Tests whether the Certificate is currently expired (i.e. the `validFrom` and +`validUntil` dates specify a range of time that does not include the current +time). + +Parameters + + - `when` -- optional Date, if specified, tests whether the Certificate was or + will be expired at the specified time instead of now + +Returns a Boolean. + +### `Certificate#isSignedByKey(key)` + +Tests whether the Certificate was validly signed by the given (public) Key. + +Parameters + + - `key` -- a Key instance + +Returns a Boolean. + +### `Certificate#isSignedBy(certificate)` + +Tests whether this Certificate was validly signed by the subject of the given +certificate. Also tests that the issuer Identity of this Certificate and the +subject Identity of the other Certificate are equivalent. + +Parameters + + - `certificate` -- another Certificate instance + +Returns a Boolean. + +### `Certificate#fingerprint([hashAlgo])` + +Returns the X509-style fingerprint of the entire certificate (as a Fingerprint +instance). This matches what a web-browser or similar would display as the +certificate fingerprint and should not be confused with the fingerprint of the +subject's public key. + +Parameters + + - `hashAlgo` -- an optional String, any hash function name + +### `Certificate#toBuffer([format])` + +Serializes the Certificate to a Buffer and returns it. + +Parameters + + - `format` -- an optional String, output format, one of `'openssh'`, `'pem'` or + `'x509'`. Defaults to `'x509'`. + +Returns a Buffer. + +### `Certificate#toString([format])` + + - `format` -- an optional String, output format, one of `'openssh'`, `'pem'` or + `'x509'`. Defaults to `'pem'`. + +Returns a String. + +## Certificate identities + +### `identityForHost(hostname)` + +Constructs a host-type Identity for a given hostname. + +Parameters + + - `hostname` -- the fully qualified DNS name of the host + +Returns an Identity instance. + +### `identityForUser(uid)` + +Constructs a user-type Identity for a given UID. + +Parameters + + - `uid` -- a String, user identifier (login name) + +Returns an Identity instance. + +### `identityForEmail(email)` + +Constructs an email-type Identity for a given email address. + +Parameters + + - `email` -- a String, email address + +Returns an Identity instance. + +### `identityFromDN(dn)` + +Parses an LDAP-style DN string (e.g. `'CN=foo, C=US'`) and turns it into an +Identity instance. + +Parameters + + - `dn` -- a String + +Returns an Identity instance. + +### `Identity#toString()` + +Returns the identity as an LDAP-style DN string. +e.g. `'CN=foo, O=bar corp, C=us'` + +### `Identity#type` + +The type of identity. One of `'host'`, `'user'`, `'email'` or `'unknown'` + +### `Identity#hostname` +### `Identity#uid` +### `Identity#email` + +Set when `type` is `'host'`, `'user'`, or `'email'`, respectively. Strings. + +### `Identity#cn` + +The value of the first `CN=` in the DN, if any. + Errors ------ @@ -425,8 +633,30 @@ The key data given could not be parsed as a valid key. Properties -- `keyName` -- `name` that was given to `Key#parse` +- `keyName` -- `filename` that was given to `parseKey` +- `format` -- the `format` that was trying to parse the key (see `parseKey`) +- `innerErr` -- the inner Error thrown by the format parser + +### `KeyEncryptedError` + +The key is encrypted with a symmetric key (ie, it is password protected). The +parsing operation would succeed if it was given the `passphrase` option. + +Properties + +- `keyName` -- `filename` that was given to `parseKey` +- `format` -- the `format` that was trying to parse the key (currently can only + be `"pem"`) + +### `CertificateParseError` + +The certificate data given could not be parsed as a valid certificate. + +Properties + +- `certName` -- `filename` that was given to `parseCertificate` - `format` -- the `format` that was trying to parse the key + (see `parseCertificate`) - `innerErr` -- the inner Error thrown by the format parser Friends of sshpk diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv index 8eec411ffb8cb1..a1205a45d5431f 100755 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv @@ -7,6 +7,9 @@ var dashdash = require('dashdash'); var sshpk = require('../lib/index'); var fs = require('fs'); var path = require('path'); +var tty = require('tty'); +var readline = require('readline'); +var getPassword = require('getpass').getPass; var options = [ { @@ -131,7 +134,9 @@ if (require.main === module) { while ((data = inFile.read())) bufs.push(data); }); - inFile.on('end', function () { + var parseOpts = {}; + parseOpts.filename = inFileName; + inFile.on('end', function processKey() { var buf = Buffer.concat(bufs); var fmt = 'auto'; if (opts.informat) @@ -140,8 +145,15 @@ if (require.main === module) { if (opts.private) f = sshpk.parsePrivateKey; try { - var key = f(buf, fmt, inFileName); + var key = f(buf, fmt, parseOpts); } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + parseOpts.passphrase = pw; + processKey(); + }); + return; + } console.error('sshpk-conv: ' + e.name + ': ' + e.message); process.exit(1); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign index c8b91932aa62ee..673fc9864214db 100755 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign @@ -7,6 +7,7 @@ var dashdash = require('dashdash'); var sshpk = require('../lib/index'); var fs = require('fs'); var path = require('path'); +var getPassword = require('getpass').getPass; var options = [ { @@ -51,6 +52,8 @@ var options = [ } ]; +var parseOpts = {}; + if (require.main === module) { var parser = dashdash.createParser({ options: options @@ -79,11 +82,23 @@ if (require.main === module) { } var keyData = fs.readFileSync(opts.identity); + parseOpts.filename = opts.identity; + + run(); +} +function run() { var key; try { - key = sshpk.parsePrivateKey(keyData); + key = sshpk.parsePrivateKey(keyData, 'auto', parseOpts); } catch (e) { + if (e.name === 'KeyEncryptedError') { + getPassword(function (err, pw) { + parseOpts.passphrase = pw; + run(); + }); + return; + } console.error('sshpk-sign: error loading private key "' + opts.identity + '": ' + e.name + ': ' + e.message); process.exit(1); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js new file mode 100644 index 00000000000000..4fbe6abad451da --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/certificate.js @@ -0,0 +1,291 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = Certificate; + +var assert = require('assert-plus'); +var algs = require('./algs'); +var crypto = require('crypto'); +var Fingerprint = require('./fingerprint'); +var Signature = require('./signature'); +var errs = require('./errors'); +var util = require('util'); +var utils = require('./utils'); +var Key = require('./key'); +var PrivateKey = require('./private-key'); +var Identity = require('./identity'); + +var formats = {}; +formats['openssh'] = require('./formats/openssh-cert'); +formats['x509'] = require('./formats/x509'); +formats['pem'] = require('./formats/x509-pem'); + +var CertificateParseError = errs.CertificateParseError; +var InvalidAlgorithmError = errs.InvalidAlgorithmError; + +function Certificate(opts) { + assert.object(opts, 'options'); + assert.arrayOfObject(opts.subjects, 'options.subjects'); + utils.assertCompatible(opts.subjects[0], Identity, [1, 0], + 'options.subjects'); + utils.assertCompatible(opts.subjectKey, Key, [1, 0], + 'options.subjectKey'); + utils.assertCompatible(opts.issuer, Identity, [1, 0], 'options.issuer'); + if (opts.issuerKey !== undefined) { + utils.assertCompatible(opts.issuerKey, Key, [1, 0], + 'options.issuerKey'); + } + assert.object(opts.signatures, 'options.signatures'); + assert.buffer(opts.serial, 'options.serial'); + assert.date(opts.validFrom, 'options.validFrom'); + assert.date(opts.validUntil, 'optons.validUntil'); + + this._hashCache = {}; + + this.subjects = opts.subjects; + this.issuer = opts.issuer; + this.subjectKey = opts.subjectKey; + this.issuerKey = opts.issuerKey; + this.signatures = opts.signatures; + this.serial = opts.serial; + this.validFrom = opts.validFrom; + this.validUntil = opts.validUntil; +} + +Certificate.formats = formats; + +Certificate.prototype.toBuffer = function (format, options) { + if (format === undefined) + format = 'x509'; + assert.string(format, 'format'); + assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); + + return (formats[format].write(this, options)); +}; + +Certificate.prototype.toString = function (format, options) { + if (format === undefined) + format = 'pem'; + return (this.toBuffer(format, options).toString()); +}; + +Certificate.prototype.fingerprint = function (algo) { + if (algo === undefined) + algo = 'sha256'; + assert.string(algo, 'algorithm'); + var opts = { + type: 'certificate', + hash: this.hash(algo), + algorithm: algo + }; + return (new Fingerprint(opts)); +}; + +Certificate.prototype.hash = function (algo) { + assert.string(algo, 'algorithm'); + algo = algo.toLowerCase(); + if (algs.hashAlgs[algo] === undefined) + throw (new InvalidAlgorithmError(algo)); + + if (this._hashCache[algo]) + return (this._hashCache[algo]); + + var hash = crypto.createHash(algo). + update(this.toBuffer('x509')).digest(); + this._hashCache[algo] = hash; + return (hash); +}; + +Certificate.prototype.isExpired = function (when) { + if (when === undefined) + when = new Date(); + return (!((when.getTime() >= this.validFrom.getTime()) && + (when.getTime() < this.validUntil.getTime()))); +}; + +Certificate.prototype.isSignedBy = function (issuerCert) { + utils.assertCompatible(issuerCert, Certificate, [1, 0], 'issuer'); + + if (!this.issuer.equals(issuerCert.subjects[0])) + return (false); + + return (this.isSignedByKey(issuerCert.subjectKey)); +}; + +Certificate.prototype.isSignedByKey = function (issuerKey) { + utils.assertCompatible(issuerKey, Key, [1, 2], 'issuerKey'); + + if (this.issuerKey !== undefined) { + return (this.issuerKey. + fingerprint('sha512').matches(issuerKey)); + } + + var fmt = Object.keys(this.signatures)[0]; + var valid = formats[fmt].verify(this, issuerKey); + if (valid) + this.issuerKey = issuerKey; + return (valid); +}; + +Certificate.prototype.signWith = function (key) { + utils.assertCompatible(key, PrivateKey, [1, 2], 'key'); + var fmts = Object.keys(formats); + var didOne = false; + for (var i = 0; i < fmts.length; ++i) { + if (fmts[i] !== 'pem') { + var ret = formats[fmts[i]].sign(this, key); + if (ret === true) + didOne = true; + } + } + if (!didOne) { + throw (new Error('Failed to sign the certificate for any ' + + 'available certificate formats')); + } +}; + +Certificate.createSelfSigned = function (subjectOrSubjects, key, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, PrivateKey, [1, 2], 'private key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = new Buffer('0000000000000001', 'hex'); + + var cert = new Certificate({ + subjects: subjects, + issuer: subjects[0], + subjectKey: key.toPublic(), + issuerKey: key.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil + }); + cert.signWith(key); + + return (cert); +}; + +Certificate.create = + function (subjectOrSubjects, key, issuer, issuerKey, options) { + var subjects; + if (Array.isArray(subjectOrSubjects)) + subjects = subjectOrSubjects; + else + subjects = [subjectOrSubjects]; + + assert.arrayOfObject(subjects); + subjects.forEach(function (subject) { + utils.assertCompatible(subject, Identity, [1, 0], 'subject'); + }); + + utils.assertCompatible(key, Key, [1, 0], 'key'); + if (PrivateKey.isPrivateKey(key)) + key = key.toPublic(); + utils.assertCompatible(issuer, Identity, [1, 0], 'issuer'); + utils.assertCompatible(issuerKey, PrivateKey, [1, 2], 'issuer key'); + + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalObject(options.validFrom, 'options.validFrom'); + assert.optionalObject(options.validUntil, 'options.validUntil'); + var validFrom = options.validFrom; + var validUntil = options.validUntil; + if (validFrom === undefined) + validFrom = new Date(); + if (validUntil === undefined) { + assert.optionalNumber(options.lifetime, 'options.lifetime'); + var lifetime = options.lifetime; + if (lifetime === undefined) + lifetime = 10*365*24*3600; + validUntil = new Date(); + validUntil.setTime(validUntil.getTime() + lifetime*1000); + } + assert.optionalBuffer(options.serial, 'options.serial'); + var serial = options.serial; + if (serial === undefined) + serial = new Buffer('0000000000000001', 'hex'); + + var cert = new Certificate({ + subjects: subjects, + issuer: issuer, + subjectKey: key, + issuerKey: issuerKey.toPublic(), + signatures: {}, + serial: serial, + validFrom: validFrom, + validUntil: validUntil + }); + cert.signWith(issuerKey); + + return (cert); +}; + +Certificate.parse = function (data, format, options) { + if (typeof (data) !== 'string') + assert.buffer(data, 'data'); + if (format === undefined) + format = 'auto'; + assert.string(format, 'format'); + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; + + assert.object(formats[format], 'formats[format]'); + + try { + var k = formats[format].read(data, options); + return (k); + } catch (e) { + throw (new CertificateParseError(options.filename, format, e)); + } +}; + +Certificate.isCertificate = function (obj, ver) { + return (utils.isCompatible(obj, Certificate, ver)); +}; + +/* + * API versions for Certificate: + * [1,0] -- initial ver + */ +Certificate.prototype._sshpkApiVersion = [1, 0]; + +Certificate._oldVersionDetect = function (obj) { + return ([1, 0]); +}; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js index 3551c1071e27ad..1cc09ec71d48db 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/errors.js @@ -50,9 +50,35 @@ function SignatureParseError(type, format, innerErr) { } util.inherits(SignatureParseError, Error); +function CertificateParseError(name, format, innerErr) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, CertificateParseError); + this.name = 'CertificateParseError'; + this.format = format; + this.certName = name; + this.innerErr = innerErr; + this.message = 'Failed to parse ' + name + ' as a valid ' + format + + ' format certificate: ' + innerErr.message; +} +util.inherits(CertificateParseError, Error); + +function KeyEncryptedError(name, format) { + if (Error.captureStackTrace) + Error.captureStackTrace(this, KeyEncryptedError); + this.name = 'KeyEncryptedError'; + this.format = format; + this.keyName = name; + this.message = 'The ' + format + ' format key ' + name + ' is ' + + 'encrypted (password-protected), and no passphrase was ' + + 'provided in `options`'; +} +util.inherits(KeyEncryptedError, Error); + module.exports = { FingerprintFormatError: FingerprintFormatError, InvalidAlgorithmError: InvalidAlgorithmError, KeyParseError: KeyParseError, - SignatureParseError: SignatureParseError + SignatureParseError: SignatureParseError, + KeyEncryptedError: KeyEncryptedError, + CertificateParseError: CertificateParseError }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js index c607330e7f5f68..7ed7e5130467ff 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/fingerprint.js @@ -7,6 +7,7 @@ var algs = require('./algs'); var crypto = require('crypto'); var errs = require('./errors'); var Key = require('./key'); +var Certificate = require('./certificate'); var utils = require('./utils'); var FingerprintFormatError = errs.FingerprintFormatError; @@ -14,6 +15,7 @@ var InvalidAlgorithmError = errs.InvalidAlgorithmError; function Fingerprint(opts) { assert.object(opts, 'options'); + assert.string(opts.type, 'options.type'); assert.buffer(opts.hash, 'options.hash'); assert.string(opts.algorithm, 'options.algorithm'); @@ -22,6 +24,7 @@ function Fingerprint(opts) { throw (new InvalidAlgorithmError(this.algorithm)); this.hash = opts.hash; + this.type = opts.type; } Fingerprint.prototype.toString = function (format) { @@ -44,11 +47,16 @@ Fingerprint.prototype.toString = function (format) { } }; -Fingerprint.prototype.matches = function (key) { - assert.object(key, 'key'); - utils.assertCompatible(key, Key, [1, 0], 'key'); +Fingerprint.prototype.matches = function (other) { + assert.object(other, 'key or certificate'); + if (this.type === 'key') { + utils.assertCompatible(other, Key, [1, 0], 'key'); + } else { + utils.assertCompatible(other, Certificate, [1, 0], + 'certificate'); + } - var theirHash = key.hash(this.algorithm); + var theirHash = other.hash(this.algorithm); var theirHash2 = crypto.createHash(this.algorithm). update(theirHash).digest('base64'); @@ -59,10 +67,19 @@ Fingerprint.prototype.matches = function (key) { return (this.hash2 === theirHash2); }; -Fingerprint.parse = function (fp, enAlgs) { +Fingerprint.parse = function (fp, options) { assert.string(fp, 'fingerprint'); - var alg, hash; + var alg, hash, enAlgs; + if (Array.isArray(options)) { + enAlgs = options; + options = {}; + } + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + if (options.enAlgs !== undefined) + enAlgs = options.enAlgs; assert.optionalArrayOfString(enAlgs, 'algorithms'); var parts = fp.split(':'); @@ -105,7 +122,11 @@ Fingerprint.parse = function (fp, enAlgs) { throw (new InvalidAlgorithmError(alg)); } - return (new Fingerprint({algorithm: alg, hash: hash})); + return (new Fingerprint({ + algorithm: alg, + hash: hash, + type: options.type || 'key' + })); }; function addColons(s) { diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js index 37c3cc81356676..973c03245e3807 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/auto.js @@ -14,24 +14,24 @@ var pem = require('./pem'); var ssh = require('./ssh'); var rfc4253 = require('./rfc4253'); -function read(buf) { +function read(buf, options) { if (typeof (buf) === 'string') { if (buf.trim().match(/^[-]+[ ]*BEGIN/)) - return (pem.read(buf)); + return (pem.read(buf, options)); if (buf.match(/^\s*ssh-[a-z]/)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); if (buf.match(/^\s*ecdsa-/)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); buf = new Buffer(buf, 'binary'); } else { assert.buffer(buf); if (findPEMHeader(buf)) - return (pem.read(buf)); + return (pem.read(buf, options)); if (findSSHHeader(buf)) - return (ssh.read(buf)); + return (ssh.read(buf, options)); } if (buf.readUInt32BE(0) < buf.length) - return (rfc4253.read(buf)); + return (rfc4253.read(buf, options)); throw (new Error('Failed to auto-detect format of key')); } @@ -68,6 +68,6 @@ function findPEMHeader(buf) { return (true); } -function write(key) { +function write(key, options) { throw (new Error('"auto" format cannot be used for writing')); } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js new file mode 100644 index 00000000000000..8ce7350fee26bb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/openssh-cert.js @@ -0,0 +1,289 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = { + read: read, + verify: verify, + sign: sign, + write: write, + + /* Internal private API */ + fromBuffer: fromBuffer, + toBuffer: toBuffer +}; + +var assert = require('assert-plus'); +var SSHBuffer = require('../ssh-buffer'); +var crypto = require('crypto'); +var algs = require('../algs'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var Identity = require('../identity'); +var rfc4253 = require('./rfc4253'); +var Signature = require('../signature'); +var utils = require('../utils'); +var Certificate = require('../certificate'); + +function verify(cert, key) { + /* + * We always give an issuerKey, so if our verify() is being called then + * there was no signature. Return false. + */ + return (false); +} + +var TYPES = { + 'user': 1, + 'host': 2 +}; +Object.keys(TYPES).forEach(function (k) { TYPES[TYPES[k]] = k; }); + +var ECDSA_ALGO = /^ecdsa-sha2-([^@-]+)-cert-v01@openssh.com$/; + +function read(buf, options) { + if (Buffer.isBuffer(buf)) + buf = buf.toString('ascii'); + var parts = buf.trim().split(/[ \t\n]+/g); + if (parts.length < 2 || parts.length > 3) + throw (new Error('Not a valid SSH certificate line')); + + var algo = parts[0]; + var data = parts[1]; + + data = new Buffer(data, 'base64'); + return (fromBuffer(data, algo)); +} + +function fromBuffer(data, algo, partial) { + var sshbuf = new SSHBuffer({ buffer: data }); + var innerAlgo = sshbuf.readString(); + if (algo !== undefined && innerAlgo !== algo) + throw (new Error('SSH certificate algorithm mismatch')); + if (algo === undefined) + algo = innerAlgo; + + var cert = {}; + cert.signatures = {}; + cert.signatures.openssh = {}; + + cert.signatures.openssh.nonce = sshbuf.readBuffer(); + + var key = {}; + var parts = (key.parts = []); + key.type = getAlg(algo); + + var partCount = algs.info[key.type].parts.length; + while (parts.length < partCount) + parts.push(sshbuf.readPart()); + assert.ok(parts.length >= 1, 'key must have at least one part'); + + var algInfo = algs.info[key.type]; + if (key.type === 'ecdsa') { + var res = ECDSA_ALGO.exec(algo); + assert.ok(res !== null); + assert.strictEqual(res[1], parts[0].data.toString()); + } + + for (var i = 0; i < algInfo.parts.length; ++i) { + parts[i].name = algInfo.parts[i]; + if (parts[i].name !== 'curve' && + algInfo.normalize !== false) { + var p = parts[i]; + p.data = utils.mpNormalize(p.data); + } + } + + cert.subjectKey = new Key(key); + + cert.serial = sshbuf.readInt64(); + + var type = TYPES[sshbuf.readInt()]; + assert.string(type, 'valid cert type'); + + cert.signatures.openssh.keyId = sshbuf.readString(); + + var principals = []; + var pbuf = sshbuf.readBuffer(); + var psshbuf = new SSHBuffer({ buffer: pbuf }); + while (!psshbuf.atEnd()) + principals.push(psshbuf.readString()); + if (principals.length === 0) + principals = ['*']; + + cert.subjects = principals.map(function (pr) { + if (type === 'user') + return (Identity.forUser(pr)); + else if (type === 'host') + return (Identity.forHost(pr)); + throw (new Error('Unknown identity type ' + type)); + }); + + cert.validFrom = int64ToDate(sshbuf.readInt64()); + cert.validUntil = int64ToDate(sshbuf.readInt64()); + + cert.signatures.openssh.critical = sshbuf.readBuffer(); + cert.signatures.openssh.exts = sshbuf.readBuffer(); + + /* reserved */ + sshbuf.readBuffer(); + + var signingKeyBuf = sshbuf.readBuffer(); + cert.issuerKey = rfc4253.read(signingKeyBuf); + + /* + * OpenSSH certs don't give the identity of the issuer, just their + * public key. So, we use an Identity that matches anything. The + * isSignedBy() function will later tell you if the key matches. + */ + cert.issuer = Identity.forHost('**'); + + var sigBuf = sshbuf.readBuffer(); + cert.signatures.openssh.signature = + Signature.parse(sigBuf, cert.issuerKey.type, 'ssh'); + + if (partial !== undefined) { + partial.remainder = sshbuf.remainder(); + partial.consumed = sshbuf._offset; + } + + return (new Certificate(cert)); +} + +function int64ToDate(buf) { + var i = buf.readUInt32BE(0) * 4294967296; + i += buf.readUInt32BE(4); + var d = new Date(); + d.setTime(i * 1000); + d.sourceInt64 = buf; + return (d); +} + +function dateToInt64(date) { + if (date.sourceInt64 !== undefined) + return (date.sourceInt64); + var i = Math.round(date.getTime() / 1000); + var upper = Math.floor(i / 4294967296); + var lower = Math.floor(i % 4294967296); + var buf = new Buffer(8); + buf.writeUInt32BE(upper, 0); + buf.writeUInt32BE(lower, 4); + return (buf); +} + +function sign(cert, key) { + if (cert.signatures.openssh === undefined) + cert.signatures.openssh = {}; + try { + var blob = toBuffer(cert, true); + } catch (e) { + delete (cert.signatures.openssh); + return (false); + } + var sig = cert.signatures.openssh; + var hashAlgo = undefined; + if (key.type === 'rsa' || key.type === 'dsa') + hashAlgo = 'sha1'; + var signer = key.createSign(hashAlgo); + signer.write(blob); + sig.signature = signer.sign(); + return (true); +} + +function write(cert, options) { + if (options === undefined) + options = {}; + + var blob = toBuffer(cert); + var out = getCertType(cert.subjectKey) + ' ' + blob.toString('base64'); + if (options.comment) + out = out + ' ' + options.comment; + return (out); +} + + +function toBuffer(cert, noSig) { + assert.object(cert.signatures.openssh, 'signature for openssh format'); + var sig = cert.signatures.openssh; + + if (sig.nonce === undefined) + sig.nonce = crypto.randomBytes(16); + var buf = new SSHBuffer({}); + buf.writeString(getCertType(cert.subjectKey)); + buf.writeBuffer(sig.nonce); + + var key = cert.subjectKey; + var algInfo = algs.info[key.type]; + algInfo.parts.forEach(function (part) { + buf.writePart(key.part[part]); + }); + + buf.writeInt64(cert.serial); + + var type = cert.subjects[0].type; + assert.notStrictEqual(type, 'unknown'); + cert.subjects.forEach(function (id) { + assert.strictEqual(id.type, type); + }); + type = TYPES[type]; + buf.writeInt(type); + + if (sig.keyId === undefined) { + sig.keyId = cert.subjects[0].type + '_' + + (cert.subjects[0].uid || cert.subjects[0].hostname); + } + buf.writeString(sig.keyId); + + var sub = new SSHBuffer({}); + cert.subjects.forEach(function (id) { + if (type === TYPES.host) + sub.writeString(id.hostname); + else if (type === TYPES.user) + sub.writeString(id.uid); + }); + buf.writeBuffer(sub.toBuffer()); + + buf.writeInt64(dateToInt64(cert.validFrom)); + buf.writeInt64(dateToInt64(cert.validUntil)); + + if (sig.critical === undefined) + sig.critical = new Buffer(0); + buf.writeBuffer(sig.critical); + + if (sig.exts === undefined) + sig.exts = new Buffer(0); + buf.writeBuffer(sig.exts); + + /* reserved */ + buf.writeBuffer(new Buffer(0)); + + sub = rfc4253.write(cert.issuerKey); + buf.writeBuffer(sub); + + if (!noSig) + buf.writeBuffer(sig.signature.toBuffer('ssh')); + + return (buf.toBuffer()); +} + +function getAlg(certType) { + if (certType === 'ssh-rsa-cert-v01@openssh.com') + return ('rsa'); + if (certType === 'ssh-dss-cert-v01@openssh.com') + return ('dsa'); + if (certType.match(ECDSA_ALGO)) + return ('ecdsa'); + if (certType === 'ssh-ed25519-cert-v01@openssh.com') + return ('ed25519'); + throw (new Error('Unsupported cert type ' + certType)); +} + +function getCertType(key) { + if (key.type === 'rsa') + return ('ssh-rsa-cert-v01@openssh.com'); + if (key.type === 'dsa') + return ('ssh-dss-cert-v01@openssh.com'); + if (key.type === 'ecdsa') + return ('ecdsa-sha2-' + key.curve + '-cert-v01@openssh.com'); + if (key.type === 'ed25519') + return ('ssh-ed25519-cert-v01@openssh.com'); + throw (new Error('Unsupported key type ' + key.type)); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js index 1d907607e29dc3..5318b35165336d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pem.js @@ -7,6 +7,7 @@ module.exports = { var assert = require('assert-plus'); var asn1 = require('asn1'); +var crypto = require('crypto'); var algs = require('../algs'); var utils = require('../utils'); var Key = require('../key'); @@ -17,11 +18,13 @@ var pkcs8 = require('./pkcs8'); var sshpriv = require('./ssh-private'); var rfc4253 = require('./rfc4253'); +var errors = require('../errors'); + /* * For reading we support both PKCS#1 and PKCS#8. If we find a private key, * we just take the public component of it and use that. */ -function read(buf, forceType) { +function read(buf, options, forceType) { var input = buf; if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); @@ -58,12 +61,26 @@ function read(buf, forceType) { break; headers[m[1].toLowerCase()] = m[2]; } + + var cipher, key, iv; if (headers['proc-type']) { var parts = headers['proc-type'].split(','); if (parts[0] === '4' && parts[1] === 'ENCRYPTED') { - throw (new Error('PEM key is encrypted ' + - '(password-protected). Please use the ' + - 'SSH agent or decrypt the key.')); + if (typeof (options.passphrase) === 'string') { + options.passphrase = new Buffer( + options.passphrase, 'utf-8'); + } + if (!Buffer.isBuffer(options.passphrase)) { + throw (new errors.KeyEncryptedError( + options.filename, 'PEM')); + } else { + parts = headers['dek-info'].split(','); + assert.ok(parts.length === 2); + cipher = parts[0].toLowerCase(); + iv = new Buffer(parts[1], 'hex'); + key = utils.opensslKeyDeriv(cipher, iv, + options.passphrase, 1).key; + } } } @@ -71,6 +88,23 @@ function read(buf, forceType) { lines = lines.slice(0, -1).join(''); buf = new Buffer(lines, 'base64'); + if (cipher && key && iv) { + var cipherStream = crypto.createDecipheriv(cipher, key, iv); + var chunk, chunks = []; + cipherStream.once('error', function (e) { + if (e.toString().indexOf('bad decrypt') !== -1) { + throw (new Error('Incorrect passphrase ' + + 'supplied, could not decrypt key')); + } + throw (e); + }); + cipherStream.write(buf); + cipherStream.end(); + while ((chunk = cipherStream.read()) !== null) + chunks.push(chunk); + buf = Buffer.concat(chunks); + } + /* The new OpenSSH internal format abuses PEM headers */ if (alg && alg.toLowerCase() === 'openssh') return (sshpriv.readSSHPrivate(type, buf)); @@ -98,7 +132,7 @@ function read(buf, forceType) { } } -function write(key, type) { +function write(key, options, type) { assert.object(key); var alg = {'ecdsa': 'EC', 'rsa': 'RSA', 'dsa': 'DSA'}[key.type]; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js index 6f9a24f115042b..a5676af6ef8420 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs1.js @@ -19,12 +19,12 @@ var pem = require('./pem'); var pkcs8 = require('./pkcs8'); var readECDSACurve = pkcs8.readECDSACurve; -function read(buf) { - return (pem.read(buf, 'pkcs1')); +function read(buf, options) { + return (pem.read(buf, options, 'pkcs1')); } -function write(key) { - return (pem.write(key, 'pkcs1')); +function write(key, options) { + return (pem.write(key, options, 'pkcs1')); } /* Helper to read in a single mpint */ diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js index c57c85537a72ca..4ccbefcbec2be2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/pkcs8.js @@ -18,12 +18,12 @@ var Key = require('../key'); var PrivateKey = require('../private-key'); var pem = require('./pem'); -function read(buf) { - return (pem.read(buf, 'pkcs8')); +function read(buf, options) { + return (pem.read(buf, options, 'pkcs8')); } -function write(key) { - return (pem.write(key, 'pkcs8')); +function write(key, options) { + return (pem.write(key, options, 'pkcs8')); } /* Helper to read in a single mpint */ @@ -42,10 +42,12 @@ function readPkcs8(alg, type, der) { } der.readSequence(); + var next = der.offset + der.length; var oid = der.readOID(); switch (oid) { case '1.2.840.113549.1.1.1': + der._offset = next; if (type === 'public') return (readPkcs8RSAPublic(der)); else @@ -66,10 +68,6 @@ function readPkcs8(alg, type, der) { } function readPkcs8RSAPublic(der) { - // Null -- XXX this probably isn't good practice - der.readByte(); - der.readByte(); - // bit string sequence der.readSequence(asn1.Ber.BitString); der.readByte(); @@ -93,9 +91,6 @@ function readPkcs8RSAPublic(der) { } function readPkcs8RSAPrivate(der) { - der.readByte(); - der.readByte(); - der.readSequence(asn1.Ber.OctetString); der.readSequence(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js index 3e0e286cdef33f..9d436dd92155f6 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/rfc4253.js @@ -52,7 +52,7 @@ function keyTypeToAlg(key) { throw (new Error('Unknown key type ' + key.type)); } -function read(partial, type, buf) { +function read(partial, type, buf, options) { if (typeof (buf) === 'string') buf = new Buffer(buf); assert.buffer(buf, 'buf'); @@ -120,7 +120,7 @@ function read(partial, type, buf) { return (new Constructor(key)); } -function write(key) { +function write(key, options) { assert.object(key); var alg = keyTypeToAlg(key); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js index 02d7c27e8f33dd..bfbdab527f9b82 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh-private.js @@ -18,8 +18,8 @@ var pem = require('./pem'); var rfc4253 = require('./rfc4253'); var SSHBuffer = require('../ssh-buffer'); -function read(buf) { - return (pem.read(buf)); +function read(buf, options) { + return (pem.read(buf, options)); } var MAGIC = 'openssh-key-v1'; @@ -76,7 +76,7 @@ function readSSHPrivate(type, buf) { return (key); } -function write(key) { +function write(key, options) { var pubKey; if (PrivateKey.isPrivateKey(key)) pubKey = key.toPublic(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js index f7baa48cfea2f4..655c9eaf3bf7c9 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/ssh.js @@ -18,7 +18,7 @@ var SSHKEY_RE = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/]+[=]*)([\n \t]+([^\n]+))?$/; /*JSSTYLED*/ var SSHKEY_RE2 = /^([a-z0-9-]+)[ \t]+([a-zA-Z0-9+\/ \t\n]+[=]*)(.*)$/; -function read(buf) { +function read(buf, options) { if (typeof (buf) !== 'string') { assert.buffer(buf, 'buf'); buf = buf.toString('ascii'); @@ -95,7 +95,7 @@ function read(buf) { return (key); } -function write(key) { +function write(key, options) { assert.object(key); if (!Key.isKey(key)) throw (new Error('Must be a public key')); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js new file mode 100644 index 00000000000000..c59c7d5ff0a29a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509-pem.js @@ -0,0 +1,77 @@ +// Copyright 2016 Joyent, Inc. + +var x509 = require('./x509'); + +module.exports = { + read: read, + verify: x509.verify, + sign: x509.sign, + write: write +}; + +var assert = require('assert-plus'); +var asn1 = require('asn1'); +var algs = require('../algs'); +var utils = require('../utils'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var pem = require('./pem'); +var Identity = require('../identity'); +var Signature = require('../signature'); +var Certificate = require('../certificate'); + +function read(buf, options) { + if (typeof (buf) !== 'string') { + assert.buffer(buf, 'buf'); + buf = buf.toString('ascii'); + } + + var lines = buf.trim().split(/[\r\n]+/g); + + var m = lines[0].match(/*JSSTYLED*/ + /[-]+[ ]*BEGIN CERTIFICATE[ ]*[-]+/); + assert.ok(m, 'invalid PEM header'); + + var m2 = lines[lines.length - 1].match(/*JSSTYLED*/ + /[-]+[ ]*END CERTIFICATE[ ]*[-]+/); + assert.ok(m2, 'invalid PEM footer'); + + var headers = {}; + while (true) { + lines = lines.slice(1); + m = lines[0].match(/*JSSTYLED*/ + /^([A-Za-z0-9-]+): (.+)$/); + if (!m) + break; + headers[m[1].toLowerCase()] = m[2]; + } + + /* Chop off the first and last lines */ + lines = lines.slice(0, -1).join(''); + buf = new Buffer(lines, 'base64'); + + return (x509.read(buf, options)); +} + +function write(cert, options) { + var dbuf = x509.write(cert, options); + + var header = 'CERTIFICATE'; + var tmp = dbuf.toString('base64'); + var len = tmp.length + (tmp.length / 64) + + 18 + 16 + header.length*2 + 10; + var buf = new Buffer(len); + var o = 0; + o += buf.write('-----BEGIN ' + header + '-----\n', o); + for (var i = 0; i < tmp.length; ) { + var limit = i + 64; + if (limit > tmp.length) + limit = tmp.length; + o += buf.write(tmp.slice(i, limit), o); + buf[o++] = 10; + i = limit; + } + o += buf.write('-----END ' + header + '-----\n', o); + + return (buf.slice(0, o)); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js new file mode 100644 index 00000000000000..a2975404a52cdb --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/formats/x509.js @@ -0,0 +1,484 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = { + read: read, + verify: verify, + sign: sign, + write: write +}; + +var assert = require('assert-plus'); +var asn1 = require('asn1'); +var algs = require('../algs'); +var utils = require('../utils'); +var Key = require('../key'); +var PrivateKey = require('../private-key'); +var pem = require('./pem'); +var Identity = require('../identity'); +var Signature = require('../signature'); +var Certificate = require('../certificate'); +var pkcs8 = require('./pkcs8'); + +/* + * This file is based on RFC5280 (X.509). + */ + +/* Helper to read in a single mpint */ +function readMPInt(der, nm) { + assert.strictEqual(der.peek(), asn1.Ber.Integer, + nm + ' is not an Integer'); + return (utils.mpNormalize(der.readString(asn1.Ber.Integer, true))); +} + +function verify(cert, key) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + var algParts = sig.algo.split('-'); + if (algParts[0] !== key.type) + return (false); + + var blob = sig.cache; + if (blob === undefined) { + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + blob = der.buffer; + } + + var verifier = key.createVerify(algParts[1]); + verifier.write(blob); + return (verifier.verify(sig.signature)); +} + +function Local(i) { + return (asn1.Ber.Context | asn1.Ber.Constructor | i); +} + +function Context(i) { + return (asn1.Ber.Context | i); +} + +var SIGN_ALGS = { + 'rsa-md5': '1.2.840.113549.1.1.4', + 'rsa-sha1': '1.2.840.113549.1.1.5', + 'rsa-sha256': '1.2.840.113549.1.1.11', + 'rsa-sha384': '1.2.840.113549.1.1.12', + 'rsa-sha512': '1.2.840.113549.1.1.13', + 'dsa-sha1': '1.2.840.10040.4.3', + 'dsa-sha256': '2.16.840.1.101.3.4.3.2', + 'ecdsa-sha1': '1.2.840.10045.4.1', + 'ecdsa-sha256': '1.2.840.10045.4.3.2', + 'ecdsa-sha384': '1.2.840.10045.4.3.3', + 'ecdsa-sha512': '1.2.840.10045.4.3.4' +}; +Object.keys(SIGN_ALGS).forEach(function (k) { + SIGN_ALGS[SIGN_ALGS[k]] = k; +}); +SIGN_ALGS['1.3.14.3.2.3'] = 'rsa-md5'; +SIGN_ALGS['1.3.14.3.2.29'] = 'rsa-sha1'; + +var EXTS = { + 'issuerKeyId': '2.5.29.35', + 'altName': '2.5.29.17' +}; + +function read(buf, options) { + if (typeof (buf) === 'string') { + buf = new Buffer(buf, 'binary'); + } + assert.buffer(buf, 'buf'); + + var der = new asn1.BerReader(buf); + + der.readSequence(); + if (Math.abs(der.length - der.remain) > 1) { + throw (new Error('DER sequence does not contain whole byte ' + + 'stream')); + } + + var tbsStart = der.offset; + der.readSequence(); + var sigOffset = der.offset + der.length; + var tbsEnd = sigOffset; + + if (der.peek() === Local(0)) { + der.readSequence(Local(0)); + var version = der.readInt(); + assert.ok(version <= 3, + 'only x.509 versions up to v3 supported'); + } + + var cert = {}; + cert.signatures = {}; + var sig = (cert.signatures.x509 = {}); + sig.extras = {}; + + cert.serial = readMPInt(der, 'serial'); + + der.readSequence(); + var after = der.offset + der.length; + var certAlgOid = der.readOID(); + var certAlg = SIGN_ALGS[certAlgOid]; + if (certAlg === undefined) + throw (new Error('unknown signature algorithm ' + certAlgOid)); + + der._offset = after; + cert.issuer = Identity.parseAsn1(der); + + der.readSequence(); + cert.validFrom = readDate(der); + cert.validUntil = readDate(der); + + cert.subjects = [Identity.parseAsn1(der)]; + + der.readSequence(); + after = der.offset + der.length; + cert.subjectKey = pkcs8.readPkcs8(undefined, 'public', der); + der._offset = after; + + /* issuerUniqueID */ + if (der.peek() === Local(1)) { + der.readSequence(Local(1)); + sig.extras.issuerUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } + + /* subjectUniqueID */ + if (der.peek() === Local(2)) { + der.readSequence(Local(2)); + sig.extras.subjectUniqueID = + buf.slice(der.offset, der.offset + der.length); + der._offset += der.length; + } + + /* extensions */ + if (der.peek() === Local(3)) { + der.readSequence(Local(3)); + var extEnd = der.offset + der.length; + der.readSequence(); + + while (der.offset < extEnd) + readExtension(cert, buf, der); + + assert.strictEqual(der.offset, extEnd); + } + + assert.strictEqual(der.offset, sigOffset); + + der.readSequence(); + after = der.offset + der.length; + var sigAlgOid = der.readOID(); + var sigAlg = SIGN_ALGS[sigAlgOid]; + if (sigAlg === undefined) + throw (new Error('unknown signature algorithm ' + sigAlgOid)); + der._offset = after; + + var sigData = der.readString(asn1.Ber.BitString, true); + if (sigData[0] === 0) + sigData = sigData.slice(1); + var algParts = sigAlg.split('-'); + + sig.signature = Signature.parse(sigData, algParts[0], 'asn1'); + sig.signature.hashAlgorithm = algParts[1]; + sig.algo = sigAlg; + sig.cache = buf.slice(tbsStart, tbsEnd); + + return (new Certificate(cert)); +} + +function readDate(der) { + if (der.peek() === asn1.Ber.UTCTime) { + return (utcTimeToDate(der.readString(asn1.Ber.UTCTime))); + } else if (der.peek() === asn1.Ber.GeneralizedTime) { + return (gTimeToDate(der.readString(asn1.Ber.GeneralizedTime))); + } else { + throw (new Error('Unsupported date format')); + } +} + +/* RFC5280, section 4.2.1.6 (GeneralName type) */ +var ALTNAME = { + OtherName: Local(0), + RFC822Name: Context(1), + DNSName: Context(2), + X400Address: Local(3), + DirectoryName: Local(4), + EDIPartyName: Local(5), + URI: Context(6), + IPAddress: Context(7), + OID: Context(8) +}; + +function readExtension(cert, buf, der) { + der.readSequence(); + var after = der.offset + der.length; + var extId = der.readOID(); + var id; + var sig = cert.signatures.x509; + sig.extras.exts = []; + + var critical; + if (der.peek() === asn1.Ber.Boolean) + critical = der.readBoolean(); + + switch (extId) { + case (EXTS.altName): + der.readSequence(asn1.Ber.OctetString); + der.readSequence(); + var aeEnd = der.offset + der.length; + while (der.offset < aeEnd) { + switch (der.peek()) { + case ALTNAME.OtherName: + case ALTNAME.EDIPartyName: + der.readSequence(); + der._offset += der.length; + break; + case ALTNAME.OID: + der.readOID(ALTNAME.OID); + break; + case ALTNAME.RFC822Name: + /* RFC822 specifies email addresses */ + var email = der.readString(ALTNAME.RFC822Name); + id = Identity.forEmail(email); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DirectoryName: + der.readSequence(ALTNAME.DirectoryName); + id = Identity.parseAsn1(der); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + case ALTNAME.DNSName: + var host = der.readString( + ALTNAME.DNSName); + id = Identity.forHost(host); + if (!cert.subjects[0].equals(id)) + cert.subjects.push(id); + break; + default: + der.readString(der.peek()); + break; + } + } + sig.extras.exts.push({ oid: extId, critical: critical }); + break; + default: + sig.extras.exts.push({ + oid: extId, + critical: critical, + data: der.readString(asn1.Ber.OctetString, true) + }); + break; + } + + der._offset = after; +} + +var UTCTIME_RE = + /^([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function utcTimeToDate(t) { + var m = t.match(UTCTIME_RE); + assert.ok(m, 'timestamps must be in UTC'); + var d = new Date(); + + var thisYear = d.getUTCFullYear(); + var century = Math.floor(thisYear / 100) * 100; + + var year = parseInt(m[1], 10); + if (thisYear % 100 < 50 && year >= 60) + year += (century - 1); + else + year += century; + d.setUTCFullYear(year, parseInt(m[2], 10) - 1, parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); +} + +var GTIME_RE = + /^([0-9]{4})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})([0-9]{2})?Z$/; +function gTimeToDate(t) { + var m = t.match(GTIME_RE); + assert.ok(m); + var d = new Date(); + + d.setUTCFullYear(parseInt(m[1], 10), parseInt(m[2], 10) - 1, + parseInt(m[3], 10)); + d.setUTCHours(parseInt(m[4], 10), parseInt(m[5], 10)); + if (m[6] && m[6].length > 0) + d.setUTCSeconds(parseInt(m[6], 10)); + return (d); +} + +function zeroPad(n) { + var s = '' + n; + while (s.length < 2) + s = '0' + s; + return (s); +} + +function dateToUTCTime(d) { + var s = ''; + s += zeroPad(d.getUTCFullYear() % 100); + s += zeroPad(d.getUTCMonth() + 1); + s += zeroPad(d.getUTCDate()); + s += zeroPad(d.getUTCHours()); + s += zeroPad(d.getUTCMinutes()); + s += zeroPad(d.getUTCSeconds()); + s += 'Z'; + return (s); +} + +function sign(cert, key) { + if (cert.signatures.x509 === undefined) + cert.signatures.x509 = {}; + var sig = cert.signatures.x509; + + sig.algo = key.type + '-' + key.defaultHashAlgorithm(); + if (SIGN_ALGS[sig.algo] === undefined) + return (false); + + var der = new asn1.BerWriter(); + writeTBSCert(cert, der); + var blob = der.buffer; + sig.cache = blob; + + var signer = key.createSign(); + signer.write(blob); + cert.signatures.x509.signature = signer.sign(); + + return (true); +} + +function write(cert, options) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + var der = new asn1.BerWriter(); + der.startSequence(); + if (sig.cache) { + der._ensure(sig.cache.length); + sig.cache.copy(der._buf, der._offset); + der._offset += sig.cache.length; + } else { + writeTBSCert(cert, der); + } + + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + if (sig.algo.match(/^rsa-/)) + der.writeNull(); + der.endSequence(); + + var sigData = sig.signature.toBuffer('asn1'); + var data = new Buffer(sigData.length + 1); + data[0] = 0; + sigData.copy(data, 1); + der.writeBuffer(data, asn1.Ber.BitString); + der.endSequence(); + + return (der.buffer); +} + +function writeTBSCert(cert, der) { + var sig = cert.signatures.x509; + assert.object(sig, 'x509 signature'); + + der.startSequence(); + + der.startSequence(Local(0)); + der.writeInt(2); + der.endSequence(); + + der.writeBuffer(utils.mpNormalize(cert.serial), asn1.Ber.Integer); + + der.startSequence(); + der.writeOID(SIGN_ALGS[sig.algo]); + der.endSequence(); + + cert.issuer.toAsn1(der); + + der.startSequence(); + der.writeString(dateToUTCTime(cert.validFrom), asn1.Ber.UTCTime); + der.writeString(dateToUTCTime(cert.validUntil), asn1.Ber.UTCTime); + der.endSequence(); + + var subject = cert.subjects[0]; + var altNames = cert.subjects.slice(1); + subject.toAsn1(der); + + pkcs8.writePkcs8(der, cert.subjectKey); + + if (sig.extras && sig.extras.issuerUniqueID) { + der.writeBuffer(sig.extras.issuerUniqueID, Local(1)); + } + + if (sig.extras && sig.extras.subjectUniqueID) { + der.writeBuffer(sig.extras.subjectUniqueID, Local(2)); + } + + if (altNames.length > 0 || subject.type === 'host' || + (sig.extras && sig.extras.exts)) { + der.startSequence(Local(3)); + der.startSequence(); + + var exts = [ + { oid: EXTS.altName } + ]; + if (sig.extras && sig.extras.exts) + exts = sig.extras.exts; + + for (var i = 0; i < exts.length; ++i) { + der.startSequence(); + der.writeOID(exts[i].oid); + + if (exts[i].critical !== undefined) + der.writeBoolean(exts[i].critical); + + if (exts[i].oid === EXTS.altName) { + der.startSequence(asn1.Ber.OctetString); + der.startSequence(); + if (subject.type === 'host') { + der.writeString(subject.hostname, + Context(2)); + } + for (var j = 0; j < altNames.length; ++j) { + if (altNames[j].type === 'host') { + der.writeString( + altNames[j].hostname, + ALTNAME.DNSName); + } else if (altNames[j].type === + 'email') { + der.writeString( + altNames[j].email, + ALTNAME.RFC822Name); + } else { + /* + * Encode anything else as a + * DN style name for now. + */ + der.startSequence( + ALTNAME.DirectoryName); + altNames[j].toAsn1(der); + der.endSequence(); + } + } + der.endSequence(); + der.endSequence(); + } else { + der.writeBuffer(exts[i].data, + asn1.Ber.OctetString); + } + + der.endSequence(); + } + + der.endSequence(); + der.endSequence(); + } + + der.endSequence(); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js new file mode 100644 index 00000000000000..b4f5cd73ec516d --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/identity.js @@ -0,0 +1,255 @@ +// Copyright 2016 Joyent, Inc. + +module.exports = Identity; + +var assert = require('assert-plus'); +var algs = require('./algs'); +var crypto = require('crypto'); +var Fingerprint = require('./fingerprint'); +var Signature = require('./signature'); +var errs = require('./errors'); +var util = require('util'); +var utils = require('./utils'); +var asn1 = require('asn1'); + +/*JSSTYLED*/ +var DNS_NAME_RE = /^([*]|[a-z0-9][a-z0-9\-]{0,62})(?:\.([*]|[a-z0-9][a-z0-9\-]{0,62}))*$/i; + +var oids = {}; +oids.cn = '2.5.4.3'; +oids.o = '2.5.4.10'; +oids.ou = '2.5.4.11'; +oids.l = '2.5.4.7'; +oids.s = '2.5.4.8'; +oids.c = '2.5.4.6'; +oids.sn = '2.5.4.4'; +oids.dc = '0.9.2342.19200300.100.1.25'; +oids.uid = '0.9.2342.19200300.100.1.1'; +oids.mail = '0.9.2342.19200300.100.1.3'; + +var unoids = {}; +Object.keys(oids).forEach(function (k) { + unoids[oids[k]] = k; +}); + +function Identity(opts) { + var self = this; + assert.object(opts, 'options'); + assert.arrayOfObject(opts.components, 'options.components'); + this.components = opts.components; + this.componentLookup = {}; + this.components.forEach(function (c) { + if (c.name && !c.oid) + c.oid = oids[c.name]; + if (c.oid && !c.name) + c.name = unoids[c.oid]; + if (self.componentLookup[c.name] === undefined) + self.componentLookup[c.name] = []; + self.componentLookup[c.name].push(c); + }); + if (this.componentLookup.cn && this.componentLookup.cn.length > 0) { + this.cn = this.componentLookup.cn[0].value; + } + assert.optionalString(opts.type, 'options.type'); + if (opts.type === undefined) { + if (this.components.length === 1 && + this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.dc && + this.components.length === this.componentLookup.dc.length) { + this.type = 'host'; + this.hostname = this.componentLookup.dc.map( + function (c) { + return (c.value); + }).join('.'); + + } else if (this.componentLookup.uid && + this.components.length === + this.componentLookup.uid.length) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1 && + this.componentLookup.cn[0].value.match(DNS_NAME_RE)) { + this.type = 'host'; + this.hostname = this.componentLookup.cn[0].value; + + } else if (this.componentLookup.uid && + this.componentLookup.uid.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.uid[0].value; + + } else if (this.componentLookup.mail && + this.componentLookup.mail.length === 1) { + this.type = 'email'; + this.email = this.componentLookup.mail[0].value; + + } else if (this.componentLookup.cn && + this.componentLookup.cn.length === 1) { + this.type = 'user'; + this.uid = this.componentLookup.cn[0].value; + + } else { + this.type = 'unknown'; + } + } else { + this.type = opts.type; + if (this.type === 'host') + this.hostname = opts.hostname; + else if (this.type === 'user') + this.uid = opts.uid; + else if (this.type === 'email') + this.email = opts.email; + else + throw (new Error('Unknown type ' + this.type)); + } +} + +Identity.prototype.toString = function () { + return (this.components.map(function (c) { + return (c.name.toUpperCase() + '=' + c.value); + }).join(', ')); +}; + +Identity.prototype.toAsn1 = function (der, tag) { + der.startSequence(tag); + this.components.forEach(function (c) { + der.startSequence(asn1.Ber.Constructor | asn1.Ber.Set); + der.startSequence(); + der.writeOID(c.oid); + der.writeString(c.value, asn1.Ber.PrintableString); + der.endSequence(); + der.endSequence(); + }); + der.endSequence(); +}; + +function globMatch(a, b) { + if (a === '**' || b === '**') + return (true); + var aParts = a.split('.'); + var bParts = b.split('.'); + if (aParts.length !== bParts.length) + return (false); + for (var i = 0; i < aParts.length; ++i) { + if (aParts[i] === '*' || bParts[i] === '*') + continue; + if (aParts[i] !== bParts[i]) + return (false); + } + return (true); +} + +Identity.prototype.equals = function (other) { + if (!Identity.isIdentity(other, [1, 0])) + return (false); + if (other.components.length !== this.components.length) + return (false); + for (var i = 0; i < this.components.length; ++i) { + if (this.components[i].oid !== other.components[i].oid) + return (false); + if (!globMatch(this.components[i].value, + other.components[i].value)) { + return (false); + } + } + return (true); +}; + +Identity.forHost = function (hostname) { + assert.string(hostname, 'hostname'); + return (new Identity({ + type: 'host', + hostname: hostname, + components: [ { name: 'cn', value: hostname } ] + })); +}; + +Identity.forUser = function (uid) { + assert.string(uid, 'uid'); + return (new Identity({ + type: 'user', + uid: uid, + components: [ { name: 'uid', value: uid } ] + })); +}; + +Identity.forEmail = function (email) { + assert.string(email, 'email'); + return (new Identity({ + type: 'email', + email: email, + components: [ { name: 'mail', value: email } ] + })); +}; + +Identity.parseDN = function (dn) { + assert.string(dn, 'dn'); + var parts = dn.split(','); + var cmps = parts.map(function (c) { + c = c.trim(); + var eqPos = c.indexOf('='); + var name = c.slice(0, eqPos).toLowerCase(); + var value = c.slice(eqPos + 1); + return ({ name: name, value: value }); + }); + return (new Identity({ components: cmps })); +}; + +Identity.parseAsn1 = function (der, top) { + var components = []; + der.readSequence(top); + var end = der.offset + der.length; + while (der.offset < end) { + der.readSequence(asn1.Ber.Constructor | asn1.Ber.Set); + var after = der.offset + der.length; + der.readSequence(); + var oid = der.readOID(); + var type = der.peek(); + var value; + switch (type) { + case asn1.Ber.PrintableString: + case asn1.Ber.IA5String: + case asn1.Ber.OctetString: + case asn1.Ber.T61String: + value = der.readString(type); + break; + case asn1.Ber.Utf8String: + value = der.readString(type, true); + value = value.toString('utf8'); + break; + case asn1.Ber.CharacterString: + case asn1.Ber.BMPString: + value = der.readString(type, true); + value = value.toString('utf16le'); + break; + default: + throw (new Error('Unknown asn1 type ' + type)); + } + components.push({ oid: oid, value: value }); + der._offset = after; + } + der._offset = end; + return (new Identity({ + components: components + })); +}; + +Identity.isIdentity = function (obj, ver) { + return (utils.isCompatible(obj, Identity, ver)); +}; + +/* + * API versions for Identity: + * [1,0] -- initial ver + */ +Identity.prototype._sshpkApiVersion = [1, 0]; + +Identity._oldVersionDetect = function (obj) { + return ([1, 0]); +}; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js index 5cd962b31257fc..96a1384286a811 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/index.js @@ -4,6 +4,8 @@ var Key = require('./key'); var Fingerprint = require('./fingerprint'); var Signature = require('./signature'); var PrivateKey = require('./private-key'); +var Certificate = require('./certificate'); +var Identity = require('./identity'); var errs = require('./errors'); module.exports = { @@ -16,10 +18,21 @@ module.exports = { parseSignature: Signature.parse, PrivateKey: PrivateKey, parsePrivateKey: PrivateKey.parse, + Certificate: Certificate, + parseCertificate: Certificate.parse, + createSelfSignedCertificate: Certificate.createSelfSigned, + createCertificate: Certificate.create, + Identity: Identity, + identityFromDN: Identity.parseDN, + identityForHost: Identity.forHost, + identityForUser: Identity.forUser, + identityForEmail: Identity.forEmail, /* errors */ FingerprintFormatError: errs.FingerprintFormatError, InvalidAlgorithmError: errs.InvalidAlgorithmError, KeyParseError: errs.KeyParseError, - SignatureParseError: errs.SignatureParseError + SignatureParseError: errs.SignatureParseError, + KeyEncryptedError: errs.KeyEncryptedError, + CertificateParseError: errs.CertificateParseError }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js index d140f0e54d8bcd..ff5c3637337cd3 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js @@ -77,11 +77,12 @@ function Key(opts) { Key.formats = formats; -Key.prototype.toBuffer = function (format) { +Key.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'ssh'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); if (format === 'rfc4253') { if (this._rfc4253Cache === undefined) @@ -89,11 +90,11 @@ Key.prototype.toBuffer = function (format) { return (this._rfc4253Cache); } - return (formats[format].write(this)); + return (formats[format].write(this, options)); }; -Key.prototype.toString = function (format) { - return (this.toBuffer(format).toString()); +Key.prototype.toString = function (format, options) { + return (this.toBuffer(format, options).toString()); }; Key.prototype.hash = function (algo) { @@ -107,9 +108,6 @@ Key.prototype.hash = function (algo) { var hash = crypto.createHash(algo). update(this.toBuffer('rfc4253')).digest(); - /* Workaround for node 0.8 */ - if (typeof (hash) === 'string') - hash = new Buffer(hash, 'binary'); this._hashCache[algo] = hash; return (hash); }; @@ -119,6 +117,7 @@ Key.prototype.fingerprint = function (algo) { algo = 'sha256'; assert.string(algo, 'algorithm'); var opts = { + type: 'key', hash: this.hash(algo), algorithm: algo }; @@ -158,10 +157,7 @@ Key.prototype.createVerify = function (hashAlgo) { var v, nm, err; try { - nm = this.type.toUpperCase() + '-'; - if (this.type === 'ecdsa') - nm = 'ecdsa-with-'; - nm += hashAlgo.toUpperCase(); + nm = hashAlgo.toUpperCase(); v = crypto.createVerify(nm); } catch (e) { err = e; @@ -213,26 +209,34 @@ Key.prototype.createDiffieHellman = function () { }; Key.prototype.createDH = Key.prototype.createDiffieHellman; -Key.parse = function (data, format, name) { +Key.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); - if (name === undefined) - name = '(unnamed)'; + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { - var k = formats[format].read(data); + var k = formats[format].read(data, options); if (k instanceof PrivateKey) k = k.toPublic(); if (!k.comment) - k.comment = name; + k.comment = options.filename; return (k); } catch (e) { - throw (new KeyParseError(name, format, e)); + if (e.name === 'KeyEncryptedError') + throw (e); + throw (new KeyParseError(options.filename, format, e)); } }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js index 993ae32650237a..f80d93966286b5 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/private-key.js @@ -23,6 +23,7 @@ var Key = require('./key'); var InvalidAlgorithmError = errs.InvalidAlgorithmError; var KeyParseError = errs.KeyParseError; +var KeyEncryptedError = errs.KeyEncryptedError; var formats = {}; formats['auto'] = require('./formats/auto'); @@ -44,13 +45,14 @@ util.inherits(PrivateKey, Key); PrivateKey.formats = formats; -PrivateKey.prototype.toBuffer = function (format) { +PrivateKey.prototype.toBuffer = function (format, options) { if (format === undefined) format = 'pkcs1'; assert.string(format, 'format'); assert.object(formats[format], 'formats[format]'); + assert.optionalObject(options, 'options'); - return (formats[format].write(this)); + return (formats[format].write(this, options)); }; PrivateKey.prototype.hash = function (algo) { @@ -146,10 +148,7 @@ PrivateKey.prototype.createSign = function (hashAlgo) { var v, nm, err; try { - nm = this.type.toUpperCase() + '-'; - if (this.type === 'ecdsa') - nm = 'ecdsa-with-'; - nm += hashAlgo.toUpperCase(); + nm = hashAlgo.toUpperCase(); v = crypto.createSign(nm); } catch (e) { err = e; @@ -175,25 +174,33 @@ PrivateKey.prototype.createSign = function (hashAlgo) { return (v); }; -PrivateKey.parse = function (data, format, name) { +PrivateKey.parse = function (data, format, options) { if (typeof (data) !== 'string') assert.buffer(data, 'data'); if (format === undefined) format = 'auto'; assert.string(format, 'format'); - if (name === undefined) - name = '(unnamed)'; + if (typeof (options) === 'string') + options = { filename: options }; + assert.optionalObject(options, 'options'); + if (options === undefined) + options = {}; + assert.optionalString(options.filename, 'options.filename'); + if (options.filename === undefined) + options.filename = '(unnamed)'; assert.object(formats[format], 'formats[format]'); try { - var k = formats[format].read(data); + var k = formats[format].read(data, options); assert.ok(k instanceof PrivateKey, 'key is not a private key'); if (!k.comment) - k.comment = name; + k.comment = options.filename; return (k); } catch (e) { - throw (new KeyParseError(name, format, e)); + if (e.name === 'KeyEncryptedError') + throw (e); + throw (new KeyParseError(options.filename, format, e)); } }; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js index ddf4a8c988c908..964f55cb5667c0 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/signature.js @@ -65,23 +65,31 @@ Signature.prototype.toBuffer = function (format) { buf = new SSHBuffer({}); buf.writeString('ssh-dss'); r = this.part.r.data; - if (r[0] === 0x00) + if (r.length > 20 && r[0] === 0x00) r = r.slice(1); s = this.part.s.data; + if (s.length > 20 && s[0] === 0x00) + s = s.slice(1); + if ((this.hashAlgorithm && + this.hashAlgorithm !== 'sha1') || + r.length + s.length !== 40) { + throw (new Error('OpenSSH only supports ' + + 'DSA signatures with SHA1 hash')); + } buf.writeBuffer(Buffer.concat([r, s])); return (buf.toBuffer()); } else if (format === 'ssh' && this.type === 'ecdsa') { var inner = new SSHBuffer({}); - r = this.part.r; - if (r[0] === 0x00) - r = r.slice(1); - inner.writePart(r); + r = this.part.r.data; + inner.writeBuffer(r); inner.writePart(this.part.s); buf = new SSHBuffer({}); /* XXX: find a more proper way to do this? */ var curve; - var sz = this.part.r.data.length * 8; + if (r[0] === 0x00) + r = r.slice(1); + var sz = r.length * 8; if (sz === 256) curve = 'nistp256'; else if (sz === 384) diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js index 0b0027734959a4..8fc2cb87852f40 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js @@ -73,6 +73,14 @@ SSHBuffer.prototype.readInt = function () { return (v); }; +SSHBuffer.prototype.readInt64 = function () { + assert.ok(this._offset + 8 < this._buffer.length, + 'buffer not long enough to read Int64'); + var v = this._buffer.slice(this._offset, this._offset + 8); + this._offset += 8; + return (v); +}; + SSHBuffer.prototype.readChar = function () { var v = this._buffer[this._offset++]; return (v); @@ -106,6 +114,22 @@ SSHBuffer.prototype.writeInt = function (v) { this._offset += 4; }; +SSHBuffer.prototype.writeInt64 = function (v) { + assert.buffer(v, 'value'); + if (v.length > 8) { + var lead = v.slice(0, v.length - 8); + for (var i = 0; i < lead.length; ++i) { + assert.strictEqual(lead[i], 0, + 'must fit in 64 bits of precision'); + } + v = v.slice(v.length - 8, v.length); + } + while (this._offset + 8 > this._size) + this.expand(); + v.copy(this._buffer, this._offset); + this._offset += 8; +}; + SSHBuffer.prototype.writeChar = function (v) { while (this._offset + 1 > this._size) this.expand(); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js index 34c22d31a6cf11..d57245cc16b41d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/utils.js @@ -8,11 +8,13 @@ module.exports = { ecNormalize: ecNormalize, countZeros: countZeros, assertCompatible: assertCompatible, - isCompatible: isCompatible + isCompatible: isCompatible, + opensslKeyDeriv: opensslKeyDeriv }; var assert = require('assert-plus'); var PrivateKey = require('./private-key'); +var crypto = require('crypto'); var MAX_CLASS_DEPTH = 3; @@ -68,6 +70,43 @@ function assertCompatible(obj, klass, needVer, name) { 'version ' + needVer[0] + '.' + needVer[1]); } +var CIPHER_LEN = { + 'des-ede3-cbc': { key: 7, iv: 8 }, + 'aes-128-cbc': { key: 16, iv: 16 } +}; +var PKCS5_SALT_LEN = 8; + +function opensslKeyDeriv(cipher, salt, passphrase, count) { + assert.buffer(salt, 'salt'); + assert.buffer(passphrase, 'passphrase'); + assert.number(count, 'iteration count'); + + var clen = CIPHER_LEN[cipher]; + assert.object(clen, 'supported cipher'); + + salt = salt.slice(0, PKCS5_SALT_LEN); + + var D, D_prev, bufs; + var material = new Buffer(0); + while (material.length < clen.key + clen.iv) { + bufs = []; + if (D_prev) + bufs.push(D_prev); + bufs.push(passphrase); + bufs.push(salt); + D = Buffer.concat(bufs); + for (var j = 0; j < count; ++j) + D = crypto.createHash('md5').update(D).digest(); + material = Buffer.concat([material, D]); + D_prev = D; + } + + return ({ + key: material.slice(0, clen.key), + iv: material.slice(clen.key, clen.key + clen.iv) + }); +} + /* Count leading zero bits on a buffer */ function countZeros(buf) { var o = 0, obit = 8; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 index d03b3067395d34..0887dce2728fb2 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 @@ -13,7 +13,7 @@ Reads in a public or private key and converts it between different formats, particularly formats used in the SSH protocol and the well\-known PEM PKCS#1/7 formats. .PP -In the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to +In the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to stderr information about its nature, size and fingerprint. .SH EXAMPLES .PP @@ -76,7 +76,7 @@ MIIDpAIBAAKCAQEA6T/GYJndb1TRH3+NL.... .SH OPTIONS .TP \fB\fC\-i, \-\-identify\fR -Instead of converting the key, output identifying information about it to +Instead of converting the key, output identifying information about it to stderr, including its type, size and fingerprints. .TP \fB\fC\-p, \-\-private\fR @@ -125,7 +125,7 @@ The internal binary format of keys when sent over the wire in the SSH protocol. This is also the format that the \fB\fCssh\-agent\fR uses in its protocol. .SH SEE ALSO .PP -.BR ssh-keygen (1), +.BR ssh-keygen (1), .BR openssl (1) .SH BUGS .PP diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json index 9d3b1f7ecfcce5..7e1f2b3ace550d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "asn1@>=0.2.3 <0.3.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "asn1@~0.2.3", + "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", + "spec": ">=0.2.3 <0.3.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "asn1@>=0.2.3 <0.3.0", @@ -11,16 +19,17 @@ "_installable": true, "_location": "/request/http-signature/sshpk/asn1", "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" }, "_npmVersion": "1.4.28", "_phantomChildren": {}, "_requested": { - "name": "asn1", - "raw": "asn1@>=0.2.3 <0.3.0", - "rawSpec": ">=0.2.3 <0.3.0", + "raw": "asn1@~0.2.3", "scope": null, + "escapedName": "asn1", + "name": "asn1", + "rawSpec": "~0.2.3", "spec": ">=0.2.3 <0.3.0", "type": "range" }, @@ -30,11 +39,11 @@ "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", "_shrinkwrap": null, - "_spec": "asn1@>=0.2.3 <0.3.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "asn1@~0.2.3", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, "bugs": { "url": "https://github.com/mcavage/node-asn1/issues" @@ -61,7 +70,7 @@ "directories": {}, "dist": { "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86", - "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" + "tarball": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz" }, "homepage": "https://github.com/mcavage/node-asn1", "license": "MIT", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/AUTHORS similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/AUTHORS rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/AUTHORS diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/CHANGES.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/CHANGES.md rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/CHANGES.md diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js similarity index 100% rename from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js rename to deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json new file mode 100644 index 00000000000000..305af0ddb3d97a --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json @@ -0,0 +1,118 @@ +{ + "_args": [ + [ + { + "raw": "assert-plus@^1.0.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + ] + ], + "_from": "assert-plus@>=1.0.0 <2.0.0", + "_id": "assert-plus@1.0.0", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk/assert-plus", + "_nodeVersion": "0.10.40", + "_npmUser": { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + }, + "_npmVersion": "3.3.9", + "_phantomChildren": {}, + "_requested": { + "raw": "assert-plus@^1.0.0", + "scope": null, + "escapedName": "assert-plus", + "name": "assert-plus", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature/sshpk", + "/request/http-signature/sshpk/dashdash", + "/request/http-signature/sshpk/getpass" + ], + "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", + "_shrinkwrap": null, + "_spec": "assert-plus@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "author": { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + "bugs": { + "url": "https://github.com/mcavage/node-assert-plus/issues" + }, + "contributors": [ + { + "name": "Dave Eddy", + "email": "dave@daveeddy.com" + }, + { + "name": "Fred Kuo", + "email": "fred.kuo@joyent.com" + }, + { + "name": "Lars-Magnus Skog", + "email": "ralphtheninja@riseup.net" + }, + { + "name": "Mark Cavage", + "email": "mcavage@gmail.com" + }, + { + "name": "Patrick Mooney", + "email": "pmooney@pfmooney.com" + }, + { + "name": "Rob Gulewich", + "email": "robert.gulewich@joyent.com" + } + ], + "dependencies": {}, + "description": "Extra assertions on top of node's assert module", + "devDependencies": { + "faucet": "0.0.1", + "tape": "4.2.2" + }, + "directories": {}, + "dist": { + "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", + "tarball": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" + }, + "engines": { + "node": ">=0.8" + }, + "homepage": "https://github.com/mcavage/node-assert-plus#readme", + "license": "MIT", + "main": "./assert.js", + "maintainers": [ + { + "name": "mcavage", + "email": "mcavage@gmail.com" + }, + { + "name": "pfmooney", + "email": "patrick.f.mooney@gmail.com" + } + ], + "name": "assert-plus", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/mcavage/node-assert-plus.git" + }, + "scripts": { + "test": "tape tests/*.js | ./node_modules/.bin/faucet" + }, + "version": "1.0.0" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js index 572b00edee09b3..adb6f13b158420 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js @@ -826,7 +826,7 @@ function bashCompletionSpecFromOptions(args) { var longopts = []; var optargs = []; (args.options || []).forEach(function (o) { - if (o.group) { + if (o.group !== undefined && o.group !== null) { // Skip group headers. return; } @@ -999,12 +999,45 @@ function getOptionType(name) { } +/** + * Return a synopsis string for the given option spec. + * + * Examples: + * > synopsisFromOpt({names: ['help', 'h'], type: 'bool'}); + * '[ --help | -h ]' + * > synopsisFromOpt({name: 'file', type: 'string', helpArg: 'FILE'}); + * '[ --file=FILE ]' + */ +function synopsisFromOpt(o) { + assert.object(o, 'o'); + + if (o.hasOwnProperty('group')) { + return null; + } + var names = o.names || [o.name]; + // `type` here could be undefined if, for example, the command has a + // dashdash option spec with a bogus 'type'. + var type = getOptionType(o.type); + var helpArg = o.helpArg || (type && type.helpArg) || 'ARG'; + var parts = []; + names.forEach(function (name) { + var part = (name.length === 1 ? '-' : '--') + name; + if (type && type.takesArg) { + part += (name.length === 1 ? ' ' + helpArg : '=' + helpArg); + } + parts.push(part); + }); + return ('[ ' + parts.join(' | ') + ' ]'); +}; + + module.exports = { createParser: createParser, Parser: Parser, parse: parse, addOptionType: addOptionType, getOptionType: getOptionType, + synopsisFromOpt: synopsisFromOpt, // Bash completion-related exports BASH_COMPLETION_TEMPLATE_PATH: BASH_COMPLETION_TEMPLATE_PATH, diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json deleted file mode 100644 index 5e7cfaadf2956c..00000000000000 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json +++ /dev/null @@ -1,107 +0,0 @@ -{ - "_args": [ - [ - "assert-plus@^1.0.0", - "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash" - ] - ], - "_from": "assert-plus@>=1.0.0 <2.0.0", - "_id": "assert-plus@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/request/http-signature/sshpk/dashdash/assert-plus", - "_nodeVersion": "0.10.40", - "_npmUser": { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" - }, - "_npmVersion": "3.3.9", - "_phantomChildren": {}, - "_requested": { - "name": "assert-plus", - "raw": "assert-plus@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/request/http-signature/sshpk/dashdash" - ], - "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "_shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "_shrinkwrap": null, - "_spec": "assert-plus@^1.0.0", - "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash", - "author": { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" - }, - "bugs": { - "url": "https://github.com/mcavage/node-assert-plus/issues" - }, - "contributors": [ - { - "email": "dave@daveeddy.com", - "name": "Dave Eddy" - }, - { - "email": "fred.kuo@joyent.com", - "name": "Fred Kuo" - }, - { - "email": "ralphtheninja@riseup.net", - "name": "Lars-Magnus Skog" - }, - { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" - }, - { - "email": "pmooney@pfmooney.com", - "name": "Patrick Mooney" - }, - { - "email": "robert.gulewich@joyent.com", - "name": "Rob Gulewich" - } - ], - "dependencies": {}, - "description": "Extra assertions on top of node's assert module", - "devDependencies": { - "faucet": "0.0.1", - "tape": "4.2.2" - }, - "directories": {}, - "dist": { - "shasum": "f12e0f3c5d77b0b1cdd9146942e4e96c1e4dd525", - "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz" - }, - "engines": { - "node": ">=0.8" - }, - "homepage": "https://github.com/mcavage/node-assert-plus#readme", - "license": "MIT", - "main": "./assert.js", - "maintainers": [ - { - "email": "mcavage@gmail.com", - "name": "mcavage" - }, - { - "email": "patrick.f.mooney@gmail.com", - "name": "pfmooney" - } - ], - "name": "assert-plus", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/mcavage/node-assert-plus.git" - }, - "scripts": { - "test": "tape tests/*.js | ./node_modules/.bin/faucet" - }, - "version": "1.0.0" -} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json index 81f871030f59f6..03c284deca9110 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json @@ -1,44 +1,53 @@ { "_args": [ [ - "dashdash@>=1.10.1 <2.0.0", + { + "raw": "dashdash@^1.12.0", + "scope": null, + "escapedName": "dashdash", + "name": "dashdash", + "rawSpec": "^1.12.0", + "spec": ">=1.12.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "dashdash@>=1.10.1 <2.0.0", - "_id": "dashdash@1.13.0", + "_from": "dashdash@>=1.12.0 <2.0.0", + "_id": "dashdash@1.14.0", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/dashdash", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/dashdash-1.13.0.tgz_1455248887432_0.5643249636050314" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/dashdash-1.14.0.tgz_1464847169030_0.07120498712174594" }, "_npmUser": { - "email": "trentm@gmail.com", - "name": "trentm" + "name": "trentm", + "email": "trentm@gmail.com" }, "_npmVersion": "1.4.29", "_phantomChildren": {}, "_requested": { - "name": "dashdash", - "raw": "dashdash@>=1.10.1 <2.0.0", - "rawSpec": ">=1.10.1 <2.0.0", + "raw": "dashdash@^1.12.0", "scope": null, - "spec": ">=1.10.1 <2.0.0", + "escapedName": "dashdash", + "name": "dashdash", + "rawSpec": "^1.12.0", + "spec": ">=1.12.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature/sshpk" ], - "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz", - "_shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a", + "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz", + "_shasum": "29e486c5418bf0f356034a993d51686a33e84141", "_shrinkwrap": null, - "_spec": "dashdash@>=1.10.1 <2.0.0", + "_spec": "dashdash@^1.12.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "trentm@gmail.com", "name": "Trent Mick", + "email": "trentm@gmail.com", "url": "http://trentm.com" }, "bugs": { @@ -46,8 +55,8 @@ }, "contributors": [ { - "email": "trentm@gmail.com", "name": "Trent Mick", + "email": "trentm@gmail.com", "url": "http://trentm.com" }, { @@ -76,13 +85,13 @@ }, "directories": {}, "dist": { - "shasum": "a5aae6fd9d8e156624eb0dd9259eb12ba245385a", - "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.13.0.tgz" + "shasum": "29e486c5418bf0f356034a993d51686a33e84141", + "tarball": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.0.tgz" }, "engines": { "node": ">=0.10" }, - "gitHead": "69425c9d9000d72c95e78ca43e3f84675f8f73ff", + "gitHead": "2f70d248a509418e4473922ee034faf9cd91b3f8", "homepage": "https://github.com/trentm/node-dashdash", "keywords": [ "option", @@ -98,8 +107,8 @@ "main": "./lib/dashdash.js", "maintainers": [ { - "email": "trentm@gmail.com", - "name": "trentm" + "name": "trentm", + "email": "trentm@gmail.com" } ], "name": "dashdash", @@ -112,5 +121,5 @@ "scripts": { "test": "nodeunit test/*.test.js" }, - "version": "1.13.0" + "version": "1.14.0" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js index 371b545c53072a..24372810b8bc25 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/index.js @@ -25,11 +25,11 @@ exports.ECKey = function(curve, key, isPublic) // var y = key.slice(bytes+1); // this.P = new ECPointFp(curve, // curve.fromBigInteger(new BigInteger(x.toString("hex"), 16)), -// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); +// curve.fromBigInteger(new BigInteger(y.toString("hex"), 16))); this.P = curve.decodePointHex(key.toString("hex")); }else{ if(key.length != bytes) return false; - priv = new BigInteger(key.toString("hex"), 16); + priv = new BigInteger(key.toString("hex"), 16); } }else{ var n1 = n.subtract(BigInteger.ONE); @@ -51,6 +51,7 @@ exports.ECKey = function(curve, key, isPublic) if(!key || !key.P) return false; var S = key.P.multiply(priv); return new Buffer(unstupid(S.getX().toBigInteger().toString(16),bytes*2),"hex"); - } + } } } + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn index c769b38beabae1..24502a9cf74836 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/LICENSE-jsbn @@ -18,9 +18,9 @@ This software is covered under the following copyright: * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js index 38dc523caaf279..3852671eca2204 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/lib/ec.js @@ -434,7 +434,7 @@ ECFieldElementFp.prototype.modReduce = function(x) { u = u.multiply(this.getR()); } - x = u.add(v); + x = u.add(v); } while (x.compareTo(q) >= 0) { @@ -454,8 +454,8 @@ ECFieldElementFp.prototype.sqrt = function() // p mod 4 == 3 if (this.q.testBit(1)) { - var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); - return z.square().equals(this) ? z : null; + var z = new ECFieldElementFp(this.q,this.x.modPow(this.q.shiftRight(2).add(BigInteger.ONE),this.q)); + return z.square().equals(this) ? z : null; } // p mod 4 == 1 diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json index ec581d9a98d955..2054197955767d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json @@ -1,28 +1,37 @@ { "_args": [ [ - "ecc-jsbn@>=0.0.1 <1.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "ecc-jsbn@~0.1.1", + "scope": null, + "escapedName": "ecc-jsbn", + "name": "ecc-jsbn", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "ecc-jsbn@>=0.0.1 <1.0.0", + "_from": "ecc-jsbn@>=0.1.1 <0.2.0", "_id": "ecc-jsbn@0.1.1", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/ecc-jsbn", "_nodeVersion": "0.12.6", "_npmUser": { - "email": "jeremie@jabber.org", - "name": "quartzjer" + "name": "quartzjer", + "email": "jeremie@jabber.org" }, "_npmVersion": "2.11.2", "_phantomChildren": {}, "_requested": { - "name": "ecc-jsbn", - "raw": "ecc-jsbn@>=0.0.1 <1.0.0", - "rawSpec": ">=0.0.1 <1.0.0", + "raw": "ecc-jsbn@~0.1.1", "scope": null, - "spec": ">=0.0.1 <1.0.0", + "escapedName": "ecc-jsbn", + "name": "ecc-jsbn", + "rawSpec": "~0.1.1", + "spec": ">=0.1.1 <0.2.0", "type": "range" }, "_requiredBy": [ @@ -31,11 +40,11 @@ "_resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", "_shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505", "_shrinkwrap": null, - "_spec": "ecc-jsbn@>=0.0.1 <1.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "ecc-jsbn@~0.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { - "email": "jeremie@jabber.org", "name": "Jeremie Miller", + "email": "jeremie@jabber.org", "url": "http://jeremie.com/" }, "bugs": { @@ -49,14 +58,14 @@ "directories": {}, "dist": { "shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505", - "tarball": "http://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" + "tarball": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz" }, "gitHead": "d35a360352496721030da645e8054f07efc22487", "homepage": "https://github.com/quartzjer/ecc-jsbn", "keywords": [ - "browserify", + "jsbn", "ecc", - "jsbn" + "browserify" ], "license": "MIT", "main": "index.js", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore new file mode 100644 index 00000000000000..a4261fc06feaaf --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.npmignore @@ -0,0 +1,8 @@ +.gitmodules +deps +docs +Makefile +node_modules +test +tools +coverage diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml new file mode 100644 index 00000000000000..d8b5833a71b22c --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/.travis.yml @@ -0,0 +1,9 @@ +language: node_js +node_js: + - "5.10" + - "4.4" + - "4.1" + - "0.12" + - "0.10" +before_install: + - "make check" diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE new file mode 100644 index 00000000000000..f6d947d2f61c41 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/LICENSE @@ -0,0 +1,18 @@ +Copyright Joyent, Inc. All rights reserved. +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/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md new file mode 100644 index 00000000000000..6e4a50f63f7f00 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/README.md @@ -0,0 +1,32 @@ +## getpass + +Get a password from the terminal. Sounds simple? Sounds like the `readline` +module should be able to do it? NOPE. + +## Install and use it + +```bash +npm install --save getpass +``` + +```javascript +const mod_getpass = require('getpass'); +``` + +## API + +### `mod_getpass.getPass([options, ]callback)` + +Gets a password from the terminal. If available, this uses `/dev/tty` to avoid +interfering with any data being piped in or out of stdio. + +This function prints a prompt (by default `Password:`) and then accepts input +without echoing. + +Parameters: + + * `options`, an Object, with properties: + * `prompt`, an optional String + * `callback`, a `Func(error, password)`, with arguments: + * `error`, either `null` (no error) or an `Error` instance + * `password`, a String diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js new file mode 100644 index 00000000000000..55a7718c0f7f72 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/lib/index.js @@ -0,0 +1,123 @@ +/* + * Copyright 2016, Joyent, Inc. All rights reserved. + * Author: Alex Wilson + * + * 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. +*/ + +module.exports = { + getPass: getPass +}; + +const mod_tty = require('tty'); +const mod_fs = require('fs'); +const mod_assert = require('assert-plus'); + +var BACKSPACE = String.fromCharCode(127); +var CTRLC = '\u0003'; +var CTRLD = '\u0004'; + +function getPass(opts, cb) { + if (typeof (opts) === 'function' && cb === undefined) { + cb = opts; + opts = {}; + } + mod_assert.object(opts, 'options'); + mod_assert.func(cb, 'callback'); + + mod_assert.optionalString(opts.prompt, 'options.prompt'); + if (opts.prompt === undefined) + opts.prompt = 'Password'; + + openTTY(function (err, rfd, wfd, rtty, wtty) { + if (err) { + cb(err); + return; + } + + wtty.write(opts.prompt + ':'); + rtty.resume(); + rtty.setRawMode(true); + rtty.resume(); + rtty.setEncoding('utf8'); + + var pw = ''; + rtty.on('data', onData); + + function onData(data) { + var str = data.toString('utf8'); + for (var i = 0; i < str.length; ++i) { + var ch = str[i]; + switch (ch) { + case '\r': + case '\n': + case CTRLD: + cleanup(); + cb(null, pw); + return; + case CTRLC: + cleanup(); + cb(new Error('Aborted')); + return; + case BACKSPACE: + pw = pw.slice(0, pw.length - 1); + break; + default: + pw += ch; + break; + } + } + } + + function cleanup() { + wtty.write('\r\n'); + rtty.setRawMode(false); + rtty.pause(); + rtty.removeListener('data', onData); + if (wfd !== undefined && wfd !== rfd) { + wtty.end(); + mod_fs.closeSync(wfd); + } + if (rfd !== undefined) { + rtty.end(); + mod_fs.closeSync(rfd); + } + } + }); +} + +function openTTY(cb) { + mod_fs.open('/dev/tty', 'r+', function (err, rttyfd) { + if ((err && (err.code === 'ENOENT' || err.code === 'EACCES')) || + (process.version.match(/^v0[.][0-8][.]/))) { + cb(null, undefined, undefined, process.stdin, + process.stdout); + return; + } + var rtty = new mod_tty.ReadStream(rttyfd); + mod_fs.open('/dev/tty', 'w+', function (err3, wttyfd) { + var wtty = new mod_tty.WriteStream(wttyfd); + if (err3) { + cb(err3); + return; + } + cb(null, rttyfd, wttyfd, rtty, wtty); + }); + }); +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json new file mode 100644 index 00000000000000..bb44e44afcbf23 --- /dev/null +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/getpass/package.json @@ -0,0 +1,91 @@ +{ + "_args": [ + [ + { + "raw": "getpass@^0.1.1", + "scope": null, + "escapedName": "getpass", + "name": "getpass", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + ] + ], + "_from": "getpass@>=0.1.1 <0.2.0", + "_id": "getpass@0.1.6", + "_inCache": true, + "_installable": true, + "_location": "/request/http-signature/sshpk/getpass", + "_nodeVersion": "0.12.9", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/getpass-0.1.6.tgz_1461907090215_0.6450737570412457" + }, + "_npmUser": { + "name": "arekinath", + "email": "alex@cooperi.net" + }, + "_npmVersion": "2.14.9", + "_phantomChildren": {}, + "_requested": { + "raw": "getpass@^0.1.1", + "scope": null, + "escapedName": "getpass", + "name": "getpass", + "rawSpec": "^0.1.1", + "spec": ">=0.1.1 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request/http-signature/sshpk" + ], + "_resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz", + "_shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", + "_shrinkwrap": null, + "_spec": "getpass@^0.1.1", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "author": { + "name": "Alex Wilson", + "email": "alex.wilson@joyent.com" + }, + "bugs": { + "url": "https://github.com/arekinath/node-getpass/issues" + }, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "description": "getpass for node.js", + "devDependencies": { + "json": "^9.0.3", + "pty.js": "^0.3.0", + "tape": "^4.4.0" + }, + "directories": {}, + "dist": { + "shasum": "283ffd9fc1256840875311c1b60e8c40187110e6", + "tarball": "https://registry.npmjs.org/getpass/-/getpass-0.1.6.tgz" + }, + "gitHead": "e7fdf43ad60aa520f894d41856852aa320f36646", + "homepage": "https://github.com/arekinath/node-getpass#readme", + "license": "MIT", + "main": "lib/index.js", + "maintainers": [ + { + "name": "arekinath", + "email": "alex@cooperi.net" + } + ], + "name": "getpass", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/arekinath/node-getpass.git" + }, + "scripts": { + "test": "tape test/*.test.js" + }, + "version": "0.1.6" +} diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js index 11c83e86c7b47e..870983984b3482 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/index.js @@ -3,9 +3,9 @@ /* * Copyright (c) 2014 Mega Limited * under the MIT License. - * + * * Authors: Guy K. Kloss - * + * * You should have received a copy of the license along with this program. */ @@ -13,7 +13,7 @@ var dh = require('./lib/dh'); var eddsa = require('./lib/eddsa'); var curve255 = require('./lib/curve255'); var utils = require('./lib/utils'); - + /** * @exports jodid25519 * Curve 25519-based cryptography collection. @@ -23,7 +23,7 @@ var utils = require('./lib/utils'); * (EdDSA) based on Ed25519. */ var ns = {}; - + /** Module version indicator as string (format: [major.minor.patch]). */ ns.VERSION = '0.7.1'; diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json index 3bc9f501c6deb2..12f5e81553ba64 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "jodid25519@>=1.0.0 <2.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "jodid25519@^1.0.0", + "scope": null, + "escapedName": "jodid25519", + "name": "jodid25519", + "rawSpec": "^1.0.0", + "spec": ">=1.0.0 <2.0.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "jodid25519@>=1.0.0 <2.0.0", @@ -12,16 +20,17 @@ "_location": "/request/http-signature/sshpk/jodid25519", "_nodeVersion": "4.1.1", "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, "_npmVersion": "2.14.4", "_phantomChildren": {}, "_requested": { - "name": "jodid25519", - "raw": "jodid25519@>=1.0.0 <2.0.0", - "rawSpec": ">=1.0.0 <2.0.0", + "raw": "jodid25519@^1.0.0", "scope": null, + "escapedName": "jodid25519", + "name": "jodid25519", + "rawSpec": "^1.0.0", "spec": ">=1.0.0 <2.0.0", "type": "range" }, @@ -31,8 +40,8 @@ "_resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz", "_shasum": "06d4912255093419477d425633606e0e90782967", "_shrinkwrap": null, - "_spec": "jodid25519@>=1.0.0 <2.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "jodid25519@^1.0.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "Michele Bini, Ron Garret, Guy K. Kloss" }, @@ -55,22 +64,22 @@ "sinon-chai": "^2.8.0" }, "directories": { - "doc": "doc", "src": "src", - "test": "test" + "test": "test", + "doc": "doc" }, "dist": { "shasum": "06d4912255093419477d425633606e0e90782967", - "tarball": "http://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" + "tarball": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz" }, "gitHead": "a83b9fcf7fd3be4f27cd4a57817aff171c7cd918", "homepage": "https://github.com/meganz/jodid25519", "keywords": [ "Curve25519", - "ECDH", - "ECDSA", "Ed25519", + "ECDH", "EdDSA", + "ECDSA", "encryption", "signing" ], diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE index 7ccbf5073c8650..2a6457e9ef1e09 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/LICENSE @@ -18,9 +18,9 @@ This software is covered under the following copyright: * 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" AND WITHOUT WARRANTY OF ANY KIND, - * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY - * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. + * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND, + * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY + * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. * * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL, * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md index 9686611db7f379..7aac67f53ff0ef 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/README.md @@ -7,7 +7,7 @@ I felt compelled to put this on github and publish to npm. I haven't tested ever ## usage var BigInteger = require('jsbn'); - + var a = new BigInteger('91823918239182398123'); alert(a.bitLength()); // 67 @@ -171,3 +171,5 @@ returns new BI of absolute value ### bi.isProbablePrime + + diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html index ea180b8cc4268f..7c26a5665c1b1a 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/example.html @@ -5,8 +5,8 @@ - - + + \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json index 838d035ffcd59b..30d10169dc1ac7 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "jsbn@>=0.1.0 <0.2.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" + { + "raw": "jsbn@~0.1.0", + "scope": null, + "escapedName": "jsbn", + "name": "jsbn", + "rawSpec": "~0.1.0", + "spec": ">=0.1.0 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], "_from": "jsbn@>=0.1.0 <0.2.0", @@ -12,16 +20,17 @@ "_location": "/request/http-signature/sshpk/jsbn", "_nodeVersion": "0.12.2", "_npmUser": { - "email": "andyperlitch@gmail.com", - "name": "andyperlitch" + "name": "andyperlitch", + "email": "andyperlitch@gmail.com" }, "_npmVersion": "2.7.4", "_phantomChildren": {}, "_requested": { - "name": "jsbn", - "raw": "jsbn@>=0.1.0 <0.2.0", - "rawSpec": ">=0.1.0 <0.2.0", + "raw": "jsbn@~0.1.0", "scope": null, + "escapedName": "jsbn", + "name": "jsbn", + "rawSpec": "~0.1.0", "spec": ">=0.1.0 <0.2.0", "type": "range" }, @@ -33,8 +42,8 @@ "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz", "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", "_shrinkwrap": null, - "_spec": "jsbn@>=0.1.0 <0.2.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", + "_spec": "jsbn@~0.1.0", + "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "Tom Wu" }, @@ -47,14 +56,14 @@ "directories": {}, "dist": { "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd", - "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" + "tarball": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz" }, "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a", "homepage": "https://github.com/andyperlitch/jsbn", "keywords": [ - "big", "biginteger", "bignumber", + "big", "integer" ], "license": "BSD", diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md index 3ebc0affaa8ec0..77c69bd5ee45be 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/CHANGELOG.md @@ -2,59 +2,6 @@ TweetNaCl.js Changelog ====================== -v0.14.1 -------- - -No code changes, just tweaked packaging and added COPYING.txt. - - -v0.14.0 -------- - -* **Breaking change!** All functions from `nacl.util` have been removed. These - functions are no longer available: - - nacl.util.decodeUTF8 - nacl.util.encodeUTF8 - nacl.util.decodeBase64 - nacl.util.encodeBase64 - - If want to continue using them, you can include - package: - - - - - or - - var nacl = require('tweetnacl'); - nacl.util = require('tweetnacl-util'); - - However it is recommended to use better packages that have wider - compatibility and better performance. Functions from `nacl.util` were never - intended to be robust solution for string conversion and were included for - convenience: cryptography library is not the right place for them. - - Currently calling these functions will throw error pointing to - `tweetnacl-util-js` (in the next version this error message will be removed). - -* Improved detection of available random number generators, making it possible - to use `nacl.randomBytes` and related functions in Web Workers without - changes. - -* Changes to testing (see README). - - -v0.13.3 -------- - -No code changes. - -* Reverted license field in package.json to "Public domain". - -* Fixed typo in README. - - v0.13.2 ------- @@ -141,18 +88,18 @@ v0.10.0 * **Signature API breaking change!** `nacl.sign` and `nacl.sign.open` now deal with signed messages, and new `nacl.sign.detached` and `nacl.sign.detached.verify` are available. - + Previously, `nacl.sign` returned a signature, and `nacl.sign.open` accepted a message and "detached" signature. This was unlike NaCl's API, which dealt with signed messages (concatenation of signature and message). - + The new API is: nacl.sign(message, secretKey) -> signedMessage nacl.sign.open(signedMessage, publicKey) -> message | null Since detached signatures are common, two new API functions were introduced: - + nacl.sign.detached(message, secretKey) -> signature nacl.sign.detached.verify(message, signature, publicKey) -> true | false diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt deleted file mode 100644 index c2bd1e5b7e81ab..00000000000000 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/COPYING.txt +++ /dev/null @@ -1,9 +0,0 @@ -Public Domain - -The person who associated a work with this deed has dedicated the work to the -public domain by waiving all of his or her rights to the work worldwide under -copyright law, including all related and neighboring rights, to the extent -allowed by law. - -You can copy, modify, distribute and perform the work, even for commercial -purposes, all without asking permission. diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md index c80bbed8d8da15..11bd3472c258d1 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md @@ -7,7 +7,7 @@ to JavaScript for modern browsers and Node.js. Public domain. [![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master) ](https://travis-ci.org/dchest/tweetnacl-js) -Demo: +[Demo](https://dchest.github.io/tweetnacl-js/) **:warning: Beta version. The library is stable and API is frozen, however it has not been independently reviewed. If you can help reviewing it, please @@ -26,6 +26,8 @@ Documentation * [Hashing](#hashing) * [Random bytes generation](#random-bytes-generation) * [Constant-time comparison](#constant-time-comparison) + * [Utilities](#utilities) +* [Examples](#examples) * [System requirements](#system-requirements) * [Development and testing](#development-and-testing) * [Contributors](#contributors) @@ -65,20 +67,10 @@ or [download source code](https://github.com/dchest/tweetnacl-js/releases). Usage ------ +------ All API functions accept and return bytes as `Uint8Array`s. If you need to -encode or decode strings, use functions from - or one of the more robust codec -packages. - -In Node.js v4 and later `Buffer` objects are backed by `Uint8Array`s, so you -can freely pass them to TweetNaCl.js functions as arguments. The returned -objects are still `Uint8Array`s, so if you need `Buffer`s, you'll have to -convert them manually; make sure to convert using copying: `new Buffer(array)`, -instead of sharing: `new Buffer(array.buffer)`, because some functions return -subarrays of their buffers. - +encode or decode strings, use functions from `nacl.util` namespace. ### Public-key authenticated encryption (box) @@ -295,6 +287,12 @@ depending on the platform it runs on: * `window.msCrypto.getRandomValues` (Internet Explorer 11) * `crypto.randomBytes` (Node.js) +Note that browsers are required to throw `QuotaExceededError` exception if +requested `length` is more than 65536, so do not ask for more than 65536 bytes +in *one call* (multiple calls to get as many bytes as you like are okay: +browsers can generate infinite amount of random bytes without any bad +consequences). + If the platform doesn't provide a suitable PRNG, the following functions, which require random numbers, will throw exception: @@ -328,6 +326,30 @@ Returns `false` if either of the arguments has zero length, or arguments have different lengths, or their contents differ. +### Utilities + +Encoding/decoding functions are provided for convenience. They are correct, +however their performance and wide compatibility with uncommon runtimes is not +something that is considered important compared to the simplicity and size of +implementation. You can use third-party libraries if you need to. + +#### nacl.util.decodeUTF8(string) + +Decodes string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeUTF8(array) + +Encodes `Uint8Array` or `Array` of bytes into string. + +#### nacl.util.decodeBase64(string) + +Decodes Base-64 encoded string and returns `Uint8Array` of bytes. + +#### nacl.util.encodeBase64(array) + +Encodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding. + + System requirements ------------------- @@ -342,7 +364,7 @@ of: Other systems: -* Node.js +* Node.js (we test on 0.10 and later) Development and testing @@ -363,36 +385,32 @@ Tests use minified version, so make sure to rebuild it every time you change To run tests in Node.js: - $ npm run test-node + $ npm test By default all tests described here work on `nacl.min.js`. To test other versions, set environment variable `NACL_SRC` to the file name you want to test. For example, the following command will test fast minified version: - $ NACL_SRC=nacl-fast.min.js npm run test-node + $ NACL_SRC=nacl-fast.min.js npm test To run full suite of tests in Node.js, including comparing outputs of JavaScript port to outputs of the original C version: - $ npm run test-node-all + $ npm run testall To prepare tests for browsers: - $ npm run build-test-browser + $ npm run browser and then open `test/browser/test.html` (or `test/browser/test-fast.html`) to run them. -To run headless browser tests with `tape-run` (powered by Electron): +To run headless browser tests with `testling`: - $ npm run test-browser + $ npm run testling (If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.) -To run tests in both Node and Electron: - - $ npm test - ### Benchmarking To run benchmarks in Node.js: diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js index 5e4562fe89a1ab..6c4995848cc42c 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.js @@ -745,7 +745,7 @@ poly1305.prototype.finish = function(mac, macpos) { } g[9] -= (1 << 13); - mask = (c ^ 1) - 1; + mask = (g[9] >>> ((2 * 8) - 1)) - 1; for (i = 0; i < 10; i++) g[i] &= mask; mask = ~mask; for (i = 0; i < 10; i++) this.h[i] = (this.h[i] & mask) | g[i]; @@ -2157,13 +2157,39 @@ function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } -// TODO: Completely remove this in v0.15. -if (!nacl.util) { - nacl.util = {}; - nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { - throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); - }; -} +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; nacl.randomBytes = function(n) { var b = new Uint8Array(n); @@ -2360,22 +2386,26 @@ nacl.setPRNG = function(fn) { (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. - var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; - if (crypto && crypto.getRandomValues) { - // Browsers. - var QUOTA = 65536; - nacl.setPRNG(function(x, n) { - var i, v = new Uint8Array(n); - for (i = 0; i < n; i += QUOTA) { - crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); - } - for (i = 0; i < n; i++) x[i] = v[i]; - cleanup(v); - }); + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } } else if (typeof require !== 'undefined') { // Node.js. crypto = require('crypto'); - if (crypto && crypto.randomBytes) { + if (crypto) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; @@ -2385,4 +2415,4 @@ nacl.setPRNG = function(fn) { } })(); -})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {})); +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js index 624fbbe91e71fc..7072c2af4435bd 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl-fast.min.js @@ -1,2 +1,2 @@ -!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;d=d+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+v|0,L=L+b|0,z=z+g|0,R=R+_|0,P=P+A|0,r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=z>>>0&255,r[53]=z>>>8&255,r[54]=z>>>16&255,r[55]=z>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=P>>>0&255,r[61]=P>>>8&255,r[62]=P>>>16&255,r[63]=P>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,v=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,b=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,g=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,_=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,d=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=v,L=b,z=g,R=_,P=A,O=0;20>O;O+=2)o=d+L|0,M^=o<<7|o>>>25,o=M+d|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,d^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,z^=o<<9|o>>>23,o=z+T|0,U^=o<<13|o>>>19,o=U+z|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=P+k|0,x^=o<<7|o>>>25,o=x+P|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,P^=o<<18|o>>>14,o=d+x|0,U^=o<<7|o>>>25,o=U+d|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,d^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=P+R|0,L^=o<<7|o>>>25,o=L+P|0,z^=o<<9|o>>>23,o=z+L|0,R^=o<<13|o>>>19,o=R+z|0,P^=o<<18|o>>>14;r[0]=d>>>0&255,r[1]=d>>>8&255,r[2]=d>>>16&255,r[3]=d>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=P>>>0&255,r[13]=P>>>8&255,r[14]=P>>>16&255,r[15]=P>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function v(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function b(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function g(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function _(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(g(h),g(h),g(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,_(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function d(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,v=0,b=0,g=0,_=0,A=0,d=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,z=0,R=0,P=n[0],O=n[1],N=n[2],C=n[3],F=n[4],I=n[5],G=n[6],Z=n[7],j=n[8],q=n[9],V=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*P,h+=e*O,a+=e*N,f+=e*C,s+=e*F,u+=e*I,c+=e*G,y+=e*Z,l+=e*j,w+=e*q,p+=e*V,v+=e*X,b+=e*D,g+=e*H,_+=e*J,A+=e*Q,e=t[1],h+=e*P,a+=e*O,f+=e*N,s+=e*C,u+=e*F,c+=e*I,y+=e*G,l+=e*Z,w+=e*j,p+=e*q,v+=e*V,b+=e*X,g+=e*D,_+=e*H,A+=e*J,d+=e*Q,e=t[2],a+=e*P,f+=e*O,s+=e*N,u+=e*C,c+=e*F,y+=e*I,l+=e*G,w+=e*Z,p+=e*j,v+=e*q,b+=e*V,g+=e*X,_+=e*D,A+=e*H,d+=e*J,U+=e*Q,e=t[3],f+=e*P,s+=e*O,u+=e*N,c+=e*C,y+=e*F,l+=e*I,w+=e*G,p+=e*Z,v+=e*j,b+=e*q,g+=e*V,_+=e*X,A+=e*D,d+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*P,u+=e*O,c+=e*N,y+=e*C,l+=e*F,w+=e*I,p+=e*G,v+=e*Z,b+=e*j,g+=e*q,_+=e*V,A+=e*X,d+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*P,c+=e*O,y+=e*N,l+=e*C,w+=e*F,p+=e*I,v+=e*G,b+=e*Z,g+=e*j,_+=e*q,A+=e*V,d+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*P,y+=e*O,l+=e*N,w+=e*C,p+=e*F,v+=e*I,b+=e*G,g+=e*Z,_+=e*j,A+=e*q,d+=e*V,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*P,l+=e*O,w+=e*N,p+=e*C,v+=e*F,b+=e*I,g+=e*G,_+=e*Z,A+=e*j,d+=e*q,U+=e*V,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*P,w+=e*O,p+=e*N,v+=e*C,b+=e*F,g+=e*I,_+=e*G,A+=e*Z,d+=e*j,U+=e*q,E+=e*V,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*P,p+=e*O,v+=e*N,b+=e*C,g+=e*F,_+=e*I,A+=e*G,d+=e*Z,U+=e*j,E+=e*q,x+=e*V,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*P,v+=e*O,b+=e*N,g+=e*C,_+=e*F,A+=e*I,d+=e*G,U+=e*Z,E+=e*j,x+=e*q,M+=e*V,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],v+=e*P,b+=e*O,g+=e*N,_+=e*C,A+=e*F,d+=e*I,U+=e*G,E+=e*Z,x+=e*j,M+=e*q,m+=e*V,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],b+=e*P,g+=e*O,_+=e*N,A+=e*C,d+=e*F,U+=e*I,E+=e*G,x+=e*Z,M+=e*j,m+=e*q,B+=e*V,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],g+=e*P,_+=e*O,A+=e*N,d+=e*C,U+=e*F,E+=e*I,x+=e*G,M+=e*Z,m+=e*j,B+=e*q,S+=e*V,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],_+=e*P,A+=e*O,d+=e*N,U+=e*C,E+=e*F,x+=e*I,M+=e*G,m+=e*Z,B+=e*j,S+=e*q,K+=e*V,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,z+=e*Q,e=t[15],A+=e*P,d+=e*O,U+=e*N,E+=e*C,x+=e*F,M+=e*I,m+=e*G,B+=e*Z,S+=e*j,K+=e*q,T+=e*V,Y+=e*X,k+=e*D,L+=e*H,z+=e*J,R+=e*Q,i+=38*d,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,v+=38*k,b+=38*L,g+=38*z,_+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=_+o+65535,o=Math.floor(e/65536),_=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=v,r[12]=b,r[13]=g,r[14]=_,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,_(a,f,e),_(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),_(a,f,e),_(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function z(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function P(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],z=r[2],R=r[3],P=r[4],O=r[5],N=r[6],C=r[7],F=t[0],I=t[1],G=t[2],Z=t[3],j=t[4],q=t[5],V=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=z,a=R,f=P,s=O,u=N,c=C,y=F,l=I,w=G,p=Z,v=j,b=q,g=V,_=X,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(P>>>14|j<<18)^(P>>>18|j<<14)^(j>>>9|P<<23),M=(j>>>14|P<<18)^(j>>>18|P<<14)^(P>>>9|j<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=P&O^~P&N,M=j&q^~j&V,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,d=65535&m|B<<16,x=A,M=d,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&z^L&z,M=F&I^F&G^I&G,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,_=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=d,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,z=i,R=h,P=a,O=f,N=s,C=u,k=c,I=y,G=l,Z=w,j=p,q=v,V=b,X=g,F=_,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],d=Y[(E+1)%16],x=(A>>>1|d<<31)^(A>>>8|d<<24)^A>>>7,M=(d>>>1|A<<31)^(d>>>8|A<<24)^(d>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],d=Y[(E+14)%16],x=(A>>>19|d<<13)^(d>>>29|A<<3)^A>>>6,M=(d>>>19|A<<13)^(A>>>29|d<<3)^(d>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=z,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=z=65535&S|K<<16,t[2]=G=65535&m|B<<16,x=R,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=Z=65535&m|B<<16,x=P,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=P=65535&S|K<<16,t[4]=j=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=O=65535&S|K<<16,t[5]=q=65535&m|B<<16,x=N,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=N=65535&S|K<<16,t[6]=V=65535&m|B<<16,x=C,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=C=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function O(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,P(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),P(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function N(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function C(r,t,n){var e;for(e=0;4>e;e++)_(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(b(r[0],er),b(r[1],or),b(r[2],or),b(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,C(r,t,e),N(t,r),N(r,r),C(r,t,e)}function G(r,t){var n=[$(),$(),$(),$()];b(n[0],fr),b(n[1],sr),b(n[2],or),m(n[3],fr,sr),I(r,n,t)}function Z(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),O(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,G(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function j(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*vr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*vr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*vr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function q(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;j(r,n)}function V(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];O(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(O(f,r.subarray(32),n+32),q(f),G(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(O(a,r,n+64),q(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return j(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return b(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),d(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),d(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(O(f,r,n),q(f),I(s,u,f),G(u,t.subarray(32)),N(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==br)throw new Error("bad key size");if(t.length!==gr)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,v,b,g,_,A,d,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],z=this.r[1],R=this.r[2],P=this.r[3],O=this.r[4],N=this.r[5],C=this.r[6],F=this.r[7],I=this.r[8],G=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=x*(5*G),y+=M*(5*I),y+=m*(5*F),y+=B*(5*C),c=y>>>13,y&=8191,y+=S*(5*N),y+=K*(5*O),y+=T*(5*P),y+=Y*(5*R),y+=k*(5*z),c+=y>>>13,y&=8191,l=c,l+=E*z,l+=x*L,l+=M*(5*G),l+=m*(5*I),l+=B*(5*F),c=l>>>13,l&=8191,l+=S*(5*C),l+=K*(5*N),l+=T*(5*O),l+=Y*(5*P),l+=k*(5*R),c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*z,w+=M*L,w+=m*(5*G),w+=B*(5*I),c=w>>>13,w&=8191,w+=S*(5*F),w+=K*(5*C),w+=T*(5*N),w+=Y*(5*O),w+=k*(5*P),c+=w>>>13,w&=8191,p=c,p+=E*P,p+=x*R,p+=M*z,p+=m*L,p+=B*(5*G),c=p>>>13,p&=8191,p+=S*(5*I),p+=K*(5*F),p+=T*(5*C),p+=Y*(5*N),p+=k*(5*O),c+=p>>>13,p&=8191,v=c,v+=E*O,v+=x*P,v+=M*R,v+=m*z,v+=B*L,c=v>>>13,v&=8191,v+=S*(5*G),v+=K*(5*I),v+=T*(5*F),v+=Y*(5*C),v+=k*(5*N),c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*R,b+=B*z,c=b>>>13,b&=8191,b+=S*L,b+=K*(5*G),b+=T*(5*I),b+=Y*(5*F),b+=k*(5*C),c+=b>>>13,b&=8191,g=c,g+=E*C,g+=x*N,g+=M*O,g+=m*P,g+=B*R,c=g>>>13,g&=8191,g+=S*z,g+=K*L,g+=T*(5*G),g+=Y*(5*I),g+=k*(5*F),c+=g>>>13,g&=8191,_=c,_+=E*F,_+=x*C,_+=M*N,_+=m*O,_+=B*P,c=_>>>13,_&=8191,_+=S*R,_+=K*z,_+=T*L,_+=Y*(5*G),_+=k*(5*I),c+=_>>>13,_&=8191,A=c,A+=E*I,A+=x*F,A+=M*C,A+=m*N,A+=B*O,c=A>>>13,A&=8191,A+=S*P,A+=K*R,A+=T*z,A+=Y*L,A+=k*(5*G),c+=A>>>13,A&=8191,d=c,d+=E*G,d+=x*I,d+=M*F,d+=m*C,d+=B*N,c=d>>>13,d&=8191,d+=S*O,d+=K*P,d+=T*R,d+=Y*z,d+=k*L,c+=d>>>13,d&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=v,S=b,K=g,T=_,Y=A,k=d,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(1^n)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=v,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],vr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),br=32,gr=24,_r=32,Ar=16,dr=32,Ur=32,Er=32,xr=32,Mr=32,mr=gr,Br=_r,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:v,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:z,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:O,crypto_sign:V,crypto_sign_keypair:Z,crypto_sign_open:D,crypto_secretbox_KEYBYTES:br,crypto_secretbox_NONCEBYTES:gr,crypto_secretbox_ZEROBYTES:_r,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:dr,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util||(r.util={},r.util.decodeUTF8=r.util.encodeUTF8=r.util.encodeBase64=r.util.decodeBase64=function(){throw new Error("nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js")}),r.randomBytes=function(r){var t=new Uint8Array(r);return rr(t,r),t},r.secretbox=function(r,t,n){Q(r,t,n),H(n,t);for(var e=new Uint8Array(_r+r.length),o=new Uint8Array(e.length),i=0;ie)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return Z(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return Z(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return O(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t), -0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(t&&t.getRandomValues){var n=65536;r.setPRNG(function(r,e){var o,i=new Uint8Array(e);for(o=0;e>o;o+=n)t.getRandomValues(i.subarray(o,o+Math.min(e-o,n)));for(o=0;e>o;o++)r[o]=i[o];W(i)})}else"undefined"!=typeof require&&(t=require("crypto"),t&&t.randomBytes&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file +!function(r){"use strict";function t(r,t,n,e){r[t]=n>>24&255,r[t+1]=n>>16&255,r[t+2]=n>>8&255,r[t+3]=255&n,r[t+4]=e>>24&255,r[t+5]=e>>16&255,r[t+6]=e>>8&255,r[t+7]=255&e}function n(r,t,n,e,o){var i,h=0;for(i=0;o>i;i++)h|=r[t+i]^n[e+i];return(1&h-1>>>8)-1}function e(r,t,e,o){return n(r,t,e,o,16)}function o(r,t,e,o){return n(r,t,e,o,32)}function i(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;_=_+i|0,U=U+h|0,E=E+a|0,x=x+f|0,M=M+s|0,m=m+u|0,B=B+c|0,S=S+y|0,K=K+l|0,T=T+w|0,Y=Y+p|0,k=k+g|0,L=L+v|0,C=C+b|0,R=R+d|0,z=z+A|0,r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=U>>>0&255,r[5]=U>>>8&255,r[6]=U>>>16&255,r[7]=U>>>24&255,r[8]=E>>>0&255,r[9]=E>>>8&255,r[10]=E>>>16&255,r[11]=E>>>24&255,r[12]=x>>>0&255,r[13]=x>>>8&255,r[14]=x>>>16&255,r[15]=x>>>24&255,r[16]=M>>>0&255,r[17]=M>>>8&255,r[18]=M>>>16&255,r[19]=M>>>24&255,r[20]=m>>>0&255,r[21]=m>>>8&255,r[22]=m>>>16&255,r[23]=m>>>24&255,r[24]=B>>>0&255,r[25]=B>>>8&255,r[26]=B>>>16&255,r[27]=B>>>24&255,r[28]=S>>>0&255,r[29]=S>>>8&255,r[30]=S>>>16&255,r[31]=S>>>24&255,r[32]=K>>>0&255,r[33]=K>>>8&255,r[34]=K>>>16&255,r[35]=K>>>24&255,r[36]=T>>>0&255,r[37]=T>>>8&255,r[38]=T>>>16&255,r[39]=T>>>24&255,r[40]=Y>>>0&255,r[41]=Y>>>8&255,r[42]=Y>>>16&255,r[43]=Y>>>24&255,r[44]=k>>>0&255,r[45]=k>>>8&255,r[46]=k>>>16&255,r[47]=k>>>24&255,r[48]=L>>>0&255,r[49]=L>>>8&255,r[50]=L>>>16&255,r[51]=L>>>24&255,r[52]=C>>>0&255,r[53]=C>>>8&255,r[54]=C>>>16&255,r[55]=C>>>24&255,r[56]=R>>>0&255,r[57]=R>>>8&255,r[58]=R>>>16&255,r[59]=R>>>24&255,r[60]=z>>>0&255,r[61]=z>>>8&255,r[62]=z>>>16&255,r[63]=z>>>24&255}function h(r,t,n,e){for(var o,i=255&e[0]|(255&e[1])<<8|(255&e[2])<<16|(255&e[3])<<24,h=255&n[0]|(255&n[1])<<8|(255&n[2])<<16|(255&n[3])<<24,a=255&n[4]|(255&n[5])<<8|(255&n[6])<<16|(255&n[7])<<24,f=255&n[8]|(255&n[9])<<8|(255&n[10])<<16|(255&n[11])<<24,s=255&n[12]|(255&n[13])<<8|(255&n[14])<<16|(255&n[15])<<24,u=255&e[4]|(255&e[5])<<8|(255&e[6])<<16|(255&e[7])<<24,c=255&t[0]|(255&t[1])<<8|(255&t[2])<<16|(255&t[3])<<24,y=255&t[4]|(255&t[5])<<8|(255&t[6])<<16|(255&t[7])<<24,l=255&t[8]|(255&t[9])<<8|(255&t[10])<<16|(255&t[11])<<24,w=255&t[12]|(255&t[13])<<8|(255&t[14])<<16|(255&t[15])<<24,p=255&e[8]|(255&e[9])<<8|(255&e[10])<<16|(255&e[11])<<24,g=255&n[16]|(255&n[17])<<8|(255&n[18])<<16|(255&n[19])<<24,v=255&n[20]|(255&n[21])<<8|(255&n[22])<<16|(255&n[23])<<24,b=255&n[24]|(255&n[25])<<8|(255&n[26])<<16|(255&n[27])<<24,d=255&n[28]|(255&n[29])<<8|(255&n[30])<<16|(255&n[31])<<24,A=255&e[12]|(255&e[13])<<8|(255&e[14])<<16|(255&e[15])<<24,_=i,U=h,E=a,x=f,M=s,m=u,B=c,S=y,K=l,T=w,Y=p,k=g,L=v,C=b,R=d,z=A,P=0;20>P;P+=2)o=_+L|0,M^=o<<7|o>>>25,o=M+_|0,K^=o<<9|o>>>23,o=K+M|0,L^=o<<13|o>>>19,o=L+K|0,_^=o<<18|o>>>14,o=m+U|0,T^=o<<7|o>>>25,o=T+m|0,C^=o<<9|o>>>23,o=C+T|0,U^=o<<13|o>>>19,o=U+C|0,m^=o<<18|o>>>14,o=Y+B|0,R^=o<<7|o>>>25,o=R+Y|0,E^=o<<9|o>>>23,o=E+R|0,B^=o<<13|o>>>19,o=B+E|0,Y^=o<<18|o>>>14,o=z+k|0,x^=o<<7|o>>>25,o=x+z|0,S^=o<<9|o>>>23,o=S+x|0,k^=o<<13|o>>>19,o=k+S|0,z^=o<<18|o>>>14,o=_+x|0,U^=o<<7|o>>>25,o=U+_|0,E^=o<<9|o>>>23,o=E+U|0,x^=o<<13|o>>>19,o=x+E|0,_^=o<<18|o>>>14,o=m+M|0,B^=o<<7|o>>>25,o=B+m|0,S^=o<<9|o>>>23,o=S+B|0,M^=o<<13|o>>>19,o=M+S|0,m^=o<<18|o>>>14,o=Y+T|0,k^=o<<7|o>>>25,o=k+Y|0,K^=o<<9|o>>>23,o=K+k|0,T^=o<<13|o>>>19,o=T+K|0,Y^=o<<18|o>>>14,o=z+R|0,L^=o<<7|o>>>25,o=L+z|0,C^=o<<9|o>>>23,o=C+L|0,R^=o<<13|o>>>19,o=R+C|0,z^=o<<18|o>>>14;r[0]=_>>>0&255,r[1]=_>>>8&255,r[2]=_>>>16&255,r[3]=_>>>24&255,r[4]=m>>>0&255,r[5]=m>>>8&255,r[6]=m>>>16&255,r[7]=m>>>24&255,r[8]=Y>>>0&255,r[9]=Y>>>8&255,r[10]=Y>>>16&255,r[11]=Y>>>24&255,r[12]=z>>>0&255,r[13]=z>>>8&255,r[14]=z>>>16&255,r[15]=z>>>24&255,r[16]=B>>>0&255,r[17]=B>>>8&255,r[18]=B>>>16&255,r[19]=B>>>24&255,r[20]=S>>>0&255,r[21]=S>>>8&255,r[22]=S>>>16&255,r[23]=S>>>24&255,r[24]=K>>>0&255,r[25]=K>>>8&255,r[26]=K>>>16&255,r[27]=K>>>24&255,r[28]=T>>>0&255,r[29]=T>>>8&255,r[30]=T>>>16&255,r[31]=T>>>24&255}function a(r,t,n,e){i(r,t,n,e)}function f(r,t,n,e){h(r,t,n,e)}function s(r,t,n,e,o,i,h){var f,s,u=new Uint8Array(16),c=new Uint8Array(64);for(s=0;16>s;s++)u[s]=0;for(s=0;8>s;s++)u[s]=i[s];for(;o>=64;){for(a(c,u,h,cr),s=0;64>s;s++)r[t+s]=n[e+s]^c[s];for(f=1,s=8;16>s;s++)f=f+(255&u[s])|0,u[s]=255&f,f>>>=8;o-=64,t+=64,e+=64}if(o>0)for(a(c,u,h,cr),s=0;o>s;s++)r[t+s]=n[e+s]^c[s];return 0}function u(r,t,n,e,o){var i,h,f=new Uint8Array(16),s=new Uint8Array(64);for(h=0;16>h;h++)f[h]=0;for(h=0;8>h;h++)f[h]=e[h];for(;n>=64;){for(a(s,f,o,cr),h=0;64>h;h++)r[t+h]=s[h];for(i=1,h=8;16>h;h++)i=i+(255&f[h])|0,f[h]=255&i,i>>>=8;n-=64,t+=64}if(n>0)for(a(s,f,o,cr),h=0;n>h;h++)r[t+h]=s[h];return 0}function c(r,t,n,e,o){var i=new Uint8Array(32);f(i,e,o,cr);for(var h=new Uint8Array(8),a=0;8>a;a++)h[a]=e[a+16];return u(r,t,n,h,i)}function y(r,t,n,e,o,i,h){var a=new Uint8Array(32);f(a,i,h,cr);for(var u=new Uint8Array(8),c=0;8>c;c++)u[c]=i[c+16];return s(r,t,n,e,o,u,a)}function l(r,t,n,e,o,i){var h=new yr(i);return h.update(n,e,o),h.finish(r,t),0}function w(r,t,n,o,i,h){var a=new Uint8Array(16);return l(a,0,n,o,i,h),e(r,t,a,0)}function p(r,t,n,e,o){var i;if(32>n)return-1;for(y(r,0,t,0,n,e,o),l(r,16,r,32,n-32,r),i=0;16>i;i++)r[i]=0;return 0}function g(r,t,n,e,o){var i,h=new Uint8Array(32);if(32>n)return-1;if(c(h,0,32,e,o),0!==w(t,16,t,32,n-32,h))return-1;for(y(r,0,t,0,n,e,o),i=0;32>i;i++)r[i]=0;return 0}function v(r,t){var n;for(n=0;16>n;n++)r[n]=0|t[n]}function b(r){var t,n,e=1;for(t=0;16>t;t++)n=r[t]+e+65535,e=Math.floor(n/65536),r[t]=n-65536*e;r[0]+=e-1+37*(e-1)}function d(r,t,n){for(var e,o=~(n-1),i=0;16>i;i++)e=o&(r[i]^t[i]),r[i]^=e,t[i]^=e}function A(r,t){var n,e,o,i=$(),h=$();for(n=0;16>n;n++)h[n]=t[n];for(b(h),b(h),b(h),e=0;2>e;e++){for(i[0]=h[0]-65517,n=1;15>n;n++)i[n]=h[n]-65535-(i[n-1]>>16&1),i[n-1]&=65535;i[15]=h[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(h,i,1-o)}for(n=0;16>n;n++)r[2*n]=255&h[n],r[2*n+1]=h[n]>>8}function _(r,t){var n=new Uint8Array(32),e=new Uint8Array(32);return A(n,r),A(e,t),o(n,0,e,0)}function U(r){var t=new Uint8Array(32);return A(t,r),1&t[0]}function E(r,t){var n;for(n=0;16>n;n++)r[n]=t[2*n]+(t[2*n+1]<<8);r[15]&=32767}function x(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]+n[e]}function M(r,t,n){for(var e=0;16>e;e++)r[e]=t[e]-n[e]}function m(r,t,n){var e,o,i=0,h=0,a=0,f=0,s=0,u=0,c=0,y=0,l=0,w=0,p=0,g=0,v=0,b=0,d=0,A=0,_=0,U=0,E=0,x=0,M=0,m=0,B=0,S=0,K=0,T=0,Y=0,k=0,L=0,C=0,R=0,z=n[0],P=n[1],O=n[2],N=n[3],F=n[4],I=n[5],j=n[6],G=n[7],Z=n[8],V=n[9],q=n[10],X=n[11],D=n[12],H=n[13],J=n[14],Q=n[15];e=t[0],i+=e*z,h+=e*P,a+=e*O,f+=e*N,s+=e*F,u+=e*I,c+=e*j,y+=e*G,l+=e*Z,w+=e*V,p+=e*q,g+=e*X,v+=e*D,b+=e*H,d+=e*J,A+=e*Q,e=t[1],h+=e*z,a+=e*P,f+=e*O,s+=e*N,u+=e*F,c+=e*I,y+=e*j,l+=e*G,w+=e*Z,p+=e*V,g+=e*q,v+=e*X,b+=e*D,d+=e*H,A+=e*J,_+=e*Q,e=t[2],a+=e*z,f+=e*P,s+=e*O,u+=e*N,c+=e*F,y+=e*I,l+=e*j,w+=e*G,p+=e*Z,g+=e*V,v+=e*q,b+=e*X,d+=e*D,A+=e*H,_+=e*J,U+=e*Q,e=t[3],f+=e*z,s+=e*P,u+=e*O,c+=e*N,y+=e*F,l+=e*I,w+=e*j,p+=e*G,g+=e*Z,v+=e*V,b+=e*q,d+=e*X,A+=e*D,_+=e*H,U+=e*J,E+=e*Q,e=t[4],s+=e*z,u+=e*P,c+=e*O,y+=e*N,l+=e*F,w+=e*I,p+=e*j,g+=e*G,v+=e*Z,b+=e*V,d+=e*q,A+=e*X,_+=e*D,U+=e*H,E+=e*J,x+=e*Q,e=t[5],u+=e*z,c+=e*P,y+=e*O,l+=e*N,w+=e*F,p+=e*I,g+=e*j,v+=e*G,b+=e*Z,d+=e*V,A+=e*q,_+=e*X,U+=e*D,E+=e*H,x+=e*J,M+=e*Q,e=t[6],c+=e*z,y+=e*P,l+=e*O,w+=e*N,p+=e*F,g+=e*I,v+=e*j,b+=e*G,d+=e*Z,A+=e*V,_+=e*q,U+=e*X,E+=e*D,x+=e*H,M+=e*J,m+=e*Q,e=t[7],y+=e*z,l+=e*P,w+=e*O,p+=e*N,g+=e*F,v+=e*I,b+=e*j,d+=e*G,A+=e*Z,_+=e*V,U+=e*q,E+=e*X,x+=e*D,M+=e*H,m+=e*J,B+=e*Q,e=t[8],l+=e*z,w+=e*P,p+=e*O,g+=e*N,v+=e*F,b+=e*I,d+=e*j,A+=e*G,_+=e*Z,U+=e*V,E+=e*q,x+=e*X,M+=e*D,m+=e*H,B+=e*J,S+=e*Q,e=t[9],w+=e*z,p+=e*P,g+=e*O,v+=e*N,b+=e*F,d+=e*I,A+=e*j,_+=e*G,U+=e*Z,E+=e*V,x+=e*q,M+=e*X,m+=e*D,B+=e*H,S+=e*J,K+=e*Q,e=t[10],p+=e*z,g+=e*P,v+=e*O,b+=e*N,d+=e*F,A+=e*I,_+=e*j,U+=e*G,E+=e*Z,x+=e*V,M+=e*q,m+=e*X,B+=e*D,S+=e*H,K+=e*J,T+=e*Q,e=t[11],g+=e*z,v+=e*P,b+=e*O,d+=e*N,A+=e*F,_+=e*I,U+=e*j,E+=e*G,x+=e*Z,M+=e*V,m+=e*q,B+=e*X,S+=e*D,K+=e*H,T+=e*J,Y+=e*Q,e=t[12],v+=e*z,b+=e*P,d+=e*O,A+=e*N,_+=e*F,U+=e*I,E+=e*j,x+=e*G,M+=e*Z,m+=e*V,B+=e*q,S+=e*X,K+=e*D,T+=e*H,Y+=e*J,k+=e*Q,e=t[13],b+=e*z,d+=e*P,A+=e*O,_+=e*N,U+=e*F,E+=e*I,x+=e*j,M+=e*G,m+=e*Z,B+=e*V,S+=e*q,K+=e*X,T+=e*D,Y+=e*H,k+=e*J,L+=e*Q,e=t[14],d+=e*z,A+=e*P,_+=e*O,U+=e*N,E+=e*F,x+=e*I,M+=e*j,m+=e*G,B+=e*Z,S+=e*V,K+=e*q,T+=e*X,Y+=e*D,k+=e*H,L+=e*J,C+=e*Q,e=t[15],A+=e*z,_+=e*P,U+=e*O,E+=e*N,x+=e*F,M+=e*I,m+=e*j,B+=e*G,S+=e*Z,K+=e*V,T+=e*q,Y+=e*X,k+=e*D,L+=e*H,C+=e*J,R+=e*Q,i+=38*_,h+=38*U,a+=38*E,f+=38*x,s+=38*M,u+=38*m,c+=38*B,y+=38*S,l+=38*K,w+=38*T,p+=38*Y,g+=38*k,v+=38*L,b+=38*C,d+=38*R,o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),o=1,e=i+o+65535,o=Math.floor(e/65536),i=e-65536*o,e=h+o+65535,o=Math.floor(e/65536),h=e-65536*o,e=a+o+65535,o=Math.floor(e/65536),a=e-65536*o,e=f+o+65535,o=Math.floor(e/65536),f=e-65536*o,e=s+o+65535,o=Math.floor(e/65536),s=e-65536*o,e=u+o+65535,o=Math.floor(e/65536),u=e-65536*o,e=c+o+65535,o=Math.floor(e/65536),c=e-65536*o,e=y+o+65535,o=Math.floor(e/65536),y=e-65536*o,e=l+o+65535,o=Math.floor(e/65536),l=e-65536*o,e=w+o+65535,o=Math.floor(e/65536),w=e-65536*o,e=p+o+65535,o=Math.floor(e/65536),p=e-65536*o,e=g+o+65535,o=Math.floor(e/65536),g=e-65536*o,e=v+o+65535,o=Math.floor(e/65536),v=e-65536*o,e=b+o+65535,o=Math.floor(e/65536),b=e-65536*o,e=d+o+65535,o=Math.floor(e/65536),d=e-65536*o,e=A+o+65535,o=Math.floor(e/65536),A=e-65536*o,i+=o-1+37*(o-1),r[0]=i,r[1]=h,r[2]=a,r[3]=f,r[4]=s,r[5]=u,r[6]=c,r[7]=y,r[8]=l,r[9]=w,r[10]=p,r[11]=g,r[12]=v,r[13]=b,r[14]=d,r[15]=A}function B(r,t){m(r,t,t)}function S(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=253;n>=0;n--)B(e,e),2!==n&&4!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function K(r,t){var n,e=$();for(n=0;16>n;n++)e[n]=t[n];for(n=250;n>=0;n--)B(e,e),1!==n&&m(e,e,t);for(n=0;16>n;n++)r[n]=e[n]}function T(r,t,n){var e,o,i=new Uint8Array(32),h=new Float64Array(80),a=$(),f=$(),s=$(),u=$(),c=$(),y=$();for(o=0;31>o;o++)i[o]=t[o];for(i[31]=127&t[31]|64,i[0]&=248,E(h,n),o=0;16>o;o++)f[o]=h[o],u[o]=a[o]=s[o]=0;for(a[0]=u[0]=1,o=254;o>=0;--o)e=i[o>>>3]>>>(7&o)&1,d(a,f,e),d(s,u,e),x(c,a,s),M(a,a,s),x(s,f,u),M(f,f,u),B(u,c),B(y,a),m(a,s,a),m(s,f,c),x(c,a,s),M(a,a,s),B(f,a),M(s,u,y),m(a,s,ir),x(a,a,u),m(s,s,a),m(a,u,y),m(u,f,h),B(f,c),d(a,f,e),d(s,u,e);for(o=0;16>o;o++)h[o+16]=a[o],h[o+32]=s[o],h[o+48]=f[o],h[o+64]=u[o];var l=h.subarray(32),w=h.subarray(16);return S(l,l),m(w,w,l),A(r,w),0}function Y(r,t){return T(r,t,nr)}function k(r,t){return rr(t,32),Y(r,t)}function L(r,t,n){var e=new Uint8Array(32);return T(e,n,t),f(r,tr,e,cr)}function C(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),lr(r,t,n,e,h)}function R(r,t,n,e,o,i){var h=new Uint8Array(32);return L(h,o,i),wr(r,t,n,e,h)}function z(r,t,n,e){for(var o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U,E,x,M,m,B,S,K,T=new Int32Array(16),Y=new Int32Array(16),k=r[0],L=r[1],C=r[2],R=r[3],z=r[4],P=r[5],O=r[6],N=r[7],F=t[0],I=t[1],j=t[2],G=t[3],Z=t[4],V=t[5],q=t[6],X=t[7],D=0;e>=128;){for(U=0;16>U;U++)E=8*U+D,T[U]=n[E+0]<<24|n[E+1]<<16|n[E+2]<<8|n[E+3],Y[U]=n[E+4]<<24|n[E+5]<<16|n[E+6]<<8|n[E+7];for(U=0;80>U;U++)if(o=k,i=L,h=C,a=R,f=z,s=P,u=O,c=N,y=F,l=I,w=j,p=G,g=Z,v=V,b=q,d=X,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(z>>>14|Z<<18)^(z>>>18|Z<<14)^(Z>>>9|z<<23),M=(Z>>>14|z<<18)^(Z>>>18|z<<14)^(z>>>9|Z<<23),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=z&P^~z&O,M=Z&V^~Z&q,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=pr[2*U],M=pr[2*U+1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=T[U%16],M=Y[U%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,A=65535&S|K<<16,_=65535&m|B<<16,x=A,M=_,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=(k>>>28|F<<4)^(F>>>2|k<<30)^(F>>>7|k<<25),M=(F>>>28|k<<4)^(k>>>2|F<<30)^(k>>>7|F<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,x=k&L^k&C^L&C,M=F&I^F&j^I&j,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,c=65535&S|K<<16,d=65535&m|B<<16,x=a,M=p,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=A,M=_,m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,a=65535&S|K<<16,p=65535&m|B<<16,L=o,C=i,R=h,z=a,P=f,O=s,N=u,k=c,I=y,j=l,G=w,Z=p,V=g,q=v,X=b,F=d,U%16===15)for(E=0;16>E;E++)x=T[E],M=Y[E],m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=T[(E+9)%16],M=Y[(E+9)%16],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+1)%16],_=Y[(E+1)%16],x=(A>>>1|_<<31)^(A>>>8|_<<24)^A>>>7,M=(_>>>1|A<<31)^(_>>>8|A<<24)^(_>>>7|A<<25),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,A=T[(E+14)%16],_=Y[(E+14)%16],x=(A>>>19|_<<13)^(_>>>29|A<<3)^A>>>6,M=(_>>>19|A<<13)^(A>>>29|_<<3)^(_>>>6|A<<26),m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,T[E]=65535&S|K<<16,Y[E]=65535&m|B<<16;x=k,M=F,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[0],M=t[0],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[0]=k=65535&S|K<<16,t[0]=F=65535&m|B<<16,x=L,M=I,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[1],M=t[1],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[1]=L=65535&S|K<<16,t[1]=I=65535&m|B<<16,x=C,M=j,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[2],M=t[2],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[2]=C=65535&S|K<<16,t[2]=j=65535&m|B<<16,x=R,M=G,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[3],M=t[3],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[3]=R=65535&S|K<<16,t[3]=G=65535&m|B<<16,x=z,M=Z,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[4],M=t[4],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[4]=z=65535&S|K<<16,t[4]=Z=65535&m|B<<16,x=P,M=V,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[5],M=t[5],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[5]=P=65535&S|K<<16,t[5]=V=65535&m|B<<16,x=O,M=q,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[6],M=t[6],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[6]=O=65535&S|K<<16,t[6]=q=65535&m|B<<16,x=N,M=X,m=65535&M,B=M>>>16,S=65535&x,K=x>>>16,x=r[7],M=t[7],m+=65535&M,B+=M>>>16,S+=65535&x,K+=x>>>16,B+=m>>>16,S+=B>>>16,K+=S>>>16,r[7]=N=65535&S|K<<16,t[7]=X=65535&m|B<<16,D+=128,e-=128}return e}function P(r,n,e){var o,i=new Int32Array(8),h=new Int32Array(8),a=new Uint8Array(256),f=e;for(i[0]=1779033703,i[1]=3144134277,i[2]=1013904242,i[3]=2773480762,i[4]=1359893119,i[5]=2600822924,i[6]=528734635,i[7]=1541459225,h[0]=4089235720,h[1]=2227873595,h[2]=4271175723,h[3]=1595750129,h[4]=2917565137,h[5]=725511199,h[6]=4215389547,h[7]=327033209,z(i,h,n,e),e%=128,o=0;e>o;o++)a[o]=n[f-e+o];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,t(a,e-8,f/536870912|0,f<<3),z(i,h,a,e),o=0;8>o;o++)t(r,8*o,i[o],h[o]);return 0}function O(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$(),s=$(),u=$();M(n,r[1],r[0]),M(u,t[1],t[0]),m(n,n,u),x(e,r[0],r[1]),x(u,t[0],t[1]),m(e,e,u),m(o,r[3],t[3]),m(o,o,ar),m(i,r[2],t[2]),x(i,i,i),M(h,e,n),M(a,i,o),x(f,i,o),x(s,e,n),m(r[0],h,a),m(r[1],s,f),m(r[2],f,a),m(r[3],h,s)}function N(r,t,n){var e;for(e=0;4>e;e++)d(r[e],t[e],n)}function F(r,t){var n=$(),e=$(),o=$();S(o,t[2]),m(n,t[0],o),m(e,t[1],o),A(r,e),r[31]^=U(n)<<7}function I(r,t,n){var e,o;for(v(r[0],er),v(r[1],or),v(r[2],or),v(r[3],er),o=255;o>=0;--o)e=n[o/8|0]>>(7&o)&1,N(r,t,e),O(t,r),O(r,r),N(r,t,e)}function j(r,t){var n=[$(),$(),$(),$()];v(n[0],fr),v(n[1],sr),v(n[2],or),m(n[3],fr,sr),I(r,n,t)}function G(r,t,n){var e,o=new Uint8Array(64),i=[$(),$(),$(),$()];for(n||rr(t,32),P(o,t,32),o[0]&=248,o[31]&=127,o[31]|=64,j(i,o),F(r,i),e=0;32>e;e++)t[e+32]=r[e];return 0}function Z(r,t){var n,e,o,i;for(e=63;e>=32;--e){for(n=0,o=e-32,i=e-12;i>o;++o)t[o]+=n-16*t[e]*gr[o-(e-32)],n=t[o]+128>>8,t[o]-=256*n;t[o]+=n,t[e]=0}for(n=0,o=0;32>o;o++)t[o]+=n-(t[31]>>4)*gr[o],n=t[o]>>8,t[o]&=255;for(o=0;32>o;o++)t[o]-=n*gr[o];for(e=0;32>e;e++)t[e+1]+=t[e]>>8,r[e]=255&t[e]}function V(r){var t,n=new Float64Array(64);for(t=0;64>t;t++)n[t]=r[t];for(t=0;64>t;t++)r[t]=0;Z(r,n)}function q(r,t,n,e){var o,i,h=new Uint8Array(64),a=new Uint8Array(64),f=new Uint8Array(64),s=new Float64Array(64),u=[$(),$(),$(),$()];P(h,e,32),h[0]&=248,h[31]&=127,h[31]|=64;var c=n+64;for(o=0;n>o;o++)r[64+o]=t[o];for(o=0;32>o;o++)r[32+o]=h[32+o];for(P(f,r.subarray(32),n+32),V(f),j(u,f),F(r,u),o=32;64>o;o++)r[o]=e[o];for(P(a,r,n+64),V(a),o=0;64>o;o++)s[o]=0;for(o=0;32>o;o++)s[o]=f[o];for(o=0;32>o;o++)for(i=0;32>i;i++)s[o+i]+=a[o]*h[i];return Z(r.subarray(32),s),c}function X(r,t){var n=$(),e=$(),o=$(),i=$(),h=$(),a=$(),f=$();return v(r[2],or),E(r[1],t),B(o,r[1]),m(i,o,hr),M(o,o,r[2]),x(i,r[2],i),B(h,i),B(a,h),m(f,a,h),m(n,f,o),m(n,n,i),K(n,n),m(n,n,o),m(n,n,i),m(n,n,i),m(r[0],n,i),B(e,r[0]),m(e,e,i),_(e,o)&&m(r[0],r[0],ur),B(e,r[0]),m(e,e,i),_(e,o)?-1:(U(r[0])===t[31]>>7&&M(r[0],er,r[0]),m(r[3],r[0],r[1]),0)}function D(r,t,n,e){var i,h,a=new Uint8Array(32),f=new Uint8Array(64),s=[$(),$(),$(),$()],u=[$(),$(),$(),$()];if(h=-1,64>n)return-1;if(X(u,e))return-1;for(i=0;n>i;i++)r[i]=t[i];for(i=0;32>i;i++)r[i+32]=e[i];if(P(f,r,n),V(f),I(s,u,f),j(u,t.subarray(32)),O(s,u),F(a,s),n-=64,o(t,0,a,0)){for(i=0;n>i;i++)r[i]=0;return-1}for(i=0;n>i;i++)r[i]=t[i+64];return h=n}function H(r,t){if(r.length!==vr)throw new Error("bad key size");if(t.length!==br)throw new Error("bad nonce size")}function J(r,t){if(r.length!==Er)throw new Error("bad public key size");if(t.length!==xr)throw new Error("bad secret key size")}function Q(){var r,t;for(t=0;t>>13|n<<3),e=255&r[4]|(255&r[5])<<8,this.r[2]=7939&(n>>>10|e<<6),o=255&r[6]|(255&r[7])<<8,this.r[3]=8191&(e>>>7|o<<9),i=255&r[8]|(255&r[9])<<8,this.r[4]=255&(o>>>4|i<<12),this.r[5]=i>>>1&8190,h=255&r[10]|(255&r[11])<<8,this.r[6]=8191&(i>>>14|h<<2),a=255&r[12]|(255&r[13])<<8,this.r[7]=8065&(h>>>11|a<<5),f=255&r[14]|(255&r[15])<<8,this.r[8]=8191&(a>>>8|f<<8),this.r[9]=f>>>5&127,this.pad[0]=255&r[16]|(255&r[17])<<8,this.pad[1]=255&r[18]|(255&r[19])<<8,this.pad[2]=255&r[20]|(255&r[21])<<8,this.pad[3]=255&r[22]|(255&r[23])<<8,this.pad[4]=255&r[24]|(255&r[25])<<8,this.pad[5]=255&r[26]|(255&r[27])<<8,this.pad[6]=255&r[28]|(255&r[29])<<8,this.pad[7]=255&r[30]|(255&r[31])<<8};yr.prototype.blocks=function(r,t,n){for(var e,o,i,h,a,f,s,u,c,y,l,w,p,g,v,b,d,A,_,U=this.fin?0:2048,E=this.h[0],x=this.h[1],M=this.h[2],m=this.h[3],B=this.h[4],S=this.h[5],K=this.h[6],T=this.h[7],Y=this.h[8],k=this.h[9],L=this.r[0],C=this.r[1],R=this.r[2],z=this.r[3],P=this.r[4],O=this.r[5],N=this.r[6],F=this.r[7],I=this.r[8],j=this.r[9];n>=16;)e=255&r[t+0]|(255&r[t+1])<<8,E+=8191&e,o=255&r[t+2]|(255&r[t+3])<<8,x+=8191&(e>>>13|o<<3),i=255&r[t+4]|(255&r[t+5])<<8,M+=8191&(o>>>10|i<<6),h=255&r[t+6]|(255&r[t+7])<<8,m+=8191&(i>>>7|h<<9),a=255&r[t+8]|(255&r[t+9])<<8,B+=8191&(h>>>4|a<<12),S+=a>>>1&8191,f=255&r[t+10]|(255&r[t+11])<<8,K+=8191&(a>>>14|f<<2),s=255&r[t+12]|(255&r[t+13])<<8,T+=8191&(f>>>11|s<<5),u=255&r[t+14]|(255&r[t+15])<<8,Y+=8191&(s>>>8|u<<8),k+=u>>>5|U,c=0,y=c,y+=E*L,y+=5*x*j,y+=5*M*I,y+=5*m*F,y+=5*B*N,c=y>>>13,y&=8191,y+=5*S*O,y+=5*K*P,y+=5*T*z,y+=5*Y*R,y+=5*k*C,c+=y>>>13,y&=8191,l=c,l+=E*C,l+=x*L,l+=5*M*j,l+=5*m*I,l+=5*B*F,c=l>>>13,l&=8191,l+=5*S*N,l+=5*K*O,l+=5*T*P,l+=5*Y*z,l+=5*k*R,c+=l>>>13,l&=8191,w=c,w+=E*R,w+=x*C,w+=M*L,w+=5*m*j,w+=5*B*I,c=w>>>13,w&=8191,w+=5*S*F,w+=5*K*N,w+=5*T*O,w+=5*Y*P,w+=5*k*z,c+=w>>>13,w&=8191,p=c,p+=E*z,p+=x*R,p+=M*C,p+=m*L,p+=5*B*j,c=p>>>13,p&=8191,p+=5*S*I,p+=5*K*F,p+=5*T*N,p+=5*Y*O,p+=5*k*P,c+=p>>>13,p&=8191,g=c,g+=E*P,g+=x*z,g+=M*R,g+=m*C,g+=B*L,c=g>>>13,g&=8191,g+=5*S*j,g+=5*K*I,g+=5*T*F,g+=5*Y*N,g+=5*k*O,c+=g>>>13,g&=8191,v=c,v+=E*O,v+=x*P,v+=M*z,v+=m*R,v+=B*C,c=v>>>13,v&=8191,v+=S*L,v+=5*K*j,v+=5*T*I,v+=5*Y*F,v+=5*k*N,c+=v>>>13,v&=8191,b=c,b+=E*N,b+=x*O,b+=M*P,b+=m*z,b+=B*R,c=b>>>13,b&=8191,b+=S*C,b+=K*L,b+=5*T*j,b+=5*Y*I,b+=5*k*F,c+=b>>>13,b&=8191,d=c,d+=E*F,d+=x*N,d+=M*O,d+=m*P,d+=B*z,c=d>>>13,d&=8191,d+=S*R,d+=K*C,d+=T*L,d+=5*Y*j,d+=5*k*I,c+=d>>>13,d&=8191,A=c,A+=E*I,A+=x*F,A+=M*N,A+=m*O,A+=B*P,c=A>>>13,A&=8191,A+=S*z,A+=K*R,A+=T*C,A+=Y*L,A+=5*k*j,c+=A>>>13,A&=8191,_=c,_+=E*j,_+=x*I,_+=M*F,_+=m*N,_+=B*O,c=_>>>13,_&=8191,_+=S*P,_+=K*z,_+=T*R,_+=Y*C,_+=k*L,c+=_>>>13,_&=8191,c=(c<<2)+c|0,c=c+y|0,y=8191&c,c>>>=13,l+=c,E=y,x=l,M=w,m=p,B=g,S=v,K=b,T=d,Y=A,k=_,t+=16,n-=16;this.h[0]=E,this.h[1]=x,this.h[2]=M,this.h[3]=m,this.h[4]=B,this.h[5]=S,this.h[6]=K,this.h[7]=T,this.h[8]=Y,this.h[9]=k},yr.prototype.finish=function(r,t){var n,e,o,i,h=new Uint16Array(10);if(this.leftover){for(i=this.leftover,this.buffer[i++]=1;16>i;i++)this.buffer[i]=0;this.fin=1,this.blocks(this.buffer,0,16)}for(n=this.h[1]>>>13,this.h[1]&=8191,i=2;10>i;i++)this.h[i]+=n,n=this.h[i]>>>13,this.h[i]&=8191;for(this.h[0]+=5*n,n=this.h[0]>>>13,this.h[0]&=8191,this.h[1]+=n,n=this.h[1]>>>13,this.h[1]&=8191,this.h[2]+=n,h[0]=this.h[0]+5,n=h[0]>>>13,h[0]&=8191,i=1;10>i;i++)h[i]=this.h[i]+n,n=h[i]>>>13,h[i]&=8191;for(h[9]-=8192,e=(h[9]>>>15)-1,i=0;10>i;i++)h[i]&=e;for(e=~e,i=0;10>i;i++)this.h[i]=this.h[i]&e|h[i];for(this.h[0]=65535&(this.h[0]|this.h[1]<<13),this.h[1]=65535&(this.h[1]>>>3|this.h[2]<<10),this.h[2]=65535&(this.h[2]>>>6|this.h[3]<<7),this.h[3]=65535&(this.h[3]>>>9|this.h[4]<<4),this.h[4]=65535&(this.h[4]>>>12|this.h[5]<<1|this.h[6]<<14),this.h[5]=65535&(this.h[6]>>>2|this.h[7]<<11),this.h[6]=65535&(this.h[7]>>>5|this.h[8]<<8),this.h[7]=65535&(this.h[8]>>>8|this.h[9]<<5),o=this.h[0]+this.pad[0],this.h[0]=65535&o,i=1;8>i;i++)o=(this.h[i]+this.pad[i]|0)+(o>>>16)|0,this.h[i]=65535&o;r[t+0]=this.h[0]>>>0&255,r[t+1]=this.h[0]>>>8&255,r[t+2]=this.h[1]>>>0&255,r[t+3]=this.h[1]>>>8&255,r[t+4]=this.h[2]>>>0&255,r[t+5]=this.h[2]>>>8&255,r[t+6]=this.h[3]>>>0&255,r[t+7]=this.h[3]>>>8&255,r[t+8]=this.h[4]>>>0&255,r[t+9]=this.h[4]>>>8&255,r[t+10]=this.h[5]>>>0&255,r[t+11]=this.h[5]>>>8&255,r[t+12]=this.h[6]>>>0&255,r[t+13]=this.h[6]>>>8&255,r[t+14]=this.h[7]>>>0&255,r[t+15]=this.h[7]>>>8&255},yr.prototype.update=function(r,t,n){var e,o;if(this.leftover){for(o=16-this.leftover,o>n&&(o=n),e=0;o>e;e++)this.buffer[this.leftover+e]=r[t+e];if(n-=o,t+=o,this.leftover+=o,this.leftover<16)return;this.blocks(this.buffer,0,16),this.leftover=0}if(n>=16&&(o=n-n%16,this.blocks(r,t,o),t+=o,n-=o),n){for(e=0;n>e;e++)this.buffer[this.leftover+e]=r[t+e];this.leftover+=n}};var lr=p,wr=g,pr=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],gr=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]),vr=32,br=24,dr=32,Ar=16,_r=32,Ur=32,Er=32,xr=32,Mr=32,mr=br,Br=dr,Sr=Ar,Kr=64,Tr=32,Yr=64,kr=32,Lr=64;r.lowlevel={crypto_core_hsalsa20:f,crypto_stream_xor:y,crypto_stream:c,crypto_stream_salsa20_xor:s,crypto_stream_salsa20:u,crypto_onetimeauth:l,crypto_onetimeauth_verify:w,crypto_verify_16:e,crypto_verify_32:o,crypto_secretbox:p,crypto_secretbox_open:g,crypto_scalarmult:T,crypto_scalarmult_base:Y,crypto_box_beforenm:L,crypto_box_afternm:lr,crypto_box:C,crypto_box_open:R,crypto_box_keypair:k,crypto_hash:P,crypto_sign:q,crypto_sign_keypair:G,crypto_sign_open:D,crypto_secretbox_KEYBYTES:vr,crypto_secretbox_NONCEBYTES:br,crypto_secretbox_ZEROBYTES:dr,crypto_secretbox_BOXZEROBYTES:Ar,crypto_scalarmult_BYTES:_r,crypto_scalarmult_SCALARBYTES:Ur,crypto_box_PUBLICKEYBYTES:Er,crypto_box_SECRETKEYBYTES:xr,crypto_box_BEFORENMBYTES:Mr,crypto_box_NONCEBYTES:mr,crypto_box_ZEROBYTES:Br,crypto_box_BOXZEROBYTES:Sr,crypto_sign_BYTES:Kr,crypto_sign_PUBLICKEYBYTES:Tr,crypto_sign_SECRETKEYBYTES:Yr,crypto_sign_SEEDBYTES:kr,crypto_hash_BYTES:Lr},r.util={},r.util.decodeUTF8=function(r){var t,n=unescape(encodeURIComponent(r)),e=new Uint8Array(n.length);for(t=0;tt;t++)n.push(String.fromCharCode(r[t]));return btoa(n.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var t,n=atob(r),e=new Uint8Array(n.length);for(t=0;te)return null;for(var o=new Uint8Array(e),i=0;ie;e++)o[e]=t[e];for(e=0;e=0},r.sign.keyPair=function(){var r=new Uint8Array(Tr),t=new Uint8Array(Yr);return G(r,t),{publicKey:r,secretKey:t}},r.sign.keyPair.fromSecretKey=function(r){if(Q(r),r.length!==Yr)throw new Error("bad secret key size");for(var t=new Uint8Array(Tr),n=0;ne;e++)n[e]=r[e];return G(t,n,!0),{publicKey:t,secretKey:n}},r.sign.publicKeyLength=Tr,r.sign.secretKeyLength=Yr,r.sign.seedLength=kr,r.sign.signatureLength=Kr,r.hash=function(r){Q(r);var t=new Uint8Array(Lr);return P(t,r,r.length),t},r.hash.hashLength=Lr,r.verify=function(r,t){return Q(r,t),0===r.length||0===t.length?!1:r.length!==t.length?!1:0===n(r,0,t,0,r.length)?!0:!1},r.setPRNG=function(r){rr=r},function(){var t;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?t=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(t=window.msCrypto),t&&r.setPRNG(function(r,n){var e,o=new Uint8Array(n);for(t.getRandomValues(o),e=0;n>e;e++)r[e]=o[e];W(o)})):"undefined"!=typeof require&&(t=require("crypto"),t&&r.setPRNG(function(r,n){var e,o=t.randomBytes(n);for(e=0;n>e;e++)r[e]=o[e];W(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js index f72dd78d12550f..b8edbbee692cdf 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.js @@ -944,13 +944,39 @@ function cleanup(arr) { for (var i = 0; i < arr.length; i++) arr[i] = 0; } -// TODO: Completely remove this in v0.15. -if (!nacl.util) { - nacl.util = {}; - nacl.util.decodeUTF8 = nacl.util.encodeUTF8 = nacl.util.encodeBase64 = nacl.util.decodeBase64 = function() { - throw new Error('nacl.util moved into separate package: https://github.com/dchest/tweetnacl-util-js'); - }; -} +nacl.util = {}; + +nacl.util.decodeUTF8 = function(s) { + var i, d = unescape(encodeURIComponent(s)), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; +}; + +nacl.util.encodeUTF8 = function(arr) { + var i, s = []; + for (i = 0; i < arr.length; i++) s.push(String.fromCharCode(arr[i])); + return decodeURIComponent(escape(s.join(''))); +}; + +nacl.util.encodeBase64 = function(arr) { + if (typeof btoa === 'undefined') { + return (new Buffer(arr)).toString('base64'); + } else { + var i, s = [], len = arr.length; + for (i = 0; i < len; i++) s.push(String.fromCharCode(arr[i])); + return btoa(s.join('')); + } +}; + +nacl.util.decodeBase64 = function(s) { + if (typeof atob === 'undefined') { + return new Uint8Array(Array.prototype.slice.call(new Buffer(s, 'base64'), 0)); + } else { + var i, d = atob(s), b = new Uint8Array(d.length); + for (i = 0; i < d.length; i++) b[i] = d.charCodeAt(i); + return b; + } +}; nacl.randomBytes = function(n) { var b = new Uint8Array(n); @@ -1147,22 +1173,26 @@ nacl.setPRNG = function(fn) { (function() { // Initialize PRNG if environment provides CSPRNG. // If not, methods calling randombytes will throw. - var crypto = typeof self !== 'undefined' ? (self.crypto || self.msCrypto) : null; - if (crypto && crypto.getRandomValues) { - // Browsers. - var QUOTA = 65536; - nacl.setPRNG(function(x, n) { - var i, v = new Uint8Array(n); - for (i = 0; i < n; i += QUOTA) { - crypto.getRandomValues(v.subarray(i, i + Math.min(n - i, QUOTA))); - } - for (i = 0; i < n; i++) x[i] = v[i]; - cleanup(v); - }); + var crypto; + if (typeof window !== 'undefined') { + // Browser. + if (window.crypto && window.crypto.getRandomValues) { + crypto = window.crypto; // Standard + } else if (window.msCrypto && window.msCrypto.getRandomValues) { + crypto = window.msCrypto; // Internet Explorer 11+ + } + if (crypto) { + nacl.setPRNG(function(x, n) { + var i, v = new Uint8Array(n); + crypto.getRandomValues(v); + for (i = 0; i < n; i++) x[i] = v[i]; + cleanup(v); + }); + } } else if (typeof require !== 'undefined') { // Node.js. crypto = require('crypto'); - if (crypto && crypto.randomBytes) { + if (crypto) { nacl.setPRNG(function(x, n) { var i, v = crypto.randomBytes(n); for (i = 0; i < n; i++) x[i] = v[i]; @@ -1172,4 +1202,4 @@ nacl.setPRNG = function(fn) { } })(); -})(typeof module !== 'undefined' && module.exports ? module.exports : (self.nacl = self.nacl || {})); +})(typeof module !== 'undefined' && module.exports ? module.exports : (window.nacl = window.nacl || {})); diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js index eed3854153ec05..95d869502e4b0d 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/nacl.min.js @@ -1 +1 @@ -!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function v(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function b(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,v(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(v(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,v(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function p(r,n,e,t,o,i){var a=new Uint8Array(16);return b(a,0,e,t,o,i),f(r,n,a,0)}function _(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),b(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function A(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==p(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function U(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function E(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function d(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(E(a),E(a),E(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,d(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];E(r),E(r)}function L(r,n){Y(r,n,n)}function k(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function z(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,d(f,u,t),d(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ar),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),d(f,u,t),d(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return k(l,l),Y(h,h,l),x(r,h),0}function P(r,n){return R(r,n,br)}function O(r,n){return gr(n,32),P(r,n)}function F(r,n,e){var t=new Uint8Array(32);return R(t,e,n),y(r,vr,t,Br)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Kr(r,n,e,t,a)}function C(r,n,e,t,o,i){var a=new Uint8Array(32);return F(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function G(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function Z(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),q(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,V(w[0]),I(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,Er),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)d(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();k(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(U(r[0],pr),U(r[1],_r),U(r[2],_r),U(r[3],pr),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];U(e[0],dr),U(e[1],xr),U(e[2],_r),Y(e[3],dr,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*kr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*kr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*kr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return U(r[2],_r),S(r[1],n),L(o,r[1]),Y(i,o,Ur),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),z(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],pr,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==zr)throw new Error("bad key size");if(n.length!==Rr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Cr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(Vr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(Vr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=Vr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Ir,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n="undefined"!=typeof self?self.crypto||self.msCrypto:null;if(n&&n.getRandomValues){var e=65536;r.setPRNG(function(r,t){var o,i=new Uint8Array(t);for(o=0;t>o;o+=e)n.getRandomValues(i.subarray(o,o+Math.min(t-o,e)));for(o=0;t>o;o++)r[o]=i[o];sr(i)})}else"undefined"!=typeof require&&(n=require("crypto"),n&&n.randomBytes&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:self.nacl=self.nacl||{}); \ No newline at end of file +!function(r){"use strict";function n(r,n){return r<>>32-n}function e(r,n){var e=255&r[n+3];return e=e<<8|255&r[n+2],e=e<<8|255&r[n+1],e<<8|255&r[n+0]}function t(r,n){var e=r[n]<<24|r[n+1]<<16|r[n+2]<<8|r[n+3],t=r[n+4]<<24|r[n+5]<<16|r[n+6]<<8|r[n+7];return new lr(e,t)}function o(r,n,e){var t;for(t=0;4>t;t++)r[n+t]=255&e,e>>>=8}function i(r,n,e){r[n]=e.hi>>24&255,r[n+1]=e.hi>>16&255,r[n+2]=e.hi>>8&255,r[n+3]=255&e.hi,r[n+4]=e.lo>>24&255,r[n+5]=e.lo>>16&255,r[n+6]=e.lo>>8&255,r[n+7]=255&e.lo}function a(r,n,e,t,o){var i,a=0;for(i=0;o>i;i++)a|=r[n+i]^e[t+i];return(1&a-1>>>8)-1}function f(r,n,e,t){return a(r,n,e,t,16)}function u(r,n,e,t){return a(r,n,e,t,32)}function c(r,t,i,a,f){var u,c,w,y=new Uint32Array(16),s=new Uint32Array(16),l=new Uint32Array(16),h=new Uint32Array(4);for(u=0;4>u;u++)s[5*u]=e(a,4*u),s[1+u]=e(i,4*u),s[6+u]=e(t,4*u),s[11+u]=e(i,16+4*u);for(u=0;16>u;u++)l[u]=s[u];for(u=0;20>u;u++){for(c=0;4>c;c++){for(w=0;4>w;w++)h[w]=s[(5*c+4*w)%16];for(h[1]^=n(h[0]+h[3]|0,7),h[2]^=n(h[1]+h[0]|0,9),h[3]^=n(h[2]+h[1]|0,13),h[0]^=n(h[3]+h[2]|0,18),w=0;4>w;w++)y[4*c+(c+w)%4]=h[w]}for(w=0;16>w;w++)s[w]=y[w]}if(f){for(u=0;16>u;u++)s[u]=s[u]+l[u]|0;for(u=0;4>u;u++)s[5*u]=s[5*u]-e(a,4*u)|0,s[6+u]=s[6+u]-e(t,4*u)|0;for(u=0;4>u;u++)o(r,4*u,s[5*u]),o(r,16+4*u,s[6+u])}else for(u=0;16>u;u++)o(r,4*u,s[u]+l[u]|0)}function w(r,n,e,t){return c(r,n,e,t,!1),0}function y(r,n,e,t){return c(r,n,e,t,!0),0}function s(r,n,e,t,o,i,a){var f,u,c=new Uint8Array(16),y=new Uint8Array(64);if(!o)return 0;for(u=0;16>u;u++)c[u]=0;for(u=0;8>u;u++)c[u]=i[u];for(;o>=64;){for(w(y,c,a,Br),u=0;64>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];for(f=1,u=8;16>u;u++)f=f+(255&c[u])|0,c[u]=255&f,f>>>=8;o-=64,n+=64,e&&(t+=64)}if(o>0)for(w(y,c,a,Br),u=0;o>u;u++)r[n+u]=(e?e[t+u]:0)^y[u];return 0}function l(r,n,e,t,o){return s(r,n,null,0,e,t,o)}function h(r,n,e,t,o){var i=new Uint8Array(32);return y(i,t,o,Br),l(r,n,e,t.subarray(16),i)}function g(r,n,e,t,o,i,a){var f=new Uint8Array(32);return y(f,i,a,Br),s(r,n,e,t,o,i.subarray(16),f)}function p(r,n){var e,t=0;for(e=0;17>e;e++)t=t+(r[e]+n[e]|0)|0,r[e]=255&t,t>>>=8}function v(r,n,e,t,o,i){var a,f,u,c,w=new Uint32Array(17),y=new Uint32Array(17),s=new Uint32Array(17),l=new Uint32Array(17),h=new Uint32Array(17);for(u=0;17>u;u++)y[u]=s[u]=0;for(u=0;16>u;u++)y[u]=i[u];for(y[3]&=15,y[4]&=252,y[7]&=15,y[8]&=252,y[11]&=15,y[12]&=252,y[15]&=15;o>0;){for(u=0;17>u;u++)l[u]=0;for(u=0;16>u&&o>u;++u)l[u]=e[t+u];for(l[u]=1,t+=u,o-=u,p(s,l),f=0;17>f;f++)for(w[f]=0,u=0;17>u;u++)w[f]=w[f]+s[u]*(f>=u?y[f-u]:320*y[f+17-u]|0)|0|0;for(f=0;17>f;f++)s[f]=w[f];for(c=0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;for(c=c+s[16]|0,s[16]=3&c,c=5*(c>>>2)|0,u=0;16>u;u++)c=c+s[u]|0,s[u]=255&c,c>>>=8;c=c+s[16]|0,s[16]=c}for(u=0;17>u;u++)h[u]=s[u];for(p(s,Sr),a=0|-(s[16]>>>7),u=0;17>u;u++)s[u]^=a&(h[u]^s[u]);for(u=0;16>u;u++)l[u]=i[u+16];for(l[16]=0,p(s,l),u=0;16>u;u++)r[n+u]=s[u];return 0}function b(r,n,e,t,o,i){var a=new Uint8Array(16);return v(a,0,e,t,o,i),f(r,n,a,0)}function A(r,n,e,t,o){var i;if(32>e)return-1;for(g(r,0,n,0,e,t,o),v(r,16,r,32,e-32,r),i=0;16>i;i++)r[i]=0;return 0}function U(r,n,e,t,o){var i,a=new Uint8Array(32);if(32>e)return-1;if(h(a,0,32,t,o),0!==b(n,16,n,32,e-32,a))return-1;for(g(r,0,n,0,e,t,o),i=0;32>i;i++)r[i]=0;return 0}function _(r,n){var e;for(e=0;16>e;e++)r[e]=0|n[e]}function d(r){var n,e;for(e=0;16>e;e++)r[e]+=65536,n=Math.floor(r[e]/65536),r[(e+1)*(15>e?1:0)]+=n-1+37*(n-1)*(15===e?1:0),r[e]-=65536*n}function E(r,n,e){for(var t,o=~(e-1),i=0;16>i;i++)t=o&(r[i]^n[i]),r[i]^=t,n[i]^=t}function x(r,n){var e,t,o,i=hr(),a=hr();for(e=0;16>e;e++)a[e]=n[e];for(d(a),d(a),d(a),t=0;2>t;t++){for(i[0]=a[0]-65517,e=1;15>e;e++)i[e]=a[e]-65535-(i[e-1]>>16&1),i[e-1]&=65535;i[15]=a[15]-32767-(i[14]>>16&1),o=i[15]>>16&1,i[14]&=65535,E(a,i,1-o)}for(e=0;16>e;e++)r[2*e]=255&a[e],r[2*e+1]=a[e]>>8}function m(r,n){var e=new Uint8Array(32),t=new Uint8Array(32);return x(e,r),x(t,n),u(e,0,t,0)}function B(r){var n=new Uint8Array(32);return x(n,r),1&n[0]}function S(r,n){var e;for(e=0;16>e;e++)r[e]=n[2*e]+(n[2*e+1]<<8);r[15]&=32767}function K(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]+e[t]|0}function T(r,n,e){var t;for(t=0;16>t;t++)r[t]=n[t]-e[t]|0}function Y(r,n,e){var t,o,i=new Float64Array(31);for(t=0;31>t;t++)i[t]=0;for(t=0;16>t;t++)for(o=0;16>o;o++)i[t+o]+=n[t]*e[o];for(t=0;15>t;t++)i[t]+=38*i[t+16];for(t=0;16>t;t++)r[t]=i[t];d(r),d(r)}function L(r,n){Y(r,n,n)}function C(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=253;e>=0;e--)L(t,t),2!==e&&4!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function R(r,n){var e,t=hr();for(e=0;16>e;e++)t[e]=n[e];for(e=250;e>=0;e--)L(t,t),1!==e&&Y(t,t,n);for(e=0;16>e;e++)r[e]=t[e]}function k(r,n,e){var t,o,i=new Uint8Array(32),a=new Float64Array(80),f=hr(),u=hr(),c=hr(),w=hr(),y=hr(),s=hr();for(o=0;31>o;o++)i[o]=n[o];for(i[31]=127&n[31]|64,i[0]&=248,S(a,e),o=0;16>o;o++)u[o]=a[o],w[o]=f[o]=c[o]=0;for(f[0]=w[0]=1,o=254;o>=0;--o)t=i[o>>>3]>>>(7&o)&1,E(f,u,t),E(c,w,t),K(y,f,c),T(f,f,c),K(c,u,w),T(u,u,w),L(w,y),L(s,f),Y(f,c,f),Y(c,u,y),K(y,f,c),T(f,f,c),L(u,f),T(c,w,s),Y(f,c,Ur),K(f,f,w),Y(c,c,f),Y(f,w,s),Y(w,u,a),L(u,y),E(f,u,t),E(c,w,t);for(o=0;16>o;o++)a[o+16]=f[o],a[o+32]=c[o],a[o+48]=u[o],a[o+64]=w[o];var l=a.subarray(32),h=a.subarray(16);return C(l,l),Y(h,h,l),x(r,h),0}function z(r,n){return k(r,n,vr)}function P(r,n){return gr(n,32),z(r,n)}function O(r,n,e){var t=new Uint8Array(32);return k(t,e,n),y(r,pr,t,Br)}function F(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Kr(r,n,e,t,a)}function N(r,n,e,t,o,i){var a=new Uint8Array(32);return O(a,o,i),Tr(r,n,e,t,a)}function M(){var r,n,e,t=0,o=0,i=0,a=0,f=65535;for(e=0;e>>16,i+=n&f,a+=n>>>16;return o+=t>>>16,i+=o>>>16,a+=i>>>16,new lr(i&f|a<<16,t&f|o<<16)}function j(r,n){return new lr(r.hi>>>n,r.lo>>>n|r.hi<<32-n)}function G(){var r,n=0,e=0;for(r=0;rn?(e=r.hi>>>n|r.lo<>>n|r.hi<n&&(e=r.lo>>>n|r.hi<>>n|r.lo<a;a++)u[a]=w[a]=t(r,8*a);for(var s=0;e>=128;){for(a=0;16>a;a++)y[a]=t(n,8*a+s);for(a=0;80>a;a++){for(f=0;8>f;f++)c[f]=w[f];for(o=M(w[7],X(w[4]),Z(w[4],w[5],w[6]),Yr[a],y[a%16]),c[7]=M(o,q(w[0]),V(w[0],w[1],w[2])),c[3]=M(c[3],o),f=0;8>f;f++)w[(f+1)%8]=c[f];if(a%16===15)for(f=0;16>f;f++)y[f]=M(y[f],y[(f+9)%16],D(y[(f+1)%16]),H(y[(f+14)%16]))}for(a=0;8>a;a++)w[a]=M(w[a],u[a]),u[a]=w[a];s+=128,e-=128}for(a=0;8>a;a++)i(r,8*a,u[a]);return e}function Q(r,n,e){var t,o=new Uint8Array(64),a=new Uint8Array(256),f=e;for(t=0;64>t;t++)o[t]=Lr[t];for(J(o,n,e),e%=128,t=0;256>t;t++)a[t]=0;for(t=0;e>t;t++)a[t]=n[f-e+t];for(a[e]=128,e=256-128*(112>e?1:0),a[e-9]=0,i(a,e-8,new lr(f/536870912|0,f<<3)),J(o,a,e),t=0;64>t;t++)r[t]=o[t];return 0}function W(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr(),c=hr(),w=hr();T(e,r[1],r[0]),T(w,n[1],n[0]),Y(e,e,w),K(t,r[0],r[1]),K(w,n[0],n[1]),Y(t,t,w),Y(o,r[3],n[3]),Y(o,o,dr),Y(i,r[2],n[2]),K(i,i,i),T(a,t,e),T(f,i,o),K(u,i,o),K(c,t,e),Y(r[0],a,f),Y(r[1],c,u),Y(r[2],u,f),Y(r[3],a,c)}function $(r,n,e){var t;for(t=0;4>t;t++)E(r[t],n[t],e)}function rr(r,n){var e=hr(),t=hr(),o=hr();C(o,n[2]),Y(e,n[0],o),Y(t,n[1],o),x(r,t),r[31]^=B(e)<<7}function nr(r,n,e){var t,o;for(_(r[0],br),_(r[1],Ar),_(r[2],Ar),_(r[3],br),o=255;o>=0;--o)t=e[o/8|0]>>(7&o)&1,$(r,n,t),W(n,r),W(r,r),$(r,n,t)}function er(r,n){var e=[hr(),hr(),hr(),hr()];_(e[0],Er),_(e[1],xr),_(e[2],Ar),Y(e[3],Er,xr),nr(r,e,n)}function tr(r,n,e){var t,o=new Uint8Array(64),i=[hr(),hr(),hr(),hr()];for(e||gr(n,32),Q(o,n,32),o[0]&=248,o[31]&=127,o[31]|=64,er(i,o),rr(r,i),t=0;32>t;t++)n[t+32]=r[t];return 0}function or(r,n){var e,t,o,i;for(t=63;t>=32;--t){for(e=0,o=t-32,i=t-12;i>o;++o)n[o]+=e-16*n[t]*Cr[o-(t-32)],e=n[o]+128>>8,n[o]-=256*e;n[o]+=e,n[t]=0}for(e=0,o=0;32>o;o++)n[o]+=e-(n[31]>>4)*Cr[o],e=n[o]>>8,n[o]&=255;for(o=0;32>o;o++)n[o]-=e*Cr[o];for(t=0;32>t;t++)n[t+1]+=n[t]>>8,r[t]=255&n[t]}function ir(r){var n,e=new Float64Array(64);for(n=0;64>n;n++)e[n]=r[n];for(n=0;64>n;n++)r[n]=0;or(r,e)}function ar(r,n,e,t){var o,i,a=new Uint8Array(64),f=new Uint8Array(64),u=new Uint8Array(64),c=new Float64Array(64),w=[hr(),hr(),hr(),hr()];Q(a,t,32),a[0]&=248,a[31]&=127,a[31]|=64;var y=e+64;for(o=0;e>o;o++)r[64+o]=n[o];for(o=0;32>o;o++)r[32+o]=a[32+o];for(Q(u,r.subarray(32),e+32),ir(u),er(w,u),rr(r,w),o=32;64>o;o++)r[o]=t[o];for(Q(f,r,e+64),ir(f),o=0;64>o;o++)c[o]=0;for(o=0;32>o;o++)c[o]=u[o];for(o=0;32>o;o++)for(i=0;32>i;i++)c[o+i]+=f[o]*a[i];return or(r.subarray(32),c),y}function fr(r,n){var e=hr(),t=hr(),o=hr(),i=hr(),a=hr(),f=hr(),u=hr();return _(r[2],Ar),S(r[1],n),L(o,r[1]),Y(i,o,_r),T(o,o,r[2]),K(i,r[2],i),L(a,i),L(f,a),Y(u,f,a),Y(e,u,o),Y(e,e,i),R(e,e),Y(e,e,o),Y(e,e,i),Y(e,e,i),Y(r[0],e,i),L(t,r[0]),Y(t,t,i),m(t,o)&&Y(r[0],r[0],mr),L(t,r[0]),Y(t,t,i),m(t,o)?-1:(B(r[0])===n[31]>>7&&T(r[0],br,r[0]),Y(r[3],r[0],r[1]),0)}function ur(r,n,e,t){var o,i,a=new Uint8Array(32),f=new Uint8Array(64),c=[hr(),hr(),hr(),hr()],w=[hr(),hr(),hr(),hr()];if(i=-1,64>e)return-1;if(fr(w,t))return-1;for(o=0;e>o;o++)r[o]=n[o];for(o=0;32>o;o++)r[o+32]=t[o];if(Q(f,r,e),ir(f),nr(c,w,f),er(w,n.subarray(32)),W(c,w),rr(a,c),e-=64,u(n,0,a,0)){for(o=0;e>o;o++)r[o]=0;return-1}for(o=0;e>o;o++)r[o]=n[o+64];return i=e}function cr(r,n){if(r.length!==Rr)throw new Error("bad key size");if(n.length!==kr)throw new Error("bad nonce size")}function wr(r,n){if(r.length!==Nr)throw new Error("bad public key size");if(n.length!==Mr)throw new Error("bad secret key size")}function yr(){var r,n;for(n=0;nn;n++)e.push(String.fromCharCode(r[n]));return btoa(e.join(""))},r.util.decodeBase64=function(r){if("undefined"==typeof atob)return new Uint8Array(Array.prototype.slice.call(new Buffer(r,"base64"),0));var n,e=atob(r),t=new Uint8Array(e.length);for(n=0;nt)return null;for(var o=new Uint8Array(t),i=0;it;t++)o[t]=n[t];for(t=0;t=0},r.sign.keyPair=function(){var r=new Uint8Array(qr),n=new Uint8Array(Xr);return tr(r,n),{publicKey:r,secretKey:n}},r.sign.keyPair.fromSecretKey=function(r){if(yr(r),r.length!==Xr)throw new Error("bad secret key size");for(var n=new Uint8Array(qr),e=0;et;t++)e[t]=r[t];return tr(n,e,!0),{publicKey:n,secretKey:e}},r.sign.publicKeyLength=qr,r.sign.secretKeyLength=Xr,r.sign.seedLength=Dr,r.sign.signatureLength=Vr,r.hash=function(r){yr(r);var n=new Uint8Array(Hr);return Q(n,r,r.length),n},r.hash.hashLength=Hr,r.verify=function(r,n){return yr(r,n),0===r.length||0===n.length?!1:r.length!==n.length?!1:0===a(r,0,n,0,r.length)?!0:!1},r.setPRNG=function(r){gr=r},function(){var n;"undefined"!=typeof window?(window.crypto&&window.crypto.getRandomValues?n=window.crypto:window.msCrypto&&window.msCrypto.getRandomValues&&(n=window.msCrypto),n&&r.setPRNG(function(r,e){var t,o=new Uint8Array(e);for(n.getRandomValues(o),t=0;e>t;t++)r[t]=o[t];sr(o)})):"undefined"!=typeof require&&(n=require("crypto"),n&&r.setPRNG(function(r,e){var t,o=n.randomBytes(e);for(t=0;e>t;t++)r[t]=o[t];sr(o)}))}()}("undefined"!=typeof module&&module.exports?module.exports:window.nacl=window.nacl||{}); \ No newline at end of file diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json index 0903b54ccfb82f..147ea92c406fa1 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json @@ -1,41 +1,46 @@ { "_args": [ [ - "tweetnacl@>=0.13.0 <1.0.0", + { + "raw": "tweetnacl@~0.13.0", + "scope": null, + "escapedName": "tweetnacl", + "name": "tweetnacl", + "rawSpec": "~0.13.0", + "spec": ">=0.13.0 <0.14.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk" ] ], - "_from": "tweetnacl@>=0.13.0 <1.0.0", - "_id": "tweetnacl@0.14.3", + "_from": "tweetnacl@>=0.13.0 <0.14.0", + "_id": "tweetnacl@0.13.3", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk/tweetnacl", - "_nodeVersion": "5.6.0", - "_npmOperationalInternal": { - "host": "packages-16-east.internal.npmjs.com", - "tmp": "tmp/tweetnacl-0.14.3.tgz_1459224951636_0.7403244483284652" - }, + "_nodeVersion": "4.2.3", "_npmUser": { - "email": "dmitry@codingrobots.com", - "name": "dchest" + "name": "dchest", + "email": "dmitry@codingrobots.com" }, - "_npmVersion": "3.7.3", + "_npmVersion": "2.14.7", "_phantomChildren": {}, "_requested": { - "name": "tweetnacl", - "raw": "tweetnacl@>=0.13.0 <1.0.0", - "rawSpec": ">=0.13.0 <1.0.0", + "raw": "tweetnacl@~0.13.0", "scope": null, - "spec": ">=0.13.0 <1.0.0", + "escapedName": "tweetnacl", + "name": "tweetnacl", + "rawSpec": "~0.13.0", + "spec": ">=0.13.0 <0.14.0", "type": "range" }, "_requiredBy": [ "/request/http-signature/sshpk" ], - "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz", - "_shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d", + "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz", + "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", "_shrinkwrap": null, - "_spec": "tweetnacl@>=0.13.0 <1.0.0", + "_spec": "tweetnacl@~0.13.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk", "author": { "name": "TweetNaCl-js contributors" @@ -50,24 +55,23 @@ "dependencies": {}, "description": "Port of TweetNaCl cryptographic library to JavaScript", "devDependencies": { - "browserify": "^13.0.0", - "eslint": "^2.2.0", - "faucet": "^0.0.1", + "browserify": "^10.1.3", + "eslint": "^1.4.3", + "faucet": "0.0.1", "tap-browser-color": "^0.1.2", - "tape": "^4.4.0", - "tape-run": "^2.1.3", - "tweetnacl-util": "^0.13.3", - "uglify-js": "^2.6.1" + "tape": "^4.0.0", + "testling": "^1.7.1", + "uglify-js": "^2.4.21" }, "directories": { "test": "test" }, "dist": { - "shasum": "3da382f670f25ded78d7b3d1792119bca0b7132d", - "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.3.tgz" + "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56", + "tarball": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz" }, - "gitHead": "3eb4fc544a2a1d6c0a41b98b9906288ca8b087e4", - "homepage": "https://tweetnacl.js.org", + "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068", + "homepage": "https://dchest.github.io/tweetnacl-js", "keywords": [ "crypto", "cryptography", @@ -82,12 +86,12 @@ "salsa20", "signatures" ], - "license": "SEE LICENSE IN COPYING.txt", + "license": "Public domain", "main": "nacl-fast.js", "maintainers": [ { - "email": "dmitry@codingrobots.com", - "name": "dchest" + "name": "dchest", + "email": "dmitry@codingrobots.com" } ], "name": "tweetnacl", @@ -99,13 +103,27 @@ }, "scripts": { "bench": "node test/benchmark/bench.js", + "browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null", + "browser-quick": "browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", "build": "uglifyjs nacl.js -c -m -o nacl.min.js && uglifyjs nacl-fast.js -c -m -o nacl-fast.min.js", - "build-test-browser": "browserify test/browser/init.js test/*.js | uglifyjs -c -m -o test/browser/_bundle.js 2>/dev/null && browserify test/browser/init.js test/*.quick.js | uglifyjs -c -m -o test/browser/_bundle-quick.js 2>/dev/null", + "chrome": "browserify test/browser/testling_init.js test/*.js | testling -x google-chrome | faucet", + "firefox": "browserify test/browser/testling_init.js test/*.js | testling -x firefox | faucet", "lint": "eslint nacl.js nacl-fast.js test/*.js test/benchmark/*.js", - "test": "npm run test-node-all && npm run test-browser", - "test-browser": "NACL_SRC=${NACL_SRC:='nacl.min.js'} && npm run build-test-browser && cat $NACL_SRC test/browser/_bundle.js | tape-run | faucet", - "test-node": "tape test/*.js | faucet", - "test-node-all": "make -C test/c && tape test/*.js test/c/*.js | faucet" + "test": "tape test/*.js | faucet", + "testall": "make -C test/c && tape test/*.js test/c/*.js | faucet", + "testling": "browserify test/browser/testling_init.js test/*.js | testling | faucet" + }, + "testling": { + "files": "test/*.js", + "browsers": [ + "chrome/22..latest", + "firefox/16..latest", + "safari/latest", + "opera/11.0..latest", + "iphone/6..latest", + "ipad/6..latest", + "android-browser/latest" + ] }, - "version": "0.14.3" + "version": "0.13.3" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json index fc995b42cd3b5e..27d297637ebc2f 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json @@ -1,39 +1,48 @@ { "_args": [ [ - "sshpk@^1.7.0", + { + "raw": "sshpk@^1.7.0", + "scope": null, + "escapedName": "sshpk", + "name": "sshpk", + "rawSpec": "^1.7.0", + "spec": ">=1.7.0 <2.0.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature" ] ], "_from": "sshpk@>=1.7.0 <2.0.0", - "_id": "sshpk@1.7.4", + "_id": "sshpk@1.9.2", "_inCache": true, "_installable": true, "_location": "/request/http-signature/sshpk", - "_nodeVersion": "0.12.9", + "_nodeVersion": "0.12.15", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/sshpk-1.7.4.tgz_1455236064846_0.4782760036177933" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/sshpk-1.9.2.tgz_1469841656006_0.10793639998883009" }, "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, - "_npmVersion": "2.14.4", + "_npmVersion": "2.15.8", "_phantomChildren": {}, "_requested": { - "name": "sshpk", "raw": "sshpk@^1.7.0", - "rawSpec": "^1.7.0", "scope": null, + "escapedName": "sshpk", + "name": "sshpk", + "rawSpec": "^1.7.0", "spec": ">=1.7.0 <2.0.0", "type": "range" }, "_requiredBy": [ "/request/http-signature" ], - "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz", - "_shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38", + "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.9.2.tgz", + "_shasum": "3b41351bbad5c34ddf4bd8119937efee31a46765", "_shrinkwrap": null, "_spec": "sshpk@^1.7.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/http-signature", @@ -50,33 +59,34 @@ }, "contributors": [ { - "email": "dave@daveeddy.com", - "name": "Dave Eddy" + "name": "Dave Eddy", + "email": "dave@daveeddy.com" }, { - "email": "mcavage@gmail.com", - "name": "Mark Cavage" + "name": "Mark Cavage", + "email": "mcavage@gmail.com" }, { - "email": "alex@cooperi.net", - "name": "Alex Wilson" + "name": "Alex Wilson", + "email": "alex@cooperi.net" } ], "dependencies": { - "asn1": ">=0.2.3 <0.3.0", - "assert-plus": ">=0.2.0 <0.3.0", - "dashdash": ">=1.10.1 <2.0.0", - "ecc-jsbn": ">=0.0.1 <1.0.0", - "jodid25519": ">=1.0.0 <2.0.0", - "jsbn": ">=0.1.0 <0.2.0", - "tweetnacl": ">=0.13.0 <1.0.0" + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.13.0" }, "description": "A library for finding and using SSH public keys", "devDependencies": { - "benchmark": ">=1.0.0 <2.0.0", - "sinon": ">=1.17.2 <2.0.0", - "tape": ">=3.5.0 <4.0.0", - "temp": "0.8.2" + "benchmark": "^1.0.0", + "sinon": "^1.17.2", + "tape": "^3.5.0", + "temp": "^0.8.2" }, "directories": { "bin": "./bin", @@ -84,33 +94,33 @@ "man": "./man/man1" }, "dist": { - "shasum": "ad7b47defca61c8415d964243b62b0ce60fbca38", - "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.4.tgz" + "shasum": "3b41351bbad5c34ddf4bd8119937efee31a46765", + "tarball": "https://registry.npmjs.org/sshpk/-/sshpk-1.9.2.tgz" }, "engines": { - "node": ">=0.8.0" + "node": ">=0.10.0" }, - "gitHead": "9b86d45d512c97f6ea10b98a2970828dfb290310", + "gitHead": "a8b794384822a52eea5ed3b2f192a780b7909609", "homepage": "https://github.com/arekinath/node-sshpk#readme", "license": "MIT", "main": "lib/index.js", "maintainers": [ { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" } ], "man": [ - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-conv.1", - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-sign.1", - "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-verify.1" + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-conv.1", + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-sign.1", + "/Users/alex.wilson/dev/node-sshpk/man/man1/sshpk-verify.1" ], "name": "sshpk", "optionalDependencies": { - "ecc-jsbn": ">=0.0.1 <1.0.0", - "jodid25519": ">=1.0.0 <2.0.0", - "jsbn": ">=0.1.0 <0.2.0", - "tweetnacl": ">=0.13.0 <1.0.0" + "ecc-jsbn": "~0.1.1", + "jodid25519": "^1.0.0", + "jsbn": "~0.1.0", + "tweetnacl": "~0.13.0" }, "readme": "ERROR: No README data found!", "repository": { @@ -120,5 +130,5 @@ "scripts": { "test": "tape test/*.js" }, - "version": "1.7.4" + "version": "1.9.2" } diff --git a/deps/npm/node_modules/request/node_modules/http-signature/package.json b/deps/npm/node_modules/request/node_modules/http-signature/package.json index c7479c09ff97a4..2f9211c9a7468e 100644 --- a/deps/npm/node_modules/request/node_modules/http-signature/package.json +++ b/deps/npm/node_modules/request/node_modules/http-signature/package.json @@ -1,7 +1,15 @@ { "_args": [ [ - "http-signature@~1.1.0", + { + "raw": "http-signature@~1.1.0", + "scope": null, + "escapedName": "http-signature", + "name": "http-signature", + "rawSpec": "~1.1.0", + "spec": ">=1.1.0 <1.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], @@ -12,16 +20,17 @@ "_location": "/request/http-signature", "_nodeVersion": "0.12.9", "_npmUser": { - "email": "alex@cooperi.net", - "name": "arekinath" + "name": "arekinath", + "email": "alex@cooperi.net" }, "_npmVersion": "2.14.9", "_phantomChildren": {}, "_requested": { - "name": "http-signature", "raw": "http-signature@~1.1.0", - "rawSpec": "~1.1.0", "scope": null, + "escapedName": "http-signature", + "name": "http-signature", + "rawSpec": "~1.1.0", "spec": ">=1.1.0 <1.2.0", "type": "range" }, @@ -66,7 +75,7 @@ "directories": {}, "dist": { "shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf", - "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" + "tarball": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz" }, "engines": { "node": ">=0.8", diff --git a/deps/npm/node_modules/request/node_modules/is-typedarray/package.json b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json index 863afc5165c769..b90ee31390f16d 100644 --- a/deps/npm/node_modules/request/node_modules/is-typedarray/package.json +++ b/deps/npm/node_modules/request/node_modules/is-typedarray/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "is-typedarray@~1.0.0", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "is-typedarray@~1.0.0", + "scope": null, + "escapedName": "is-typedarray", + "name": "is-typedarray", + "rawSpec": "~1.0.0", + "spec": ">=1.0.0 <1.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "is-typedarray@>=1.0.0 <1.1.0", @@ -12,16 +20,17 @@ "_location": "/request/is-typedarray", "_nodeVersion": "0.10.36", "_npmUser": { - "email": "hughskennedy@gmail.com", - "name": "hughsk" + "name": "hughsk", + "email": "hughskennedy@gmail.com" }, "_npmVersion": "2.7.5", "_phantomChildren": {}, "_requested": { - "name": "is-typedarray", "raw": "is-typedarray@~1.0.0", - "rawSpec": "~1.0.0", "scope": null, + "escapedName": "is-typedarray", + "name": "is-typedarray", + "rawSpec": "~1.0.0", "spec": ">=1.0.0 <1.1.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", "_shrinkwrap": null, "_spec": "is-typedarray@~1.0.0", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "hughskennedy@gmail.com", "name": "Hugh Kennedy", + "email": "hughskennedy@gmail.com", "url": "http://hughsk.io/" }, "bugs": { @@ -49,15 +58,15 @@ "directories": {}, "dist": { "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a", - "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" + "tarball": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz" }, "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe", "homepage": "https://github.com/hughsk/is-typedarray", "keywords": [ + "typed", "array", "detect", "is", - "typed", "util" ], "license": "MIT", diff --git a/deps/npm/node_modules/request/node_modules/isstream/package.json b/deps/npm/node_modules/request/node_modules/isstream/package.json index 87c26fe121c130..c2d661f5b63685 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/package.json +++ b/deps/npm/node_modules/request/node_modules/isstream/package.json @@ -1,15 +1,70 @@ { - "name": "isstream", - "version": "0.1.2", + "_args": [ + [ + { + "raw": "isstream@~0.1.2", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "~0.1.2", + "spec": ">=0.1.2 <0.2.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] + ], + "_from": "isstream@>=0.1.2 <0.2.0", + "_id": "isstream@0.1.2", + "_inCache": true, + "_installable": true, + "_location": "/request/isstream", + "_nodeVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "_npmVersion": "2.6.1", + "_phantomChildren": {}, + "_requested": { + "raw": "isstream@~0.1.2", + "scope": null, + "escapedName": "isstream", + "name": "isstream", + "rawSpec": "~0.1.2", + "spec": ">=0.1.2 <0.2.0", + "type": "range" + }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "_shrinkwrap": null, + "_spec": "isstream@~0.1.2", + "_where": "/Users/rebecca/code/npm/node_modules/request", + "author": { + "name": "Rod Vagg", + "email": "rod@vagg.org" + }, + "bugs": { + "url": "https://github.com/rvagg/isstream/issues" + }, + "dependencies": {}, "description": "Determine if an object is a Stream", - "main": "isstream.js", - "scripts": { - "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + "devDependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "tape": "~2.12.3" }, - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/isstream.git" + "directories": {}, + "dist": { + "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", + "tarball": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz" }, + "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc", + "homepage": "https://github.com/rvagg/isstream", "keywords": [ "stream", "type", @@ -17,26 +72,23 @@ "readable-stream", "hippo" ], - "devDependencies": { - "tape": "~2.12.3", - "core-util-is": "~1.0.0", - "isarray": "0.0.1", - "string_decoder": "~0.10.x", - "inherits": "~2.0.1" - }, - "author": { - "name": "Rod Vagg", - "email": "rod@vagg.org" - }, "license": "MIT", - "bugs": { - "url": "https://github.com/rvagg/isstream/issues" + "main": "isstream.js", + "maintainers": [ + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "name": "isstream", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", + "repository": { + "type": "git", + "url": "git+https://github.com/rvagg/isstream.git" }, - "homepage": "https://github.com/rvagg/isstream", - "readme": "# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable()) // true\nisStream(new Stream.Writable()) // true\nisStream(new Stream.Duplex()) // true\nisStream(new Stream.Transform()) // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream()) // false\n\nisReadable(new Stream.Readable()) // true\nisReadable(new Stream.Writable()) // false\nisReadable(new Stream.Duplex()) // true\nisReadable(new Stream.Transform()) // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable()) // false\nisWritable(new Stream.Writable()) // true\nisWritable(new Stream.Duplex()) // true\nisWritable(new Stream.Transform()) // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable()) // false\nisDuplex(new Stream.Writable()) // false\nisDuplex(new Stream.Duplex()) // true\nisDuplex(new Stream.Transform()) // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n", - "readmeFilename": "README.md", - "_id": "isstream@0.1.2", - "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a", - "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "_from": "isstream@>=0.1.2 <0.2.0" + "scripts": { + "test": "tar --xform 's/^package/readable-stream-1.0/' -zxf readable-stream-1.0.*.tgz && tar --xform 's/^package/readable-stream-1.1/' -zxf readable-stream-1.1.*.tgz && node test.js; rm -rf readable-stream-1.?/" + }, + "version": "0.1.2" } diff --git a/deps/npm/node_modules/request/node_modules/isstream/test.js b/deps/npm/node_modules/request/node_modules/isstream/test.js index 881e70b3098ff7..8c950c55e6375f 100644 --- a/deps/npm/node_modules/request/node_modules/isstream/test.js +++ b/deps/npm/node_modules/request/node_modules/isstream/test.js @@ -163,3 +163,6 @@ testDuplex(true, 'ReadableStream11.PassThrough', new (ReadableStream11.PassThrou }) }) + + + diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md index c5147d77f6c943..42bcb60af47a50 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/CHANGELOG.md @@ -1,8 +1,8 @@ ## Unreleased - Fixes stringify to only take ancestors into account when checking - circularity. + circularity. It previously assumed every visited object was circular which led to [false - positives][issue9]. + positives][issue9]. Uses the tiny serializer I wrote for [Must.js][must] a year and a half ago. - Fixes calling the `replacer` function in the proper context (`thisArg`). - Fixes calling the `cycleReplacer` function in the proper context (`thisArg`). diff --git a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json index f09f9d57168c19..35400846685d6c 100644 --- a/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json +++ b/deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json @@ -1,22 +1,55 @@ { - "name": "json-stringify-safe", - "version": "5.0.1", - "description": "Like JSON.stringify, but doesn't blow up on circular refs.", - "keywords": [ - "json", - "stringify", - "circular", - "safe" + "_args": [ + [ + { + "raw": "json-stringify-safe@~5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "~5.0.1", + "spec": ">=5.0.1 <5.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" + ] ], - "homepage": "https://github.com/isaacs/json-stringify-safe", - "bugs": { - "url": "https://github.com/isaacs/json-stringify-safe/issues" + "_from": "json-stringify-safe@>=5.0.1 <5.1.0", + "_id": "json-stringify-safe@5.0.1", + "_inCache": true, + "_installable": true, + "_location": "/request/json-stringify-safe", + "_nodeVersion": "2.0.1", + "_npmUser": { + "name": "isaacs", + "email": "isaacs@npmjs.com" + }, + "_npmVersion": "2.10.0", + "_phantomChildren": {}, + "_requested": { + "raw": "json-stringify-safe@~5.0.1", + "scope": null, + "escapedName": "json-stringify-safe", + "name": "json-stringify-safe", + "rawSpec": "~5.0.1", + "spec": ">=5.0.1 <5.1.0", + "type": "range" }, + "_requiredBy": [ + "/request" + ], + "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "_shrinkwrap": null, + "_spec": "json-stringify-safe@~5.0.1", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me" }, + "bugs": { + "url": "https://github.com/isaacs/json-stringify-safe/issues" + }, "contributors": [ { "name": "Andri Möll", @@ -24,24 +57,47 @@ "url": "http://themoll.com" } ], + "dependencies": {}, + "description": "Like JSON.stringify, but doesn't blow up on circular refs.", + "devDependencies": { + "mocha": ">= 2.1.0 < 3", + "must": ">= 0.12 < 0.13", + "sinon": ">= 1.12.2 < 2" + }, + "directories": {}, + "dist": { + "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", + "tarball": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz" + }, + "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5", + "homepage": "https://github.com/isaacs/json-stringify-safe", + "keywords": [ + "json", + "stringify", + "circular", + "safe" + ], "license": "ISC", + "main": "stringify.js", + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "moll", + "email": "andri@dot.ee" + } + ], + "name": "json-stringify-safe", + "optionalDependencies": {}, + "readme": "ERROR: No README data found!", "repository": { "type": "git", "url": "git://github.com/isaacs/json-stringify-safe.git" }, - "main": "stringify.js", "scripts": { "test": "node test.js" }, - "devDependencies": { - "mocha": ">= 2.1.0 < 3", - "must": ">= 0.12 < 0.13", - "sinon": ">= 1.12.2 < 2" - }, - "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n \"circularRef\": \"[Circular]\",\n \"list\": [\n \"[Circular]\",\n \"[Circular]\"\n ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify. The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles. If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere. This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n", - "readmeFilename": "README.md", - "_id": "json-stringify-safe@5.0.1", - "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb", - "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "_from": "json-stringify-safe@>=5.0.1 <5.1.0" + "version": "5.0.1" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md index 1d86a5cb154422..63bd4ea0b40ce4 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md @@ -1,3 +1,9 @@ +2.1.11 / 2016-05-01 +=================== + + * deps: mime-db@~1.23.0 + - Add new mime types + 2.1.10 / 2016-02-15 =================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md index 44f9f6465e949c..d6705ac86d114f 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md @@ -1,3 +1,24 @@ +1.23.0 / 2016-05-01 +=================== + + * Add `application/efi` + * Add `application/vnd.3gpp.sms+xml` + * Add `application/vnd.3lightssoftware.imagescal` + * Add `application/vnd.coreos.ignition+json` + * Add `application/vnd.desmume.movie` + * Add `application/vnd.onepager` + * Add `application/vnd.vel+json` + * Add `text/prs.prop.logic` + * Add `video/encaprtp` + * Add `video/h265` + * Add `video/iso.segment` + * Add `video/raptorfec` + * Add `video/rtploopback` + * Add `video/vnd.radgamettools.bink` + * Add `video/vnd.radgamettools.smacker` + * Add `video/vp8` + * Add extension `.3gpp` to `audio/3gpp` + 1.22.0 / 2016-02-15 =================== diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json index 863deb4f0a8bee..0a5a8a7bba5574 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json @@ -284,6 +284,9 @@ "source": "iana", "compressible": false }, + "application/efi": { + "source": "iana" + }, "application/emergencycalldata.comment+xml": { "source": "iana" }, @@ -1217,6 +1220,9 @@ "application/vnd.3gpp.sms": { "source": "iana" }, + "application/vnd.3gpp.sms+xml": { + "source": "iana" + }, "application/vnd.3gpp.srvcc-ext+xml": { "source": "iana" }, @@ -1239,6 +1245,9 @@ "source": "iana", "extensions": ["tcap"] }, + "application/vnd.3lightssoftware.imagescal": { + "source": "iana" + }, "application/vnd.3m.post-it-notes": { "source": "iana", "extensions": ["pwn"] @@ -1497,6 +1506,10 @@ "source": "iana", "extensions": ["cdbcmsg"] }, + "application/vnd.coreos.ignition+json": { + "source": "iana", + "compressible": true + }, "application/vnd.cosmocaller": { "source": "iana", "extensions": ["cmc"] @@ -1600,6 +1613,9 @@ "application/vnd.desmume-movie": { "source": "iana" }, + "application/vnd.desmume.movie": { + "source": "apache" + }, "application/vnd.dir-bi.plate-dl-nosuffix": { "source": "iana" }, @@ -3138,6 +3154,9 @@ "application/vnd.omaloc-supl-init": { "source": "iana" }, + "application/vnd.onepager": { + "source": "iana" + }, "application/vnd.openblox.game+xml": { "source": "iana" }, @@ -3981,6 +4000,10 @@ "application/vnd.vectorworks": { "source": "iana" }, + "application/vnd.vel+json": { + "source": "iana", + "compressible": true + }, "application/vnd.verimatrix.vcas": { "source": "iana" }, @@ -4826,7 +4849,9 @@ "source": "iana" }, "audio/3gpp": { - "source": "iana" + "source": "iana", + "compressible": false, + "extensions": ["3gpp"] }, "audio/3gpp2": { "source": "iana" @@ -5991,6 +6016,9 @@ "source": "iana", "extensions": ["dsc"] }, + "text/prs.prop.logic": { + "source": "iana" + }, "text/raptorfec": { "source": "iana" }, @@ -6282,6 +6310,9 @@ "video/dv": { "source": "apache" }, + "video/encaprtp": { + "source": "apache" + }, "video/h261": { "source": "apache", "extensions": ["h261"] @@ -6306,6 +6337,12 @@ "video/h264-svc": { "source": "apache" }, + "video/h265": { + "source": "apache" + }, + "video/iso.segment": { + "source": "apache" + }, "video/jpeg": { "source": "apache", "extensions": ["jpgv"] @@ -6369,12 +6406,18 @@ "compressible": false, "extensions": ["qt","mov"] }, + "video/raptorfec": { + "source": "apache" + }, "video/raw": { "source": "apache" }, "video/rtp-enc-aescm128": { "source": "apache" }, + "video/rtploopback": { + "source": "apache" + }, "video/rtx": { "source": "apache" }, @@ -6474,6 +6517,12 @@ "video/vnd.objectvideo": { "source": "apache" }, + "video/vnd.radgamettools.bink": { + "source": "apache" + }, + "video/vnd.radgamettools.smacker": { + "source": "apache" + }, "video/vnd.sealed.mpeg1": { "source": "apache" }, @@ -6494,6 +6543,9 @@ "source": "apache", "extensions": ["viv"] }, + "video/vp8": { + "source": "apache" + }, "video/webm": { "source": "apache", "compressible": false, diff --git a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json index 1abcdca6c79b95..8411c5ad0e3f7c 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json @@ -1,78 +1,87 @@ { "_args": [ [ - "mime-db@~1.22.0", + { + "raw": "mime-db@~1.23.0", + "scope": null, + "escapedName": "mime-db", + "name": "mime-db", + "rawSpec": "~1.23.0", + "spec": ">=1.23.0 <1.24.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types" ] ], - "_from": "mime-db@>=1.22.0 <1.23.0", - "_id": "mime-db@1.22.0", + "_from": "mime-db@>=1.23.0 <1.24.0", + "_id": "mime-db@1.23.0", "_inCache": true, "_installable": true, "_location": "/request/mime-types/mime-db", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/mime-db-1.22.0.tgz_1455558813990_0.7830642955377698" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/mime-db-1.23.0.tgz_1462163798086_0.43938886746764183" }, "_npmUser": { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { - "name": "mime-db", - "raw": "mime-db@~1.22.0", - "rawSpec": "~1.22.0", + "raw": "mime-db@~1.23.0", "scope": null, - "spec": ">=1.22.0 <1.23.0", + "escapedName": "mime-db", + "name": "mime-db", + "rawSpec": "~1.23.0", + "spec": ">=1.23.0 <1.24.0", "type": "range" }, "_requiredBy": [ "/request/mime-types" ], - "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz", - "_shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a", + "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz", + "_shasum": "a31b4070adaea27d732ea333740a64d0ec9a6659", "_shrinkwrap": null, - "_spec": "mime-db@~1.22.0", + "_spec": "mime-db@~1.23.0", "_where": "/Users/rebecca/code/npm/node_modules/request/node_modules/mime-types", "bugs": { "url": "https://github.com/jshttp/mime-db/issues" }, "contributors": [ { - "email": "doug@somethingdoug.com", - "name": "Douglas Christopher Wilson" + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" }, { - "email": "me@jongleberry.com", "name": "Jonathan Ong", + "email": "me@jongleberry.com", "url": "http://jongleberry.com" }, { - "email": "robert@broofa.com", "name": "Robert Kieffer", + "email": "robert@broofa.com", "url": "http://github.com/broofa" } ], "dependencies": {}, "description": "Media Type Database", "devDependencies": { - "bluebird": "3.3.1", + "bluebird": "3.3.5", "co": "4.6.0", "cogent": "1.0.1", - "csv-parse": "1.0.1", + "csv-parse": "1.1.0", "gnode": "0.1.2", - "istanbul": "0.4.2", + "istanbul": "0.4.3", "mocha": "1.21.5", - "raw-body": "2.1.5", - "stream-to-array": "2.2.1" + "raw-body": "2.1.6", + "stream-to-array": "2.3.0" }, "directories": {}, "dist": { - "shasum": "ab23a6372dc9d86d3dc9121bd0ebd38105a1904a", - "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.22.0.tgz" + "shasum": "a31b4070adaea27d732ea333740a64d0ec9a6659", + "tarball": "https://registry.npmjs.org/mime-db/-/mime-db-1.23.0.tgz" }, "engines": { "node": ">= 0.6" @@ -84,7 +93,7 @@ "db.json", "index.js" ], - "gitHead": "ed88d32405582a5aaff6225d1210005d6be2623e", + "gitHead": "ba0d99fd05b3bfdc2ebcd78f858c25cb7db6af41", "homepage": "https://github.com/jshttp/mime-db#readme", "keywords": [ "mime", @@ -98,12 +107,12 @@ "license": "MIT", "maintainers": [ { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, { - "email": "jonathanrichardong@gmail.com", - "name": "jongleberry" + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" } ], "name": "mime-db", @@ -121,5 +130,5 @@ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/", "update": "npm run fetch && npm run build" }, - "version": "1.22.0" + "version": "1.23.0" } diff --git a/deps/npm/node_modules/request/node_modules/mime-types/package.json b/deps/npm/node_modules/request/node_modules/mime-types/package.json index 8e7b5f62ba3b50..dae8f5a70a0c2e 100644 --- a/deps/npm/node_modules/request/node_modules/mime-types/package.json +++ b/deps/npm/node_modules/request/node_modules/mime-types/package.json @@ -1,31 +1,40 @@ { "_args": [ [ - "mime-types@~2.1.7", + { + "raw": "mime-types@~2.1.7", + "scope": null, + "escapedName": "mime-types", + "name": "mime-types", + "rawSpec": "~2.1.7", + "spec": ">=2.1.7 <2.2.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "mime-types@>=2.1.7 <2.2.0", - "_id": "mime-types@2.1.10", + "_id": "mime-types@2.1.11", "_inCache": true, "_installable": true, "_location": "/request/mime-types", - "_nodeVersion": "4.2.3", + "_nodeVersion": "4.4.3", "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/mime-types-2.1.10.tgz_1455575237256_0.9163766100537032" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/mime-types-2.1.11.tgz_1462165365027_0.7217204745393246" }, "_npmUser": { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, - "_npmVersion": "2.14.7", + "_npmVersion": "2.15.1", "_phantomChildren": {}, "_requested": { - "name": "mime-types", "raw": "mime-types@~2.1.7", - "rawSpec": "~2.1.7", "scope": null, + "escapedName": "mime-types", + "name": "mime-types", + "rawSpec": "~2.1.7", "spec": ">=2.1.7 <2.2.0", "type": "range" }, @@ -33,8 +42,8 @@ "/request", "/request/form-data" ], - "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz", - "_shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837", + "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz", + "_shasum": "c259c471bda808a85d6cd193b430a5fae4473b3c", "_shrinkwrap": null, "_spec": "mime-types@~2.1.7", "_where": "/Users/rebecca/code/npm/node_modules/request", @@ -43,32 +52,32 @@ }, "contributors": [ { - "email": "doug@somethingdoug.com", - "name": "Douglas Christopher Wilson" + "name": "Douglas Christopher Wilson", + "email": "doug@somethingdoug.com" }, { - "email": "fishrock123@rocketmail.com", "name": "Jeremiah Senkpiel", + "email": "fishrock123@rocketmail.com", "url": "https://searchbeam.jit.su" }, { - "email": "me@jongleberry.com", "name": "Jonathan Ong", + "email": "me@jongleberry.com", "url": "http://jongleberry.com" } ], "dependencies": { - "mime-db": "~1.22.0" + "mime-db": "~1.23.0" }, "description": "The ultimate javascript content-type utility.", "devDependencies": { - "istanbul": "0.4.2", + "istanbul": "0.4.3", "mocha": "1.21.5" }, "directories": {}, "dist": { - "shasum": "b93c7cb4362e16d41072a7e54538fb4d43070837", - "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.10.tgz" + "shasum": "c259c471bda808a85d6cd193b430a5fae4473b3c", + "tarball": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.11.tgz" }, "engines": { "node": ">= 0.6" @@ -78,7 +87,7 @@ "LICENSE", "index.js" ], - "gitHead": "70785d38e9cc251137b00f73ab3d3257c4aea203", + "gitHead": "298ffcf490a5d6e60edea7bf7a69036df04846b1", "homepage": "https://github.com/jshttp/mime-types#readme", "keywords": [ "mime", @@ -87,16 +96,16 @@ "license": "MIT", "maintainers": [ { - "email": "doug@somethingdoug.com", - "name": "dougwilson" + "name": "dougwilson", + "email": "doug@somethingdoug.com" }, { - "email": "fishrock123@rocketmail.com", - "name": "fishrock123" + "name": "fishrock123", + "email": "fishrock123@rocketmail.com" }, { - "email": "jonathanrichardong@gmail.com", - "name": "jongleberry" + "name": "jongleberry", + "email": "jonathanrichardong@gmail.com" } ], "name": "mime-types", @@ -111,5 +120,5 @@ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js", "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js" }, - "version": "2.1.10" + "version": "2.1.11" } diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md index a43093bf321f2b..652609b37e009c 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md +++ b/deps/npm/node_modules/request/node_modules/node-uuid/LICENSE.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2010-2012 Robert Kieffer +Copyright (c) 2010-2012 Robert Kieffer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu index fd597ab681ae10..a342fbbe04e9ac 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu +++ b/deps/npm/node_modules/request/node_modules/node-uuid/benchmark/bench.gnu @@ -1,14 +1,14 @@ #!/opt/local/bin/gnuplot -persist # -# +# # G N U P L O T # Version 4.4 patchlevel 3 # last modified March 2011 # System: Darwin 10.8.0 -# +# # Copyright (C) 1986-1993, 1998, 2004, 2007-2010 # Thomas Williams, Colin Kelley and many others -# +# # gnuplot home: http://www.gnuplot.info # faq, bugs, etc: type "help seeking-assistance" # immediate help: type "help" @@ -17,7 +17,7 @@ set terminal postscript eps noenhanced defaultplex \ leveldefault color colortext \ solid linewidth 1.2 butt noclip \ palfuncparam 2000,0.003 \ - "Helvetica" 14 + "Helvetica" 14 set output 'bench.eps' unset clip points set clip one @@ -38,7 +38,7 @@ set timefmt cb "%d/%m/%y,%H:%M" set boxwidth set style fill empty border set style rectangle back fc lt -3 fillstyle solid 1.00 border lt -1 -set style circle radius graph 0.02, first 0, 0 +set style circle radius graph 0.02, first 0, 0 set dummy x,y set format x "% g" set format y "% g" @@ -50,7 +50,7 @@ set angles radians unset grid set key title "" set key outside left top horizontal Right noreverse enhanced autotitles columnhead nobox -set key noinvert samplen 4 spacing 1 width 0 height 0 +set key noinvert samplen 4 spacing 1 width 0 height 0 set key maxcolumns 2 maxrows 0 unset label unset arrow @@ -107,10 +107,10 @@ set nox2tics set noy2tics set cbtics border in scale 1,0.5 mirror norotate offset character 0, 0, 0 set cbtics autofreq norangelimit -set title "" +set title "" set title offset character 0, 0, 0 font "" norotate -set timestamp bottom -set timestamp "" +set timestamp bottom +set timestamp "" set timestamp offset character 0, 0, 0 font "" norotate set rrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale rfixmin @@ -124,9 +124,9 @@ set autoscale ufixmax set vrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale vfixmin set autoscale vfixmax -set xlabel "" +set xlabel "" set xlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate -set x2label "" +set x2label "" set x2label offset character 0, 0, 0 font "" textcolor lt -1 norotate set xrange [ * : * ] noreverse nowriteback # (currently [-0.150000:3.15000] ) set autoscale xfixmin @@ -134,9 +134,9 @@ set autoscale xfixmax set x2range [ * : * ] noreverse nowriteback # (currently [0.00000:3.00000] ) set autoscale x2fixmin set autoscale x2fixmax -set ylabel "" +set ylabel "" set ylabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 -set y2label "" +set y2label "" set y2label offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set yrange [ 0.00000 : 1.90000e+06 ] noreverse nowriteback # (currently [:] ) set autoscale yfixmin @@ -144,12 +144,12 @@ set autoscale yfixmax set y2range [ * : * ] noreverse nowriteback # (currently [0.00000:1.90000e+06] ) set autoscale y2fixmin set autoscale y2fixmax -set zlabel "" +set zlabel "" set zlabel offset character 0, 0, 0 font "" textcolor lt -1 norotate set zrange [ * : * ] noreverse nowriteback # (currently [-10.0000:10.0000] ) set autoscale zfixmin set autoscale zfixmax -set cblabel "" +set cblabel "" set cblabel offset character 0, 0, 0 font "" textcolor lt -1 rotate by -270 set cbrange [ * : * ] noreverse nowriteback # (currently [8.98847e+307:-8.98847e+307] ) set autoscale cbfixmin @@ -162,12 +162,12 @@ set tmargin -1 set pm3d explicit at s set pm3d scansautomatic set pm3d interpolate 1,1 flush begin noftriangles nohidden3d corners2color mean -set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB +set palette positive nops_allcF maxcolors 0 gamma 1.5 color model RGB set palette rgbformulae 7, 5, 15 set colorbox default set colorbox vertical origin screen 0.9, 0.2, 0 size screen 0.05, 0.6, 0 front bdefault -set loadpath -set fontpath +set loadpath +set fontpath set fit noerrorvariables GNUTERM = "aqua" plot 'bench_results.txt' using 2:xticlabel(1) w lp lw 2, '' using 3:xticlabel(1) w lp lw 2, '' using 4:xticlabel(1) w lp lw 2, '' using 5:xticlabel(1) w lp lw 2, '' using 6:xticlabel(1) w lp lw 2, '' using 7:xticlabel(1) w lp lw 2, '' using 8:xticlabel(1) w lp lw 2, '' using 9:xticlabel(1) w lp lw 2 diff --git a/deps/npm/node_modules/request/node_modules/node-uuid/package.json b/deps/npm/node_modules/request/node_modules/node-uuid/package.json index 44c585893f7f49..a3a391590cc4c9 100644 --- a/deps/npm/node_modules/request/node_modules/node-uuid/package.json +++ b/deps/npm/node_modules/request/node_modules/node-uuid/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "node-uuid@~1.4.7", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "node-uuid@~1.4.7", + "scope": null, + "escapedName": "node-uuid", + "name": "node-uuid", + "rawSpec": "~1.4.7", + "spec": ">=1.4.7 <1.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "node-uuid@>=1.4.7 <1.5.0", @@ -12,16 +20,17 @@ "_location": "/request/node-uuid", "_nodeVersion": "5.0.0", "_npmUser": { - "email": "coolaj86@gmail.com", - "name": "coolaj86" + "name": "coolaj86", + "email": "coolaj86@gmail.com" }, "_npmVersion": "3.3.6", "_phantomChildren": {}, "_requested": { - "name": "node-uuid", "raw": "node-uuid@~1.4.7", - "rawSpec": "~1.4.7", "scope": null, + "escapedName": "node-uuid", + "name": "node-uuid", + "rawSpec": "~1.4.7", "spec": ">=1.4.7 <1.5.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", "_shrinkwrap": null, "_spec": "node-uuid@~1.4.7", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "robert@broofa.com", - "name": "Robert Kieffer" + "name": "Robert Kieffer", + "email": "robert@broofa.com" }, "bin": { "uuid": "./bin/uuid" @@ -61,7 +70,7 @@ "directories": {}, "dist": { "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f", - "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" + "tarball": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz" }, "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd", "homepage": "https://github.com/broofa/node-uuid", diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md index af496148e4815a..34c4a85d2dde05 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/README.md +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/README.md @@ -1,4 +1,4 @@ oauth-sign ========== -OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. +OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js index 4c20674c792a60..dadcba9709f792 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/index.js +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/index.js @@ -45,7 +45,7 @@ function compare (a, b) { } function generateBase (httpMethod, base_uri, params) { - // adapted from https://dev.twitter.com/docs/auth/oauth and + // adapted from https://dev.twitter.com/docs/auth/oauth and // https://dev.twitter.com/docs/auth/creating-signature // Parameter normalization @@ -133,3 +133,4 @@ exports.plaintext = plaintext exports.sign = sign exports.rfc3986 = rfc3986 exports.generateBase = generateBase + diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json index 788eebb0c21a5d..a01120c9f5e7c1 100644 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/package.json +++ b/deps/npm/node_modules/request/node_modules/oauth-sign/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "oauth-sign@~0.8.0", + { + "raw": "oauth-sign@~0.8.1", + "scope": null, + "escapedName": "oauth-sign", + "name": "oauth-sign", + "rawSpec": "~0.8.1", + "spec": ">=0.8.1 <0.9.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "oauth-sign@>=0.8.0 <0.9.0", - "_id": "oauth-sign@0.8.1", + "_from": "oauth-sign@>=0.8.1 <0.9.0", + "_id": "oauth-sign@0.8.2", "_inCache": true, "_installable": true, "_location": "/request/oauth-sign", - "_nodeVersion": "5.5.0", + "_nodeVersion": "5.9.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/oauth-sign-0.8.2.tgz_1462396399020_0.8175400267355144" + }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.6.0", + "_npmVersion": "2.15.3", "_phantomChildren": {}, "_requested": { - "name": "oauth-sign", - "raw": "oauth-sign@~0.8.0", - "rawSpec": "~0.8.0", + "raw": "oauth-sign@~0.8.1", "scope": null, - "spec": ">=0.8.0 <0.9.0", + "escapedName": "oauth-sign", + "name": "oauth-sign", + "rawSpec": "~0.8.1", + "spec": ">=0.8.1 <0.9.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz", - "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06", + "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "_shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", "_shrinkwrap": null, - "_spec": "oauth-sign@~0.8.0", + "_spec": "oauth-sign@~0.8.1", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "mikeal.rogers@gmail.com", "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, "bugs": { @@ -46,28 +59,31 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "182439bdb91378bf7460e75c64ea43e6448def06", - "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz" + "shasum": "46a6ab7f0aead8deae9ec0565780b7d4efeb9d43", + "tarball": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz" }, "engines": { "node": "*" }, - "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d", + "files": [ + "index.js" + ], + "gitHead": "0b034206316132f57e26970152c2fb18e71bddd5", "homepage": "https://github.com/mikeal/oauth-sign#readme", "license": "Apache-2.0", "main": "index.js", "maintainers": [ { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "jnylen@gmail.com", - "name": "nylen" + "name": "nylen", + "email": "jnylen@gmail.com" }, { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" } ], "name": "oauth-sign", @@ -79,5 +95,5 @@ "scripts": { "test": "node test.js" }, - "version": "0.8.1" + "version": "0.8.2" } diff --git a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js b/deps/npm/node_modules/request/node_modules/oauth-sign/test.js deleted file mode 100644 index 4cd02b8aa21967..00000000000000 --- a/deps/npm/node_modules/request/node_modules/oauth-sign/test.js +++ /dev/null @@ -1,89 +0,0 @@ -var oauth = require('./index') - , hmacsign = oauth.hmacsign - , assert = require('assert') - , qs = require('querystring') - ; - -// Tests from Twitter documentation https://dev.twitter.com/docs/auth/oauth - -var reqsign = hmacsign('POST', 'https://api.twitter.com/oauth/request_token', - { oauth_callback: 'http://localhost:3005/the_dance/process_callback?service_provider_id=11' - , oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: 'QP70eNmVz8jvdPevU3oJD2AfF7R7odC2XJcn4XlZJqk' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_timestamp: '1272323042' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98") - -console.log(reqsign) -console.log('8wUi7m5HFQy76nowoCThusfgB+Q=') -assert.equal(reqsign, '8wUi7m5HFQy76nowoCThusfgB+Q=') - -var accsign = hmacsign('POST', 'https://api.twitter.com/oauth/access_token', - { oauth_consumer_key: 'GDdmIQH6jhtmLUypg82g' - , oauth_nonce: '9zWH6qe0qG7Lc1telCn7FhUbLyVdjEaL3MO5uHxn8' - , oauth_signature_method: 'HMAC-SHA1' - , oauth_token: '8ldIZyxQeVrFZXFOZH5tAwj6vzJYuLQpl0WUEYtWc' - , oauth_timestamp: '1272323047' - , oauth_verifier: 'pDNg57prOHapMbhv25RNf75lVRd6JDsni1AJJIDYoTY' - , oauth_version: '1.0' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "x6qpRnlEmW9JbQn4PQVVeVG8ZLPEx6A0TOebgwcuA") - -console.log(accsign) -console.log('PUw/dHA4fnlJYM6RhXk5IU/0fCc=') -assert.equal(accsign, 'PUw/dHA4fnlJYM6RhXk5IU/0fCc=') - -var upsign = hmacsign('POST', 'http://api.twitter.com/1/statuses/update.json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , status: 'setting up my twitter 私のさえずりを設定する' - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('yOahq5m0YjDDjfjxHaXEsW9D+X0=') -assert.equal(upsign, 'yOahq5m0YjDDjfjxHaXEsW9D+X0=') - -// handle objects in params (useful for Wordpress REST API) -var upsign = hmacsign('POST', 'http://wordpress.com/wp-json', - { oauth_consumer_key: "GDdmIQH6jhtmLUypg82g" - , oauth_nonce: "oElnnMTQIZvqvlfXM56aBLAf5noGD0AQR3Fmi7Q6Y" - , oauth_signature_method: "HMAC-SHA1" - , oauth_token: "819797-Jxq8aYUDRmykzVKrgoLhXSq67TEa5ruc4GJC2rWimw" - , oauth_timestamp: "1272325550" - , oauth_version: "1.0" - , filter: { number: "-1" } - }, "MCD8BKwGdgPHvAuvgvz4EQpqDAtx89grbuNMRd7Eh98", "J6zix3FfA9LofH0awS24M3HcBYXO5nI1iYe8EfBA") - -console.log(upsign) -console.log('YrJFBdwnjuIitGpKrxLUplcuuUQ=') -assert.equal(upsign, 'YrJFBdwnjuIitGpKrxLUplcuuUQ=') - -// example in rfc5849 -var params = qs.parse('b5=%3D%253D&a3=a&c%40=&a2=r%20b' + '&' + 'c2&a3=2+q') -params.oauth_consumer_key = '9djdj82h48djs9d2' -params.oauth_token = 'kkk9d7dh3k39sjv7' -params.oauth_nonce = '7d8f3e4a' -params.oauth_signature_method = 'HMAC-SHA1' -params.oauth_timestamp = '137131201' - -var rfc5849sign = hmacsign('POST', 'http://example.com/request', - params, "j49sk3j29djd", "dh893hdasih9") - -console.log(rfc5849sign) -console.log('r6/TJjbCOr97/+UU0NsvSne7s5g=') -assert.equal(rfc5849sign, 'r6/TJjbCOr97/+UU0NsvSne7s5g=') - - -// PLAINTEXT - -var plainSign = oauth.sign('PLAINTEXT', 'GET', 'http://dummy.com', {}, 'consumer_secret', 'token_secret') -console.log(plainSign) -assert.equal(plainSign, 'consumer_secret&token_secret') - -plainSign = oauth.plaintext('consumer_secret', 'token_secret') -console.log(plainSign) -assert.equal(plainSign, 'consumer_secret&token_secret') diff --git a/deps/npm/node_modules/request/node_modules/qs/.npmignore b/deps/npm/node_modules/request/node_modules/qs/.npmignore deleted file mode 100644 index 7e1574dc5c3c81..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov -complexity.md diff --git a/deps/npm/node_modules/request/node_modules/qs/.travis.yml b/deps/npm/node_modules/request/node_modules/qs/.travis.yml deleted file mode 100644 index 63bdc12bebd6b9..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/.travis.yml +++ /dev/null @@ -1,69 +0,0 @@ -language: node_js -node_js: - - "5.3" - - "5.2" - - "5.1" - - "5.0" - - "4.2" - - "4.1" - - "4.0" - - "iojs-v3.3" - - "iojs-v3.2" - - "iojs-v3.1" - - "iojs-v3.0" - - "iojs-v2.5" - - "iojs-v2.4" - - "iojs-v2.3" - - "iojs-v2.2" - - "iojs-v2.1" - - "iojs-v2.0" - - "iojs-v1.8" - - "iojs-v1.7" - - "iojs-v1.6" - - "iojs-v1.5" - - "iojs-v1.4" - - "iojs-v1.3" - - "iojs-v1.2" - - "iojs-v1.1" - - "iojs-v1.0" - - "0.12" - - "0.11" - - "0.10" - - "0.9" - - "0.8" - - "0.6" - - "0.4" -before_install: - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi' - - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi' -script: - - 'if [ "${TRAVIS_NODE_VERSION}" != "4.2" ]; then npm run tests-only ; else npm test ; fi' -sudo: false -matrix: - fast_finish: true - allow_failures: - - node_js: "5.2" - - node_js: "5.1" - - node_js: "5.0" - - node_js: "4.1" - - node_js: "4.0" - - node_js: "iojs-v3.2" - - node_js: "iojs-v3.1" - - node_js: "iojs-v3.0" - - node_js: "iojs-v2.4" - - node_js: "iojs-v2.3" - - node_js: "iojs-v2.2" - - node_js: "iojs-v2.1" - - node_js: "iojs-v2.0" - - node_js: "iojs-v1.7" - - node_js: "iojs-v1.6" - - node_js: "iojs-v1.5" - - node_js: "iojs-v1.4" - - node_js: "iojs-v1.3" - - node_js: "iojs-v1.2" - - node_js: "iojs-v1.1" - - node_js: "iojs-v1.0" - - node_js: "0.11" - - node_js: "0.9" - - node_js: "0.6" - - node_js: "0.4" diff --git a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md index 5c66ea44464cb1..86bea763886548 100644 --- a/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md +++ b/deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md @@ -1,4 +1,16 @@ -## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=34&state=closed) +## **6.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values +- [Refactor] Be explicit and use `Object.prototype.hasOwnProperty.call` +- [Tests] remove `parallelshell` since it does not reliably report failures +- [Tests] up to `node` `v6.3`, `v5.12` +- [Dev Deps] update `tape`, `eslint`, `@ljharb/eslint-config`, `qs-iconv` + +## [**6.2.0**](https://github.com/ljharb/qs/issues?milestone=36&state=closed) +- [New] pass Buffers to the encoder/decoder directly (#161) +- [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160) +- [Fix] fix compacting of nested sparse arrays (#150) + +## [**6.1.0**](https://github.com/ljharb/qs/issues?milestone=35&state=closed) - [New] allowDots option for `stringify` (#151) - [Fix] "sort" option should work at a depth of 3 or more (#151) - [Fix] Restore `dist` directory; will be removed in v7 (#148) @@ -12,6 +24,9 @@ ## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed) - [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4 +## **5.2.1** +- [Fix] ensure `key[]=x&key[]&key[]=y` results in 3, not 2, values + ## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed) - [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string diff --git a/deps/npm/node_modules/request/node_modules/qs/README.md b/deps/npm/node_modules/request/node_modules/qs/README.md index 335eafb4be5a72..97e390796c7f34 100644 --- a/deps/npm/node_modules/request/node_modules/qs/README.md +++ b/deps/npm/node_modules/request/node_modules/qs/README.md @@ -225,6 +225,26 @@ var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false }); assert.equal(unencoded, 'a[b]=c'); ``` +This encoding can also be replaced by a custom encoding method set as `encoder` option: + +```javascript +var encoded = qs.stringify({ a: { b: 'c' } }, { encoder: function (str) { + // Passed in values `a`, `b`, `c` + return // Return encoded string +}}) +``` + +_(Note: the `encoder` option does not apply if `encode` is `false`)_ + +Analogue to the `encoder` there is a `decoder` option for `parse` to override decoding of properties and values: + +```javascript +var decoded = qs.parse('x=z', { decoder: function (str) { + // Passed in values `x`, `z` + return // Return decoded string +}}) +``` + Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. When arrays are stringified, by default they are given explicit indices: @@ -333,3 +353,24 @@ To completely skip rendering keys with `null` values, use the `skipNulls` flag: var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true }); assert.equal(nullsSkipped, 'a=b'); ``` + +### Dealing with special character sets + +By default the encoding and decoding of characters is done in `utf-8`. If you +wish to encode querystrings to a different character set (i.e. +[Shift JIS](https://en.wikipedia.org/wiki/Shift_JIS)) you can use the +[`qs-iconv`](https://github.com/martinheidegger/qs-iconv) library: + +```javascript +var encoder = require('qs-iconv/encoder')('shift_jis'); +var shiftJISEncoded = qs.stringify({ a: 'こんにちは!' }, { encoder: encoder }); +assert.equal(shiftJISEncoded, 'a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I'); +``` + +This also works for decoding of query strings: + +```javascript +var decoder = require('qs-iconv/decoder')('shift_jis'); +var obj = qs.parse('a=%82%B1%82%F1%82%C9%82%BF%82%CD%81I', { decoder: decoder }); +assert.deepEqual(obj, { a: 'こんにちは!' }); +``` diff --git a/deps/npm/node_modules/request/node_modules/qs/bower.json b/deps/npm/node_modules/request/node_modules/qs/bower.json deleted file mode 100644 index 44f050642d73db..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/bower.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "qs", - "main": "dist/qs.js", - "homepage": "https://github.com/hapijs/qs", - "authors": [ - "Nathan LaFreniere " - ], - "description": "A querystring parser that supports nesting and arrays, with a depth limit", - "keywords": [ - "querystring", - "qs" - ], - "license": "BSD-3-Clause", - "ignore": [ - "**/.*", - "node_modules", - "bower_components", - "test", - "tests" - ] -} diff --git a/deps/npm/node_modules/request/node_modules/qs/component.json b/deps/npm/node_modules/request/node_modules/qs/component.json deleted file mode 100644 index cb8d93fb1fe8f7..00000000000000 --- a/deps/npm/node_modules/request/node_modules/qs/component.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "name": "qs", - "repository": "hapijs/qs", - "description": "query-string parser / stringifier with nesting support", - "version": "6.1.0", - "keywords": ["querystring", "query", "parser"], - "main": "lib/index.js", - "scripts": [ - "lib/index.js", - "lib/parse.js", - "lib/stringify.js", - "lib/utils.js" - ], - "license": "BSD-3-Clause" -} diff --git a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js index bb8ea31a957830..fcf825b584085f 100644 --- a/deps/npm/node_modules/request/node_modules/qs/dist/qs.js +++ b/deps/npm/node_modules/request/node_modules/qs/dist/qs.js @@ -14,7 +14,9 @@ module.exports = { var Utils = require('./utils'); -var internals = { +var has = Object.prototype.hasOwnProperty; + +var defaults = { delimiter: '&', depth: 5, arrayLimit: 20, @@ -22,10 +24,11 @@ var internals = { strictNullHandling: false, plainObjects: false, allowPrototypes: false, - allowDots: false + allowDots: false, + decoder: Utils.decode }; -internals.parseValues = function (str, options) { +var parseValues = function parseValues(str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); @@ -33,28 +36,25 @@ internals.parseValues = function (str, options) { var part = parts[i]; var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + var key, val; if (pos === -1) { - obj[Utils.decode(part)] = ''; - - if (options.strictNullHandling) { - obj[Utils.decode(part)] = null; - } + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; } else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; } } return obj; }; -internals.parseObject = function (chain, val, options) { +var parseObject = function parseObject(chain, val, options) { if (!chain.length) { return val; } @@ -64,7 +64,7 @@ internals.parseObject = function (chain, val, options) { var obj; if (root === '[]') { obj = []; - obj = obj.concat(internals.parseObject(chain, val, options)); + obj = obj.concat(parseObject(chain, val, options)); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; @@ -77,16 +77,16 @@ internals.parseObject = function (chain, val, options) { (options.parseArrays && index <= options.arrayLimit) ) { obj = []; - obj[index] = internals.parseObject(chain, val, options); + obj[index] = parseObject(chain, val, options); } else { - obj[cleanRoot] = internals.parseObject(chain, val, options); + obj[cleanRoot] = parseObject(chain, val, options); } } return obj; }; -internals.parseKeys = function (givenKey, val, options) { +var parseKeys = function parseKeys(givenKey, val, options) { if (!givenKey) { return; } @@ -109,7 +109,7 @@ internals.parseKeys = function (givenKey, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { if (!options.allowPrototypes) { return; } @@ -123,7 +123,7 @@ internals.parseKeys = function (givenKey, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -137,30 +137,32 @@ internals.parseKeys = function (givenKey, val, options) { keys.push('[' + key.slice(segment.index) + ']'); } - return internals.parseObject(keys, val, options); + return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts || {}; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - - if ( - str === '' || - str === null || - typeof str === 'undefined' - ) { + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } - var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object @@ -168,7 +170,7 @@ module.exports = function (str, opts) { var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; - var newObj = internals.parseKeys(key, tempObj[key], options); + var newObj = parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); } @@ -180,45 +182,45 @@ module.exports = function (str, opts) { var Utils = require('./utils'); -var internals = { - delimiter: '&', - arrayPrefixGenerators: { - brackets: function (prefix) { - return prefix + '[]'; - }, - indices: function (prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function (prefix) { - return prefix; - } +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', strictNullHandling: false, skipNulls: false, - encode: true + encode: true, + encoder: Utils.encode }; -internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) { +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } else if (Utils.isBuffer(obj)) { - obj = String(obj); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { if (strictNullHandling) { - return encode ? Utils.encode(prefix) : prefix; + return encoder ? encoder(prefix) : prefix; } obj = ''; } - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { - if (encode) { - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; } - return [prefix + '=' + obj]; + return [prefix + '=' + String(obj)]; } var values = []; @@ -243,9 +245,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH } if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } else { - values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } } @@ -255,14 +257,20 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH module.exports = function (object, opts) { var obj = object; var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var objKeys; var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); @@ -277,7 +285,7 @@ module.exports = function (object, opts) { } var arrayFormat; - if (options.arrayFormat in internals.arrayPrefixGenerators) { + if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; @@ -285,7 +293,7 @@ module.exports = function (object, opts) { arrayFormat = 'indices'; } - var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); @@ -302,7 +310,7 @@ module.exports = function (object, opts) { continue; } - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } return keys.join(delimiter); @@ -357,7 +365,7 @@ exports.merge = function (target, source, options) { mergeTarget = exports.arrayToObject(target, options); } - return Object.keys(source).reduce(function (acc, key) { + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(acc, key)) { @@ -365,7 +373,7 @@ exports.merge = function (target, source, options) { } else { acc[key] = value; } - return acc; + return acc; }, mergeTarget); }; @@ -420,7 +428,7 @@ exports.encode = function (str) { i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; @@ -443,7 +451,9 @@ exports.compact = function (obj, references) { var compacted = []; for (var i = 0; i < obj.length; ++i) { - if (typeof obj[i] !== 'undefined') { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } } diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js index 9b6cbd221987f0..8b37cb3b294580 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/parse.js @@ -2,7 +2,9 @@ var Utils = require('./utils'); -var internals = { +var has = Object.prototype.hasOwnProperty; + +var defaults = { delimiter: '&', depth: 5, arrayLimit: 20, @@ -10,10 +12,11 @@ var internals = { strictNullHandling: false, plainObjects: false, allowPrototypes: false, - allowDots: false + allowDots: false, + decoder: Utils.decode }; -internals.parseValues = function (str, options) { +var parseValues = function parseValues(str, options) { var obj = {}; var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit); @@ -21,28 +24,25 @@ internals.parseValues = function (str, options) { var part = parts[i]; var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1; + var key, val; if (pos === -1) { - obj[Utils.decode(part)] = ''; - - if (options.strictNullHandling) { - obj[Utils.decode(part)] = null; - } + key = options.decoder(part); + val = options.strictNullHandling ? null : ''; } else { - var key = Utils.decode(part.slice(0, pos)); - var val = Utils.decode(part.slice(pos + 1)); - - if (Object.prototype.hasOwnProperty.call(obj, key)) { - obj[key] = [].concat(obj[key]).concat(val); - } else { - obj[key] = val; - } + key = options.decoder(part.slice(0, pos)); + val = options.decoder(part.slice(pos + 1)); + } + if (has.call(obj, key)) { + obj[key] = [].concat(obj[key]).concat(val); + } else { + obj[key] = val; } } return obj; }; -internals.parseObject = function (chain, val, options) { +var parseObject = function parseObject(chain, val, options) { if (!chain.length) { return val; } @@ -52,7 +52,7 @@ internals.parseObject = function (chain, val, options) { var obj; if (root === '[]') { obj = []; - obj = obj.concat(internals.parseObject(chain, val, options)); + obj = obj.concat(parseObject(chain, val, options)); } else { obj = options.plainObjects ? Object.create(null) : {}; var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root; @@ -65,16 +65,16 @@ internals.parseObject = function (chain, val, options) { (options.parseArrays && index <= options.arrayLimit) ) { obj = []; - obj[index] = internals.parseObject(chain, val, options); + obj[index] = parseObject(chain, val, options); } else { - obj[cleanRoot] = internals.parseObject(chain, val, options); + obj[cleanRoot] = parseObject(chain, val, options); } } return obj; }; -internals.parseKeys = function (givenKey, val, options) { +var parseKeys = function parseKeys(givenKey, val, options) { if (!givenKey) { return; } @@ -97,7 +97,7 @@ internals.parseKeys = function (givenKey, val, options) { if (segment[1]) { // If we aren't using plain objects, optionally prefix keys // that would overwrite object prototype properties - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) { + if (!options.plainObjects && has.call(Object.prototype, segment[1])) { if (!options.allowPrototypes) { return; } @@ -111,7 +111,7 @@ internals.parseKeys = function (givenKey, val, options) { var i = 0; while ((segment = child.exec(key)) !== null && i < options.depth) { i += 1; - if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) { + if (!options.plainObjects && has.call(Object.prototype, segment[1].replace(/\[|\]/g, ''))) { if (!options.allowPrototypes) { continue; } @@ -125,30 +125,32 @@ internals.parseKeys = function (givenKey, val, options) { keys.push('[' + key.slice(segment.index) + ']'); } - return internals.parseObject(keys, val, options); + return parseObject(keys, val, options); }; module.exports = function (str, opts) { var options = opts || {}; - options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter; - options.depth = typeof options.depth === 'number' ? options.depth : internals.depth; - options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit; + + if (options.decoder !== null && options.decoder !== undefined && typeof options.decoder !== 'function') { + throw new TypeError('Decoder has to be a function.'); + } + + options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : defaults.delimiter; + options.depth = typeof options.depth === 'number' ? options.depth : defaults.depth; + options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : defaults.arrayLimit; options.parseArrays = options.parseArrays !== false; - options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : internals.allowDots; - options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : internals.plainObjects; - options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : internals.allowPrototypes; - options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit; - options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - - if ( - str === '' || - str === null || - typeof str === 'undefined' - ) { + options.decoder = typeof options.decoder === 'function' ? options.decoder : defaults.decoder; + options.allowDots = typeof options.allowDots === 'boolean' ? options.allowDots : defaults.allowDots; + options.plainObjects = typeof options.plainObjects === 'boolean' ? options.plainObjects : defaults.plainObjects; + options.allowPrototypes = typeof options.allowPrototypes === 'boolean' ? options.allowPrototypes : defaults.allowPrototypes; + options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : defaults.parameterLimit; + options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + + if (str === '' || str === null || typeof str === 'undefined') { return options.plainObjects ? Object.create(null) : {}; } - var tempObj = typeof str === 'string' ? internals.parseValues(str, options) : str; + var tempObj = typeof str === 'string' ? parseValues(str, options) : str; var obj = options.plainObjects ? Object.create(null) : {}; // Iterate over the keys and setup the new object @@ -156,7 +158,7 @@ module.exports = function (str, opts) { var keys = Object.keys(tempObj); for (var i = 0; i < keys.length; ++i) { var key = keys[i]; - var newObj = internals.parseKeys(key, tempObj[key], options); + var newObj = parseKeys(key, tempObj[key], options); obj = Utils.merge(obj, newObj, options); } diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js index 892dad45a9f30f..6e1c9a263cd979 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/stringify.js @@ -2,45 +2,45 @@ var Utils = require('./utils'); -var internals = { - delimiter: '&', - arrayPrefixGenerators: { - brackets: function (prefix) { - return prefix + '[]'; - }, - indices: function (prefix, key) { - return prefix + '[' + key + ']'; - }, - repeat: function (prefix) { - return prefix; - } +var arrayPrefixGenerators = { + brackets: function brackets(prefix) { + return prefix + '[]'; + }, + indices: function indices(prefix, key) { + return prefix + '[' + key + ']'; }, + repeat: function repeat(prefix) { + return prefix; + } +}; + +var defaults = { + delimiter: '&', strictNullHandling: false, skipNulls: false, - encode: true + encode: true, + encoder: Utils.encode }; -internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots) { +var stringify = function stringify(object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots) { var obj = object; if (typeof filter === 'function') { obj = filter(prefix, obj); - } else if (Utils.isBuffer(obj)) { - obj = String(obj); } else if (obj instanceof Date) { obj = obj.toISOString(); } else if (obj === null) { if (strictNullHandling) { - return encode ? Utils.encode(prefix) : prefix; + return encoder ? encoder(prefix) : prefix; } obj = ''; } - if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') { - if (encode) { - return [Utils.encode(prefix) + '=' + Utils.encode(obj)]; + if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean' || Utils.isBuffer(obj)) { + if (encoder) { + return [encoder(prefix) + '=' + encoder(obj)]; } - return [prefix + '=' + obj]; + return [prefix + '=' + String(obj)]; } var values = []; @@ -65,9 +65,9 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH } if (Array.isArray(obj)) { - values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } else { - values = values.concat(internals.stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + values = values.concat(stringify(obj[key], prefix + (allowDots ? '.' + key : '[' + key + ']'), generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } } @@ -77,14 +77,20 @@ internals.stringify = function (object, prefix, generateArrayPrefix, strictNullH module.exports = function (object, opts) { var obj = object; var options = opts || {}; - var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter; - var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling; - var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls; - var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode; + var delimiter = typeof options.delimiter === 'undefined' ? defaults.delimiter : options.delimiter; + var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : defaults.strictNullHandling; + var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : defaults.skipNulls; + var encode = typeof options.encode === 'boolean' ? options.encode : defaults.encode; + var encoder = encode ? (typeof options.encoder === 'function' ? options.encoder : defaults.encoder) : null; var sort = typeof options.sort === 'function' ? options.sort : null; var allowDots = typeof options.allowDots === 'undefined' ? false : options.allowDots; var objKeys; var filter; + + if (options.encoder !== null && options.encoder !== undefined && typeof options.encoder !== 'function') { + throw new TypeError('Encoder has to be a function.'); + } + if (typeof options.filter === 'function') { filter = options.filter; obj = filter('', obj); @@ -99,7 +105,7 @@ module.exports = function (object, opts) { } var arrayFormat; - if (options.arrayFormat in internals.arrayPrefixGenerators) { + if (options.arrayFormat in arrayPrefixGenerators) { arrayFormat = options.arrayFormat; } else if ('indices' in options) { arrayFormat = options.indices ? 'indices' : 'repeat'; @@ -107,7 +113,7 @@ module.exports = function (object, opts) { arrayFormat = 'indices'; } - var generateArrayPrefix = internals.arrayPrefixGenerators[arrayFormat]; + var generateArrayPrefix = arrayPrefixGenerators[arrayFormat]; if (!objKeys) { objKeys = Object.keys(obj); @@ -124,7 +130,7 @@ module.exports = function (object, opts) { continue; } - keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort, allowDots)); + keys = keys.concat(stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encoder, filter, sort, allowDots)); } return keys.join(delimiter); diff --git a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js index 5d433560306849..2c5c8ee503355b 100755 --- a/deps/npm/node_modules/request/node_modules/qs/lib/utils.js +++ b/deps/npm/node_modules/request/node_modules/qs/lib/utils.js @@ -46,7 +46,7 @@ exports.merge = function (target, source, options) { mergeTarget = exports.arrayToObject(target, options); } - return Object.keys(source).reduce(function (acc, key) { + return Object.keys(source).reduce(function (acc, key) { var value = source[key]; if (Object.prototype.hasOwnProperty.call(acc, key)) { @@ -54,7 +54,7 @@ exports.merge = function (target, source, options) { } else { acc[key] = value; } - return acc; + return acc; }, mergeTarget); }; @@ -109,7 +109,7 @@ exports.encode = function (str) { i += 1; c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF)); - out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]); + out += hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]; } return out; @@ -132,7 +132,9 @@ exports.compact = function (obj, references) { var compacted = []; for (var i = 0; i < obj.length; ++i) { - if (typeof obj[i] !== 'undefined') { + if (obj[i] && typeof obj[i] === 'object') { + compacted.push(exports.compact(obj[i], refs)); + } else if (typeof obj[i] !== 'undefined') { compacted.push(obj[i]); } } diff --git a/deps/npm/node_modules/request/node_modules/qs/package.json b/deps/npm/node_modules/request/node_modules/qs/package.json index 33318a7253cc48..64853dbde47222 100644 --- a/deps/npm/node_modules/request/node_modules/qs/package.json +++ b/deps/npm/node_modules/request/node_modules/qs/package.json @@ -1,73 +1,84 @@ { "_args": [ [ - "qs@~6.1.0", + { + "raw": "qs@~6.2.0", + "scope": null, + "escapedName": "qs", + "name": "qs", + "rawSpec": "~6.2.0", + "spec": ">=6.2.0 <6.3.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "qs@>=6.1.0 <6.2.0", - "_id": "qs@6.1.0", + "_from": "qs@>=6.2.0 <6.3.0", + "_id": "qs@6.2.1", "_inCache": true, "_installable": true, "_location": "/request/qs", - "_nodeVersion": "5.5.0", + "_nodeVersion": "6.3.0", "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/qs-6.1.0.tgz_1454565583082_0.44599376199766994" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/qs-6.2.1.tgz_1469044929716_0.06957711698487401" }, "_npmUser": { - "email": "ljharb@gmail.com", - "name": "ljharb" + "name": "ljharb", + "email": "ljharb@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "name": "qs", - "raw": "qs@~6.1.0", - "rawSpec": "~6.1.0", + "raw": "qs@~6.2.0", "scope": null, - "spec": ">=6.1.0 <6.2.0", + "escapedName": "qs", + "name": "qs", + "rawSpec": "~6.2.0", + "spec": ">=6.2.0 <6.3.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/qs/-/qs-6.1.0.tgz", - "_shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26", + "_resolved": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz", + "_shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", "_shrinkwrap": null, - "_spec": "qs@~6.1.0", + "_spec": "qs@~6.2.0", "_where": "/Users/rebecca/code/npm/node_modules/request", "bugs": { "url": "https://github.com/ljharb/qs/issues" }, "contributors": [ { - "email": "ljharb@gmail.com", "name": "Jordan Harband", + "email": "ljharb@gmail.com", "url": "http://ljharb.codes" } ], "dependencies": {}, "description": "A querystring parser that supports nesting and arrays, with a depth limit", "devDependencies": { - "@ljharb/eslint-config": "^1.6.1", - "browserify": "^12.0.1", + "@ljharb/eslint-config": "^6.0.0", + "browserify": "^13.0.1", "covert": "^1.1.0", - "eslint": "^1.10.3", - "evalmd": "^0.0.16", + "eslint": "^3.1.0", + "evalmd": "^0.0.17", + "iconv-lite": "^0.4.13", "mkdirp": "^0.5.1", "parallelshell": "^2.0.0", - "tape": "^4.3.0" + "qs-iconv": "^1.0.3", + "tape": "^4.6.0" }, "directories": {}, "dist": { - "shasum": "ec1d1626b24278d99f0fdf4549e524e24eceeb26", - "tarball": "http://registry.npmjs.org/qs/-/qs-6.1.0.tgz" + "shasum": "ce03c5ff0935bc1d9d69a9f14cbd18e568d67625", + "tarball": "https://registry.npmjs.org/qs/-/qs-6.2.1.tgz" }, "engines": { "node": ">=0.6" }, - "gitHead": "5bd79545edb33d6a43398fec7df9ecef2da005ea", + "gitHead": "335f839142e6c2c69f5302c4940d92acb0e77561", "homepage": "https://github.com/ljharb/qs", "keywords": [ "querystring", @@ -77,16 +88,16 @@ "main": "lib/index.js", "maintainers": [ { - "email": "eran@hammer.io", - "name": "hueniverse" + "name": "hueniverse", + "email": "eran@hammer.io" }, { - "email": "ljharb@gmail.com", - "name": "ljharb" + "name": "ljharb", + "email": "ljharb@gmail.com" }, { - "email": "quitlahok@gmail.com", - "name": "nlf" + "name": "nlf", + "email": "quitlahok@gmail.com" } ], "name": "qs", @@ -101,9 +112,10 @@ "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js", "lint": "eslint lib/*.js text/*.js", "prepublish": "npm run dist", + "pretest": "npm run --silent readme && npm run --silent lint", "readme": "evalmd README.md", - "test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'", + "test": "npm run --silent coverage", "tests-only": "node test" }, - "version": "6.1.0" + "version": "6.2.1" } diff --git a/deps/npm/node_modules/request/node_modules/qs/test/parse.js b/deps/npm/node_modules/request/node_modules/qs/test/parse.js index 5665d074e95bd4..ccf8c8c4c5365a 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/parse.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/parse.js @@ -2,6 +2,7 @@ var test = require('tape'); var qs = require('../'); +var iconv = require('iconv-lite'); test('parse()', function (t) { t.test('parses a simple string', function (st) { @@ -120,8 +121,11 @@ test('parse()', function (t) { st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } }); st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } }); st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] }); - st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c'), { a: { '0': 'b', t: 'u', c: true } }); - st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y'), { a: { '0': 'b', '1': 'c', x: 'y' } }); + + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: false }), { a: { '0': 'b', c: true, t: 'u' } }); + st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c', { allowPrototypes: true }), { a: { '0': 'b', t: 'u', hasOwnProperty: 'c' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: false }), { a: { '0': 'b', '1': 'c', x: 'y' } }); + st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y', { allowPrototypes: true }), { a: { '0': 'b', hasOwnProperty: 'c', x: 'y' } }); st.end(); }); @@ -173,14 +177,42 @@ test('parse()', function (t) { t.test('allows for empty strings in arrays', function (st) { st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] }); - st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true }), { a: ['b', null, 'c', ''] }); - st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true }), { a: ['b', '', 'c', null] }); - st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'), { a: ['', 'b', 'c'] }); + + st.deepEqual( + qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 20 + array indices: null then empty string works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]&a[]=c&a[]=', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', null, 'c', ''] }, + 'with arrayLimit 0 + array brackets: null then empty string works' + ); + + st.deepEqual( + qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true, arrayLimit: 20 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 20 + array indices: empty string then null works' + ); + st.deepEqual( + qs.parse('a[]=b&a[]=&a[]=c&a[]', { strictNullHandling: true, arrayLimit: 0 }), + { a: ['b', '', 'c', null] }, + 'with arrayLimit 0 + array brackets: empty string then null works' + ); + + st.deepEqual( + qs.parse('a[]=&a[]=b&a[]=c'), + { a: ['', 'b', 'c'] }, + 'array brackets: empty strings work' + ); st.end(); }); t.test('compacts sparse arrays', function (st) { st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] }); + st.deepEqual(qs.parse('a[1][b][2][c]=1'), { a: [{ b: [{ c: '1' }] }] }); + st.deepEqual(qs.parse('a[1][2][3][c]=1'), { a: [[[{ c: '1' }]]] }); + st.deepEqual(qs.parse('a[1][2][3][c][1]=1'), { a: [[[{ c: ['1'] }]]] }); st.end(); }); @@ -390,4 +422,30 @@ test('parse()', function (t) { st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray); st.end(); }); + + t.test('can parse with custom encoding', function (st) { + st.deepEqual(qs.parse('%8c%a7=%91%e5%8d%e3%95%7b', { + decoder: function (str) { + var reg = /\%([0-9A-F]{2})/ig; + var result = []; + var parts; + var last = 0; + while (parts = reg.exec(str)) { + result.push(parseInt(parts[1], 16)); + last = parts.index + parts[0].length; + } + return iconv.decode(new Buffer(result), 'shift_jis').toString(); + } + }), { 県: '大阪府' }); + st.end(); + }); + + t.test('throws error with wrong decoder', function (st) { + st.throws(function () { + qs.parse({}, { + decoder: 'string' + }); + }, new TypeError('Decoder has to be a function.')); + st.end(); + }); }); diff --git a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js index 508c2460b69081..699397e3346a9e 100755 --- a/deps/npm/node_modules/request/node_modules/qs/test/stringify.js +++ b/deps/npm/node_modules/request/node_modules/qs/test/stringify.js @@ -2,6 +2,7 @@ var test = require('tape'); var qs = require('../'); +var iconv = require('iconv-lite'); test('stringify()', function (t) { t.test('stringifies a querystring object', function (st) { @@ -65,6 +66,11 @@ test('stringify()', function (t) { st.end(); }); + t.test('stringifies an array with mixed objects and primitives', function (st) { + st.equal(qs.stringify({ a: [{ b: 1 }, 2, 3] }, { encode: false }), 'a[0][b]=1&a[1]=2&a[2]=3'); + st.end(); + }); + t.test('stringifies an object inside an array with dots notation', function (st) { st.equal(qs.stringify({ a: [{ b: 'c' }] }, { allowDots: true, encode: false }), 'a[0].b=c'); st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }, { allowDots: true, encode: false }), 'a[0].b.c[0]=1'); @@ -256,4 +262,44 @@ test('stringify()', function (t) { st.equal(qs.stringify({ a: 'a', z: { zj: {zjb: 'zjb', zja: 'zja'}, zi: {zib: 'zib', zia: 'zia'} }, b: 'b' }, { sort: null, encode: false }), 'a=a&z[zj][zjb]=zjb&z[zj][zja]=zja&z[zi][zib]=zib&z[zi][zia]=zia&b=b'); st.end(); }); + + t.test('can stringify with custom encoding', function (st) { + st.equal(qs.stringify({ 県: '大阪府', '': ''}, { + encoder: function (str) { + if (str.length === 0) { + return ''; + } + var buf = iconv.encode(str, 'shiftjis'); + var result = []; + for (var i=0; i < buf.length; ++i) { + result.push(buf.readUInt8(i).toString(16)); + } + return '%' + result.join('%'); + } + }), '%8c%a7=%91%e5%8d%e3%95%7b&='); + st.end(); + }); + + t.test('throws error with wrong encoder', function (st) { + st.throws(function () { + qs.stringify({}, { + encoder: 'string' + }); + }, new TypeError('Encoder has to be a function.')); + st.end(); + }); + + t.test('can use custom encoder for a buffer object', { + skip: typeof Buffer === 'undefined' + }, function (st) { + st.equal(qs.stringify({ a: new Buffer([1]) }, { + encoder: function (buffer) { + if (typeof buffer === 'string') { + return buffer; + } + return String.fromCharCode(buffer.readUInt8(0) + 97); + } + }), 'a=b'); + st.end(); + }); }); diff --git a/deps/npm/node_modules/request/node_modules/stringstream/package.json b/deps/npm/node_modules/request/node_modules/stringstream/package.json index 9ab3d820ddb754..514c18dc16a847 100644 --- a/deps/npm/node_modules/request/node_modules/stringstream/package.json +++ b/deps/npm/node_modules/request/node_modules/stringstream/package.json @@ -1,8 +1,16 @@ { "_args": [ [ - "stringstream@~0.0.4", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "stringstream@~0.0.4", + "scope": null, + "escapedName": "stringstream", + "name": "stringstream", + "rawSpec": "~0.0.4", + "spec": ">=0.0.4 <0.1.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "stringstream@>=0.0.4 <0.1.0", @@ -12,16 +20,17 @@ "_location": "/request/stringstream", "_nodeVersion": "4.2.1", "_npmUser": { - "email": "michael.hart.au@gmail.com", - "name": "hichaelmart" + "name": "hichaelmart", + "email": "michael.hart.au@gmail.com" }, "_npmVersion": "2.14.8", "_phantomChildren": {}, "_requested": { - "name": "stringstream", "raw": "stringstream@~0.0.4", - "rawSpec": "~0.0.4", "scope": null, + "escapedName": "stringstream", + "name": "stringstream", + "rawSpec": "~0.0.4", "spec": ">=0.0.4 <0.1.0", "type": "range" }, @@ -32,10 +41,10 @@ "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", "_shrinkwrap": null, "_spec": "stringstream@~0.0.4", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "michael.hart.au@gmail.com", "name": "Michael Hart", + "email": "michael.hart.au@gmail.com", "url": "http://github.com/mhart" }, "bugs": { @@ -47,15 +56,15 @@ "directories": {}, "dist": { "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878", - "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" + "tarball": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz" }, "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b", "homepage": "https://github.com/mhart/StringStream#readme", "keywords": [ - "base64", - "gzip", + "string", "stream", - "string" + "base64", + "gzip" ], "license": "MIT", "main": "stringstream.js", diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md index 9899dbf6eed156..126f222b904646 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/README.md +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/README.md @@ -1,9 +1,8 @@ [RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js -[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) +[![npm package](https://nodei.co/npm/tough-cookie.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/tough-cookie/) -[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie) -![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9) +[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie) # Synopsis @@ -30,6 +29,10 @@ It's _so_ easy! Why the name? NPM modules `cookie`, `cookies` and `cookiejar` were already taken. +## Version Support + +Support for versions of node.js will follow that of the [request](https://www.npmjs.com/package/request) module. + # API ## tough @@ -426,6 +429,17 @@ Inherits from `Store`. A just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API. +## Community Cookie Stores + +These are some Store implementations authored and maintained by the community. They aren't official and we don't vouch for them but you may be interested to have a look: + +- [`db-cookie-store`](https://github.com/JSBizon/db-cookie-store): SQL including SQLite-based databases +- [`file-cookie-store`](https://github.com/JSBizon/file-cookie-store): Netscape cookie file format on disk +- [`redis-cookie-store`](https://github.com/benkroeger/redis-cookie-store): Redis +- [`tough-cookie-filestore`](https://github.com/mitsuru/tough-cookie-filestore): JSON on disk +- [`tough-cookie-web-storage-store`](https://github.com/exponentjs/tough-cookie-web-storage-store): DOM localStorage and sessionStorage + + # Serialization Format **NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`. diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js index 12da297ac4d20f..c3dacfe44a3f2a 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/lib/cookie.js @@ -68,9 +68,6 @@ var LOOSE_COOKIE_PAIR = /^((?:=)?([^=;]*)\s*=\s*)?([^\n\r\0]*)/; // Note ';' is \x3B var PATH_VALUE = /[\x20-\x3A\x3C-\x7E]+/; -// Used for checking whether or not there is a trailing semi-colon -var TRAILING_SEMICOLON = /;+$/; - var DAY_OF_MONTH = /^(\d{1,2})[^\d]*$/; var TIME = /^(\d{1,2})[^\d]*:(\d{1,2})[^\d]*:(\d{1,2})[^\d]*$/; var MONTH = /^(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)/i; @@ -327,12 +324,6 @@ function parse(str, options) { } str = str.trim(); - // S4.1.1 Trailing semi-colons are not part of the specification. - var semiColonCheck = TRAILING_SEMICOLON.exec(str); - if (semiColonCheck) { - str = str.slice(0, semiColonCheck.index); - } - // We use a regex to parse the "name-value-pair" part of S5.2 var firstSemi = str.indexOf(';'); // S5.2 step 1 var pairRe = options.loose ? LOOSE_COOKIE_PAIR : COOKIE_PAIR; @@ -362,7 +353,7 @@ function parse(str, options) { // S5.2.3 "unparsed-attributes consist of the remainder of the set-cookie-string // (including the %x3B (";") in question)." plus later on in the same section // "discard the first ";" and trim". - var unparsed = str.slice(firstSemi).replace(/^\s*;\s*/,'').trim(); + var unparsed = str.slice(firstSemi + 1).trim(); // "If the unparsed-attributes string is empty, skip the rest of these // steps." @@ -378,9 +369,12 @@ function parse(str, options) { * cookie-attribute-list". Therefore, in this implementation, we overwrite * the previous value. */ - var cookie_avs = unparsed.split(/\s*;\s*/); + var cookie_avs = unparsed.split(';'); while (cookie_avs.length) { - var av = cookie_avs.shift(); + var av = cookie_avs.shift().trim(); + if (av.length === 0) { // happens if ";;" appears + continue; + } var av_sep = av.indexOf('='); var av_key, av_value; diff --git a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json index 565dbe191469f9..ca65ee5216cf2b 100644 --- a/deps/npm/node_modules/request/node_modules/tough-cookie/package.json +++ b/deps/npm/node_modules/request/node_modules/tough-cookie/package.json @@ -1,45 +1,54 @@ { "_args": [ [ - "tough-cookie@~2.2.0", + { + "raw": "tough-cookie@~2.3.0", + "scope": null, + "escapedName": "tough-cookie", + "name": "tough-cookie", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", + "type": "range" + }, "/Users/rebecca/code/npm/node_modules/request" ] ], - "_from": "tough-cookie@>=2.2.0 <2.3.0", - "_id": "tough-cookie@2.2.2", + "_from": "tough-cookie@>=2.3.0 <2.4.0", + "_id": "tough-cookie@2.3.1", "_inCache": true, "_installable": true, "_location": "/request/tough-cookie", - "_nodeVersion": "5.1.1", + "_nodeVersion": "6.3.1", "_npmOperationalInternal": { - "host": "packages-13-west.internal.npmjs.com", - "tmp": "tmp/tough-cookie-2.2.2.tgz_1457564639182_0.5129188685677946" + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/tough-cookie-2.3.1.tgz_1469494891088_0.8524557144846767" }, "_npmUser": { - "email": "jstash@gmail.com", - "name": "jstash" + "name": "jstash", + "email": "jstash@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "3.10.3", "_phantomChildren": {}, "_requested": { - "name": "tough-cookie", - "raw": "tough-cookie@~2.2.0", - "rawSpec": "~2.2.0", + "raw": "tough-cookie@~2.3.0", "scope": null, - "spec": ">=2.2.0 <2.3.0", + "escapedName": "tough-cookie", + "name": "tough-cookie", + "rawSpec": "~2.3.0", + "spec": ">=2.3.0 <2.4.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz", - "_shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7", + "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz", + "_shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", "_shrinkwrap": null, - "_spec": "tough-cookie@~2.2.0", + "_spec": "tough-cookie@~2.3.0", "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "jstashewsky@salesforce.com", - "name": "Jeremy Stashewsky" + "name": "Jeremy Stashewsky", + "email": "jstashewsky@salesforce.com" }, "bugs": { "url": "https://github.com/SalesforceEng/tough-cookie/issues" @@ -68,20 +77,21 @@ "description": "RFC6265 Cookies and Cookie Jar for node.js", "devDependencies": { "async": "^1.4.2", + "string.prototype.repeat": "^0.2.0", "vows": "^0.8.1" }, "directories": {}, "dist": { - "shasum": "c83a1830f4e5ef0b93ef2a3488e724f8de016ac7", - "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.2.tgz" + "shasum": "99c77dfbb7d804249e8a299d4cb0fd81fef083fd", + "tarball": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.1.tgz" }, "engines": { - "node": ">=0.10.0" + "node": ">=0.8" }, "files": [ "lib" ], - "gitHead": "cc46628c4d7d2e8c372ecba29293ca8a207ec192", + "gitHead": "c11a2d11d12348a35ef595c809e30e641a804a7d", "homepage": "https://github.com/SalesforceEng/tough-cookie", "keywords": [ "HTTP", @@ -97,12 +107,12 @@ "main": "./lib/cookie", "maintainers": [ { - "email": "jeremy@goinstant.com", - "name": "jstash" + "name": "jstash", + "email": "jstash@gmail.com" }, { - "email": "services@goinstant.com", - "name": "goinstant" + "name": "nexxy", + "email": "emily@contactvibe.com" } ], "name": "tough-cookie", @@ -116,5 +126,5 @@ "suffixup": "curl -o public_suffix_list.dat https://publicsuffix.org/list/public_suffix_list.dat && ./generate-pubsuffix.js", "test": "vows test/*_test.js" }, - "version": "2.2.2" + "version": "2.3.1" } diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js index 177adb378b53e0..68013ac1f4ef33 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/index.js @@ -118,7 +118,7 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { var placeholder = {} self.sockets.push(placeholder) - var connectOptions = mergeOptions({}, self.proxyOptions, + var connectOptions = mergeOptions({}, self.proxyOptions, { method: 'CONNECT' , path: options.host + ':' + options.port , agent: false @@ -183,7 +183,7 @@ TunnelingAgent.prototype.createSocket = function createSocket(options, cb) { TunnelingAgent.prototype.removeSocket = function removeSocket(socket) { var pos = this.sockets.indexOf(socket) if (pos === -1) return - + this.sockets.splice(pos, 1) var pending = this.requests.shift() @@ -198,7 +198,7 @@ function createSecureSocket(options, cb) { var self = this TunnelingAgent.prototype.createSocket.call(self, options, function(socket) { // 0 is dummy port for v0.6 - var secureSocket = tls.connect(0, mergeOptions({}, self.options, + var secureSocket = tls.connect(0, mergeOptions({}, self.options, { servername: options.host , socket: socket } diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json index 0b2f3110ab3927..9c1a5262cade43 100644 --- a/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json +++ b/deps/npm/node_modules/request/node_modules/tunnel-agent/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "tunnel-agent@~0.4.1", - "/Users/ogd/Documents/projects/npm/npm/node_modules/request" + { + "raw": "tunnel-agent@~0.4.1", + "scope": null, + "escapedName": "tunnel-agent", + "name": "tunnel-agent", + "rawSpec": "~0.4.1", + "spec": ">=0.4.1 <0.5.0", + "type": "range" + }, + "/Users/rebecca/code/npm/node_modules/request" ] ], "_from": "tunnel-agent@>=0.4.1 <0.5.0", - "_id": "tunnel-agent@0.4.2", + "_id": "tunnel-agent@0.4.3", "_inCache": true, "_installable": true, "_location": "/request/tunnel-agent", - "_nodeVersion": "5.0.0", + "_nodeVersion": "5.9.0", + "_npmOperationalInternal": { + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/tunnel-agent-0.4.3.tgz_1462396470295_0.23639482469297945" + }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.3.12", + "_npmVersion": "2.15.3", "_phantomChildren": {}, "_requested": { - "name": "tunnel-agent", "raw": "tunnel-agent@~0.4.1", - "rawSpec": "~0.4.1", "scope": null, + "escapedName": "tunnel-agent", + "name": "tunnel-agent", + "rawSpec": "~0.4.1", "spec": ">=0.4.1 <0.5.0", "type": "range" }, "_requiredBy": [ "/request" ], - "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz", - "_shasum": "1104e3f36ac87125c287270067d582d18133bfee", + "_resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz", + "_shasum": "6373db76909fe570e08d73583365ed828a74eeeb", "_shrinkwrap": null, "_spec": "tunnel-agent@~0.4.1", - "_where": "/Users/ogd/Documents/projects/npm/npm/node_modules/request", + "_where": "/Users/rebecca/code/npm/node_modules/request", "author": { - "email": "mikeal.rogers@gmail.com", "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com", "url": "http://www.futurealoof.com" }, "bugs": { @@ -46,13 +59,16 @@ "devDependencies": {}, "directories": {}, "dist": { - "shasum": "1104e3f36ac87125c287270067d582d18133bfee", - "tarball": "http://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.2.tgz" + "shasum": "6373db76909fe570e08d73583365ed828a74eeeb", + "tarball": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.4.3.tgz" }, "engines": { "node": "*" }, - "gitHead": "449634d1054949f9f145f4925985a8dea0f46b0f", + "files": [ + "index.js" + ], + "gitHead": "e72d830f5ed388a2a71d37ce062c38e3fb34bdde", "homepage": "https://github.com/mikeal/tunnel-agent#readme", "license": "Apache-2.0", "main": "index.js", @@ -81,5 +97,5 @@ "url": "git+https://github.com/mikeal/tunnel-agent.git" }, "scripts": {}, - "version": "0.4.2" + "version": "0.4.3" } diff --git a/deps/npm/node_modules/request/package.json b/deps/npm/node_modules/request/package.json index 6c9fa0ec836af5..8e1c5b8a118203 100644 --- a/deps/npm/node_modules/request/package.json +++ b/deps/npm/node_modules/request/package.json @@ -1,51 +1,63 @@ { "_args": [ [ - "request@latest", + { + "raw": "request@~2.74.0", + "scope": null, + "escapedName": "request", + "name": "request", + "rawSpec": "~2.74.0", + "spec": ">=2.74.0 <2.75.0", + "type": "range" + }, "/Users/rebecca/code/npm" ] ], - "_from": "request@latest", - "_id": "request@2.72.0", + "_from": "request@>=2.74.0 <2.75.0", + "_id": "request@2.74.0", "_inCache": true, "_installable": true, "_location": "/request", - "_nodeVersion": "5.9.0", + "_nodeVersion": "6.2.2", "_npmOperationalInternal": { - "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/request-2.72.0.tgz_1460901215210_0.9173020373564214" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/request-2.74.0.tgz_1469231082306_0.13140005595050752" }, "_npmUser": { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" }, - "_npmVersion": "3.8.5", + "_npmVersion": "2.15.6", "_phantomChildren": { "ansi-regex": "2.0.0", "inherits": "2.0.1", "strip-ansi": "3.0.1" }, "_requested": { - "name": "request", - "raw": "request@latest", - "rawSpec": "latest", + "raw": "request@~2.74.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "request", + "name": "request", + "rawSpec": "~2.74.0", + "spec": ">=2.74.0 <2.75.0", + "type": "range" }, "_requiredBy": [ + "#USER", "/", "/node-gyp", - "/npm-registry-client" + "/npm-registry-client", + "/npm-registry-couchapp/couchapp", + "/npm-registry-couchapp/couchapp/nano" ], - "_resolved": "https://registry.npmjs.org/request/-/request-2.72.0.tgz", - "_shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1", + "_resolved": "https://registry.npmjs.org/request/-/request-2.74.0.tgz", + "_shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", "_shrinkwrap": null, - "_spec": "request@latest", + "_spec": "request@~2.74.0", "_where": "/Users/rebecca/code/npm", "author": { - "email": "mikeal.rogers@gmail.com", - "name": "Mikeal Rogers" + "name": "Mikeal Rogers", + "email": "mikeal.rogers@gmail.com" }, "bugs": { "url": "http://github.com/request/request/issues" @@ -58,7 +70,7 @@ "combined-stream": "~1.0.5", "extend": "~3.0.0", "forever-agent": "~0.6.1", - "form-data": "~1.0.0-rc3", + "form-data": "~1.0.0-rc4", "har-validator": "~2.0.6", "hawk": "~3.1.3", "http-signature": "~1.1.0", @@ -68,62 +80,62 @@ "mime-types": "~2.1.7", "node-uuid": "~1.4.7", "oauth-sign": "~0.8.1", - "qs": "~6.1.0", + "qs": "~6.2.0", "stringstream": "~0.0.4", - "tough-cookie": "~2.2.0", + "tough-cookie": "~2.3.0", "tunnel-agent": "~0.4.1" }, "description": "Simplified HTTP request client.", "devDependencies": { "bluebird": "^3.2.1", - "browserify": "^12.0.2", + "browserify": "^13.0.1", "browserify-istanbul": "^2.0.0", "buffer-equal": "^1.0.0", - "codecov.io": "^0.1.6", + "codecov": "^1.0.1", "coveralls": "^2.11.4", "eslint": "^2.5.3", "function-bind": "^1.0.2", "istanbul": "^0.4.0", - "karma": "^0.13.10", + "karma": "^1.1.1", "karma-browserify": "^5.0.1", - "karma-cli": "^0.1.1", - "karma-coverage": "^0.5.3", + "karma-cli": "^1.0.0", + "karma-coverage": "^1.0.0", "karma-phantomjs-launcher": "^1.0.0", - "karma-tap": "^1.0.3", + "karma-tap": "^2.0.1", "phantomjs-prebuilt": "^2.1.3", "rimraf": "^2.2.8", "server-destroy": "^1.0.1", - "tape": "^4.2.0", + "tape": "^4.6.0", "taper": "^0.4.0" }, "directories": {}, "dist": { - "shasum": "0ce3a179512620b10441f14c82e21c12c0ddb4e1", - "tarball": "https://registry.npmjs.org/request/-/request-2.72.0.tgz" + "shasum": "7693ca768bbb0ea5c8ce08c084a45efa05b892ab", + "tarball": "https://registry.npmjs.org/request/-/request-2.74.0.tgz" }, "engines": { "node": ">=0.8.0" }, - "gitHead": "6dcac13642955577592fdafb5ff3cdc8a6ff1b1b", + "gitHead": "76e82351cbc21049441b1763c6f2bbd504fa8f5a", "homepage": "https://github.com/request/request#readme", "license": "Apache-2.0", "main": "index.js", "maintainers": [ { - "email": "mikeal.rogers@gmail.com", - "name": "mikeal" + "name": "mikeal", + "email": "mikeal.rogers@gmail.com" }, { - "email": "jnylen@gmail.com", - "name": "nylen" + "name": "nylen", + "email": "jnylen@gmail.com" }, { - "email": "fkschott@gmail.com", - "name": "fredkschott" + "name": "fredkschott", + "email": "fkschott@gmail.com" }, { - "email": "simeonvelichkov@gmail.com", - "name": "simov" + "name": "simov", + "email": "simeonvelichkov@gmail.com" } ], "name": "request", @@ -146,5 +158,5 @@ "util", "utility" ], - "version": "2.72.0" + "version": "2.74.0" } diff --git a/deps/npm/node_modules/request/request.js b/deps/npm/node_modules/request/request.js index ac2cd8098f1045..8267c125375af4 100644 --- a/deps/npm/node_modules/request/request.js +++ b/deps/npm/node_modules/request/request.js @@ -9,6 +9,7 @@ var http = require('http') , bl = require('bl') , hawk = require('hawk') , aws2 = require('aws-sign2') + , aws4 = require('aws4') , httpSignature = require('http-signature') , mime = require('mime-types') , stringstream = require('stringstream') @@ -70,20 +71,6 @@ function filterOutReservedFunctions(reserved, options) { } -// Function for properly handling a connection error -function connectionErrorHandler(error) { - var socket = this - if (socket.res) { - if (socket.res.request) { - socket.res.request.emit('error', error) - } else { - socket.res.emit('error', error) - } - } else { - socket._httpMessage.emit('error', error) - } -} - // Return a simpler request object to allow serialization function requestToJSON() { var self = this @@ -335,7 +322,7 @@ Request.prototype.init = function (options) { var formData = options.formData var requestForm = self.form() var appendFormValue = function (key, value) { - if (value.hasOwnProperty('value') && value.hasOwnProperty('options')) { + if (value && value.hasOwnProperty('value') && value.hasOwnProperty('options')) { requestForm.append(key, value.value, value.options) } else { requestForm.append(key, value) @@ -804,11 +791,6 @@ Request.prototype.start = function () { self.emit('socket', socket) }) - self.on('end', function() { - if ( self.req.connection ) { - self.req.connection.removeListener('error', connectionErrorHandler) - } - }) self.emit('request', self.req) } @@ -843,11 +825,6 @@ Request.prototype.onRequestResponse = function (response) { debug('response end', self.uri.href, response.statusCode, response.headers) }) - // The check on response.connection is a workaround for browserify. - if (response.connection && response.connection.listeners('error').indexOf(connectionErrorHandler) === -1) { - response.connection.setMaxListeners(0) - response.connection.once('error', connectionErrorHandler) - } if (self._aborted) { debug('aborted', self.uri.href) response.resume() @@ -1266,7 +1243,6 @@ Request.prototype.aws = function (opts, now) { } if (opts.sign_version == 4 || opts.sign_version == '4') { - var aws4 = require('aws4') // use aws4 var options = { host: self.uri.host, diff --git a/deps/npm/node_modules/retry/Readme.md b/deps/npm/node_modules/retry/Readme.md index 26e50a3a7f3c6a..eee05f7bb61537 100644 --- a/deps/npm/node_modules/retry/Readme.md +++ b/deps/npm/node_modules/retry/Readme.md @@ -78,7 +78,7 @@ milliseconds. If `options` is an array, a copy of that array is returned. The formula used to calculate the individual timeouts is: ``` -var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout); +Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout) ``` Have a look at [this article][article] for a better explanation of approach. @@ -120,11 +120,11 @@ an array of method names which need to be wrapped. ``` retry.wrap(obj) -retry.wrap(obj, ['method1', 'method2']); +retry.wrap(obj, ['method1', 'method2']) -retry.wrap(obj, {retries: 3}); +retry.wrap(obj, {retries: 3}) -retry.wrap(obj, {retries: 3}, ['method1', 'method2']); +retry.wrap(obj, {retries: 3}, ['method1', 'method2']) ``` The `options` object can take any options that the usual call to `retry.operation` can take. @@ -139,7 +139,7 @@ Available options: If `forever` is true, the following changes happen: * `RetryOperation.errors()` will only output an array of one item: the last error. -* `RetryOperation` will repeatedly use the last item in the `timeouts` array. +* `RetryOperation` will repeatedly use the `timeouts` array. Once all of its timeouts have been used up, it restarts with the first timeout, then uses the second and so on. #### retryOperation.errors() @@ -181,6 +181,10 @@ has been reached. Otherwise it returns `true`, and retries the operation after the timeout for the current attempt number. +#### retryOperation.stop() + +Allows you to stop the operation being retried. Useful for aborting the operation on a fatal error etc. + #### retryOperation.attempts() Returns an int representing the number of attempts it took to call `fn` before it was successful. @@ -192,6 +196,10 @@ retry is licensed under the MIT license. # Changelog +0.10.0 Adding `stop` functionality, thanks to @maxnachlinger. + +0.9.0 Adding `unref` functionality, thanks to @satazor. + 0.8.0 Implementing retry.wrap. 0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13). diff --git a/deps/npm/node_modules/retry/example/dns.js b/deps/npm/node_modules/retry/example/dns.js index d6351e9d05bb33..446729b6f9af6b 100644 --- a/deps/npm/node_modules/retry/example/dns.js +++ b/deps/npm/node_modules/retry/example/dns.js @@ -28,4 +28,4 @@ faultTolerantResolve('nodejs.org', function(err, errors, addresses) { console.warn('addresses:'); console.log(addresses); -}); +}); \ No newline at end of file diff --git a/deps/npm/node_modules/retry/example/stop.js b/deps/npm/node_modules/retry/example/stop.js new file mode 100644 index 00000000000000..e1ceafeebafc51 --- /dev/null +++ b/deps/npm/node_modules/retry/example/stop.js @@ -0,0 +1,40 @@ +var retry = require('../lib/retry'); + +function attemptAsyncOperation(someInput, cb) { + var opts = { + retries: 2, + factor: 2, + minTimeout: 1 * 1000, + maxTimeout: 2 * 1000, + randomize: true + }; + var operation = retry.operation(opts); + + operation.attempt(function(currentAttempt) { + failingAsyncOperation(someInput, function(err, result) { + + if (err && err.message === 'A fatal error') { + operation.stop(); + return cb(err); + } + + if (operation.retry(err)) { + return; + } + + cb(operation.mainError(), operation.errors(), result); + }); + }); +} + +attemptAsyncOperation('test input', function(err, errors, result) { + console.warn('err:'); + console.log(err); + + console.warn('result:'); + console.log(result); +}); + +function failingAsyncOperation(input, cb) { + return setImmediate(cb.bind(null, new Error('A fatal error'))); +} diff --git a/deps/npm/node_modules/retry/lib/retry.js b/deps/npm/node_modules/retry/lib/retry.js index 02ab14729bd8b7..77428cfd0006fa 100644 --- a/deps/npm/node_modules/retry/lib/retry.js +++ b/deps/npm/node_modules/retry/lib/retry.js @@ -33,6 +33,10 @@ exports.timeouts = function(options) { timeouts.push(this.createTimeout(i, opts)); } + if (options && options.forever && !timeouts.length) { + timeouts.push(this.createTimeout(i, opts)); + } + // sort the array numerically ascending timeouts.sort(function(a,b) { return a - b; diff --git a/deps/npm/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/retry/lib/retry_operation.js index ad96efbdf3b02d..2b3db8e1776973 100644 --- a/deps/npm/node_modules/retry/lib/retry_operation.js +++ b/deps/npm/node_modules/retry/lib/retry_operation.js @@ -19,6 +19,15 @@ function RetryOperation(timeouts, options) { } module.exports = RetryOperation; +RetryOperation.prototype.stop = function() { + if (this._timeout) { + clearTimeout(this._timeout); + } + + this._timeouts = []; + this._cachedTimeouts = null; +}; + RetryOperation.prototype.retry = function(err) { if (this._timeout) { clearTimeout(this._timeout); diff --git a/deps/npm/node_modules/retry/package.json b/deps/npm/node_modules/retry/package.json index 9d2283a3986e54..73a2819edeeab9 100644 --- a/deps/npm/node_modules/retry/package.json +++ b/deps/npm/node_modules/retry/package.json @@ -1,41 +1,54 @@ { "_args": [ [ - "retry@latest", - "/Users/rebecca/code/npm" + { + "raw": "retry@0.10.0", + "scope": null, + "escapedName": "retry", + "name": "retry", + "rawSpec": "0.10.0", + "spec": "0.10.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "retry@latest", - "_id": "retry@0.9.0", + "_from": "retry@0.10.0", + "_id": "retry@0.10.0", "_inCache": true, - "_installable": true, "_location": "/retry", "_nodeVersion": "4.2.1", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/retry-0.10.0.tgz_1471682099847_0.5031970851123333" + }, "_npmUser": { - "email": "tim@debuggable.com", - "name": "tim-kos" + "name": "tim-kos", + "email": "tim@debuggable.com" }, "_npmVersion": "2.1.7", "_phantomChildren": {}, "_requested": { - "name": "retry", - "raw": "retry@latest", - "rawSpec": "latest", + "raw": "retry@0.10.0", "scope": null, - "spec": "latest", - "type": "tag" + "escapedName": "retry", + "name": "retry", + "rawSpec": "0.10.0", + "spec": "0.10.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_resolved": "https://registry.npmjs.org/retry/-/retry-0.9.0.tgz", - "_shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", + "_resolved": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz", + "_shasum": "649e15ca408422d98318161935e7f7d652d435dd", "_shrinkwrap": null, - "_spec": "retry@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "retry@0.10.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "tim@debuggable.com", "name": "Tim Koschützki", + "email": "tim@debuggable.com", "url": "http://debuggable.com/" }, "bugs": { @@ -51,13 +64,13 @@ "lib": "./lib" }, "dist": { - "shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d", - "tarball": "http://registry.npmjs.org/retry/-/retry-0.9.0.tgz" + "shasum": "649e15ca408422d98318161935e7f7d652d435dd", + "tarball": "https://registry.npmjs.org/retry/-/retry-0.10.0.tgz" }, "engines": { "node": "*" }, - "gitHead": "1b621cf499ef7647d005e3650006b93a8dbeb986", + "gitHead": "0616e6a6ebc49b5a36b619c8f7c414ced8c3813b", "homepage": "https://github.com/tim-kos/node-retry", "license": "MIT", "main": "index", @@ -75,5 +88,5 @@ "url": "git://github.com/tim-kos/node-retry.git" }, "scripts": {}, - "version": "0.9.0" + "version": "0.10.0" } diff --git a/deps/npm/node_modules/retry/test/integration/test-forever.js b/deps/npm/node_modules/retry/test/integration/test-forever.js new file mode 100644 index 00000000000000..b41307cb529f12 --- /dev/null +++ b/deps/npm/node_modules/retry/test/integration/test-forever.js @@ -0,0 +1,24 @@ +var common = require('../common'); +var assert = common.assert; +var retry = require(common.dir.lib + '/retry'); + +(function testForeverUsesFirstTimeout() { + var operation = retry.operation({ + retries: 0, + minTimeout: 100, + maxTimeout: 100, + forever: true + }); + + operation.attempt(function(numAttempt) { + console.log('>numAttempt', numAttempt); + var err = new Error("foo"); + if (numAttempt == 10) { + operation.stop(); + } + + if (operation.retry(err)) { + return; + } + }); +})(); diff --git a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js index cecfa3b7310013..916936424f073b 100644 --- a/deps/npm/node_modules/retry/test/integration/test-retry-operation.js +++ b/deps/npm/node_modules/retry/test/integration/test-retry-operation.js @@ -104,3 +104,73 @@ var retry = require(common.dir.lib + '/retry'); fn(); })(); + +(function testRetryForeverNoRetries() { + var error = new Error('some error'); + var delay = 50 + var operation = retry.operation({ + retries: null, + forever: true, + minTimeout: delay, + maxTimeout: delay + }); + + var attempts = 0; + var startTime = new Date().getTime(); + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + if (attempts !== 4 && operation.retry(error)) { + return; + } + + var endTime = new Date().getTime(); + var minTime = startTime + (delay * 3); + var maxTime = minTime + 20 // add a little headroom for code execution time + assert(endTime > minTime) + assert(endTime < maxTime) + assert.strictEqual(attempts, 4); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + }); + }; + + fn(); +})(); + +(function testStop() { + var error = new Error('some error'); + var operation = retry.operation([1, 2, 3]); + var attempts = 0; + + var finalCallback = fake.callback('finalCallback'); + fake.expectAnytime(finalCallback); + + var fn = function() { + operation.attempt(function(currentAttempt) { + attempts++; + assert.equal(currentAttempt, attempts); + + if (attempts === 2) { + operation.stop(); + + assert.strictEqual(attempts, 2); + assert.strictEqual(operation.attempts(), attempts); + assert.strictEqual(operation.mainError(), error); + finalCallback(); + } + + if (operation.retry(error)) { + return; + } + }); + }; + + fn(); +})(); diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index ccc09c5afd7a47..c4043f1eb37ecf 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,53 +1,59 @@ { "_args": [ [ - "rimraf@~2.5.1", + { + "raw": "rimraf@2.5.4", + "scope": null, + "escapedName": "rimraf", + "name": "rimraf", + "rawSpec": "2.5.4", + "spec": "2.5.4", + "type": "version" + }, "/Users/rebecca/code/npm" ] ], - "_from": "rimraf@>=2.5.1 <2.6.0", - "_id": "rimraf@2.5.2", + "_from": "rimraf@2.5.4", + "_id": "rimraf@2.5.4", "_inCache": true, "_installable": true, "_location": "/rimraf", - "_nodeVersion": "5.6.0", + "_nodeVersion": "4.4.4", "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/rimraf-2.5.2.tgz_1455346499772_0.9326622514054179" + "host": "packages-16-east.internal.npmjs.com", + "tmp": "tmp/rimraf-2.5.4.tgz_1469206941888_0.8645927573088557" }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.7.0", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "rimraf", - "raw": "rimraf@~2.5.1", - "rawSpec": "~2.5.1", + "raw": "rimraf@2.5.4", "scope": null, - "spec": ">=2.5.1 <2.6.0", - "type": "range" + "escapedName": "rimraf", + "name": "rimraf", + "rawSpec": "2.5.4", + "spec": "2.5.4", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/fs-vacuum", "/fstream", "/node-gyp", - "/npm-registry-client", - "/standard/standard-engine/eslint/file-entry-cache/flat-cache/del", - "/tacks", - "/tap/nyc", - "/tap/nyc/spawn-wrap" + "/npm-registry-client" ], - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz", - "_shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", + "_shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", "_shrinkwrap": null, - "_spec": "rimraf@~2.5.1", + "_spec": "rimraf@2.5.4", "_where": "/Users/rebecca/code/npm", "author": { - "email": "i@izs.me", "name": "Isaac Z. Schlueter", + "email": "i@izs.me", "url": "http://blog.izs.me/" }, "bin": { @@ -57,17 +63,17 @@ "url": "https://github.com/isaacs/rimraf/issues" }, "dependencies": { - "glob": "^7.0.0" + "glob": "^7.0.5" }, "description": "A deep deletion module for node (like `rm -rf`)", "devDependencies": { "mkdirp": "^0.5.1", - "tap": "^5.1.1" + "tap": "^6.1.1" }, "directories": {}, "dist": { - "shasum": "62ba947fa4c0b4363839aefecd4f0fbad6059726", - "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.2.tgz" + "shasum": "96800093cbf1a0c86bd95b4625467535c29dfa04", + "tarball": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz" }, "files": [ "LICENSE", @@ -75,14 +81,14 @@ "bin.js", "rimraf.js" ], - "gitHead": "f414f87021f88d004ac487eebc8d07ce6a152721", + "gitHead": "2af08bbbd0a03549b278414309dc5d8097699443", "homepage": "https://github.com/isaacs/rimraf#readme", "license": "ISC", "main": "rimraf.js", "maintainers": [ { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" } ], "name": "rimraf", @@ -95,5 +101,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "2.5.2" + "version": "2.5.4" } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index c01d13b200cc5e..5d9a5768a454dd 100644 --- a/deps/npm/node_modules/rimraf/rimraf.js +++ b/deps/npm/node_modules/rimraf/rimraf.js @@ -48,9 +48,9 @@ function rimraf (p, options, cb) { assert(p, 'rimraf: missing path') assert.equal(typeof p, 'string', 'rimraf: path should be a string') - assert(options, 'rimraf: missing options') - assert.equal(typeof options, 'object', 'rimraf: options should be object') assert.equal(typeof cb, 'function', 'rimraf: callback function required') + assert(options, 'rimraf: invalid options argument provided') + assert.equal(typeof options, 'object', 'rimraf: options should be object') defaults(options) @@ -61,7 +61,7 @@ function rimraf (p, options, cb) { if (options.disableGlob || !glob.hasMagic(p)) return afterGlob(null, [p]) - fs.lstat(p, function (er, stat) { + options.lstat(p, function (er, stat) { if (!er) return afterGlob(null, [p]) @@ -135,6 +135,10 @@ function rimraf_ (p, options, cb) { if (er && er.code === "ENOENT") return cb(null) + // Windows can EPERM on stat. Life is suffering. + if (er && er.code === "EPERM" && isWindows) + fixWinEPERM(p, options, er, cb) + if (st && st.isDirectory()) return rmdir(p, options, er, cb) @@ -269,7 +273,7 @@ function rimrafSync (p, options) { results = [p] } else { try { - fs.lstatSync(p) + options.lstatSync(p) results = [p] } catch (er) { results = glob.sync(p, options.glob) @@ -287,6 +291,10 @@ function rimrafSync (p, options) { } catch (er) { if (er.code === "ENOENT") return + + // Windows can EPERM on stat. Life is suffering. + if (er.code === "EPERM" && isWindows) + fixWinEPERMSync(p, options, er) } try { diff --git a/deps/npm/node_modules/semver/.npmignore b/deps/npm/node_modules/semver/.npmignore deleted file mode 100644 index 534108e3f481cf..00000000000000 --- a/deps/npm/node_modules/semver/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -node_modules/ -coverage/ -.nyc_output/ -nyc_output/ diff --git a/deps/npm/node_modules/semver/.travis.yml b/deps/npm/node_modules/semver/.travis.yml deleted file mode 100644 index 991d04b6e2272b..00000000000000 --- a/deps/npm/node_modules/semver/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/deps/npm/node_modules/semver/README.md b/deps/npm/node_modules/semver/README.md index 0b14a7e8103b07..cbd956549dbb01 100644 --- a/deps/npm/node_modules/semver/README.md +++ b/deps/npm/node_modules/semver/README.md @@ -4,6 +4,8 @@ semver(1) -- The semantic versioner for npm ## Usage $ npm install semver + $ node + var semver = require('semver') semver.valid('1.2.3') // '1.2.3' semver.valid('a.b.c') // null @@ -16,18 +18,35 @@ As a command-line utility: $ semver -h - Usage: semver [ [...]] [-r | -i | --preid | -l | -rv] - Test if version(s) satisfy the supplied range(s), and sort them. + SemVer 5.1.0 - Multiple versions or ranges may be supplied, unless increment - option is specified. In that case, only a single version may - be used, and it is incremented by the specified level + A JavaScript implementation of the http://semver.org/ specification + Copyright Isaac Z. Schlueter + + Usage: semver [options] [ [...]] + Prints valid versions sorted by SemVer precedence + + Options: + -r --range + Print versions that match the specified range. + + -i --increment [] + Increment a version by the specified level. Level can + be one of: major, minor, patch, premajor, preminor, + prepatch, or prerelease. Default level is 'patch'. + Only one version may be specified. + + --preid + Identifier to be used to prefix premajor, preminor, + prepatch or prerelease version increments. + + -l --loose + Interpret versions and ranges loosely Program exits successfully if any valid version satisfies all supplied ranges, and prints all satisfying versions. - If no versions are valid, or ranges are not satisfied, - then exits failure. + If no satisfying versions are found, then exits failure. Versions are printed in ascending order, so supplying multiple versions to the utility will just sort them. @@ -242,7 +261,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? @@ -272,6 +291,8 @@ strings that they parse. same as `prepatch`. It increments the patch version, then makes a prerelease. If the input version is already a prerelease it simply increments it. +* `prerelease(v)`: Returns an array of prerelease components, or null + if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]` * `major(v)`: Return the major version number. * `minor(v)`: Return the minor version number. * `patch(v)`: Return the patch version number. @@ -306,6 +327,8 @@ strings that they parse. range. * `maxSatisfying(versions, range)`: Return the highest version in the list that satisfies the range, or `null` if none of them do. +* `minSatisfying(versions, range)`: Return the lowest version in the list + that satisfies the range, or `null` if none of them do. * `gtr(version, range)`: Return `true` if version is greater than all the versions possible in the range. * `ltr(version, range)`: Return `true` if version is less than all the diff --git a/deps/npm/node_modules/semver/package.json b/deps/npm/node_modules/semver/package.json index b1dfe4040c7bac..ae806605aed01c 100644 --- a/deps/npm/node_modules/semver/package.json +++ b/deps/npm/node_modules/semver/package.json @@ -1,31 +1,44 @@ { "_args": [ [ - "semver@~5.1.0", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "semver@5.3.0", + "scope": null, + "escapedName": "semver", + "name": "semver", + "rawSpec": "5.3.0", + "spec": "5.3.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "semver@>=5.1.0 <5.2.0", - "_id": "semver@5.1.0", + "_from": "semver@5.3.0", + "_id": "semver@5.3.0", "_inCache": true, - "_installable": true, "_location": "/semver", - "_nodeVersion": "4.0.0", + "_nodeVersion": "4.4.4", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/semver-5.3.0.tgz_1468515166602_0.9155273644719273" + }, "_npmUser": { - "email": "i@izs.me", - "name": "isaacs" + "name": "isaacs", + "email": "i@izs.me" }, - "_npmVersion": "3.3.2", + "_npmVersion": "3.10.6", "_phantomChildren": {}, "_requested": { - "name": "semver", - "raw": "semver@~5.1.0", - "rawSpec": "~5.1.0", + "raw": "semver@5.3.0", "scope": null, - "spec": ">=5.1.0 <5.2.0", - "type": "range" + "escapedName": "semver", + "name": "semver", + "rawSpec": "5.3.0", + "spec": "5.3.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/", "/init-package-json", "/node-gyp", @@ -35,11 +48,11 @@ "/npm-registry-client", "/read-installed" ], - "_resolved": "https://registry.npmjs.org/semver/-/semver-5.1.0.tgz", - "_shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", + "_resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "_shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f", "_shrinkwrap": null, - "_spec": "semver@~5.1.0", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "semver@5.3.0", + "_where": "/Users/zkat/Documents/code/npm", "bin": { "semver": "./bin/semver" }, @@ -53,10 +66,15 @@ }, "directories": {}, "dist": { - "shasum": "85f2cf8550465c4df000cf7d86f6b054106ab9e5", - "tarball": "http://registry.npmjs.org/semver/-/semver-5.1.0.tgz" + "shasum": "9b2ce5d3de02d17c6012ad326aa6b4d0cf54f94f", + "tarball": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz" }, - "gitHead": "8e33a30e62e40e4983d1c5f55e794331b861aadc", + "files": [ + "bin", + "range.bnf", + "semver.js" + ], + "gitHead": "d21444a0658224b152ce54965d02dbe0856afb84", "homepage": "https://github.com/npm/node-semver#readme", "license": "ISC", "main": "semver.js", @@ -80,5 +98,5 @@ "scripts": { "test": "tap test/*.js" }, - "version": "5.1.0" + "version": "5.3.0" } diff --git a/deps/npm/node_modules/semver/range.bnf b/deps/npm/node_modules/semver/range.bnf index 000df923a6963f..25ebd5c8325488 100644 --- a/deps/npm/node_modules/semver/range.bnf +++ b/deps/npm/node_modules/semver/range.bnf @@ -6,7 +6,7 @@ simple ::= primitive | partial | tilde | caret primitive ::= ( '<' | '>' | '>=' | '<=' | '=' | ) partial partial ::= xr ( '.' xr ( '.' xr qualifier ? )? )? xr ::= 'x' | 'X' | '*' | nr -nr ::= '0' | ['1'-'9']['0'-'9']+ +nr ::= '0' | ['1'-'9'] ( ['0'-'9'] ) * tilde ::= '~' partial caret ::= '^' partial qualifier ::= ( '-' pre )? ( '+' build )? diff --git a/deps/npm/node_modules/semver/semver.js b/deps/npm/node_modules/semver/semver.js index 71795f6f0720ae..5f1a3c5c9e5dc9 100644 --- a/deps/npm/node_modules/semver/semver.js +++ b/deps/npm/node_modules/semver/semver.js @@ -314,9 +314,9 @@ function SemVer(version, loose) { else this.prerelease = m[4].split('.').map(function(id) { if (/^[0-9]+$/.test(id)) { - var num = +id + var num = +id; if (num >= 0 && num < MAX_SAFE_INTEGER) - return num + return num; } return id; }); @@ -836,7 +836,7 @@ function replaceTilde(comp, loose) { else if (isX(m)) ret = '>=' + M + '.0.0 <' + (+M + 1) + '.0.0'; else if (isX(p)) - // ~1.2 == >=1.2.0- <1.3.0- + // ~1.2 == >=1.2.0 <1.3.0 ret = '>=' + M + '.' + m + '.0 <' + M + '.' + (+m + 1) + '.0'; else if (pr) { debug('replaceTilde pr', pr); @@ -966,11 +966,11 @@ function replaceXRange(comp, loose) { } else if (gtlt === '<=') { // <=0.7.x is actually <0.8.0, since any 0.7.x should // pass. Similarly, <=7.x is actually <8.0.0, etc. - gtlt = '<' + gtlt = '<'; if (xm) - M = +M + 1 + M = +M + 1; else - m = +m + 1 + m = +m + 1; } ret = gtlt + M + '.' + m + '.' + p; @@ -1094,6 +1094,15 @@ function maxSatisfying(versions, range, loose) { })[0] || null; } +exports.minSatisfying = minSatisfying; +function minSatisfying(versions, range, loose) { + return versions.filter(function(version) { + return satisfies(version, range, loose); + }).sort(function(a, b) { + return compare(a, b, loose); + })[0] || null; +} + exports.validRange = validRange; function validRange(range, loose) { try { @@ -1186,3 +1195,9 @@ function outside(version, range, hilo, loose) { } return true; } + +exports.prerelease = prerelease; +function prerelease(version, loose) { + var parsed = parse(version, loose); + return (parsed && parsed.prerelease.length) ? parsed.prerelease : null; +} diff --git a/deps/npm/node_modules/semver/test/big-numbers.js b/deps/npm/node_modules/semver/test/big-numbers.js deleted file mode 100644 index c051864bc978c2..00000000000000 --- a/deps/npm/node_modules/semver/test/big-numbers.js +++ /dev/null @@ -1,31 +0,0 @@ -var test = require('tap').test -var semver = require('../') - -test('long version is too long', function (t) { - var v = '1.2.' + new Array(256).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('big number is like too long version', function (t) { - var v = '1.2.' + new Array(100).join('1') - t.throws(function () { - new semver.SemVer(v) - }) - t.equal(semver.valid(v, false), null) - t.equal(semver.valid(v, true), null) - t.equal(semver.inc(v, 'patch'), null) - t.end() -}) - -test('parsing null does not throw', function (t) { - t.equal(semver.parse(null), null) - t.equal(semver.parse({}), null) - t.equal(semver.parse(new semver.SemVer('1.2.3')).version, '1.2.3') - t.end() -}) diff --git a/deps/npm/node_modules/semver/test/clean.js b/deps/npm/node_modules/semver/test/clean.js deleted file mode 100644 index 9e268de950ce8c..00000000000000 --- a/deps/npm/node_modules/semver/test/clean.js +++ /dev/null @@ -1,29 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var clean = semver.clean; - -test('\nclean tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', '1.2.3'], - [' 1.2.3 ', '1.2.3'], - [' 1.2.3-4 ', '1.2.3-4'], - [' 1.2.3-pre ', '1.2.3-pre'], - [' =v1.2.3 ', '1.2.3'], - ['v1.2.3', '1.2.3'], - [' v1.2.3 ', '1.2.3'], - ['\t1.2.3', '1.2.3'], - ['>1.2.3', null], - ['~1.2.3', null], - ['<=1.2.3', null], - ['1.2.x', null] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var msg = 'clean(' + range + ') = ' + version; - t.equal(clean(range), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/gtr.js b/deps/npm/node_modules/semver/test/gtr.js deleted file mode 100644 index bbb87896c64fbb..00000000000000 --- a/deps/npm/node_modules/semver/test/gtr.js +++ /dev/null @@ -1,173 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var gtr = semver.gtr; - -test('\ngtr tests', function(t) { - // [range, version, loose] - // Version should be greater than range - [ - ['~1.2.2', '1.3.0'], - ['~0.6.1-1', '0.7.1-1'], - ['1.0.0 - 2.0.0', '2.0.1'], - ['1.0.0', '1.0.1-beta1'], - ['1.0.0', '2.0.0'], - ['<=2.0.0', '2.1.1'], - ['<=2.0.0', '3.2.9'], - ['<2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '1.2.5'], - ['2.x.x', '3.0.0'], - ['1.2.x', '1.3.0'], - ['1.2.x || 2.x', '3.0.0'], - ['2.*.*', '5.0.1'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '4.0.0'], - ['2', '3.0.0'], - ['2.3', '2.4.2'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.5.5'], - ['~>3.2.1', '3.3.0'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.4'], - ['~> 1', '3.2.3'], - ['~1.0', '1.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.1.0'], - ['<1.2', '1.2.0'], - ['< 1.2', '1.2.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-pre', '0.6.0'], - ['~v0.5.4-pre', '0.6.1-pre'], - ['=0.7.x', '0.8.0'], - ['=0.7.x', '0.8.0-asdf'], - ['<0.7.x', '0.7.0'], - ['~1.2.2', '1.3.0'], - ['1.0.0 - 2.0.0', '2.2.3'], - ['1.0.0', '1.0.1'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['2', '3.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~1', '2.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['1', '2.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['=0.7.x', '0.8.2'], - ['<0.7.x', '0.7.2'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(gtr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative gtr tests', function(t) { - // [range, version, loose] - // Version should NOT be greater than range - [ - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '0.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['*', 'v1.2.3-foo'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['1', '1.0.0beta', true], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^1', '0.0.0-0'], - ['^3.0.0', '2.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!gtr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(gtr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/index.js b/deps/npm/node_modules/semver/test/index.js deleted file mode 100644 index 47c3f5f9513103..00000000000000 --- a/deps/npm/node_modules/semver/test/index.js +++ /dev/null @@ -1,698 +0,0 @@ -'use strict'; - -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var eq = semver.eq; -var gt = semver.gt; -var lt = semver.lt; -var neq = semver.neq; -var cmp = semver.cmp; -var gte = semver.gte; -var lte = semver.lte; -var satisfies = semver.satisfies; -var validRange = semver.validRange; -var inc = semver.inc; -var diff = semver.diff; -var replaceStars = semver.replaceStars; -var toComparators = semver.toComparators; -var SemVer = semver.SemVer; -var Range = semver.Range; - -test('\ncomparison tests', function(t) { - // [version1, version2] - // version1 should be greater than version2 - [['0.0.0', '0.0.0-foo'], - ['0.0.1', '0.0.0'], - ['1.0.0', '0.9.9'], - ['0.10.0', '0.9.0'], - ['0.99.0', '0.10.0'], - ['2.0.0', '1.2.3'], - ['v0.0.0', '0.0.0-foo', true], - ['v0.0.1', '0.0.0', true], - ['v1.0.0', '0.9.9', true], - ['v0.10.0', '0.9.0', true], - ['v0.99.0', '0.10.0', true], - ['v2.0.0', '1.2.3', true], - ['0.0.0', 'v0.0.0-foo', true], - ['0.0.1', 'v0.0.0', true], - ['1.0.0', 'v0.9.9', true], - ['0.10.0', 'v0.9.0', true], - ['0.99.0', 'v0.10.0', true], - ['2.0.0', 'v1.2.3', true], - ['1.2.3', '1.2.3-asdf'], - ['1.2.3', '1.2.3-4'], - ['1.2.3', '1.2.3-4-foo'], - ['1.2.3-5-foo', '1.2.3-5'], - ['1.2.3-5', '1.2.3-4'], - ['1.2.3-5-foo', '1.2.3-5-Foo'], - ['3.0.0', '2.7.2+asdf'], - ['1.2.3-a.10', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a.5'], - ['1.2.3-a.b', '1.2.3-a'], - ['1.2.3-a.b.c.10.d.5', '1.2.3-a.b.c.5.d.100'], - ['1.2.3-r2', '1.2.3-r100'], - ['1.2.3-r100', '1.2.3-R2'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(gt(v0, v1, loose), "gt('" + v0 + "', '" + v1 + "')"); - t.ok(lt(v1, v0, loose), "lt('" + v1 + "', '" + v0 + "')"); - t.ok(!gt(v1, v0, loose), "!gt('" + v1 + "', '" + v0 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(eq(v0, v0, loose), "eq('" + v0 + "', '" + v0 + "')"); - t.ok(eq(v1, v1, loose), "eq('" + v1 + "', '" + v1 + "')"); - t.ok(neq(v0, v1, loose), "neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v1, '==', v1, loose), "cmp('" + v1 + "' == '" + v1 + "')"); - t.ok(cmp(v0, '>=', v1, loose), "cmp('" + v0 + "' >= '" + v1 + "')"); - t.ok(cmp(v1, '<=', v0, loose), "cmp('" + v1 + "' <= '" + v0 + "')"); - t.ok(cmp(v0, '!=', v1, loose), "cmp('" + v0 + "' != '" + v1 + "')"); - }); - t.end(); -}); - -test('\nequality tests', function(t) { - // [version1, version2] - // version1 should be equivalent to version2 - [['1.2.3', 'v1.2.3', true], - ['1.2.3', '=1.2.3', true], - ['1.2.3', 'v 1.2.3', true], - ['1.2.3', '= 1.2.3', true], - ['1.2.3', ' v1.2.3', true], - ['1.2.3', ' =1.2.3', true], - ['1.2.3', ' v 1.2.3', true], - ['1.2.3', ' = 1.2.3', true], - ['1.2.3-0', 'v1.2.3-0', true], - ['1.2.3-0', '=1.2.3-0', true], - ['1.2.3-0', 'v 1.2.3-0', true], - ['1.2.3-0', '= 1.2.3-0', true], - ['1.2.3-0', ' v1.2.3-0', true], - ['1.2.3-0', ' =1.2.3-0', true], - ['1.2.3-0', ' v 1.2.3-0', true], - ['1.2.3-0', ' = 1.2.3-0', true], - ['1.2.3-1', 'v1.2.3-1', true], - ['1.2.3-1', '=1.2.3-1', true], - ['1.2.3-1', 'v 1.2.3-1', true], - ['1.2.3-1', '= 1.2.3-1', true], - ['1.2.3-1', ' v1.2.3-1', true], - ['1.2.3-1', ' =1.2.3-1', true], - ['1.2.3-1', ' v 1.2.3-1', true], - ['1.2.3-1', ' = 1.2.3-1', true], - ['1.2.3-beta', 'v1.2.3-beta', true], - ['1.2.3-beta', '=1.2.3-beta', true], - ['1.2.3-beta', 'v 1.2.3-beta', true], - ['1.2.3-beta', '= 1.2.3-beta', true], - ['1.2.3-beta', ' v1.2.3-beta', true], - ['1.2.3-beta', ' =1.2.3-beta', true], - ['1.2.3-beta', ' v 1.2.3-beta', true], - ['1.2.3-beta', ' = 1.2.3-beta', true], - ['1.2.3-beta+build', ' = 1.2.3-beta+otherbuild', true], - ['1.2.3+build', ' = 1.2.3+otherbuild', true], - ['1.2.3-beta+build', '1.2.3-beta+otherbuild'], - ['1.2.3+build', '1.2.3+otherbuild'], - [' v1.2.3+build', '1.2.3+otherbuild'] - ].forEach(function(v) { - var v0 = v[0]; - var v1 = v[1]; - var loose = v[2]; - t.ok(eq(v0, v1, loose), "eq('" + v0 + "', '" + v1 + "')"); - t.ok(!neq(v0, v1, loose), "!neq('" + v0 + "', '" + v1 + "')"); - t.ok(cmp(v0, '==', v1, loose), 'cmp(' + v0 + '==' + v1 + ')'); - t.ok(!cmp(v0, '!=', v1, loose), '!cmp(' + v0 + '!=' + v1 + ')'); - t.ok(!cmp(v0, '===', v1, loose), '!cmp(' + v0 + '===' + v1 + ')'); - t.ok(cmp(v0, '!==', v1, loose), 'cmp(' + v0 + '!==' + v1 + ')'); - t.ok(!gt(v0, v1, loose), "!gt('" + v0 + "', '" + v1 + "')"); - t.ok(gte(v0, v1, loose), "gte('" + v0 + "', '" + v1 + "')"); - t.ok(!lt(v0, v1, loose), "!lt('" + v0 + "', '" + v1 + "')"); - t.ok(lte(v0, v1, loose), "lte('" + v0 + "', '" + v1 + "')"); - }); - t.end(); -}); - - -test('\nrange tests', function(t) { - // [range, version] - // version should be included by range - [['1.0.0 - 2.0.0', '1.2.3'], - ['^1.2.3+build', '1.2.3'], - ['^1.2.3+build', '1.3.0'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3'], - ['1.2.3pre+asdf - 2.4.3-pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3pre+asdf - 2.4.3pre+asdf', '1.2.3', true], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '1.2.3-pre.2'], - ['1.2.3-pre+asdf - 2.4.3-pre+asdf', '2.4.3-alpha'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0'], - ['*', '1.2.3'], - ['*', 'v1.2.3', true], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97', true], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0, - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0, - ['~ 1.0', '1.0.2'], - ['~ 1.0.3', '1.0.12'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['<=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['~1.2.1 >=1.2.3', '1.2.3'], - ['~1.2.1 =1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['~1.2.1 >=1.2.3 1.2.3', '1.2.3'], - ['~1.2.1 1.2.3 >=1.2.3', '1.2.3'], - ['~1.2.1 1.2.3', '1.2.3'], - ['>=1.2.1 1.2.3', '1.2.3'], - ['1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.3 >=1.2.1', '1.2.3'], - ['>=1.2.1 >=1.2.3', '1.2.3'], - ['>=1.2', '1.2.8'], - ['^1.2.3', '1.8.1'], - ['^0.1.2', '0.1.2'], - ['^0.1', '0.1.2'], - ['^1.2', '1.4.2'], - ['^1.2 ^1', '1.4.2'], - ['^1.2.3-alpha', '1.2.3-pre'], - ['^1.2.0-alpha', '1.2.0-pre'], - ['^0.0.1-alpha', '0.0.1-beta'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - t.ok(satisfies(ver, range, loose), range + ' satisfied by ' + ver); - }); - t.end(); -}); - -test('\nnegative range tests', function(t) { - // [range, version] - // version should not be included by range - [['1.0.0 - 2.0.0', '2.2.3'], - ['1.2.3+asdf - 2.4.3+asdf', '1.2.3-pre.2'], - ['1.2.3+asdf - 2.4.3+asdf', '2.4.3-alpha'], - ['^1.2.3+build', '2.0.0'], - ['^1.2.3+build', '1.2.0'], - ['^1.2.3', '1.2.3-pre'], - ['^1.2', '1.2.0-pre'], - ['>1.2', '1.3.0-beta'], - ['<=1.2.3', '1.2.3-beta'], - ['^1.2.3', '1.2.3-beta'], - ['=0.7.x', '0.7.0-asdf'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['<1', '1.0.0beta', true], - ['< 1', '1.0.0beta', true], - ['1.0.0', '1.0.1'], - ['>=1.0.0', '0.0.0'], - ['>=1.0.0', '0.0.1'], - ['>=1.0.0', '0.1.0'], - ['>1.0.0', '0.0.1'], - ['>1.0.0', '0.1.0'], - ['<=2.0.0', '3.0.0'], - ['<=2.0.0', '2.9999.9999'], - ['<=2.0.0', '2.2.9'], - ['<2.0.0', '2.9999.9999'], - ['<2.0.0', '2.2.9'], - ['>=0.1.97', 'v0.1.93', true], - ['>=0.1.97', '0.1.93'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['>=0.2.3 || <0.0.1', '0.0.3'], - ['>=0.2.3 || <0.0.1', '0.2.2'], - ['2.x.x', '1.1.3'], - ['2.x.x', '3.1.3'], - ['1.2.x', '1.3.3'], - ['1.2.x || 2.x', '3.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['2.*.*', '3.1.3'], - ['1.2.*', '1.3.3'], - ['1.2.* || 2.*', '3.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.1.2'], - ['2.3', '2.4.1'], - ['~2.4', '2.5.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.9'], - ['~>3.2.1', '3.3.2'], // >=3.2.1 <3.3.0 - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '2.2.3'], - ['~1.0', '1.1.0'], // >=1.0.0 <1.1.0 - ['<1', '1.0.0'], - ['>=1.2', '1.1.1'], - ['1', '2.0.0beta', true], - ['~v0.5.4-beta', '0.5.4-alpha'], - ['=0.7.x', '0.8.2'], - ['>=0.7.x', '0.6.2'], - ['<0.7.x', '0.7.2'], - ['<1.2.3', '1.2.3-beta'], - ['=1.2.3', '1.2.3-beta'], - ['>1.2', '1.2.8'], - ['^1.2.3', '2.0.0-alpha'], - ['^1.2.3', '1.2.2'], - ['^1.2', '1.1.9'], - ['*', 'v1.2.3-foo', true], - // invalid ranges never satisfied! - ['blerg', '1.2.3'], - ['git+https://user:password0123@github.com/foo', '123.0.0', true], - ['^1.2.3', '2.0.0-pre'] - ].forEach(function(v) { - var range = v[0]; - var ver = v[1]; - var loose = v[2]; - var found = satisfies(ver, range, loose); - t.ok(!found, ver + ' not satisfied by ' + range); - }); - t.end(); -}); - -test('\nincrement versions test', function(t) { -// [version, inc, result, identifier] -// inc(version, inc) -> result - [['1.2.3', 'major', '2.0.0'], - ['1.2.3', 'minor', '1.3.0'], - ['1.2.3', 'patch', '1.2.4'], - ['1.2.3tag', 'major', '2.0.0', true], - ['1.2.3-tag', 'major', '2.0.0'], - ['1.2.3', 'fake', null], - ['1.2.0-0', 'patch', '1.2.0'], - ['fake', 'major', null], - ['1.2.3-4', 'major', '2.0.0'], - ['1.2.3-4', 'minor', '1.3.0'], - ['1.2.3-4', 'patch', '1.2.3'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3'], - ['1.2.4', 'prerelease', '1.2.5-0'], - ['1.2.3-0', 'prerelease', '1.2.3-1'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1'], - ['1.2.3-alpha.1', 'prerelease', '1.2.3-alpha.2'], - ['1.2.3-alpha.2', 'prerelease', '1.2.3-alpha.3'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta'], - ['1.2.3-alpha.1.beta', 'prerelease', '1.2.3-alpha.2.beta'], - ['1.2.3-alpha.2.beta', 'prerelease', '1.2.3-alpha.3.beta'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta'], - ['1.2.0', 'prepatch', '1.2.1-0'], - ['1.2.0-1', 'prepatch', '1.2.1-0'], - ['1.2.0', 'preminor', '1.3.0-0'], - ['1.2.3-1', 'preminor', '1.3.0-0'], - ['1.2.0', 'premajor', '2.0.0-0'], - ['1.2.3-1', 'premajor', '2.0.0-0'], - ['1.2.0-1', 'minor', '1.2.0'], - ['1.0.0-1', 'major', '1.0.0'], - - ['1.2.3', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'minor', '1.3.0', false, 'dev'], - ['1.2.3', 'patch', '1.2.4', false, 'dev'], - ['1.2.3tag', 'major', '2.0.0', true, 'dev'], - ['1.2.3-tag', 'major', '2.0.0', false, 'dev'], - ['1.2.3', 'fake', null, false, 'dev'], - ['1.2.0-0', 'patch', '1.2.0', false, 'dev'], - ['fake', 'major', null, false, 'dev'], - ['1.2.3-4', 'major', '2.0.0', false, 'dev'], - ['1.2.3-4', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-4', 'patch', '1.2.3', false, 'dev'], - ['1.2.3-alpha.0.beta', 'major', '2.0.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'minor', '1.3.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'patch', '1.2.3', false, 'dev'], - ['1.2.4', 'prerelease', '1.2.5-dev.0', false, 'dev'], - ['1.2.3-0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0', 'prerelease', '1.2.3-alpha.1', false, 'alpha'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.0.beta', 'prerelease', '1.2.3-alpha.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.0.beta', 'prerelease', '1.2.3-alpha.10.1.beta', false, 'alpha'], - ['1.2.3-alpha.10.1.beta', 'prerelease', '1.2.3-alpha.10.2.beta', false, 'alpha'], - ['1.2.3-alpha.10.2.beta', 'prerelease', '1.2.3-alpha.10.3.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.10.beta.0', 'prerelease', '1.2.3-alpha.10.beta.1', false, 'alpha'], - ['1.2.3-alpha.10.beta.1', 'prerelease', '1.2.3-alpha.10.beta.2', false, 'alpha'], - ['1.2.3-alpha.10.beta.2', 'prerelease', '1.2.3-alpha.10.beta.3', false, 'alpha'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-dev.0', false, 'dev'], - ['1.2.3-alpha.9.beta', 'prerelease', '1.2.3-alpha.10.beta', false, 'alpha'], - ['1.2.3-alpha.10.beta', 'prerelease', '1.2.3-alpha.11.beta', false, 'alpha'], - ['1.2.3-alpha.11.beta', 'prerelease', '1.2.3-alpha.12.beta', false, 'alpha'], - ['1.2.0', 'prepatch', '1.2.1-dev.0', false, 'dev'], - ['1.2.0-1', 'prepatch', '1.2.1-dev.0', false, 'dev'], - ['1.2.0', 'preminor', '1.3.0-dev.0', false, 'dev'], - ['1.2.3-1', 'preminor', '1.3.0-dev.0', false, 'dev'], - ['1.2.0', 'premajor', '2.0.0-dev.0', false, 'dev'], - ['1.2.3-1', 'premajor', '2.0.0-dev.0', false, 'dev'], - ['1.2.0-1', 'minor', '1.2.0', false, 'dev'], - ['1.0.0-1', 'major', '1.0.0', false, 'dev'], - ['1.2.3-dev.bar', 'prerelease', '1.2.3-dev.0', false, 'dev'] - - ].forEach(function(v) { - var pre = v[0]; - var what = v[1]; - var wanted = v[2]; - var loose = v[3]; - var id = v[4]; - var found = inc(pre, what, loose, id); - var cmd = 'inc(' + pre + ', ' + what + ', ' + id + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - - var parsed = semver.parse(pre, loose); - if (wanted) { - parsed.inc(what, id); - t.equal(parsed.version, wanted, cmd + ' object version updated'); - t.equal(parsed.raw, wanted, cmd + ' object raw field updated'); - } else if (parsed) { - t.throws(function () { - parsed.inc(what, id) - }) - } else { - t.equal(parsed, null) - } - }); - - t.end(); -}); - -test('\ndiff versions test', function(t) { -// [version1, version2, result] -// diff(version1, version2) -> result - [['1.2.3', '0.2.3', 'major'], - ['1.4.5', '0.2.3', 'major'], - ['1.2.3', '2.0.0-pre', 'premajor'], - ['1.2.3', '1.3.3', 'minor'], - ['1.0.1', '1.1.0-pre', 'preminor'], - ['1.2.3', '1.2.4', 'patch'], - ['1.2.3', '1.2.4-pre', 'prepatch'], - ['0.0.1', '0.0.1-pre', 'prerelease'], - ['0.0.1', '0.0.1-pre-2', 'prerelease'], - ['1.1.0', '1.1.0-pre', 'prerelease'], - ['1.1.0-pre-1', '1.1.0-pre-2', 'prerelease'], - ['1.0.0', '1.0.0', null] - - ].forEach(function(v) { - var version1 = v[0]; - var version2 = v[1]; - var wanted = v[2]; - var found = diff(version1, version2); - var cmd = 'diff(' + version1 + ', ' + version2 + ')'; - t.equal(found, wanted, cmd + ' === ' + wanted); - }); - - t.end(); -}); - -test('\nvalid range test', function(t) { - // [range, result] - // validRange(range) -> result - // translate ranges into their canonical form - [['1.0.0 - 2.0.0', '>=1.0.0 <=2.0.0'], - ['1.0.0', '1.0.0'], - ['>=*', '*'], - ['', '*'], - ['*', '*'], - ['*', '*'], - ['>=1.0.0', '>=1.0.0'], - ['>1.0.0', '>1.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['1', '>=1.0.0 <2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<=2.0.0', '<=2.0.0'], - ['<2.0.0', '<2.0.0'], - ['<2.0.0', '<2.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['>= 1.0.0', '>=1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['> 1.0.0', '>1.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['<= 2.0.0', '<=2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['< 2.0.0', '<2.0.0'], - ['>=0.1.97', '>=0.1.97'], - ['>=0.1.97', '>=0.1.97'], - ['0.1.20 || 1.2.4', '0.1.20||1.2.4'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['>=0.2.3 || <0.0.1', '>=0.2.3||<0.0.1'], - ['||', '||'], - ['2.x.x', '>=2.0.0 <3.0.0'], - ['1.2.x', '>=1.2.0 <1.3.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['1.2.x || 2.x', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['x', '*'], - ['2.*.*', '>=2.0.0 <3.0.0'], - ['1.2.*', '>=1.2.0 <1.3.0'], - ['1.2.* || 2.*', '>=1.2.0 <1.3.0||>=2.0.0 <3.0.0'], - ['*', '*'], - ['2', '>=2.0.0 <3.0.0'], - ['2.3', '>=2.3.0 <2.4.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~2.4', '>=2.4.0 <2.5.0'], - ['~>3.2.1', '>=3.2.1 <3.3.0'], - ['~1', '>=1.0.0 <2.0.0'], - ['~>1', '>=1.0.0 <2.0.0'], - ['~> 1', '>=1.0.0 <2.0.0'], - ['~1.0', '>=1.0.0 <1.1.0'], - ['~ 1.0', '>=1.0.0 <1.1.0'], - ['^0', '>=0.0.0 <1.0.0'], - ['^ 1', '>=1.0.0 <2.0.0'], - ['^0.1', '>=0.1.0 <0.2.0'], - ['^1.0', '>=1.0.0 <2.0.0'], - ['^1.2', '>=1.2.0 <2.0.0'], - ['^0.0.1', '>=0.0.1 <0.0.2'], - ['^0.0.1-beta', '>=0.0.1-beta <0.0.2'], - ['^0.1.2', '>=0.1.2 <0.2.0'], - ['^1.2.3', '>=1.2.3 <2.0.0'], - ['^1.2.3-beta.4', '>=1.2.3-beta.4 <2.0.0'], - ['<1', '<1.0.0'], - ['< 1', '<1.0.0'], - ['>=1', '>=1.0.0'], - ['>= 1', '>=1.0.0'], - ['<1.2', '<1.2.0'], - ['< 1.2', '<1.2.0'], - ['1', '>=1.0.0 <2.0.0'], - ['>01.02.03', '>1.2.3', true], - ['>01.02.03', null], - ['~1.2.3beta', '>=1.2.3-beta <1.3.0', true], - ['~1.2.3beta', null], - ['^ 1.2 ^ 1', '>=1.2.0 <2.0.0 >=1.0.0 <2.0.0'] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var loose = v[2]; - var found = validRange(pre, loose); - - t.equal(found, wanted, 'validRange(' + pre + ') === ' + wanted); - }); - - t.end(); -}); - -test('\ncomparators test', function(t) { - // [range, comparators] - // turn range into a set of individual comparators - [['1.0.0 - 2.0.0', [['>=1.0.0', '<=2.0.0']]], - ['1.0.0', [['1.0.0']]], - ['>=*', [['']]], - ['', [['']]], - ['*', [['']]], - ['*', [['']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>=1.0.0', [['>=1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['>1.0.0', [['>1.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<=2.0.0', [['<=2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['<2.0.0', [['<2.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['>= 1.0.0', [['>=1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['> 1.0.0', [['>1.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['<= 2.0.0', [['<=2.0.0']]], - ['< 2.0.0', [['<2.0.0']]], - ['<\t2.0.0', [['<2.0.0']]], - ['>=0.1.97', [['>=0.1.97']]], - ['>=0.1.97', [['>=0.1.97']]], - ['0.1.20 || 1.2.4', [['0.1.20'], ['1.2.4']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['>=0.2.3 || <0.0.1', [['>=0.2.3'], ['<0.0.1']]], - ['||', [[''], ['']]], - ['2.x.x', [['>=2.0.0', '<3.0.0']]], - ['1.2.x', [['>=1.2.0', '<1.3.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.x || 2.x', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['x', [['']]], - ['2.*.*', [['>=2.0.0', '<3.0.0']]], - ['1.2.*', [['>=1.2.0', '<1.3.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['1.2.* || 2.*', [['>=1.2.0', '<1.3.0'], ['>=2.0.0', '<3.0.0']]], - ['*', [['']]], - ['2', [['>=2.0.0', '<3.0.0']]], - ['2.3', [['>=2.3.0', '<2.4.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~2.4', [['>=2.4.0', '<2.5.0']]], - ['~>3.2.1', [['>=3.2.1', '<3.3.0']]], - ['~1', [['>=1.0.0', '<2.0.0']]], - ['~>1', [['>=1.0.0', '<2.0.0']]], - ['~> 1', [['>=1.0.0', '<2.0.0']]], - ['~1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0', [['>=1.0.0', '<1.1.0']]], - ['~ 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['~> 1.0.3', [['>=1.0.3', '<1.1.0']]], - ['<1', [['<1.0.0']]], - ['< 1', [['<1.0.0']]], - ['>=1', [['>=1.0.0']]], - ['>= 1', [['>=1.0.0']]], - ['<1.2', [['<1.2.0']]], - ['< 1.2', [['<1.2.0']]], - ['1', [['>=1.0.0', '<2.0.0']]], - ['1 2', [['>=1.0.0', '<2.0.0', '>=2.0.0', '<3.0.0']]], - ['1.2 - 3.4.5', [['>=1.2.0', '<=3.4.5']]], - ['1.2.3 - 3.4', [['>=1.2.3', '<3.5.0']]], - ['1.2.3 - 3', [['>=1.2.3', '<4.0.0']]], - ['>*', [['<0.0.0']]], - ['<*', [['<0.0.0']]] - ].forEach(function(v) { - var pre = v[0]; - var wanted = v[1]; - var found = toComparators(v[0]); - var jw = JSON.stringify(wanted); - t.equivalent(found, wanted, 'toComparators(' + pre + ') === ' + jw); - }); - - t.end(); -}); - -test('\ninvalid version numbers', function(t) { - ['1.2.3.4', - 'NOT VALID', - 1.2, - null, - 'Infinity.NaN.Infinity' - ].forEach(function(v) { - t.throws(function() { - new SemVer(v); - }, {name:'TypeError', message:'Invalid Version: ' + v}); - }); - - t.end(); -}); - -test('\nstrict vs loose version numbers', function(t) { - [['=1.2.3', '1.2.3'], - ['01.02.03', '1.2.3'], - ['1.2.3-beta.01', '1.2.3-beta.1'], - [' =1.2.3', '1.2.3'], - ['1.2.3foo', '1.2.3-foo'] - ].forEach(function(v) { - var loose = v[0]; - var strict = v[1]; - t.throws(function() { - new SemVer(loose); - }); - var lv = new SemVer(loose, true); - t.equal(lv.version, strict); - t.ok(eq(loose, strict, true)); - t.throws(function() { - eq(loose, strict); - }); - t.throws(function() { - new SemVer(strict).compare(loose); - }); - }); - t.end(); -}); - -test('\nstrict vs loose ranges', function(t) { - [['>=01.02.03', '>=1.2.3'], - ['~1.02.03beta', '>=1.2.3-beta <1.3.0'] - ].forEach(function(v) { - var loose = v[0]; - var comps = v[1]; - t.throws(function() { - new Range(loose); - }); - t.equal(new Range(loose, true).range, comps); - }); - t.end(); -}); - -test('\nmax satisfying', function(t) { - [[['1.2.3', '1.2.4'], '1.2', '1.2.4'], - [['1.2.4', '1.2.3'], '1.2', '1.2.4'], - [['1.2.3', '1.2.4', '1.2.5', '1.2.6'], '~1.2.3', '1.2.6'], - [['1.1.0', '1.2.0', '1.2.1', '1.3.0', '2.0.0b1', '2.0.0b2', '2.0.0b3', '2.0.0', '2.1.0'], '~2.0.0', '2.0.0', true] - ].forEach(function(v) { - var versions = v[0]; - var range = v[1]; - var expect = v[2]; - var loose = v[3]; - var actual = semver.maxSatisfying(versions, range, loose); - t.equal(actual, expect); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/ltr.js b/deps/npm/node_modules/semver/test/ltr.js deleted file mode 100644 index 0f7167d6589258..00000000000000 --- a/deps/npm/node_modules/semver/test/ltr.js +++ /dev/null @@ -1,181 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); -var ltr = semver.ltr; - -test('\nltr tests', function(t) { - // [range, version, loose] - // Version should be less than range - [ - ['~1.2.2', '1.2.1'], - ['~0.6.1-1', '0.6.1-0'], - ['1.0.0 - 2.0.0', '0.0.1'], - ['1.0.0-beta.2', '1.0.0-beta.1'], - ['1.0.0', '0.0.0'], - ['>=2.0.0', '1.1.1'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['0.1.20 || 1.2.4', '0.1.5'], - ['2.x.x', '1.0.0'], - ['1.2.x', '1.1.0'], - ['1.2.x || 2.x', '1.0.0'], - ['2.*.*', '1.0.1'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.9999'], - ['2', '1.0.0'], - ['2.3', '2.2.2'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.3.5'], - ['~>3.2.1', '3.2.0'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.4'], - ['~> 1', '0.2.3'], - ['~1.0', '0.1.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '0.1.0'], - ['>1.2', '1.2.0'], - ['> 1.2', '1.2.1'], - ['1', '0.0.0beta', true], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['~v0.5.4-pre', '0.5.4-alpha'], - ['=0.7.x', '0.6.0'], - ['=0.7.x', '0.6.0-asdf'], - ['>=0.7.x', '0.6.0'], - ['~1.2.2', '1.2.1'], - ['1.0.0 - 2.0.0', '0.2.3'], - ['1.0.0', '0.0.1'], - ['>=2.0.0', '1.0.0'], - ['>=2.0.0', '1.9999.9999'], - ['>=2.0.0', '1.2.9'], - ['>2.0.0', '2.0.0'], - ['>2.0.0', '1.2.9'], - ['2.x.x', '1.1.3'], - ['1.2.x', '1.1.3'], - ['1.2.x || 2.x', '1.1.3'], - ['2.*.*', '1.1.3'], - ['1.2.*', '1.1.3'], - ['1.2.* || 2.*', '1.1.3'], - ['2', '1.9999.9999'], - ['2.3', '2.2.1'], - ['~2.4', '2.3.0'], // >=2.4.0 <2.5.0 - ['~>3.2.1', '2.3.2'], // >=3.2.1 <3.3.0 - ['~1', '0.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '0.2.3'], - ['~1.0', '0.0.0'], // >=1.0.0 <1.1.0 - ['>1', '1.0.0'], - ['2', '1.0.0beta', true], - ['>1', '1.0.0beta', true], - ['> 1', '1.0.0beta', true], - ['=0.7.x', '0.6.2'], - ['=0.7.x', '0.7.0-asdf'], - ['^1', '1.0.0-0'], - ['>=0.7.x', '0.7.0-asdf'], - ['1', '1.0.0beta', true], - ['>=0.7.x', '0.6.2'], - ['>1.2.3', '1.3.0-alpha'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.ok(ltr(version, range, loose), msg); - }); - t.end(); -}); - -test('\nnegative ltr tests', function(t) { - // [range, version, loose] - // Version should NOT be less than range - [ - ['~ 1.0', '1.1.0'], - ['~0.6.1-1', '0.6.1-1'], - ['1.0.0 - 2.0.0', '1.2.3'], - ['1.0.0 - 2.0.0', '2.9.9'], - ['1.0.0', '1.0.0'], - ['>=*', '0.2.4'], - ['', '1.0.0', true], - ['*', '1.2.3'], - ['>=1.0.0', '1.0.0'], - ['>=1.0.0', '1.0.1'], - ['>=1.0.0', '1.1.0'], - ['>1.0.0', '1.0.1'], - ['>1.0.0', '1.1.0'], - ['<=2.0.0', '2.0.0'], - ['<=2.0.0', '1.9999.9999'], - ['<=2.0.0', '0.2.9'], - ['<2.0.0', '1.9999.9999'], - ['<2.0.0', '0.2.9'], - ['>= 1.0.0', '1.0.0'], - ['>= 1.0.0', '1.0.1'], - ['>= 1.0.0', '1.1.0'], - ['> 1.0.0', '1.0.1'], - ['> 1.0.0', '1.1.0'], - ['<= 2.0.0', '2.0.0'], - ['<= 2.0.0', '1.9999.9999'], - ['<= 2.0.0', '0.2.9'], - ['< 2.0.0', '1.9999.9999'], - ['<\t2.0.0', '0.2.9'], - ['>=0.1.97', 'v0.1.97'], - ['>=0.1.97', '0.1.97'], - ['0.1.20 || 1.2.4', '1.2.4'], - ['0.1.20 || >1.2.4', '1.2.4'], - ['0.1.20 || 1.2.4', '1.2.3'], - ['0.1.20 || 1.2.4', '0.1.20'], - ['>=0.2.3 || <0.0.1', '0.0.0'], - ['>=0.2.3 || <0.0.1', '0.2.3'], - ['>=0.2.3 || <0.0.1', '0.2.4'], - ['||', '1.3.4'], - ['2.x.x', '2.1.3'], - ['1.2.x', '1.2.3'], - ['1.2.x || 2.x', '2.1.3'], - ['1.2.x || 2.x', '1.2.3'], - ['x', '1.2.3'], - ['2.*.*', '2.1.3'], - ['1.2.*', '1.2.3'], - ['1.2.* || 2.*', '2.1.3'], - ['1.2.* || 2.*', '1.2.3'], - ['1.2.* || 2.*', '1.2.3'], - ['*', '1.2.3'], - ['2', '2.1.2'], - ['2.3', '2.3.1'], - ['~2.4', '2.4.0'], // >=2.4.0 <2.5.0 - ['~2.4', '2.4.5'], - ['~>3.2.1', '3.2.2'], // >=3.2.1 <3.3.0 - ['~1', '1.2.3'], // >=1.0.0 <2.0.0 - ['~>1', '1.2.3'], - ['~> 1', '1.2.3'], - ['~1.0', '1.0.2'], // >=1.0.0 <1.1.0 - ['~ 1.0', '1.0.2'], - ['>=1', '1.0.0'], - ['>= 1', '1.0.0'], - ['<1.2', '1.1.1'], - ['< 1.2', '1.1.1'], - ['~v0.5.4-pre', '0.5.5'], - ['~v0.5.4-pre', '0.5.4'], - ['=0.7.x', '0.7.2'], - ['>=0.7.x', '0.7.2'], - ['<=0.7.x', '0.6.2'], - ['>0.2.3 >0.2.4 <=0.2.5', '0.2.5'], - ['>=0.2.3 <=0.2.4', '0.2.4'], - ['1.0.0 - 2.0.0', '2.0.0'], - ['^3.0.0', '4.0.0'], - ['^1.0.0 || ~2.0.1', '2.0.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '3.2.0'], - ['^0.1.0 || ~3.0.1 || 5.0.0', '1.0.0beta', true], - ['^0.1.0 || ~3.0.1 || 5.0.0', '5.0.0-0', true], - ['^0.1.0 || ~3.0.1 || >4 <=5.0.0', '3.5.0'], - ['^1.0.0alpha', '1.0.0beta', true], - ['~1.0.0alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0beta', true], - ['~1.0.0-alpha', '1.0.0beta', true], - ['^1.0.0-alpha', '1.0.0-beta'], - ['~1.0.0-alpha', '1.0.0-beta'], - ['=0.1.0', '1.0.0'] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = '!ltr(' + version + ', ' + range + ', ' + loose + ')'; - t.notOk(ltr(version, range, loose), msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/semver/test/major-minor-patch.js b/deps/npm/node_modules/semver/test/major-minor-patch.js deleted file mode 100644 index e9d4039c8be629..00000000000000 --- a/deps/npm/node_modules/semver/test/major-minor-patch.js +++ /dev/null @@ -1,72 +0,0 @@ -var tap = require('tap'); -var test = tap.test; -var semver = require('../semver.js'); - -test('\nmajor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.3', 1], - [' 1.2.3 ', 1], - [' 2.2.3-4 ', 2], - [' 3.2.3-pre ', 3], - ['v5.2.3', 5], - [' v8.2.3 ', 8], - ['\t13.2.3', 13], - ['=21.2.3', 21, true], - ['v=34.2.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'major(' + range + ') = ' + version; - t.equal(semver.major(range, loose), version, msg); - }); - t.end(); -}); - -test('\nminor tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.1.3', 1], - [' 1.1.3 ', 1], - [' 1.2.3-4 ', 2], - [' 1.3.3-pre ', 3], - ['v1.5.3', 5], - [' v1.8.3 ', 8], - ['\t1.13.3', 13], - ['=1.21.3', 21, true], - ['v=1.34.3', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'minor(' + range + ') = ' + version; - t.equal(semver.minor(range, loose), version, msg); - }); - t.end(); -}); - -test('\npatch tests', function(t) { - // [range, version] - // Version should be detectable despite extra characters - [ - ['1.2.1', 1], - [' 1.2.1 ', 1], - [' 1.2.2-4 ', 2], - [' 1.2.3-pre ', 3], - ['v1.2.5', 5], - [' v1.2.8 ', 8], - ['\t1.2.13', 13], - ['=1.2.21', 21, true], - ['v=1.2.34', 34, true] - ].forEach(function(tuple) { - var range = tuple[0]; - var version = tuple[1]; - var loose = tuple[2] || false; - var msg = 'patch(' + range + ') = ' + version; - t.equal(semver.patch(range, loose), version, msg); - }); - t.end(); -}); diff --git a/deps/npm/node_modules/tar/lib/entry.js b/deps/npm/node_modules/tar/lib/entry.js index 5f5dd3c2688a8b..591202bd3b9af4 100644 --- a/deps/npm/node_modules/tar/lib/entry.js +++ b/deps/npm/node_modules/tar/lib/entry.js @@ -210,7 +210,7 @@ Entry.prototype._setProps = function () { this._remaining = props.size } -// the parser may not call write if _abort is true. +// the parser may not call write if _abort is true. // useful for skipping data from some files quickly. Entry.prototype.abort = function(){ this._abort = true diff --git a/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js index b0f5d82546823e..c6db79a43d91d7 100644 --- a/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js +++ b/deps/npm/node_modules/tar/node_modules/block-stream/test/two-stream.js @@ -10,10 +10,10 @@ stack = new Buffer( tsize ); for ( ; i < tsize; i++) stack[i] = "x".charCodeAt(0); isize = 1 * 1024; // <- initial packet size with 4K no bug! -fsize = 2 * 1024 ; // <- first block-stream size +fsize = 2 * 1024 ; // <- first block-stream size psize = Math.ceil( isize / 6 ); // <- second block-stream size -fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first +fexpected = Math.ceil( tsize / fsize ); // <- packets expected for first pexpected = Math.ceil( tsize / psize ); // <- packets expected for second diff --git a/deps/npm/node_modules/tar/test/parse-discard.js b/deps/npm/node_modules/tar/test/parse-discard.js index 79408c274b96e9..da01a65ccc7d7d 100644 --- a/deps/npm/node_modules/tar/test/parse-discard.js +++ b/deps/npm/node_modules/tar/test/parse-discard.js @@ -20,10 +20,10 @@ tap.test("parser test", function (t) { .pipe(parser) .on('entry',function(entry){ if(entry.path === 'c.txt') entry.abort() - + total += entry.size; entry.on('data',function(data){ - dataTotal += data.length + dataTotal += data.length }) }) }) diff --git a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md index 08f7a7b48fcd24..52de4277db20a0 100644 --- a/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md +++ b/deps/npm/node_modules/unique-filename/node_modules/unique-slug/README.md @@ -17,3 +17,4 @@ hex. If *str* is not passed in, it will be 4 bytes coverted into 8 hex characters, generated by `crypto.pseudoRandomBytes`. + diff --git a/deps/npm/node_modules/validate-npm-package-license/LICENSE b/deps/npm/node_modules/validate-npm-package-license/LICENSE index 17de51c642a7da..a5e905d5521799 100644 --- a/deps/npm/node_modules/validate-npm-package-license/LICENSE +++ b/deps/npm/node_modules/validate-npm-package-license/LICENSE @@ -10,165 +10,165 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. -"License" shall mean the terms and conditions for use, reproduction, and +"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. -"Licensor" shall mean the copyright owner or entity authorized by the +"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. -"Legal Entity" shall mean the union of the acting entity and all other -entities that control, are controlled by, or are under common control -with that entity. For the purposes of this definition, "control" means -(i) the power, direct or indirect, to cause the direction or management -of such entity, whether by contract or otherwise, or (ii) ownership of -fifty percent (50%) or more of the outstanding shares, or (iii) +"Legal Entity" shall mean the union of the acting entity and all other +entities that control, are controlled by, or are under common control +with that entity. For the purposes of this definition, "control" means +(i) the power, direct or indirect, to cause the direction or management +of such entity, whether by contract or otherwise, or (ii) ownership of +fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. -"You" (or "Your") shall mean an individual or Legal Entity exercising +"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. -"Source" form shall mean the preferred form for making modifications, -including but not limited to software source code, documentation source, +"Source" form shall mean the preferred form for making modifications, +including but not limited to software source code, documentation source, and configuration files. -"Object" form shall mean any form resulting from mechanical -transformation or translation of a Source form, including but not -limited to compiled object code, generated documentation, and +"Object" form shall mean any form resulting from mechanical +transformation or translation of a Source form, including but not +limited to compiled object code, generated documentation, and conversions to other media types. -"Work" shall mean the work of authorship, whether in Source or Object -form, made available under the License, as indicated by a copyright -notice that is included in or attached to the work (an example is +"Work" shall mean the work of authorship, whether in Source or Object +form, made available under the License, as indicated by a copyright +notice that is included in or attached to the work (an example is provided in the Appendix below). -"Derivative Works" shall mean any work, whether in Source or Object -form, that is based on (or derived from) the Work and for which the -editorial revisions, annotations, elaborations, or other modifications -represent, as a whole, an original work of authorship. For the purposes -of this License, Derivative Works shall not include works that remain -separable from, or merely link (or bind by name) to the interfaces of, +"Derivative Works" shall mean any work, whether in Source or Object +form, that is based on (or derived from) the Work and for which the +editorial revisions, annotations, elaborations, or other modifications +represent, as a whole, an original work of authorship. For the purposes +of this License, Derivative Works shall not include works that remain +separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. -"Contribution" shall mean any work of authorship, including the original -version of the Work and any modifications or additions to that Work or -Derivative Works thereof, that is intentionally submitted to Licensor -for inclusion in the Work by the copyright owner or by an individual or -Legal Entity authorized to submit on behalf of the copyright owner. For -the purposes of this definition, "submitted" means any form of -electronic, verbal, or written communication sent to the Licensor or its -representatives, including but not limited to communication on -electronic mailing lists, source code control systems, and issue -tracking systems that are managed by, or on behalf of, the Licensor for -the purpose of discussing and improving the Work, but excluding -communication that is conspicuously marked or otherwise designated in +"Contribution" shall mean any work of authorship, including the original +version of the Work and any modifications or additions to that Work or +Derivative Works thereof, that is intentionally submitted to Licensor +for inclusion in the Work by the copyright owner or by an individual or +Legal Entity authorized to submit on behalf of the copyright owner. For +the purposes of this definition, "submitted" means any form of +electronic, verbal, or written communication sent to the Licensor or its +representatives, including but not limited to communication on +electronic mailing lists, source code control systems, and issue +tracking systems that are managed by, or on behalf of, the Licensor for +the purpose of discussing and improving the Work, but excluding +communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." -"Contributor" shall mean Licensor and any individual or Legal Entity on -behalf of whom a Contribution has been received by Licensor and +"Contributor" shall mean Licensor and any individual or Legal Entity on +behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. -2. Grant of Copyright License. Subject to the terms and conditions of -this License, each Contributor hereby grants to You a perpetual, -worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright -license to reproduce, prepare Derivative Works of, publicly display, -publicly perform, sublicense, and distribute the Work and such +2. Grant of Copyright License. Subject to the terms and conditions of +this License, each Contributor hereby grants to You a perpetual, +worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright +license to reproduce, prepare Derivative Works of, publicly display, +publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. -3. Grant of Patent License. Subject to the terms and conditions of this -License, each Contributor hereby grants to You a perpetual, worldwide, -non-exclusive, no-charge, royalty-free, irrevocable (except as stated in -this section) patent license to make, have made, use, offer to sell, -sell, import, and otherwise transfer the Work, where such license -applies only to those patent claims licensable by such Contributor that -are necessarily infringed by their Contribution(s) alone or by -combination of their Contribution(s) with the Work to which such -Contribution(s) was submitted. If You institute patent litigation -against any entity (including a cross-claim or counterclaim in a -lawsuit) alleging that the Work or a Contribution incorporated within -the Work constitutes direct or contributory patent infringement, then -any patent licenses granted to You under this License for that Work +3. Grant of Patent License. Subject to the terms and conditions of this +License, each Contributor hereby grants to You a perpetual, worldwide, +non-exclusive, no-charge, royalty-free, irrevocable (except as stated in +this section) patent license to make, have made, use, offer to sell, +sell, import, and otherwise transfer the Work, where such license +applies only to those patent claims licensable by such Contributor that +are necessarily infringed by their Contribution(s) alone or by +combination of their Contribution(s) with the Work to which such +Contribution(s) was submitted. If You institute patent litigation +against any entity (including a cross-claim or counterclaim in a +lawsuit) alleging that the Work or a Contribution incorporated within +the Work constitutes direct or contributory patent infringement, then +any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. -4. Redistribution. You may reproduce and distribute copies of the Work -or Derivative Works thereof in any medium, with or without -modifications, and in Source or Object form, provided that You meet the +4. Redistribution. You may reproduce and distribute copies of the Work +or Derivative Works thereof in any medium, with or without +modifications, and in Source or Object form, provided that You meet the following conditions: -(a) You must give any other recipients of the Work or Derivative Works a +(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and -(b) You must cause any modified files to carry prominent notices stating +(b) You must cause any modified files to carry prominent notices stating that You changed the files; and -(c) You must retain, in the Source form of any Derivative Works that You -distribute, all copyright, patent, trademark, and attribution notices -from the Source form of the Work, excluding those notices that do not +(c) You must retain, in the Source form of any Derivative Works that You +distribute, all copyright, patent, trademark, and attribution notices +from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and -(d) If the Work includes a "NOTICE" text file as part of its -distribution, then any Derivative Works that You distribute must include -a readable copy of the attribution notices contained within such NOTICE -file, excluding those notices that do not pertain to any part of the -Derivative Works, in at least one of the following places: within a -NOTICE text file distributed as part of the Derivative Works; within the -Source form or documentation, if provided along with the Derivative -Works; or, within a display generated by the Derivative Works, if and -wherever such third-party notices normally appear. The contents of the -NOTICE file are for informational purposes only and do not modify the -License. You may add Your own attribution notices within Derivative -Works that You distribute, alongside or as an addendum to the NOTICE -text from the Work, provided that such additional attribution notices +(d) If the Work includes a "NOTICE" text file as part of its +distribution, then any Derivative Works that You distribute must include +a readable copy of the attribution notices contained within such NOTICE +file, excluding those notices that do not pertain to any part of the +Derivative Works, in at least one of the following places: within a +NOTICE text file distributed as part of the Derivative Works; within the +Source form or documentation, if provided along with the Derivative +Works; or, within a display generated by the Derivative Works, if and +wherever such third-party notices normally appear. The contents of the +NOTICE file are for informational purposes only and do not modify the +License. You may add Your own attribution notices within Derivative +Works that You distribute, alongside or as an addendum to the NOTICE +text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. -You may add Your own copyright statement to Your modifications and may -provide additional or different license terms and conditions for use, -reproduction, or distribution of Your modifications, or for any such -Derivative Works as a whole, provided Your use, reproduction, and -distribution of the Work otherwise complies with the conditions stated +You may add Your own copyright statement to Your modifications and may +provide additional or different license terms and conditions for use, +reproduction, or distribution of Your modifications, or for any such +Derivative Works as a whole, provided Your use, reproduction, and +distribution of the Work otherwise complies with the conditions stated in this License. -5. Submission of Contributions. Unless You explicitly state otherwise, -any Contribution intentionally submitted for inclusion in the Work by -You to the Licensor shall be under the terms and conditions of this -License, without any additional terms or conditions. Notwithstanding the -above, nothing herein shall supersede or modify the terms of any -separate license agreement you may have executed with Licensor regarding +5. Submission of Contributions. Unless You explicitly state otherwise, +any Contribution intentionally submitted for inclusion in the Work by +You to the Licensor shall be under the terms and conditions of this +License, without any additional terms or conditions. Notwithstanding the +above, nothing herein shall supersede or modify the terms of any +separate license agreement you may have executed with Licensor regarding such Contributions. -6. Trademarks. This License does not grant permission to use the trade -names, trademarks, service marks, or product names of the Licensor, -except as required for reasonable and customary use in describing the +6. Trademarks. This License does not grant permission to use the trade +names, trademarks, service marks, or product names of the Licensor, +except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. -7. Disclaimer of Warranty. Unless required by applicable law or agreed -to in writing, Licensor provides the Work (and each Contributor provides -its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS -OF ANY KIND, either express or implied, including, without limitation, -any warranties or conditions of TITLE, NON-INFRINGEMENT, -MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely -responsible for determining the appropriateness of using or -redistributing the Work and assume any risks associated with Your +7. Disclaimer of Warranty. Unless required by applicable law or agreed +to in writing, Licensor provides the Work (and each Contributor provides +its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, either express or implied, including, without limitation, +any warranties or conditions of TITLE, NON-INFRINGEMENT, +MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely +responsible for determining the appropriateness of using or +redistributing the Work and assume any risks associated with Your exercise of permissions under this License. -8. Limitation of Liability. In no event and under no legal theory, -whether in tort (including negligence), contract, or otherwise, unless -required by applicable law (such as deliberate and grossly negligent -acts) or agreed to in writing, shall any Contributor be liable to You -for damages, including any direct, indirect, special, incidental, or -consequential damages of any character arising as a result of this -License or out of the use or inability to use the Work (including but -not limited to damages for loss of goodwill, work stoppage, computer -failure or malfunction, or any and all other commercial damages or -losses), even if such Contributor has been advised of the possibility of +8. Limitation of Liability. In no event and under no legal theory, +whether in tort (including negligence), contract, or otherwise, unless +required by applicable law (such as deliberate and grossly negligent +acts) or agreed to in writing, shall any Contributor be liable to You +for damages, including any direct, indirect, special, incidental, or +consequential damages of any character arising as a result of this +License or out of the use or inability to use the Work (including but +not limited to damages for loss of goodwill, work stoppage, computer +failure or malfunction, or any and all other commercial damages or +losses), even if such Contributor has been advised of the possibility of such damages. -9. Accepting Warranty or Additional Liability. While redistributing the -Work or Derivative Works thereof, You may choose to offer, and charge a -fee for, acceptance of support, warranty, indemnity, or other liability -obligations and/or rights consistent with this License. However, in -accepting such obligations, You may act only on Your own behalf and on -Your sole responsibility, not on behalf of any other Contributor, and -only if You agree to indemnify, defend, and hold each Contributor -harmless for any liability incurred by, or claims asserted against, such -Contributor by reason of your accepting any such warranty or additional +9. Accepting Warranty or Additional Liability. While redistributing the +Work or Derivative Works thereof, You may choose to offer, and charge a +fee for, acceptance of support, warranty, indemnity, or other liability +obligations and/or rights consistent with this License. However, in +accepting such obligations, You may act only on Your own behalf and on +Your sole responsibility, not on behalf of any other Contributor, and +only if You agree to indemnify, defend, and hold each Contributor +harmless for any liability incurred by, or claims asserted against, such +Contributor by reason of your accepting any such warranty or additional liability. diff --git a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md index e9837a5068ae0e..0eb45c420775eb 100644 --- a/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md +++ b/deps/npm/node_modules/validate-npm-package-name/node_modules/builtins/History.md @@ -1,10 +1,10 @@ -0.0.7 / 2014-09-01 +0.0.7 / 2014-09-01 ================== * update .repository -0.0.6 / 2014-09-01 +0.0.6 / 2014-09-01 ================== * add travis @@ -22,17 +22,17 @@ * add timers -0.0.3 / 2014-02-22 +0.0.3 / 2014-02-22 ================== * add buffer -0.0.2 / 2014-02-11 +0.0.2 / 2014-02-11 ================== * add assert -0.0.1 / 2014-02-11 +0.0.1 / 2014-02-11 ================== * add main diff --git a/deps/npm/node_modules/which/CHANGELOG.md b/deps/npm/node_modules/which/CHANGELOG.md index 56106119e9a645..f2c6e4fd39de14 100644 --- a/deps/npm/node_modules/which/CHANGELOG.md +++ b/deps/npm/node_modules/which/CHANGELOG.md @@ -1,6 +1,10 @@ # Changes +## v1.2.11 + +* Prevent changelog script from being included in package + ## v1.2.10 * Use env.PATH only, not env.Path diff --git a/deps/npm/node_modules/which/changelog.sh b/deps/npm/node_modules/which/changelog.sh deleted file mode 100644 index 360e54af40f6af..00000000000000 --- a/deps/npm/node_modules/which/changelog.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -( - echo '# Changes' - echo '' - git log --first-parent --pretty=format:'%s' \ - | grep -v '^update changelog' \ - | perl -p -e 's/^((v?[0-9]+\.?)+)$/\n## \1\n/g' \ - | perl -p -e 's/^([^#\s].*)$/* \1/g' -)> CHANGELOG.md diff --git a/deps/npm/node_modules/which/package.json b/deps/npm/node_modules/which/package.json index 27071d747a9d0d..dcdb66c9ebc3d1 100644 --- a/deps/npm/node_modules/which/package.json +++ b/deps/npm/node_modules/which/package.json @@ -2,41 +2,40 @@ "_args": [ [ { - "raw": "which@latest", + "raw": "which@1.2.11", "scope": null, "escapedName": "which", "name": "which", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "1.2.11", + "spec": "1.2.11", + "type": "version" }, - "/Users/rebecca/code/npm" + "/Users/zkat/Documents/code/npm" ] ], - "_from": "which@latest", - "_id": "which@1.2.10", + "_from": "which@1.2.11", + "_id": "which@1.2.11", "_inCache": true, - "_installable": true, "_location": "/which", - "_nodeVersion": "4.4.4", + "_nodeVersion": "6.5.0", "_npmOperationalInternal": { "host": "packages-12-west.internal.npmjs.com", - "tmp": "tmp/which-1.2.10.tgz_1465116744337_0.4818702598568052" + "tmp": "tmp/which-1.2.11.tgz_1473093398489_0.1032072464004159" }, "_npmUser": { "name": "isaacs", "email": "i@izs.me" }, - "_npmVersion": "3.9.1", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "raw": "which@latest", + "raw": "which@1.2.11", "scope": null, "escapedName": "which", "name": "which", - "rawSpec": "latest", - "spec": "latest", - "type": "tag" + "rawSpec": "1.2.11", + "spec": "1.2.11", + "type": "version" }, "_requiredBy": [ "#USER", @@ -44,11 +43,11 @@ "/node-gyp", "/tap/foreground-child/cross-spawn" ], - "_resolved": "https://registry.npmjs.org/which/-/which-1.2.10.tgz", - "_shasum": "91cd9bd0751322411b659b40f054b21de957ab2d", + "_resolved": "https://registry.npmjs.org/which/-/which-1.2.11.tgz", + "_shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", "_shrinkwrap": null, - "_spec": "which@latest", - "_where": "/Users/rebecca/code/npm", + "_spec": "which@1.2.11", + "_where": "/Users/zkat/Documents/code/npm", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -71,14 +70,14 @@ }, "directories": {}, "dist": { - "shasum": "91cd9bd0751322411b659b40f054b21de957ab2d", - "tarball": "https://registry.npmjs.org/which/-/which-1.2.10.tgz" + "shasum": "c8b2eeea6b8c1659fa7c1dd4fdaabe9533dc5e8b", + "tarball": "https://registry.npmjs.org/which/-/which-1.2.11.tgz" }, "files": [ "which.js", "bin/which" ], - "gitHead": "3f590834623ee940d922e12b1c8b9cbf24bd5012", + "gitHead": "8a7d0aa1ca10173f9f4d84bf528a3efc1f5d0c6f", "homepage": "https://github.com/isaacs/node-which#readme", "license": "ISC", "main": "which.js", @@ -96,9 +95,9 @@ "url": "git://github.com/isaacs/node-which.git" }, "scripts": { - "changelog": "bash changelog.sh", + "changelog": "bash gen-changelog.sh", "postversion": "npm run changelog && git add CHANGELOG.md && git commit -m 'update changelog - '${npm_package_version}", "test": "tap test/*.js --cov" }, - "version": "1.2.10" + "version": "1.2.11" } diff --git a/deps/npm/node_modules/write-file-atomic/.npmignore b/deps/npm/node_modules/write-file-atomic/.npmignore deleted file mode 100644 index 454382637b44d0..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -*~ -DEADJOE -.#* -node_modules \ No newline at end of file diff --git a/deps/npm/node_modules/write-file-atomic/.travis.yml b/deps/npm/node_modules/write-file-atomic/.travis.yml deleted file mode 100644 index 3bc5d90c5666ca..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/.travis.yml +++ /dev/null @@ -1,11 +0,0 @@ -language: node_js -sudo: false -before_install: - - "npm -g install npm" -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" - - "4" - - "5" diff --git a/deps/npm/node_modules/write-file-atomic/LICENSE b/deps/npm/node_modules/write-file-atomic/LICENSE index af4588069db82d..95e65a7706e0e9 100644 --- a/deps/npm/node_modules/write-file-atomic/LICENSE +++ b/deps/npm/node_modules/write-file-atomic/LICENSE @@ -3,3 +3,4 @@ Copyright (c) 2015, Rebecca Turner Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + diff --git a/deps/npm/node_modules/write-file-atomic/README.md b/deps/npm/node_modules/write-file-atomic/README.md index 26e434d19437b0..a9d3461db1c781 100644 --- a/deps/npm/node_modules/write-file-atomic/README.md +++ b/deps/npm/node_modules/write-file-atomic/README.md @@ -19,7 +19,7 @@ callback **Function** Atomically and asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer. -The file is initially named `filename + "." + md5hex(__filename, process.pid, ++invocations)`. +The file is initially named `filename + "." + murmurhex(__filename, process.pid, ++invocations)`. If writeFile completes successfully then, if passed the **chown** option it will change the ownership of the file. Finally it renames the file back to the filename you specified. If it encounters errors at any of these steps it will attempt to unlink the temporary file and then diff --git a/deps/npm/node_modules/write-file-atomic/index.js b/deps/npm/node_modules/write-file-atomic/index.js index 797e571779f9d8..519aacad988057 100644 --- a/deps/npm/node_modules/write-file-atomic/index.js +++ b/deps/npm/node_modules/write-file-atomic/index.js @@ -2,6 +2,7 @@ var fs = require('graceful-fs') var chain = require('slide').chain var MurmurHash3 = require('imurmurhash') +var extend = Object.assign || require('util')._extend function murmurhex () { var hash = new MurmurHash3() @@ -20,22 +21,63 @@ module.exports = function writeFile (filename, data, options, callback) { } if (!options) options = {} var tmpfile = getTmpname(filename) - chain([ - [fs, fs.writeFile, tmpfile, data, options], - options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], - [fs, fs.rename, tmpfile, filename] - ], function (err) { - err ? fs.unlink(tmpfile, function () { callback(err) }) - : callback() - }) + + if (options.mode && options.chmod) { + return thenWriteFile() + } else { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + return fs.stat(filename, function (err, stats) { + options = extend({}, options) + if (!err && stats && !options.mode) { + options.mode = stats.mode + } + if (!err && stats && !options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + return thenWriteFile() + }) + } + + function thenWriteFile () { + chain([ + [fs, fs.writeFile, tmpfile, data, options.encoding || 'utf8'], + options.mode && [fs, fs.chmod, tmpfile, options.mode], + options.chown && [fs, fs.chown, tmpfile, options.chown.uid, options.chown.gid], + [fs, fs.rename, tmpfile, filename] + ], function (err) { + err ? fs.unlink(tmpfile, function () { callback(err) }) + : callback() + }) + } } module.exports.sync = function writeFileSync (filename, data, options) { if (!options) options = {} var tmpfile = getTmpname(filename) + try { - fs.writeFileSync(tmpfile, data, options) + if (!options.mode || !options.chmod) { + // Either mode or chown is not explicitly set + // Default behavior is to copy it from original file + try { + var stats = fs.statSync(filename) + + options = extend({}, options) + if (!options.mode) { + options.mode = stats.mode + } + if (!options.chown && process.getuid) { + options.chown = { uid: stats.uid, gid: stats.gid } + } + } catch (ex) { + // ignore stat errors + } + } + + fs.writeFileSync(tmpfile, data, options.encoding || 'utf8') if (options.chown) fs.chownSync(tmpfile, options.chown.uid, options.chown.gid) + if (options.mode) fs.chmodSync(tmpfile, options.mode) fs.renameSync(tmpfile, filename) } catch (err) { try { fs.unlinkSync(tmpfile) } catch (e) {} diff --git a/deps/npm/node_modules/write-file-atomic/package.json b/deps/npm/node_modules/write-file-atomic/package.json index 8fad457888a3f4..76e9e9bf03159c 100644 --- a/deps/npm/node_modules/write-file-atomic/package.json +++ b/deps/npm/node_modules/write-file-atomic/package.json @@ -1,40 +1,54 @@ { "_args": [ [ - "write-file-atomic@^1.1.4", - "/Users/ogd/Documents/projects/npm/npm" + { + "raw": "write-file-atomic@1.2.0", + "scope": null, + "escapedName": "write-file-atomic", + "name": "write-file-atomic", + "rawSpec": "1.2.0", + "spec": "1.2.0", + "type": "version" + }, + "/Users/zkat/Documents/code/npm" ] ], - "_from": "write-file-atomic@>=1.1.4 <2.0.0", - "_id": "write-file-atomic@1.1.4", + "_from": "write-file-atomic@1.2.0", + "_id": "write-file-atomic@1.2.0", "_inCache": true, - "_installable": true, "_location": "/write-file-atomic", - "_nodeVersion": "5.1.0", + "_nodeVersion": "4.5.0", + "_npmOperationalInternal": { + "host": "packages-12-west.internal.npmjs.com", + "tmp": "tmp/write-file-atomic-1.2.0.tgz_1471552371956_0.5829780481290072" + }, "_npmUser": { - "email": "ogd@aoaioxxysz.net", - "name": "othiym23" + "name": "iarna", + "email": "me@re-becca.org" }, - "_npmVersion": "3.5.1", + "_npmVersion": "3.10.7", "_phantomChildren": {}, "_requested": { - "name": "write-file-atomic", - "raw": "write-file-atomic@^1.1.4", - "rawSpec": "^1.1.4", + "raw": "write-file-atomic@1.2.0", "scope": null, - "spec": ">=1.1.4 <2.0.0", - "type": "range" + "escapedName": "write-file-atomic", + "name": "write-file-atomic", + "rawSpec": "1.2.0", + "spec": "1.2.0", + "type": "version" }, "_requiredBy": [ + "#USER", "/" ], - "_shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", + "_resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.2.0.tgz", + "_shasum": "14c66d4e4cb3ca0565c28cf3b7a6f3e4d5938fab", "_shrinkwrap": null, - "_spec": "write-file-atomic@^1.1.4", - "_where": "/Users/ogd/Documents/projects/npm/npm", + "_spec": "write-file-atomic@1.2.0", + "_where": "/Users/zkat/Documents/code/npm", "author": { - "email": "me@re-becca.org", "name": "Rebecca Turner", + "email": "me@re-becca.org", "url": "http://re-becca.org" }, "bugs": { @@ -49,18 +63,22 @@ "devDependencies": { "require-inject": "^1.1.0", "standard": "^5.4.1", - "tap": "^2.3.1" + "tap": "^2.3.1", + "tmp": "0.0.28" }, "directories": {}, "dist": { - "shasum": "b1f52dc2e8dc0e3cb04d187a25f758a38a90ca3b", - "tarball": "http://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.1.4.tgz" + "shasum": "14c66d4e4cb3ca0565c28cf3b7a6f3e4d5938fab", + "tarball": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.2.0.tgz" }, - "gitHead": "42dc04a17af96ac045f4979c8c951ee5a14a8b8b", + "files": [ + "index.js" + ], + "gitHead": "c29f37cb5955f597066ad7aedea7aa6f7408a5b7", "homepage": "https://github.com/iarna/write-file-atomic", "keywords": [ - "atomic", - "writeFile" + "writeFile", + "atomic" ], "license": "ISC", "main": "index.js", @@ -84,5 +102,5 @@ "scripts": { "test": "standard && tap --coverage test/*.js" }, - "version": "1.1.4" + "version": "1.2.0" } diff --git a/deps/npm/node_modules/write-file-atomic/test/basic.js b/deps/npm/node_modules/write-file-atomic/test/basic.js deleted file mode 100644 index 13b971973321d2..00000000000000 --- a/deps/npm/node_modules/write-file-atomic/test/basic.js +++ /dev/null @@ -1,97 +0,0 @@ -'use strict' -var test = require('tap').test -var requireInject = require('require-inject') -var writeFileAtomic = requireInject('../index', { - 'graceful-fs': { - writeFile: function (tmpfile, data, options, cb) { - if (/nowrite/.test(tmpfile)) return cb(new Error('ENOWRITE')) - cb() - }, - chown: function (tmpfile, uid, gid, cb) { - if (/nochown/.test(tmpfile)) return cb(new Error('ENOCHOWN')) - cb() - }, - rename: function (tmpfile, filename, cb) { - if (/norename/.test(tmpfile)) return cb(new Error('ENORENAME')) - cb() - }, - unlink: function (tmpfile, cb) { - if (/nounlink/.test(tmpfile)) return cb(new Error('ENOUNLINK')) - cb() - }, - writeFileSync: function (tmpfile, data, options) { - if (/nowrite/.test(tmpfile)) throw new Error('ENOWRITE') - }, - chownSync: function (tmpfile, uid, gid) { - if (/nochown/.test(tmpfile)) throw new Error('ENOCHOWN') - }, - renameSync: function (tmpfile, filename) { - if (/norename/.test(tmpfile)) throw new Error('ENORENAME') - }, - unlinkSync: function (tmpfile) { - if (/nounlink/.test(tmpfile)) throw new Error('ENOUNLINK') - } - } -}) -var writeFileAtomicSync = writeFileAtomic.sync - -test('async tests', function (t) { - t.plan(7) - writeFileAtomic('good', 'test', {mode: '0777'}, function (err) { - t.notOk(err, 'No errors occur when passing in options') - }) - writeFileAtomic('good', 'test', function (err) { - t.notOk(err, 'No errors occur when NOT passing in options') - }) - writeFileAtomic('nowrite', 'test', function (err) { - t.is(err.message, 'ENOWRITE', 'writeFile failures propagate') - }) - writeFileAtomic('nochown', 'test', {chown: {uid: 100, gid: 100}}, function (err) { - t.is(err.message, 'ENOCHOWN', 'Chown failures propagate') - }) - writeFileAtomic('nochown', 'test', function (err) { - t.notOk(err, 'No attempt to chown when no uid/gid passed in') - }) - writeFileAtomic('norename', 'test', function (err) { - t.is(err.message, 'ENORENAME', 'Rename errors propagate') - }) - writeFileAtomic('norename nounlink', 'test', function (err) { - t.is(err.message, 'ENORENAME', 'Failure to unlink the temp file does not clobber the original error') - }) -}) - -test('sync tests', function (t) { - t.plan(7) - var throws = function (shouldthrow, msg, todo) { - var err - try { todo() } catch (e) { err = e } - t.is(shouldthrow, err.message, msg) - } - var noexception = function (msg, todo) { - var err - try { todo() } catch (e) { err = e } - t.notOk(err, msg) - } - - noexception('No errors occur when passing in options', function () { - writeFileAtomicSync('good', 'test', {mode: '0777'}) - }) - noexception('No errors occur when NOT passing in options', function () { - writeFileAtomicSync('good', 'test') - }) - throws('ENOWRITE', 'writeFile failures propagate', function () { - writeFileAtomicSync('nowrite', 'test') - }) - throws('ENOCHOWN', 'Chown failures propagate', function () { - writeFileAtomicSync('nochown', 'test', {chown: {uid: 100, gid: 100}}) - }) - noexception('No attempt to chown when no uid/gid passed in', function () { - writeFileAtomicSync('nochown', 'test') - }) - throws('ENORENAME', 'Rename errors propagate', function () { - writeFileAtomicSync('norename', 'test') - }) - throws('ENORENAME', 'Failure to unlink the temp file does not clobber the original error', function () { - writeFileAtomicSync('norename nounlink', 'test') - }) -}) diff --git a/deps/npm/package.json b/deps/npm/package.json index 0a34e4355e8608..55659aab66248a 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "3.10.3", + "version": "3.10.8", "name": "npm", "description": "a package manager for JavaScript", "keywords": [ @@ -45,34 +45,34 @@ "fs-vacuum": "~1.2.9", "fs-write-stream-atomic": "~1.0.8", "fstream": "~1.0.10", - "fstream-npm": "~1.1.0", - "glob": "~7.0.4", - "graceful-fs": "~4.1.4", + "fstream-npm": "~1.2.0", + "glob": "~7.0.6", + "graceful-fs": "~4.1.6", "has-unicode": "~2.0.1", "hosted-git-info": "~2.1.5", "iferr": "~0.1.5", "inflight": "~1.0.5", - "inherits": "~2.0.1", + "inherits": "~2.0.3", "ini": "~1.3.4", "init-package-json": "~1.9.4", "lockfile": "~1.0.1", "lodash._baseuniq": "~4.6.0", - "lodash.clonedeep": "~4.3.2", - "lodash.union": "~4.4.0", - "lodash.uniq": "~4.3.0", - "lodash.without": "~4.2.0", + "lodash.clonedeep": "~4.5.0", + "lodash.union": "~4.6.0", + "lodash.uniq": "~4.5.0", + "lodash.without": "~4.4.0", "mkdirp": "~0.5.1", - "node-gyp": "~3.3.1", + "node-gyp": "~3.4.0", "nopt": "~3.0.6", "normalize-git-url": "~3.0.2", "normalize-package-data": "~2.3.5", "npm-cache-filename": "~1.0.2", "npm-install-checks": "~3.0.0", "npm-package-arg": "~4.2.0", - "npm-registry-client": "~7.1.2", - "npm-user-validate": "~0.1.4", - "npmlog": "~3.1.2", - "once": "~1.3.3", + "npm-registry-client": "~7.2.1", + "npm-user-validate": "~0.1.5", + "npmlog": "~4.0.0", + "once": "~1.4.0", "opener": "~1.4.1", "osenv": "~0.1.3", "path-is-inside": "~1.0.1", @@ -81,12 +81,12 @@ "read-installed": "~4.0.3", "read-package-json": "~2.0.4", "read-package-tree": "~5.1.5", - "readable-stream": "~2.1.4", + "readable-stream": "~2.1.5", "realize-package-specifier": "~3.0.3", - "request": "~2.72.0", - "retry": "~0.9.0", - "rimraf": "~2.5.2", - "semver": "~5.1.0", + "request": "~2.74.0", + "retry": "~0.10.0", + "rimraf": "~2.5.4", + "semver": "~5.3.0", "sha": "~2.0.1", "slide": "~1.1.6", "sorted-object": "~2.0.0", @@ -98,9 +98,9 @@ "unique-filename": "~1.1.0", "unpipe": "~1.0.0", "validate-npm-package-name": "~2.2.2", - "which": "~1.2.10", + "which": "~1.2.11", "wrappy": "~1.0.2", - "write-file-atomic": "~1.1.4" + "write-file-atomic": "~1.2.0" }, "bundleDependencies": [ "abbrev", @@ -188,7 +188,7 @@ ], "devDependencies": { "deep-equal": "~1.0.1", - "marked": "~0.3.5", + "marked": "~0.3.6", "marked-man": "~0.1.5", "npm-registry-couchapp": "~2.6.12", "npm-registry-mock": "~1.0.1", @@ -196,16 +196,18 @@ "sprintf-js": "~1.0.3", "standard": "~6.0.8", "tacks": "~1.2.1", - "tap": "~5.7.2" + "tap": "~7.0.0" }, "scripts": { "dumpconf": "env | grep npm | sort | uniq", "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rimraf test/*/*/node_modules && make doc-clean && make -j4 doc", "preversion": "bash scripts/update-authors.sh && git add AUTHORS && git commit -m \"update AUTHORS\" || true", - "tap": "tap --coverage --reporter=classic --timeout 300", + "tap": "tap --reporter=classic --timeout 300", + "tap-cover": "tap --coverage --reporter=classic --timeout 600", "test": "standard && npm run test-tap", + "test-coverage": "npm run tap-cover -- \"test/tap/*.js\" \"test/network/*.js\"", "test-tap": "npm run tap -- \"test/tap/*.js\"", - "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\"" + "test-node": "\"$NODE\" \"node_modules/.bin/tap\" --timeout 240 \"test/tap/*.js\" \"test/network/*.js\"" }, "license": "Artistic-2.0" } diff --git a/deps/npm/scripts/changelog.js b/deps/npm/scripts/changelog.js index 35685ffc6031b3..c60c6c664baea8 100644 --- a/deps/npm/scripts/changelog.js +++ b/deps/npm/scripts/changelog.js @@ -13,32 +13,38 @@ the result to the changelog. */ const execSync = require('child_process').execSync const branch = process.argv[2] || 'master' -const log = execSync(`git log --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/) -const authormap = { - 'Rebecca Turner': 'iarna', - 'Forrest L Norvell': 'othiym23', - 'Kyle Mitchell': 'kemitchell', - 'Chris Rebert': 'cvrebert', - 'Kat Marchán': 'zkat' -} +const log = execSync(`git log --reverse --pretty='format:%h %H%d %s (%aN)%n%b%n---%n' ${branch}...`).toString().split(/\n/) main() +function shortname (url) { + let matched = url.match(/https:\/\/github.com\/([^/]+\/[^/]+)\/(?:pull|issues)\/(\d+)/) + if (!matched) return false + let repo = matched[1] + let id = matched[2] + if (repo !== 'npm/npm') { + return `${repo}#${id}` + } else { + return `${id}` + } +} + function print_commit (c) { - let m console.log(`* [\`${c.shortid}\`](https://github.com/npm/npm/commit/${c.fullid})`) if (c.fixes) { - console.log(` [#${c.fixes}](https://github.com/npm/npm/issues/${c.fixes})`) - } else if (c.prurl && (m = c.prurl.match(/https:\/\/github.com\/([^/]+\/[^/]+)\/pull\/(\d+)/))) { - let repo = m[1] - let prid = m[2] - if (repo !== 'npm/npm') { - console.log(` [${repo}#${prid}](${c.prurl})`) + let label = shortname(c.fixes) + if (label) { + console.log(` [${label}](${c.fixes})`) } else { - console.log(` [#${prid}](${c.prurl})`) + console.log(` [#${c.fixes}](https://github.com/npm/npm/issues/${c.fixes})`) } } else if (c.prurl) { - console.log(` [#](${c.prurl})`) + let label = shortname(c.prurl) + if (label) { + console.log(` [${label}](${c.prurl})`) + } else { + console.log(` [#](${c.prurl})`) + } } let msg = c.message .replace(/^\s+/mg, '') @@ -74,7 +80,7 @@ function main () { fullid: m[2], branch: m[3], message: m[4], - author: authormap[m[5]] || m[5], + author: m[5], prurl: null, fixes: null, credit: null @@ -84,7 +90,7 @@ function main () { } else if (m = line.match(/^Credit: @(.*)/)) { if (!commit.credit) commit.credit = [] commit.credit.push(m[1]) - } else if (m = line.match(/^Fixes: #(.*)/)) { + } else if (m = line.match(/^Fixes: (.*)/)) { commit.fixes = m[1] } else if (m = line.match(/^Reviewed-By: @(.*)/)) { commit.reviewed = m[1] diff --git a/deps/npm/scripts/maketest b/deps/npm/scripts/maketest new file mode 100755 index 00000000000000..b4f674393baac5 --- /dev/null +++ b/deps/npm/scripts/maketest @@ -0,0 +1,94 @@ +#!/usr/bin/env node +'use strict' +var loadFromDir = require('tacks/load-from-dir.js') + +process.exit(main(process.argv.slice(2))) + +function main (argv) { + if (argv.length !== 1) { + console.error('Usage: maketest ') + return 1 + } + var fixturedir = process.argv[2] + + console.log(generateFromDir(fixturedir)) + return 0 +} + +function indent (ind, str) { + return str.replace(/\n/g, '\n' + ind) +} + +function generateFromDir (dir) { + var tacks = loadFromDir(dir) + return `'use strict' +var path = require('path') +var test = require('tap').test +var mr = require('npm-registry-mock') +var Tacks = require('tacks') +var File = Tacks.File +var Symlink = Tacks.Symlink +var Dir = Tacks.Dir +var extend = Object.assign || require('util')._extend +var common = require('../common-tap.js') + +var basedir = path.join(__dirname, path.basename(__filename, '.js')) +var testdir = path.join(basedir, 'testdir') +var cachedir = path.join(basedir, 'cache') +var globaldir = path.join(basedir, 'global') +var tmpdir = path.join(basedir, 'tmp') + +var conf = { + cwd: testdir, + env: extend({ + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }, process.env) +} + +var server +var fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: ${indent(' ', tacks.fixture.toSource())} +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + mr({port: common.port, throwOnUnmatched: true}, function (err, s) { + if (err) throw err + server = s + t.done() + }) +}) + +test('example', function (t) { + common.npm(['install'], conf, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'command ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + // your assertions here + t.done() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.done() +})\n` +} diff --git a/deps/npm/test/common-tap.js b/deps/npm/test/common-tap.js index 847c87ba0fa172..14c1581f7873db 100644 --- a/deps/npm/test/common-tap.js +++ b/deps/npm/test/common-tap.js @@ -45,6 +45,7 @@ exports.npm = function (cmd, opts, cb) { if (!opts.env.npm_config_cache) { opts.env.npm_config_cache = npm_config_cache } + nodeBin = opts.nodeExecPath || nodeBin var stdout = '' var stderr = '' diff --git a/deps/npm/test/tap/bearer-token-check.js b/deps/npm/test/network/bearer-token-check.js similarity index 100% rename from deps/npm/test/tap/bearer-token-check.js rename to deps/npm/test/network/bearer-token-check.js diff --git a/deps/npm/test/tap/git-cache-locking.js b/deps/npm/test/network/git-cache-locking.js similarity index 100% rename from deps/npm/test/tap/git-cache-locking.js rename to deps/npm/test/network/git-cache-locking.js diff --git a/deps/npm/test/tap/git-cache-no-hooks.js b/deps/npm/test/network/git-cache-no-hooks.js similarity index 100% rename from deps/npm/test/tap/git-cache-no-hooks.js rename to deps/npm/test/network/git-cache-no-hooks.js diff --git a/deps/npm/test/tap/it.js b/deps/npm/test/network/it.js similarity index 100% rename from deps/npm/test/tap/it.js rename to deps/npm/test/network/it.js diff --git a/deps/npm/test/tap/legacy-bundled-git.js b/deps/npm/test/network/legacy-bundled-git.js similarity index 100% rename from deps/npm/test/tap/legacy-bundled-git.js rename to deps/npm/test/network/legacy-bundled-git.js diff --git a/deps/npm/test/tap/legacy-optional-deps.js b/deps/npm/test/network/legacy-optional-deps.js similarity index 100% rename from deps/npm/test/tap/legacy-optional-deps.js rename to deps/npm/test/network/legacy-optional-deps.js diff --git a/deps/npm/test/tap/legacy-shrinkwrap.js b/deps/npm/test/network/legacy-shrinkwrap.js similarity index 100% rename from deps/npm/test/tap/legacy-shrinkwrap.js rename to deps/npm/test/network/legacy-shrinkwrap.js diff --git a/deps/npm/test/tap/legacy-url-dep.js b/deps/npm/test/network/legacy-url-dep.js similarity index 100% rename from deps/npm/test/tap/legacy-url-dep.js rename to deps/npm/test/network/legacy-url-dep.js diff --git a/deps/npm/test/tap/outdated-symlink.js b/deps/npm/test/network/outdated-symlink.js similarity index 100% rename from deps/npm/test/tap/outdated-symlink.js rename to deps/npm/test/network/outdated-symlink.js diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/network/registry.js similarity index 100% rename from deps/npm/test/tap/registry.js rename to deps/npm/test/network/registry.js diff --git a/deps/npm/test/tap/404-private-registry-scoped.js b/deps/npm/test/tap/404-private-registry-scoped.js index 84251b113c2a9c..0f0cbc4ec70134 100644 --- a/deps/npm/test/tap/404-private-registry-scoped.js +++ b/deps/npm/test/tap/404-private-registry-scoped.js @@ -1,9 +1,24 @@ var test = require('tap').test +var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') var common = require('../common-tap.js') var mr = require('npm-registry-mock') var server +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +function setup () { + cleanup() + mkdirp.sync(testdir) +} + +function cleanup () { + rimraf.sync(testdir) +} + test('setup', function (t) { + setup() mr({port: common.port, throwOnUnmatched: true}, function (err, s) { t.ifError(err, 'registry mocked successfully') server = s @@ -12,8 +27,11 @@ test('setup', function (t) { }) test('scoped package names not mangled on error with non-root registry', function (t) { + server.get('/@scope%2ffoo').reply(404, {}) common.npm( [ + '--registry=' + common.registry, + '--cache=' + testdir, 'cache', 'add', '@scope/foo@*', @@ -23,16 +41,17 @@ test('scoped package names not mangled on error with non-root registry', functio function (er, code, stdout, stderr) { t.ifError(er, 'correctly handled 404') t.equal(code, 1, 'exited with error') - t.match(stderr, /404 Not found/, 'should notify the sort of error as a 404') + t.match(stderr, /E404/, 'should notify the sort of error as a 404') t.match(stderr, /@scope\/foo/, 'should have package name in error') + server.done() t.end() } ) }) test('cleanup', function (t) { - t.pass('cleaned up') - server.done() server.close() + cleanup() + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/404-private-registry.js b/deps/npm/test/tap/404-private-registry.js index a30f61432a4d91..a38fa02c12536e 100644 --- a/deps/npm/test/tap/404-private-registry.js +++ b/deps/npm/test/tap/404-private-registry.js @@ -1,13 +1,25 @@ -require('../common-tap') var test = require('tap').test var path = require('path') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') var common = require('../common-tap.js') var mr = require('npm-registry-mock') var server var packageName = path.basename(__filename, '.js') +var testdir = path.join(__dirname, packageName) + +function setup () { + cleanup() + mkdirp.sync(testdir) +} + +function cleanup () { + rimraf.sync(testdir) +} test('setup', function (t) { + setup() mr({port: common.port, throwOnUnmatched: true}, function (err, s) { t.ifError(err, 'registry mocked successfully') server = s @@ -16,8 +28,11 @@ test('setup', function (t) { }) test('package names not mangled on error with non-root registry', function (t) { + server.get('/' + packageName).reply(404, {}) common.npm( [ + '--registry=' + common.registry, + '--cache=' + testdir, 'cache', 'add', packageName + '@*' @@ -27,14 +42,15 @@ test('package names not mangled on error with non-root registry', function (t) { t.ifError(er, 'correctly handled 404') t.equal(code, 1, 'exited with error') t.match(stderr, packageName, 'should have package name in error') + server.done() t.end() } ) }) test('cleanup', function (t) { - t.pass('cleaned up') - server.done() server.close() + cleanup() + t.pass('cleaned up') t.end() }) diff --git a/deps/npm/test/tap/add-local.js b/deps/npm/test/tap/add-local.js new file mode 100644 index 00000000000000..cc615b8997fb8f --- /dev/null +++ b/deps/npm/test/tap/add-local.js @@ -0,0 +1,137 @@ +var path = require('path') +var test = require('tap').test +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var requireInject = require('require-inject') + +var pkg = path.join(__dirname, '/local-dir') +var cache = path.join(pkg, '/cache') +var tmp = path.join(pkg, '/tmp') +var prefix = path.join(pkg, '/prefix') + +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('addLocal directory race on Windows', function (t) { + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/get-stat': function (cb) { + cb(null, {}) + }, + chownr: function (x, y, z, cb) { + cb(new Error('chownr should never have been called')) + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('addLocal temporary cache file race', function (t) { + // See https://github.com/npm/npm/issues/12669 + setup() + var p = { + name: 'test', + version: '1.0.0', + type: 'directory', + spec: pkg + } + var fixture = new Tacks( + Dir({ + 'package.json': File(p) + }) + ) + var addLocal = requireInject('../../lib/cache/add-local', { + // basic setup/mock stuff + '../../lib/npm.js': { + cache: cache, + tmp: tmp, + prefix: prefix + }, + '../../lib/cache/add-local-tarball.js': function (tgz, data, shasum, cb) { + cb(null) + }, + '../../lib/utils/lifecycle.js': function (data, cycle, p, cb) { + cb(null) + }, + '../../lib/utils/tar.js': { + pack: function (tgz, p, data, cb) { + cb(null) + } + }, + 'sha': { + get: function (tgz, cb) { + cb(null, 'deadbeef') + } + }, + + // Test-specific mocked values to simulate race. + '../../lib/cache/get-stat': function (cb) { + cb(null, {uid: 1, gid: 2}) + }, + chownr: function (x, y, z, cb) { + // Simulate a race condition between `tar.pack` and `chownr` + // where the latter will return `ENOENT` when an async process + // removes a file that its internal `fs.readdir` listed. + cb({code: 'ENOENT'}) + } + }) + + fixture.create(pkg) + addLocal(p, null, function (err) { + t.ifErr(err, 'addLocal completed without error') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + +function setup () { + mkdirp.sync(cache) + mkdirp.sync(tmp) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/bundled-dependencies.js b/deps/npm/test/tap/bundled-dependencies.js new file mode 100644 index 00000000000000..a49610e666d2d5 --- /dev/null +++ b/deps/npm/test/tap/bundled-dependencies.js @@ -0,0 +1,112 @@ +'use strict' +var test = require('tap').test +var common = require('../common-tap.js') +var path = require('path') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var fs = require('graceful-fs') +var tar = require('tar') +var zlib = require('zlib') +var basepath = path.resolve(__dirname, path.basename(__filename, '.js')) +var fixturepath = path.resolve(basepath, 'npm-test-bundled-deps') +var targetpath = path.resolve(basepath, 'target') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +test('basic bundling', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + bundledDependencies: [ + 'addme' + ] + }), + node_modules: Dir({ + addme: Dir({ + 'index.js': File('') + }), + iggyme: Dir({ + 'index.js': File('') + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('node_modules/addme'), 'bundled dep included') + t.notOk(fileExists('node_modules/iggyme'), 'unspecified dep not included') + done() + }) +}) + +test('scoped dep bundling', function (t) { + var fixture = new Tacks( + Dir({ + 'package.json': File({ + name: 'npm-test-files', + version: '1.2.5', + bundledDependencies: [ + '@foo/addme' + ] + }), + node_modules: Dir({ + '@foo': Dir({ + addme: Dir({ + 'index.js': File('') + }), + iggyme: Dir({ + 'index.js': File('') + }) + }) + }) + }) + ) + withFixture(t, fixture, function (done) { + t.ok(fileExists('node_modules/@foo/addme'), 'bundled dep included') + t.notOk( + fileExists('node_modules/@foo/iggyme'), + 'unspecified dep not included') + done() + }) +}) + +function fileExists (file) { + try { + return !!fs.statSync(path.resolve(targetpath, 'package', file)) + } catch (_) { + return false + } +} + +function withFixture (t, fixture, tester) { + fixture.create(fixturepath) + mkdirp.sync(targetpath) + common.npm(['pack', fixturepath], {cwd: basepath}, extractAndCheck) + function extractAndCheck (err, code) { + if (err) throw err + t.is(code, 0, 'pack went ok') + extractTarball(checkTests) + } + function checkTests (err) { + if (err) throw err + tester(removeAndDone) + } + function removeAndDone (err) { + if (err) throw err + fixture.remove(fixturepath) + rimraf.sync(basepath) + t.done() + } +} + +function extractTarball (cb) { + // Unpack to disk so case-insensitive filesystems are consistent + fs.createReadStream(path.join(basepath, 'npm-test-files-1.2.5.tgz')) + .pipe(zlib.Unzip()) + .on('error', cb) + .pipe(tar.Extract(targetpath)) + .on('error', cb) + .on('end', function () { cb() }) +} diff --git a/deps/npm/test/tap/correct-mkdir.js b/deps/npm/test/tap/correct-mkdir.js index 4bfc6b1c977614..a4f86598737c05 100644 --- a/deps/npm/test/tap/correct-mkdir.js +++ b/deps/npm/test/tap/correct-mkdir.js @@ -56,3 +56,108 @@ test('correct-mkdir: no race conditions', function (t) { // Immediate call again in case of race condition there correctMkdir(cache_dir, handleCallFinish) }) + +test('correct-mkdir: ignore ENOENTs from chownr', function (t) { + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + cb({code: 'ENOENT'}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr\'s ENOENT errors were ignored') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +// NEED TO RUN LAST + +// These test checks that Windows users are protected by crashes related to +// unexpectedly having a UID/GID other than 0 if a user happens to add these +// variables to their environment. There are assumptions in correct-mkdir +// that special-case Windows by checking on UID-related things. +test('correct-mkdir: SUDO_UID and SUDO_GID non-Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + process.getuid = function () { return 0 } + process.getgid = function () { return 0 } + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.is(uid, +process.env.SUDO_UID, 'using the environment\'s UID') + t.is(gid, +process.env.SUDO_GID, 'using the environment\'s GID') + cb(null, {}) + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish () { + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) + +test('correct-mkdir: SUDO_UID and SUDO_GID Windows', function (t) { + process.env.SUDO_UID = 999 + process.env.SUDO_GID = 999 + delete process.getuid + delete process.getgid + var mock_fs = {} + mock_fs.stat = function (path, cb) { + if (path === cache_dir) { + cb(null, { + uid: 0, + isDirectory: function () { + return true + } + }) + } else { + assert.ok(false, 'Unhandled stat path: ' + path) + } + } + var mock_chownr = function (path, uid, gid, cb) { + t.fail('chownr should not be called at all on Windows') + cb('nope') + } + var mocks = { + 'graceful-fs': mock_fs, + 'chownr': mock_chownr + } + var correctMkdir = requireInject('../../lib/utils/correct-mkdir.js', mocks) + + function handleCallFinish (err) { + t.ifErr(err, 'chownr was not called because Windows') + t.end() + } + correctMkdir(cache_dir, handleCallFinish) +}) diff --git a/deps/npm/test/tap/files-and-ignores.js b/deps/npm/test/tap/files-and-ignores.js index a8f4b222b89675..88d9d12922b4e0 100644 --- a/deps/npm/test/tap/files-and-ignores.js +++ b/deps/npm/test/tap/files-and-ignores.js @@ -404,7 +404,8 @@ test('certain files ignored unconditionally', function (t) { '.npmrc', '.foo.swp', '.DS_Store', - '._ohno' + '._ohno', + 'foo.orig' ] }), '.git': Dir({foo: File('')}), @@ -421,7 +422,8 @@ test('certain files ignored unconditionally', function (t) { '.foo.swp': File(''), '.DS_Store': Dir({foo: File('')}), '._ohno': File(''), - '._ohnoes': Dir({noes: File('')}) + '._ohnoes': Dir({noes: File('')}), + 'foo.orig': File('') }) ) withFixture(t, fixture, function (done) { @@ -440,6 +442,7 @@ test('certain files ignored unconditionally', function (t) { t.notOk(fileExists('.DS_Store'), '.DS_Store not included') t.notOk(fileExists('._ohno'), '._ohno not included') t.notOk(fileExists('._ohnoes'), '._ohnoes not included') + t.notOk(fileExists('foo.orig'), 'foo.orig not included') done() }) }) diff --git a/deps/npm/test/tap/full-warning-messages.js b/deps/npm/test/tap/full-warning-messages.js index 3c74c61d0cd4e8..6745ee3db2e67f 100644 --- a/deps/npm/test/tap/full-warning-messages.js +++ b/deps/npm/test/tap/full-warning-messages.js @@ -94,8 +94,8 @@ test('tree-style', function (t) { t.notMatch(stdout, /modB/, 'modB not installed') var stderrlines = stderr.trim().split(/\n/) t.is(stderrlines.length, 2, 'two lines of warnings') - t.match(stderr, /Skipping failed optional dependency/, 'expected optional failure warning') - t.match(stderr, /Not compatible with your operating system or architecture/, 'reason for optional failure') + t.match(stderr, /SKIPPING OPTIONAL DEPENDENCY/, 'expected optional failure warning') + t.match(stderr, /Unsupported platform/, 'reason for optional failure') exists(t, modJoin(base, 'modA'), 'module A') notExists(t, modJoin(base, 'modB'), 'module B') t.done() diff --git a/deps/npm/test/tap/install-cli-only-shrinkwrap.js b/deps/npm/test/tap/install-cli-only-shrinkwrap.js new file mode 100644 index 00000000000000..17ff1ec9559eca --- /dev/null +++ b/deps/npm/test/tap/install-cli-only-shrinkwrap.js @@ -0,0 +1,139 @@ +var fs = require('graceful-fs') +var path = require('path') +var existsSync = fs.existsSync || path.existsSync + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.join(__dirname, path.basename(__filename, '.js')) + +var EXEC_OPTS = { cwd: pkg } + +var json = { + name: 'install-cli-only-shrinkwrap', + description: 'fixture', + version: '0.0.0', + dependencies: { + dependency: 'file:./dependency' + }, + devDependencies: { + 'dev-dependency': 'file:./dev-dependency' + } +} + +var shrinkwrap = { + name: 'install-cli-only-shrinkwrap', + description: 'fixture', + version: '0.0.0', + dependencies: { + dependency: { + version: '0.0.0', + from: 'file:./dependency' + }, + 'dev-dependency': { + version: '0.0.0', + from: 'file:./dev-dependency', + dev: true + } + } +} + +var dependency = { + name: 'dependency', + description: 'fixture', + version: '0.0.0' +} + +var devDependency = { + name: 'dev-dependency', + description: 'fixture', + version: '0.0.0' +} + +test('setup', function (t) { + setup() + t.pass('setup ran') + t.end() +}) + +test('\'npm install --only=development\' should only install devDependencies', function (t) { + common.npm(['install', '--only=development'], EXEC_OPTS, function (err, code, stderr, stdout) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'npm install did not raise error code') + t.ok( + existsSync( + path.resolve(pkg, 'node_modules/dev-dependency/package.json') + ), + 'devDependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dependency/package.json')), + 'dependency was NOT installed' + ) + t.end() + }) +}) + +test('\'npm install --only=production\' should only install dependencies', function (t) { + cleanup() + setup() + common.npm(['install', '--only=production'], EXEC_OPTS, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'npm install did not raise error code') + t.ok( + existsSync( + path.resolve(pkg, 'node_modules/dependency/package.json') + ), + 'dependency was installed' + ) + t.notOk( + existsSync(path.resolve(pkg, 'node_modules/dev-dependency/package.json')), + 'devDependency was NOT installed' + ) + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + mkdirp.sync(path.join(pkg, 'dependency')) + fs.writeFileSync( + path.join(pkg, 'dependency', 'package.json'), + JSON.stringify(dependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'dev-dependency')) + fs.writeFileSync( + path.join(pkg, 'dev-dependency', 'package.json'), + JSON.stringify(devDependency, null, 2) + ) + + mkdirp.sync(path.join(pkg, 'node_modules')) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + fs.writeFileSync( + path.join(pkg, 'npm-shrinkwrap.json'), + JSON.stringify(shrinkwrap, null, 2) + ) + process.chdir(pkg) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/install-parse-error.js b/deps/npm/test/tap/install-parse-error.js index b142abb39a1ade..72d19efc25dff0 100644 --- a/deps/npm/test/tap/install-parse-error.js +++ b/deps/npm/test/tap/install-parse-error.js @@ -49,3 +49,4 @@ test('cleanup', function (t) { cleanup() t.end() }) + diff --git a/deps/npm/test/tap/install-property-conflicts.js b/deps/npm/test/tap/install-property-conflicts.js new file mode 100644 index 00000000000000..8f293885abf401 --- /dev/null +++ b/deps/npm/test/tap/install-property-conflicts.js @@ -0,0 +1,74 @@ +var fs = require('fs') +var resolve = require('path').resolve + +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = resolve(__dirname, 'install-property-conflicts') +var target = resolve(pkg, '_target') + +var EXEC_OPTS = { + cwd: target +} + +var json = { + name: 'install-property-conflicts', + version: '1.2.3', + type: 'nose-boop!' +} + +test('setup', function (t) { + setup() + t.pass('setup ran') + t.end() +}) + +test('install package with a `type` property', function (t) { + t.comment('issue: https://github.com/npm/npm/issues/11398') + common.npm( + [ + 'install', + '--prefix', target, + pkg + ], + EXEC_OPTS, + function (err, code, stdout, stderr) { + t.ifError(err, 'npm command ran from test') + t.equals(code, 0, 'install exited with success (0)') + var installedPkg = resolve( + target, + 'node_modules', + 'install-property-conflicts', + 'package.json') + t.ok(fs.statSync(installedPkg), 'package installed successfully') + t.end() + } + ) +}) + +test('clean', function (t) { + cleanup() + t.pass('cleaned up') + t.end() +}) + +function setup () { + cleanup() + mkdirp.sync(pkg) + // make sure it installs locally + mkdirp.sync(resolve(target, 'node_modules')) + fs.writeFileSync( + resolve(pkg, 'package.json'), + JSON.stringify(json, null, 2) + '\n' + ) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) + rimraf.sync(target) +} diff --git a/deps/npm/test/tap/install-shrinkwrapped-git.js b/deps/npm/test/tap/install-shrinkwrapped-git.js new file mode 100644 index 00000000000000..34875ffb651a5e --- /dev/null +++ b/deps/npm/test/tap/install-shrinkwrapped-git.js @@ -0,0 +1,159 @@ +var fs = require('fs') +var path = require('path') +var resolve = path.resolve +var osenv = require('osenv') +var mkdirp = require('mkdirp') +var rimraf = require('rimraf') +var test = require('tap').test +var npm = require('../../lib/npm') +var common = require('../common-tap') +var chain = require('slide').chain + +var mockPath = resolve(__dirname, 'install-shrinkwrapped') +var parentPath = resolve(mockPath, 'parent') +var parentNodeModulesPath = path.join(parentPath, 'node_modules') +var outdatedNodeModulesPath = resolve(mockPath, 'node-modules-backup') +var childPath = resolve(mockPath, 'child.git') + +var gitDaemon +var gitDaemonPID +var git + +var parentPackageJSON = JSON.stringify({ + name: 'parent', + version: '0.1.0' +}) + +var childPackageJSON = JSON.stringify({ + name: 'child', + version: '0.1.0' +}) + +test('setup', function (t) { + setup(function (err, result) { + t.ifError(err, 'git started up successfully') + + if (!err) { + gitDaemon = result[result.length - 2] + gitDaemonPID = result[result.length - 1] + } + + t.end() + }) +}) + +test('shrinkwrapped git dependency got updated', function (t) { + t.comment('test for https://github.com/npm/npm/issues/12718') + + // Prepare the child package git repo with two commits + prepareChildAndGetRefs(function (refs) { + chain([ + // Install & shrinkwrap child package's first commit + [npm.commands.install, ['git://localhost:1234/child.git#' + refs[0]]], + [npm.commands.shrinkwrap, []], + // Backup node_modules with the first commit + [fs.rename, parentNodeModulesPath, outdatedNodeModulesPath], + // Install & shrinkwrap child package's second commit + [npm.commands.install, ['git://localhost:1234/child.git#' + refs[1]]], + [npm.commands.shrinkwrap, []], + // Restore node_modules with the first commit + [rimraf, parentNodeModulesPath], + [fs.rename, outdatedNodeModulesPath, parentNodeModulesPath], + // Update node_modules + [npm.commands.install, []] + ], function () { + var childPackageJSON = require(path.join(parentNodeModulesPath, 'child', 'package.json')) + t.equal( + childPackageJSON._resolved, + 'git://localhost:1234/child.git#' + refs[1], + "Child package wasn't updated" + ) + t.end() + }) + }) +}) + +test('clean', function (t) { + gitDaemon.on('close', function () { + cleanup() + t.end() + }) + process.kill(gitDaemonPID) +}) + +function setup (cb) { + // Setup parent package + mkdirp.sync(parentPath) + fs.writeFileSync(resolve(parentPath, 'package.json'), parentPackageJSON) + process.chdir(parentPath) + + // Setup child + mkdirp.sync(childPath) + fs.writeFileSync(resolve(childPath, 'package.json'), childPackageJSON) + + // Setup npm and then git + npm.load({ + registry: common.registry, + loglevel: 'silent', + save: true // Always install packages with --save + }, function () { + // It's important to initialize git after npm because it uses config + initializeGit(cb) + }) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(mockPath) + rimraf.sync(common['npm_config_cache']) +} + +function prepareChildAndGetRefs (cb) { + var opts = { cwd: childPath, env: { PATH: process.env.PATH } } + chain([ + [fs.writeFile, path.join(childPath, 'README.md'), ''], + git.chainableExec(['add', 'README.md'], opts), + git.chainableExec(['commit', '-m', 'Add README'], opts), + git.chainableExec(['log', '--pretty=format:"%H"', '-2'], opts) + ], function () { + var gitLogStdout = arguments[arguments.length - 1] + var refs = gitLogStdout[gitLogStdout.length - 1].split('\n').map(function (ref) { + return ref.match(/^"(.+)"$/)[1] + }).reverse() // Reverse refs order: last, first -> first, last + cb(refs) + }) +} + +function initializeGit (cb) { + git = require('../../lib/utils/git') + common.makeGitRepo({ + path: childPath, + commands: [startGitDaemon] + }, cb) +} + +function startGitDaemon (cb) { + var daemon = git.spawn( + [ + 'daemon', + '--verbose', + '--listen=localhost', + '--export-all', + '--base-path=' + mockPath, // Path to the dir that contains child.git + '--reuseaddr', + '--port=1234' + ], + { + cwd: parentPath, + env: process.env, + stdio: ['pipe', 'pipe', 'pipe'] + } + ) + daemon.stderr.on('data', function findChild (c) { + var cpid = c.toString().match(/^\[(\d+)\]/) + if (cpid[1]) { + this.removeListener('data', findChild) + cb(null, [daemon, cpid[1]]) + } + }) +} diff --git a/deps/npm/test/tap/invalid-dep-version-filtering.js b/deps/npm/test/tap/invalid-dep-version-filtering.js new file mode 100644 index 00000000000000..a4a872f54e972d --- /dev/null +++ b/deps/npm/test/tap/invalid-dep-version-filtering.js @@ -0,0 +1,135 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var mr = require('npm-registry-mock') +var common = require('../common-tap') +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var cachedir = path.join(testdir, 'cache') + +var fixture = new Tacks(Dir({ + cache: Dir(), + node_modules: Dir(), + tarballs: Dir({ + 'pkgA.tgz': File(new Buffer( + '1f8b0800000000000003edcfcf0a0221100670cf3ec5e0396cfcb703bd8d' + + '842cb5e4ca5a5da2776f5da153b78408fc5d3e6684e133f9e3e4c7b04f35' + + 'e539cf9135868883b5509206b725ea3a6f9c01a634598d8e48134365d0e0' + + 'fadebac827b77cf5cb5ae5db3bf52bf0ce3ff1e00022fa4b100710691abd' + + 'd895cd3d2cf934c7b25412250afee4bfaeda755dd735f40211b5bced0008' + + '0000', + 'hex' + )), + 'pkgB1.tgz': File(new Buffer( + '1f8b0800000000000003edcfc10a0221140550d77ec5c375d8d3d111fa1b' + + '0b196ac891b16913fd7be308adda2544f0cee6e25d3caec99f463f847daa' + + '292f798aac3144ec8d8192aeb75ba2aeef8ded8029ed8c46eb1c1a86aa43' + + 'bd76d87ac8274bbef9799df2ed9dfa1578e79f78700011fd35880388340e' + + '47b12bcd3dccf93cc5522a8912057ff25f4f258410d2d00b247d22080008' + + '0000', + 'hex' + )) + }) +})) + +var pkgAtgz = path.join(testdir, 'tarballs', 'pkgA.tgz') +var pkgB1tgz = path.join(testdir, 'tarballs', 'pkgB1.tgz') + +var server + +var pkgA = { + name: 'pkg-a', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'pkg-a', + version: '1.0.0', + dependencies: { + 'pkg-b': '1.0.0' + }, + dist: { + shasum: 'dc5471ce0439f0f47749bb01473cad4570cc7dc5', + tarball: common.registry + '/pkg-a/-/pkg-a-1.0.0.tgz' + } + } + } +} + +var pkgB = { + name: 'pkg-b', + 'dist-tags': { + latest: '1.0.0' + }, + versions: { + '1.0.0': { + name: 'pkg-b', + version: '1.0.0', + dist: { + shasum: '53031aa2cf774c0e841c6fdbbe54c13825cd5640', + tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0.tgz' + } + }, + '1.0.0rc1': { + name: 'pkg-b', + version: '1.0.0rc1', + dist: { + shasum: '7f4b1bf680e3a31113d77619b4dc7c3b4c7dc15c', + tarball: common.registry + '/pkg-b/-/pkg-b-1.0.0-rc1.tgz' + } + } + } +} + +function setup () { + cleanup() + fixture.create(testdir) +} +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + setup() + mr({ port: common.port, throwOnUnmatched: true }, function (err, s) { + t.ifError(err, 'registry mocked successfully') + server = s + t.end() + }) +}) + +test('invalid versions should be ignored', function (t) { + server.get('/pkg-a').reply(200, pkgA) + server.get('/pkg-b').reply(200, pkgB) + server.get('/pkg-a/-/pkg-a-1.0.0.tgz').replyWithFile(200, pkgAtgz) + server.get('/pkg-b/-/pkg-b-1.0.0.tgz').replyWithFile(200, pkgB1tgz) + + common.npm( + [ + 'install', + '--cache', cachedir, + '--registry', common.registry, + '--fetch-retries=0', + 'pkg-a@1.0.0' + ], + {cwd: testdir}, + function (err, code, stdout, stderr) { + if (err) throw err + t.equal(code, 0, 'install succeded') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + server.done() + t.end() + } + ) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/lifecycle-order.js b/deps/npm/test/tap/lifecycle-order.js new file mode 100644 index 00000000000000..903e1945d1e915 --- /dev/null +++ b/deps/npm/test/tap/lifecycle-order.js @@ -0,0 +1,57 @@ +var fs = require('graceful-fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var pkg = path.resolve(__dirname, path.basename(__filename, '.js')) + +var json = { + name: 'lifecycle-order', + version: '1.0.0', + scripts: { + preinstall: 'node -e "var fs = require(\'fs\'); fs.openSync(\'preinstall-step\', \'w+\'); if (fs.existsSync(\'node_modules\')) { throw \'node_modules exists on preinstall\' }"', + install: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'preinstall-step\')) { fs.openSync(\'install-step\', \'w+\') } else { throw \'Out of order\' }"', + postinstall: 'node -e "var fs = require(\'fs\'); if (fs.existsSync(\'install-step\')) { fs.openSync(\'postinstall-step\', \'w+\') } else { throw \'Out of order\' }"' + } +} + +test('setup', function (t) { + cleanup() + mkdirp.sync(pkg) + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(json, null, 2) + ) + + process.chdir(pkg) + t.end() +}) + +test('lifecycle scripts execute in the proper order', function (t) { + common.npm('install', {cwd: pkg}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'no error') + + // All three files should exist + t.ok(fs.existsSync(path.join(pkg, 'preinstall-step')), 'preinstall ok') + t.ok(fs.existsSync(path.join(pkg, 'install-step')), 'install ok') + t.ok(fs.existsSync(path.join(pkg, 'postinstall-step')), 'postinstall ok') + + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/lifecycle-path.js b/deps/npm/test/tap/lifecycle-path.js index 3264fe87be9552..684fd4d3b589b8 100644 --- a/deps/npm/test/tap/lifecycle-path.js +++ b/deps/npm/test/tap/lifecycle-path.js @@ -31,11 +31,33 @@ test('setup', function (t) { t.end() }) -test('make sure the path is correct', function (t) { +test('make sure the path is correct, without directory of current node', function (t) { + checkPath(false, t) +}) + +test('make sure the path is correct, with directory of current node', function (t) { + checkPath(true, t) +}) + +function checkPath (withDirOfCurrentNode, t) { + var newPATH = PATH + var currentNodeExecPath = process.execPath + if (withDirOfCurrentNode) { + var newNodeExeDir = path.join(pkg, 'node-bin') + mkdirp.sync(newNodeExeDir) + currentNodeExecPath = path.join(newNodeExeDir, 'my_bundled_' + path.basename(process.execPath)) + fs.writeFileSync(currentNodeExecPath, fs.readFileSync(process.execPath)) + fs.chmodSync(currentNodeExecPath, '755') + } else { + // Ensure that current node interpreter will be found in the PATH, + // so the PATH won't be prepended with its parent directory + newPATH = [path.dirname(process.execPath), PATH].join(process.platform === 'win32' ? ';' : ':') + } common.npm(['run-script', 'env'], { cwd: pkg, + nodeExecPath: currentNodeExecPath, env: { - PATH: PATH + PATH: newPATH }, stdio: [ 0, 'pipe', 2 ] }, function (er, code, stdout) { @@ -60,17 +82,18 @@ test('make sure the path is correct', function (t) { }) // get the ones we tacked on, then the system-specific requirements - var expect = [ - '{{ROOT}}/bin/node-gyp-bin', - '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin', - path.dirname(process.execPath) - ].concat(PATH.split(pathSplit)).map(function (p) { + var expectedPaths = ['{{ROOT}}/bin/node-gyp-bin', + '{{ROOT}}/test/tap/lifecycle-path/node_modules/.bin'] + if (withDirOfCurrentNode) { + expectedPaths.push('{{ROOT}}/test/tap/lifecycle-path/node-bin') + } + var expect = expectedPaths.concat(newPATH.split(pathSplit)).map(function (p) { return p.replace(/\\/g, '/') }) t.same(actual, expect) t.end() }) -}) +} test('cleanup', function (t) { cleanup() diff --git a/deps/npm/test/tap/local-args-relative-to-cwd.js b/deps/npm/test/tap/local-args-relative-to-cwd.js new file mode 100644 index 00000000000000..6c424bf67f123c --- /dev/null +++ b/deps/npm/test/tap/local-args-relative-to-cwd.js @@ -0,0 +1,65 @@ +'use strict' +var fs = require('graceful-fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +var fixture = new Tacks( + Dir({ + example: Dir({ + }), + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0' + }) + }), + node_modules: Dir({ + }) + }) +) + +function setup () { + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + cleanup() + setup() + t.end() +}) + +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} + +test('local-args-relative-to-cwd', function (t) { + var instdir = path.join(testdir, 'example') + var config = ['--loglevel=error'] + common.npm(config.concat(['install', '../mod1']), {cwd: instdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'install ran ok') + t.ok(exists(path.join(testdir, 'node_modules', 'mod1')), 'mod1 installed') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/node-modules-path-munge.js b/deps/npm/test/tap/node-modules-path-munge.js new file mode 100644 index 00000000000000..fdca0393cc1d10 --- /dev/null +++ b/deps/npm/test/tap/node-modules-path-munge.js @@ -0,0 +1,39 @@ +var common = require('../common-tap.js') +var t = require('tap') +var fs = require('fs') +var rimraf = require('rimraf') +var mkdirp = require('mkdirp') +var path = require('path') +var dir = path.join(__dirname, 'my_node_modules') +var script = process.platform === 'win32' ? 'echo %PATH%' : 'echo $PATH' + +t.test('setup', function (t) { + rimraf.sync(dir) + mkdirp.sync(dir) + fs.writeFileSync(dir + '/package.json', JSON.stringify({ + name: 'my_node_modules', + version: '1.2.3', + scripts: { + test: script + } + })) + t.end() +}) + +t.test('verify PATH is munged right', function (t) { + common.npm(['test'], { cwd: dir }, function (err, code, stdout, stderr) { + if (err) { + throw err + } + t.equal(code, 0, 'exit ok') + t.notOk(stderr, 'should have no stderr') + var expect = path.resolve(dir, 'node_modules', '.bin').toLowerCase() + t.contains(stdout.toLowerCase(), expect) + t.end() + }) +}) + +t.test('cleanup', function (t) { + rimraf.sync(dir) + t.end() +}) diff --git a/deps/npm/test/tap/optional-metadep-rollback-collision.js b/deps/npm/test/tap/optional-metadep-rollback-collision.js index a9294858d2722c..bc1bccd16e93c0 100644 --- a/deps/npm/test/tap/optional-metadep-rollback-collision.js +++ b/deps/npm/test/tap/optional-metadep-rollback-collision.js @@ -199,14 +199,12 @@ test('go go test racer', function (t) { env: { PATH: process.env.PATH, Path: process.env.Path - }, - stdio: [0, 'pipe', 2] + } }, function (er, code, stdout, stderr) { t.ifError(er, 'install ran to completion without error') t.is(code, 0, 'npm install exited with code 0') - t.is(stderr, '') - + t.comment(stdout.trim()) // stdout should be empty, because we only have one, optional, dep and // if it fails we shouldn't try installing anything t.equal(stdout, '') diff --git a/deps/npm/test/tap/shrinkwrap-default-arg-ver.js b/deps/npm/test/tap/shrinkwrap-default-arg-ver.js new file mode 100644 index 00000000000000..d87bc92391ffe6 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-default-arg-ver.js @@ -0,0 +1,104 @@ +'use strict' +var path = require('path') +var fs = require('graceful-fs') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var mr = require('npm-registry-mock') + +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var config = [ + '--loglevel=error', + '--registry=' + common.registry, + '--cache=' + path.join(testdir, 'cache') +] + +var fixture = new Tacks( + Dir({ + 'cache': Dir(), + 'npm-shrinkwrap.json': File({ + name: 'shrinkwrap-default-arg-ver', + version: '1.0.0', + dependencies: { + underscore: { + version: '1.3.1', + from: 'mod1@>=1.3.1 <2.0.0', + resolved: common.registry + '/underscore/-/underscore-1.3.1.tgz' + } + } + }), + 'package.json': File({ + name: 'shrinkwrap-default-arg-ver', + version: '1.0.0', + dependencies: { + underscore: '^1.3.1' + } + }) + }) +) +var installed = path.join(testdir, 'node_modules', 'underscore', 'package.json') + +function setup () { + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +var server +test('setup', function (t) { + cleanup() + setup() + mr({port: common.port}, function (er, s) { + if (er) throw er + server = s + t.end() + }) +}) + +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} +test('shrinkwrap-default-arg-version', function (t) { + // When this feature was malfunctioning npm would select the version of + // `mod1` from the `package.json` instead of the `npm-shrinkwrap.json`, + // which in this case would mean trying the registry instead of installing + // from a local folder. + common.npm(config.concat(['install', 'underscore']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'installed ok') + t.ok(exists(path.join(testdir, 'node_modules', 'underscore')), 'underscore installed') + var pjson = JSON.parse(fs.readFileSync(installed)) + t.is(pjson.version, '1.3.1', 'got shrinkwrap version') + t.end() + }) +}) + +test('can-override', function (t) { + common.npm(config.concat(['install', 'underscore@latest']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.is(code, 0, 'installed ok') + t.ok(exists(path.join(testdir, 'node_modules', 'underscore')), 'underscore installed') + var pjson = JSON.parse(fs.readFileSync(installed)) + t.is(pjson.version, '1.5.1', 'got latest version') + t.end() + }) +}) + +test('cleanup', function (t) { + server.close() + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js b/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js new file mode 100644 index 00000000000000..c9511bb152ea74 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-dev-dep-cycle.js @@ -0,0 +1,93 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var common = require('../common-tap.js') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) + +var fixture = new Tacks( + Dir({ + node_modules: Dir({ + 'a': Dir({ + 'package.json': File({ + _requested: { + rawSpec: 'file:///mods/a' + }, + dependencies: { + 'b': 'file:///mods/b' + }, + name: 'a', + version: '1.0.0' + }) + }), + 'b': Dir({ + 'package.json': File({ + _requested: { + rawSpec: 'file:///mods/b' + }, + dependencies: { + 'a': 'file:///mods/a' + }, + name: 'b', + version: '1.0.0' + }) + }) + }), + 'package.json': File({ + name: 'test', + version: '1.0.0', + devDependencies: { + 'a': 'file:///mods/a' + } + }) + }) +) + +var expectedShrinkwrap = { + name: 'test', + version: '1.0.0', + dependencies: {} +} + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +function readJson (file) { + try { + var contents = fs.readFileSync(file) + return JSON.parse(contents) + } catch (ex) { + return ex + } +} + +test('setup', function (t) { + setup() + t.end() +}) + +test('shrinkwrap cycle in dev deps', function (t) { + common.npm(['shrinkwrap'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'result code = ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + var actualShrinkwrap = readJson(path.join(testdir, 'npm-shrinkwrap.json')) + t.isDeeply(actualShrinkwrap, expectedShrinkwrap, 'shrinkwrap is right') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/shrinkwrap-local-dependency.js b/deps/npm/test/tap/shrinkwrap-local-dependency.js index 8d7c0712f9ae58..d3537756c062d8 100644 --- a/deps/npm/test/tap/shrinkwrap-local-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-local-dependency.js @@ -1,121 +1,123 @@ var test = require('tap').test var path = require('path') var fs = require('fs') -var osenv = require('osenv') var rimraf = require('rimraf') -var mkdirp = require('mkdirp') var common = require('../common-tap.js') - -var PKG_DIR = path.resolve(__dirname, 'shrinkwrap-local-dependency') -var CACHE_DIR = path.resolve(PKG_DIR, 'cache') -var DEP_DIR = path.resolve(PKG_DIR, 'dep') - -var desired = { - 'name': 'npm-test-shrinkwrap-local-dependency', - 'version': '0.0.0', - 'dependencies': { - 'npm-test-shrinkwrap-local-dependency-dep': { - 'version': '0.0.0', - 'from': 'dep', - 'resolved': 'file:dep' +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir + +var testdir = path.resolve(__dirname, path.basename(__filename, '.js')) +var cachedir = path.resolve(testdir, 'cache') +var config = ['--cache=' + cachedir, '--loglevel=error'] + +var shrinkwrap = { + name: 'shrinkwrap-local-dependency', + version: '1.0.0', + dependencies: { + mod2: { + version: '1.0.0', + from: path.join('mods', 'mod2'), + resolved: 'file:' + path.join('mods', 'mod2'), + dependencies: { + mod1: { + version: '1.0.0', + from: path.join('mods', 'mod1'), + resolved: 'file:' + path.join('mods', 'mod1') + } + } } } } -var root = { - 'author': 'Thomas Torp', - 'name': 'npm-test-shrinkwrap-local-dependency', - 'version': '0.0.0', - 'dependencies': { - 'npm-test-shrinkwrap-local-dependency-dep': 'file:./dep' - } +var fixture = new Tacks( + Dir({ + cache: Dir(), + mods: Dir({ + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0' + }) + }), + mod2: Dir({ + 'package.json': File({ + name: 'mod2', + version: '1.0.0', + dependencies: { + mod1: 'file:' + path.join('..', 'mod1') + } + }) + }) + }), + 'package.json': File({ + name: 'shrinkwrap-local-dependency', + version: '1.0.0', + dependencies: { + mod2: 'file:' + path.join('mods', 'mod2') + } + }) + }) +) + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanNodeModules () { + rimraf.sync(path.resolve(testdir, 'node_modules')) } -var dependency = { - 'author': 'Thomas Torp', - 'name': 'npm-test-shrinkwrap-local-dependency-dep', - 'version': '0.0.0' +function cleanup () { + fixture.remove(testdir) } test('shrinkwrap uses resolved with file: on local deps', function (t) { setup() - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], - {}, - function (err, code) { - t.ifError(err, 'npm install worked') - t.equal(code, 0, 'npm exited normally') - - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'shrinkwrap'], - {}, - function (err, code) { - t.ifError(err, 'npm shrinkwrap worked') - t.equal(code, 0, 'npm exited normally') - - fs.readFile('npm-shrinkwrap.json', { encoding: 'utf8' }, function (err, data) { - t.ifError(err, 'read file correctly') - t.deepEqual(JSON.parse(data), desired, 'shrinkwrap looks correct') + common.npm(config.concat(['install', '--legacy']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') - t.end() - }) - } - ) - } - ) + common.npm(config.concat('shrinkwrap'), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') + var data = fs.readFileSync(path.join(testdir, 'npm-shrinkwrap.json'), { encoding: 'utf8' }) + t.deepEqual(JSON.parse(data), shrinkwrap, 'shrinkwrap looks correct') + t.end() + }) + }) }) +function exists (file) { + try { + fs.statSync(file) + return true + } catch (ex) { + return false + } +} + test("'npm install' should install local packages from shrinkwrap", function (t) { cleanNodeModules() - common.npm( - ['--cache=' + CACHE_DIR, '--loglevel=silent', 'install', '.'], - {}, - function (err, code) { - t.ifError(err, 'install ran correctly') - t.notOk(code, 'npm install exited with code 0') - var dependencyPackageJson = path.resolve( - PKG_DIR, - 'node_modules/npm-test-shrinkwrap-local-dependency-dep/package.json' - ) - t.ok( - JSON.parse(fs.readFileSync(dependencyPackageJson, 'utf8')), - 'package with local dependency installed from shrinkwrap' - ) - - t.end() - } - ) + common.npm(config.concat(['install']), {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.equal(code, 0, 'npm exited normally') + t.ok(exists(path.join(testdir, 'node_modules', 'mod2')), 'mod2 exists') + t.ok(exists(path.join(testdir, 'node_modules', 'mod2', 'node_modules', 'mod1')), 'mod1 exists') + t.end() + }) }) test('cleanup', function (t) { cleanup() t.end() }) - -function setup () { - cleanup() - mkdirp.sync(PKG_DIR) - mkdirp.sync(CACHE_DIR) - mkdirp.sync(DEP_DIR) - fs.writeFileSync( - path.resolve(PKG_DIR, 'package.json'), - JSON.stringify(root, null, 2) - ) - fs.writeFileSync( - path.resolve(DEP_DIR, 'package.json'), - JSON.stringify(dependency, null, 2) - ) - process.chdir(PKG_DIR) -} - -function cleanNodeModules () { - rimraf.sync(path.resolve(PKG_DIR, 'node_modules')) -} - -function cleanup () { - process.chdir(osenv.tmpdir()) - cleanNodeModules() - rimraf.sync(PKG_DIR) -} diff --git a/deps/npm/test/tap/shrinkwrap-optional-platform.js b/deps/npm/test/tap/shrinkwrap-optional-platform.js new file mode 100644 index 00000000000000..09d26f778be303 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-optional-platform.js @@ -0,0 +1,96 @@ +'use strict' +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var File = Tacks.File +var Dir = Tacks.Dir +var extend = Object.assign || require('util')._extend +var common = require('../common-tap.js') + +var basedir = path.join(__dirname, path.basename(__filename, '.js')) +var testdir = path.join(basedir, 'testdir') +var cachedir = path.join(basedir, 'cache') +var globaldir = path.join(basedir, 'global') +var tmpdir = path.join(basedir, 'tmp') + +var conf = { + cwd: testdir, + env: extend(extend({}, process.env), { + npm_config_cache: cachedir, + npm_config_tmp: tmpdir, + npm_config_prefix: globaldir, + npm_config_registry: common.registry, + npm_config_loglevel: 'warn' + }) +} + +var fixture = new Tacks(Dir({ + cache: Dir(), + global: Dir(), + tmp: Dir(), + testdir: Dir({ + mod1: Dir({ + 'package.json': File({ + name: 'mod1', + version: '1.0.0', + scripts: { + + }, + os: ['nosuchos'] + }) + }), + 'npm-shrinkwrap.json': File({ + name: 'shrinkwrap-optional-platform', + version: '1.0.0', + dependencies: { + mod1: { + version: '1.0.0', + from: 'mod1', + resolved: 'file:mod1', + optional: true + } + } + }), + 'package.json': File({ + name: 'shrinkwrap-optional-platform', + version: '1.0.0', + optionalDependencies: { + mod1: 'file:mod1' + }, + description: 'x', + repository: 'x', + license: 'Artistic-2.0' + }) + }) +})) + +function setup () { + cleanup() + fixture.create(basedir) +} + +function cleanup () { + fixture.remove(basedir) +} + +test('setup', function (t) { + setup() + t.done() +}) + +test('example', function (t) { + common.npm(['install'], conf, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'install ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.notMatch(stderr, /Exit status 1/, 'did not try to install opt dep') + t.done() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.done() +}) + diff --git a/deps/npm/test/tap/shrinkwrap-optional-property.js b/deps/npm/test/tap/shrinkwrap-optional-property.js new file mode 100644 index 00000000000000..47f11a750b233d --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-optional-property.js @@ -0,0 +1,100 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var mr = require('npm-registry-mock') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') +var npm = npm = require('../../') + +var pkg = path.resolve(__dirname, 'shrinkwrap-optional-dependency') + +test('shrinkwrap adds optional property when optional dependency', function (t) { + t.plan(1) + + mr({port: common.port}, function (er, s) { + function fail (err) { + s.close() // Close on failure to allow node to exit + t.fail(err) + } + + setup(function (err) { + if (err) return fail(err) + + // Install with the optional dependency + npm.install('.', function (err) { + if (err) return fail(err) + + writePackage() + + npm.commands.shrinkwrap([], true, function (err, results) { + if (err) return fail(err) + + t.deepEqual(results, desired) + s.close() + t.end() + }) + }) + }) + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +var desired = { + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': { + version: '0.0.0', + from: 'test-package@0.0.0', + resolved: common.registry + '/test-package/-/test-package-0.0.0.tgz' + }, + 'underscore': { + version: '1.3.3', + from: 'underscore@1.3.3', + resolved: 'http://localhost:1337/underscore/-/underscore-1.3.3.tgz', + optional: true + } + } +} + +var json = { + author: 'Maximilian Antoni', + name: 'npm-test-shrinkwrap-optional-dependency', + version: '0.0.0', + dependencies: { + 'test-package': '0.0.0' + }, + optionalDependencies: { + 'underscore': '1.3.3' + } +} + +function writePackage () { + fs.writeFileSync(path.join(pkg, 'package.json'), JSON.stringify(json, null, 2)) +} + +function setup (cb) { + cleanup() + mkdirp.sync(pkg) + writePackage() + process.chdir(pkg) + + var opts = { + cache: path.resolve(pkg, 'cache'), + registry: common.registry + } + npm.load(opts, cb) +} + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(pkg) +} diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js index 723960ac321699..d3e86fcd659c18 100644 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js +++ b/deps/npm/test/tap/shrinkwrap-prod-dependency-also.js @@ -70,6 +70,7 @@ var desired = { resolved: common.registry + '/request/-/request-0.9.0.tgz' }, underscore: { + dev: true, version: '1.5.1', from: 'underscore@1.5.1', resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' diff --git a/deps/npm/test/tap/shrinkwrap-prod-dependency.js b/deps/npm/test/tap/shrinkwrap-prod-dependency.js index 5bc834376eb1a3..57d6ecd3b19d9a 100644 --- a/deps/npm/test/tap/shrinkwrap-prod-dependency.js +++ b/deps/npm/test/tap/shrinkwrap-prod-dependency.js @@ -50,6 +50,7 @@ var desired = { resolved: common.registry + '/request/-/request-0.9.0.tgz' }, underscore: { + dev: true, version: '1.5.1', from: 'underscore@1.5.1', resolved: common.registry + '/underscore/-/underscore-1.5.1.tgz' diff --git a/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js b/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js new file mode 100644 index 00000000000000..eacea9e3ceafe3 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-save-dev-with-existing-deps.js @@ -0,0 +1,102 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installme = path.join(base, 'installme') +var installme_pkg = path.join(installme, 'package.json') +var example = path.join(base, 'example') +var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') +var example_pkg = path.join(example, 'package.json') +var installed_prod = path.join(example, 'node_modules', 'installed-prod') +var installed_prod_pkg = path.join(installed_prod, 'package.json') +var installed_dev = path.join(example, 'node_modules', 'installed-dev') +var installed_dev_pkg = path.join(installed_dev, 'package.json') + +var EXEC_OPTS = { cwd: example } + +var installme_pkg_json = { + name: 'installme', + version: '1.0.0', + dependencies: {} +} + +var example_pkg_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed-prod': '1.0' + }, + devDependencies: { + 'installed-dev': '1.0' + } +} + +var example_shrinkwrap_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed-prod': { + version: '1.0.0' + }, + 'installed-dev': { + version: '1.0.0' + } + } +} + +var installed_prod_pkg_json = { + _id: 'installed-prod@1.0.0', + name: 'installed-prod', + version: '1.0.0' +} + +var installed_dev_pkg_json = { + _id: 'installed-dev@1.0.0', + name: 'installed-dev', + version: '1.0.0' +} + +function writeJson (filename, obj) { + mkdirp.sync(path.dirname(filename)) + fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) +} + +test('setup', function (t) { + cleanup() + writeJson(installme_pkg, installme_pkg_json) + writeJson(example_pkg, example_pkg_json) + writeJson(example_shrinkwrap, example_shrinkwrap_json) + writeJson(installed_prod_pkg, installed_prod_pkg_json) + writeJson(installed_dev_pkg, installed_dev_pkg_json) + t.end() +}) + +test('install --save-dev leaves prod deps alone', function (t) { + common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { + t.ifError(er, "spawn didn't catch fire") + t.is(code, 0, 'install completed ok') + t.is(stderr, '', 'install completed without error output') + var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) + t.ok(shrinkwrap.dependencies['installed-prod'], "save-dev new install didn't remove prod dep") + t.ok(shrinkwrap.dependencies['installed-dev'], "save-dev new install didn't remove dev dep") + t.ok(shrinkwrap.dependencies.installme, 'save-dev new install DID add new dev dep') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js b/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js new file mode 100644 index 00000000000000..436b17895a4838 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-save-dev-without-existing-dev-deps.js @@ -0,0 +1,87 @@ +var fs = require('fs') +var path = require('path') + +var mkdirp = require('mkdirp') +var osenv = require('osenv') +var rimraf = require('rimraf') +var test = require('tap').test + +var common = require('../common-tap.js') + +var base = path.resolve(__dirname, path.basename(__filename, '.js')) +var installme = path.join(base, 'installme') +var installme_pkg = path.join(installme, 'package.json') +var example = path.join(base, 'example') +var example_shrinkwrap = path.join(example, 'npm-shrinkwrap.json') +var example_pkg = path.join(example, 'package.json') +var installed = path.join(example, 'node_modules', 'installed') +var installed_pkg = path.join(installed, 'package.json') + +var EXEC_OPTS = { cwd: example } + +var installme_pkg_json = { + name: 'installme', + version: '1.0.0', + dependencies: {} +} + +var example_pkg_json = { + name: 'example', + version: '1.0.0', + dependencies: { + 'installed': '1.0' + }, + devDependencies: {} +} + +var example_shrinkwrap_json = { + name: 'example', + version: '1.0.0', + dependencies: { + installed: { + version: '1.0.0' + } + } +} + +var installed_pkg_json = { + _id: 'installed@1.0.0', + name: 'installed', + version: '1.0.0' +} + +function writeJson (filename, obj) { + mkdirp.sync(path.dirname(filename)) + fs.writeFileSync(filename, JSON.stringify(obj, null, 2)) +} + +test('setup', function (t) { + cleanup() + writeJson(installme_pkg, installme_pkg_json) + writeJson(example_pkg, example_pkg_json) + writeJson(example_shrinkwrap, example_shrinkwrap_json) + writeJson(installed_pkg, installed_pkg_json) + t.end() +}) + +test('install --save-dev leaves dev deps alone', function (t) { + common.npm(['install', '--save-dev', 'file://' + installme], EXEC_OPTS, function (er, code, stdout, stderr) { + t.ifError(er, "spawn didn't catch fire") + t.is(code, 0, 'install completed ok') + t.is(stderr, '', 'install completed without error output') + var shrinkwrap = JSON.parse(fs.readFileSync(example_shrinkwrap)) + t.ok(shrinkwrap.dependencies.installed, "save-dev new install didn't remove dep") + t.notOk(shrinkwrap.dependencies.installme, 'save-dev new install DID NOT add new dev dep') + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) + +function cleanup () { + process.chdir(osenv.tmpdir()) + rimraf.sync(base) +} diff --git a/deps/npm/test/tap/shrinkwrap-transitive-dev.js b/deps/npm/test/tap/shrinkwrap-transitive-dev.js new file mode 100644 index 00000000000000..80a38f7f9eb2b6 --- /dev/null +++ b/deps/npm/test/tap/shrinkwrap-transitive-dev.js @@ -0,0 +1,83 @@ +'use strict' +var fs = require('fs') +var path = require('path') +var test = require('tap').test +var Tacks = require('tacks') +var common = require('../common-tap.js') +var File = Tacks.File +var Dir = Tacks.Dir + +var testname = path.basename(__filename, '.js') +var testdir = path.join(__dirname, testname) +var cachedir = path.join(testdir, 'cache') +var swfile = path.join(testdir, 'npm-shrinkwrap.json') +var fixture = new Tacks( + Dir({ + cache: Dir(), + mods: Dir({ + moda: Dir({ + 'package.json': File({ + name: 'moda', + version: '1.0.0', + dependencies: { + modb: '../modb' + } + }) + }), + modb: Dir({ + 'package.json': File({ + name: 'modb', + version: '1.0.0' + }) + }) + }), + 'package.json': File({ + name: testname, + version: '1.0.0', + devDependencies: { + moda: 'file:mods/moda' + } + }) + }) +) + +function setup () { + cleanup() + fixture.create(testdir) +} + +function cleanup () { + fixture.remove(testdir) +} + +test('setup', function (t) { + setup() + common.npm(['install', '--cache=' + cachedir], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'setup ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + t.end() + }) +}) + +test('transitive-deps-of-dev-deps', function (t) { + common.npm(['shrinkwrap', '--loglevel=error'], {cwd: testdir}, function (err, code, stdout, stderr) { + if (err) throw err + t.is(code, 0, 'shrinkwrap ran ok') + t.comment(stdout.trim()) + t.comment(stderr.trim()) + try { + var shrinkwrap = JSON.parse(fs.readFileSync(swfile)) + t.isDeeply(shrinkwrap.dependencies, {}, 'empty shrinkwrap') + } catch (ex) { + t.ifError(ex) + } + t.end() + }) +}) + +test('cleanup', function (t) { + cleanup() + t.end() +}) diff --git a/deps/npm/test/tap/update-symlink.js b/deps/npm/test/tap/update-symlink.js index 1447fde628a945..1fb07b8a752efa 100644 --- a/deps/npm/test/tap/update-symlink.js +++ b/deps/npm/test/tap/update-symlink.js @@ -1,6 +1,5 @@ var fs = require('graceful-fs') var path = require('path') -var osenv = require('osenv') var mkdirp = require('mkdirp') var mr = require('npm-registry-mock') var rimraf = require('rimraf') @@ -8,14 +7,17 @@ var test = require('tap').test var common = require('../common-tap.js') -var pkg = path.resolve(__dirname, 'update-symlink') -var originalLog - -var fakeRoot = path.join(__dirname, 'fakeRoot') +var testdir = path.join(__dirname, path.basename(__filename, '.js')) +var pkg = path.resolve(testdir, 'update-symlink') +var cachedir = path.join(testdir, 'cache') +var globaldir = path.join(testdir, 'global') var OPTS = { env: { - 'npm_config_prefix': fakeRoot - } + 'npm_config_cache': cachedir, + 'npm_config_prefix': globaldir, + 'npm_config_registry': common.registry + }, + cwd: pkg } var jsonLocal = { @@ -28,57 +30,92 @@ var jsonLocal = { } } +var server test('setup', function (t) { cleanup() - originalLog = console.log + mkdirp.sync(cachedir) mkdirp.sync(pkg) - common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, function (err, c, out) { + fs.writeFileSync( + path.join(pkg, 'package.json'), + JSON.stringify(jsonLocal, null, 2) + ) + + mr({ port: common.port }, thenInstallUnderscore) + + function thenInstallUnderscore (er, s) { + server = s + common.npm(['install', '-g', 'underscore@1.3.1'], OPTS, thenLink) + } + + function thenLink (err, c, out) { t.ifError(err, 'global install did not error') - process.chdir(pkg) - fs.writeFileSync( - path.join(pkg, 'package.json'), - JSON.stringify(jsonLocal, null, 2) - ) - common.npm(['link', 'underscore'], OPTS, function (err, c, out) { - t.ifError(err, 'link did not error') - common.npm(['install', 'async@0.2.9'], OPTS, function (err, c, out) { - t.ifError(err, 'local install did not error') - common.npm(['ls'], OPTS, function (err, c, out, stderr) { - t.ifError(err) - t.equal(c, 0) - t.equal(stderr, '', 'got expected stderr') - t.has(out, /async@0.2.9/, 'installed ok') - t.has(out, /underscore@1.3.1/, 'creates local link ok') - t.end() - }) - }) - }) - }) -}) + common.npm(['link', 'underscore'], OPTS, thenInstallAsync) + } -test('when update is called linked packages should be excluded', function (t) { - console.log = function () {} - mr({ port: common.port }, function (er, s) { - common.npm(['update'], OPTS, function (err, c, out, stderr) { + function thenInstallAsync (err, c, out) { + t.ifError(err, 'link did not error') + common.npm(['install', 'async@0.2.9'], OPTS, thenVerify) + } + + function thenVerify (err, c, out) { + t.ifError(err, 'local install did not error') + common.npm(['ls'], OPTS, function (err, c, out, stderr) { t.ifError(err) - t.has(out, /async@1.5.2/, 'updated ok') - t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') - s.close() + t.equal(c, 0) + t.equal(stderr, '', 'got expected stderr') + t.has(out, /async@0.2.9/, 'installed ok') + t.has(out, /underscore@1.3.1/, 'creates local link ok') t.end() }) + } +}) + +test('when update is called linked packages should be excluded', function (t) { + common.npm(['update'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.has(out, /async@0.2.10/, 'updated ok') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() + }) +}) + +test('when install is called and the package already exists as a link, outputs a warning if the requested version is not the same as the linked one', function (t) { + common.npm(['install', 'underscore'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + + t.comment(out.trim()) + t.comment(stderr.trim()) + t.doesNotHave(out, /underscore/, 'linked package not updated') + t.has(stderr, /underscore/, 'warning output relating to linked package') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() + }) +}) + +test('when install is called and the package already exists as a link, does not warn if the requested version is same as the linked one', function (t) { + common.npm(['install', 'underscore@1.3.1'], OPTS, function (err, c, out, stderr) { + t.ifError(err) + t.equal(c, 0) + t.comment(out.trim()) + t.comment(stderr.trim()) + t.doesNotHave(out, /underscore/, 'linked package not updated') + t.doesNotHave(stderr, /underscore/, 'no warning or error relating to linked package') + t.doesNotHave(stderr, /ERR!/, 'no errors in stderr') + t.end() }) }) test('cleanup', function (t) { + server.close() common.npm(['rm', 'underscore', 'async'], OPTS, function (err, code) { t.ifError(err, 'npm removed the linked package without error') t.equal(code, 0, 'cleanup in local ok') - process.chdir(osenv.tmpdir()) common.npm(['rm', '-g', 'underscore'], OPTS, function (err, code) { t.ifError(err, 'npm removed the global package without error') t.equal(code, 0, 'cleanup in global ok') - console.log = originalLog cleanup() t.end() }) @@ -86,6 +123,5 @@ test('cleanup', function (t) { }) function cleanup () { - rimraf.sync(pkg) - rimraf.sync(fakeRoot) + rimraf.sync(testdir) } diff --git a/deps/openssl/asm/arm-void-gas/aes/bsaes-armv7.S b/deps/openssl/asm/arm-void-gas/aes/bsaes-armv7.S index 9738ed50235b3e..449e7a442e87ce 100644 --- a/deps/openssl/asm/arm-void-gas/aes/bsaes-armv7.S +++ b/deps/openssl/asm/arm-void-gas/aes/bsaes-armv7.S @@ -1816,8 +1816,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_6: - vst1.64 {q14}, [r0,:128] @ next round tweak - veor q4, q4, q12 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1853,8 +1851,6 @@ bsaes_xts_encrypt: .align 5 .Lxts_enc_5: - vst1.64 {q13}, [r0,:128] @ next round tweak - veor q3, q3, q11 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1883,8 +1879,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_4: - vst1.64 {q12}, [r0,:128] @ next round tweak - veor q2, q2, q10 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1910,8 +1904,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_3: - vst1.64 {q11}, [r0,:128] @ next round tweak - veor q1, q1, q9 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1936,8 +1928,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_2: - vst1.64 {q10}, [r0,:128] @ next round tweak - veor q0, q0, q8 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1960,7 +1950,7 @@ bsaes_xts_encrypt: .align 4 .Lxts_enc_1: mov r0, sp - veor q0, q8 + veor q0, q0, q8 mov r1, sp vst1.8 {q0}, [sp,:128] mov r2, r10 @@ -2346,8 +2336,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_5: - vst1.64 {q13}, [r0,:128] @ next round tweak - veor q3, q3, q11 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2376,8 +2364,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_4: - vst1.64 {q12}, [r0,:128] @ next round tweak - veor q2, q2, q10 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2403,8 +2389,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_3: - vst1.64 {q11}, [r0,:128] @ next round tweak - veor q1, q1, q9 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2429,8 +2413,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_2: - vst1.64 {q10}, [r0,:128] @ next round tweak - veor q0, q0, q8 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2453,12 +2435,12 @@ bsaes_xts_decrypt: .align 4 .Lxts_dec_1: mov r0, sp - veor q0, q8 + veor q0, q0, q8 mov r1, sp vst1.8 {q0}, [sp,:128] + mov r5, r2 @ preserve magic mov r2, r10 mov r4, r3 @ preserve fp - mov r5, r2 @ preserve magic bl AES_decrypt diff --git a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s index b4fb5fe7e94a00..21175f570d09ec 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont.s @@ -6,6 +6,8 @@ .type bn_mul_mont,@function .align 16 bn_mul_mont: + movl %r9d,%r9d + movq %rsp,%rax testl $3,%r9d jnz .Lmul_enter cmpl $8,%r9d @@ -26,29 +28,36 @@ bn_mul_mont: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 2(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -16(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -.Lmul_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done + +.align 16 .Lmul_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc .Lmul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + movq %rax,8(%rsp,%r9,8) +.Lmul_body: movq %rdx,%r12 movq (%r8),%r8 movq (%r12),%rbx @@ -216,19 +225,21 @@ bn_mul_mont: movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp .Lmul_epilogue: .byte 0xf3,0xc3 .size bn_mul_mont,.-bn_mul_mont .type bn_mul4x_mont,@function .align 16 bn_mul4x_mont: + movl %r9d,%r9d + movq %rsp,%rax .Lmul4x_enter: andl $0x80100,%r11d cmpl $0x80100,%r11d @@ -240,23 +251,29 @@ bn_mul4x_mont: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 4(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -32(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -.Lmul4x_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lmul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: + movq %rax,8(%rsp,%r9,8) +.Lmul4x_body: movq %rdi,16(%rsp,%r9,8) movq %rdx,%r12 movq (%r8),%r8 @@ -625,13 +642,13 @@ bn_mul4x_mont: movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp .Lmul4x_epilogue: .byte 0xf3,0xc3 .size bn_mul4x_mont,.-bn_mul4x_mont @@ -641,14 +658,15 @@ bn_mul4x_mont: .type bn_sqr8x_mont,@function .align 32 bn_sqr8x_mont: -.Lsqr8x_enter: movq %rsp,%rax +.Lsqr8x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lsqr8x_prologue: movl %r9d,%r10d shll $3,%r9d @@ -661,33 +679,42 @@ bn_sqr8x_mont: leaq -64(%rsp,%r9,2),%r11 + movq %rsp,%rbp movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lsqr8x_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -64(%rbp,%r9,2),%rbp jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq -64(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lsqr8x_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lsqr8x_page_walk + jmp .Lsqr8x_page_walk_done + +.align 16 .Lsqr8x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lsqr8x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lsqr8x_page_walk +.Lsqr8x_page_walk_done: movq %r9,%r10 negq %r9 @@ -800,30 +827,38 @@ bn_sqr8x_mont: .type bn_mulx4x_mont,@function .align 32 bn_mulx4x_mont: -.Lmulx4x_enter: movq %rsp,%rax +.Lmulx4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lmulx4x_prologue: shll $3,%r9d -.byte 0x67 xorq %r10,%r10 subq %r9,%r10 movq (%r8),%r8 - leaq -72(%rsp,%r10,1),%rsp - andq $-128,%rsp - movq %rax,%r11 - subq %rsp,%r11 + leaq -72(%rsp,%r10,1),%rbp + andq $-128,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmulx4x_page_walk + jmp .Lmulx4x_page_walk_done + +.align 16 .Lmulx4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc .Lmulx4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmulx4x_page_walk +.Lmulx4x_page_walk_done: leaq (%rdx,%r9,1),%r10 diff --git a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s index e4dfd834605d13..416152560a7ac4 100644 --- a/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm/x64-elf-gas/bn/x86_64-mont5.s @@ -6,6 +6,8 @@ .type bn_mul_mont_gather5,@function .align 64 bn_mul_mont_gather5: + movl %r9d,%r9d + movq %rsp,%rax testl $7,%r9d jnz .Lmul_enter movl OPENSSL_ia32cap_P+8(%rip),%r11d @@ -13,10 +15,7 @@ bn_mul_mont_gather5: .align 16 .Lmul_enter: - movl %r9d,%r9d - movq %rsp,%rax movd 8(%rsp),%xmm5 - leaq .Linc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 @@ -24,26 +23,36 @@ bn_mul_mont_gather5: pushq %r14 pushq %r15 - leaq 2(%r9),%r11 - negq %r11 - leaq -264(%rsp,%r11,8),%rsp - andq $-1024,%rsp + negq %r9 + movq %rsp,%r11 + leaq -280(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %rax,8(%rsp,%r9,8) -.Lmul_body: - subq %rsp,%rax - andq $-4096,%rax + subq %r10,%r11 + andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done + .Lmul_page_walk: - movq (%rsp,%rax,1),%r11 - subq $4096,%rax -.byte 0x2e - jnc .Lmul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + + leaq .Linc(%rip),%r10 + movq %rax,8(%rsp,%r9,8) +.Lmul_body: leaq 128(%rdx),%r12 movdqa 0(%r10),%xmm0 @@ -414,18 +423,19 @@ bn_mul_mont_gather5: .type bn_mul4x_mont_gather5,@function .align 32 bn_mul4x_mont_gather5: +.byte 0x67 + movq %rsp,%rax .Lmul4x_enter: andl $0x80108,%r11d cmpl $0x80108,%r11d je .Lmulx4x_enter -.byte 0x67 - movq %rsp,%rax pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lmul4x_prologue: .byte 0x67 shll $3,%r9d @@ -442,32 +452,40 @@ bn_mul4x_mont_gather5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lmul4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lmul4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lmul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: negq %r9 @@ -1019,17 +1037,18 @@ mul4x_internal: .type bn_power5,@function .align 32 bn_power5: + movq %rsp,%rax movl OPENSSL_ia32cap_P+8(%rip),%r11d andl $0x80108,%r11d cmpl $0x80108,%r11d je .Lpowerx5_enter - movq %rsp,%rax pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lpower5_prologue: shll $3,%r9d leal (%r9,%r9,2),%r10d @@ -1044,32 +1063,40 @@ bn_power5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lpwr_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lpwr_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwr_page_walk + jmp .Lpwr_page_walk_done + .Lpwr_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lpwr_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwr_page_walk +.Lpwr_page_walk_done: movq %r9,%r10 negq %r9 @@ -1980,6 +2007,7 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 +.Lfrom_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -1994,32 +2022,40 @@ bn_from_mont8x: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lfrom_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lfrom_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lfrom_page_walk + jmp .Lfrom_page_walk_done + .Lfrom_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lfrom_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lfrom_page_walk +.Lfrom_page_walk_done: movq %r9,%r10 negq %r9 @@ -2113,14 +2149,15 @@ bn_from_mont8x: .type bn_mulx4x_mont_gather5,@function .align 32 bn_mulx4x_mont_gather5: -.Lmulx4x_enter: movq %rsp,%rax +.Lmulx4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lmulx4x_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -2137,31 +2174,39 @@ bn_mulx4x_mont_gather5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lmulx4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lmulx4xsp_done .Lmulx4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lmulx4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmulx4x_page_walk + jmp .Lmulx4x_page_walk_done + .Lmulx4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lmulx4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmulx4x_page_walk +.Lmulx4x_page_walk_done: @@ -2619,14 +2664,15 @@ mulx4x_internal: .type bn_powerx5,@function .align 32 bn_powerx5: -.Lpowerx5_enter: movq %rsp,%rax +.Lpowerx5_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lpowerx5_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -2641,32 +2687,40 @@ bn_powerx5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lpwrx_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lpwrx_sp_done .align 32 .Lpwrx_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lpwrx_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwrx_page_walk + jmp .Lpwrx_page_walk_done + .Lpwrx_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lpwrx_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwrx_page_walk +.Lpwrx_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s index 6d1be614f3f618..23188cda6e935a 100644 --- a/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/ec/ecp_nistz256-x86_64.s @@ -27,6 +27,7 @@ ecp_nistz256_mul_by_2: pushq %r13 movq 0(%rsi),%r8 + xorq %r13,%r13 movq 8(%rsi),%r9 addq %r8,%r8 movq 16(%rsi),%r10 @@ -37,7 +38,7 @@ ecp_nistz256_mul_by_2: adcq %r10,%r10 adcq %r11,%r11 movq %r9,%rdx - sbbq %r13,%r13 + adcq $0,%r13 subq 0(%rsi),%r8 movq %r10,%rcx @@ -45,14 +46,14 @@ ecp_nistz256_mul_by_2: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -149,12 +150,12 @@ ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq .Lpoly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 - cmovzq %rcx,%r10 - cmovzq %r12,%r11 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 + cmovcq %rcx,%r10 + cmovcq %r12,%r11 xorq %r13,%r13 addq 0(%rsi),%r8 @@ -171,14 +172,14 @@ ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq .Lpoly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -217,14 +218,14 @@ ecp_nistz256_add: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -1461,13 +1462,14 @@ ecp_nistz256_avx2_select_w7: .type __ecp_nistz256_add_toq,@function .align 32 __ecp_nistz256_add_toq: + xorq %r11,%r11 addq 0(%rbx),%r12 adcq 8(%rbx),%r13 movq %r12,%rax adcq 16(%rbx),%r8 adcq 24(%rbx),%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1475,14 +1477,14 @@ __ecp_nistz256_add_toq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1550,13 +1552,14 @@ __ecp_nistz256_subq: .type __ecp_nistz256_mul_by_2q,@function .align 32 __ecp_nistz256_mul_by_2q: + xorq %r11,%r11 addq %r12,%r12 adcq %r13,%r13 movq %r12,%rax adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1564,14 +1567,14 @@ __ecp_nistz256_mul_by_2q: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1809,16 +1812,14 @@ ecp_nistz256_point_add: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1830,14 +1831,14 @@ ecp_nistz256_point_add: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-0(%rsi),%rsi movq %rax,544+0(%rsp) @@ -1848,8 +1849,8 @@ ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -2032,6 +2033,7 @@ ecp_nistz256_point_add: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -2039,7 +2041,7 @@ ecp_nistz256_point_add: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -2047,15 +2049,15 @@ ecp_nistz256_point_add: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -2213,16 +2215,14 @@ ecp_nistz256_point_add_affine: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -2340,6 +2340,7 @@ ecp_nistz256_point_add_affine: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -2347,7 +2348,7 @@ ecp_nistz256_point_add_affine: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -2355,15 +2356,15 @@ ecp_nistz256_point_add_affine: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -2510,14 +2511,14 @@ __ecp_nistz256_add_tox: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 + sbbq $0,%r11 - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovncq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovncq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -2605,14 +2606,14 @@ __ecp_nistz256_mul_by_2x: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 + sbbq $0,%r11 - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovncq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovncq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -2842,16 +2843,14 @@ ecp_nistz256_point_addx: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -2863,14 +2862,14 @@ ecp_nistz256_point_addx: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-128(%rsi),%rsi movq %rdx,544+0(%rsp) @@ -2881,8 +2880,8 @@ ecp_nistz256_point_addx: call __ecp_nistz256_sqr_montx pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -3065,6 +3064,7 @@ ecp_nistz256_point_addx: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -3072,7 +3072,7 @@ ecp_nistz256_point_addx: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -3080,15 +3080,15 @@ ecp_nistz256_point_addx: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subx @@ -3242,16 +3242,14 @@ ecp_nistz256_point_add_affinex: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -3369,6 +3367,7 @@ ecp_nistz256_point_add_affinex: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -3376,7 +3375,7 @@ ecp_nistz256_point_add_affinex: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -3384,15 +3383,15 @@ ecp_nistz256_point_add_affinex: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subx diff --git a/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s b/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s index 22a031f368e505..195a148bb9b2a3 100644 --- a/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm/x64-elf-gas/sha/sha1-x86_64.s @@ -1263,9 +1263,9 @@ _shaext_shortcut: .align 16 .Loop_shaext: decq %rdx - leaq 64(%rsi),%rax + leaq 64(%rsi),%r8 paddd %xmm4,%xmm1 - cmovneq %rax,%rsi + cmovneq %r8,%rsi movdqa %xmm0,%xmm8 .byte 15,56,201,229 movdqa %xmm0,%xmm2 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s index bca9fbda7fbea5..1d5e63892f024f 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont.s @@ -6,6 +6,8 @@ .p2align 4 _bn_mul_mont: + movl %r9d,%r9d + movq %rsp,%rax testl $3,%r9d jnz L$mul_enter cmpl $8,%r9d @@ -26,29 +28,36 @@ L$mul_enter: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 2(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -16(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -L$mul_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk + jmp L$mul_page_walk_done + +.p2align 4 L$mul_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc L$mul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk +L$mul_page_walk_done: + movq %rax,8(%rsp,%r9,8) +L$mul_body: movq %rdx,%r12 movq (%r8),%r8 movq (%r12),%rbx @@ -216,19 +225,21 @@ L$copy: movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp L$mul_epilogue: .byte 0xf3,0xc3 .p2align 4 bn_mul4x_mont: + movl %r9d,%r9d + movq %rsp,%rax L$mul4x_enter: andl $0x80100,%r11d cmpl $0x80100,%r11d @@ -240,23 +251,29 @@ L$mul4x_enter: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 4(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -32(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -L$mul4x_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul4x_page_walk + jmp L$mul4x_page_walk_done + L$mul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$mul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul4x_page_walk +L$mul4x_page_walk_done: + movq %rax,8(%rsp,%r9,8) +L$mul4x_body: movq %rdi,16(%rsp,%r9,8) movq %rdx,%r12 movq (%r8),%r8 @@ -625,13 +642,13 @@ L$copy4x: movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp L$mul4x_epilogue: .byte 0xf3,0xc3 @@ -641,14 +658,15 @@ L$mul4x_epilogue: .p2align 5 bn_sqr8x_mont: -L$sqr8x_enter: movq %rsp,%rax +L$sqr8x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$sqr8x_prologue: movl %r9d,%r10d shll $3,%r9d @@ -661,33 +679,42 @@ L$sqr8x_enter: leaq -64(%rsp,%r9,2),%r11 + movq %rsp,%rbp movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$sqr8x_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -64(%rbp,%r9,2),%rbp jmp L$sqr8x_sp_done .p2align 5 L$sqr8x_sp_alt: leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq -64(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$sqr8x_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$sqr8x_page_walk + jmp L$sqr8x_page_walk_done + +.p2align 4 L$sqr8x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$sqr8x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$sqr8x_page_walk +L$sqr8x_page_walk_done: movq %r9,%r10 negq %r9 @@ -800,30 +827,38 @@ L$sqr8x_epilogue: .p2align 5 bn_mulx4x_mont: -L$mulx4x_enter: movq %rsp,%rax +L$mulx4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$mulx4x_prologue: shll $3,%r9d -.byte 0x67 xorq %r10,%r10 subq %r9,%r10 movq (%r8),%r8 - leaq -72(%rsp,%r10,1),%rsp - andq $-128,%rsp - movq %rax,%r11 - subq %rsp,%r11 + leaq -72(%rsp,%r10,1),%rbp + andq $-128,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mulx4x_page_walk + jmp L$mulx4x_page_walk_done + +.p2align 4 L$mulx4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc L$mulx4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mulx4x_page_walk +L$mulx4x_page_walk_done: leaq (%rdx,%r9,1),%r10 diff --git a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s index 5d987a12296d8a..878c31ffac81ab 100644 --- a/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm/x64-macosx-gas/bn/x86_64-mont5.s @@ -6,6 +6,8 @@ .p2align 6 _bn_mul_mont_gather5: + movl %r9d,%r9d + movq %rsp,%rax testl $7,%r9d jnz L$mul_enter movl _OPENSSL_ia32cap_P+8(%rip),%r11d @@ -13,10 +15,7 @@ _bn_mul_mont_gather5: .p2align 4 L$mul_enter: - movl %r9d,%r9d - movq %rsp,%rax movd 8(%rsp),%xmm5 - leaq L$inc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 @@ -24,26 +23,36 @@ L$mul_enter: pushq %r14 pushq %r15 - leaq 2(%r9),%r11 - negq %r11 - leaq -264(%rsp,%r11,8),%rsp - andq $-1024,%rsp + negq %r9 + movq %rsp,%r11 + leaq -280(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %rax,8(%rsp,%r9,8) -L$mul_body: - subq %rsp,%rax - andq $-4096,%rax + subq %r10,%r11 + andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk + jmp L$mul_page_walk_done + L$mul_page_walk: - movq (%rsp,%rax,1),%r11 - subq $4096,%rax -.byte 0x2e - jnc L$mul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk +L$mul_page_walk_done: + + leaq L$inc(%rip),%r10 + movq %rax,8(%rsp,%r9,8) +L$mul_body: leaq 128(%rdx),%r12 movdqa 0(%r10),%xmm0 @@ -414,18 +423,19 @@ L$mul_epilogue: .p2align 5 bn_mul4x_mont_gather5: +.byte 0x67 + movq %rsp,%rax L$mul4x_enter: andl $0x80108,%r11d cmpl $0x80108,%r11d je L$mulx4x_enter -.byte 0x67 - movq %rsp,%rax pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$mul4x_prologue: .byte 0x67 shll $3,%r9d @@ -442,32 +452,40 @@ L$mul4x_enter: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$mul4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$mul4xsp_done .p2align 5 L$mul4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$mul4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mul4x_page_walk + jmp L$mul4x_page_walk_done + L$mul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$mul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mul4x_page_walk +L$mul4x_page_walk_done: negq %r9 @@ -1019,17 +1037,18 @@ L$inner4x: .p2align 5 _bn_power5: + movq %rsp,%rax movl _OPENSSL_ia32cap_P+8(%rip),%r11d andl $0x80108,%r11d cmpl $0x80108,%r11d je L$powerx5_enter - movq %rsp,%rax pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$power5_prologue: shll $3,%r9d leal (%r9,%r9,2),%r10d @@ -1044,32 +1063,40 @@ _bn_power5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$pwr_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$pwr_sp_done .p2align 5 L$pwr_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$pwr_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwr_page_walk + jmp L$pwr_page_walk_done + L$pwr_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$pwr_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwr_page_walk +L$pwr_page_walk_done: movq %r9,%r10 negq %r9 @@ -1980,6 +2007,7 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 +L$from_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -1994,32 +2022,40 @@ bn_from_mont8x: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$from_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$from_sp_done .p2align 5 L$from_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$from_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$from_page_walk + jmp L$from_page_walk_done + L$from_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$from_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$from_page_walk +L$from_page_walk_done: movq %r9,%r10 negq %r9 @@ -2113,14 +2149,15 @@ L$from_epilogue: .p2align 5 bn_mulx4x_mont_gather5: -L$mulx4x_enter: movq %rsp,%rax +L$mulx4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$mulx4x_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -2137,31 +2174,39 @@ L$mulx4x_enter: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$mulx4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$mulx4xsp_done L$mulx4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$mulx4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mulx4x_page_walk + jmp L$mulx4x_page_walk_done + L$mulx4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$mulx4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mulx4x_page_walk +L$mulx4x_page_walk_done: @@ -2619,14 +2664,15 @@ L$mulx4x_inner: .p2align 5 bn_powerx5: -L$powerx5_enter: movq %rsp,%rax +L$powerx5_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$powerx5_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -2641,32 +2687,40 @@ L$powerx5_enter: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$pwrx_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$pwrx_sp_done .p2align 5 L$pwrx_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$pwrx_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwrx_page_walk + jmp L$pwrx_page_walk_done + L$pwrx_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$pwrx_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwrx_page_walk +L$pwrx_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s index b90788f4536b12..05b6d5be2c885b 100644 --- a/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/ec/ecp_nistz256-x86_64.s @@ -27,6 +27,7 @@ _ecp_nistz256_mul_by_2: pushq %r13 movq 0(%rsi),%r8 + xorq %r13,%r13 movq 8(%rsi),%r9 addq %r8,%r8 movq 16(%rsi),%r10 @@ -37,7 +38,7 @@ _ecp_nistz256_mul_by_2: adcq %r10,%r10 adcq %r11,%r11 movq %r9,%rdx - sbbq %r13,%r13 + adcq $0,%r13 subq 0(%rsi),%r8 movq %r10,%rcx @@ -45,14 +46,14 @@ _ecp_nistz256_mul_by_2: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -149,12 +150,12 @@ _ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq L$poly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 - cmovzq %rcx,%r10 - cmovzq %r12,%r11 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 + cmovcq %rcx,%r10 + cmovcq %r12,%r11 xorq %r13,%r13 addq 0(%rsi),%r8 @@ -171,14 +172,14 @@ _ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq L$poly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -217,14 +218,14 @@ _ecp_nistz256_add: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -1461,13 +1462,14 @@ L$select_loop_avx2_w7: .p2align 5 __ecp_nistz256_add_toq: + xorq %r11,%r11 addq 0(%rbx),%r12 adcq 8(%rbx),%r13 movq %r12,%rax adcq 16(%rbx),%r8 adcq 24(%rbx),%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1475,14 +1477,14 @@ __ecp_nistz256_add_toq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1550,13 +1552,14 @@ __ecp_nistz256_subq: .p2align 5 __ecp_nistz256_mul_by_2q: + xorq %r11,%r11 addq %r12,%r12 adcq %r13,%r13 movq %r12,%rax adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1564,14 +1567,14 @@ __ecp_nistz256_mul_by_2q: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1809,16 +1812,14 @@ _ecp_nistz256_point_add: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1830,14 +1831,14 @@ _ecp_nistz256_point_add: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-0(%rsi),%rsi movq %rax,544+0(%rsp) @@ -1848,8 +1849,8 @@ _ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -2032,6 +2033,7 @@ L$add_proceedq: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -2039,7 +2041,7 @@ L$add_proceedq: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -2047,15 +2049,15 @@ L$add_proceedq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -2213,16 +2215,14 @@ _ecp_nistz256_point_add_affine: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -2340,6 +2340,7 @@ _ecp_nistz256_point_add_affine: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -2347,7 +2348,7 @@ _ecp_nistz256_point_add_affine: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -2355,15 +2356,15 @@ _ecp_nistz256_point_add_affine: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -2510,14 +2511,14 @@ __ecp_nistz256_add_tox: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 + sbbq $0,%r11 - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovncq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovncq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -2605,14 +2606,14 @@ __ecp_nistz256_mul_by_2x: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 + sbbq $0,%r11 - btq $0,%r11 - cmovncq %rax,%r12 - cmovncq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovncq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovncq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -2842,16 +2843,14 @@ L$point_addx: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -2863,14 +2862,14 @@ L$point_addx: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-128(%rsi),%rsi movq %rdx,544+0(%rsp) @@ -2881,8 +2880,8 @@ L$point_addx: call __ecp_nistz256_sqr_montx pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -3065,6 +3064,7 @@ L$add_proceedx: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -3072,7 +3072,7 @@ L$add_proceedx: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -3080,15 +3080,15 @@ L$add_proceedx: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subx @@ -3242,16 +3242,14 @@ L$point_add_affinex: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -3369,6 +3367,7 @@ L$point_add_affinex: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -3376,7 +3375,7 @@ L$point_add_affinex: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -3384,15 +3383,15 @@ L$point_add_affinex: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subx diff --git a/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s b/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s index c89ffe3df60f54..1c52e05e399eb6 100644 --- a/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm/x64-macosx-gas/sha/sha1-x86_64.s @@ -1263,9 +1263,9 @@ _shaext_shortcut: .p2align 4 L$oop_shaext: decq %rdx - leaq 64(%rsi),%rax + leaq 64(%rsi),%r8 paddd %xmm4,%xmm1 - cmovneq %rax,%rsi + cmovneq %r8,%rsi movdqa %xmm0,%xmm8 .byte 15,56,201,229 movdqa %xmm0,%xmm2 diff --git a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm index ccc591b7c9b1c7..9693ed97e47c9b 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont.asm @@ -19,6 +19,8 @@ $L$SEH_begin_bn_mul_mont:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp test r9d,3 jnz $L$mul_enter cmp r9d,8 @@ -39,29 +41,36 @@ $L$mul_enter:: push r14 push r15 - mov r9d,r9d - lea r10,QWORD PTR[2+r9] + neg r9 mov r11,rsp - neg r10 - lea rsp,QWORD PTR[r10*8+rsp] - and rsp,-1024 + lea r10,QWORD PTR[((-16))+r9*8+rsp] + neg r9 + and r10,-1024 - mov QWORD PTR[8+r9*8+rsp],r11 -$L$mul_body:: - sub r11,rsp + sub r11,r10 and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk + jmp $L$mul_page_walk_done + +ALIGN 16 $L$mul_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 066h,02eh - jnc $L$mul_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk +$L$mul_page_walk_done:: + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul_body:: mov r12,rdx mov r8,QWORD PTR[r8] mov rbx,QWORD PTR[r12] @@ -229,13 +238,13 @@ $L$copy:: mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - mov r15,QWORD PTR[rsi] - mov r14,QWORD PTR[8+rsi] - mov r13,QWORD PTR[16+rsi] - mov r12,QWORD PTR[24+rsi] - mov rbp,QWORD PTR[32+rsi] - mov rbx,QWORD PTR[40+rsi] - lea rsp,QWORD PTR[48+rsi] + mov r15,QWORD PTR[((-48))+rsi] + mov r14,QWORD PTR[((-40))+rsi] + mov r13,QWORD PTR[((-32))+rsi] + mov r12,QWORD PTR[((-24))+rsi] + mov rbp,QWORD PTR[((-16))+rsi] + mov rbx,QWORD PTR[((-8))+rsi] + lea rsp,QWORD PTR[rsi] $L$mul_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] @@ -257,6 +266,8 @@ $L$SEH_begin_bn_mul4x_mont:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp $L$mul4x_enter:: and r11d,080100h cmp r11d,080100h @@ -268,23 +279,29 @@ $L$mul4x_enter:: push r14 push r15 - mov r9d,r9d - lea r10,QWORD PTR[4+r9] + neg r9 mov r11,rsp - neg r10 - lea rsp,QWORD PTR[r10*8+rsp] - and rsp,-1024 + lea r10,QWORD PTR[((-32))+r9*8+rsp] + neg r9 + and r10,-1024 - mov QWORD PTR[8+r9*8+rsp],r11 -$L$mul4x_body:: - sub r11,rsp + sub r11,r10 and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul4x_page_walk + jmp $L$mul4x_page_walk_done + $L$mul4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$mul4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul4x_page_walk +$L$mul4x_page_walk_done:: + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul4x_body:: mov QWORD PTR[16+r9*8+rsp],rdi mov r12,rdx mov r8,QWORD PTR[r8] @@ -653,13 +670,13 @@ $L$copy4x:: movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - mov r15,QWORD PTR[rsi] - mov r14,QWORD PTR[8+rsi] - mov r13,QWORD PTR[16+rsi] - mov r12,QWORD PTR[24+rsi] - mov rbp,QWORD PTR[32+rsi] - mov rbx,QWORD PTR[40+rsi] - lea rsp,QWORD PTR[48+rsi] + mov r15,QWORD PTR[((-48))+rsi] + mov r14,QWORD PTR[((-40))+rsi] + mov r13,QWORD PTR[((-32))+rsi] + mov r12,QWORD PTR[((-24))+rsi] + mov rbp,QWORD PTR[((-16))+rsi] + mov rbx,QWORD PTR[((-8))+rsi] + lea rsp,QWORD PTR[rsi] $L$mul4x_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] @@ -684,14 +701,15 @@ $L$SEH_begin_bn_sqr8x_mont:: mov r9,QWORD PTR[48+rsp] -$L$sqr8x_enter:: mov rax,rsp +$L$sqr8x_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$sqr8x_prologue:: mov r10d,r9d shl r9d,3 @@ -704,33 +722,42 @@ $L$sqr8x_enter:: lea r11,QWORD PTR[((-64))+r9*2+rsp] + mov rbp,rsp mov r8,QWORD PTR[r8] sub r11,rsi and r11,4095 cmp r10,r11 jb $L$sqr8x_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-64))+r9*2+rbp] jmp $L$sqr8x_sp_done ALIGN 32 $L$sqr8x_sp_alt:: lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rbp,QWORD PTR[((-64))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$sqr8x_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$sqr8x_page_walk + jmp $L$sqr8x_page_walk_done + +ALIGN 16 $L$sqr8x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$sqr8x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$sqr8x_page_walk +$L$sqr8x_page_walk_done:: mov r10,r9 neg r9 @@ -858,30 +885,38 @@ $L$SEH_begin_bn_mulx4x_mont:: mov r9,QWORD PTR[48+rsp] -$L$mulx4x_enter:: mov rax,rsp +$L$mulx4x_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$mulx4x_prologue:: shl r9d,3 -DB 067h xor r10,r10 sub r10,r9 mov r8,QWORD PTR[r8] - lea rsp,QWORD PTR[((-72))+r10*1+rsp] - and rsp,-128 - mov r11,rax - sub r11,rsp + lea rbp,QWORD PTR[((-72))+r10*1+rsp] + and rbp,-128 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mulx4x_page_walk + jmp $L$mulx4x_page_walk_done + +ALIGN 16 $L$mulx4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 066h,02eh - jnc $L$mulx4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mulx4x_page_walk +$L$mulx4x_page_walk_done:: lea r10,QWORD PTR[r9*1+rdx] @@ -1230,22 +1265,8 @@ mul_handler PROC PRIVATE mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] - lea rax,QWORD PTR[48+rax] - - mov rbx,QWORD PTR[((-8))+rax] - mov rbp,QWORD PTR[((-16))+rax] - mov r12,QWORD PTR[((-24))+rax] - mov r13,QWORD PTR[((-32))+rax] - mov r14,QWORD PTR[((-40))+rax] - mov r15,QWORD PTR[((-48))+rax] - mov QWORD PTR[144+r8],rbx - mov QWORD PTR[160+r8],rbp - mov QWORD PTR[216+r8],r12 - mov QWORD PTR[224+r8],r13 - mov QWORD PTR[232+r8],r14 - mov QWORD PTR[240+r8],r15 - jmp $L$common_seh_tail + jmp $L$common_pop_regs mul_handler ENDP @@ -1273,15 +1294,21 @@ sqr_handler PROC PRIVATE cmp rbx,r10 jb $L$common_seh_tail + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_pop_regs + mov rax,QWORD PTR[152+r8] - mov r10d,DWORD PTR[4+r11] + mov r10d,DWORD PTR[8+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail mov rax,QWORD PTR[40+rax] +$L$common_pop_regs:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -1366,11 +1393,13 @@ DB 9,0,0,0 $L$SEH_info_bn_sqr8x_mont:: DB 9,0,0,0 DD imagerel sqr_handler - DD imagerel $L$sqr8x_body,imagerel $L$sqr8x_epilogue + DD imagerel $L$sqr8x_prologue,imagerel $L$sqr8x_body,imagerel $L$sqr8x_epilogue +ALIGN 8 $L$SEH_info_bn_mulx4x_mont:: DB 9,0,0,0 DD imagerel sqr_handler - DD imagerel $L$mulx4x_body,imagerel $L$mulx4x_epilogue + DD imagerel $L$mulx4x_prologue,imagerel $L$mulx4x_body,imagerel $L$mulx4x_epilogue +ALIGN 8 .xdata ENDS END diff --git a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm index 3c1a74afb9cca5..6cd4f2d3d8bc3c 100644 --- a/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm +++ b/deps/openssl/asm/x64-win32-masm/bn/x86_64-mont5.asm @@ -19,6 +19,8 @@ $L$SEH_begin_bn_mul_mont_gather5:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp test r9d,7 jnz $L$mul_enter mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))] @@ -26,10 +28,7 @@ $L$SEH_begin_bn_mul_mont_gather5:: ALIGN 16 $L$mul_enter:: - mov r9d,r9d - mov rax,rsp movd xmm5,DWORD PTR[56+rsp] - lea r10,QWORD PTR[$L$inc] push rbx push rbp push r12 @@ -37,26 +36,36 @@ $L$mul_enter:: push r14 push r15 - lea r11,QWORD PTR[2+r9] - neg r11 - lea rsp,QWORD PTR[((-264))+r11*8+rsp] - and rsp,-1024 + neg r9 + mov r11,rsp + lea r10,QWORD PTR[((-280))+r9*8+rsp] + neg r9 + and r10,-1024 + - mov QWORD PTR[8+r9*8+rsp],rax -$L$mul_body:: + sub r11,r10 + and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk + jmp $L$mul_page_walk_done - sub rax,rsp - and rax,-4096 $L$mul_page_walk:: - mov r11,QWORD PTR[rax*1+rsp] - sub rax,4096 -DB 02eh - jnc $L$mul_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk +$L$mul_page_walk_done:: + + lea r10,QWORD PTR[$L$inc] + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul_body:: lea r12,QWORD PTR[128+rdx] movdqa xmm0,XMMWORD PTR[r10] @@ -442,18 +451,19 @@ $L$SEH_begin_bn_mul4x_mont_gather5:: mov r9,QWORD PTR[48+rsp] +DB 067h + mov rax,rsp $L$mul4x_enter:: and r11d,080108h cmp r11d,080108h je $L$mulx4x_enter -DB 067h - mov rax,rsp push rbx push rbp push r12 push r13 push r14 push r15 +$L$mul4x_prologue:: DB 067h shl r9d,3 @@ -470,32 +480,40 @@ DB 067h lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mul4xsp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$mul4xsp_done ALIGN 32 $L$mul4xsp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$mul4xsp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mul4x_page_walk + jmp $L$mul4x_page_walk_done + $L$mul4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$mul4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mul4x_page_walk +$L$mul4x_page_walk_done:: neg r9 @@ -1062,17 +1080,18 @@ $L$SEH_begin_bn_power5:: mov r9,QWORD PTR[48+rsp] + mov rax,rsp mov r11d,DWORD PTR[((OPENSSL_ia32cap_P+8))] and r11d,080108h cmp r11d,080108h je $L$powerx5_enter - mov rax,rsp push rbx push rbp push r12 push r13 push r14 push r15 +$L$power5_prologue:: shl r9d,3 lea r10d,DWORD PTR[r9*2+r9] @@ -1087,32 +1106,40 @@ $L$SEH_begin_bn_power5:: lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwr_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$pwr_sp_done ALIGN 32 $L$pwr_sp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$pwr_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwr_page_walk + jmp $L$pwr_page_walk_done + $L$pwr_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$pwr_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwr_page_walk +$L$pwr_page_walk_done:: mov r10,r9 neg r9 @@ -2038,6 +2065,7 @@ DB 067h push r13 push r14 push r15 +$L$from_prologue:: shl r9d,3 lea r10,QWORD PTR[r9*2+r9] @@ -2052,32 +2080,40 @@ DB 067h lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$from_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$from_sp_done ALIGN 32 $L$from_sp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$from_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$from_page_walk + jmp $L$from_page_walk_done + $L$from_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$from_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$from_page_walk +$L$from_page_walk_done:: mov r10,r9 neg r9 @@ -2186,14 +2222,15 @@ $L$SEH_begin_bn_mulx4x_mont_gather5:: mov r9,QWORD PTR[48+rsp] -$L$mulx4x_enter:: mov rax,rsp +$L$mulx4x_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$mulx4x_prologue:: shl r9d,3 lea r10,QWORD PTR[r9*2+r9] @@ -2210,31 +2247,39 @@ $L$mulx4x_enter:: lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mulx4xsp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$mulx4xsp_done $L$mulx4xsp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$mulx4xsp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mulx4x_page_walk + jmp $L$mulx4x_page_walk_done + $L$mulx4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$mulx4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mulx4x_page_walk +$L$mulx4x_page_walk_done:: @@ -2707,14 +2752,15 @@ $L$SEH_begin_bn_powerx5:: mov r9,QWORD PTR[48+rsp] -$L$powerx5_enter:: mov rax,rsp +$L$powerx5_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$powerx5_prologue:: shl r9d,3 lea r10,QWORD PTR[r9*2+r9] @@ -2729,32 +2775,40 @@ $L$powerx5_enter:: lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwrx_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$pwrx_sp_done ALIGN 32 $L$pwrx_sp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$pwrx_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwrx_page_walk + jmp $L$pwrx_page_walk_done + $L$pwrx_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$pwrx_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwrx_page_walk +$L$pwrx_page_walk_done:: mov r10,r9 neg r9 @@ -3712,9 +3766,14 @@ mul_handler PROC PRIVATE cmp rbx,r10 jb $L$common_seh_tail + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_pop_regs + mov rax,QWORD PTR[152+r8] - mov r10d,DWORD PTR[4+r11] + mov r10d,DWORD PTR[8+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail @@ -3726,11 +3785,11 @@ mul_handler PROC PRIVATE mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] - jmp $L$body_proceed + jmp $L$common_pop_regs $L$body_40:: mov rax,QWORD PTR[40+rax] -$L$body_proceed:: +$L$common_pop_regs:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -3819,32 +3878,32 @@ ALIGN 8 $L$SEH_info_bn_mul_mont_gather5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$mul_body,imagerel $L$mul_epilogue + DD imagerel $L$mul_body,imagerel $L$mul_body,imagerel $L$mul_epilogue ALIGN 8 $L$SEH_info_bn_mul4x_mont_gather5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue + DD imagerel $L$mul4x_prologue,imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue ALIGN 8 $L$SEH_info_bn_power5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$power5_body,imagerel $L$power5_epilogue + DD imagerel $L$power5_prologue,imagerel $L$power5_body,imagerel $L$power5_epilogue ALIGN 8 $L$SEH_info_bn_from_mont8x:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$from_body,imagerel $L$from_epilogue + DD imagerel $L$from_prologue,imagerel $L$from_body,imagerel $L$from_epilogue ALIGN 8 $L$SEH_info_bn_mulx4x_mont_gather5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$mulx4x_body,imagerel $L$mulx4x_epilogue + DD imagerel $L$mulx4x_prologue,imagerel $L$mulx4x_body,imagerel $L$mulx4x_epilogue ALIGN 8 $L$SEH_info_bn_powerx5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$powerx5_body,imagerel $L$powerx5_epilogue + DD imagerel $L$powerx5_prologue,imagerel $L$powerx5_body,imagerel $L$powerx5_epilogue ALIGN 8 $L$SEH_info_bn_gather5:: DB 001h,00bh,003h,00ah diff --git a/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm b/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm index f38d253c166748..7cf9277bfb33d4 100644 --- a/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/ec/ecp_nistz256-x86_64.asm @@ -36,6 +36,7 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: push r13 mov r8,QWORD PTR[rsi] + xor r13,r13 mov r9,QWORD PTR[8+rsi] add r8,r8 mov r10,QWORD PTR[16+rsi] @@ -46,7 +47,7 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: adc r10,r10 adc r11,r11 mov rdx,r9 - sbb r13,r13 + adc r13,0 sub r8,QWORD PTR[rsi] mov rcx,r10 @@ -54,14 +55,14 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: sbb r10,QWORD PTR[16+rsi] mov r12,r11 sbb r11,QWORD PTR[24+rsi] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -180,12 +181,12 @@ $L$SEH_begin_ecp_nistz256_mul_by_3:: sbb r10,0 mov r12,r11 sbb r11,QWORD PTR[(($L$poly+24))] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx - cmovz r10,rcx - cmovz r11,r12 + cmovc r8,rax + cmovc r9,rdx + cmovc r10,rcx + cmovc r11,r12 xor r13,r13 add r8,QWORD PTR[rsi] @@ -202,14 +203,14 @@ $L$SEH_begin_ecp_nistz256_mul_by_3:: sbb r10,0 mov r12,r11 sbb r11,QWORD PTR[(($L$poly+24))] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -260,14 +261,14 @@ $L$SEH_begin_ecp_nistz256_add:: sbb r10,QWORD PTR[16+rsi] mov r12,r11 sbb r11,QWORD PTR[24+rsi] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -1673,13 +1674,14 @@ ecp_nistz256_avx2_select_w7 ENDP ALIGN 32 __ecp_nistz256_add_toq PROC PRIVATE + xor r11,r11 add r12,QWORD PTR[rbx] adc r13,QWORD PTR[8+rbx] mov rax,r12 adc r8,QWORD PTR[16+rbx] adc r9,QWORD PTR[24+rbx] mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -1687,14 +1689,14 @@ __ecp_nistz256_add_toq PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax - cmovz r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovz r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovz r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -1762,13 +1764,14 @@ __ecp_nistz256_subq ENDP ALIGN 32 __ecp_nistz256_mul_by_2q PROC PRIVATE + xor r11,r11 add r12,r12 adc r13,r13 mov rax,r12 adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -1776,14 +1779,14 @@ __ecp_nistz256_mul_by_2q PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax - cmovz r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovz r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovz r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -2041,16 +2044,14 @@ $L$SEH_begin_ecp_nistz256_point_add:: mov rsi,rdx movdqa XMMWORD PTR[384+rsp],xmm0 movdqa XMMWORD PTR[(384+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[416+rsp],xmm2 movdqa XMMWORD PTR[(416+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[448+rsp],xmm4 movdqa XMMWORD PTR[(448+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rsi] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rsi] movdqu xmm2,XMMWORD PTR[32+rsi] por xmm5,xmm3 @@ -2062,14 +2063,14 @@ $L$SEH_begin_ecp_nistz256_point_add:: movdqa XMMWORD PTR[480+rsp],xmm0 pshufd xmm4,xmm5,01eh movdqa XMMWORD PTR[(480+16)+rsp],xmm1 - por xmm1,xmm0 -DB 102,72,15,110,199 + movdqu xmm0,XMMWORD PTR[64+rsi] + movdqu xmm1,XMMWORD PTR[80+rsi] movdqa XMMWORD PTR[512+rsp],xmm2 movdqa XMMWORD PTR[(512+16)+rsp],xmm3 - por xmm3,xmm2 por xmm5,xmm4 pxor xmm4,xmm4 - por xmm3,xmm1 + por xmm1,xmm0 +DB 102,72,15,110,199 lea rsi,QWORD PTR[((64-0))+rsi] mov QWORD PTR[((544+0))+rsp],rax @@ -2080,8 +2081,8 @@ DB 102,72,15,110,199 call __ecp_nistz256_sqr_montq pcmpeqd xmm5,xmm4 - pshufd xmm4,xmm3,1h - por xmm4,xmm3 + pshufd xmm4,xmm1,1h + por xmm4,xmm1 pshufd xmm5,xmm5,0 pshufd xmm3,xmm4,01eh por xmm4,xmm3 @@ -2264,6 +2265,7 @@ $L$add_proceedq:: + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[96+rsp] adc r13,r13 @@ -2271,7 +2273,7 @@ $L$add_proceedq:: adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -2279,15 +2281,15 @@ $L$add_proceedq:: sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subq @@ -2457,16 +2459,14 @@ $L$SEH_begin_ecp_nistz256_point_add_affine:: mov r8,QWORD PTR[((64+24))+rsi] movdqa XMMWORD PTR[320+rsp],xmm0 movdqa XMMWORD PTR[(320+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[352+rsp],xmm2 movdqa XMMWORD PTR[(352+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[384+rsp],xmm4 movdqa XMMWORD PTR[(384+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rbx] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rbx] movdqu xmm2,XMMWORD PTR[32+rbx] por xmm5,xmm3 @@ -2584,6 +2584,7 @@ DB 102,72,15,110,199 + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[192+rsp] adc r13,r13 @@ -2591,7 +2592,7 @@ DB 102,72,15,110,199 adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -2599,15 +2600,15 @@ DB 102,72,15,110,199 sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subq @@ -2757,14 +2758,14 @@ __ecp_nistz256_add_tox PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 + sbb r11,0 - bt r11,0 - cmovnc r12,rax - cmovnc r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovnc r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovnc r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -2852,14 +2853,14 @@ __ecp_nistz256_mul_by_2x PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 + sbb r11,0 - bt r11,0 - cmovnc r12,rax - cmovnc r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovnc r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovnc r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -3109,16 +3110,14 @@ $L$point_addx:: mov rsi,rdx movdqa XMMWORD PTR[384+rsp],xmm0 movdqa XMMWORD PTR[(384+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[416+rsp],xmm2 movdqa XMMWORD PTR[(416+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[448+rsp],xmm4 movdqa XMMWORD PTR[(448+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rsi] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rsi] movdqu xmm2,XMMWORD PTR[32+rsi] por xmm5,xmm3 @@ -3130,14 +3129,14 @@ $L$point_addx:: movdqa XMMWORD PTR[480+rsp],xmm0 pshufd xmm4,xmm5,01eh movdqa XMMWORD PTR[(480+16)+rsp],xmm1 - por xmm1,xmm0 -DB 102,72,15,110,199 + movdqu xmm0,XMMWORD PTR[64+rsi] + movdqu xmm1,XMMWORD PTR[80+rsi] movdqa XMMWORD PTR[512+rsp],xmm2 movdqa XMMWORD PTR[(512+16)+rsp],xmm3 - por xmm3,xmm2 por xmm5,xmm4 pxor xmm4,xmm4 - por xmm3,xmm1 + por xmm1,xmm0 +DB 102,72,15,110,199 lea rsi,QWORD PTR[((64-128))+rsi] mov QWORD PTR[((544+0))+rsp],rdx @@ -3148,8 +3147,8 @@ DB 102,72,15,110,199 call __ecp_nistz256_sqr_montx pcmpeqd xmm5,xmm4 - pshufd xmm4,xmm3,1h - por xmm4,xmm3 + pshufd xmm4,xmm1,1h + por xmm4,xmm1 pshufd xmm5,xmm5,0 pshufd xmm3,xmm4,01eh por xmm4,xmm3 @@ -3332,6 +3331,7 @@ $L$add_proceedx:: + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[96+rsp] adc r13,r13 @@ -3339,7 +3339,7 @@ $L$add_proceedx:: adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -3347,15 +3347,15 @@ $L$add_proceedx:: sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subx @@ -3521,16 +3521,14 @@ $L$point_add_affinex:: mov r8,QWORD PTR[((64+24))+rsi] movdqa XMMWORD PTR[320+rsp],xmm0 movdqa XMMWORD PTR[(320+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[352+rsp],xmm2 movdqa XMMWORD PTR[(352+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[384+rsp],xmm4 movdqa XMMWORD PTR[(384+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rbx] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rbx] movdqu xmm2,XMMWORD PTR[32+rbx] por xmm5,xmm3 @@ -3648,6 +3646,7 @@ DB 102,72,15,110,199 + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[192+rsp] adc r13,r13 @@ -3655,7 +3654,7 @@ DB 102,72,15,110,199 adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -3663,15 +3662,15 @@ DB 102,72,15,110,199 sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subx diff --git a/deps/openssl/asm/x64-win32-masm/sha/sha1-x86_64.asm b/deps/openssl/asm/x64-win32-masm/sha/sha1-x86_64.asm index 295a2c06ba012e..24df4681230d5f 100644 --- a/deps/openssl/asm/x64-win32-masm/sha/sha1-x86_64.asm +++ b/deps/openssl/asm/x64-win32-masm/sha/sha1-x86_64.asm @@ -1291,9 +1291,9 @@ DB 102,15,56,0,251 ALIGN 16 $L$oop_shaext:: dec rdx - lea rax,QWORD PTR[64+rsi] + lea r8,QWORD PTR[64+rsi] paddd xmm1,xmm4 - cmovne rsi,rax + cmovne rsi,r8 movdqa xmm8,xmm0 DB 15,56,201,229 movdqa xmm2,xmm0 diff --git a/deps/openssl/asm/x86-elf-gas/bn/x86-mont.s b/deps/openssl/asm/x86-elf-gas/bn/x86-mont.s index 2f7211d92e230b..b683577231ad00 100644 --- a/deps/openssl/asm/x86-elf-gas/bn/x86-mont.s +++ b/deps/openssl/asm/x86-elf-gas/bn/x86-mont.s @@ -15,44 +15,51 @@ bn_mul_mont: jl .L000just_leave leal 20(%esp),%esi leal 24(%esp),%edx - movl %esp,%ebp addl $2,%edi negl %edi - leal -32(%esp,%edi,4),%esp + leal -32(%esp,%edi,4),%ebp negl %edi - movl %esp,%eax + movl %ebp,%eax subl %edx,%eax andl $2047,%eax - subl %eax,%esp - xorl %esp,%edx + subl %eax,%ebp + xorl %ebp,%edx andl $2048,%edx xorl $2048,%edx - subl %edx,%esp - andl $-64,%esp - movl %ebp,%eax - subl %esp,%eax + subl %edx,%ebp + andl $-64,%ebp + movl %esp,%eax + subl %ebp,%eax andl $-4096,%eax + movl %esp,%edx + leal (%ebp,%eax,1),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja .L001page_walk + jmp .L002page_walk_done +.align 16 .L001page_walk: - movl (%esp,%eax,1),%edx - subl $4096,%eax -.byte 46 - jnc .L001page_walk + leal -4096(%esp),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja .L001page_walk +.L002page_walk_done: movl (%esi),%eax movl 4(%esi),%ebx movl 8(%esi),%ecx - movl 12(%esi),%edx + movl 12(%esi),%ebp movl 16(%esi),%esi movl (%esi),%esi movl %eax,4(%esp) movl %ebx,8(%esp) movl %ecx,12(%esp) - movl %edx,16(%esp) + movl %ebp,16(%esp) movl %esi,20(%esp) leal -3(%edi),%ebx - movl %ebp,24(%esp) + movl %edx,24(%esp) leal OPENSSL_ia32cap_P,%eax btl $26,(%eax) - jnc .L002non_sse2 + jnc .L003non_sse2 movl $-1,%eax movd %eax,%mm7 movl 8(%esp),%esi @@ -76,7 +83,7 @@ bn_mul_mont: psrlq $32,%mm3 incl %ecx .align 16 -.L0031st: +.L0041st: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -91,7 +98,7 @@ bn_mul_mont: psrlq $32,%mm3 leal 1(%ecx),%ecx cmpl %ebx,%ecx - jl .L0031st + jl .L0041st pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -105,7 +112,7 @@ bn_mul_mont: paddq %mm2,%mm3 movq %mm3,32(%esp,%ebx,4) incl %edx -.L004outer: +.L005outer: xorl %ecx,%ecx movd (%edi,%edx,4),%mm4 movd (%esi),%mm5 @@ -127,7 +134,7 @@ bn_mul_mont: paddq %mm6,%mm2 incl %ecx decl %ebx -.L005inner: +.L006inner: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -144,7 +151,7 @@ bn_mul_mont: paddq %mm6,%mm2 decl %ebx leal 1(%ecx),%ecx - jnz .L005inner + jnz .L006inner movl %ecx,%ebx pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 @@ -162,11 +169,11 @@ bn_mul_mont: movq %mm3,32(%esp,%ebx,4) leal 1(%edx),%edx cmpl %ebx,%edx - jle .L004outer + jle .L005outer emms - jmp .L006common_tail + jmp .L007common_tail .align 16 -.L002non_sse2: +.L003non_sse2: movl 8(%esp),%esi leal 1(%ebx),%ebp movl 12(%esp),%edi @@ -177,12 +184,12 @@ bn_mul_mont: leal 4(%edi,%ebx,4),%eax orl %edx,%ebp movl (%edi),%edi - jz .L007bn_sqr_mont + jz .L008bn_sqr_mont movl %eax,28(%esp) movl (%esi),%eax xorl %edx,%edx .align 16 -.L008mull: +.L009mull: movl %edx,%ebp mull %edi addl %eax,%ebp @@ -191,7 +198,7 @@ bn_mul_mont: movl (%esi,%ecx,4),%eax cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl .L008mull + jl .L009mull movl %edx,%ebp mull %edi movl 20(%esp),%edi @@ -209,9 +216,9 @@ bn_mul_mont: movl 4(%esi),%eax adcl $0,%edx incl %ecx - jmp .L0092ndmadd + jmp .L0102ndmadd .align 16 -.L0101stmadd: +.L0111stmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -222,7 +229,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl .L0101stmadd + jl .L0111stmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%eax @@ -245,7 +252,7 @@ bn_mul_mont: adcl $0,%edx movl $1,%ecx .align 16 -.L0092ndmadd: +.L0102ndmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -256,7 +263,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl .L0092ndmadd + jl .L0102ndmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -272,16 +279,16 @@ bn_mul_mont: movl %edx,32(%esp,%ebx,4) cmpl 28(%esp),%ecx movl %eax,36(%esp,%ebx,4) - je .L006common_tail + je .L007common_tail movl (%ecx),%edi movl 8(%esp),%esi movl %ecx,12(%esp) xorl %ecx,%ecx xorl %edx,%edx movl (%esi),%eax - jmp .L0101stmadd + jmp .L0111stmadd .align 16 -.L007bn_sqr_mont: +.L008bn_sqr_mont: movl %ebx,(%esp) movl %ecx,12(%esp) movl %edi,%eax @@ -292,7 +299,7 @@ bn_mul_mont: andl $1,%ebx incl %ecx .align 16 -.L011sqr: +.L012sqr: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -304,7 +311,7 @@ bn_mul_mont: cmpl (%esp),%ecx movl %eax,%ebx movl %ebp,28(%esp,%ecx,4) - jl .L011sqr + jl .L012sqr movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -328,7 +335,7 @@ bn_mul_mont: movl 4(%esi),%eax movl $1,%ecx .align 16 -.L0123rdmadd: +.L0133rdmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -347,7 +354,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl .L0123rdmadd + jl .L0133rdmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -363,7 +370,7 @@ bn_mul_mont: movl %edx,32(%esp,%ebx,4) cmpl %ebx,%ecx movl %eax,36(%esp,%ebx,4) - je .L006common_tail + je .L007common_tail movl 4(%esi,%ecx,4),%edi leal 1(%ecx),%ecx movl %edi,%eax @@ -375,12 +382,12 @@ bn_mul_mont: xorl %ebp,%ebp cmpl %ebx,%ecx leal 1(%ecx),%ecx - je .L013sqrlast + je .L014sqrlast movl %edx,%ebx shrl $1,%edx andl $1,%ebx .align 16 -.L014sqradd: +.L015sqradd: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -396,13 +403,13 @@ bn_mul_mont: cmpl (%esp),%ecx movl %ebp,28(%esp,%ecx,4) movl %eax,%ebx - jle .L014sqradd + jle .L015sqradd movl %edx,%ebp addl %edx,%edx shrl $31,%ebp addl %ebx,%edx adcl $0,%ebp -.L013sqrlast: +.L014sqrlast: movl 20(%esp),%edi movl 16(%esp),%esi imull 32(%esp),%edi @@ -417,9 +424,9 @@ bn_mul_mont: adcl $0,%edx movl $1,%ecx movl 4(%esi),%eax - jmp .L0123rdmadd + jmp .L0133rdmadd .align 16 -.L006common_tail: +.L007common_tail: movl 16(%esp),%ebp movl 4(%esp),%edi leal 32(%esp),%esi @@ -427,13 +434,13 @@ bn_mul_mont: movl %ebx,%ecx xorl %edx,%edx .align 16 -.L015sub: +.L016sub: sbbl (%ebp,%edx,4),%eax movl %eax,(%edi,%edx,4) decl %ecx movl 4(%esi,%edx,4),%eax leal 1(%edx),%edx - jge .L015sub + jge .L016sub sbbl $0,%eax andl %eax,%esi notl %eax @@ -441,12 +448,12 @@ bn_mul_mont: andl %eax,%ebp orl %ebp,%esi .align 16 -.L016copy: +.L017copy: movl (%esi,%ebx,4),%eax movl %eax,(%edi,%ebx,4) movl %ecx,32(%esp,%ebx,4) decl %ebx - jge .L016copy + jge .L017copy movl 24(%esp),%esp movl $1,%eax .L000just_leave: diff --git a/deps/openssl/asm/x86-macosx-gas/bn/x86-mont.s b/deps/openssl/asm/x86-macosx-gas/bn/x86-mont.s index accec0e5197ccd..7bc58d24e0e624 100644 --- a/deps/openssl/asm/x86-macosx-gas/bn/x86-mont.s +++ b/deps/openssl/asm/x86-macosx-gas/bn/x86-mont.s @@ -14,47 +14,54 @@ L_bn_mul_mont_begin: jl L000just_leave leal 20(%esp),%esi leal 24(%esp),%edx - movl %esp,%ebp addl $2,%edi negl %edi - leal -32(%esp,%edi,4),%esp + leal -32(%esp,%edi,4),%ebp negl %edi - movl %esp,%eax + movl %ebp,%eax subl %edx,%eax andl $2047,%eax - subl %eax,%esp - xorl %esp,%edx + subl %eax,%ebp + xorl %ebp,%edx andl $2048,%edx xorl $2048,%edx - subl %edx,%esp - andl $-64,%esp - movl %ebp,%eax - subl %esp,%eax + subl %edx,%ebp + andl $-64,%ebp + movl %esp,%eax + subl %ebp,%eax andl $-4096,%eax + movl %esp,%edx + leal (%ebp,%eax,1),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja L001page_walk + jmp L002page_walk_done +.align 4,0x90 L001page_walk: - movl (%esp,%eax,1),%edx - subl $4096,%eax -.byte 46 - jnc L001page_walk + leal -4096(%esp),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja L001page_walk +L002page_walk_done: movl (%esi),%eax movl 4(%esi),%ebx movl 8(%esi),%ecx - movl 12(%esi),%edx + movl 12(%esi),%ebp movl 16(%esi),%esi movl (%esi),%esi movl %eax,4(%esp) movl %ebx,8(%esp) movl %ecx,12(%esp) - movl %edx,16(%esp) + movl %ebp,16(%esp) movl %esi,20(%esp) leal -3(%edi),%ebx - movl %ebp,24(%esp) - call L002PIC_me_up -L002PIC_me_up: + movl %edx,24(%esp) + call L003PIC_me_up +L003PIC_me_up: popl %eax - movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L002PIC_me_up(%eax),%eax + movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L003PIC_me_up(%eax),%eax btl $26,(%eax) - jnc L003non_sse2 + jnc L004non_sse2 movl $-1,%eax movd %eax,%mm7 movl 8(%esp),%esi @@ -78,7 +85,7 @@ L002PIC_me_up: psrlq $32,%mm3 incl %ecx .align 4,0x90 -L0041st: +L0051st: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -93,7 +100,7 @@ L0041st: psrlq $32,%mm3 leal 1(%ecx),%ecx cmpl %ebx,%ecx - jl L0041st + jl L0051st pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -107,7 +114,7 @@ L0041st: paddq %mm2,%mm3 movq %mm3,32(%esp,%ebx,4) incl %edx -L005outer: +L006outer: xorl %ecx,%ecx movd (%edi,%edx,4),%mm4 movd (%esi),%mm5 @@ -129,7 +136,7 @@ L005outer: paddq %mm6,%mm2 incl %ecx decl %ebx -L006inner: +L007inner: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -146,7 +153,7 @@ L006inner: paddq %mm6,%mm2 decl %ebx leal 1(%ecx),%ecx - jnz L006inner + jnz L007inner movl %ecx,%ebx pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 @@ -164,11 +171,11 @@ L006inner: movq %mm3,32(%esp,%ebx,4) leal 1(%edx),%edx cmpl %ebx,%edx - jle L005outer + jle L006outer emms - jmp L007common_tail + jmp L008common_tail .align 4,0x90 -L003non_sse2: +L004non_sse2: movl 8(%esp),%esi leal 1(%ebx),%ebp movl 12(%esp),%edi @@ -179,12 +186,12 @@ L003non_sse2: leal 4(%edi,%ebx,4),%eax orl %edx,%ebp movl (%edi),%edi - jz L008bn_sqr_mont + jz L009bn_sqr_mont movl %eax,28(%esp) movl (%esi),%eax xorl %edx,%edx .align 4,0x90 -L009mull: +L010mull: movl %edx,%ebp mull %edi addl %eax,%ebp @@ -193,7 +200,7 @@ L009mull: movl (%esi,%ecx,4),%eax cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl L009mull + jl L010mull movl %edx,%ebp mull %edi movl 20(%esp),%edi @@ -211,9 +218,9 @@ L009mull: movl 4(%esi),%eax adcl $0,%edx incl %ecx - jmp L0102ndmadd + jmp L0112ndmadd .align 4,0x90 -L0111stmadd: +L0121stmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -224,7 +231,7 @@ L0111stmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl L0111stmadd + jl L0121stmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%eax @@ -247,7 +254,7 @@ L0111stmadd: adcl $0,%edx movl $1,%ecx .align 4,0x90 -L0102ndmadd: +L0112ndmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -258,7 +265,7 @@ L0102ndmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl L0102ndmadd + jl L0112ndmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -274,16 +281,16 @@ L0102ndmadd: movl %edx,32(%esp,%ebx,4) cmpl 28(%esp),%ecx movl %eax,36(%esp,%ebx,4) - je L007common_tail + je L008common_tail movl (%ecx),%edi movl 8(%esp),%esi movl %ecx,12(%esp) xorl %ecx,%ecx xorl %edx,%edx movl (%esi),%eax - jmp L0111stmadd + jmp L0121stmadd .align 4,0x90 -L008bn_sqr_mont: +L009bn_sqr_mont: movl %ebx,(%esp) movl %ecx,12(%esp) movl %edi,%eax @@ -294,7 +301,7 @@ L008bn_sqr_mont: andl $1,%ebx incl %ecx .align 4,0x90 -L012sqr: +L013sqr: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -306,7 +313,7 @@ L012sqr: cmpl (%esp),%ecx movl %eax,%ebx movl %ebp,28(%esp,%ecx,4) - jl L012sqr + jl L013sqr movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -330,7 +337,7 @@ L012sqr: movl 4(%esi),%eax movl $1,%ecx .align 4,0x90 -L0133rdmadd: +L0143rdmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -349,7 +356,7 @@ L0133rdmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl L0133rdmadd + jl L0143rdmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -365,7 +372,7 @@ L0133rdmadd: movl %edx,32(%esp,%ebx,4) cmpl %ebx,%ecx movl %eax,36(%esp,%ebx,4) - je L007common_tail + je L008common_tail movl 4(%esi,%ecx,4),%edi leal 1(%ecx),%ecx movl %edi,%eax @@ -377,12 +384,12 @@ L0133rdmadd: xorl %ebp,%ebp cmpl %ebx,%ecx leal 1(%ecx),%ecx - je L014sqrlast + je L015sqrlast movl %edx,%ebx shrl $1,%edx andl $1,%ebx .align 4,0x90 -L015sqradd: +L016sqradd: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -398,13 +405,13 @@ L015sqradd: cmpl (%esp),%ecx movl %ebp,28(%esp,%ecx,4) movl %eax,%ebx - jle L015sqradd + jle L016sqradd movl %edx,%ebp addl %edx,%edx shrl $31,%ebp addl %ebx,%edx adcl $0,%ebp -L014sqrlast: +L015sqrlast: movl 20(%esp),%edi movl 16(%esp),%esi imull 32(%esp),%edi @@ -419,9 +426,9 @@ L014sqrlast: adcl $0,%edx movl $1,%ecx movl 4(%esi),%eax - jmp L0133rdmadd + jmp L0143rdmadd .align 4,0x90 -L007common_tail: +L008common_tail: movl 16(%esp),%ebp movl 4(%esp),%edi leal 32(%esp),%esi @@ -429,13 +436,13 @@ L007common_tail: movl %ebx,%ecx xorl %edx,%edx .align 4,0x90 -L016sub: +L017sub: sbbl (%ebp,%edx,4),%eax movl %eax,(%edi,%edx,4) decl %ecx movl 4(%esi,%edx,4),%eax leal 1(%edx),%edx - jge L016sub + jge L017sub sbbl $0,%eax andl %eax,%esi notl %eax @@ -443,12 +450,12 @@ L016sub: andl %eax,%ebp orl %ebp,%esi .align 4,0x90 -L017copy: +L018copy: movl (%esi,%ebx,4),%eax movl %eax,(%edi,%ebx,4) movl %ecx,32(%esp,%ebx,4) decl %ebx - jge L017copy + jge L018copy movl 24(%esp),%esp movl $1,%eax L000just_leave: diff --git a/deps/openssl/asm/x86-win32-masm/bn/x86-mont.asm b/deps/openssl/asm/x86-win32-masm/bn/x86-mont.asm index 4987f6fe9153f5..f026dae738fb4b 100644 --- a/deps/openssl/asm/x86-win32-masm/bn/x86-mont.asm +++ b/deps/openssl/asm/x86-win32-masm/bn/x86-mont.asm @@ -31,44 +31,51 @@ $L_bn_mul_mont_begin:: jl $L000just_leave lea esi,DWORD PTR 20[esp] lea edx,DWORD PTR 24[esp] - mov ebp,esp add edi,2 neg edi - lea esp,DWORD PTR [edi*4+esp-32] + lea ebp,DWORD PTR [edi*4+esp-32] neg edi - mov eax,esp + mov eax,ebp sub eax,edx and eax,2047 - sub esp,eax - xor edx,esp + sub ebp,eax + xor edx,ebp and edx,2048 xor edx,2048 - sub esp,edx - and esp,-64 - mov eax,ebp - sub eax,esp + sub ebp,edx + and ebp,-64 + mov eax,esp + sub eax,ebp and eax,-4096 + mov edx,esp + lea esp,DWORD PTR [eax*1+ebp] + mov eax,DWORD PTR [esp] + cmp esp,ebp + ja $L001page_walk + jmp $L002page_walk_done +ALIGN 16 $L001page_walk: - mov edx,DWORD PTR [eax*1+esp] - sub eax,4096 -DB 46 - jnc $L001page_walk + lea esp,DWORD PTR [esp-4096] + mov eax,DWORD PTR [esp] + cmp esp,ebp + ja $L001page_walk +$L002page_walk_done: mov eax,DWORD PTR [esi] mov ebx,DWORD PTR 4[esi] mov ecx,DWORD PTR 8[esi] - mov edx,DWORD PTR 12[esi] + mov ebp,DWORD PTR 12[esi] mov esi,DWORD PTR 16[esi] mov esi,DWORD PTR [esi] mov DWORD PTR 4[esp],eax mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ecx - mov DWORD PTR 16[esp],edx + mov DWORD PTR 16[esp],ebp mov DWORD PTR 20[esp],esi lea ebx,DWORD PTR [edi-3] - mov DWORD PTR 24[esp],ebp + mov DWORD PTR 24[esp],edx lea eax,DWORD PTR _OPENSSL_ia32cap_P bt DWORD PTR [eax],26 - jnc $L002non_sse2 + jnc $L003non_sse2 mov eax,-1 movd mm7,eax mov esi,DWORD PTR 8[esp] @@ -92,7 +99,7 @@ DB 46 psrlq mm3,32 inc ecx ALIGN 16 -$L0031st: +$L0041st: pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -107,7 +114,7 @@ $L0031st: psrlq mm3,32 lea ecx,DWORD PTR 1[ecx] cmp ecx,ebx - jl $L0031st + jl $L0041st pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -121,7 +128,7 @@ $L0031st: paddq mm3,mm2 movq QWORD PTR 32[ebx*4+esp],mm3 inc edx -$L004outer: +$L005outer: xor ecx,ecx movd mm4,DWORD PTR [edx*4+edi] movd mm5,DWORD PTR [esi] @@ -143,7 +150,7 @@ $L004outer: paddq mm2,mm6 inc ecx dec ebx -$L005inner: +$L006inner: pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -160,7 +167,7 @@ $L005inner: paddq mm2,mm6 dec ebx lea ecx,DWORD PTR 1[ecx] - jnz $L005inner + jnz $L006inner mov ebx,ecx pmuludq mm0,mm4 pmuludq mm1,mm5 @@ -178,11 +185,11 @@ $L005inner: movq QWORD PTR 32[ebx*4+esp],mm3 lea edx,DWORD PTR 1[edx] cmp edx,ebx - jle $L004outer + jle $L005outer emms - jmp $L006common_tail + jmp $L007common_tail ALIGN 16 -$L002non_sse2: +$L003non_sse2: mov esi,DWORD PTR 8[esp] lea ebp,DWORD PTR 1[ebx] mov edi,DWORD PTR 12[esp] @@ -193,12 +200,12 @@ $L002non_sse2: lea eax,DWORD PTR 4[ebx*4+edi] or ebp,edx mov edi,DWORD PTR [edi] - jz $L007bn_sqr_mont + jz $L008bn_sqr_mont mov DWORD PTR 28[esp],eax mov eax,DWORD PTR [esi] xor edx,edx ALIGN 16 -$L008mull: +$L009mull: mov ebp,edx mul edi add ebp,eax @@ -207,7 +214,7 @@ $L008mull: mov eax,DWORD PTR [ecx*4+esi] cmp ecx,ebx mov DWORD PTR 28[ecx*4+esp],ebp - jl $L008mull + jl $L009mull mov ebp,edx mul edi mov edi,DWORD PTR 20[esp] @@ -225,9 +232,9 @@ $L008mull: mov eax,DWORD PTR 4[esi] adc edx,0 inc ecx - jmp $L0092ndmadd + jmp $L0102ndmadd ALIGN 16 -$L0101stmadd: +$L0111stmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -238,7 +245,7 @@ $L0101stmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 28[ecx*4+esp],ebp - jl $L0101stmadd + jl $L0111stmadd mov ebp,edx mul edi add eax,DWORD PTR 32[ebx*4+esp] @@ -261,7 +268,7 @@ $L0101stmadd: adc edx,0 mov ecx,1 ALIGN 16 -$L0092ndmadd: +$L0102ndmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -272,7 +279,7 @@ $L0092ndmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 24[ecx*4+esp],ebp - jl $L0092ndmadd + jl $L0102ndmadd mov ebp,edx mul edi add ebp,DWORD PTR 32[ebx*4+esp] @@ -288,16 +295,16 @@ $L0092ndmadd: mov DWORD PTR 32[ebx*4+esp],edx cmp ecx,DWORD PTR 28[esp] mov DWORD PTR 36[ebx*4+esp],eax - je $L006common_tail + je $L007common_tail mov edi,DWORD PTR [ecx] mov esi,DWORD PTR 8[esp] mov DWORD PTR 12[esp],ecx xor ecx,ecx xor edx,edx mov eax,DWORD PTR [esi] - jmp $L0101stmadd + jmp $L0111stmadd ALIGN 16 -$L007bn_sqr_mont: +$L008bn_sqr_mont: mov DWORD PTR [esp],ebx mov DWORD PTR 12[esp],ecx mov eax,edi @@ -308,7 +315,7 @@ $L007bn_sqr_mont: and ebx,1 inc ecx ALIGN 16 -$L011sqr: +$L012sqr: mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -320,7 +327,7 @@ $L011sqr: cmp ecx,DWORD PTR [esp] mov ebx,eax mov DWORD PTR 28[ecx*4+esp],ebp - jl $L011sqr + jl $L012sqr mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -344,7 +351,7 @@ $L011sqr: mov eax,DWORD PTR 4[esi] mov ecx,1 ALIGN 16 -$L0123rdmadd: +$L0133rdmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -363,7 +370,7 @@ $L0123rdmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 24[ecx*4+esp],ebp - jl $L0123rdmadd + jl $L0133rdmadd mov ebp,edx mul edi add ebp,DWORD PTR 32[ebx*4+esp] @@ -379,7 +386,7 @@ $L0123rdmadd: mov DWORD PTR 32[ebx*4+esp],edx cmp ecx,ebx mov DWORD PTR 36[ebx*4+esp],eax - je $L006common_tail + je $L007common_tail mov edi,DWORD PTR 4[ecx*4+esi] lea ecx,DWORD PTR 1[ecx] mov eax,edi @@ -391,12 +398,12 @@ $L0123rdmadd: xor ebp,ebp cmp ecx,ebx lea ecx,DWORD PTR 1[ecx] - je $L013sqrlast + je $L014sqrlast mov ebx,edx shr edx,1 and ebx,1 ALIGN 16 -$L014sqradd: +$L015sqradd: mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -412,13 +419,13 @@ $L014sqradd: cmp ecx,DWORD PTR [esp] mov DWORD PTR 28[ecx*4+esp],ebp mov ebx,eax - jle $L014sqradd + jle $L015sqradd mov ebp,edx add edx,edx shr ebp,31 add edx,ebx adc ebp,0 -$L013sqrlast: +$L014sqrlast: mov edi,DWORD PTR 20[esp] mov esi,DWORD PTR 16[esp] imul edi,DWORD PTR 32[esp] @@ -433,9 +440,9 @@ $L013sqrlast: adc edx,0 mov ecx,1 mov eax,DWORD PTR 4[esi] - jmp $L0123rdmadd + jmp $L0133rdmadd ALIGN 16 -$L006common_tail: +$L007common_tail: mov ebp,DWORD PTR 16[esp] mov edi,DWORD PTR 4[esp] lea esi,DWORD PTR 32[esp] @@ -443,13 +450,13 @@ $L006common_tail: mov ecx,ebx xor edx,edx ALIGN 16 -$L015sub: +$L016sub: sbb eax,DWORD PTR [edx*4+ebp] mov DWORD PTR [edx*4+edi],eax dec ecx mov eax,DWORD PTR 4[edx*4+esi] lea edx,DWORD PTR 1[edx] - jge $L015sub + jge $L016sub sbb eax,0 and esi,eax not eax @@ -457,12 +464,12 @@ $L015sub: and ebp,eax or esi,ebp ALIGN 16 -$L016copy: +$L017copy: mov eax,DWORD PTR [ebx*4+esi] mov DWORD PTR [ebx*4+edi],eax mov DWORD PTR 32[ebx*4+esp],ecx dec ebx - jge $L016copy + jge $L017copy mov esp,DWORD PTR 24[esp] mov eax,1 $L000just_leave: diff --git a/deps/openssl/asm_obsolete/arm-void-gas/aes/bsaes-armv7.S b/deps/openssl/asm_obsolete/arm-void-gas/aes/bsaes-armv7.S index 9738ed50235b3e..449e7a442e87ce 100644 --- a/deps/openssl/asm_obsolete/arm-void-gas/aes/bsaes-armv7.S +++ b/deps/openssl/asm_obsolete/arm-void-gas/aes/bsaes-armv7.S @@ -1816,8 +1816,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_6: - vst1.64 {q14}, [r0,:128] @ next round tweak - veor q4, q4, q12 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1853,8 +1851,6 @@ bsaes_xts_encrypt: .align 5 .Lxts_enc_5: - vst1.64 {q13}, [r0,:128] @ next round tweak - veor q3, q3, q11 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1883,8 +1879,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_4: - vst1.64 {q12}, [r0,:128] @ next round tweak - veor q2, q2, q10 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1910,8 +1904,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_3: - vst1.64 {q11}, [r0,:128] @ next round tweak - veor q1, q1, q9 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1936,8 +1928,6 @@ bsaes_xts_encrypt: b .Lxts_enc_done .align 4 .Lxts_enc_2: - vst1.64 {q10}, [r0,:128] @ next round tweak - veor q0, q0, q8 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1960,7 +1950,7 @@ bsaes_xts_encrypt: .align 4 .Lxts_enc_1: mov r0, sp - veor q0, q8 + veor q0, q0, q8 mov r1, sp vst1.8 {q0}, [sp,:128] mov r2, r10 @@ -2346,8 +2336,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_5: - vst1.64 {q13}, [r0,:128] @ next round tweak - veor q3, q3, q11 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2376,8 +2364,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_4: - vst1.64 {q12}, [r0,:128] @ next round tweak - veor q2, q2, q10 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2403,8 +2389,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_3: - vst1.64 {q11}, [r0,:128] @ next round tweak - veor q1, q1, q9 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2429,8 +2413,6 @@ bsaes_xts_decrypt: b .Lxts_dec_done .align 4 .Lxts_dec_2: - vst1.64 {q10}, [r0,:128] @ next round tweak - veor q0, q0, q8 #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2453,12 +2435,12 @@ bsaes_xts_decrypt: .align 4 .Lxts_dec_1: mov r0, sp - veor q0, q8 + veor q0, q0, q8 mov r1, sp vst1.8 {q0}, [sp,:128] + mov r5, r2 @ preserve magic mov r2, r10 mov r4, r3 @ preserve fp - mov r5, r2 @ preserve magic bl AES_decrypt diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s index 0d36e3d4734b32..865c2ef5cb5c97 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont.s @@ -6,6 +6,8 @@ .type bn_mul_mont,@function .align 16 bn_mul_mont: + movl %r9d,%r9d + movq %rsp,%rax testl $3,%r9d jnz .Lmul_enter cmpl $8,%r9d @@ -25,29 +27,36 @@ bn_mul_mont: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 2(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -16(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -.Lmul_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done + +.align 16 .Lmul_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc .Lmul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + movq %rax,8(%rsp,%r9,8) +.Lmul_body: movq %rdx,%r12 movq (%r8),%r8 movq (%r12),%rbx @@ -215,19 +224,21 @@ bn_mul_mont: movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp .Lmul_epilogue: .byte 0xf3,0xc3 .size bn_mul_mont,.-bn_mul_mont .type bn_mul4x_mont,@function .align 16 bn_mul4x_mont: + movl %r9d,%r9d + movq %rsp,%rax .Lmul4x_enter: pushq %rbx pushq %rbp @@ -236,23 +247,29 @@ bn_mul4x_mont: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 4(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -32(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -.Lmul4x_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lmul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: + movq %rax,8(%rsp,%r9,8) +.Lmul4x_body: movq %rdi,16(%rsp,%r9,8) movq %rdx,%r12 movq (%r8),%r8 @@ -621,13 +638,13 @@ bn_mul4x_mont: movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp .Lmul4x_epilogue: .byte 0xf3,0xc3 .size bn_mul4x_mont,.-bn_mul4x_mont @@ -636,14 +653,15 @@ bn_mul4x_mont: .type bn_sqr8x_mont,@function .align 32 bn_sqr8x_mont: -.Lsqr8x_enter: movq %rsp,%rax +.Lsqr8x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lsqr8x_prologue: movl %r9d,%r10d shll $3,%r9d @@ -656,33 +674,42 @@ bn_sqr8x_mont: leaq -64(%rsp,%r9,2),%r11 + movq %rsp,%rbp movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lsqr8x_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -64(%rbp,%r9,2),%rbp jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq -64(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lsqr8x_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lsqr8x_page_walk + jmp .Lsqr8x_page_walk_done + +.align 16 .Lsqr8x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lsqr8x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lsqr8x_page_walk +.Lsqr8x_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s index a503f6bd8da256..74ac8ee1595f47 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/bn/x86_64-mont5.s @@ -6,16 +6,15 @@ .type bn_mul_mont_gather5,@function .align 64 bn_mul_mont_gather5: + movl %r9d,%r9d + movq %rsp,%rax testl $7,%r9d jnz .Lmul_enter jmp .Lmul4x_enter .align 16 .Lmul_enter: - movl %r9d,%r9d - movq %rsp,%rax movd 8(%rsp),%xmm5 - leaq .Linc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 @@ -23,26 +22,36 @@ bn_mul_mont_gather5: pushq %r14 pushq %r15 - leaq 2(%r9),%r11 - negq %r11 - leaq -264(%rsp,%r11,8),%rsp - andq $-1024,%rsp + negq %r9 + movq %rsp,%r11 + leaq -280(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 + - movq %rax,8(%rsp,%r9,8) -.Lmul_body: + subq %r10,%r11 + andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done - subq %rsp,%rax - andq $-4096,%rax .Lmul_page_walk: - movq (%rsp,%rax,1),%r11 - subq $4096,%rax -.byte 0x2e - jnc .Lmul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + + leaq .Linc(%rip),%r10 + movq %rax,8(%rsp,%r9,8) +.Lmul_body: leaq 128(%rdx),%r12 movdqa 0(%r10),%xmm0 @@ -413,15 +422,16 @@ bn_mul_mont_gather5: .type bn_mul4x_mont_gather5,@function .align 32 bn_mul4x_mont_gather5: -.Lmul4x_enter: .byte 0x67 movq %rsp,%rax +.Lmul4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +.Lmul4x_prologue: .byte 0x67 shll $3,%r9d @@ -438,32 +448,40 @@ bn_mul4x_mont_gather5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lmul4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lmul4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lmul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: negq %r9 @@ -1022,6 +1040,7 @@ bn_power5: pushq %r13 pushq %r14 pushq %r15 +.Lpower5_prologue: shll $3,%r9d leal (%r9,%r9,2),%r10d @@ -1036,32 +1055,40 @@ bn_power5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lpwr_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lpwr_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwr_page_walk + jmp .Lpwr_page_walk_done + .Lpwr_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lpwr_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lpwr_page_walk +.Lpwr_page_walk_done: movq %r9,%r10 negq %r9 @@ -1972,6 +1999,7 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 +.Lfrom_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -1986,32 +2014,40 @@ bn_from_mont8x: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb .Lfrom_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp .Lfrom_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lfrom_page_walk + jmp .Lfrom_page_walk_done + .Lfrom_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc .Lfrom_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja .Lfrom_page_walk +.Lfrom_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s index 7876e382994517..c7bc6f2636038b 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/ec/ecp_nistz256-x86_64.s @@ -27,6 +27,7 @@ ecp_nistz256_mul_by_2: pushq %r13 movq 0(%rsi),%r8 + xorq %r13,%r13 movq 8(%rsi),%r9 addq %r8,%r8 movq 16(%rsi),%r10 @@ -37,7 +38,7 @@ ecp_nistz256_mul_by_2: adcq %r10,%r10 adcq %r11,%r11 movq %r9,%rdx - sbbq %r13,%r13 + adcq $0,%r13 subq 0(%rsi),%r8 movq %r10,%rcx @@ -45,14 +46,14 @@ ecp_nistz256_mul_by_2: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -149,12 +150,12 @@ ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq .Lpoly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 - cmovzq %rcx,%r10 - cmovzq %r12,%r11 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 + cmovcq %rcx,%r10 + cmovcq %r12,%r11 xorq %r13,%r13 addq 0(%rsi),%r8 @@ -171,14 +172,14 @@ ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq .Lpoly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -217,14 +218,14 @@ ecp_nistz256_add: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -993,13 +994,14 @@ ecp_nistz256_avx2_select_w7: .type __ecp_nistz256_add_toq,@function .align 32 __ecp_nistz256_add_toq: + xorq %r11,%r11 addq 0(%rbx),%r12 adcq 8(%rbx),%r13 movq %r12,%rax adcq 16(%rbx),%r8 adcq 24(%rbx),%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1007,14 +1009,14 @@ __ecp_nistz256_add_toq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1082,13 +1084,14 @@ __ecp_nistz256_subq: .type __ecp_nistz256_mul_by_2q,@function .align 32 __ecp_nistz256_mul_by_2q: + xorq %r11,%r11 addq %r12,%r12 adcq %r13,%r13 movq %r12,%rax adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1096,14 +1099,14 @@ __ecp_nistz256_mul_by_2q: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1333,16 +1336,14 @@ ecp_nistz256_point_add: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1354,14 +1355,14 @@ ecp_nistz256_point_add: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-0(%rsi),%rsi movq %rax,544+0(%rsp) @@ -1372,8 +1373,8 @@ ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -1556,6 +1557,7 @@ ecp_nistz256_point_add: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -1563,7 +1565,7 @@ ecp_nistz256_point_add: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1571,15 +1573,15 @@ ecp_nistz256_point_add: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -1733,16 +1735,14 @@ ecp_nistz256_point_add_affine: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -1860,6 +1860,7 @@ ecp_nistz256_point_add_affine: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -1867,7 +1868,7 @@ ecp_nistz256_point_add_affine: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1875,15 +1876,15 @@ ecp_nistz256_point_add_affine: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq diff --git a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s index 38b7df19704ba2..d2fbc15044d213 100644 --- a/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-elf-gas/sha/sha1-x86_64.s @@ -1255,9 +1255,9 @@ _shaext_shortcut: .align 16 .Loop_shaext: decq %rdx - leaq 64(%rsi),%rax + leaq 64(%rsi),%r8 paddd %xmm4,%xmm1 - cmovneq %rax,%rsi + cmovneq %r8,%rsi movdqa %xmm0,%xmm8 .byte 15,56,201,229 movdqa %xmm0,%xmm2 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s index a5b25ebb4b24d0..7c59d9b7302d94 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont.s @@ -6,6 +6,8 @@ .p2align 4 _bn_mul_mont: + movl %r9d,%r9d + movq %rsp,%rax testl $3,%r9d jnz L$mul_enter cmpl $8,%r9d @@ -25,29 +27,36 @@ L$mul_enter: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 2(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -16(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -L$mul_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk + jmp L$mul_page_walk_done + +.p2align 4 L$mul_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x66,0x2e - jnc L$mul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk +L$mul_page_walk_done: + movq %rax,8(%rsp,%r9,8) +L$mul_body: movq %rdx,%r12 movq (%r8),%r8 movq (%r12),%rbx @@ -215,19 +224,21 @@ L$copy: movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp L$mul_epilogue: .byte 0xf3,0xc3 .p2align 4 bn_mul4x_mont: + movl %r9d,%r9d + movq %rsp,%rax L$mul4x_enter: pushq %rbx pushq %rbp @@ -236,23 +247,29 @@ L$mul4x_enter: pushq %r14 pushq %r15 - movl %r9d,%r9d - leaq 4(%r9),%r10 + negq %r9 movq %rsp,%r11 - negq %r10 - leaq (%rsp,%r10,8),%rsp - andq $-1024,%rsp + leaq -32(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 - movq %r11,8(%rsp,%r9,8) -L$mul4x_body: - subq %rsp,%r11 + subq %r10,%r11 andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul4x_page_walk + jmp L$mul4x_page_walk_done + L$mul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$mul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul4x_page_walk +L$mul4x_page_walk_done: + movq %rax,8(%rsp,%r9,8) +L$mul4x_body: movq %rdi,16(%rsp,%r9,8) movq %rdx,%r12 movq (%r8),%r8 @@ -621,13 +638,13 @@ L$copy4x: movdqu %xmm2,16(%rdi,%r14,1) movq 8(%rsp,%r9,8),%rsi movq $1,%rax - movq (%rsi),%r15 - movq 8(%rsi),%r14 - movq 16(%rsi),%r13 - movq 24(%rsi),%r12 - movq 32(%rsi),%rbp - movq 40(%rsi),%rbx - leaq 48(%rsi),%rsp + movq -48(%rsi),%r15 + movq -40(%rsi),%r14 + movq -32(%rsi),%r13 + movq -24(%rsi),%r12 + movq -16(%rsi),%rbp + movq -8(%rsi),%rbx + leaq (%rsi),%rsp L$mul4x_epilogue: .byte 0xf3,0xc3 @@ -636,14 +653,15 @@ L$mul4x_epilogue: .p2align 5 bn_sqr8x_mont: -L$sqr8x_enter: movq %rsp,%rax +L$sqr8x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$sqr8x_prologue: movl %r9d,%r10d shll $3,%r9d @@ -656,33 +674,42 @@ L$sqr8x_enter: leaq -64(%rsp,%r9,2),%r11 + movq %rsp,%rbp movq (%r8),%r8 subq %rsi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$sqr8x_sp_alt - subq %r11,%rsp - leaq -64(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -64(%rbp,%r9,2),%rbp jmp L$sqr8x_sp_done .p2align 5 L$sqr8x_sp_alt: leaq 4096-64(,%r9,2),%r10 - leaq -64(%rsp,%r9,2),%rsp + leaq -64(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$sqr8x_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$sqr8x_page_walk + jmp L$sqr8x_page_walk_done + +.p2align 4 L$sqr8x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$sqr8x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$sqr8x_page_walk +L$sqr8x_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s index 8bb7c34c3589ed..527abf57114b25 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/bn/x86_64-mont5.s @@ -6,16 +6,15 @@ .p2align 6 _bn_mul_mont_gather5: + movl %r9d,%r9d + movq %rsp,%rax testl $7,%r9d jnz L$mul_enter jmp L$mul4x_enter .p2align 4 L$mul_enter: - movl %r9d,%r9d - movq %rsp,%rax movd 8(%rsp),%xmm5 - leaq L$inc(%rip),%r10 pushq %rbx pushq %rbp pushq %r12 @@ -23,26 +22,36 @@ L$mul_enter: pushq %r14 pushq %r15 - leaq 2(%r9),%r11 - negq %r11 - leaq -264(%rsp,%r11,8),%rsp - andq $-1024,%rsp + negq %r9 + movq %rsp,%r11 + leaq -280(%rsp,%r9,8),%r10 + negq %r9 + andq $-1024,%r10 + - movq %rax,8(%rsp,%r9,8) -L$mul_body: + subq %r10,%r11 + andq $-4096,%r11 + leaq (%r10,%r11,1),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk + jmp L$mul_page_walk_done - subq %rsp,%rax - andq $-4096,%rax L$mul_page_walk: - movq (%rsp,%rax,1),%r11 - subq $4096,%rax -.byte 0x2e - jnc L$mul_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r11 + cmpq %r10,%rsp + ja L$mul_page_walk +L$mul_page_walk_done: + + leaq L$inc(%rip),%r10 + movq %rax,8(%rsp,%r9,8) +L$mul_body: leaq 128(%rdx),%r12 movdqa 0(%r10),%xmm0 @@ -413,15 +422,16 @@ L$mul_epilogue: .p2align 5 bn_mul4x_mont_gather5: -L$mul4x_enter: .byte 0x67 movq %rsp,%rax +L$mul4x_enter: pushq %rbx pushq %rbp pushq %r12 pushq %r13 pushq %r14 pushq %r15 +L$mul4x_prologue: .byte 0x67 shll $3,%r9d @@ -438,32 +448,40 @@ L$mul4x_enter: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$mul4xsp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$mul4xsp_done .p2align 5 L$mul4xsp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$mul4xsp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mul4x_page_walk + jmp L$mul4x_page_walk_done + L$mul4x_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$mul4x_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$mul4x_page_walk +L$mul4x_page_walk_done: negq %r9 @@ -1022,6 +1040,7 @@ _bn_power5: pushq %r13 pushq %r14 pushq %r15 +L$power5_prologue: shll $3,%r9d leal (%r9,%r9,2),%r10d @@ -1036,32 +1055,40 @@ _bn_power5: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$pwr_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$pwr_sp_done .p2align 5 L$pwr_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$pwr_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwr_page_walk + jmp L$pwr_page_walk_done + L$pwr_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$pwr_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$pwr_page_walk +L$pwr_page_walk_done: movq %r9,%r10 negq %r9 @@ -1972,6 +1999,7 @@ bn_from_mont8x: pushq %r13 pushq %r14 pushq %r15 +L$from_prologue: shll $3,%r9d leaq (%r9,%r9,2),%r10 @@ -1986,32 +2014,40 @@ bn_from_mont8x: leaq -320(%rsp,%r9,2),%r11 + movq %rsp,%rbp subq %rdi,%r11 andq $4095,%r11 cmpq %r11,%r10 jb L$from_sp_alt - subq %r11,%rsp - leaq -320(%rsp,%r9,2),%rsp + subq %r11,%rbp + leaq -320(%rbp,%r9,2),%rbp jmp L$from_sp_done .p2align 5 L$from_sp_alt: leaq 4096-320(,%r9,2),%r10 - leaq -320(%rsp,%r9,2),%rsp + leaq -320(%rbp,%r9,2),%rbp subq %r10,%r11 movq $0,%r10 cmovcq %r10,%r11 - subq %r11,%rsp + subq %r11,%rbp L$from_sp_done: - andq $-64,%rsp - movq %rax,%r11 - subq %rsp,%r11 + andq $-64,%rbp + movq %rsp,%r11 + subq %rbp,%r11 andq $-4096,%r11 + leaq (%r11,%rbp,1),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$from_page_walk + jmp L$from_page_walk_done + L$from_page_walk: - movq (%rsp,%r11,1),%r10 - subq $4096,%r11 -.byte 0x2e - jnc L$from_page_walk + leaq -4096(%rsp),%rsp + movq (%rsp),%r10 + cmpq %rbp,%rsp + ja L$from_page_walk +L$from_page_walk_done: movq %r9,%r10 negq %r9 diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s index 30456b900fdffc..62e8d00ccda8a9 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/ec/ecp_nistz256-x86_64.s @@ -27,6 +27,7 @@ _ecp_nistz256_mul_by_2: pushq %r13 movq 0(%rsi),%r8 + xorq %r13,%r13 movq 8(%rsi),%r9 addq %r8,%r8 movq 16(%rsi),%r10 @@ -37,7 +38,7 @@ _ecp_nistz256_mul_by_2: adcq %r10,%r10 adcq %r11,%r11 movq %r9,%rdx - sbbq %r13,%r13 + adcq $0,%r13 subq 0(%rsi),%r8 movq %r10,%rcx @@ -45,14 +46,14 @@ _ecp_nistz256_mul_by_2: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -149,12 +150,12 @@ _ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq L$poly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 - cmovzq %rcx,%r10 - cmovzq %r12,%r11 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 + cmovcq %rcx,%r10 + cmovcq %r12,%r11 xorq %r13,%r13 addq 0(%rsi),%r8 @@ -171,14 +172,14 @@ _ecp_nistz256_mul_by_3: sbbq $0,%r10 movq %r11,%r12 sbbq L$poly+24(%rip),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -217,14 +218,14 @@ _ecp_nistz256_add: sbbq 16(%rsi),%r10 movq %r11,%r12 sbbq 24(%rsi),%r11 - testq %r13,%r13 + sbbq $0,%r13 - cmovzq %rax,%r8 - cmovzq %rdx,%r9 + cmovcq %rax,%r8 + cmovcq %rdx,%r9 movq %r8,0(%rdi) - cmovzq %rcx,%r10 + cmovcq %rcx,%r10 movq %r9,8(%rdi) - cmovzq %r12,%r11 + cmovcq %r12,%r11 movq %r10,16(%rdi) movq %r11,24(%rdi) @@ -993,13 +994,14 @@ _ecp_nistz256_avx2_select_w7: .p2align 5 __ecp_nistz256_add_toq: + xorq %r11,%r11 addq 0(%rbx),%r12 adcq 8(%rbx),%r13 movq %r12,%rax adcq 16(%rbx),%r8 adcq 24(%rbx),%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1007,14 +1009,14 @@ __ecp_nistz256_add_toq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1082,13 +1084,14 @@ __ecp_nistz256_subq: .p2align 5 __ecp_nistz256_mul_by_2q: + xorq %r11,%r11 addq %r12,%r12 adcq %r13,%r13 movq %r12,%rax adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1096,14 +1099,14 @@ __ecp_nistz256_mul_by_2q: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 - cmovzq %rbp,%r13 + cmovcq %rax,%r12 + cmovcq %rbp,%r13 movq %r12,0(%rdi) - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq %r13,8(%rdi) - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq %r8,16(%rdi) movq %r9,24(%rdi) @@ -1333,16 +1336,14 @@ _ecp_nistz256_point_add: movq %rdx,%rsi movdqa %xmm0,384(%rsp) movdqa %xmm1,384+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,416(%rsp) movdqa %xmm3,416+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,448(%rsp) movdqa %xmm5,448+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rsi),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rsi),%xmm1 movdqu 32(%rsi),%xmm2 por %xmm3,%xmm5 @@ -1354,14 +1355,14 @@ _ecp_nistz256_point_add: movdqa %xmm0,480(%rsp) pshufd $0x1e,%xmm5,%xmm4 movdqa %xmm1,480+16(%rsp) - por %xmm0,%xmm1 -.byte 102,72,15,110,199 + movdqu 64(%rsi),%xmm0 + movdqu 80(%rsi),%xmm1 movdqa %xmm2,512(%rsp) movdqa %xmm3,512+16(%rsp) - por %xmm2,%xmm3 por %xmm4,%xmm5 pxor %xmm4,%xmm4 - por %xmm1,%xmm3 + por %xmm0,%xmm1 +.byte 102,72,15,110,199 leaq 64-0(%rsi),%rsi movq %rax,544+0(%rsp) @@ -1372,8 +1373,8 @@ _ecp_nistz256_point_add: call __ecp_nistz256_sqr_montq pcmpeqd %xmm4,%xmm5 - pshufd $0xb1,%xmm3,%xmm4 - por %xmm3,%xmm4 + pshufd $0xb1,%xmm1,%xmm4 + por %xmm1,%xmm4 pshufd $0,%xmm5,%xmm5 pshufd $0x1e,%xmm4,%xmm3 por %xmm3,%xmm4 @@ -1556,6 +1557,7 @@ L$add_proceedq: + xorq %r11,%r11 addq %r12,%r12 leaq 96(%rsp),%rsi adcq %r13,%r13 @@ -1563,7 +1565,7 @@ L$add_proceedq: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1571,15 +1573,15 @@ L$add_proceedq: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq @@ -1733,16 +1735,14 @@ _ecp_nistz256_point_add_affine: movq 64+24(%rsi),%r8 movdqa %xmm0,320(%rsp) movdqa %xmm1,320+16(%rsp) - por %xmm0,%xmm1 movdqa %xmm2,352(%rsp) movdqa %xmm3,352+16(%rsp) - por %xmm2,%xmm3 movdqa %xmm4,384(%rsp) movdqa %xmm5,384+16(%rsp) - por %xmm1,%xmm3 + por %xmm4,%xmm5 movdqu 0(%rbx),%xmm0 - pshufd $0xb1,%xmm3,%xmm5 + pshufd $0xb1,%xmm5,%xmm3 movdqu 16(%rbx),%xmm1 movdqu 32(%rbx),%xmm2 por %xmm3,%xmm5 @@ -1860,6 +1860,7 @@ _ecp_nistz256_point_add_affine: + xorq %r11,%r11 addq %r12,%r12 leaq 192(%rsp),%rsi adcq %r13,%r13 @@ -1867,7 +1868,7 @@ _ecp_nistz256_point_add_affine: adcq %r8,%r8 adcq %r9,%r9 movq %r13,%rbp - sbbq %r11,%r11 + adcq $0,%r11 subq $-1,%r12 movq %r8,%rcx @@ -1875,15 +1876,15 @@ _ecp_nistz256_point_add_affine: sbbq $0,%r8 movq %r9,%r10 sbbq %r15,%r9 - testq %r11,%r11 + sbbq $0,%r11 - cmovzq %rax,%r12 + cmovcq %rax,%r12 movq 0(%rsi),%rax - cmovzq %rbp,%r13 + cmovcq %rbp,%r13 movq 8(%rsi),%rbp - cmovzq %rcx,%r8 + cmovcq %rcx,%r8 movq 16(%rsi),%rcx - cmovzq %r10,%r9 + cmovcq %r10,%r9 movq 24(%rsi),%r10 call __ecp_nistz256_subq diff --git a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s index 671034cdafa3c4..47c5f633cd8149 100644 --- a/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s +++ b/deps/openssl/asm_obsolete/x64-macosx-gas/sha/sha1-x86_64.s @@ -1255,9 +1255,9 @@ _shaext_shortcut: .p2align 4 L$oop_shaext: decq %rdx - leaq 64(%rsi),%rax + leaq 64(%rsi),%r8 paddd %xmm4,%xmm1 - cmovneq %rax,%rsi + cmovneq %r8,%rsi movdqa %xmm0,%xmm8 .byte 15,56,201,229 movdqa %xmm0,%xmm2 diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm index ed588a016b64fd..2b46716247f87d 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont.asm @@ -19,6 +19,8 @@ $L$SEH_begin_bn_mul_mont:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp test r9d,3 jnz $L$mul_enter cmp r9d,8 @@ -38,29 +40,36 @@ $L$mul_enter:: push r14 push r15 - mov r9d,r9d - lea r10,QWORD PTR[2+r9] + neg r9 mov r11,rsp - neg r10 - lea rsp,QWORD PTR[r10*8+rsp] - and rsp,-1024 + lea r10,QWORD PTR[((-16))+r9*8+rsp] + neg r9 + and r10,-1024 - mov QWORD PTR[8+r9*8+rsp],r11 -$L$mul_body:: - sub r11,rsp + sub r11,r10 and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk + jmp $L$mul_page_walk_done + +ALIGN 16 $L$mul_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 066h,02eh - jnc $L$mul_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk +$L$mul_page_walk_done:: + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul_body:: mov r12,rdx mov r8,QWORD PTR[r8] mov rbx,QWORD PTR[r12] @@ -228,13 +237,13 @@ $L$copy:: mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - mov r15,QWORD PTR[rsi] - mov r14,QWORD PTR[8+rsi] - mov r13,QWORD PTR[16+rsi] - mov r12,QWORD PTR[24+rsi] - mov rbp,QWORD PTR[32+rsi] - mov rbx,QWORD PTR[40+rsi] - lea rsp,QWORD PTR[48+rsi] + mov r15,QWORD PTR[((-48))+rsi] + mov r14,QWORD PTR[((-40))+rsi] + mov r13,QWORD PTR[((-32))+rsi] + mov r12,QWORD PTR[((-24))+rsi] + mov rbp,QWORD PTR[((-16))+rsi] + mov rbx,QWORD PTR[((-8))+rsi] + lea rsp,QWORD PTR[rsi] $L$mul_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] @@ -256,6 +265,8 @@ $L$SEH_begin_bn_mul4x_mont:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp $L$mul4x_enter:: push rbx push rbp @@ -264,23 +275,29 @@ $L$mul4x_enter:: push r14 push r15 - mov r9d,r9d - lea r10,QWORD PTR[4+r9] + neg r9 mov r11,rsp - neg r10 - lea rsp,QWORD PTR[r10*8+rsp] - and rsp,-1024 + lea r10,QWORD PTR[((-32))+r9*8+rsp] + neg r9 + and r10,-1024 - mov QWORD PTR[8+r9*8+rsp],r11 -$L$mul4x_body:: - sub r11,rsp + sub r11,r10 and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul4x_page_walk + jmp $L$mul4x_page_walk_done + $L$mul4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$mul4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul4x_page_walk +$L$mul4x_page_walk_done:: + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul4x_body:: mov QWORD PTR[16+r9*8+rsp],rdi mov r12,rdx mov r8,QWORD PTR[r8] @@ -649,13 +666,13 @@ $L$copy4x:: movdqu XMMWORD PTR[16+r14*1+rdi],xmm2 mov rsi,QWORD PTR[8+r9*8+rsp] mov rax,1 - mov r15,QWORD PTR[rsi] - mov r14,QWORD PTR[8+rsi] - mov r13,QWORD PTR[16+rsi] - mov r12,QWORD PTR[24+rsi] - mov rbp,QWORD PTR[32+rsi] - mov rbx,QWORD PTR[40+rsi] - lea rsp,QWORD PTR[48+rsi] + mov r15,QWORD PTR[((-48))+rsi] + mov r14,QWORD PTR[((-40))+rsi] + mov r13,QWORD PTR[((-32))+rsi] + mov r12,QWORD PTR[((-24))+rsi] + mov rbp,QWORD PTR[((-16))+rsi] + mov rbx,QWORD PTR[((-8))+rsi] + lea rsp,QWORD PTR[rsi] $L$mul4x_epilogue:: mov rdi,QWORD PTR[8+rsp] ;WIN64 epilogue mov rsi,QWORD PTR[16+rsp] @@ -679,14 +696,15 @@ $L$SEH_begin_bn_sqr8x_mont:: mov r9,QWORD PTR[48+rsp] -$L$sqr8x_enter:: mov rax,rsp +$L$sqr8x_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$sqr8x_prologue:: mov r10d,r9d shl r9d,3 @@ -699,33 +717,42 @@ $L$sqr8x_enter:: lea r11,QWORD PTR[((-64))+r9*2+rsp] + mov rbp,rsp mov r8,QWORD PTR[r8] sub r11,rsi and r11,4095 cmp r10,r11 jb $L$sqr8x_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-64))+r9*2+rbp] jmp $L$sqr8x_sp_done ALIGN 32 $L$sqr8x_sp_alt:: lea r10,QWORD PTR[((4096-64))+r9*2] - lea rsp,QWORD PTR[((-64))+r9*2+rsp] + lea rbp,QWORD PTR[((-64))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$sqr8x_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$sqr8x_page_walk + jmp $L$sqr8x_page_walk_done + +ALIGN 16 $L$sqr8x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$sqr8x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$sqr8x_page_walk +$L$sqr8x_page_walk_done:: mov r10,r9 neg r9 @@ -860,22 +887,8 @@ mul_handler PROC PRIVATE mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] - lea rax,QWORD PTR[48+rax] - mov rbx,QWORD PTR[((-8))+rax] - mov rbp,QWORD PTR[((-16))+rax] - mov r12,QWORD PTR[((-24))+rax] - mov r13,QWORD PTR[((-32))+rax] - mov r14,QWORD PTR[((-40))+rax] - mov r15,QWORD PTR[((-48))+rax] - mov QWORD PTR[144+r8],rbx - mov QWORD PTR[160+r8],rbp - mov QWORD PTR[216+r8],r12 - mov QWORD PTR[224+r8],r13 - mov QWORD PTR[232+r8],r14 - mov QWORD PTR[240+r8],r15 - - jmp $L$common_seh_tail + jmp $L$common_pop_regs mul_handler ENDP @@ -903,15 +916,21 @@ sqr_handler PROC PRIVATE cmp rbx,r10 jb $L$common_seh_tail + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_pop_regs + mov rax,QWORD PTR[152+r8] - mov r10d,DWORD PTR[4+r11] + mov r10d,DWORD PTR[8+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail mov rax,QWORD PTR[40+rax] +$L$common_pop_regs:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -993,7 +1012,8 @@ DB 9,0,0,0 $L$SEH_info_bn_sqr8x_mont:: DB 9,0,0,0 DD imagerel sqr_handler - DD imagerel $L$sqr8x_body,imagerel $L$sqr8x_epilogue + DD imagerel $L$sqr8x_prologue,imagerel $L$sqr8x_body,imagerel $L$sqr8x_epilogue +ALIGN 8 .xdata ENDS END diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm index fb3c27a0ff5ede..89f45a49157cba 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/bn/x86_64-mont5.asm @@ -19,16 +19,15 @@ $L$SEH_begin_bn_mul_mont_gather5:: mov r9,QWORD PTR[48+rsp] + mov r9d,r9d + mov rax,rsp test r9d,7 jnz $L$mul_enter jmp $L$mul4x_enter ALIGN 16 $L$mul_enter:: - mov r9d,r9d - mov rax,rsp movd xmm5,DWORD PTR[56+rsp] - lea r10,QWORD PTR[$L$inc] push rbx push rbp push r12 @@ -36,26 +35,36 @@ $L$mul_enter:: push r14 push r15 - lea r11,QWORD PTR[2+r9] - neg r11 - lea rsp,QWORD PTR[((-264))+r11*8+rsp] - and rsp,-1024 + neg r9 + mov r11,rsp + lea r10,QWORD PTR[((-280))+r9*8+rsp] + neg r9 + and r10,-1024 + - mov QWORD PTR[8+r9*8+rsp],rax -$L$mul_body:: + sub r11,r10 + and r11,-4096 + lea rsp,QWORD PTR[r11*1+r10] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk + jmp $L$mul_page_walk_done - sub rax,rsp - and rax,-4096 $L$mul_page_walk:: - mov r11,QWORD PTR[rax*1+rsp] - sub rax,4096 -DB 02eh - jnc $L$mul_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r11,QWORD PTR[rsp] + cmp rsp,r10 + ja $L$mul_page_walk +$L$mul_page_walk_done:: + + lea r10,QWORD PTR[$L$inc] + mov QWORD PTR[8+r9*8+rsp],rax +$L$mul_body:: lea r12,QWORD PTR[128+rdx] movdqa xmm0,XMMWORD PTR[r10] @@ -441,15 +450,16 @@ $L$SEH_begin_bn_mul4x_mont_gather5:: mov r9,QWORD PTR[48+rsp] -$L$mul4x_enter:: DB 067h mov rax,rsp +$L$mul4x_enter:: push rbx push rbp push r12 push r13 push r14 push r15 +$L$mul4x_prologue:: DB 067h shl r9d,3 @@ -466,32 +476,40 @@ DB 067h lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$mul4xsp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$mul4xsp_done ALIGN 32 $L$mul4xsp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$mul4xsp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mul4x_page_walk + jmp $L$mul4x_page_walk_done + $L$mul4x_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$mul4x_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$mul4x_page_walk +$L$mul4x_page_walk_done:: neg r9 @@ -1065,6 +1083,7 @@ $L$SEH_begin_bn_power5:: push r13 push r14 push r15 +$L$power5_prologue:: shl r9d,3 lea r10d,DWORD PTR[r9*2+r9] @@ -1079,32 +1098,40 @@ $L$SEH_begin_bn_power5:: lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$pwr_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$pwr_sp_done ALIGN 32 $L$pwr_sp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$pwr_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwr_page_walk + jmp $L$pwr_page_walk_done + $L$pwr_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$pwr_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$pwr_page_walk +$L$pwr_page_walk_done:: mov r10,r9 neg r9 @@ -2030,6 +2057,7 @@ DB 067h push r13 push r14 push r15 +$L$from_prologue:: shl r9d,3 lea r10,QWORD PTR[r9*2+r9] @@ -2044,32 +2072,40 @@ DB 067h lea r11,QWORD PTR[((-320))+r9*2+rsp] + mov rbp,rsp sub r11,rdi and r11,4095 cmp r10,r11 jb $L$from_sp_alt - sub rsp,r11 - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + sub rbp,r11 + lea rbp,QWORD PTR[((-320))+r9*2+rbp] jmp $L$from_sp_done ALIGN 32 $L$from_sp_alt:: lea r10,QWORD PTR[((4096-320))+r9*2] - lea rsp,QWORD PTR[((-320))+r9*2+rsp] + lea rbp,QWORD PTR[((-320))+r9*2+rbp] sub r11,r10 mov r10,0 cmovc r11,r10 - sub rsp,r11 + sub rbp,r11 $L$from_sp_done:: - and rsp,-64 - mov r11,rax - sub r11,rsp + and rbp,-64 + mov r11,rsp + sub r11,rbp and r11,-4096 + lea rsp,QWORD PTR[rbp*1+r11] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$from_page_walk + jmp $L$from_page_walk_done + $L$from_page_walk:: - mov r10,QWORD PTR[r11*1+rsp] - sub r11,4096 -DB 02eh - jnc $L$from_page_walk + lea rsp,QWORD PTR[((-4096))+rsp] + mov r10,QWORD PTR[rsp] + cmp rsp,rbp + ja $L$from_page_walk +$L$from_page_walk_done:: mov r10,r9 neg r9 @@ -2383,9 +2419,14 @@ mul_handler PROC PRIVATE cmp rbx,r10 jb $L$common_seh_tail + mov r10d,DWORD PTR[4+r11] + lea r10,QWORD PTR[r10*1+rsi] + cmp rbx,r10 + jb $L$common_pop_regs + mov rax,QWORD PTR[152+r8] - mov r10d,DWORD PTR[4+r11] + mov r10d,DWORD PTR[8+r11] lea r10,QWORD PTR[r10*1+rsi] cmp rbx,r10 jae $L$common_seh_tail @@ -2397,11 +2438,11 @@ mul_handler PROC PRIVATE mov r10,QWORD PTR[192+r8] mov rax,QWORD PTR[8+r10*8+rax] - jmp $L$body_proceed + jmp $L$common_pop_regs $L$body_40:: mov rax,QWORD PTR[40+rax] -$L$body_proceed:: +$L$common_pop_regs:: mov rbx,QWORD PTR[((-8))+rax] mov rbp,QWORD PTR[((-16))+rax] mov r12,QWORD PTR[((-24))+rax] @@ -2483,22 +2524,22 @@ ALIGN 8 $L$SEH_info_bn_mul_mont_gather5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$mul_body,imagerel $L$mul_epilogue + DD imagerel $L$mul_body,imagerel $L$mul_body,imagerel $L$mul_epilogue ALIGN 8 $L$SEH_info_bn_mul4x_mont_gather5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue + DD imagerel $L$mul4x_prologue,imagerel $L$mul4x_body,imagerel $L$mul4x_epilogue ALIGN 8 $L$SEH_info_bn_power5:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$power5_body,imagerel $L$power5_epilogue + DD imagerel $L$power5_prologue,imagerel $L$power5_body,imagerel $L$power5_epilogue ALIGN 8 $L$SEH_info_bn_from_mont8x:: DB 9,0,0,0 DD imagerel mul_handler - DD imagerel $L$from_body,imagerel $L$from_epilogue + DD imagerel $L$from_prologue,imagerel $L$from_body,imagerel $L$from_epilogue ALIGN 8 $L$SEH_info_bn_gather5:: DB 001h,00bh,003h,00ah diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm b/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm index ca78bd52ccc9f2..c985159a7b4012 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/ec/ecp_nistz256-x86_64.asm @@ -36,6 +36,7 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: push r13 mov r8,QWORD PTR[rsi] + xor r13,r13 mov r9,QWORD PTR[8+rsi] add r8,r8 mov r10,QWORD PTR[16+rsi] @@ -46,7 +47,7 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: adc r10,r10 adc r11,r11 mov rdx,r9 - sbb r13,r13 + adc r13,0 sub r8,QWORD PTR[rsi] mov rcx,r10 @@ -54,14 +55,14 @@ $L$SEH_begin_ecp_nistz256_mul_by_2:: sbb r10,QWORD PTR[16+rsi] mov r12,r11 sbb r11,QWORD PTR[24+rsi] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -180,12 +181,12 @@ $L$SEH_begin_ecp_nistz256_mul_by_3:: sbb r10,0 mov r12,r11 sbb r11,QWORD PTR[(($L$poly+24))] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx - cmovz r10,rcx - cmovz r11,r12 + cmovc r8,rax + cmovc r9,rdx + cmovc r10,rcx + cmovc r11,r12 xor r13,r13 add r8,QWORD PTR[rsi] @@ -202,14 +203,14 @@ $L$SEH_begin_ecp_nistz256_mul_by_3:: sbb r10,0 mov r12,r11 sbb r11,QWORD PTR[(($L$poly+24))] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -260,14 +261,14 @@ $L$SEH_begin_ecp_nistz256_add:: sbb r10,QWORD PTR[16+rsi] mov r12,r11 sbb r11,QWORD PTR[24+rsi] - test r13,r13 + sbb r13,0 - cmovz r8,rax - cmovz r9,rdx + cmovc r8,rax + cmovc r9,rdx mov QWORD PTR[rdi],r8 - cmovz r10,rcx + cmovc r10,rcx mov QWORD PTR[8+rdi],r9 - cmovz r11,r12 + cmovc r11,r12 mov QWORD PTR[16+rdi],r10 mov QWORD PTR[24+rdi],r11 @@ -1167,13 +1168,14 @@ ecp_nistz256_avx2_select_w7 ENDP ALIGN 32 __ecp_nistz256_add_toq PROC PRIVATE + xor r11,r11 add r12,QWORD PTR[rbx] adc r13,QWORD PTR[8+rbx] mov rax,r12 adc r8,QWORD PTR[16+rbx] adc r9,QWORD PTR[24+rbx] mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -1181,14 +1183,14 @@ __ecp_nistz256_add_toq PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax - cmovz r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovz r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovz r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -1256,13 +1258,14 @@ __ecp_nistz256_subq ENDP ALIGN 32 __ecp_nistz256_mul_by_2q PROC PRIVATE + xor r11,r11 add r12,r12 adc r13,r13 mov rax,r12 adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -1270,14 +1273,14 @@ __ecp_nistz256_mul_by_2q PROC PRIVATE sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax - cmovz r13,rbp + cmovc r12,rax + cmovc r13,rbp mov QWORD PTR[rdi],r12 - cmovz r8,rcx + cmovc r8,rcx mov QWORD PTR[8+rdi],r13 - cmovz r9,r10 + cmovc r9,r10 mov QWORD PTR[16+rdi],r8 mov QWORD PTR[24+rdi],r9 @@ -1527,16 +1530,14 @@ $L$SEH_begin_ecp_nistz256_point_add:: mov rsi,rdx movdqa XMMWORD PTR[384+rsp],xmm0 movdqa XMMWORD PTR[(384+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[416+rsp],xmm2 movdqa XMMWORD PTR[(416+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[448+rsp],xmm4 movdqa XMMWORD PTR[(448+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rsi] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rsi] movdqu xmm2,XMMWORD PTR[32+rsi] por xmm5,xmm3 @@ -1548,14 +1549,14 @@ $L$SEH_begin_ecp_nistz256_point_add:: movdqa XMMWORD PTR[480+rsp],xmm0 pshufd xmm4,xmm5,01eh movdqa XMMWORD PTR[(480+16)+rsp],xmm1 - por xmm1,xmm0 -DB 102,72,15,110,199 + movdqu xmm0,XMMWORD PTR[64+rsi] + movdqu xmm1,XMMWORD PTR[80+rsi] movdqa XMMWORD PTR[512+rsp],xmm2 movdqa XMMWORD PTR[(512+16)+rsp],xmm3 - por xmm3,xmm2 por xmm5,xmm4 pxor xmm4,xmm4 - por xmm3,xmm1 + por xmm1,xmm0 +DB 102,72,15,110,199 lea rsi,QWORD PTR[((64-0))+rsi] mov QWORD PTR[((544+0))+rsp],rax @@ -1566,8 +1567,8 @@ DB 102,72,15,110,199 call __ecp_nistz256_sqr_montq pcmpeqd xmm5,xmm4 - pshufd xmm4,xmm3,1h - por xmm4,xmm3 + pshufd xmm4,xmm1,1h + por xmm4,xmm1 pshufd xmm5,xmm5,0 pshufd xmm3,xmm4,01eh por xmm4,xmm3 @@ -1750,6 +1751,7 @@ $L$add_proceedq:: + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[96+rsp] adc r13,r13 @@ -1757,7 +1759,7 @@ $L$add_proceedq:: adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -1765,15 +1767,15 @@ $L$add_proceedq:: sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subq @@ -1939,16 +1941,14 @@ $L$SEH_begin_ecp_nistz256_point_add_affine:: mov r8,QWORD PTR[((64+24))+rsi] movdqa XMMWORD PTR[320+rsp],xmm0 movdqa XMMWORD PTR[(320+16)+rsp],xmm1 - por xmm1,xmm0 movdqa XMMWORD PTR[352+rsp],xmm2 movdqa XMMWORD PTR[(352+16)+rsp],xmm3 - por xmm3,xmm2 movdqa XMMWORD PTR[384+rsp],xmm4 movdqa XMMWORD PTR[(384+16)+rsp],xmm5 - por xmm3,xmm1 + por xmm5,xmm4 movdqu xmm0,XMMWORD PTR[rbx] - pshufd xmm5,xmm3,1h + pshufd xmm3,xmm5,1h movdqu xmm1,XMMWORD PTR[16+rbx] movdqu xmm2,XMMWORD PTR[32+rbx] por xmm5,xmm3 @@ -2066,6 +2066,7 @@ DB 102,72,15,110,199 + xor r11,r11 add r12,r12 lea rsi,QWORD PTR[192+rsp] adc r13,r13 @@ -2073,7 +2074,7 @@ DB 102,72,15,110,199 adc r8,r8 adc r9,r9 mov rbp,r13 - sbb r11,r11 + adc r11,0 sub r12,-1 mov rcx,r8 @@ -2081,15 +2082,15 @@ DB 102,72,15,110,199 sbb r8,0 mov r10,r9 sbb r9,r15 - test r11,r11 + sbb r11,0 - cmovz r12,rax + cmovc r12,rax mov rax,QWORD PTR[rsi] - cmovz r13,rbp + cmovc r13,rbp mov rbp,QWORD PTR[8+rsi] - cmovz r8,rcx + cmovc r8,rcx mov rcx,QWORD PTR[16+rsi] - cmovz r9,r10 + cmovc r9,r10 mov r10,QWORD PTR[24+rsi] call __ecp_nistz256_subq diff --git a/deps/openssl/asm_obsolete/x64-win32-masm/sha/sha1-x86_64.asm b/deps/openssl/asm_obsolete/x64-win32-masm/sha/sha1-x86_64.asm index 07b7882a96c0c6..7528c8a8a69303 100644 --- a/deps/openssl/asm_obsolete/x64-win32-masm/sha/sha1-x86_64.asm +++ b/deps/openssl/asm_obsolete/x64-win32-masm/sha/sha1-x86_64.asm @@ -1283,9 +1283,9 @@ DB 102,15,56,0,251 ALIGN 16 $L$oop_shaext:: dec rdx - lea rax,QWORD PTR[64+rsi] + lea r8,QWORD PTR[64+rsi] paddd xmm1,xmm4 - cmovne rsi,rax + cmovne rsi,r8 movdqa xmm8,xmm0 DB 15,56,201,229 movdqa xmm2,xmm0 diff --git a/deps/openssl/asm_obsolete/x86-elf-gas/bn/x86-mont.s b/deps/openssl/asm_obsolete/x86-elf-gas/bn/x86-mont.s index 2f7211d92e230b..b683577231ad00 100644 --- a/deps/openssl/asm_obsolete/x86-elf-gas/bn/x86-mont.s +++ b/deps/openssl/asm_obsolete/x86-elf-gas/bn/x86-mont.s @@ -15,44 +15,51 @@ bn_mul_mont: jl .L000just_leave leal 20(%esp),%esi leal 24(%esp),%edx - movl %esp,%ebp addl $2,%edi negl %edi - leal -32(%esp,%edi,4),%esp + leal -32(%esp,%edi,4),%ebp negl %edi - movl %esp,%eax + movl %ebp,%eax subl %edx,%eax andl $2047,%eax - subl %eax,%esp - xorl %esp,%edx + subl %eax,%ebp + xorl %ebp,%edx andl $2048,%edx xorl $2048,%edx - subl %edx,%esp - andl $-64,%esp - movl %ebp,%eax - subl %esp,%eax + subl %edx,%ebp + andl $-64,%ebp + movl %esp,%eax + subl %ebp,%eax andl $-4096,%eax + movl %esp,%edx + leal (%ebp,%eax,1),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja .L001page_walk + jmp .L002page_walk_done +.align 16 .L001page_walk: - movl (%esp,%eax,1),%edx - subl $4096,%eax -.byte 46 - jnc .L001page_walk + leal -4096(%esp),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja .L001page_walk +.L002page_walk_done: movl (%esi),%eax movl 4(%esi),%ebx movl 8(%esi),%ecx - movl 12(%esi),%edx + movl 12(%esi),%ebp movl 16(%esi),%esi movl (%esi),%esi movl %eax,4(%esp) movl %ebx,8(%esp) movl %ecx,12(%esp) - movl %edx,16(%esp) + movl %ebp,16(%esp) movl %esi,20(%esp) leal -3(%edi),%ebx - movl %ebp,24(%esp) + movl %edx,24(%esp) leal OPENSSL_ia32cap_P,%eax btl $26,(%eax) - jnc .L002non_sse2 + jnc .L003non_sse2 movl $-1,%eax movd %eax,%mm7 movl 8(%esp),%esi @@ -76,7 +83,7 @@ bn_mul_mont: psrlq $32,%mm3 incl %ecx .align 16 -.L0031st: +.L0041st: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -91,7 +98,7 @@ bn_mul_mont: psrlq $32,%mm3 leal 1(%ecx),%ecx cmpl %ebx,%ecx - jl .L0031st + jl .L0041st pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -105,7 +112,7 @@ bn_mul_mont: paddq %mm2,%mm3 movq %mm3,32(%esp,%ebx,4) incl %edx -.L004outer: +.L005outer: xorl %ecx,%ecx movd (%edi,%edx,4),%mm4 movd (%esi),%mm5 @@ -127,7 +134,7 @@ bn_mul_mont: paddq %mm6,%mm2 incl %ecx decl %ebx -.L005inner: +.L006inner: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -144,7 +151,7 @@ bn_mul_mont: paddq %mm6,%mm2 decl %ebx leal 1(%ecx),%ecx - jnz .L005inner + jnz .L006inner movl %ecx,%ebx pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 @@ -162,11 +169,11 @@ bn_mul_mont: movq %mm3,32(%esp,%ebx,4) leal 1(%edx),%edx cmpl %ebx,%edx - jle .L004outer + jle .L005outer emms - jmp .L006common_tail + jmp .L007common_tail .align 16 -.L002non_sse2: +.L003non_sse2: movl 8(%esp),%esi leal 1(%ebx),%ebp movl 12(%esp),%edi @@ -177,12 +184,12 @@ bn_mul_mont: leal 4(%edi,%ebx,4),%eax orl %edx,%ebp movl (%edi),%edi - jz .L007bn_sqr_mont + jz .L008bn_sqr_mont movl %eax,28(%esp) movl (%esi),%eax xorl %edx,%edx .align 16 -.L008mull: +.L009mull: movl %edx,%ebp mull %edi addl %eax,%ebp @@ -191,7 +198,7 @@ bn_mul_mont: movl (%esi,%ecx,4),%eax cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl .L008mull + jl .L009mull movl %edx,%ebp mull %edi movl 20(%esp),%edi @@ -209,9 +216,9 @@ bn_mul_mont: movl 4(%esi),%eax adcl $0,%edx incl %ecx - jmp .L0092ndmadd + jmp .L0102ndmadd .align 16 -.L0101stmadd: +.L0111stmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -222,7 +229,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl .L0101stmadd + jl .L0111stmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%eax @@ -245,7 +252,7 @@ bn_mul_mont: adcl $0,%edx movl $1,%ecx .align 16 -.L0092ndmadd: +.L0102ndmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -256,7 +263,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl .L0092ndmadd + jl .L0102ndmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -272,16 +279,16 @@ bn_mul_mont: movl %edx,32(%esp,%ebx,4) cmpl 28(%esp),%ecx movl %eax,36(%esp,%ebx,4) - je .L006common_tail + je .L007common_tail movl (%ecx),%edi movl 8(%esp),%esi movl %ecx,12(%esp) xorl %ecx,%ecx xorl %edx,%edx movl (%esi),%eax - jmp .L0101stmadd + jmp .L0111stmadd .align 16 -.L007bn_sqr_mont: +.L008bn_sqr_mont: movl %ebx,(%esp) movl %ecx,12(%esp) movl %edi,%eax @@ -292,7 +299,7 @@ bn_mul_mont: andl $1,%ebx incl %ecx .align 16 -.L011sqr: +.L012sqr: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -304,7 +311,7 @@ bn_mul_mont: cmpl (%esp),%ecx movl %eax,%ebx movl %ebp,28(%esp,%ecx,4) - jl .L011sqr + jl .L012sqr movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -328,7 +335,7 @@ bn_mul_mont: movl 4(%esi),%eax movl $1,%ecx .align 16 -.L0123rdmadd: +.L0133rdmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -347,7 +354,7 @@ bn_mul_mont: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl .L0123rdmadd + jl .L0133rdmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -363,7 +370,7 @@ bn_mul_mont: movl %edx,32(%esp,%ebx,4) cmpl %ebx,%ecx movl %eax,36(%esp,%ebx,4) - je .L006common_tail + je .L007common_tail movl 4(%esi,%ecx,4),%edi leal 1(%ecx),%ecx movl %edi,%eax @@ -375,12 +382,12 @@ bn_mul_mont: xorl %ebp,%ebp cmpl %ebx,%ecx leal 1(%ecx),%ecx - je .L013sqrlast + je .L014sqrlast movl %edx,%ebx shrl $1,%edx andl $1,%ebx .align 16 -.L014sqradd: +.L015sqradd: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -396,13 +403,13 @@ bn_mul_mont: cmpl (%esp),%ecx movl %ebp,28(%esp,%ecx,4) movl %eax,%ebx - jle .L014sqradd + jle .L015sqradd movl %edx,%ebp addl %edx,%edx shrl $31,%ebp addl %ebx,%edx adcl $0,%ebp -.L013sqrlast: +.L014sqrlast: movl 20(%esp),%edi movl 16(%esp),%esi imull 32(%esp),%edi @@ -417,9 +424,9 @@ bn_mul_mont: adcl $0,%edx movl $1,%ecx movl 4(%esi),%eax - jmp .L0123rdmadd + jmp .L0133rdmadd .align 16 -.L006common_tail: +.L007common_tail: movl 16(%esp),%ebp movl 4(%esp),%edi leal 32(%esp),%esi @@ -427,13 +434,13 @@ bn_mul_mont: movl %ebx,%ecx xorl %edx,%edx .align 16 -.L015sub: +.L016sub: sbbl (%ebp,%edx,4),%eax movl %eax,(%edi,%edx,4) decl %ecx movl 4(%esi,%edx,4),%eax leal 1(%edx),%edx - jge .L015sub + jge .L016sub sbbl $0,%eax andl %eax,%esi notl %eax @@ -441,12 +448,12 @@ bn_mul_mont: andl %eax,%ebp orl %ebp,%esi .align 16 -.L016copy: +.L017copy: movl (%esi,%ebx,4),%eax movl %eax,(%edi,%ebx,4) movl %ecx,32(%esp,%ebx,4) decl %ebx - jge .L016copy + jge .L017copy movl 24(%esp),%esp movl $1,%eax .L000just_leave: diff --git a/deps/openssl/asm_obsolete/x86-macosx-gas/bn/x86-mont.s b/deps/openssl/asm_obsolete/x86-macosx-gas/bn/x86-mont.s index accec0e5197ccd..7bc58d24e0e624 100644 --- a/deps/openssl/asm_obsolete/x86-macosx-gas/bn/x86-mont.s +++ b/deps/openssl/asm_obsolete/x86-macosx-gas/bn/x86-mont.s @@ -14,47 +14,54 @@ L_bn_mul_mont_begin: jl L000just_leave leal 20(%esp),%esi leal 24(%esp),%edx - movl %esp,%ebp addl $2,%edi negl %edi - leal -32(%esp,%edi,4),%esp + leal -32(%esp,%edi,4),%ebp negl %edi - movl %esp,%eax + movl %ebp,%eax subl %edx,%eax andl $2047,%eax - subl %eax,%esp - xorl %esp,%edx + subl %eax,%ebp + xorl %ebp,%edx andl $2048,%edx xorl $2048,%edx - subl %edx,%esp - andl $-64,%esp - movl %ebp,%eax - subl %esp,%eax + subl %edx,%ebp + andl $-64,%ebp + movl %esp,%eax + subl %ebp,%eax andl $-4096,%eax + movl %esp,%edx + leal (%ebp,%eax,1),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja L001page_walk + jmp L002page_walk_done +.align 4,0x90 L001page_walk: - movl (%esp,%eax,1),%edx - subl $4096,%eax -.byte 46 - jnc L001page_walk + leal -4096(%esp),%esp + movl (%esp),%eax + cmpl %ebp,%esp + ja L001page_walk +L002page_walk_done: movl (%esi),%eax movl 4(%esi),%ebx movl 8(%esi),%ecx - movl 12(%esi),%edx + movl 12(%esi),%ebp movl 16(%esi),%esi movl (%esi),%esi movl %eax,4(%esp) movl %ebx,8(%esp) movl %ecx,12(%esp) - movl %edx,16(%esp) + movl %ebp,16(%esp) movl %esi,20(%esp) leal -3(%edi),%ebx - movl %ebp,24(%esp) - call L002PIC_me_up -L002PIC_me_up: + movl %edx,24(%esp) + call L003PIC_me_up +L003PIC_me_up: popl %eax - movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L002PIC_me_up(%eax),%eax + movl L_OPENSSL_ia32cap_P$non_lazy_ptr-L003PIC_me_up(%eax),%eax btl $26,(%eax) - jnc L003non_sse2 + jnc L004non_sse2 movl $-1,%eax movd %eax,%mm7 movl 8(%esp),%esi @@ -78,7 +85,7 @@ L002PIC_me_up: psrlq $32,%mm3 incl %ecx .align 4,0x90 -L0041st: +L0051st: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -93,7 +100,7 @@ L0041st: psrlq $32,%mm3 leal 1(%ecx),%ecx cmpl %ebx,%ecx - jl L0041st + jl L0051st pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -107,7 +114,7 @@ L0041st: paddq %mm2,%mm3 movq %mm3,32(%esp,%ebx,4) incl %edx -L005outer: +L006outer: xorl %ecx,%ecx movd (%edi,%edx,4),%mm4 movd (%esi),%mm5 @@ -129,7 +136,7 @@ L005outer: paddq %mm6,%mm2 incl %ecx decl %ebx -L006inner: +L007inner: pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 paddq %mm0,%mm2 @@ -146,7 +153,7 @@ L006inner: paddq %mm6,%mm2 decl %ebx leal 1(%ecx),%ecx - jnz L006inner + jnz L007inner movl %ecx,%ebx pmuludq %mm4,%mm0 pmuludq %mm5,%mm1 @@ -164,11 +171,11 @@ L006inner: movq %mm3,32(%esp,%ebx,4) leal 1(%edx),%edx cmpl %ebx,%edx - jle L005outer + jle L006outer emms - jmp L007common_tail + jmp L008common_tail .align 4,0x90 -L003non_sse2: +L004non_sse2: movl 8(%esp),%esi leal 1(%ebx),%ebp movl 12(%esp),%edi @@ -179,12 +186,12 @@ L003non_sse2: leal 4(%edi,%ebx,4),%eax orl %edx,%ebp movl (%edi),%edi - jz L008bn_sqr_mont + jz L009bn_sqr_mont movl %eax,28(%esp) movl (%esi),%eax xorl %edx,%edx .align 4,0x90 -L009mull: +L010mull: movl %edx,%ebp mull %edi addl %eax,%ebp @@ -193,7 +200,7 @@ L009mull: movl (%esi,%ecx,4),%eax cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl L009mull + jl L010mull movl %edx,%ebp mull %edi movl 20(%esp),%edi @@ -211,9 +218,9 @@ L009mull: movl 4(%esi),%eax adcl $0,%edx incl %ecx - jmp L0102ndmadd + jmp L0112ndmadd .align 4,0x90 -L0111stmadd: +L0121stmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -224,7 +231,7 @@ L0111stmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,28(%esp,%ecx,4) - jl L0111stmadd + jl L0121stmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%eax @@ -247,7 +254,7 @@ L0111stmadd: adcl $0,%edx movl $1,%ecx .align 4,0x90 -L0102ndmadd: +L0112ndmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -258,7 +265,7 @@ L0102ndmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl L0102ndmadd + jl L0112ndmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -274,16 +281,16 @@ L0102ndmadd: movl %edx,32(%esp,%ebx,4) cmpl 28(%esp),%ecx movl %eax,36(%esp,%ebx,4) - je L007common_tail + je L008common_tail movl (%ecx),%edi movl 8(%esp),%esi movl %ecx,12(%esp) xorl %ecx,%ecx xorl %edx,%edx movl (%esi),%eax - jmp L0111stmadd + jmp L0121stmadd .align 4,0x90 -L008bn_sqr_mont: +L009bn_sqr_mont: movl %ebx,(%esp) movl %ecx,12(%esp) movl %edi,%eax @@ -294,7 +301,7 @@ L008bn_sqr_mont: andl $1,%ebx incl %ecx .align 4,0x90 -L012sqr: +L013sqr: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -306,7 +313,7 @@ L012sqr: cmpl (%esp),%ecx movl %eax,%ebx movl %ebp,28(%esp,%ecx,4) - jl L012sqr + jl L013sqr movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -330,7 +337,7 @@ L012sqr: movl 4(%esi),%eax movl $1,%ecx .align 4,0x90 -L0133rdmadd: +L0143rdmadd: movl %edx,%ebp mull %edi addl 32(%esp,%ecx,4),%ebp @@ -349,7 +356,7 @@ L0133rdmadd: adcl $0,%edx cmpl %ebx,%ecx movl %ebp,24(%esp,%ecx,4) - jl L0133rdmadd + jl L0143rdmadd movl %edx,%ebp mull %edi addl 32(%esp,%ebx,4),%ebp @@ -365,7 +372,7 @@ L0133rdmadd: movl %edx,32(%esp,%ebx,4) cmpl %ebx,%ecx movl %eax,36(%esp,%ebx,4) - je L007common_tail + je L008common_tail movl 4(%esi,%ecx,4),%edi leal 1(%ecx),%ecx movl %edi,%eax @@ -377,12 +384,12 @@ L0133rdmadd: xorl %ebp,%ebp cmpl %ebx,%ecx leal 1(%ecx),%ecx - je L014sqrlast + je L015sqrlast movl %edx,%ebx shrl $1,%edx andl $1,%ebx .align 4,0x90 -L015sqradd: +L016sqradd: movl (%esi,%ecx,4),%eax movl %edx,%ebp mull %edi @@ -398,13 +405,13 @@ L015sqradd: cmpl (%esp),%ecx movl %ebp,28(%esp,%ecx,4) movl %eax,%ebx - jle L015sqradd + jle L016sqradd movl %edx,%ebp addl %edx,%edx shrl $31,%ebp addl %ebx,%edx adcl $0,%ebp -L014sqrlast: +L015sqrlast: movl 20(%esp),%edi movl 16(%esp),%esi imull 32(%esp),%edi @@ -419,9 +426,9 @@ L014sqrlast: adcl $0,%edx movl $1,%ecx movl 4(%esi),%eax - jmp L0133rdmadd + jmp L0143rdmadd .align 4,0x90 -L007common_tail: +L008common_tail: movl 16(%esp),%ebp movl 4(%esp),%edi leal 32(%esp),%esi @@ -429,13 +436,13 @@ L007common_tail: movl %ebx,%ecx xorl %edx,%edx .align 4,0x90 -L016sub: +L017sub: sbbl (%ebp,%edx,4),%eax movl %eax,(%edi,%edx,4) decl %ecx movl 4(%esi,%edx,4),%eax leal 1(%edx),%edx - jge L016sub + jge L017sub sbbl $0,%eax andl %eax,%esi notl %eax @@ -443,12 +450,12 @@ L016sub: andl %eax,%ebp orl %ebp,%esi .align 4,0x90 -L017copy: +L018copy: movl (%esi,%ebx,4),%eax movl %eax,(%edi,%ebx,4) movl %ecx,32(%esp,%ebx,4) decl %ebx - jge L017copy + jge L018copy movl 24(%esp),%esp movl $1,%eax L000just_leave: diff --git a/deps/openssl/asm_obsolete/x86-win32-masm/bn/x86-mont.asm b/deps/openssl/asm_obsolete/x86-win32-masm/bn/x86-mont.asm index 4987f6fe9153f5..f026dae738fb4b 100644 --- a/deps/openssl/asm_obsolete/x86-win32-masm/bn/x86-mont.asm +++ b/deps/openssl/asm_obsolete/x86-win32-masm/bn/x86-mont.asm @@ -31,44 +31,51 @@ $L_bn_mul_mont_begin:: jl $L000just_leave lea esi,DWORD PTR 20[esp] lea edx,DWORD PTR 24[esp] - mov ebp,esp add edi,2 neg edi - lea esp,DWORD PTR [edi*4+esp-32] + lea ebp,DWORD PTR [edi*4+esp-32] neg edi - mov eax,esp + mov eax,ebp sub eax,edx and eax,2047 - sub esp,eax - xor edx,esp + sub ebp,eax + xor edx,ebp and edx,2048 xor edx,2048 - sub esp,edx - and esp,-64 - mov eax,ebp - sub eax,esp + sub ebp,edx + and ebp,-64 + mov eax,esp + sub eax,ebp and eax,-4096 + mov edx,esp + lea esp,DWORD PTR [eax*1+ebp] + mov eax,DWORD PTR [esp] + cmp esp,ebp + ja $L001page_walk + jmp $L002page_walk_done +ALIGN 16 $L001page_walk: - mov edx,DWORD PTR [eax*1+esp] - sub eax,4096 -DB 46 - jnc $L001page_walk + lea esp,DWORD PTR [esp-4096] + mov eax,DWORD PTR [esp] + cmp esp,ebp + ja $L001page_walk +$L002page_walk_done: mov eax,DWORD PTR [esi] mov ebx,DWORD PTR 4[esi] mov ecx,DWORD PTR 8[esi] - mov edx,DWORD PTR 12[esi] + mov ebp,DWORD PTR 12[esi] mov esi,DWORD PTR 16[esi] mov esi,DWORD PTR [esi] mov DWORD PTR 4[esp],eax mov DWORD PTR 8[esp],ebx mov DWORD PTR 12[esp],ecx - mov DWORD PTR 16[esp],edx + mov DWORD PTR 16[esp],ebp mov DWORD PTR 20[esp],esi lea ebx,DWORD PTR [edi-3] - mov DWORD PTR 24[esp],ebp + mov DWORD PTR 24[esp],edx lea eax,DWORD PTR _OPENSSL_ia32cap_P bt DWORD PTR [eax],26 - jnc $L002non_sse2 + jnc $L003non_sse2 mov eax,-1 movd mm7,eax mov esi,DWORD PTR 8[esp] @@ -92,7 +99,7 @@ DB 46 psrlq mm3,32 inc ecx ALIGN 16 -$L0031st: +$L0041st: pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -107,7 +114,7 @@ $L0031st: psrlq mm3,32 lea ecx,DWORD PTR 1[ecx] cmp ecx,ebx - jl $L0031st + jl $L0041st pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -121,7 +128,7 @@ $L0031st: paddq mm3,mm2 movq QWORD PTR 32[ebx*4+esp],mm3 inc edx -$L004outer: +$L005outer: xor ecx,ecx movd mm4,DWORD PTR [edx*4+edi] movd mm5,DWORD PTR [esi] @@ -143,7 +150,7 @@ $L004outer: paddq mm2,mm6 inc ecx dec ebx -$L005inner: +$L006inner: pmuludq mm0,mm4 pmuludq mm1,mm5 paddq mm2,mm0 @@ -160,7 +167,7 @@ $L005inner: paddq mm2,mm6 dec ebx lea ecx,DWORD PTR 1[ecx] - jnz $L005inner + jnz $L006inner mov ebx,ecx pmuludq mm0,mm4 pmuludq mm1,mm5 @@ -178,11 +185,11 @@ $L005inner: movq QWORD PTR 32[ebx*4+esp],mm3 lea edx,DWORD PTR 1[edx] cmp edx,ebx - jle $L004outer + jle $L005outer emms - jmp $L006common_tail + jmp $L007common_tail ALIGN 16 -$L002non_sse2: +$L003non_sse2: mov esi,DWORD PTR 8[esp] lea ebp,DWORD PTR 1[ebx] mov edi,DWORD PTR 12[esp] @@ -193,12 +200,12 @@ $L002non_sse2: lea eax,DWORD PTR 4[ebx*4+edi] or ebp,edx mov edi,DWORD PTR [edi] - jz $L007bn_sqr_mont + jz $L008bn_sqr_mont mov DWORD PTR 28[esp],eax mov eax,DWORD PTR [esi] xor edx,edx ALIGN 16 -$L008mull: +$L009mull: mov ebp,edx mul edi add ebp,eax @@ -207,7 +214,7 @@ $L008mull: mov eax,DWORD PTR [ecx*4+esi] cmp ecx,ebx mov DWORD PTR 28[ecx*4+esp],ebp - jl $L008mull + jl $L009mull mov ebp,edx mul edi mov edi,DWORD PTR 20[esp] @@ -225,9 +232,9 @@ $L008mull: mov eax,DWORD PTR 4[esi] adc edx,0 inc ecx - jmp $L0092ndmadd + jmp $L0102ndmadd ALIGN 16 -$L0101stmadd: +$L0111stmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -238,7 +245,7 @@ $L0101stmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 28[ecx*4+esp],ebp - jl $L0101stmadd + jl $L0111stmadd mov ebp,edx mul edi add eax,DWORD PTR 32[ebx*4+esp] @@ -261,7 +268,7 @@ $L0101stmadd: adc edx,0 mov ecx,1 ALIGN 16 -$L0092ndmadd: +$L0102ndmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -272,7 +279,7 @@ $L0092ndmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 24[ecx*4+esp],ebp - jl $L0092ndmadd + jl $L0102ndmadd mov ebp,edx mul edi add ebp,DWORD PTR 32[ebx*4+esp] @@ -288,16 +295,16 @@ $L0092ndmadd: mov DWORD PTR 32[ebx*4+esp],edx cmp ecx,DWORD PTR 28[esp] mov DWORD PTR 36[ebx*4+esp],eax - je $L006common_tail + je $L007common_tail mov edi,DWORD PTR [ecx] mov esi,DWORD PTR 8[esp] mov DWORD PTR 12[esp],ecx xor ecx,ecx xor edx,edx mov eax,DWORD PTR [esi] - jmp $L0101stmadd + jmp $L0111stmadd ALIGN 16 -$L007bn_sqr_mont: +$L008bn_sqr_mont: mov DWORD PTR [esp],ebx mov DWORD PTR 12[esp],ecx mov eax,edi @@ -308,7 +315,7 @@ $L007bn_sqr_mont: and ebx,1 inc ecx ALIGN 16 -$L011sqr: +$L012sqr: mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -320,7 +327,7 @@ $L011sqr: cmp ecx,DWORD PTR [esp] mov ebx,eax mov DWORD PTR 28[ecx*4+esp],ebp - jl $L011sqr + jl $L012sqr mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -344,7 +351,7 @@ $L011sqr: mov eax,DWORD PTR 4[esi] mov ecx,1 ALIGN 16 -$L0123rdmadd: +$L0133rdmadd: mov ebp,edx mul edi add ebp,DWORD PTR 32[ecx*4+esp] @@ -363,7 +370,7 @@ $L0123rdmadd: adc edx,0 cmp ecx,ebx mov DWORD PTR 24[ecx*4+esp],ebp - jl $L0123rdmadd + jl $L0133rdmadd mov ebp,edx mul edi add ebp,DWORD PTR 32[ebx*4+esp] @@ -379,7 +386,7 @@ $L0123rdmadd: mov DWORD PTR 32[ebx*4+esp],edx cmp ecx,ebx mov DWORD PTR 36[ebx*4+esp],eax - je $L006common_tail + je $L007common_tail mov edi,DWORD PTR 4[ecx*4+esi] lea ecx,DWORD PTR 1[ecx] mov eax,edi @@ -391,12 +398,12 @@ $L0123rdmadd: xor ebp,ebp cmp ecx,ebx lea ecx,DWORD PTR 1[ecx] - je $L013sqrlast + je $L014sqrlast mov ebx,edx shr edx,1 and ebx,1 ALIGN 16 -$L014sqradd: +$L015sqradd: mov eax,DWORD PTR [ecx*4+esi] mov ebp,edx mul edi @@ -412,13 +419,13 @@ $L014sqradd: cmp ecx,DWORD PTR [esp] mov DWORD PTR 28[ecx*4+esp],ebp mov ebx,eax - jle $L014sqradd + jle $L015sqradd mov ebp,edx add edx,edx shr ebp,31 add edx,ebx adc ebp,0 -$L013sqrlast: +$L014sqrlast: mov edi,DWORD PTR 20[esp] mov esi,DWORD PTR 16[esp] imul edi,DWORD PTR 32[esp] @@ -433,9 +440,9 @@ $L013sqrlast: adc edx,0 mov ecx,1 mov eax,DWORD PTR 4[esi] - jmp $L0123rdmadd + jmp $L0133rdmadd ALIGN 16 -$L006common_tail: +$L007common_tail: mov ebp,DWORD PTR 16[esp] mov edi,DWORD PTR 4[esp] lea esi,DWORD PTR 32[esp] @@ -443,13 +450,13 @@ $L006common_tail: mov ecx,ebx xor edx,edx ALIGN 16 -$L015sub: +$L016sub: sbb eax,DWORD PTR [edx*4+ebp] mov DWORD PTR [edx*4+edi],eax dec ecx mov eax,DWORD PTR 4[edx*4+esi] lea edx,DWORD PTR 1[edx] - jge $L015sub + jge $L016sub sbb eax,0 and esi,eax not eax @@ -457,12 +464,12 @@ $L015sub: and ebp,eax or esi,ebp ALIGN 16 -$L016copy: +$L017copy: mov eax,DWORD PTR [ebx*4+esi] mov DWORD PTR [ebx*4+edi],eax mov DWORD PTR 32[ebx*4+esp],ecx dec ebx - jge $L016copy + jge $L017copy mov esp,DWORD PTR 24[esp] mov eax,1 $L000just_leave: diff --git a/deps/openssl/openssl.gypi b/deps/openssl/openssl.gypi index 3620e45c410746..871cec0c7e4696 100644 --- a/deps/openssl/openssl.gypi +++ b/deps/openssl/openssl.gypi @@ -1263,6 +1263,11 @@ # Microsoft's IIS, which seems to be ignoring whole ClientHello after # seeing this extension. 'OPENSSL_NO_HEARTBEATS', + + # Compile out hardware engines. Most are stubs that dynamically load + # the real driver but that poses a security liability when an attacker + # is able to create a malicious DLL in one of the default search paths. + 'OPENSSL_NO_HW', ], 'openssl_default_defines_win': [ 'MK1MF_BUILD', diff --git a/deps/openssl/openssl/CHANGES b/deps/openssl/openssl/CHANGES index 62658fe3ee6b36..042afe37246c60 100644 --- a/deps/openssl/openssl/CHANGES +++ b/deps/openssl/openssl/CHANGES @@ -2,6 +2,178 @@ OpenSSL CHANGES _______________ + Changes between 1.0.2i and 1.0.2j [26 Sep 2016] + + *) Missing CRL sanity check + + A bug fix which included a CRL sanity check was added to OpenSSL 1.1.0 + but was omitted from OpenSSL 1.0.2i. As a result any attempt to use + CRLs in OpenSSL 1.0.2i will crash with a null pointer exception. + + This issue only affects the OpenSSL 1.0.2i + (CVE-2016-7052) + [Matt Caswell] + + Changes between 1.0.2h and 1.0.2i [22 Sep 2016] + + *) OCSP Status Request extension unbounded memory growth + + A malicious client can send an excessively large OCSP Status Request + extension. If that client continually requests renegotiation, sending a + large OCSP Status Request extension each time, then there will be unbounded + memory growth on the server. This will eventually lead to a Denial Of + Service attack through memory exhaustion. Servers with a default + configuration are vulnerable even if they do not support OCSP. Builds using + the "no-ocsp" build time option are not affected. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6304) + [Matt Caswell] + + *) In order to mitigate the SWEET32 attack, the DES ciphers were moved from + HIGH to MEDIUM. + + This issue was reported to OpenSSL Karthikeyan Bhargavan and Gaetan + Leurent (INRIA) + (CVE-2016-2183) + [Rich Salz] + + *) OOB write in MDC2_Update() + + An overflow can occur in MDC2_Update() either if called directly or + through the EVP_DigestUpdate() function using MDC2. If an attacker + is able to supply very large amounts of input data after a previous + call to EVP_EncryptUpdate() with a partial block then a length check + can overflow resulting in a heap corruption. + + The amount of data needed is comparable to SIZE_MAX which is impractical + on most platforms. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6303) + [Stephen Henson] + + *) Malformed SHA512 ticket DoS + + If a server uses SHA512 for TLS session ticket HMAC it is vulnerable to a + DoS attack where a malformed ticket will result in an OOB read which will + ultimately crash. + + The use of SHA512 in TLS session tickets is comparatively rare as it requires + a custom server callback and ticket lookup mechanism. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6302) + [Stephen Henson] + + *) OOB write in BN_bn2dec() + + The function BN_bn2dec() does not check the return value of BN_div_word(). + This can cause an OOB write if an application uses this function with an + overly large BIGNUM. This could be a problem if an overly large certificate + or CRL is printed out from an untrusted source. TLS is not affected because + record limits will reject an oversized certificate before it is parsed. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-2182) + [Stephen Henson] + + *) OOB read in TS_OBJ_print_bio() + + The function TS_OBJ_print_bio() misuses OBJ_obj2txt(): the return value is + the total length the OID text representation would use and not the amount + of data written. This will result in OOB reads when large OIDs are + presented. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-2180) + [Stephen Henson] + + *) Pointer arithmetic undefined behaviour + + Avoid some undefined pointer arithmetic + + A common idiom in the codebase is to check limits in the following manner: + "p + len > limit" + + Where "p" points to some malloc'd data of SIZE bytes and + limit == p + SIZE + + "len" here could be from some externally supplied data (e.g. from a TLS + message). + + The rules of C pointer arithmetic are such that "p + len" is only well + defined where len <= SIZE. Therefore the above idiom is actually + undefined behaviour. + + For example this could cause problems if some malloc implementation + provides an address for "p" such that "p + len" actually overflows for + values of len that are too big and therefore p + len < limit. + + This issue was reported to OpenSSL by Guido Vranken + (CVE-2016-2177) + [Matt Caswell] + + *) Constant time flag not preserved in DSA signing + + Operations in the DSA signing algorithm should run in constant time in + order to avoid side channel attacks. A flaw in the OpenSSL DSA + implementation means that a non-constant time codepath is followed for + certain operations. This has been demonstrated through a cache-timing + attack to be sufficient for an attacker to recover the private DSA key. + + This issue was reported by César Pereida (Aalto University), Billy Brumley + (Tampere University of Technology), and Yuval Yarom (The University of + Adelaide and NICTA). + (CVE-2016-2178) + [César Pereida] + + *) DTLS buffered message DoS + + In a DTLS connection where handshake messages are delivered out-of-order + those messages that OpenSSL is not yet ready to process will be buffered + for later use. Under certain circumstances, a flaw in the logic means that + those messages do not get removed from the buffer even though the handshake + has been completed. An attacker could force up to approx. 15 messages to + remain in the buffer when they are no longer required. These messages will + be cleared when the DTLS connection is closed. The default maximum size for + a message is 100k. Therefore the attacker could force an additional 1500k + to be consumed per connection. By opening many simulataneous connections an + attacker could cause a DoS attack through memory exhaustion. + + This issue was reported to OpenSSL by Quan Luo. + (CVE-2016-2179) + [Matt Caswell] + + *) DTLS replay protection DoS + + A flaw in the DTLS replay attack protection mechanism means that records + that arrive for future epochs update the replay protection "window" before + the MAC for the record has been validated. This could be exploited by an + attacker by sending a record for the next epoch (which does not have to + decrypt or have a valid MAC), with a very large sequence number. This means + that all subsequent legitimate packets are dropped causing a denial of + service for a specific DTLS connection. + + This issue was reported to OpenSSL by the OCAP audit team. + (CVE-2016-2181) + [Matt Caswell] + + *) Certificate message OOB reads + + In OpenSSL 1.0.2 and earlier some missing message length checks can result + in OOB reads of up to 2 bytes beyond an allocated buffer. There is a + theoretical DoS risk but this has not been observed in practice on common + platforms. + + The messages affected are client certificate, client certificate request + and server certificate. As a result the attack can only be performed + against a client or a server which enables client authentication. + + This issue was reported to OpenSSL by Shi Lei (Gear Team, Qihoo 360 Inc.) + (CVE-2016-6306) + [Stephen Henson] + Changes between 1.0.2g and 1.0.2h [3 May 2016] *) Prevent padding oracle in AES-NI CBC MAC check @@ -8669,7 +8841,7 @@ des-cbc 3624.96k 5258.21k 5530.91k 5624.30k 5628.26k *) Source code cleanups: use const where appropriate, eliminate casts, use void * instead of char * in lhash. - [Ulf Möller] + [Ulf Möller] *) Bugfix: ssl3_send_server_key_exchange was not restartable (the state was not changed to SSL3_ST_SW_KEY_EXCH_B, and because of diff --git a/deps/openssl/openssl/CONTRIBUTING b/deps/openssl/openssl/CONTRIBUTING index 9d63d8abb67252..07115e5a758869 100644 --- a/deps/openssl/openssl/CONTRIBUTING +++ b/deps/openssl/openssl/CONTRIBUTING @@ -1,38 +1,75 @@ -HOW TO CONTRIBUTE TO OpenSSL ----------------------------- +HOW TO CONTRIBUTE TO PATCHES OpenSSL +------------------------------------ -Development is coordinated on the openssl-dev mailing list (see -http://www.openssl.org for information on subscribing). If you -would like to submit a patch, send it to rt@openssl.org with -the string "[PATCH]" in the subject. Please be sure to include a -textual explanation of what your patch does. - -You can also make GitHub pull requests. If you do this, please also send -mail to rt@openssl.org with a brief description and a link to the PR so -that we can more easily keep track of it. +(Please visit https://www.openssl.org/community/getting-started.html for +other ideas about how to contribute.) +Development is coordinated on the openssl-dev mailing list (see the +above link or https://mta.openssl.org for information on subscribing). If you are unsure as to whether a feature will be useful for the general -OpenSSL community please discuss it on the openssl-dev mailing list first. -Someone may be already working on the same thing or there may be a good -reason as to why that feature isn't implemented. +OpenSSL community you might want to discuss it on the openssl-dev mailing +list first. Someone may be already working on the same thing or there +may be a good reason as to why that feature isn't implemented. -Patches should be as up to date as possible, preferably relative to the -current Git or the last snapshot. They should follow our coding style -(see https://www.openssl.org/policies/codingstyle.html) and compile without -warnings using the --strict-warnings flag. OpenSSL compiles on many varied -platforms: try to ensure you only use portable features. +The best way to submit a patch is to make a pull request on GitHub. +(It is not necessary to send mail to rt@openssl.org to open a ticket!) +If you think the patch could use feedback from the community, please +start a thread on openssl-dev. -Our preferred format for patch files is "git format-patch" output. For example -to provide a patch file containing the last commit in your local git repository -use the following command: +You can also submit patches by sending it as mail to rt@openssl.org. +Please include the word "PATCH" and an explanation of what the patch +does in the subject line. If you do this, our preferred format is "git +format-patch" output. For example to provide a patch file containing the +last commit in your local git repository use the following command: -# git format-patch --stdout HEAD^ >mydiffs.patch + % git format-patch --stdout HEAD^ >mydiffs.patch Another method of creating an acceptable patch file without using git is as follows: -# cd openssl-work -# [your changes] -# ./Configure dist; make clean -# cd .. -# diff -ur openssl-orig openssl-work > mydiffs.patch + % cd openssl-work + ...make your changes... + % ./Configure dist; make clean + % cd .. + % diff -ur openssl-orig openssl-work >mydiffs.patch + +Note that pull requests are generally easier for the team, and community, to +work with. Pull requests benefit from all of the standard GitHub features, +including code review tools, simpler integration, and CI build support. + +No matter how a patch is submitted, the following items will help make +the acceptance and review process faster: + + 1. Anything other than trivial contributions will require a contributor + licensing agreement, giving us permission to use your code. See + https://www.openssl.org/policies/cla.html for details. + + 2. All source files should start with the following text (with + appropriate comment characters at the start of each line and the + year(s) updated): + + Copyright 20xx-20yy The OpenSSL Project Authors. All Rights Reserved. + + Licensed under the OpenSSL license (the "License"). You may not use + this file except in compliance with the License. You can obtain a copy + in the file LICENSE in the source distribution or at + https://www.openssl.org/source/license.html + + 3. Patches should be as current as possible. When using GitHub, please + expect to have to rebase and update often. Note that we do not accept merge + commits. You will be asked to remove them before a patch is considered + acceptable. + + 4. Patches should follow our coding style (see + https://www.openssl.org/policies/codingstyle.html) and compile without + warnings. Where gcc or clang is availble you should use the + --strict-warnings Configure option. OpenSSL compiles on many varied + platforms: try to ensure you only use portable features. + + 5. When at all possible, patches should include tests. These can either be + added to an existing test, or completely new. Please see test/README + for information on the test framework. + + 6. New features or changed functionality must include documentation. Please + look at the "pod" files in doc/apps, doc/crypto and doc/ssl for examples of + our style. diff --git a/deps/openssl/openssl/Configure b/deps/openssl/openssl/Configure index c98107a487188f..c39f71a17910ea 100755 --- a/deps/openssl/openssl/Configure +++ b/deps/openssl/openssl/Configure @@ -799,7 +799,7 @@ my @experimental = (); # This is what $depflags will look like with the above defaults # (we need this to see if we should advise the user to run "make depend"): -my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST"; +my $default_depflags = " -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS"; # Explicit "no-..." options will be collected in %disabled along with the defaults. # To remove something from %disabled, use "enable-foo" (unless it's experimental). @@ -1082,11 +1082,6 @@ if (defined($disabled{"md5"}) || defined($disabled{"sha"}) $disabled{"tls1"} = "forced"; } -if (defined($disabled{"tls1"})) - { - $disabled{"tlsext"} = "forced"; - } - if (defined($disabled{"ec"}) || defined($disabled{"dsa"}) || defined($disabled{"dh"})) { @@ -1254,6 +1249,7 @@ my $shared_extension = $fields[$idx_shared_extension]; my $ranlib = $ENV{'RANLIB'} || $fields[$idx_ranlib]; my $ar = $ENV{'AR'} || "ar"; my $arflags = $fields[$idx_arflags]; +my $windres = $ENV{'RC'} || $ENV{'WINDRES'} || "windres"; my $multilib = $fields[$idx_multilib]; # if $prefix/lib$multilib is not an existing directory, then @@ -1562,8 +1558,15 @@ $cpuid_obj="mem_clr.o" unless ($cpuid_obj =~ /\.o$/); $des_obj=$des_enc unless ($des_obj =~ /\.o$/); $bf_obj=$bf_enc unless ($bf_obj =~ /\.o$/); $cast_obj=$cast_enc unless ($cast_obj =~ /\.o$/); -$rc4_obj=$rc4_enc unless ($rc4_obj =~ /\.o$/); $rc5_obj=$rc5_enc unless ($rc5_obj =~ /\.o$/); +if ($rc4_obj =~ /\.o$/) + { + $cflags.=" -DRC4_ASM"; + } +else + { + $rc4_obj=$rc4_enc; + } if ($sha1_obj =~ /\.o$/) { # $sha1_obj=$sha1_enc; @@ -1717,12 +1720,14 @@ while () s/^AR=\s*/AR= \$\(CROSS_COMPILE\)/; s/^NM=\s*/NM= \$\(CROSS_COMPILE\)/; s/^RANLIB=\s*/RANLIB= \$\(CROSS_COMPILE\)/; + s/^RC=\s*/RC= \$\(CROSS_COMPILE\)/; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= \$\(CROSS_COMPILE\)$cc/ if $cc eq "gcc"; } else { s/^CC=.*$/CC= $cc/; s/^AR=\s*ar/AR= $ar/; s/^RANLIB=.*/RANLIB= $ranlib/; + s/^RC=.*/RC= $windres/; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $cc eq "gcc"; s/^MAKEDEPPROG=.*$/MAKEDEPPROG= $cc/ if $ecc eq "gcc" || $ecc eq "clang"; } diff --git a/deps/openssl/openssl/INSTALL.W32 b/deps/openssl/openssl/INSTALL.W32 index 80e538273e996b..bd10187c32244f 100644 --- a/deps/openssl/openssl/INSTALL.W32 +++ b/deps/openssl/openssl/INSTALL.W32 @@ -300,17 +300,17 @@ If you link with static OpenSSL libraries [those built with ms/nt.mak], then you're expected to additionally link your application with - WS2_32.LIB, ADVAPI32.LIB, GDI32.LIB and USER32.LIB. Those developing - non-interactive service applications might feel concerned about linking - with the latter two, as they are justly associated with interactive - desktop, which is not available to service processes. The toolkit is - designed to detect in which context it's currently executed, GUI, - console app or service, and act accordingly, namely whether or not to - actually make GUI calls. Additionally those who wish to - /DELAYLOAD:GDI32.DLL and /DELAYLOAD:USER32.DLL and actually keep them - off service process should consider implementing and exporting from - .exe image in question own _OPENSSL_isservice not relying on USER32.DLL. - E.g., on Windows Vista and later you could: + WS2_32.LIB, GDI32.LIB, ADVAPI32.LIB, CRYPT32.LIB and USER32.LIB. Those + developing non-interactive service applications might feel concerned about + linking with GDI32.LIB and USER32.LIB, as they are justly associated with + interactive desktop, which is not available to service processes. The toolkit + is designed to detect in which context it's currently executed, GUI, console + app or service, and act accordingly, namely whether or not to actually make + GUI calls. Additionally those who wish to /DELAYLOAD:GDI32.DLL and + /DELAYLOAD:USER32.DLL and actually keep them off service process should + consider implementing and exporting from .exe image in question own + _OPENSSL_isservice not relying on USER32.DLL. E.g., on Windows Vista and + later you could: __declspec(dllexport) __cdecl BOOL _OPENSSL_isservice(void) { DWORD sess; diff --git a/deps/openssl/openssl/Makefile b/deps/openssl/openssl/Makefile index 26325cc0d814de..04bfb11a170108 100644 --- a/deps/openssl/openssl/Makefile +++ b/deps/openssl/openssl/Makefile @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2h +VERSION=1.0.2j MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -62,12 +62,13 @@ OPENSSLDIR=/usr/local/ssl CC= cc CFLAG= -O DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS -PEX_LIBS= -EX_LIBS= -EXE_EXT= -ARFLAGS= +PEX_LIBS= +EX_LIBS= +EXE_EXT= +ARFLAGS= AR= ar $(ARFLAGS) r RANLIB= /usr/bin/ranlib +RC= windres NM= nm PERL= /usr/bin/perl TAR= tar @@ -85,26 +86,26 @@ ASFLAG=$(CFLAG) # For x86 assembler: Set PROCESSOR to 386 if you want to support # the 80386. -PROCESSOR= +PROCESSOR= # CPUID module collects small commonly used assembler snippets CPUID_OBJ= mem_clr.o BN_ASM= bn_asm.o -EC_ASM= +EC_ASM= DES_ENC= des_enc.o fcrypt_b.o AES_ENC= aes_core.o aes_cbc.o BF_ENC= bf_enc.o CAST_ENC= c_enc.o RC4_ENC= rc4_enc.o rc4_skey.o RC5_ENC= rc5_enc.o -MD5_ASM_OBJ= -SHA1_ASM_OBJ= -RMD160_ASM_OBJ= +MD5_ASM_OBJ= +SHA1_ASM_OBJ= +RMD160_ASM_OBJ= WP_ASM_OBJ= wp_block.o CMLL_ENC= camellia.o cmll_misc.o cmll_cbc.o -MODES_ASM_OBJ= -ENGINES_ASM_OBJ= -PERLASM_SCHEME= +MODES_ASM_OBJ= +ENGINES_ASM_OBJ= +PERLASM_SCHEME= # KRB5 stuff KRB5_INCLUDES= @@ -210,6 +211,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ + RC='$(RC)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ @@ -368,6 +370,7 @@ libcrypto.pc: Makefile echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ + echo 'enginesdir=$${libdir}/engines'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ @@ -525,7 +528,7 @@ tar-snap: $(TARFILE).list rm -f $(TARFILE).list ls -l $(TARFILE) -dist: +dist: $(PERL) Configure dist @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -582,9 +585,9 @@ install_sw: *ssl*) i=ssleay32.dll;; \ esac; \ echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ + cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ + chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ fi; \ fi; \ done; \ diff --git a/deps/openssl/openssl/Makefile.bak b/deps/openssl/openssl/Makefile.bak index 507740dde49363..7b97fb0dc1989b 100644 --- a/deps/openssl/openssl/Makefile.bak +++ b/deps/openssl/openssl/Makefile.bak @@ -4,7 +4,7 @@ ## Makefile for OpenSSL ## -VERSION=1.0.2h +VERSION=1.0.2j MAJOR=1 MINOR=0.2 SHLIB_VERSION_NUMBER=1.0.0 @@ -60,14 +60,15 @@ OPENSSLDIR=/usr/local/ssl # PKCS1_CHECK - pkcs1 tests. CC= gcc -CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM +CFLAG= -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -Wa,--noexecstack -m64 -DL_ENDIAN -O3 -Wall -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM DEPFLAG= -DOPENSSL_NO_EC_NISTP_64_GCC_128 -DOPENSSL_NO_GMP -DOPENSSL_NO_JPAKE -DOPENSSL_NO_LIBUNBOUND -DOPENSSL_NO_MD2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SCTP -DOPENSSL_NO_SSL_TRACE -DOPENSSL_NO_SSL2 -DOPENSSL_NO_STORE -DOPENSSL_NO_UNIT_TEST -DOPENSSL_NO_WEAK_SSL_CIPHERS -PEX_LIBS= +PEX_LIBS= EX_LIBS= -ldl -EXE_EXT= -ARFLAGS= +EXE_EXT= +ARFLAGS= AR= ar $(ARFLAGS) r RANLIB= /usr/bin/ranlib +RC= windres NM= nm PERL= /usr/bin/perl TAR= tar @@ -85,7 +86,7 @@ ASFLAG=$(CFLAG) # For x86 assembler: Set PROCESSOR to 386 if you want to support # the 80386. -PROCESSOR= +PROCESSOR= # CPUID module collects small commonly used assembler snippets CPUID_OBJ= x86_64cpuid.o @@ -99,11 +100,11 @@ RC4_ENC= rc4-x86_64.o rc4-md5-x86_64.o RC5_ENC= rc5_enc.o MD5_ASM_OBJ= md5-x86_64.o SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o -RMD160_ASM_OBJ= +RMD160_ASM_OBJ= WP_ASM_OBJ= wp-x86_64.o CMLL_ENC= cmll-x86_64.o cmll_misc.o MODES_ASM_OBJ= ghash-x86_64.o aesni-gcm-x86_64.o -ENGINES_ASM_OBJ= +ENGINES_ASM_OBJ= PERLASM_SCHEME= elf # KRB5 stuff @@ -210,6 +211,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ + RC='$(RC)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ @@ -368,6 +370,7 @@ libcrypto.pc: Makefile echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ + echo 'enginesdir=$${libdir}/engines'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ @@ -525,7 +528,7 @@ tar-snap: $(TARFILE).list rm -f $(TARFILE).list ls -l $(TARFILE) -dist: +dist: $(PERL) Configure dist @$(MAKE) SDIRS='$(SDIRS)' clean @$(MAKE) TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' $(DISTTARVARS) tar @@ -582,9 +585,9 @@ install_sw: *ssl*) i=ssleay32.dll;; \ esac; \ echo installing $$i; \ - cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ - mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ + cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ + chmod 755 $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new; \ + mv -f $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i.new $(INSTALL_PREFIX)$(INSTALLTOP)/bin/$$i ); \ fi; \ fi; \ done; \ diff --git a/deps/openssl/openssl/Makefile.org b/deps/openssl/openssl/Makefile.org index 76fdbdf6ac5c2a..2377f5029187fd 100644 --- a/deps/openssl/openssl/Makefile.org +++ b/deps/openssl/openssl/Makefile.org @@ -66,6 +66,7 @@ EXE_EXT= ARFLAGS= AR=ar $(ARFLAGS) r RANLIB= ranlib +RC= windres NM= nm PERL= perl TAR= tar @@ -208,6 +209,7 @@ BUILDENV= LC_ALL=C PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)'\ CC='$(CC)' CFLAG='$(CFLAG)' \ AS='$(CC)' ASFLAG='$(CFLAG) -c' \ AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \ + RC='$(RC)' \ CROSS_COMPILE='$(CROSS_COMPILE)' \ PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \ SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \ @@ -366,6 +368,7 @@ libcrypto.pc: Makefile echo 'exec_prefix=$${prefix}'; \ echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \ echo 'includedir=$${prefix}/include'; \ + echo 'enginesdir=$${libdir}/engines'; \ echo ''; \ echo 'Name: OpenSSL-libcrypto'; \ echo 'Description: OpenSSL cryptography library'; \ diff --git a/deps/openssl/openssl/Makefile.shared b/deps/openssl/openssl/Makefile.shared index a2aa9804c1d98d..e8d222ac6a0067 100644 --- a/deps/openssl/openssl/Makefile.shared +++ b/deps/openssl/openssl/Makefile.shared @@ -293,7 +293,7 @@ link_a.cygwin: fi; \ dll_name=$$SHLIB$$SHLIB_SOVER$$SHLIB_SUFFIX; \ $(PERL) util/mkrc.pl $$dll_name | \ - $(CROSS_COMPILE)windres -o rc.o; \ + $(RC) -o rc.o; \ extras="$$extras rc.o"; \ ALLSYMSFLAGS='-Wl,--whole-archive'; \ NOALLSYMSFLAGS='-Wl,--no-whole-archive'; \ diff --git a/deps/openssl/openssl/NEWS b/deps/openssl/openssl/NEWS index 6c85116fc87d29..c0579632b2ebdc 100644 --- a/deps/openssl/openssl/NEWS +++ b/deps/openssl/openssl/NEWS @@ -5,6 +5,24 @@ This file gives a brief overview of the major changes between each OpenSSL release. For more details please read the CHANGES file. + Major changes between OpenSSL 1.0.2i and OpenSSL 1.0.2j [26 Sep 2016] + + o Fix Use After Free for large message sizes (CVE-2016-6309) + + Major changes between OpenSSL 1.0.2h and OpenSSL 1.0.2i [22 Sep 2016] + + o OCSP Status Request extension unbounded memory growth (CVE-2016-6304) + o SWEET32 Mitigation (CVE-2016-2183) + o OOB write in MDC2_Update() (CVE-2016-6303) + o Malformed SHA512 ticket DoS (CVE-2016-6302) + o OOB write in BN_bn2dec() (CVE-2016-2182) + o OOB read in TS_OBJ_print_bio() (CVE-2016-2180) + o Pointer arithmetic undefined behaviour (CVE-2016-2177) + o Constant time flag not preserved in DSA signing (CVE-2016-2178) + o DTLS buffered message DoS (CVE-2016-2179) + o DTLS replay protection DoS (CVE-2016-2181) + o Certificate message OOB reads (CVE-2016-6306) + Major changes between OpenSSL 1.0.2g and OpenSSL 1.0.2h [3 May 2016] o Prevent padding oracle in AES-NI CBC MAC check (CVE-2016-2107) diff --git a/deps/openssl/openssl/README b/deps/openssl/openssl/README index b880eec2d4793b..6dedfc019738c0 100644 --- a/deps/openssl/openssl/README +++ b/deps/openssl/openssl/README @@ -1,5 +1,5 @@ - OpenSSL 1.0.2h 3 May 2016 + OpenSSL 1.0.2j 26 Sep 2016 Copyright (c) 1998-2015 The OpenSSL Project Copyright (c) 1995-1998 Eric A. Young, Tim J. Hudson diff --git a/deps/openssl/openssl/apps/CA.pl b/deps/openssl/openssl/apps/CA.pl index 6bf9311a31af2e..43c20b201c79c4 100644 --- a/deps/openssl/openssl/apps/CA.pl +++ b/deps/openssl/openssl/apps/CA.pl @@ -5,10 +5,10 @@ # things easier between now and when Eric is convinced to fix it :-) # # CA -newca ... will setup the right stuff -# CA -newreq[-nodes] ... will generate a certificate request -# CA -sign ... will sign the generated request and output +# CA -newreq[-nodes] ... will generate a certificate request +# CA -sign ... will sign the generated request and output # -# At the end of that grab newreq.pem and newcert.pem (one has the key +# At the end of that grab newreq.pem and newcert.pem (one has the key # and the other the certificate) and cat them together and that is what # you want/need ... I'll make even this a little cleaner later. # @@ -64,7 +64,7 @@ foreach (@ARGV) { if ( /^(-\?|-h|-help)$/ ) { - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n"; exit 0; } elsif (/^-newcert$/) { # create a certificate @@ -83,7 +83,7 @@ print "Request is in newreq.pem, private key is in newkey.pem\n"; } elsif (/^-newca$/) { # if explicitly asked for or it doesn't exist then setup the - # directory structure that Eric likes to manage things + # directory structure that Eric likes to manage things $NEW="1"; if ( "$NEW" || ! -f "${CATOP}/serial" ) { # create the directory hierarchy @@ -114,7 +114,7 @@ system ("$REQ -new -keyout " . "${CATOP}/private/$CAKEY -out ${CATOP}/$CAREQ"); system ("$CA -create_serial " . - "-out ${CATOP}/$CACERT $CADAYS -batch " . + "-out ${CATOP}/$CACERT $CADAYS -batch " . "-keyfile ${CATOP}/private/$CAKEY -selfsign " . "-extensions v3_ca " . "-infiles ${CATOP}/$CAREQ "); @@ -160,7 +160,7 @@ } else { system ("$VERIFY -CAfile $CATOP/$CACERT newcert.pem"); $RET=$?; - exit 0; + exit 0; } } else { print STDERR "Unknown arg $_\n"; diff --git a/deps/openssl/openssl/apps/CA.pl.in b/deps/openssl/openssl/apps/CA.pl.in index c783a6e6a54159..3bf4c99f31029e 100644 --- a/deps/openssl/openssl/apps/CA.pl.in +++ b/deps/openssl/openssl/apps/CA.pl.in @@ -64,7 +64,7 @@ $RET = 0; foreach (@ARGV) { if ( /^(-\?|-h|-help)$/ ) { - print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-verify\n"; + print STDERR "usage: CA -newcert|-newreq|-newreq-nodes|-newca|-sign|-signcert|-verify\n"; exit 0; } elsif (/^-newcert$/) { # create a certificate @@ -186,4 +186,3 @@ while () { } } } - diff --git a/deps/openssl/openssl/apps/apps.c b/deps/openssl/openssl/apps/apps.c index b1dd97038f7d7c..9fdc3e0097c557 100644 --- a/deps/openssl/openssl/apps/apps.c +++ b/deps/openssl/openssl/apps/apps.c @@ -215,7 +215,8 @@ int args_from_file(char *file, int *argc, char **argv[]) if (arg != NULL) OPENSSL_free(arg); arg = (char **)OPENSSL_malloc(sizeof(char *) * (i * 2)); - + if (arg == NULL) + return 0; *argv = arg; num = 0; p = buf; @@ -2374,6 +2375,8 @@ int args_verify(char ***pargs, int *pargc, flags |= X509_V_FLAG_PARTIAL_CHAIN; else if (!strcmp(arg, "-no_alt_chains")) flags |= X509_V_FLAG_NO_ALT_CHAINS; + else if (!strcmp(arg, "-allow_proxy_certs")) + flags |= X509_V_FLAG_ALLOW_PROXY_CERTS; else return 0; @@ -3195,6 +3198,36 @@ int app_isdir(const char *name) #endif /* raw_read|write section */ +#if defined(__VMS) +# include "vms_term_sock.h" +static int stdin_sock = -1; + +static void close_stdin_sock(void) +{ + TerminalSocket (TERM_SOCK_DELETE, &stdin_sock); +} + +int fileno_stdin(void) +{ + if (stdin_sock == -1) { + TerminalSocket(TERM_SOCK_CREATE, &stdin_sock); + atexit(close_stdin_sock); + } + + return stdin_sock; +} +#else +int fileno_stdin(void) +{ + return fileno(stdin); +} +#endif + +int fileno_stdout(void) +{ + return fileno(stdout); +} + #if defined(_WIN32) && defined(STD_INPUT_HANDLE) int raw_read_stdin(void *buf, int siz) { @@ -3204,10 +3237,17 @@ int raw_read_stdin(void *buf, int siz) else return (-1); } +#elif defined(__VMS) +#include + +int raw_read_stdin(void *buf, int siz) +{ + return recv(fileno_stdin(), buf, siz, 0); +} #else int raw_read_stdin(void *buf, int siz) { - return read(fileno(stdin), buf, siz); + return read(fileno_stdin(), buf, siz); } #endif @@ -3223,6 +3263,6 @@ int raw_write_stdout(const void *buf, int siz) #else int raw_write_stdout(const void *buf, int siz) { - return write(fileno(stdout), buf, siz); + return write(fileno_stdout(), buf, siz); } #endif diff --git a/deps/openssl/openssl/apps/apps.h b/deps/openssl/openssl/apps/apps.h index 19bf5cc3337d7d..c6c3881f31e1e6 100644 --- a/deps/openssl/openssl/apps/apps.h +++ b/deps/openssl/openssl/apps/apps.h @@ -375,6 +375,8 @@ void store_setup_crl_download(X509_STORE *st); # define SERIAL_RAND_BITS 64 int app_isdir(const char *); +int fileno_stdin(void); +int fileno_stdout(void); int raw_read_stdin(void *, int); int raw_write_stdout(const void *, int); diff --git a/deps/openssl/openssl/apps/ca.c b/deps/openssl/openssl/apps/ca.c index 0b66095b83b6f1..a0ec5838fa7cb3 100644 --- a/deps/openssl/openssl/apps/ca.c +++ b/deps/openssl/openssl/apps/ca.c @@ -2103,25 +2103,23 @@ static int do_body(X509 **xret, EVP_PKEY *pkey, X509 *x509, goto err; /* We now just add it to the database */ - row[DB_type] = (char *)OPENSSL_malloc(2); - tm = X509_get_notAfter(ret); - row[DB_exp_date] = (char *)OPENSSL_malloc(tm->length + 1); - memcpy(row[DB_exp_date], tm->data, tm->length); - row[DB_exp_date][tm->length] = '\0'; - - row[DB_rev_date] = NULL; - - /* row[DB_serial] done already */ - row[DB_file] = (char *)OPENSSL_malloc(8); + row[DB_type] = OPENSSL_malloc(2); + row[DB_exp_date] = OPENSSL_malloc(tm->length + 1); + row[DB_rev_date] = OPENSSL_malloc(1); + row[DB_file] = OPENSSL_malloc(8); row[DB_name] = X509_NAME_oneline(X509_get_subject_name(ret), NULL, 0); - if ((row[DB_type] == NULL) || (row[DB_exp_date] == NULL) || + (row[DB_rev_date] == NULL) || (row[DB_file] == NULL) || (row[DB_name] == NULL)) { BIO_printf(bio_err, "Memory allocation failure\n"); goto err; } - BUF_strlcpy(row[DB_file], "unknown", 8); + + memcpy(row[DB_exp_date], tm->data, tm->length); + row[DB_exp_date][tm->length] = '\0'; + row[DB_rev_date][0] = '\0'; + strcpy(row[DB_file], "unknown"); row[DB_type][0] = 'V'; row[DB_type][1] = '\0'; @@ -2307,6 +2305,7 @@ static int certify_spkac(X509 **xret, char *infile, EVP_PKEY *pkey, j = NETSCAPE_SPKI_verify(spki, pktmp); if (j <= 0) { + EVP_PKEY_free(pktmp); BIO_printf(bio_err, "signature verification failed on SPKAC public key\n"); goto err; diff --git a/deps/openssl/openssl/apps/dgst.c b/deps/openssl/openssl/apps/dgst.c index 95e5fa3fc7b7d5..26afcd7b30baf1 100644 --- a/deps/openssl/openssl/apps/dgst.c +++ b/deps/openssl/openssl/apps/dgst.c @@ -243,6 +243,11 @@ int MAIN(int argc, char **argv) argv++; } + if (keyfile != NULL && argc > 1) { + BIO_printf(bio_err, "Can only sign or verify one file\n"); + goto end; + } + if (do_verify && !sigfile) { BIO_printf(bio_err, "No signature to verify: use the -signature option\n"); diff --git a/deps/openssl/openssl/apps/enc.c b/deps/openssl/openssl/apps/enc.c index 7b7c70b132d722..8e2ef27aca34f0 100644 --- a/deps/openssl/openssl/apps/enc.c +++ b/deps/openssl/openssl/apps/enc.c @@ -509,7 +509,7 @@ int MAIN(int argc, char **argv) BIO_printf(bio_err, "invalid hex salt value\n"); goto end; } - } else if (RAND_pseudo_bytes(salt, sizeof salt) < 0) + } else if (RAND_bytes(salt, sizeof salt) <= 0) goto end; /* * If -P option then don't bother writing diff --git a/deps/openssl/openssl/apps/makeapps.com b/deps/openssl/openssl/apps/makeapps.com index 47457afc7c5731..97dff415385e8e 100644 --- a/deps/openssl/openssl/apps/makeapps.com +++ b/deps/openssl/openssl/apps/makeapps.com @@ -186,7 +186,7 @@ $ LIB_OPENSSL = "VERIFY,ASN1PARS,REQ,DGST,DH,DHPARAM,ENC,PASSWD,GENDH,ERRSTR,"+- "CIPHERS,NSEQ,PKCS12,PKCS8,PKEY,PKEYPARAM,PKEYUTL,"+ - "SPKAC,SMIME,CMS,RAND,ENGINE,OCSP,PRIME,TS,SRP" $! -$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT" +$ LIB_OPENSSL = LIB_OPENSSL+ ",VMS_DECC_INIT,VMS_TERM_SOCK" $! $ TCPIP_PROGRAMS = ",," $ IF COMPILER .EQS. "VAXC" THEN - diff --git a/deps/openssl/openssl/apps/passwd.c b/deps/openssl/openssl/apps/passwd.c index 5ff53b5743c6f7..798a6d593616fa 100644 --- a/deps/openssl/openssl/apps/passwd.c +++ b/deps/openssl/openssl/apps/passwd.c @@ -416,7 +416,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, if (*salt_malloc_p == NULL) goto err; } - if (RAND_pseudo_bytes((unsigned char *)*salt_p, 2) < 0) + if (RAND_bytes((unsigned char *)*salt_p, 2) <= 0) goto err; (*salt_p)[0] = cov_2char[(*salt_p)[0] & 0x3f]; /* 6 bits */ (*salt_p)[1] = cov_2char[(*salt_p)[1] & 0x3f]; /* 6 bits */ @@ -437,7 +437,7 @@ static int do_passwd(int passed_salt, char **salt_p, char **salt_malloc_p, if (*salt_malloc_p == NULL) goto err; } - if (RAND_pseudo_bytes((unsigned char *)*salt_p, 8) < 0) + if (RAND_bytes((unsigned char *)*salt_p, 8) <= 0) goto err; for (i = 0; i < 8; i++) diff --git a/deps/openssl/openssl/apps/pkcs12.c b/deps/openssl/openssl/apps/pkcs12.c index cbb75b7d5fe49a..82182c29b86d7f 100644 --- a/deps/openssl/openssl/apps/pkcs12.c +++ b/deps/openssl/openssl/apps/pkcs12.c @@ -832,6 +832,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, EVP_PKEY *pkey; PKCS8_PRIV_KEY_INFO *p8; X509 *x509; + int ret = 0; switch (M_PKCS12_bag_type(bag)) { case NID_keyBag: @@ -844,7 +845,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, if (!(pkey = EVP_PKCS82PKEY(p8))) return 0; print_attribs(out, p8->attributes, "Key Attributes"); - PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); + ret = PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); EVP_PKEY_free(pkey); break; @@ -864,7 +865,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, } print_attribs(out, p8->attributes, "Key Attributes"); PKCS8_PRIV_KEY_INFO_free(p8); - PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); + ret = PEM_write_bio_PrivateKey(out, pkey, enc, NULL, 0, NULL, pempass); EVP_PKEY_free(pkey); break; @@ -884,7 +885,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, if (!(x509 = PKCS12_certbag2x509(bag))) return 0; dump_cert_text(out, x509); - PEM_write_bio_X509(out, x509); + ret = PEM_write_bio_X509(out, x509); X509_free(x509); break; @@ -902,7 +903,7 @@ int dump_certs_pkeys_bag(BIO *out, PKCS12_SAFEBAG *bag, char *pass, return 1; break; } - return 1; + return ret; } /* Given a single certificate return a verified chain or NULL if error */ @@ -931,16 +932,70 @@ static int get_cert_chain(X509 *cert, X509_STORE *store, int alg_print(BIO *x, X509_ALGOR *alg) { - PBEPARAM *pbe; - const unsigned char *p; - p = alg->parameter->value.sequence->data; - pbe = d2i_PBEPARAM(NULL, &p, alg->parameter->value.sequence->length); - if (!pbe) - return 1; - BIO_printf(bio_err, "%s, Iteration %ld\n", - OBJ_nid2ln(OBJ_obj2nid(alg->algorithm)), - ASN1_INTEGER_get(pbe->iter)); - PBEPARAM_free(pbe); + int pbenid, aparamtype; + ASN1_OBJECT *aoid; + void *aparam; + PBEPARAM *pbe = NULL; + + X509_ALGOR_get0(&aoid, &aparamtype, &aparam, alg); + + pbenid = OBJ_obj2nid(aoid); + + BIO_printf(x, "%s", OBJ_nid2ln(pbenid)); + + /* + * If PBE algorithm is PBES2 decode algorithm parameters + * for additional details. + */ + if (pbenid == NID_pbes2) { + PBE2PARAM *pbe2 = NULL; + int encnid; + if (aparamtype == V_ASN1_SEQUENCE) + pbe2 = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBE2PARAM)); + if (pbe2 == NULL) { + BIO_puts(x, ""); + goto done; + } + X509_ALGOR_get0(&aoid, &aparamtype, &aparam, pbe2->keyfunc); + pbenid = OBJ_obj2nid(aoid); + X509_ALGOR_get0(&aoid, NULL, NULL, pbe2->encryption); + encnid = OBJ_obj2nid(aoid); + BIO_printf(x, ", %s, %s", OBJ_nid2ln(pbenid), + OBJ_nid2sn(encnid)); + /* If KDF is PBKDF2 decode parameters */ + if (pbenid == NID_id_pbkdf2) { + PBKDF2PARAM *kdf = NULL; + int prfnid; + if (aparamtype == V_ASN1_SEQUENCE) + kdf = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBKDF2PARAM)); + if (kdf == NULL) { + BIO_puts(x, ""); + goto done; + } + + if (kdf->prf == NULL) { + prfnid = NID_hmacWithSHA1; + } else { + X509_ALGOR_get0(&aoid, NULL, NULL, kdf->prf); + prfnid = OBJ_obj2nid(aoid); + } + BIO_printf(x, ", Iteration %ld, PRF %s", + ASN1_INTEGER_get(kdf->iter), OBJ_nid2sn(prfnid)); + PBKDF2PARAM_free(kdf); + } + PBE2PARAM_free(pbe2); + } else { + if (aparamtype == V_ASN1_SEQUENCE) + pbe = ASN1_item_unpack(aparam, ASN1_ITEM_rptr(PBEPARAM)); + if (pbe == NULL) { + BIO_puts(x, ""); + goto done; + } + BIO_printf(x, ", Iteration %ld", ASN1_INTEGER_get(pbe->iter)); + PBEPARAM_free(pbe); + } + done: + BIO_puts(x, "\n"); return 1; } diff --git a/deps/openssl/openssl/apps/pkeyutl.c b/deps/openssl/openssl/apps/pkeyutl.c index 39faa451ab8df0..e47206c40a114b 100644 --- a/deps/openssl/openssl/apps/pkeyutl.c +++ b/deps/openssl/openssl/apps/pkeyutl.c @@ -446,14 +446,14 @@ static EVP_PKEY_CTX *init_ctx(int *pkeysize, if (!pkey) goto end; - + #ifndef OPENSSL_NO_ENGINE if (engine_impl) impl = e; #endif - + ctx = EVP_PKEY_CTX_new(pkey, impl); - + EVP_PKEY_free(pkey); if (!ctx) diff --git a/deps/openssl/openssl/apps/req.c b/deps/openssl/openssl/apps/req.c index e818bd2976d6db..d1411c91bbb89e 100644 --- a/deps/openssl/openssl/apps/req.c +++ b/deps/openssl/openssl/apps/req.c @@ -332,9 +332,10 @@ int MAIN(int argc, char **argv) subject = 1; else if (strcmp(*argv, "-text") == 0) text = 1; - else if (strcmp(*argv, "-x509") == 0) + else if (strcmp(*argv, "-x509") == 0) { + newreq = 1; x509 = 1; - else if (strcmp(*argv, "-asn1-kludge") == 0) + } else if (strcmp(*argv, "-asn1-kludge") == 0) kludge = 1; else if (strcmp(*argv, "-no-asn1-kludge") == 0) kludge = 0; @@ -756,7 +757,7 @@ int MAIN(int argc, char **argv) } } - if (newreq || x509) { + if (newreq) { if (pkey == NULL) { BIO_printf(bio_err, "you need to specify a private key\n"); goto end; @@ -1331,12 +1332,11 @@ static int auto_info(X509_REQ *req, STACK_OF(CONF_VALUE) *dn_sk, break; } #ifndef CHARSET_EBCDIC - if (*p == '+') + if (*type == '+') { #else - if (*p == os_toascii['+']) + if (*type == os_toascii['+']) { #endif - { - p++; + type++; mval = -1; } else mval = 0; diff --git a/deps/openssl/openssl/apps/s_apps.h b/deps/openssl/openssl/apps/s_apps.h index 5b54bfdc4e1ca3..5ba1e1d6d86d42 100644 --- a/deps/openssl/openssl/apps/s_apps.h +++ b/deps/openssl/openssl/apps/s_apps.h @@ -199,7 +199,8 @@ int load_excert(SSL_EXCERT **pexc, BIO *err); void print_ssl_summary(BIO *bio, SSL *s); #ifdef HEADER_SSL_H int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx, - int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr); + int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr, + int *no_prot_opt); int args_ssl_call(SSL_CTX *ctx, BIO *err, SSL_CONF_CTX *cctx, STACK_OF(OPENSSL_STRING) *str, int no_ecdhe, int no_jpake); int ssl_ctx_add_crls(SSL_CTX *ctx, STACK_OF(X509_CRL) *crls, diff --git a/deps/openssl/openssl/apps/s_cb.c b/deps/openssl/openssl/apps/s_cb.c index 5b5e711bf2eb9c..d1a99a7bd605b4 100644 --- a/deps/openssl/openssl/apps/s_cb.c +++ b/deps/openssl/openssl/apps/s_cb.c @@ -1507,11 +1507,18 @@ void print_ssl_summary(BIO *bio, SSL *s) } int args_ssl(char ***pargs, int *pargc, SSL_CONF_CTX *cctx, - int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr) + int *badarg, BIO *err, STACK_OF(OPENSSL_STRING) **pstr, + int *no_prot_opt) { char *arg = **pargs, *argn = (*pargs)[1]; int rv; + if (strcmp(arg, "-no_ssl2") == 0 || strcmp(arg, "-no_ssl3") == 0 + || strcmp(arg, "-no_tls1") == 0 || strcmp(arg, "-no_tls1_1") == 0 + || strcmp(arg, "-no_tls1_2") == 0) { + *no_prot_opt = 1; + } + /* Attempt to run SSL configuration command */ rv = SSL_CONF_cmd_argv(cctx, pargc, pargs); /* If parameter not recognised just return */ diff --git a/deps/openssl/openssl/apps/s_client.c b/deps/openssl/openssl/apps/s_client.c index bc8004a5551524..dd474868f46fdd 100644 --- a/deps/openssl/openssl/apps/s_client.c +++ b/deps/openssl/openssl/apps/s_client.c @@ -250,9 +250,9 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity, unsigned char *psk, unsigned int max_psk_len) { - unsigned int psk_len = 0; int ret; - BIGNUM *bn = NULL; + long key_len; + unsigned char *key; if (c_debug) BIO_printf(bio_c_out, "psk_client_cb\n"); @@ -273,32 +273,29 @@ static unsigned int psk_client_cb(SSL *ssl, const char *hint, char *identity, if (c_debug) BIO_printf(bio_c_out, "created identity '%s' len=%d\n", identity, ret); - ret = BN_hex2bn(&bn, psk_key); - if (!ret) { - BIO_printf(bio_err, "Could not convert PSK key '%s' to BIGNUM\n", + + /* convert the PSK key to binary */ + key = string_to_hex(psk_key, &key_len); + if (key == NULL) { + BIO_printf(bio_err, "Could not convert PSK key '%s' to buffer\n", psk_key); - if (bn) - BN_free(bn); return 0; } - - if ((unsigned int)BN_num_bytes(bn) > max_psk_len) { + if ((unsigned long)key_len > (unsigned long)max_psk_len) { BIO_printf(bio_err, - "psk buffer of callback is too small (%d) for key (%d)\n", - max_psk_len, BN_num_bytes(bn)); - BN_free(bn); + "psk buffer of callback is too small (%d) for key (%ld)\n", + max_psk_len, key_len); + OPENSSL_free(key); return 0; } - psk_len = BN_bn2bin(bn, psk); - BN_free(bn); - if (psk_len == 0) - goto out_err; + memcpy(psk, key, key_len); + OPENSSL_free(key); if (c_debug) - BIO_printf(bio_c_out, "created PSK len=%d\n", psk_len); + BIO_printf(bio_c_out, "created PSK len=%ld\n", key_len); - return psk_len; + return key_len; out_err: if (c_debug) BIO_printf(bio_err, "Error in PSK client callback\n"); @@ -759,6 +756,7 @@ int MAIN(int argc, char **argv) int crl_format = FORMAT_PEM; int crl_download = 0; STACK_OF(X509_CRL) *crls = NULL; + int prot_opt = 0, no_prot_opt = 0; meth = SSLv23_client_method(); @@ -862,7 +860,8 @@ int MAIN(int argc, char **argv) if (badarg) goto bad; continue; - } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args)) { + } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args, + &no_prot_opt)) { if (badarg) goto bad; continue; @@ -954,31 +953,42 @@ int MAIN(int argc, char **argv) } #endif #ifndef OPENSSL_NO_SSL2 - else if (strcmp(*argv, "-ssl2") == 0) + else if (strcmp(*argv, "-ssl2") == 0) { meth = SSLv2_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_SSL3_METHOD - else if (strcmp(*argv, "-ssl3") == 0) + else if (strcmp(*argv, "-ssl3") == 0) { meth = SSLv3_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_TLS1 - else if (strcmp(*argv, "-tls1_2") == 0) + else if (strcmp(*argv, "-tls1_2") == 0) { meth = TLSv1_2_client_method(); - else if (strcmp(*argv, "-tls1_1") == 0) + prot_opt++; + } else if (strcmp(*argv, "-tls1_1") == 0) { meth = TLSv1_1_client_method(); - else if (strcmp(*argv, "-tls1") == 0) + prot_opt++; + } else if (strcmp(*argv, "-tls1") == 0) { meth = TLSv1_client_method(); + prot_opt++; + } #endif #ifndef OPENSSL_NO_DTLS1 else if (strcmp(*argv, "-dtls") == 0) { meth = DTLS_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1") == 0) { meth = DTLSv1_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1_2") == 0) { meth = DTLSv1_2_client_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-timeout") == 0) enable_timeouts = 1; else if (strcmp(*argv, "-mtu") == 0) { @@ -1165,6 +1175,17 @@ int MAIN(int argc, char **argv) } #endif + if (prot_opt > 1) { + BIO_printf(bio_err, "Cannot supply multiple protocol flags\n"); + goto end; + } + + if (prot_opt == 1 && no_prot_opt) { + BIO_printf(bio_err, "Cannot supply both a protocol flag and " + "\"-no_\"\n"); + goto end; + } + OpenSSL_add_ssl_algorithms(); SSL_load_error_strings(); @@ -1556,7 +1577,10 @@ int MAIN(int argc, char **argv) SSL_set_connect_state(con); /* ok, lets connect */ - width = SSL_get_fd(con) + 1; + if (fileno_stdin() > SSL_get_fd(con)) + width = fileno_stdin() + 1; + else + width = SSL_get_fd(con) + 1; read_tty = 1; write_tty = 0; @@ -1739,9 +1763,11 @@ int MAIN(int argc, char **argv) #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined (OPENSSL_SYS_BEOS_R5) if (tty_on) { if (read_tty) - openssl_fdset(fileno(stdin), &readfds); + openssl_fdset(fileno_stdin(), &readfds); +#if !defined(OPENSSL_SYS_VMS) if (write_tty) - openssl_fdset(fileno(stdout), &writefds); + openssl_fdset(fileno_stdout(), &writefds); +#endif } if (read_ssl) openssl_fdset(SSL_get_fd(con), &readfds); @@ -1810,14 +1836,14 @@ int MAIN(int argc, char **argv) /* Under BeOS-R5 the situation is similar to DOS */ i = 0; stdin_set = 0; - (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); + (void)fcntl(fileno_stdin(), F_SETFL, O_NONBLOCK); if (!write_tty) { if (read_tty) { tv.tv_sec = 1; tv.tv_usec = 0; i = select(width, (void *)&readfds, (void *)&writefds, NULL, &tv); - if (read(fileno(stdin), sbuf, 0) >= 0) + if (read(fileno_stdin(), sbuf, 0) >= 0) stdin_set = 1; if (!i && (stdin_set != 1 || !read_tty)) continue; @@ -1825,7 +1851,7 @@ int MAIN(int argc, char **argv) i = select(width, (void *)&readfds, (void *)&writefds, NULL, timeoutp); } - (void)fcntl(fileno(stdin), F_SETFL, 0); + (void)fcntl(fileno_stdin(), F_SETFL, 0); #else i = select(width, (void *)&readfds, (void *)&writefds, NULL, timeoutp); @@ -1901,11 +1927,11 @@ int MAIN(int argc, char **argv) goto shut; } } -#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) +#if defined(OPENSSL_SYS_WINDOWS) || defined(OPENSSL_SYS_MSDOS) || defined(OPENSSL_SYS_NETWARE) || defined(OPENSSL_SYS_BEOS_R5) || defined(OPENSSL_SYS_VMS) /* Assume Windows/DOS/BeOS can always write */ else if (!ssl_pending && write_tty) #else - else if (!ssl_pending && FD_ISSET(fileno(stdout), &writefds)) + else if (!ssl_pending && FD_ISSET(fileno_stdout(), &writefds)) #endif { #ifdef CHARSET_EBCDIC @@ -2003,7 +2029,7 @@ int MAIN(int argc, char **argv) #elif defined(OPENSSL_SYS_BEOS_R5) else if (stdin_set) #else - else if (FD_ISSET(fileno(stdin), &readfds)) + else if (FD_ISSET(fileno_stdin(), &readfds)) #endif { if (crlf) { diff --git a/deps/openssl/openssl/apps/s_server.c b/deps/openssl/openssl/apps/s_server.c index 09c755b55cfe16..857a70e3e4c5c2 100644 --- a/deps/openssl/openssl/apps/s_server.c +++ b/deps/openssl/openssl/apps/s_server.c @@ -353,9 +353,8 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity, unsigned char *psk, unsigned int max_psk_len) { - unsigned int psk_len = 0; - int ret; - BIGNUM *bn = NULL; + long key_len = 0; + unsigned char *key; if (s_debug) BIO_printf(bio_s_out, "psk_server_cb\n"); @@ -377,32 +376,26 @@ static unsigned int psk_server_cb(SSL *ssl, const char *identity, BIO_printf(bio_s_out, "PSK client identity found\n"); /* convert the PSK key to binary */ - ret = BN_hex2bn(&bn, psk_key); - if (!ret) { - BIO_printf(bio_err, "Could not convert PSK key '%s' to BIGNUM\n", + key = string_to_hex(psk_key, &key_len); + if (key == NULL) { + BIO_printf(bio_err, "Could not convert PSK key '%s' to buffer\n", psk_key); - if (bn) - BN_free(bn); return 0; } - if (BN_num_bytes(bn) > (int)max_psk_len) { + if (key_len > (int)max_psk_len) { BIO_printf(bio_err, - "psk buffer of callback is too small (%d) for key (%d)\n", - max_psk_len, BN_num_bytes(bn)); - BN_free(bn); + "psk buffer of callback is too small (%d) for key (%ld)\n", + max_psk_len, key_len); + OPENSSL_free(key); return 0; } - ret = BN_bn2bin(bn, psk); - BN_free(bn); - - if (ret < 0) - goto out_err; - psk_len = (unsigned int)ret; + memcpy(psk, key, key_len); + OPENSSL_free(key); if (s_debug) - BIO_printf(bio_s_out, "fetched PSK len=%d\n", psk_len); - return psk_len; + BIO_printf(bio_s_out, "fetched PSK len=%ld\n", key_len); + return key_len; out_err: if (s_debug) BIO_printf(bio_err, "Error in PSK server callback\n"); @@ -1144,6 +1137,7 @@ int MAIN(int argc, char *argv[]) int crl_format = FORMAT_PEM; int crl_download = 0; STACK_OF(X509_CRL) *crls = NULL; + int prot_opt = 0, no_prot_opt = 0; meth = SSLv23_server_method(); @@ -1307,7 +1301,8 @@ int MAIN(int argc, char *argv[]) if (badarg) goto bad; continue; - } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args)) { + } else if (args_ssl(&argv, &argc, cctx, &badarg, bio_err, &ssl_args, + &no_prot_opt)) { if (badarg) goto bad; continue; @@ -1451,32 +1446,40 @@ int MAIN(int argc, char *argv[]) else if (strcmp(*argv, "-ssl2") == 0) { no_ecdhe = 1; meth = SSLv2_server_method(); + prot_opt++; } #endif #ifndef OPENSSL_NO_SSL3_METHOD else if (strcmp(*argv, "-ssl3") == 0) { meth = SSLv3_server_method(); + prot_opt++; } #endif #ifndef OPENSSL_NO_TLS1 else if (strcmp(*argv, "-tls1") == 0) { meth = TLSv1_server_method(); + prot_opt++; } else if (strcmp(*argv, "-tls1_1") == 0) { meth = TLSv1_1_server_method(); + prot_opt++; } else if (strcmp(*argv, "-tls1_2") == 0) { meth = TLSv1_2_server_method(); + prot_opt++; } #endif #ifndef OPENSSL_NO_DTLS1 else if (strcmp(*argv, "-dtls") == 0) { meth = DTLS_server_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1") == 0) { meth = DTLSv1_server_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-dtls1_2") == 0) { meth = DTLSv1_2_server_method(); socket_type = SOCK_DGRAM; + prot_opt++; } else if (strcmp(*argv, "-timeout") == 0) enable_timeouts = 1; else if (strcmp(*argv, "-mtu") == 0) { @@ -1586,6 +1589,17 @@ int MAIN(int argc, char *argv[]) } #endif + if (prot_opt > 1) { + BIO_printf(bio_err, "Cannot supply multiple protocol flags\n"); + goto end; + } + + if (prot_opt == 1 && no_prot_opt) { + BIO_printf(bio_err, "Cannot supply both a protocol flag and " + "\"-no_\"\n"); + goto end; + } + SSL_load_error_strings(); OpenSSL_add_ssl_algorithms(); @@ -2293,7 +2307,10 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) } #endif - width = s + 1; + if (fileno_stdin() > s) + width = fileno_stdin() + 1; + else + width = s + 1; for (;;) { int read_from_terminal; int read_from_sslcon; @@ -2304,7 +2321,7 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) if (!read_from_sslcon) { FD_ZERO(&readfds); #if !defined(OPENSSL_SYS_WINDOWS) && !defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_NETWARE) && !defined(OPENSSL_SYS_BEOS_R5) - openssl_fdset(fileno(stdin), &readfds); + openssl_fdset(fileno_stdin(), &readfds); #endif openssl_fdset(s, &readfds); /* @@ -2332,13 +2349,13 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) /* Under BeOS-R5 the situation is similar to DOS */ tv.tv_sec = 1; tv.tv_usec = 0; - (void)fcntl(fileno(stdin), F_SETFL, O_NONBLOCK); + (void)fcntl(fileno_stdin(), F_SETFL, O_NONBLOCK); i = select(width, (void *)&readfds, NULL, NULL, &tv); - if ((i < 0) || (!i && read(fileno(stdin), buf, 0) < 0)) + if ((i < 0) || (!i && read(fileno_stdin(), buf, 0) < 0)) continue; - if (read(fileno(stdin), buf, 0) >= 0) + if (read(fileno_stdin(), buf, 0) >= 0) read_from_terminal = 1; - (void)fcntl(fileno(stdin), F_SETFL, 0); + (void)fcntl(fileno_stdin(), F_SETFL, 0); #else if ((SSL_version(con) == DTLS1_VERSION) && DTLSv1_get_timeout(con, &timeout)) @@ -2355,7 +2372,7 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) if (i <= 0) continue; - if (FD_ISSET(fileno(stdin), &readfds)) + if (FD_ISSET(fileno_stdin(), &readfds)) read_from_terminal = 1; #endif if (FD_ISSET(s, &readfds)) @@ -2382,6 +2399,7 @@ static int sv_body(char *hostname, int s, int stype, unsigned char *context) assert(lf_num == 0); } else i = raw_read_stdin(buf, bufsize); + if (!s_quiet && !s_brief) { if ((i <= 0) || (buf[0] == 'Q')) { BIO_printf(bio_s_out, "DONE\n"); @@ -3371,7 +3389,7 @@ static int generate_session_id(const SSL *ssl, unsigned char *id, { unsigned int count = 0; do { - if (RAND_pseudo_bytes(id, *id_len) < 0) + if (RAND_bytes(id, *id_len) <= 0) return 0; /* * Prefix the session_id with the required prefix. NB: If our prefix diff --git a/deps/openssl/openssl/apps/speed.c b/deps/openssl/openssl/apps/speed.c index 95adcc19cc15f1..b862868eacc7be 100644 --- a/deps/openssl/openssl/apps/speed.c +++ b/deps/openssl/openssl/apps/speed.c @@ -2614,6 +2614,10 @@ static int do_multi(int multi) static char sep[] = ":"; fds = malloc(multi * sizeof *fds); + if (fds == NULL) { + fprintf(stderr, "Out of memory in speed (do_multi)\n"); + exit(1); + } for (n = 0; n < multi; ++n) { if (pipe(fd) == -1) { fprintf(stderr, "pipe failure\n"); diff --git a/deps/openssl/openssl/apps/srp.c b/deps/openssl/openssl/apps/srp.c index c0ff4171cabf8e..c75052f38dd454 100644 --- a/deps/openssl/openssl/apps/srp.c +++ b/deps/openssl/openssl/apps/srp.c @@ -765,4 +765,6 @@ int MAIN(int argc, char **argv) OPENSSL_EXIT(ret); } +#else +static void *dummy = &dummy; #endif diff --git a/deps/openssl/openssl/apps/verify.c b/deps/openssl/openssl/apps/verify.c index 78e729fc890f99..b5ae6b370e1e12 100644 --- a/deps/openssl/openssl/apps/verify.c +++ b/deps/openssl/openssl/apps/verify.c @@ -115,43 +115,43 @@ int MAIN(int argc, char **argv) if (argc >= 1) { if (strcmp(*argv, "-CApath") == 0) { if (argc-- < 1) - goto end; + goto usage; CApath = *(++argv); } else if (strcmp(*argv, "-CAfile") == 0) { if (argc-- < 1) - goto end; + goto usage; CAfile = *(++argv); } else if (args_verify(&argv, &argc, &badarg, bio_err, &vpm)) { if (badarg) - goto end; + goto usage; continue; } else if (strcmp(*argv, "-untrusted") == 0) { if (argc-- < 1) - goto end; + goto usage; untfile = *(++argv); } else if (strcmp(*argv, "-trusted") == 0) { if (argc-- < 1) - goto end; + goto usage; trustfile = *(++argv); } else if (strcmp(*argv, "-CRLfile") == 0) { if (argc-- < 1) - goto end; + goto usage; crlfile = *(++argv); } else if (strcmp(*argv, "-crl_download") == 0) crl_download = 1; #ifndef OPENSSL_NO_ENGINE else if (strcmp(*argv, "-engine") == 0) { if (--argc < 1) - goto end; + goto usage; engine = *(++argv); } #endif else if (strcmp(*argv, "-help") == 0) - goto end; + goto usage; else if (strcmp(*argv, "-verbose") == 0) v_verbose = 1; else if (argv[0][0] == '-') - goto end; + goto usage; else break; argc--; @@ -228,7 +228,7 @@ int MAIN(int argc, char **argv) ret = -1; } - end: + usage: if (ret == 1) { BIO_printf(bio_err, "usage: verify [-verbose] [-CApath path] [-CAfile file] [-purpose purpose] [-crl_check]"); @@ -247,6 +247,7 @@ int MAIN(int argc, char **argv) X509_PURPOSE_get0_name(ptmp)); } } + end: if (vpm) X509_VERIFY_PARAM_free(vpm); if (cert_ctx != NULL) diff --git a/deps/openssl/openssl/apps/vms_term_sock.c b/deps/openssl/openssl/apps/vms_term_sock.c new file mode 100755 index 00000000000000..a7d87ff3618c6e --- /dev/null +++ b/deps/openssl/openssl/apps/vms_term_sock.c @@ -0,0 +1,590 @@ +/* + * Copyright 2016 VMS Software, Inc. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifdef __VMS +# define OPENSSL_SYS_VMS +# pragma message disable DOLLARID + + +# include + +# if !defined(_POSIX_C_SOURCE) && defined(OPENSSL_SYS_VMS) +/* + * On VMS, you need to define this to get the declaration of fileno(). The + * value 2 is to make sure no function defined in POSIX-2 is left undefined. + */ +# define _POSIX_C_SOURCE 2 +# endif + +# include + +# undef _POSIX_C_SOURCE + +# include +# include +# include +# include +# include +# include +# include +# include +# include +# ifdef __alpha +# include +# else +typedef struct _iosb { /* Copied from IOSBDEF.H for Alpha */ +# pragma __nomember_alignment + __union { + __struct { + unsigned short int iosb$w_status; /* Final I/O status */ + __union { + __struct { /* 16-bit byte count variant */ + unsigned short int iosb$w_bcnt; /* 16-bit byte count */ + __union { + unsigned int iosb$l_dev_depend; /* 32-bit device dependent info */ + unsigned int iosb$l_pid; /* 32-bit pid */ + } iosb$r_l; + } iosb$r_bcnt_16; + __struct { /* 32-bit byte count variant */ + unsigned int iosb$l_bcnt; /* 32-bit byte count (unaligned) */ + unsigned short int iosb$w_dev_depend_high; /* 16-bit device dependent info */ + } iosb$r_bcnt_32; + } iosb$r_devdepend; + } iosb$r_io_64; + __struct { + __union { + unsigned int iosb$l_getxxi_status; /* Final GETxxI status */ + unsigned int iosb$l_reg_status; /* Final $Registry status */ + } iosb$r_l_status; + unsigned int iosb$l_reserved; /* Reserved field */ + } iosb$r_get_64; + } iosb$r_io_get; +} IOSB; + +# if !defined(__VAXC) +# define iosb$w_status iosb$r_io_get.iosb$r_io_64.iosb$w_status +# define iosb$w_bcnt iosb$r_io_get.iosb$r_io_64.iosb$r_devdepend.iosb$r_bcnt_16.iosb$w_bcnt +# define iosb$r_l iosb$r_io_get.iosb$r_io_64.iosb$r_devdepend.iosb$r_bcnt_16.iosb$r_l +# define iosb$l_dev_depend iosb$r_l.iosb$l_dev_depend +# define iosb$l_pid iosb$r_l.iosb$l_pid +# define iosb$l_bcnt iosb$r_io_get.iosb$r_io_64.iosb$r_devdepend.iosb$r_bcnt_32.iosb$l_bcnt +# define iosb$w_dev_depend_high iosb$r_io_get.iosb$r_io_64.iosb$r_devdepend.iosb$r_bcnt_32.iosb$w_dev_depend_high +# define iosb$l_getxxi_status iosb$r_io_get.iosb$r_get_64.iosb$r_l_status.iosb$l_getxxi_status +# define iosb$l_reg_status iosb$r_io_get.iosb$r_get_64.iosb$r_l_status.iosb$l_reg_status +# endif /* #if !defined(__VAXC) */ + +# endif /* End of IOSBDEF */ + +# include +# include +# include +# include +# include +# include + +# include "vms_term_sock.h" + +# ifdef __alpha +static struct _iosb TerminalDeviceIosb; +# else +IOSB TerminalDeviceIosb; +# endif + +static char TerminalDeviceBuff[255 + 2]; +static int TerminalSocketPair[2] = {0, 0}; +static unsigned short TerminalDeviceChan = 0; + +static int CreateSocketPair (int, int, int, int *); +static void SocketPairTimeoutAst (int); +static int TerminalDeviceAst (int); +static void LogMessage (char *, ...); + +/* +** Socket Pair Timeout Value (must be 0-59 seconds) +*/ +# define SOCKET_PAIR_TIMEOUT_VALUE 20 + +/* +** Socket Pair Timeout Block which is passed to timeout AST +*/ +typedef struct _SocketPairTimeoutBlock { + unsigned short SockChan1; + unsigned short SockChan2; +} SPTB; + +# ifdef TERM_SOCK_TEST + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +int main (int argc, char *argv[], char *envp[]) +{ + char TermBuff[80]; + int TermSock, + status, + len; + + LogMessage ("Enter 'q' or 'Q' to quit ..."); + while (strcasecmp (TermBuff, "Q")) { + /* + ** Create the terminal socket + */ + status = TerminalSocket (TERM_SOCK_CREATE, &TermSock); + if (status != TERM_SOCK_SUCCESS) + exit (1); + + /* + ** Process the terminal input + */ + LogMessage ("Waiting on terminal I/O ...\n"); + len = recv (TermSock, TermBuff, sizeof (TermBuff), 0) ; + TermBuff[len] = '\0'; + LogMessage ("Received terminal I/O [%s]", TermBuff); + + /* + ** Delete the terminal socket + */ + status = TerminalSocket (TERM_SOCK_DELETE, &TermSock); + if (status != TERM_SOCK_SUCCESS) + exit (1); + } + + return 1; + +} +# endif + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +int TerminalSocket (int FunctionCode, int *ReturnSocket) +{ + int status; + $DESCRIPTOR (TerminalDeviceDesc, "SYS$COMMAND"); + + /* + ** Process the requested function code + */ + switch (FunctionCode) { + case TERM_SOCK_CREATE: + /* + ** Create a socket pair + */ + status = CreateSocketPair (AF_INET, SOCK_STREAM, 0, TerminalSocketPair); + if (status == -1) { + LogMessage ("TerminalSocket: CreateSocketPair () - %08X", status); + if (TerminalSocketPair[0]) + close (TerminalSocketPair[0]); + if (TerminalSocketPair[1]) + close (TerminalSocketPair[1]); + return (TERM_SOCK_FAILURE); + } + + /* + ** Assign a channel to the terminal device + */ + status = sys$assign (&TerminalDeviceDesc, + &TerminalDeviceChan, + 0, 0, 0); + if (! (status & 1)) { + LogMessage ("TerminalSocket: SYS$ASSIGN () - %08X", status); + close (TerminalSocketPair[0]); + close (TerminalSocketPair[1]); + return (TERM_SOCK_FAILURE); + } + + /* + ** Queue an async IO to the terminal device + */ + status = sys$qio (EFN$C_ENF, + TerminalDeviceChan, + IO$_READVBLK, + &TerminalDeviceIosb, + TerminalDeviceAst, + 0, + TerminalDeviceBuff, + sizeof (TerminalDeviceBuff) - 2, + 0, 0, 0, 0); + if (! (status & 1)) { + LogMessage ("TerminalSocket: SYS$QIO () - %08X", status); + close (TerminalSocketPair[0]); + close (TerminalSocketPair[1]); + return (TERM_SOCK_FAILURE); + } + + /* + ** Return the input side of the socket pair + */ + *ReturnSocket = TerminalSocketPair[1]; + break; + + case TERM_SOCK_DELETE: + /* + ** Cancel any pending IO on the terminal channel + */ + status = sys$cancel (TerminalDeviceChan); + if (! (status & 1)) { + LogMessage ("TerminalSocket: SYS$CANCEL () - %08X", status); + close (TerminalSocketPair[0]); + close (TerminalSocketPair[1]); + return (TERM_SOCK_FAILURE); + } + + /* + ** Deassign the terminal channel + */ + status = sys$dassgn (TerminalDeviceChan); + if (! (status & 1)) { + LogMessage ("TerminalSocket: SYS$DASSGN () - %08X", status); + close (TerminalSocketPair[0]); + close (TerminalSocketPair[1]); + return (TERM_SOCK_FAILURE); + } + + /* + ** Close the terminal socket pair + */ + close (TerminalSocketPair[0]); + close (TerminalSocketPair[1]); + + /* + ** Return the initialized socket + */ + *ReturnSocket = 0; + break; + + default: + /* + ** Invalid function code + */ + LogMessage ("TerminalSocket: Invalid Function Code - %d", FunctionCode); + return (TERM_SOCK_FAILURE); + break; + } + + /* + ** Return success + */ + return (TERM_SOCK_SUCCESS); + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +static int CreateSocketPair (int SocketFamily, + int SocketType, + int SocketProtocol, + int *SocketPair) +{ + struct dsc$descriptor AscTimeDesc = {0, DSC$K_DTYPE_T, DSC$K_CLASS_S, NULL}; + static const char* LocalHostAddr = {"127.0.0.1"}; + unsigned short TcpAcceptChan = 0, + TcpDeviceChan = 0; + unsigned long BinTimeBuff[2]; + struct sockaddr_in sin; + char AscTimeBuff[32]; + short LocalHostPort; + int status; + unsigned int slen; + +# ifdef __alpha + struct _iosb iosb; +# else + IOSB iosb; +# endif + + int SockDesc1 = 0, + SockDesc2 = 0; + SPTB sptb; + $DESCRIPTOR (TcpDeviceDesc, "TCPIP$DEVICE"); + + /* + ** Create a socket + */ + SockDesc1 = socket (SocketFamily, SocketType, 0); + if (SockDesc1 < 0) { + LogMessage ("CreateSocketPair: socket () - %d", errno); + return (-1); + } + + /* + ** Initialize the socket information + */ + slen = sizeof (sin); + memset ((char *) &sin, 0, slen); + sin.sin_family = SocketFamily; + sin.sin_addr.s_addr = inet_addr (LocalHostAddr); + sin.sin_port = 0; + + /* + ** Bind the socket to the local IP + */ + status = bind (SockDesc1, (struct sockaddr *) &sin, slen); + if (status < 0) { + LogMessage ("CreateSocketPair: bind () - %d", errno); + close (SockDesc1); + return (-1); + } + + /* + ** Get the socket name so we can save the port number + */ + status = getsockname (SockDesc1, (struct sockaddr *) &sin, &slen); + if (status < 0) { + LogMessage ("CreateSocketPair: getsockname () - %d", errno); + close (SockDesc1); + return (-1); + } else + LocalHostPort = sin.sin_port; + + /* + ** Setup a listen for the socket + */ + listen (SockDesc1, 5); + + /* + ** Get the binary (64-bit) time of the specified timeout value + */ + sprintf (AscTimeBuff, "0 0:0:%02d.00", SOCKET_PAIR_TIMEOUT_VALUE); + AscTimeDesc.dsc$w_length = strlen (AscTimeBuff); + AscTimeDesc.dsc$a_pointer = AscTimeBuff; + status = sys$bintim (&AscTimeDesc, BinTimeBuff); + if (! (status & 1)) { + LogMessage ("CreateSocketPair: SYS$BINTIM () - %08X", status); + close (SockDesc1); + return (-1); + } + + /* + ** Assign another channel to the TCP/IP device for the accept. + ** This is the channel that ends up being connected to. + */ + status = sys$assign (&TcpDeviceDesc, &TcpDeviceChan, 0, 0, 0); + if (! (status & 1)) { + LogMessage ("CreateSocketPair: SYS$ASSIGN () - %08X", status); + close (SockDesc1); + return (-1); + } + + /* + ** Get the channel of the first socket for the accept + */ + TcpAcceptChan = decc$get_sdc (SockDesc1); + + /* + ** Perform the accept using $QIO so we can do this asynchronously + */ + status = sys$qio (EFN$C_ENF, + TcpAcceptChan, + IO$_ACCESS | IO$M_ACCEPT, + &iosb, + 0, 0, 0, 0, 0, + &TcpDeviceChan, + 0, 0); + if (! (status & 1)) { + LogMessage ("CreateSocketPair: SYS$QIO () - %08X", status); + close (SockDesc1); + sys$dassgn (TcpDeviceChan); + return (-1); + } + + /* + ** Create the second socket to do the connect + */ + SockDesc2 = socket (SocketFamily, SocketType, 0); + if (SockDesc2 < 0) { + LogMessage ("CreateSocketPair: socket () - %d", errno); + sys$cancel (TcpAcceptChan); + close (SockDesc1); + sys$dassgn (TcpDeviceChan); + return (-1) ; + } + + /* + ** Setup the Socket Pair Timeout Block + */ + sptb.SockChan1 = TcpAcceptChan; + sptb.SockChan2 = decc$get_sdc (SockDesc2); + + /* + ** Before we block on the connect, set a timer that can cancel I/O on our + ** two sockets if it never connects. + */ + status = sys$setimr (EFN$C_ENF, + BinTimeBuff, + SocketPairTimeoutAst, + &sptb, + 0); + if (! (status & 1)) { + LogMessage ("CreateSocketPair: SYS$SETIMR () - %08X", status); + sys$cancel (TcpAcceptChan); + close (SockDesc1); + close (SockDesc2); + sys$dassgn (TcpDeviceChan); + return (-1); + } + + /* + ** Now issue the connect + */ + memset ((char *) &sin, 0, sizeof (sin)) ; + sin.sin_family = SocketFamily; + sin.sin_addr.s_addr = inet_addr (LocalHostAddr) ; + sin.sin_port = LocalHostPort ; + + status = connect (SockDesc2, (struct sockaddr *) &sin, sizeof (sin)); + if (status < 0 ) { + LogMessage ("CreateSocketPair: connect () - %d", errno); + sys$cantim (&sptb, 0); + sys$cancel (TcpAcceptChan); + close (SockDesc1); + close (SockDesc2); + sys$dassgn (TcpDeviceChan); + return (-1); + } + + /* + ** Wait for the asynch $QIO to finish. Note that if the I/O was aborted + ** (SS$_ABORT), then we probably canceled it from the AST routine - so log + ** a timeout. + */ + status = sys$synch (EFN$C_ENF, &iosb); + if (! (iosb.iosb$w_status & 1)) { + if (iosb.iosb$w_status == SS$_ABORT) + LogMessage ("CreateSocketPair: SYS$QIO(iosb) timeout"); + else { + LogMessage ("CreateSocketPair: SYS$QIO(iosb) - %d", + iosb.iosb$w_status); + sys$cantim (&sptb, 0); + } + close (SockDesc1); + close (SockDesc2); + sys$dassgn (TcpDeviceChan); + return (-1); + } + + /* + ** Here we're successfully connected, so cancel the timer, convert the + ** I/O channel to a socket fd, close the listener socket and return the + ** connected pair. + */ + sys$cantim (&sptb, 0); + + close (SockDesc1) ; + SocketPair[0] = SockDesc2 ; + SocketPair[1] = socket_fd (TcpDeviceChan); + + return (0) ; + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +static void SocketPairTimeoutAst (int astparm) +{ + SPTB *sptb = (SPTB *) astparm; + + sys$cancel (sptb->SockChan2); /* Cancel the connect() */ + sys$cancel (sptb->SockChan1); /* Cancel the accept() */ + + return; + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +static int TerminalDeviceAst (int astparm) +{ + int status; + + /* + ** Terminate the terminal buffer + */ + TerminalDeviceBuff[TerminalDeviceIosb.iosb$w_bcnt] = '\0'; + strcat (TerminalDeviceBuff, "\n"); + + /* + ** Send the data read from the terminal device throught the socket pair + */ + send (TerminalSocketPair[0], TerminalDeviceBuff, + TerminalDeviceIosb.iosb$w_bcnt + 1, 0); + + /* + ** Queue another async IO to the terminal device + */ + status = sys$qio (EFN$C_ENF, + TerminalDeviceChan, + IO$_READVBLK, + &TerminalDeviceIosb, + TerminalDeviceAst, + 0, + TerminalDeviceBuff, + sizeof (TerminalDeviceBuff) - 1, + 0, 0, 0, 0); + + /* + ** Return status + */ + return status; + +} + +/*----------------------------------------------------------------------------*/ +/* */ +/*----------------------------------------------------------------------------*/ +static void LogMessage (char *msg, ...) +{ + char *Month[] = {"Jan", "Feb", "Mar", "Apr", "May", "Jun", + "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; + static unsigned int pid = 0; + va_list args; + time_t CurTime; + struct tm *LocTime; + char MsgBuff[256]; + + /* + ** Get the process pid + */ + if (pid == 0) + pid = getpid (); + + /* + ** Convert the current time into local time + */ + CurTime = time (NULL); + LocTime = localtime (&CurTime); + + /* + ** Format the message buffer + */ + sprintf (MsgBuff, "%02d-%s-%04d %02d:%02d:%02d [%08X] %s\n", + LocTime->tm_mday, Month[LocTime->tm_mon], + (LocTime->tm_year + 1900), LocTime->tm_hour, LocTime->tm_min, + LocTime->tm_sec, pid, msg); + + /* + ** Get any variable arguments and add them to the print of the message + ** buffer + */ + va_start (args, msg); + vfprintf (stderr, MsgBuff, args); + va_end (args); + + /* + ** Flush standard error output + */ + fsync (fileno (stderr)); + + return; + +} +#endif diff --git a/deps/openssl/openssl/apps/vms_term_sock.h b/deps/openssl/openssl/apps/vms_term_sock.h new file mode 100755 index 00000000000000..662fa0adaf254b --- /dev/null +++ b/deps/openssl/openssl/apps/vms_term_sock.h @@ -0,0 +1,30 @@ +/* + * Copyright 2016 VMS Software, Inc. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef TERM_SOCK_H +# define TERM_SOCK_H + +/* +** Terminal Socket Function Codes +*/ +# define TERM_SOCK_CREATE 1 +# define TERM_SOCK_DELETE 2 + +/* +** Terminal Socket Status Codes +*/ +# define TERM_SOCK_FAILURE 0 +# define TERM_SOCK_SUCCESS 1 + +/* +** Terminal Socket Prototype +*/ +int TerminalSocket (int FunctionCode, int *ReturnSocket); + +#endif diff --git a/deps/openssl/openssl/apps/x509.c b/deps/openssl/openssl/apps/x509.c index 7c215bced00106..17cb62da726d07 100644 --- a/deps/openssl/openssl/apps/x509.c +++ b/deps/openssl/openssl/apps/x509.c @@ -1105,6 +1105,10 @@ static int x509_certify(X509_STORE *ctx, char *CAfile, const EVP_MD *digest, EVP_PKEY *upkey; upkey = X509_get_pubkey(xca); + if (upkey == NULL) { + BIO_printf(bio_err, "Error obtaining CA X509 public key\n"); + goto end; + } EVP_PKEY_copy_parameters(upkey, pkey); EVP_PKEY_free(upkey); @@ -1217,6 +1221,8 @@ static int sign(X509 *x, EVP_PKEY *pkey, int days, int clrext, EVP_PKEY *pktmp; pktmp = X509_get_pubkey(x); + if (pktmp == NULL) + goto err; EVP_PKEY_copy_parameters(pktmp, pkey); EVP_PKEY_save_parameters(pktmp, 1); EVP_PKEY_free(pktmp); diff --git a/deps/openssl/openssl/crypto/LPdir_nyi.c b/deps/openssl/openssl/crypto/LPdir_nyi.c index 283d5b06369eae..b16e84957bc946 100644 --- a/deps/openssl/openssl/crypto/LPdir_nyi.c +++ b/deps/openssl/openssl/crypto/LPdir_nyi.c @@ -1,6 +1,3 @@ -/* - * $LP: LPlib/source/LPdir_win.c,v 1.1 2004/06/14 10:07:56 _cvs_levitte Exp $ - */ /* * Copyright (c) 2004, Richard Levitte * All rights reserved. diff --git a/deps/openssl/openssl/crypto/LPdir_unix.c b/deps/openssl/openssl/crypto/LPdir_unix.c index bead6abd71563b..c97e260492b9d5 100644 --- a/deps/openssl/openssl/crypto/LPdir_unix.c +++ b/deps/openssl/openssl/crypto/LPdir_unix.c @@ -1,7 +1,3 @@ -/* - * $LP: LPlib/source/LPdir_unix.c,v 1.11 2004/09/23 22:07:22 _cvs_levitte Exp - * $ - */ /* * Copyright (c) 2004, Richard Levitte * All rights reserved. diff --git a/deps/openssl/openssl/crypto/LPdir_win32.c b/deps/openssl/openssl/crypto/LPdir_win32.c index b1c983d87f13cd..84f61117b8dc43 100644 --- a/deps/openssl/openssl/crypto/LPdir_win32.c +++ b/deps/openssl/openssl/crypto/LPdir_win32.c @@ -1,7 +1,3 @@ -/* - * $LP: LPlib/source/LPdir_win32.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp - * $ - */ /* * Copyright (c) 2004, Richard Levitte * All rights reserved. diff --git a/deps/openssl/openssl/crypto/LPdir_wince.c b/deps/openssl/openssl/crypto/LPdir_wince.c index ae8a56f4be8983..a8377f30f403b4 100644 --- a/deps/openssl/openssl/crypto/LPdir_wince.c +++ b/deps/openssl/openssl/crypto/LPdir_wince.c @@ -1,7 +1,3 @@ -/* - * $LP: LPlib/source/LPdir_wince.c,v 1.3 2004/08/26 13:36:05 _cvs_levitte Exp - * $ - */ /* * Copyright (c) 2004, Richard Levitte * All rights reserved. diff --git a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl index fcc81d1a493374..83343e2de1af7b 100644 --- a/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl +++ b/deps/openssl/openssl/crypto/aes/asm/bsaes-armv7.pl @@ -1797,8 +1797,6 @@ sub bitslice_key { b .Lxts_enc_done .align 4 .Lxts_enc_6: - vst1.64 {@XMM[14]}, [r0,:128] @ next round tweak - veor @XMM[4], @XMM[4], @XMM[12] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1834,8 +1832,6 @@ sub bitslice_key { .align 5 .Lxts_enc_5: - vst1.64 {@XMM[13]}, [r0,:128] @ next round tweak - veor @XMM[3], @XMM[3], @XMM[11] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1864,8 +1860,6 @@ sub bitslice_key { b .Lxts_enc_done .align 4 .Lxts_enc_4: - vst1.64 {@XMM[12]}, [r0,:128] @ next round tweak - veor @XMM[2], @XMM[2], @XMM[10] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1891,8 +1885,6 @@ sub bitslice_key { b .Lxts_enc_done .align 4 .Lxts_enc_3: - vst1.64 {@XMM[11]}, [r0,:128] @ next round tweak - veor @XMM[1], @XMM[1], @XMM[9] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1917,8 +1909,6 @@ sub bitslice_key { b .Lxts_enc_done .align 4 .Lxts_enc_2: - vst1.64 {@XMM[10]}, [r0,:128] @ next round tweak - veor @XMM[0], @XMM[0], @XMM[8] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -1941,7 +1931,7 @@ sub bitslice_key { .align 4 .Lxts_enc_1: mov r0, sp - veor @XMM[0], @XMM[8] + veor @XMM[0], @XMM[0], @XMM[8] mov r1, sp vst1.8 {@XMM[0]}, [sp,:128] mov r2, $key @@ -2251,8 +2241,6 @@ sub bitslice_key { b .Lxts_dec_done .align 4 .Lxts_dec_5: - vst1.64 {@XMM[13]}, [r0,:128] @ next round tweak - veor @XMM[3], @XMM[3], @XMM[11] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2281,8 +2269,6 @@ sub bitslice_key { b .Lxts_dec_done .align 4 .Lxts_dec_4: - vst1.64 {@XMM[12]}, [r0,:128] @ next round tweak - veor @XMM[2], @XMM[2], @XMM[10] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2308,8 +2294,6 @@ sub bitslice_key { b .Lxts_dec_done .align 4 .Lxts_dec_3: - vst1.64 {@XMM[11]}, [r0,:128] @ next round tweak - veor @XMM[1], @XMM[1], @XMM[9] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2334,8 +2318,6 @@ sub bitslice_key { b .Lxts_dec_done .align 4 .Lxts_dec_2: - vst1.64 {@XMM[10]}, [r0,:128] @ next round tweak - veor @XMM[0], @XMM[0], @XMM[8] #ifndef BSAES_ASM_EXTENDED_KEY add r4, sp, #0x90 @ pass key schedule @@ -2358,12 +2340,12 @@ sub bitslice_key { .align 4 .Lxts_dec_1: mov r0, sp - veor @XMM[0], @XMM[8] + veor @XMM[0], @XMM[0], @XMM[8] mov r1, sp vst1.8 {@XMM[0]}, [sp,:128] + mov r5, $magic @ preserve magic mov r2, $key mov r4, $fp @ preserve fp - mov r5, $magic @ preserve magic bl AES_decrypt diff --git a/deps/openssl/openssl/crypto/asn1/a_bytes.c b/deps/openssl/openssl/crypto/asn1/a_bytes.c index 385b53986a2991..65e5394664a4b6 100644 --- a/deps/openssl/openssl/crypto/asn1/a_bytes.c +++ b/deps/openssl/openssl/crypto/asn1/a_bytes.c @@ -60,7 +60,12 @@ #include "cryptlib.h" #include -static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c); +static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c, + int depth); +static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a, + const unsigned char **pp, long length, + int Ptag, int Pclass, int depth, + int *perr); /* * type is a 'bitmap' of acceptable string types. */ @@ -99,7 +104,7 @@ ASN1_STRING *d2i_ASN1_type_bytes(ASN1_STRING **a, const unsigned char **pp, ret = (*a); if (len != 0) { - s = (unsigned char *)OPENSSL_malloc((int)len + 1); + s = OPENSSL_malloc((int)len + 1); if (s == NULL) { i = ERR_R_MALLOC_FAILURE; goto err; @@ -154,15 +159,38 @@ int i2d_ASN1_bytes(ASN1_STRING *a, unsigned char **pp, int tag, int xclass) return (r); } +/* + * Maximum recursion depth of d2i_ASN1_bytes(): much more than should be + * encountered in pratice. + */ + +#define ASN1_BYTES_MAXDEPTH 20 + ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, long length, int Ptag, int Pclass) +{ + int err = 0; + ASN1_STRING *s = int_d2i_ASN1_bytes(a, pp, length, Ptag, Pclass, 0, &err); + if (err != 0) + ASN1err(ASN1_F_D2I_ASN1_BYTES, err); + return s; +} + +static ASN1_STRING *int_d2i_ASN1_bytes(ASN1_STRING **a, + const unsigned char **pp, long length, + int Ptag, int Pclass, + int depth, int *perr) { ASN1_STRING *ret = NULL; const unsigned char *p; unsigned char *s; long len; int inf, tag, xclass; - int i = 0; + + if (depth > ASN1_BYTES_MAXDEPTH) { + *perr = ASN1_R_NESTED_ASN1_STRING; + return NULL; + } if ((a == NULL) || ((*a) == NULL)) { if ((ret = ASN1_STRING_new()) == NULL) @@ -173,18 +201,19 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, p = *pp; inf = ASN1_get_object(&p, &len, &tag, &xclass, length); if (inf & 0x80) { - i = ASN1_R_BAD_OBJECT_HEADER; + *perr = ASN1_R_BAD_OBJECT_HEADER; goto err; } if (tag != Ptag) { - i = ASN1_R_WRONG_TAG; + *perr = ASN1_R_WRONG_TAG; goto err; } if (inf & V_ASN1_CONSTRUCTED) { ASN1_const_CTX c; + c.error = 0; c.pp = pp; c.p = p; c.inf = inf; @@ -192,17 +221,18 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, c.tag = Ptag; c.xclass = Pclass; c.max = (length == 0) ? 0 : (p + length); - if (!asn1_collate_primitive(ret, &c)) + if (!asn1_collate_primitive(ret, &c, depth)) { + *perr = c.error; goto err; - else { + } else { p = c.p; } } else { if (len != 0) { if ((ret->length < len) || (ret->data == NULL)) { - s = (unsigned char *)OPENSSL_malloc((int)len + 1); + s = OPENSSL_malloc((int)len + 1); if (s == NULL) { - i = ERR_R_MALLOC_FAILURE; + *perr = ERR_R_MALLOC_FAILURE; goto err; } if (ret->data != NULL) @@ -230,7 +260,6 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, err: if ((ret != NULL) && ((a == NULL) || (*a != ret))) ASN1_STRING_free(ret); - ASN1err(ASN1_F_D2I_ASN1_BYTES, i); return (NULL); } @@ -242,7 +271,8 @@ ASN1_STRING *d2i_ASN1_bytes(ASN1_STRING **a, const unsigned char **pp, * There have been a few bug fixes for this function from Paul Keogh * , many thanks to him */ -static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) +static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c, + int depth) { ASN1_STRING *os = NULL; BUF_MEM b; @@ -270,9 +300,8 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) } c->q = c->p; - if (d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass) - == NULL) { - c->error = ERR_R_ASN1_LIB; + if (int_d2i_ASN1_bytes(&os, &c->p, c->max - c->p, c->tag, c->xclass, + depth + 1, &c->error) == NULL) { goto err; } @@ -297,7 +326,6 @@ static int asn1_collate_primitive(ASN1_STRING *a, ASN1_const_CTX *c) ASN1_STRING_free(os); return (1); err: - ASN1err(ASN1_F_ASN1_COLLATE_PRIMITIVE, c->error); if (os != NULL) ASN1_STRING_free(os); if (b.data != NULL) diff --git a/deps/openssl/openssl/crypto/asn1/a_object.c b/deps/openssl/openssl/crypto/asn1/a_object.c index 27f9c1691462b6..229a40ffa34447 100644 --- a/deps/openssl/openssl/crypto/asn1/a_object.c +++ b/deps/openssl/openssl/crypto/asn1/a_object.c @@ -73,7 +73,7 @@ int i2d_ASN1_OBJECT(ASN1_OBJECT *a, unsigned char **pp) return (0); objsize = ASN1_object_size(0, a->length, V_ASN1_OBJECT); - if (pp == NULL) + if (pp == NULL || objsize == -1) return objsize; p = *pp; @@ -174,8 +174,12 @@ int a2d_ASN1_OBJECT(unsigned char *out, int olen, const char *buf, int num) if (!tmp) goto err; } - while (blsize--) - tmp[i++] = (unsigned char)BN_div_word(bl, 0x80L); + while (blsize--) { + BN_ULONG t = BN_div_word(bl, 0x80L); + if (t == (BN_ULONG)-1) + goto err; + tmp[i++] = (unsigned char)t; + } } else { for (;;) { diff --git a/deps/openssl/openssl/crypto/asn1/a_set.c b/deps/openssl/openssl/crypto/asn1/a_set.c index bf3f9718892643..5fb58655757dfd 100644 --- a/deps/openssl/openssl/crypto/asn1/a_set.c +++ b/deps/openssl/openssl/crypto/asn1/a_set.c @@ -57,6 +57,7 @@ */ #include +#include #include "cryptlib.h" #include @@ -98,10 +99,14 @@ int i2d_ASN1_SET(STACK_OF(OPENSSL_BLOCK) *a, unsigned char **pp, if (a == NULL) return (0); - for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) + for (i = sk_OPENSSL_BLOCK_num(a) - 1; i >= 0; i--) { + int tmplen = i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + if (tmplen > INT_MAX - ret) + return -1; ret += i2d(sk_OPENSSL_BLOCK_value(a, i), NULL); + } r = ASN1_object_size(1, ret, ex_tag); - if (pp == NULL) + if (pp == NULL || r == -1) return (r); p = *pp; diff --git a/deps/openssl/openssl/crypto/asn1/a_strex.c b/deps/openssl/openssl/crypto/asn1/a_strex.c index 35fd44cd22b8e7..2d562f93452f1d 100644 --- a/deps/openssl/openssl/crypto/asn1/a_strex.c +++ b/deps/openssl/openssl/crypto/asn1/a_strex.c @@ -337,7 +337,7 @@ static const signed char tag2nbyte[] = { -1, -1, -1, -1, -1, /* 5-9 */ -1, -1, 0, -1, /* 10-13 */ -1, -1, -1, -1, /* 15-17 */ - -1, 1, 1, /* 18-20 */ + 1, 1, 1, /* 18-20 */ -1, 1, 1, 1, /* 21-24 */ -1, 1, -1, /* 25-27 */ 4, -1, 2 /* 28-30 */ diff --git a/deps/openssl/openssl/crypto/asn1/a_strnid.c b/deps/openssl/openssl/crypto/asn1/a_strnid.c index 52243453689aa2..2d2303d8599e7a 100644 --- a/deps/openssl/openssl/crypto/asn1/a_strnid.c +++ b/deps/openssl/openssl/crypto/asn1/a_strnid.c @@ -250,6 +250,7 @@ int ASN1_STRING_TABLE_add(int nid, } tmp->flags = flags | STABLE_FLAGS_MALLOC; tmp->nid = nid; + tmp->minsize = tmp->maxsize = -1; new_nid = 1; } else tmp->flags = (tmp->flags & STABLE_FLAGS_MALLOC) | flags; diff --git a/deps/openssl/openssl/crypto/asn1/ameth_lib.c b/deps/openssl/openssl/crypto/asn1/ameth_lib.c index 5389c0434740a5..43ddebba33a6a4 100644 --- a/deps/openssl/openssl/crypto/asn1/ameth_lib.c +++ b/deps/openssl/openssl/crypto/asn1/ameth_lib.c @@ -93,7 +93,9 @@ static const EVP_PKEY_ASN1_METHOD *standard_methods[] = { &eckey_asn1_meth, #endif &hmac_asn1_meth, +#ifndef OPENSSL_NO_CMAC &cmac_asn1_meth, +#endif #ifndef OPENSSL_NO_DH &dhx_asn1_meth #endif diff --git a/deps/openssl/openssl/crypto/asn1/asn1_lib.c b/deps/openssl/openssl/crypto/asn1/asn1_lib.c index 874b1af8b09a41..e63e82a8b47626 100644 --- a/deps/openssl/openssl/crypto/asn1/asn1_lib.c +++ b/deps/openssl/openssl/crypto/asn1/asn1_lib.c @@ -256,26 +256,30 @@ static void asn1_put_length(unsigned char **pp, int length) int ASN1_object_size(int constructed, int length, int tag) { - int ret; - - ret = length; - ret++; + int ret = 1; + if (length < 0) + return -1; if (tag >= 31) { while (tag > 0) { tag >>= 7; ret++; } } - if (constructed == 2) - return ret + 3; - ret++; - if (length > 127) { - while (length > 0) { - length >>= 8; - ret++; + if (constructed == 2) { + ret += 3; + } else { + ret++; + if (length > 127) { + int tmplen = length; + while (tmplen > 0) { + tmplen >>= 8; + ret++; + } } } - return (ret); + if (ret >= INT_MAX - length) + return -1; + return ret + length; } static int _asn1_Finish(ASN1_const_CTX *c) @@ -324,7 +328,7 @@ int asn1_GetSequence(ASN1_const_CTX *c, long *length) return (0); } if (c->inf == (1 | V_ASN1_CONSTRUCTED)) - c->slen = *length + *(c->pp) - c->p; + c->slen = *length; c->eos = 0; return (1); } @@ -366,7 +370,7 @@ int ASN1_STRING_set(ASN1_STRING *str, const void *_data, int len) else len = strlen(data); } - if ((str->length < len) || (str->data == NULL)) { + if ((str->length <= len) || (str->data == NULL)) { c = str->data; if (c == NULL) str->data = OPENSSL_malloc(len + 1); diff --git a/deps/openssl/openssl/crypto/asn1/asn_mime.c b/deps/openssl/openssl/crypto/asn1/asn_mime.c index 96110c540f3dba..5170906c62da50 100644 --- a/deps/openssl/openssl/crypto/asn1/asn_mime.c +++ b/deps/openssl/openssl/crypto/asn1/asn_mime.c @@ -289,7 +289,7 @@ int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags, if ((flags & SMIME_DETACHED) && data) { /* We want multipart/signed */ /* Generate a random boundary */ - if (RAND_pseudo_bytes((unsigned char *)bound, 32) < 0) + if (RAND_bytes((unsigned char *)bound, 32) <= 0) return 0; for (i = 0; i < 32; i++) { c = bound[i] & 0xf; @@ -623,6 +623,8 @@ static int multi_split(BIO *bio, char *bound, STACK_OF(BIO) **ret) if (bpart) sk_BIO_push(parts, bpart); bpart = BIO_new(BIO_s_mem()); + if (bpart == NULL) + return 1; BIO_set_mem_eof_return(bpart, 0); } else if (eol) BIO_write(bpart, "\r\n", 2); diff --git a/deps/openssl/openssl/crypto/asn1/bio_asn1.c b/deps/openssl/openssl/crypto/asn1/bio_asn1.c index 60189b3b2c535b..c3afff69dc7e72 100644 --- a/deps/openssl/openssl/crypto/asn1/bio_asn1.c +++ b/deps/openssl/openssl/crypto/asn1/bio_asn1.c @@ -170,10 +170,12 @@ static int asn1_bio_init(BIO_ASN1_BUF_CTX *ctx, int size) ctx->copylen = 0; ctx->asn1_class = V_ASN1_UNIVERSAL; ctx->asn1_tag = V_ASN1_OCTET_STRING; - ctx->ex_buf = 0; - ctx->ex_pos = 0; + ctx->ex_buf = NULL; ctx->ex_len = 0; + ctx->ex_pos = 0; ctx->state = ASN1_STATE_START; + ctx->prefix = ctx->prefix_free = ctx->suffix = ctx->suffix_free = NULL; + ctx->ex_arg = NULL; return 1; } diff --git a/deps/openssl/openssl/crypto/asn1/bio_ndef.c b/deps/openssl/openssl/crypto/asn1/bio_ndef.c index 31949b87940fa5..8d7046633cfe74 100644 --- a/deps/openssl/openssl/crypto/asn1/bio_ndef.c +++ b/deps/openssl/openssl/crypto/asn1/bio_ndef.c @@ -136,6 +136,7 @@ BIO *BIO_new_NDEF(BIO *out, ASN1_VALUE *val, const ASN1_ITEM *it) ndef_aux->ndef_bio = sarg.ndef_bio; ndef_aux->boundary = sarg.boundary; ndef_aux->out = out; + ndef_aux->derbuf = NULL; BIO_ctrl(asn_bio, BIO_C_SET_EX_ARG, 0, ndef_aux); diff --git a/deps/openssl/openssl/crypto/asn1/charmap.pl b/deps/openssl/openssl/crypto/asn1/charmap.pl index 25ebf2c205d077..12ac34ad742332 100644 --- a/deps/openssl/openssl/crypto/asn1/charmap.pl +++ b/deps/openssl/openssl/crypto/asn1/charmap.pl @@ -67,17 +67,19 @@ # Now generate the C code print <ameth->old_priv_decode || !ret->ameth->old_priv_decode(ret, &p, length)) { if (ret->ameth->priv_decode) { + EVP_PKEY *tmp; PKCS8_PRIV_KEY_INFO *p8 = NULL; p8 = d2i_PKCS8_PRIV_KEY_INFO(NULL, &p, length); if (!p8) goto err; - EVP_PKEY_free(ret); - ret = EVP_PKCS82PKEY(p8); + tmp = EVP_PKCS82PKEY(p8); PKCS8_PRIV_KEY_INFO_free(p8); - if (ret == NULL) + if (tmp == NULL) goto err; + EVP_PKEY_free(ret); + ret = tmp; } else { ASN1err(ASN1_F_D2I_PRIVATEKEY, ERR_R_ASN1_LIB); goto err; diff --git a/deps/openssl/openssl/crypto/asn1/f_enum.c b/deps/openssl/openssl/crypto/asn1/f_enum.c index 591c3b578127de..94cd54dbeedd3a 100644 --- a/deps/openssl/openssl/crypto/asn1/f_enum.c +++ b/deps/openssl/openssl/crypto/asn1/f_enum.c @@ -160,8 +160,6 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -199,5 +197,7 @@ int a2i_ASN1_ENUMERATED(BIO *bp, ASN1_ENUMERATED *bs, char *buf, int size) err_sl: ASN1err(ASN1_F_A2I_ASN1_ENUMERATED, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } diff --git a/deps/openssl/openssl/crypto/asn1/f_int.c b/deps/openssl/openssl/crypto/asn1/f_int.c index 4a81f81c8832c0..2bdc78d74491ce 100644 --- a/deps/openssl/openssl/crypto/asn1/f_int.c +++ b/deps/openssl/openssl/crypto/asn1/f_int.c @@ -172,8 +172,6 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) sp = OPENSSL_realloc_clean(s, slen, num + i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_INTEGER, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -211,5 +209,7 @@ int a2i_ASN1_INTEGER(BIO *bp, ASN1_INTEGER *bs, char *buf, int size) err_sl: ASN1err(ASN1_F_A2I_ASN1_INTEGER, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } diff --git a/deps/openssl/openssl/crypto/asn1/f_string.c b/deps/openssl/openssl/crypto/asn1/f_string.c index 6a6cf3471408b2..0f7b9cfb119b5e 100644 --- a/deps/openssl/openssl/crypto/asn1/f_string.c +++ b/deps/openssl/openssl/crypto/asn1/f_string.c @@ -166,8 +166,6 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) i * 2); if (sp == NULL) { ASN1err(ASN1_F_A2I_ASN1_STRING, ERR_R_MALLOC_FAILURE); - if (s != NULL) - OPENSSL_free(s); goto err; } s = sp; @@ -205,5 +203,7 @@ int a2i_ASN1_STRING(BIO *bp, ASN1_STRING *bs, char *buf, int size) err_sl: ASN1err(ASN1_F_A2I_ASN1_STRING, ASN1_R_SHORT_LINE); } + if (ret != 1) + OPENSSL_free(s); return (ret); } diff --git a/deps/openssl/openssl/crypto/asn1/i2d_pr.c b/deps/openssl/openssl/crypto/asn1/i2d_pr.c index 4d338ac55aed4e..12966ec536e1a6 100644 --- a/deps/openssl/openssl/crypto/asn1/i2d_pr.c +++ b/deps/openssl/openssl/crypto/asn1/i2d_pr.c @@ -69,10 +69,13 @@ int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp) } if (a->ameth && a->ameth->priv_encode) { PKCS8_PRIV_KEY_INFO *p8 = EVP_PKEY2PKCS8(a); - int ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp); - PKCS8_PRIV_KEY_INFO_free(p8); + int ret = 0; + if (p8 != NULL) { + ret = i2d_PKCS8_PRIV_KEY_INFO(p8, pp); + PKCS8_PRIV_KEY_INFO_free(p8); + } return ret; } ASN1err(ASN1_F_I2D_PRIVATEKEY, ASN1_R_UNSUPPORTED_PUBLIC_KEY_TYPE); - return (-1); + return -1; } diff --git a/deps/openssl/openssl/crypto/asn1/p5_pbe.c b/deps/openssl/openssl/crypto/asn1/p5_pbe.c index bdbfdcd67c0727..e2a1def53f1db4 100644 --- a/deps/openssl/openssl/crypto/asn1/p5_pbe.c +++ b/deps/openssl/openssl/crypto/asn1/p5_pbe.c @@ -101,7 +101,7 @@ int PKCS5_pbe_set0_algor(X509_ALGOR *algor, int alg, int iter, sstr = ASN1_STRING_data(pbe->salt); if (salt) memcpy(sstr, salt, saltlen); - else if (RAND_pseudo_bytes(sstr, saltlen) < 0) + else if (RAND_bytes(sstr, saltlen) <= 0) goto err; if (!ASN1_item_pack(pbe, ASN1_ITEM_rptr(PBEPARAM), &pbe_str)) { diff --git a/deps/openssl/openssl/crypto/asn1/p5_pbev2.c b/deps/openssl/openssl/crypto/asn1/p5_pbev2.c index 73ba4a3d67aaa4..388053e0a1bfd5 100644 --- a/deps/openssl/openssl/crypto/asn1/p5_pbev2.c +++ b/deps/openssl/openssl/crypto/asn1/p5_pbev2.c @@ -120,7 +120,7 @@ X509_ALGOR *PKCS5_pbe2_set_iv(const EVP_CIPHER *cipher, int iter, if (EVP_CIPHER_iv_length(cipher)) { if (aiv) memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); - else if (RAND_pseudo_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) + else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0) goto err; } @@ -225,7 +225,7 @@ X509_ALGOR *PKCS5_pbkdf2_set(int iter, unsigned char *salt, int saltlen, if (salt) memcpy(osalt->data, salt, saltlen); - else if (RAND_pseudo_bytes(osalt->data, saltlen) < 0) + else if (RAND_bytes(osalt->data, saltlen) <= 0) goto merr; if (iter <= 0) diff --git a/deps/openssl/openssl/crypto/asn1/t_req.c b/deps/openssl/openssl/crypto/asn1/t_req.c index 024553ab196fe7..70aba4cc3b3bb2 100644 --- a/deps/openssl/openssl/crypto/asn1/t_req.c +++ b/deps/openssl/openssl/crypto/asn1/t_req.c @@ -196,6 +196,7 @@ int X509_REQ_print_ex(BIO *bp, X509_REQ *x, unsigned long nmflags, if (BIO_puts(bp, ":") <= 0) goto err; if ((type == V_ASN1_PRINTABLESTRING) || + (type == V_ASN1_UTF8STRING) || (type == V_ASN1_T61STRING) || (type == V_ASN1_IA5STRING)) { if (BIO_write(bp, (char *)bs->data, bs->length) diff --git a/deps/openssl/openssl/crypto/asn1/tasn_dec.c b/deps/openssl/openssl/crypto/asn1/tasn_dec.c index 6bdcd5c542ca56..d25402730b8b9d 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_dec.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_dec.c @@ -400,7 +400,9 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, if (tt->flags & ASN1_TFLG_ADB_MASK) { const ASN1_TEMPLATE *seqtt; ASN1_VALUE **pseqval; - seqtt = asn1_do_adb(pval, tt, 1); + seqtt = asn1_do_adb(pval, tt, 0); + if (seqtt == NULL) + continue; pseqval = asn1_get_field_ptr(pval, seqtt); ASN1_template_free(pseqval, seqtt); } @@ -411,7 +413,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, const ASN1_TEMPLATE *seqtt; ASN1_VALUE **pseqval; seqtt = asn1_do_adb(pval, tt, 1); - if (!seqtt) + if (seqtt == NULL) goto err; pseqval = asn1_get_field_ptr(pval, seqtt); /* Have we ran out of data? */ @@ -476,7 +478,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len, for (; i < it->tcount; tt++, i++) { const ASN1_TEMPLATE *seqtt; seqtt = asn1_do_adb(pval, tt, 1); - if (!seqtt) + if (seqtt == NULL) goto err; if (seqtt->flags & ASN1_TFLG_OPTIONAL) { ASN1_VALUE **pseqval; diff --git a/deps/openssl/openssl/crypto/asn1/tasn_enc.c b/deps/openssl/openssl/crypto/asn1/tasn_enc.c index f7f83e56a98140..081a9d534f8aa7 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_enc.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_enc.c @@ -59,6 +59,7 @@ #include #include +#include #include "cryptlib.h" #include #include @@ -216,17 +217,19 @@ int ASN1_item_ex_i2d(ASN1_VALUE **pval, unsigned char **out, for (i = 0, tt = it->templates; i < it->tcount; tt++, i++) { const ASN1_TEMPLATE *seqtt; ASN1_VALUE **pseqval; + int tmplen; seqtt = asn1_do_adb(pval, tt, 1); if (!seqtt) return 0; pseqval = asn1_get_field_ptr(pval, seqtt); - /* FIXME: check for errors in enhanced version */ - seqcontlen += asn1_template_ex_i2d(pseqval, NULL, seqtt, - -1, aclass); + tmplen = asn1_template_ex_i2d(pseqval, NULL, seqtt, -1, aclass); + if (tmplen == -1 || (tmplen > INT_MAX - seqcontlen)) + return -1; + seqcontlen += tmplen; } seqlen = ASN1_object_size(ndef, seqcontlen, tag); - if (!out) + if (!out || seqlen == -1) return seqlen; /* Output SEQUENCE header */ ASN1_put_object(out, ndef, seqcontlen, tag, aclass); @@ -339,19 +342,24 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, /* Determine total length of items */ skcontlen = 0; for (i = 0; i < sk_ASN1_VALUE_num(sk); i++) { + int tmplen; skitem = sk_ASN1_VALUE_value(sk, i); - skcontlen += ASN1_item_ex_i2d(&skitem, NULL, - ASN1_ITEM_ptr(tt->item), - -1, iclass); + tmplen = ASN1_item_ex_i2d(&skitem, NULL, ASN1_ITEM_ptr(tt->item), + -1, iclass); + if (tmplen == -1 || (skcontlen > INT_MAX - tmplen)) + return -1; + skcontlen += tmplen; } sklen = ASN1_object_size(ndef, skcontlen, sktag); + if (sklen == -1) + return -1; /* If EXPLICIT need length of surrounding tag */ if (flags & ASN1_TFLG_EXPTAG) ret = ASN1_object_size(ndef, sklen, ttag); else ret = sklen; - if (!out) + if (!out || ret == -1) return ret; /* Now encode this lot... */ @@ -380,7 +388,7 @@ static int asn1_template_ex_i2d(ASN1_VALUE **pval, unsigned char **out, return 0; /* Find length of EXPLICIT tag */ ret = ASN1_object_size(ndef, i, ttag); - if (out) { + if (out && ret != -1) { /* Output tag and item */ ASN1_put_object(out, ndef, i, ttag, tclass); ASN1_item_ex_i2d(pval, out, ASN1_ITEM_ptr(tt->item), -1, iclass); diff --git a/deps/openssl/openssl/crypto/asn1/tasn_prn.c b/deps/openssl/openssl/crypto/asn1/tasn_prn.c index 5e7d53e9854a6d..f628caddbd05fd 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_prn.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_prn.c @@ -204,7 +204,8 @@ static int asn1_item_print_ctx(BIO *out, ASN1_VALUE **fld, int indent, } else asn1_cb = 0; - if (*fld == NULL) { + if (((it->itype != ASN1_ITYPE_PRIMITIVE) + || (it->utype != V_ASN1_BOOLEAN)) && *fld == NULL) { if (pctx->flags & ASN1_PCTX_FLAGS_SHOW_ABSENT) { if (!nohdr && !asn1_print_fsname(out, indent, fname, sname, pctx)) return 0; @@ -446,6 +447,8 @@ static int asn1_print_integer_ctx(BIO *out, ASN1_INTEGER *str, char *s; int ret = 1; s = i2s_ASN1_INTEGER(NULL, str); + if (s == NULL) + return 0; if (BIO_puts(out, s) <= 0) ret = 0; OPENSSL_free(s); @@ -496,11 +499,16 @@ static int asn1_primitive_print(BIO *out, ASN1_VALUE **fld, return 0; if (pf && pf->prim_print) return pf->prim_print(out, fld, it, indent, pctx); - str = (ASN1_STRING *)*fld; - if (it->itype == ASN1_ITYPE_MSTRING) + if (it->itype == ASN1_ITYPE_MSTRING) { + str = (ASN1_STRING *)*fld; utype = str->type & ~V_ASN1_NEG; - else + } else { utype = it->utype; + if (utype == V_ASN1_BOOLEAN) + str = NULL; + else + str = (ASN1_STRING *)*fld; + } if (utype == V_ASN1_ANY) { ASN1_TYPE *atype = (ASN1_TYPE *)*fld; utype = atype->type; diff --git a/deps/openssl/openssl/crypto/asn1/tasn_utl.c b/deps/openssl/openssl/crypto/asn1/tasn_utl.c index 41726d8feb4e39..e14889feb1569d 100644 --- a/deps/openssl/openssl/crypto/asn1/tasn_utl.c +++ b/deps/openssl/openssl/crypto/asn1/tasn_utl.c @@ -234,7 +234,7 @@ const ASN1_TEMPLATE *asn1_do_adb(ASN1_VALUE **pval, const ASN1_TEMPLATE *tt, sfld = offset2ptr(*pval, adb->offset); /* Check if NULL */ - if (!sfld) { + if (*sfld == NULL) { if (!adb->null_tt) goto err; return adb->null_tt; diff --git a/deps/openssl/openssl/crypto/asn1/x_bignum.c b/deps/openssl/openssl/crypto/asn1/x_bignum.c index eaf046639d6a20..c644199c9f81e5 100644 --- a/deps/openssl/openssl/crypto/asn1/x_bignum.c +++ b/deps/openssl/openssl/crypto/asn1/x_bignum.c @@ -78,6 +78,8 @@ static int bn_i2c(ASN1_VALUE **pval, unsigned char *cont, int *putype, const ASN1_ITEM *it); static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, int utype, char *free_cont, const ASN1_ITEM *it); +static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, + int indent, const ASN1_PCTX *pctx); static ASN1_PRIMITIVE_FUNCS bignum_pf = { NULL, 0, @@ -85,7 +87,8 @@ static ASN1_PRIMITIVE_FUNCS bignum_pf = { bn_free, 0, bn_c2i, - bn_i2c + bn_i2c, + bn_print }; ASN1_ITEM_start(BIGNUM) @@ -151,3 +154,13 @@ static int bn_c2i(ASN1_VALUE **pval, const unsigned char *cont, int len, } return 1; } + +static int bn_print(BIO *out, ASN1_VALUE **pval, const ASN1_ITEM *it, + int indent, const ASN1_PCTX *pctx) +{ + if (!BN_print(out, *(BIGNUM **)pval)) + return 0; + if (BIO_puts(out, "\n") <= 0) + return 0; + return 1; +} diff --git a/deps/openssl/openssl/crypto/asn1/x_name.c b/deps/openssl/openssl/crypto/asn1/x_name.c index a858c2993b90f4..26378fdb2a02e1 100644 --- a/deps/openssl/openssl/crypto/asn1/x_name.c +++ b/deps/openssl/openssl/crypto/asn1/x_name.c @@ -199,10 +199,8 @@ static int x509_name_ex_d2i(ASN1_VALUE **val, int i, j, ret; STACK_OF(X509_NAME_ENTRY) *entries; X509_NAME_ENTRY *entry; - if (len > X509_NAME_MAX) { - ASN1err(ASN1_F_X509_NAME_EX_D2I, ASN1_R_TOO_LONG); - return 0; - } + if (len > X509_NAME_MAX) + len = X509_NAME_MAX; q = p; /* Get internal representation of Name */ diff --git a/deps/openssl/openssl/crypto/asn1/x_x509.c b/deps/openssl/openssl/crypto/asn1/x_x509.c index e31e1e750d9db0..aada4a8413f2eb 100644 --- a/deps/openssl/openssl/crypto/asn1/x_x509.c +++ b/deps/openssl/openssl/crypto/asn1/x_x509.c @@ -199,12 +199,26 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) return NULL; } -int i2d_X509_AUX(X509 *a, unsigned char **pp) +/* + * Serialize trusted certificate to *pp or just return the required buffer + * length if pp == NULL. We ultimately want to avoid modifying *pp in the + * error path, but that depends on similar hygiene in lower-level functions. + * Here we avoid compounding the problem. + */ +static int i2d_x509_aux_internal(X509 *a, unsigned char **pp) { int length, tmplen; unsigned char *start = pp != NULL ? *pp : NULL; + + OPENSSL_assert(pp == NULL || *pp != NULL); + + /* + * This might perturb *pp on error, but fixing that belongs in i2d_X509() + * not here. It should be that if a == NULL length is zero, but we check + * both just in case. + */ length = i2d_X509(a, pp); - if (length < 0 || a == NULL) + if (length <= 0 || a == NULL) return length; tmplen = i2d_X509_CERT_AUX(a->aux, pp); @@ -218,6 +232,42 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp) return length; } +/* + * Serialize trusted certificate to *pp, or just return the required buffer + * length if pp == NULL. + * + * When pp is not NULL, but *pp == NULL, we allocate the buffer, but since + * we're writing two ASN.1 objects back to back, we can't have i2d_X509() do + * the allocation, nor can we allow i2d_X509_CERT_AUX() to increment the + * allocated buffer. + */ +int i2d_X509_AUX(X509 *a, unsigned char **pp) +{ + int length; + unsigned char *tmp; + + /* Buffer provided by caller */ + if (pp == NULL || *pp != NULL) + return i2d_x509_aux_internal(a, pp); + + /* Obtain the combined length */ + if ((length = i2d_x509_aux_internal(a, NULL)) <= 0) + return length; + + /* Allocate requisite combined storage */ + *pp = tmp = OPENSSL_malloc(length); + if (tmp == NULL) + return -1; /* Push error onto error stack? */ + + /* Encode, but keep *pp at the originally malloced pointer */ + length = i2d_x509_aux_internal(a, &tmp); + if (length <= 0) { + OPENSSL_free(*pp); + *pp = NULL; + } + return length; +} + int i2d_re_X509_tbs(X509 *x, unsigned char **pp) { x->cert_info->enc.modified = 1; diff --git a/deps/openssl/openssl/crypto/bio/b_print.c b/deps/openssl/openssl/crypto/bio/b_print.c index 90248fa2aabac7..987fe068c6de10 100644 --- a/deps/openssl/openssl/crypto/bio/b_print.c +++ b/deps/openssl/openssl/crypto/bio/b_print.c @@ -423,9 +423,15 @@ _dopr(char **sbuffer, break; } } - *truncated = (currlen > *maxlen - 1); - if (*truncated) - currlen = *maxlen - 1; + /* + * We have to truncate if there is no dynamic buffer and we have filled the + * static buffer. + */ + if (buffer == NULL) { + *truncated = (currlen > *maxlen - 1); + if (*truncated) + currlen = *maxlen - 1; + } if(!doapr_outch(sbuffer, buffer, &currlen, maxlen, '\0')) return 0; *retlen = currlen - 1; diff --git a/deps/openssl/openssl/crypto/bio/bf_nbio.c b/deps/openssl/openssl/crypto/bio/bf_nbio.c index a04f32a0081798..4842bb4c82ffdd 100644 --- a/deps/openssl/openssl/crypto/bio/bf_nbio.c +++ b/deps/openssl/openssl/crypto/bio/bf_nbio.c @@ -139,7 +139,7 @@ static int nbiof_read(BIO *b, char *out, int outl) BIO_clear_retry_flags(b); #if 1 - if (RAND_pseudo_bytes(&n, 1) < 0) + if (RAND_bytes(&n, 1) <= 0) return -1; num = (n & 0x07); @@ -179,7 +179,7 @@ static int nbiof_write(BIO *b, const char *in, int inl) num = nt->lwn; nt->lwn = 0; } else { - if (RAND_pseudo_bytes(&n, 1) < 0) + if (RAND_bytes(&n, 1) <= 0) return -1; num = (n & 7); } diff --git a/deps/openssl/openssl/crypto/bio/bio.h b/deps/openssl/openssl/crypto/bio/bio.h index 6790aed28e0bae..8f2438cdad7018 100644 --- a/deps/openssl/openssl/crypto/bio/bio.h +++ b/deps/openssl/openssl/crypto/bio/bio.h @@ -559,11 +559,11 @@ int BIO_read_filename(BIO *b, const char *name); # define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) # define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) # define BIO_set_ssl_renegotiate_bytes(b,num) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL) # define BIO_get_num_renegotiates(b) \ - BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL); + BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL) # define BIO_set_ssl_renegotiate_timeout(b,seconds) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL) /* defined in evp.h */ /* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ diff --git a/deps/openssl/openssl/crypto/bio/bss_bio.c b/deps/openssl/openssl/crypto/bio/bss_bio.c index 4d8727f8f890cc..3dd818772942c2 100644 --- a/deps/openssl/openssl/crypto/bio/bss_bio.c +++ b/deps/openssl/openssl/crypto/bio/bss_bio.c @@ -149,9 +149,13 @@ static int bio_new(BIO *bio) return 0; b->peer = NULL; + b->closed = 0; + b->len = 0; + b->offset = 0; /* enough for one TLS record (just a default) */ b->size = 17 * 1024; b->buf = NULL; + b->request = 0; bio->ptr = b; return 1; @@ -655,16 +659,15 @@ static long bio_ctrl(BIO *bio, int cmd, long num, void *ptr) break; case BIO_CTRL_EOF: - { - BIO *other_bio = ptr; - - if (other_bio) { - struct bio_bio_st *other_b = other_bio->ptr; + if (b->peer != NULL) { + struct bio_bio_st *peer_b = b->peer->ptr; - assert(other_b != NULL); - ret = other_b->len == 0 && other_b->closed; - } else + if (peer_b->len == 0 && peer_b->closed) ret = 1; + else + ret = 0; + } else { + ret = 1; } break; diff --git a/deps/openssl/openssl/crypto/bio/bss_file.c b/deps/openssl/openssl/crypto/bio/bss_file.c index bfba93e62bbd08..a6e3b3ac0130aa 100644 --- a/deps/openssl/openssl/crypto/bio/bss_file.c +++ b/deps/openssl/openssl/crypto/bio/bss_file.c @@ -174,7 +174,11 @@ BIO *BIO_new_file(const char *filename, const char *mode) if (file == NULL) { SYSerr(SYS_F_FOPEN, get_last_sys_error()); ERR_add_error_data(5, "fopen('", filename, "','", mode, "')"); - if (errno == ENOENT) + if (errno == ENOENT +# ifdef ENXIO + || errno == ENXIO +# endif + ) BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); else BIOerr(BIO_F_BIO_NEW_FILE, ERR_R_SYS_LIB); diff --git a/deps/openssl/openssl/crypto/bio/bss_rtcp.c b/deps/openssl/openssl/crypto/bio/bss_rtcp.c index 09f14f48dc03ad..5c98a8234d4274 100644 --- a/deps/openssl/openssl/crypto/bio/bss_rtcp.c +++ b/deps/openssl/openssl/crypto/bio/bss_rtcp.c @@ -170,6 +170,8 @@ static int rtcp_new(BIO *bi) bi->num = 0; bi->flags = 0; bi->ptr = OPENSSL_malloc(sizeof(struct rpc_ctx)); + if (bi->ptr == NULL) + return (0); ctx = (struct rpc_ctx *)bi->ptr; ctx->filled = 0; ctx->pos = 0; diff --git a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl index 89f4de61e8964f..1c4003efc20a79 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86-mont.pl @@ -63,27 +63,26 @@ &lea ("esi",&wparam(0)); # put aside pointer to argument block &lea ("edx",&wparam(1)); # load ap - &mov ("ebp","esp"); # saved stack pointer! &add ("edi",2); # extra two words on top of tp &neg ("edi"); - &lea ("esp",&DWP(-$frame,"esp","edi",4)); # alloca($frame+4*(num+2)) + &lea ("ebp",&DWP(-$frame,"esp","edi",4)); # future alloca($frame+4*(num+2)) &neg ("edi"); # minimize cache contention by arraning 2K window between stack # pointer and ap argument [np is also position sensitive vector, # but it's assumed to be near ap, as it's allocated at ~same # time]. - &mov ("eax","esp"); + &mov ("eax","ebp"); &sub ("eax","edx"); &and ("eax",2047); - &sub ("esp","eax"); # this aligns sp and ap modulo 2048 + &sub ("ebp","eax"); # this aligns sp and ap modulo 2048 - &xor ("edx","esp"); + &xor ("edx","ebp"); &and ("edx",2048); &xor ("edx",2048); - &sub ("esp","edx"); # this splits them apart modulo 4096 + &sub ("ebp","edx"); # this splits them apart modulo 4096 - &and ("esp",-64); # align to cache line + &and ("ebp",-64); # align to cache line # Some OSes, *cough*-dows, insist on stack being "wired" to # physical memory in strictly sequential manner, i.e. if stack @@ -91,20 +90,28 @@ # be punishable by SEGV. But page walking can do good even on # other OSes, because it guarantees that villain thread hits # the guard page before it can make damage to innocent one... - &mov ("eax","ebp"); - &sub ("eax","esp"); + &mov ("eax","esp"); + &sub ("eax","ebp"); &and ("eax",-4096); -&set_label("page_walk"); - &mov ("edx",&DWP(0,"esp","eax")); - &sub ("eax",4096); - &data_byte(0x2e); - &jnc (&label("page_walk")); + &mov ("edx","esp"); # saved stack pointer! + &lea ("esp",&DWP(0,"ebp","eax")); + &mov ("eax",&DWP(0,"esp")); + &cmp ("esp","ebp"); + &ja (&label("page_walk")); + &jmp (&label("page_walk_done")); + +&set_label("page_walk",16); + &lea ("esp",&DWP(-4096,"esp")); + &mov ("eax",&DWP(0,"esp")); + &cmp ("esp","ebp"); + &ja (&label("page_walk")); +&set_label("page_walk_done"); ################################# load argument block... &mov ("eax",&DWP(0*4,"esi"));# BN_ULONG *rp &mov ("ebx",&DWP(1*4,"esi"));# const BN_ULONG *ap &mov ("ecx",&DWP(2*4,"esi"));# const BN_ULONG *bp - &mov ("edx",&DWP(3*4,"esi"));# const BN_ULONG *np + &mov ("ebp",&DWP(3*4,"esi"));# const BN_ULONG *np &mov ("esi",&DWP(4*4,"esi"));# const BN_ULONG *n0 #&mov ("edi",&DWP(5*4,"esi"));# int num @@ -112,11 +119,11 @@ &mov ($_rp,"eax"); # ... save a copy of argument block &mov ($_ap,"ebx"); &mov ($_bp,"ecx"); - &mov ($_np,"edx"); + &mov ($_np,"ebp"); &mov ($_n0,"esi"); &lea ($num,&DWP(-3,"edi")); # num=num-1 to assist modulo-scheduling #&mov ($_num,$num); # redundant as $num is not reused - &mov ($_sp,"ebp"); # saved stack pointer! + &mov ($_sp,"edx"); # saved stack pointer! if($sse2) { $acc0="mm0"; # mmx register bank layout diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c index d77dc433d40555..1729b479d43ece 100644 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-gcc.c @@ -194,7 +194,7 @@ BN_ULONG bn_div_words(BN_ULONG h, BN_ULONG l, BN_ULONG d) BN_ULONG ret, waste; asm("divq %4":"=a"(ret), "=d"(waste) - : "a"(l), "d"(h), "g"(d) + : "a"(l), "d"(h), "r"(d) : "cc"); return ret; diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl index 8fb6c994e1efb5..044fd7ecc0fdb5 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont.pl @@ -97,6 +97,8 @@ .type bn_mul_mont,\@function,6 .align 16 bn_mul_mont: + mov ${num}d,${num}d + mov %rsp,%rax test \$3,${num}d jnz .Lmul_enter cmp \$8,${num}d @@ -121,29 +123,36 @@ push %r14 push %r15 - mov ${num}d,${num}d - lea 2($num),%r10 + neg $num mov %rsp,%r11 - neg %r10 - lea (%rsp,%r10,8),%rsp # tp=alloca(8*(num+2)) - and \$-1024,%rsp # minimize TLB usage + lea -16(%rsp,$num,8),%r10 # future alloca(8*(num+2)) + neg $num # restore $num + and \$-1024,%r10 # minimize TLB usage - mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp -.Lmul_body: # Some OSes, *cough*-dows, insist on stack being "wired" to # physical memory in strictly sequential manner, i.e. if stack # allocation spans two pages, then reference to farmost one can # be punishable by SEGV. But page walking can do good even on # other OSes, because it guarantees that villain thread hits # the guard page before it can make damage to innocent one... - sub %rsp,%r11 + sub %r10,%r11 and \$-4096,%r11 + lea (%r10,%r11),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done + +.align 16 .Lmul_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x66,0x2e # predict non-taken - jnc .Lmul_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp +.Lmul_body: mov $bp,%r12 # reassign $bp ___ $bp="%r12"; @@ -314,13 +323,13 @@ mov 8(%rsp,$num,8),%rsi # restore %rsp mov \$1,%rax - mov (%rsi),%r15 - mov 8(%rsi),%r14 - mov 16(%rsi),%r13 - mov 24(%rsi),%r12 - mov 32(%rsi),%rbp - mov 40(%rsi),%rbx - lea 48(%rsi),%rsp + mov -48(%rsi),%r15 + mov -40(%rsi),%r14 + mov -32(%rsi),%r13 + mov -24(%rsi),%r12 + mov -16(%rsi),%rbp + mov -8(%rsi),%rbx + lea (%rsi),%rsp .Lmul_epilogue: ret .size bn_mul_mont,.-bn_mul_mont @@ -332,6 +341,8 @@ .type bn_mul4x_mont,\@function,6 .align 16 bn_mul4x_mont: + mov ${num}d,${num}d + mov %rsp,%rax .Lmul4x_enter: ___ $code.=<<___ if ($addx); @@ -347,23 +358,29 @@ push %r14 push %r15 - mov ${num}d,${num}d - lea 4($num),%r10 + neg $num mov %rsp,%r11 - neg %r10 - lea (%rsp,%r10,8),%rsp # tp=alloca(8*(num+4)) - and \$-1024,%rsp # minimize TLB usage + lea -32(%rsp,$num,8),%r10 # future alloca(8*(num+4)) + neg $num # restore + and \$-1024,%r10 # minimize TLB usage - mov %r11,8(%rsp,$num,8) # tp[num+1]=%rsp -.Lmul4x_body: - sub %rsp,%r11 + sub %r10,%r11 and \$-4096,%r11 + lea (%r10,%r11),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lmul4x_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: + mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp +.Lmul4x_body: mov $rp,16(%rsp,$num,8) # tp[num+2]=$rp mov %rdx,%r12 # reassign $bp ___ @@ -742,13 +759,13 @@ $code.=<<___; mov 8(%rsp,$num,8),%rsi # restore %rsp mov \$1,%rax - mov (%rsi),%r15 - mov 8(%rsi),%r14 - mov 16(%rsi),%r13 - mov 24(%rsi),%r12 - mov 32(%rsi),%rbp - mov 40(%rsi),%rbx - lea 48(%rsi),%rsp + mov -48(%rsi),%r15 + mov -40(%rsi),%r14 + mov -32(%rsi),%r13 + mov -24(%rsi),%r12 + mov -16(%rsi),%rbp + mov -8(%rsi),%rbx + lea (%rsi),%rsp .Lmul4x_epilogue: ret .size bn_mul4x_mont,.-bn_mul4x_mont @@ -778,14 +795,15 @@ .type bn_sqr8x_mont,\@function,6 .align 32 bn_sqr8x_mont: -.Lsqr8x_enter: mov %rsp,%rax +.Lsqr8x_enter: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lsqr8x_prologue: mov ${num}d,%r10d shl \$3,${num}d # convert $num to bytes @@ -798,33 +816,42 @@ # do its job. # lea -64(%rsp,$num,2),%r11 + mov %rsp,%rbp mov ($n0),$n0 # *n0 sub $aptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lsqr8x_sp_alt - sub %r11,%rsp # align with $aptr - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + sub %r11,%rbp # align with $aptr + lea -64(%rbp,$num,2),%rbp # future alloca(frame+2*$num) jmp .Lsqr8x_sp_done .align 32 .Lsqr8x_sp_alt: lea 4096-64(,$num,2),%r10 # 4096-frame-2*$num - lea -64(%rsp,$num,2),%rsp # alloca(frame+2*$num) + lea -64(%rbp,$num,2),%rbp # future alloca(frame+2*$num) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lsqr8x_sp_done: - and \$-64,%rsp - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lsqr8x_page_walk + jmp .Lsqr8x_page_walk_done + +.align 16 .Lsqr8x_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lsqr8x_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lsqr8x_page_walk +.Lsqr8x_page_walk_done: mov $num,%r10 neg $num @@ -948,30 +975,38 @@ .type bn_mulx4x_mont,\@function,6 .align 32 bn_mulx4x_mont: -.Lmulx4x_enter: mov %rsp,%rax +.Lmulx4x_enter: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lmulx4x_prologue: shl \$3,${num}d # convert $num to bytes - .byte 0x67 xor %r10,%r10 sub $num,%r10 # -$num mov ($n0),$n0 # *n0 - lea -72(%rsp,%r10),%rsp # alloca(frame+$num+8) - and \$-128,%rsp - mov %rax,%r11 - sub %rsp,%r11 + lea -72(%rsp,%r10),%rbp # future alloca(frame+$num+8) + and \$-128,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmulx4x_page_walk + jmp .Lmulx4x_page_walk_done + +.align 16 .Lmulx4x_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x66,0x2e # predict non-taken - jnc .Lmulx4x_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmulx4x_page_walk +.Lmulx4x_page_walk_done: lea ($bp,$num),%r10 ############################################################## @@ -1332,22 +1367,8 @@ mov 192($context),%r10 # pull $num mov 8(%rax,%r10,8),%rax # pull saved stack pointer - lea 48(%rax),%rax - - mov -8(%rax),%rbx - mov -16(%rax),%rbp - mov -24(%rax),%r12 - mov -32(%rax),%r13 - mov -40(%rax),%r14 - mov -48(%rax),%r15 - mov %rbx,144($context) # restore context->Rbx - mov %rbp,160($context) # restore context->Rbp - mov %r12,216($context) # restore context->R12 - mov %r13,224($context) # restore context->R13 - mov %r14,232($context) # restore context->R14 - mov %r15,240($context) # restore context->R15 - jmp .Lcommon_seh_tail + jmp .Lcommon_pop_regs .size mul_handler,.-mul_handler .type sqr_handler,\@abi-omnipotent @@ -1375,15 +1396,21 @@ cmp %r10,%rbx # context->Rip<.Lsqr_body jb .Lcommon_seh_tail + mov 4(%r11),%r10d # HandlerData[1] + lea (%rsi,%r10),%r10 # body label + cmp %r10,%rbx # context->Rip>=.Lsqr_epilogue + jb .Lcommon_pop_regs + mov 152($context),%rax # pull context->Rsp - mov 4(%r11),%r10d # HandlerData[1] + mov 8(%r11),%r10d # HandlerData[2] lea (%rsi,%r10),%r10 # epilogue label cmp %r10,%rbx # context->Rip>=.Lsqr_epilogue jae .Lcommon_seh_tail mov 40(%rax),%rax # pull saved stack pointer +.Lcommon_pop_regs: mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r12 @@ -1470,13 +1497,15 @@ .LSEH_info_bn_sqr8x_mont: .byte 9,0,0,0 .rva sqr_handler - .rva .Lsqr8x_body,.Lsqr8x_epilogue # HandlerData[] + .rva .Lsqr8x_prologue,.Lsqr8x_body,.Lsqr8x_epilogue # HandlerData[] +.align 8 ___ $code.=<<___ if ($addx); .LSEH_info_bn_mulx4x_mont: .byte 9,0,0,0 .rva sqr_handler - .rva .Lmulx4x_body,.Lmulx4x_epilogue # HandlerData[] + .rva .Lmulx4x_prologue,.Lmulx4x_body,.Lmulx4x_epilogue # HandlerData[] +.align 8 ___ } diff --git a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl index 938e1708180364..f1fbb45b532b27 100755 --- a/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl +++ b/deps/openssl/openssl/crypto/bn/asm/x86_64-mont5.pl @@ -86,6 +86,8 @@ .type bn_mul_mont_gather5,\@function,6 .align 64 bn_mul_mont_gather5: + mov ${num}d,${num}d + mov %rsp,%rax test \$7,${num}d jnz .Lmul_enter ___ @@ -97,10 +99,7 @@ .align 16 .Lmul_enter: - mov ${num}d,${num}d - mov %rsp,%rax movd `($win64?56:8)`(%rsp),%xmm5 # load 7th argument - lea .Linc(%rip),%r10 push %rbx push %rbp push %r12 @@ -108,26 +107,36 @@ push %r14 push %r15 - lea 2($num),%r11 - neg %r11 - lea -264(%rsp,%r11,8),%rsp # tp=alloca(8*(num+2)+256+8) - and \$-1024,%rsp # minimize TLB usage + neg $num + mov %rsp,%r11 + lea -280(%rsp,$num,8),%r10 # future alloca(8*(num+2)+256+8) + neg $num # restore $num + and \$-1024,%r10 # minimize TLB usage - mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp -.Lmul_body: # Some OSes, *cough*-dows, insist on stack being "wired" to # physical memory in strictly sequential manner, i.e. if stack # allocation spans two pages, then reference to farmost one can # be punishable by SEGV. But page walking can do good even on # other OSes, because it guarantees that villain thread hits # the guard page before it can make damage to innocent one... - sub %rsp,%rax - and \$-4096,%rax + sub %r10,%r11 + and \$-4096,%r11 + lea (%r10,%r11),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul_page_walk + jmp .Lmul_page_walk_done + .Lmul_page_walk: - mov (%rsp,%rax),%r11 - sub \$4096,%rax - .byte 0x2e # predict non-taken - jnc .Lmul_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r11 + cmp %r10,%rsp + ja .Lmul_page_walk +.Lmul_page_walk_done: + + lea .Linc(%rip),%r10 + mov %rax,8(%rsp,$num,8) # tp[num+1]=%rsp +.Lmul_body: lea 128($bp),%r12 # reassign $bp (+size optimization) ___ @@ -433,6 +442,8 @@ .type bn_mul4x_mont_gather5,\@function,6 .align 32 bn_mul4x_mont_gather5: + .byte 0x67 + mov %rsp,%rax .Lmul4x_enter: ___ $code.=<<___ if ($addx); @@ -441,14 +452,13 @@ je .Lmulx4x_enter ___ $code.=<<___; - .byte 0x67 - mov %rsp,%rax push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lmul4x_prologue: .byte 0x67 shl \$3,${num}d # convert $num to bytes @@ -465,32 +475,40 @@ # calculated from 7th argument, the index.] # lea -320(%rsp,$num,2),%r11 + mov %rsp,%rbp sub $rp,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lmul4xsp_alt - sub %r11,%rsp # align with $rp - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) + sub %r11,%rbp # align with $rp + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*num*8+256) jmp .Lmul4xsp_done .align 32 .Lmul4xsp_alt: lea 4096-320(,$num,2),%r10 - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lmul4xsp_done: - and \$-64,%rsp - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmul4x_page_walk + jmp .Lmul4x_page_walk_done + .Lmul4x_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lmul4x_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmul4x_page_walk +.Lmul4x_page_walk_done: neg $num @@ -1034,6 +1052,7 @@ .type bn_power5,\@function,6 .align 32 bn_power5: + mov %rsp,%rax ___ $code.=<<___ if ($addx); mov OPENSSL_ia32cap_P+8(%rip),%r11d @@ -1042,13 +1061,13 @@ je .Lpowerx5_enter ___ $code.=<<___; - mov %rsp,%rax push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lpower5_prologue: shl \$3,${num}d # convert $num to bytes lea ($num,$num,2),%r10d # 3*$num @@ -1063,32 +1082,40 @@ # calculated from 7th argument, the index.] # lea -320(%rsp,$num,2),%r11 + mov %rsp,%rbp sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lpwr_sp_alt - sub %r11,%rsp # align with $aptr - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) + sub %r11,%rbp # align with $aptr + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*num*8+256) jmp .Lpwr_sp_done .align 32 .Lpwr_sp_alt: lea 4096-320(,$num,2),%r10 - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*num*8+256) + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lpwr_sp_done: - and \$-64,%rsp - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lpwr_page_walk + jmp .Lpwr_page_walk_done + .Lpwr_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lpwr_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lpwr_page_walk +.Lpwr_page_walk_done: mov $num,%r10 neg $num @@ -2028,6 +2055,7 @@ push %r13 push %r14 push %r15 +.Lfrom_prologue: shl \$3,${num}d # convert $num to bytes lea ($num,$num,2),%r10 # 3*$num in bytes @@ -2042,32 +2070,40 @@ # last operation, we use the opportunity to cleanse it. # lea -320(%rsp,$num,2),%r11 + mov %rsp,%rbp sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lfrom_sp_alt - sub %r11,%rsp # align with $aptr - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + sub %r11,%rbp # align with $aptr + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*$num*8+256) jmp .Lfrom_sp_done .align 32 .Lfrom_sp_alt: lea 4096-320(,$num,2),%r10 - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lfrom_sp_done: - and \$-64,%rsp - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lfrom_page_walk + jmp .Lfrom_page_walk_done + .Lfrom_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lfrom_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lfrom_page_walk +.Lfrom_page_walk_done: mov $num,%r10 neg $num @@ -2173,14 +2209,15 @@ .type bn_mulx4x_mont_gather5,\@function,6 .align 32 bn_mulx4x_mont_gather5: -.Lmulx4x_enter: mov %rsp,%rax +.Lmulx4x_enter: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lmulx4x_prologue: shl \$3,${num}d # convert $num to bytes lea ($num,$num,2),%r10 # 3*$num in bytes @@ -2197,31 +2234,39 @@ # calculated from 7th argument, the index.] # lea -320(%rsp,$num,2),%r11 + mov %rsp,%rbp sub $rp,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lmulx4xsp_alt - sub %r11,%rsp # align with $aptr - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + sub %r11,%rbp # align with $aptr + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*$num*8+256) jmp .Lmulx4xsp_done .Lmulx4xsp_alt: lea 4096-320(,$num,2),%r10 - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lmulx4xsp_done: - and \$-64,%rsp # ensure alignment - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp # ensure alignment + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmulx4x_page_walk + jmp .Lmulx4x_page_walk_done + .Lmulx4x_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lmulx4x_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lmulx4x_page_walk +.Lmulx4x_page_walk_done: ############################################################## # Stack layout @@ -2629,14 +2674,15 @@ .type bn_powerx5,\@function,6 .align 32 bn_powerx5: -.Lpowerx5_enter: mov %rsp,%rax +.Lpowerx5_enter: push %rbx push %rbp push %r12 push %r13 push %r14 push %r15 +.Lpowerx5_prologue: shl \$3,${num}d # convert $num to bytes lea ($num,$num,2),%r10 # 3*$num in bytes @@ -2651,32 +2697,40 @@ # calculated from 7th argument, the index.] # lea -320(%rsp,$num,2),%r11 + mov %rsp,%rbp sub $rptr,%r11 and \$4095,%r11 cmp %r11,%r10 jb .Lpwrx_sp_alt - sub %r11,%rsp # align with $aptr - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + sub %r11,%rbp # align with $aptr + lea -320(%rbp,$num,2),%rbp # future alloca(frame+2*$num*8+256) jmp .Lpwrx_sp_done .align 32 .Lpwrx_sp_alt: lea 4096-320(,$num,2),%r10 - lea -320(%rsp,$num,2),%rsp # alloca(frame+2*$num*8+256) + lea -320(%rbp,$num,2),%rbp # alloca(frame+2*$num*8+256) sub %r10,%r11 mov \$0,%r10 cmovc %r10,%r11 - sub %r11,%rsp + sub %r11,%rbp .Lpwrx_sp_done: - and \$-64,%rsp - mov %rax,%r11 - sub %rsp,%r11 + and \$-64,%rbp + mov %rsp,%r11 + sub %rbp,%r11 and \$-4096,%r11 + lea (%rbp,%r11),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lpwrx_page_walk + jmp .Lpwrx_page_walk_done + .Lpwrx_page_walk: - mov (%rsp,%r11),%r10 - sub \$4096,%r11 - .byte 0x2e # predict non-taken - jnc .Lpwrx_page_walk + lea -4096(%rsp),%rsp + mov (%rsp),%r10 + cmp %rbp,%rsp + ja .Lpwrx_page_walk +.Lpwrx_page_walk_done: mov $num,%r10 neg $num @@ -3607,9 +3661,14 @@ cmp %r10,%rbx # context->RipRip>=epilogue label + jb .Lcommon_pop_regs + mov 152($context),%rax # pull context->Rsp - mov 4(%r11),%r10d # HandlerData[1] + mov 8(%r11),%r10d # HandlerData[2] lea (%rsi,%r10),%r10 # epilogue label cmp %r10,%rbx # context->Rip>=epilogue label jae .Lcommon_seh_tail @@ -3621,11 +3680,11 @@ mov 192($context),%r10 # pull $num mov 8(%rax,%r10,8),%rax # pull saved stack pointer - jmp .Lbody_proceed + jmp .Lcommon_pop_regs .Lbody_40: mov 40(%rax),%rax # pull saved stack pointer -.Lbody_proceed: +.Lcommon_pop_regs: mov -8(%rax),%rbx mov -16(%rax),%rbp mov -24(%rax),%r12 @@ -3716,34 +3775,34 @@ .LSEH_info_bn_mul_mont_gather5: .byte 9,0,0,0 .rva mul_handler - .rva .Lmul_body,.Lmul_epilogue # HandlerData[] + .rva .Lmul_body,.Lmul_body,.Lmul_epilogue # HandlerData[] .align 8 .LSEH_info_bn_mul4x_mont_gather5: .byte 9,0,0,0 .rva mul_handler - .rva .Lmul4x_body,.Lmul4x_epilogue # HandlerData[] + .rva .Lmul4x_prologue,.Lmul4x_body,.Lmul4x_epilogue # HandlerData[] .align 8 .LSEH_info_bn_power5: .byte 9,0,0,0 .rva mul_handler - .rva .Lpower5_body,.Lpower5_epilogue # HandlerData[] + .rva .Lpower5_prologue,.Lpower5_body,.Lpower5_epilogue # HandlerData[] .align 8 .LSEH_info_bn_from_mont8x: .byte 9,0,0,0 .rva mul_handler - .rva .Lfrom_body,.Lfrom_epilogue # HandlerData[] + .rva .Lfrom_prologue,.Lfrom_body,.Lfrom_epilogue # HandlerData[] ___ $code.=<<___ if ($addx); .align 8 .LSEH_info_bn_mulx4x_mont_gather5: .byte 9,0,0,0 .rva mul_handler - .rva .Lmulx4x_body,.Lmulx4x_epilogue # HandlerData[] + .rva .Lmulx4x_prologue,.Lmulx4x_body,.Lmulx4x_epilogue # HandlerData[] .align 8 .LSEH_info_bn_powerx5: .byte 9,0,0,0 .rva mul_handler - .rva .Lpowerx5_body,.Lpowerx5_epilogue # HandlerData[] + .rva .Lpowerx5_prologue,.Lpowerx5_body,.Lpowerx5_epilogue # HandlerData[] ___ $code.=<<___; .align 8 diff --git a/deps/openssl/openssl/crypto/bn/bn.h b/deps/openssl/openssl/crypto/bn/bn.h index 86264ae6315fb1..633d1b1f60136e 100644 --- a/deps/openssl/openssl/crypto/bn/bn.h +++ b/deps/openssl/openssl/crypto/bn/bn.h @@ -842,6 +842,8 @@ int RAND_pseudo_bytes(unsigned char *buf, int num); if (*(ftl--)) break; \ (a)->top = tmp_top; \ } \ + if ((a)->top == 0) \ + (a)->neg = 0; \ bn_pollute(a); \ } diff --git a/deps/openssl/openssl/crypto/bn/bn_div.c b/deps/openssl/openssl/crypto/bn/bn_div.c index 72e6ce3f74c067..bc37671cf13868 100644 --- a/deps/openssl/openssl/crypto/bn/bn_div.c +++ b/deps/openssl/openssl/crypto/bn/bn_div.c @@ -155,7 +155,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, ({ asm volatile ( \ "divl %4" \ : "=a"(q), "=d"(rem) \ - : "a"(n1), "d"(n0), "g"(d0) \ + : "a"(n1), "d"(n0), "r"(d0) \ : "cc"); \ q; \ }) @@ -170,7 +170,7 @@ int BN_div(BIGNUM *dv, BIGNUM *rem, const BIGNUM *m, const BIGNUM *d, ({ asm volatile ( \ "divq %4" \ : "=a"(q), "=d"(rem) \ - : "a"(n1), "d"(n0), "g"(d0) \ + : "a"(n1), "d"(n0), "r"(d0) \ : "cc"); \ q; \ }) diff --git a/deps/openssl/openssl/crypto/bn/bn_lib.c b/deps/openssl/openssl/crypto/bn/bn_lib.c index 80105fff410c49..10b78f5126076f 100644 --- a/deps/openssl/openssl/crypto/bn/bn_lib.c +++ b/deps/openssl/openssl/crypto/bn/bn_lib.c @@ -569,7 +569,7 @@ void BN_clear(BIGNUM *a) { bn_check_top(a); if (a->d != NULL) - memset(a->d, 0, a->dmax * sizeof(a->d[0])); + OPENSSL_cleanse(a->d, a->dmax * sizeof(a->d[0])); a->top = 0; a->neg = 0; } diff --git a/deps/openssl/openssl/crypto/bn/bn_print.c b/deps/openssl/openssl/crypto/bn/bn_print.c index bfa31efc56216b..f121fb6e9a08d8 100644 --- a/deps/openssl/openssl/crypto/bn/bn_print.c +++ b/deps/openssl/openssl/crypto/bn/bn_print.c @@ -72,12 +72,9 @@ char *BN_bn2hex(const BIGNUM *a) char *buf; char *p; - if (a->neg && BN_is_zero(a)) { - /* "-0" == 3 bytes including NULL terminator */ - buf = OPENSSL_malloc(3); - } else { - buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2); - } + if (BN_is_zero(a)) + return OPENSSL_strdup("0"); + buf = OPENSSL_malloc(a->top * BN_BYTES * 2 + 2); if (buf == NULL) { BNerr(BN_F_BN_BN2HEX, ERR_R_MALLOC_FAILURE); goto err; @@ -111,6 +108,7 @@ char *BN_bn2dec(const BIGNUM *a) char *p; BIGNUM *t = NULL; BN_ULONG *bn_data = NULL, *lp; + int bn_data_num; /*- * get an upper bound for the length of the decimal integer @@ -120,9 +118,9 @@ char *BN_bn2dec(const BIGNUM *a) */ i = BN_num_bits(a) * 3; num = (i / 10 + i / 1000 + 1) + 1; - bn_data = - (BN_ULONG *)OPENSSL_malloc((num / BN_DEC_NUM + 1) * sizeof(BN_ULONG)); - buf = (char *)OPENSSL_malloc(num + 3); + bn_data_num = num / BN_DEC_NUM + 1; + bn_data = OPENSSL_malloc(bn_data_num * sizeof(BN_ULONG)); + buf = OPENSSL_malloc(num + 3); if ((buf == NULL) || (bn_data == NULL)) { BNerr(BN_F_BN_BN2DEC, ERR_R_MALLOC_FAILURE); goto err; @@ -140,9 +138,12 @@ char *BN_bn2dec(const BIGNUM *a) if (BN_is_negative(t)) *p++ = '-'; - i = 0; while (!BN_is_zero(t)) { + if (lp - bn_data >= bn_data_num) + goto err; *lp = BN_div_word(t, BN_DEC_CONV); + if (*lp == (BN_ULONG)-1) + goto err; lp++; } lp--; @@ -240,10 +241,12 @@ int BN_hex2bn(BIGNUM **bn, const char *a) } ret->top = h; bn_correct_top(ret); - ret->neg = neg; *bn = ret; bn_check_top(ret); + /* Don't set the negative flag if it's zero. */ + if (ret->top != 0) + ret->neg = neg; return (num); err: if (*bn == NULL) @@ -295,7 +298,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a) if (j == BN_DEC_NUM) j = 0; l = 0; - while (*a) { + while (--i >= 0) { l *= 10; l += *a - '0'; a++; @@ -306,11 +309,13 @@ int BN_dec2bn(BIGNUM **bn, const char *a) j = 0; } } - ret->neg = neg; bn_correct_top(ret); *bn = ret; bn_check_top(ret); + /* Don't set the negative flag if it's zero. */ + if (ret->top != 0) + ret->neg = neg; return (num); err: if (*bn == NULL) @@ -321,6 +326,7 @@ int BN_dec2bn(BIGNUM **bn, const char *a) int BN_asc2bn(BIGNUM **bn, const char *a) { const char *p = a; + if (*p == '-') p++; @@ -331,7 +337,8 @@ int BN_asc2bn(BIGNUM **bn, const char *a) if (!BN_dec2bn(bn, p)) return 0; } - if (*a == '-') + /* Don't set the negative flag if it's zero. */ + if (*a == '-' && (*bn)->top != 0) (*bn)->neg = 1; return 1; } diff --git a/deps/openssl/openssl/crypto/bn/bn_rand.c b/deps/openssl/openssl/crypto/bn/bn_rand.c index f9fb2e9e45e01b..60d3f2260ba148 100644 --- a/deps/openssl/openssl/crypto/bn/bn_rand.c +++ b/deps/openssl/openssl/crypto/bn/bn_rand.c @@ -121,15 +121,14 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) int ret = 0, bit, bytes, mask; time_t tim; - if (bits < 0 || (bits == 1 && top > 0)) { - BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL); - return 0; - } - if (bits == 0) { + if (top != -1 || bottom != 0) + goto toosmall; BN_zero(rnd); return 1; } + if (bits < 0 || (bits == 1 && top > 0)) + goto toosmall; bytes = (bits + 7) / 8; bit = (bits - 1) % 8; @@ -145,13 +144,9 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) time(&tim); RAND_add(&tim, sizeof(tim), 0.0); - if (pseudorand) { - if (RAND_pseudo_bytes(buf, bytes) == -1) - goto err; - } else { - if (RAND_bytes(buf, bytes) <= 0) - goto err; - } + /* We ignore the value of pseudorand and always call RAND_bytes */ + if (RAND_bytes(buf, bytes) <= 0) + goto err; #if 1 if (pseudorand == 2) { @@ -199,6 +194,10 @@ static int bnrand(int pseudorand, BIGNUM *rnd, int bits, int top, int bottom) } bn_check_top(rnd); return (ret); + +toosmall: + BNerr(BN_F_BNRAND, BN_R_BITS_TOO_SMALL); + return 0; } int BN_rand(BIGNUM *rnd, int bits, int top, int bottom) diff --git a/deps/openssl/openssl/crypto/bn/bn_word.c b/deps/openssl/openssl/crypto/bn/bn_word.c index b031a60b5bf80f..9b5f9cb98c3a1a 100644 --- a/deps/openssl/openssl/crypto/bn/bn_word.c +++ b/deps/openssl/openssl/crypto/bn/bn_word.c @@ -72,10 +72,32 @@ BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w) if (w == 0) return (BN_ULONG)-1; +#ifndef BN_LLONG + /* + * If |w| is too long and we don't have BN_ULLONG then we need to fall + * back to using BN_div_word + */ + if (w > ((BN_ULONG)1 << BN_BITS4)) { + BIGNUM *tmp = BN_dup(a); + if (tmp == NULL) + return (BN_ULONG)-1; + + ret = BN_div_word(tmp, w); + BN_free(tmp); + + return ret; + } +#endif + bn_check_top(a); w &= BN_MASK2; for (i = a->top - 1; i >= 0; i--) { #ifndef BN_LLONG + /* + * We can assume here that | w <= ((BN_ULONG)1 << BN_BITS4) | and so + * | ret < ((BN_ULONG)1 << BN_BITS4) | and therefore the shifts here are + * safe and will not overflow + */ ret = ((ret << BN_BITS4) | ((a->d[i] >> BN_BITS4) & BN_MASK2l)) % w; ret = ((ret << BN_BITS4) | (a->d[i] & BN_MASK2l)) % w; #else diff --git a/deps/openssl/openssl/crypto/bn/bntest.c b/deps/openssl/openssl/crypto/bn/bntest.c index 1e35988022bbcb..a327b1a647b2e9 100644 --- a/deps/openssl/openssl/crypto/bn/bntest.c +++ b/deps/openssl/openssl/crypto/bn/bntest.c @@ -514,7 +514,7 @@ static void print_word(BIO *bp, BN_ULONG w) int test_div_word(BIO *bp) { BIGNUM a, b; - BN_ULONG r, s; + BN_ULONG r, rmod, s; int i; BN_init(&a); @@ -528,8 +528,14 @@ int test_div_word(BIO *bp) s = b.d[0]; BN_copy(&b, &a); + rmod = BN_mod_word(&b, s); r = BN_div_word(&b, s); + if (rmod != r) { + fprintf(stderr, "Mod (word) test failed!\n"); + return 0; + } + if (bp != NULL) { if (!results) { BN_print(bp, &a); diff --git a/deps/openssl/openssl/crypto/cms/cms_enc.c b/deps/openssl/openssl/crypto/cms/cms_enc.c index b14b4b68b5c950..90b1fcc75075ea 100644 --- a/deps/openssl/openssl/crypto/cms/cms_enc.c +++ b/deps/openssl/openssl/crypto/cms/cms_enc.c @@ -119,7 +119,7 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) /* Generate a random IV if we need one */ ivlen = EVP_CIPHER_CTX_iv_length(ctx); if (ivlen > 0) { - if (RAND_pseudo_bytes(iv, ivlen) <= 0) + if (RAND_bytes(iv, ivlen) <= 0) goto err; piv = iv; } @@ -179,10 +179,9 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) CMS_R_CIPHER_INITIALISATION_ERROR); goto err; } - - if (piv) { + if (enc) { calg->parameter = ASN1_TYPE_new(); - if (!calg->parameter) { + if (calg->parameter == NULL) { CMSerr(CMS_F_CMS_ENCRYPTEDCONTENT_INIT_BIO, ERR_R_MALLOC_FAILURE); goto err; } @@ -191,6 +190,11 @@ BIO *cms_EncryptedContent_init_bio(CMS_EncryptedContentInfo *ec) CMS_R_CIPHER_PARAMETER_INITIALISATION_ERROR); goto err; } + /* If parameter type not set omit parameter */ + if (calg->parameter->type == V_ASN1_UNDEF) { + ASN1_TYPE_free(calg->parameter); + calg->parameter = NULL; + } } ok = 1; diff --git a/deps/openssl/openssl/crypto/cms/cms_ess.c b/deps/openssl/openssl/crypto/cms/cms_ess.c index 8631a2eb2b303a..8212560628a9d4 100644 --- a/deps/openssl/openssl/crypto/cms/cms_ess.c +++ b/deps/openssl/openssl/crypto/cms/cms_ess.c @@ -107,8 +107,7 @@ CMS_ReceiptRequest *CMS_ReceiptRequest_create0(unsigned char *id, int idlen, else { if (!ASN1_STRING_set(rr->signedContentIdentifier, NULL, 32)) goto merr; - if (RAND_pseudo_bytes(rr->signedContentIdentifier->data, 32) - <= 0) + if (RAND_bytes(rr->signedContentIdentifier->data, 32) <= 0) goto err; } diff --git a/deps/openssl/openssl/crypto/cms/cms_lib.c b/deps/openssl/openssl/crypto/cms/cms_lib.c index d6cb60d02d1525..6d27c4969b92c4 100644 --- a/deps/openssl/openssl/crypto/cms/cms_lib.c +++ b/deps/openssl/openssl/crypto/cms/cms_lib.c @@ -413,6 +413,8 @@ static STACK_OF(CMS_CertificateChoices) return &cms->d.signedData->certificates; case NID_pkcs7_enveloped: + if (cms->d.envelopedData->originatorInfo == NULL) + return NULL; return &cms->d.envelopedData->originatorInfo->certificates; default: @@ -488,6 +490,8 @@ static STACK_OF(CMS_RevocationInfoChoice) return &cms->d.signedData->crls; case NID_pkcs7_enveloped: + if (cms->d.envelopedData->originatorInfo == NULL) + return NULL; return &cms->d.envelopedData->originatorInfo->crls; default: diff --git a/deps/openssl/openssl/crypto/cms/cms_pwri.c b/deps/openssl/openssl/crypto/cms/cms_pwri.c index b91c01691fec21..5c817caf2f0561 100644 --- a/deps/openssl/openssl/crypto/cms/cms_pwri.c +++ b/deps/openssl/openssl/crypto/cms/cms_pwri.c @@ -134,7 +134,7 @@ CMS_RecipientInfo *CMS_add0_recipient_password(CMS_ContentInfo *cms, ivlen = EVP_CIPHER_CTX_iv_length(&ctx); if (ivlen > 0) { - if (RAND_pseudo_bytes(iv, ivlen) <= 0) + if (RAND_bytes(iv, ivlen) <= 0) goto err; if (EVP_EncryptInit_ex(&ctx, NULL, NULL, NULL, iv) <= 0) { CMSerr(CMS_F_CMS_ADD0_RECIPIENT_PASSWORD, ERR_R_EVP_LIB); @@ -301,7 +301,7 @@ static int kek_wrap_key(unsigned char *out, size_t *outlen, memcpy(out + 4, in, inlen); /* Add random padding to end */ if (olen > inlen + 4 - && RAND_pseudo_bytes(out + 4 + inlen, olen - 4 - inlen) < 0) + && RAND_bytes(out + 4 + inlen, olen - 4 - inlen) <= 0) return 0; /* Encrypt twice */ EVP_EncryptUpdate(ctx, out, &dummy, out, olen); diff --git a/deps/openssl/openssl/crypto/comp/comp.h b/deps/openssl/openssl/crypto/comp/comp.h index 60a073404e922f..df599ba3314bfb 100644 --- a/deps/openssl/openssl/crypto/comp/comp.h +++ b/deps/openssl/openssl/crypto/comp/comp.h @@ -14,7 +14,7 @@ extern "C" { typedef struct comp_ctx_st COMP_CTX; -typedef struct comp_method_st { +struct comp_method_st { int type; /* NID for compression library */ const char *name; /* A text string to identify the library */ int (*init) (COMP_CTX *ctx); @@ -30,7 +30,7 @@ typedef struct comp_method_st { */ long (*ctrl) (void); long (*callback_ctrl) (void); -} COMP_METHOD; +}; struct comp_ctx_st { COMP_METHOD *meth; diff --git a/deps/openssl/openssl/crypto/conf/conf_def.h b/deps/openssl/openssl/crypto/conf/conf_def.h index 7d897b89f18298..48b34421811456 100644 --- a/deps/openssl/openssl/crypto/conf/conf_def.h +++ b/deps/openssl/openssl/crypto/conf/conf_def.h @@ -81,34 +81,34 @@ #define KEYTYPES(c) ((unsigned short *)((c)->meth_data)) #ifndef CHARSET_EBCDIC -# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) -# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) -# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) -# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) -# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) -# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) -# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) +# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) +# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) +# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) +# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) +# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) +# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) +# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) # define IS_ALPHA_NUMERIC_PUNCT(c,a) \ (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT) -# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) -# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) -# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) +# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) +# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) +# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) -#else /* CHARSET_EBCDIC */ +#else /*CHARSET_EBCDIC*/ -# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT) -# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT) -# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF) -# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC) -# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER) -# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS) -# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC) +# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT) +# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT) +# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF) +# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC) +# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER) +# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS) +# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC) # define IS_ALPHA_NUMERIC_PUNCT(c,a) \ (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT) -# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE) -# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE) -# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT) -#endif /* CHARSET_EBCDIC */ +# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE) +# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE) +# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT) +#endif /*CHARSET_EBCDIC*/ static unsigned short CONF_type_default[256] = { 0x0008, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, diff --git a/deps/openssl/openssl/crypto/conf/conf_mod.c b/deps/openssl/openssl/crypto/conf/conf_mod.c index 9acfca4f7198cf..e0c9a67ff68fb2 100644 --- a/deps/openssl/openssl/crypto/conf/conf_mod.c +++ b/deps/openssl/openssl/crypto/conf/conf_mod.c @@ -288,6 +288,10 @@ static CONF_MODULE *module_add(DSO *dso, const char *name, tmod->dso = dso; tmod->name = BUF_strdup(name); + if (tmod->name == NULL) { + OPENSSL_free(tmod); + return NULL; + } tmod->init = ifunc; tmod->finish = ffunc; tmod->links = 0; diff --git a/deps/openssl/openssl/crypto/conf/keysets.pl b/deps/openssl/openssl/crypto/conf/keysets.pl index 50ed67fa527c5b..5c9b2aaef8aaa4 100644 --- a/deps/openssl/openssl/crypto/conf/keysets.pl +++ b/deps/openssl/openssl/crypto/conf/keysets.pl @@ -59,21 +59,21 @@ * This package is an SSL implementation written * by Eric Young (eay\@cryptsoft.com). * The implementation was written so as to conform with Netscapes SSL. - * + * * This library is free for commercial and non-commercial use as long as * the following conditions are aheared to. The following conditions * apply to all code found in this distribution, be it the RC4, RSA, * lhash, DES, etc., code; not just the SSL code. The SSL documentation * included with this distribution is covered by the same copyright terms * except that the holder is Tim Hudson (tjh\@cryptsoft.com). - * + * * Copyright remains Eric Young's, and as such any Copyright notices in * the code are not to be removed. * If this package is used in a product, Eric Young should be given attribution * as the author of the parts of the library used. * This can be in the form of a textual message at program startup or * in documentation (online or textual) provided with the package. - * + * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: @@ -88,10 +88,10 @@ * Eric Young (eay\@cryptsoft.com)" * The word 'cryptographic' can be left out if the rouines from the library * being used are not cryptographic related :-). - * 4. If you include any Windows specific code (or a derivative thereof) from + * 4. If you include any Windows specific code (or a derivative thereof) from * the apps directory (application code) you must include an acknowledgement: * "This product includes software written by Tim Hudson (tjh\@cryptsoft.com)" - * + * * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE @@ -103,83 +103,85 @@ * 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. - * + * * The licence and distribution terms for any publically available version or * derivative of this code cannot be changed. i.e. this code cannot simply be * copied and put under another distribution licence * [including the GNU Public Licence.] */ -/* THIS FILE WAS AUTOMAGICALLY GENERATED! - Please modify and use keysets.pl to regenerate it. */ - -#define CONF_NUMBER $NUMBER -#define CONF_UPPER $UPPER -#define CONF_LOWER $LOWER -#define CONF_UNDER $UNDER -#define CONF_PUNCTUATION $PUNCTUATION -#define CONF_WS $WS -#define CONF_ESC $ESC -#define CONF_QUOTE $QUOTE -#define CONF_DQUOTE $DQUOTE -#define CONF_COMMENT $COMMENT -#define CONF_FCOMMENT $FCOMMENT -#define CONF_EOF $EOF -#define CONF_HIGHBIT $HIGHBIT -#define CONF_ALPHA (CONF_UPPER|CONF_LOWER) -#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) +/* + * THIS FILE WAS AUTOMAGICALLY GENERATED! Please modify and use keysets.pl to + * regenerate it. + */ + +#define CONF_NUMBER $NUMBER +#define CONF_UPPER $UPPER +#define CONF_LOWER $LOWER +#define CONF_UNDER $UNDER +#define CONF_PUNCTUATION $PUNCTUATION +#define CONF_WS $WS +#define CONF_ESC $ESC +#define CONF_QUOTE $QUOTE +#define CONF_DQUOTE $DQUOTE +#define CONF_COMMENT $COMMENT +#define CONF_FCOMMENT $FCOMMENT +#define CONF_EOF $EOF +#define CONF_HIGHBIT $HIGHBIT +#define CONF_ALPHA (CONF_UPPER|CONF_LOWER) +#define CONF_ALPHA_NUMERIC (CONF_ALPHA|CONF_NUMBER|CONF_UNDER) #define CONF_ALPHA_NUMERIC_PUNCT (CONF_ALPHA|CONF_NUMBER|CONF_UNDER| \\ - CONF_PUNCTUATION) + CONF_PUNCTUATION) -#define KEYTYPES(c) ((unsigned short *)((c)->meth_data)) +#define KEYTYPES(c) ((unsigned short *)((c)->meth_data)) #ifndef CHARSET_EBCDIC -#define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) -#define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) -#define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) -#define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) -#define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) -#define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) -#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) -#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ - (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT) -#define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) -#define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) -#define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) +# define IS_COMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_COMMENT) +# define IS_FCOMMENT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_FCOMMENT) +# define IS_EOF(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_EOF) +# define IS_ESC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ESC) +# define IS_NUMBER(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_NUMBER) +# define IS_WS(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_WS) +# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC) +# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ + (KEYTYPES(c)[(a)&0xff]&CONF_ALPHA_NUMERIC_PUNCT) +# define IS_QUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_QUOTE) +# define IS_DQUOTE(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_DQUOTE) +# define IS_HIGHBIT(c,a) (KEYTYPES(c)[(a)&0xff]&CONF_HIGHBIT) #else /*CHARSET_EBCDIC*/ -#define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT) -#define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT) -#define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF) -#define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC) -#define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER) -#define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS) -#define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC) -#define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ - (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT) -#define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE) -#define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE) -#define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT) +# define IS_COMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_COMMENT) +# define IS_FCOMMENT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_FCOMMENT) +# define IS_EOF(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_EOF) +# define IS_ESC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ESC) +# define IS_NUMBER(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_NUMBER) +# define IS_WS(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_WS) +# define IS_ALPHA_NUMERIC(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC) +# define IS_ALPHA_NUMERIC_PUNCT(c,a) \\ + (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_ALPHA_NUMERIC_PUNCT) +# define IS_QUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_QUOTE) +# define IS_DQUOTE(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_DQUOTE) +# define IS_HIGHBIT(c,a) (KEYTYPES(c)[os_toascii[a]&0xff]&CONF_HIGHBIT) #endif /*CHARSET_EBCDIC*/ EOF -print "static unsigned short CONF_type_default[256]={"; +print "static unsigned short CONF_type_default[256] = {"; for ($i=0; $i<256; $i++) { - print "\n\t" if ($i % 8) == 0; - printf "0x%04X,",$V_def[$i]; + print "\n " if ($i % 8) == 0; + printf " 0x%04X,",$V_def[$i]; } -print "\n\t};\n\n"; +print "\n};\n\n"; -print "static unsigned short CONF_type_win32[256]={"; +print "static unsigned short CONF_type_win32[256] = {"; for ($i=0; $i<256; $i++) { - print "\n\t" if ($i % 8) == 0; - printf "0x%04X,",$V_w32[$i]; + print "\n " if ($i % 8) == 0; + printf " 0x%04X,",$V_w32[$i]; } -print "\n\t};\n\n"; +print "\n};\n"; diff --git a/deps/openssl/openssl/crypto/crypto-lib.com b/deps/openssl/openssl/crypto/crypto-lib.com index 1423cac288d243..37dc418bf55931 100644 --- a/deps/openssl/openssl/crypto/crypto-lib.com +++ b/deps/openssl/openssl/crypto/crypto-lib.com @@ -1222,7 +1222,7 @@ $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ - - "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + - + "''POINTER_SIZE' /NOLIST /PREFIX=ALL /EXTERN_MODEL=STRICT_REFDEF" + - " /INCLUDE=(''CC_INCLUDES')"+ - CCEXTRAFLAGS $! diff --git a/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl b/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl index 1dc60243d4fbda..5f3a511dba27fa 100644 --- a/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl +++ b/deps/openssl/openssl/crypto/des/asm/dest4-sparcv9.pl @@ -96,7 +96,7 @@ des_t4_cbc_encrypt: cmp $len, 0 be,pn $::size_t_cc, .Lcbc_abort - nop + srln $len, 0, $len ! needed on v8+, "nop" on v9 ld [$ivec + 0], %f0 ! load ivec ld [$ivec + 4], %f1 @@ -197,7 +197,7 @@ des_t4_cbc_decrypt: cmp $len, 0 be,pn $::size_t_cc, .Lcbc_abort - nop + srln $len, 0, $len ! needed on v8+, "nop" on v9 ld [$ivec + 0], %f2 ! load ivec ld [$ivec + 4], %f3 @@ -305,7 +305,7 @@ des_t4_ede3_cbc_encrypt: cmp $len, 0 be,pn $::size_t_cc, .Lcbc_abort - nop + srln $len, 0, $len ! needed on v8+, "nop" on v9 ld [$ivec + 0], %f0 ! load ivec ld [$ivec + 4], %f1 @@ -457,7 +457,7 @@ des_t4_ede3_cbc_decrypt: cmp $len, 0 be,pn $::size_t_cc, .Lcbc_abort - nop + srln $len, 0, $len ! needed on v8+, "nop" on v9 ld [$ivec + 0], %f2 ! load ivec ld [$ivec + 4], %f3 diff --git a/deps/openssl/openssl/crypto/des/des.c b/deps/openssl/openssl/crypto/des/des.c index 586aed72378cc1..d7374382d83ac6 100644 --- a/deps/openssl/openssl/crypto/des/des.c +++ b/deps/openssl/openssl/crypto/des/des.c @@ -456,7 +456,7 @@ void doencryption(void) len = l - rem; if (feof(DES_IN)) { for (i = 7 - rem; i > 0; i--) { - if (RAND_pseudo_bytes(buf + l++, 1) < 0) + if (RAND_bytes(buf + l++, 1) <= 0) goto problems; } buf[l++] = rem; diff --git a/deps/openssl/openssl/crypto/des/enc_writ.c b/deps/openssl/openssl/crypto/des/enc_writ.c index bfaabde516ae55..c2aaa8e98ca230 100644 --- a/deps/openssl/openssl/crypto/des/enc_writ.c +++ b/deps/openssl/openssl/crypto/des/enc_writ.c @@ -135,7 +135,7 @@ int DES_enc_write(int fd, const void *_buf, int len, if (len < 8) { cp = shortbuf; memcpy(shortbuf, buf, len); - if (RAND_pseudo_bytes(shortbuf + len, 8 - len) < 0) { + if (RAND_bytes(shortbuf + len, 8 - len) <= 0) { return -1; } rnum = 8; diff --git a/deps/openssl/openssl/crypto/dh/dh_ameth.c b/deps/openssl/openssl/crypto/dh/dh_ameth.c index ac72468bd14bf0..4558283576b374 100644 --- a/deps/openssl/openssl/crypto/dh/dh_ameth.c +++ b/deps/openssl/openssl/crypto/dh/dh_ameth.c @@ -519,7 +519,7 @@ static int dh_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) static int dh_missing_parameters(const EVP_PKEY *a) { - if (!a->pkey.dh->p || !a->pkey.dh->g) + if (a->pkey.dh == NULL || a->pkey.dh->p == NULL || a->pkey.dh->g == NULL) return 1; return 0; } diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ameth.c b/deps/openssl/openssl/crypto/dsa/dsa_ameth.c index cc83d6e6ad3b6f..c4fa105747feb7 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_ameth.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_ameth.c @@ -350,7 +350,7 @@ static int dsa_missing_parameters(const EVP_PKEY *pkey) { DSA *dsa; dsa = pkey->pkey.dsa; - if ((dsa->p == NULL) || (dsa->q == NULL) || (dsa->g == NULL)) + if (dsa == NULL || dsa->p == NULL || dsa->q == NULL || dsa->g == NULL) return 1; return 0; } diff --git a/deps/openssl/openssl/crypto/dsa/dsa_gen.c b/deps/openssl/openssl/crypto/dsa/dsa_gen.c index 15f3bb4f3f3951..1fce0f81c24242 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_gen.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_gen.c @@ -185,6 +185,9 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, p = BN_CTX_get(ctx); test = BN_CTX_get(ctx); + if (test == NULL) + goto err; + if (!BN_lshift(test, BN_value_one(), bits - 1)) goto err; @@ -197,7 +200,7 @@ int dsa_builtin_paramgen(DSA *ret, size_t bits, size_t qbits, goto err; if (!seed_len || !seed_in) { - if (RAND_pseudo_bytes(seed, qsize) < 0) + if (RAND_bytes(seed, qsize) <= 0) goto err; seed_is_random = 1; } else { @@ -491,7 +494,7 @@ int dsa_builtin_paramgen2(DSA *ret, size_t L, size_t N, goto err; if (!seed_in) { - if (RAND_pseudo_bytes(seed, seed_len) < 0) + if (RAND_bytes(seed, seed_len) <= 0) goto err; } /* step 2 */ diff --git a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c index efc4f1b6aebab0..58013a4a13b57a 100644 --- a/deps/openssl/openssl/crypto/dsa/dsa_ossl.c +++ b/deps/openssl/openssl/crypto/dsa/dsa_ossl.c @@ -247,11 +247,13 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, do if (!BN_rand_range(&k, dsa->q)) goto err; - while (BN_is_zero(&k)) ; + while (BN_is_zero(&k)); + if ((dsa->flags & DSA_FLAG_NO_EXP_CONSTTIME) == 0) { BN_set_flags(&k, BN_FLG_CONSTTIME); } + if (dsa->flags & DSA_FLAG_CACHE_MONT_P) { if (!BN_MONT_CTX_set_locked(&dsa->method_mont_p, CRYPTO_LOCK_DSA, dsa->p, ctx)) @@ -264,6 +266,8 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, if (!BN_copy(&kq, &k)) goto err; + BN_set_flags(&kq, BN_FLG_CONSTTIME); + /* * We do not want timing information to leak the length of k, so we * compute g^k using an equivalent exponent of fixed length. (This @@ -282,6 +286,7 @@ static int dsa_sign_setup(DSA *dsa, BN_CTX *ctx_in, BIGNUM **kinvp, } else { K = &k; } + DSA_BN_MOD_EXP(goto err, dsa, r, dsa->g, K, dsa->p, ctx, dsa->method_mont_p); if (!BN_mod(r, r, dsa->q, ctx)) diff --git a/deps/openssl/openssl/crypto/ec/Makefile b/deps/openssl/openssl/crypto/ec/Makefile index 89491454a4412d..6628390ba48ef4 100644 --- a/deps/openssl/openssl/crypto/ec/Makefile +++ b/deps/openssl/openssl/crypto/ec/Makefile @@ -131,7 +131,7 @@ ec_ameth.o: ../../include/openssl/pkcs7.h ../../include/openssl/safestack.h ec_ameth.o: ../../include/openssl/sha.h ../../include/openssl/stack.h ec_ameth.o: ../../include/openssl/symhacks.h ../../include/openssl/x509.h ec_ameth.o: ../../include/openssl/x509_vfy.h ../asn1/asn1_locl.h ../cryptlib.h -ec_ameth.o: ec_ameth.c +ec_ameth.o: ec_ameth.c ec_lcl.h ec_asn1.o: ../../include/openssl/asn1.h ../../include/openssl/asn1t.h ec_asn1.o: ../../include/openssl/bio.h ../../include/openssl/bn.h ec_asn1.o: ../../include/openssl/crypto.h ../../include/openssl/e_os2.h diff --git a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl index 7140860e245b45..7948bf71b51e2c 100755 --- a/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl +++ b/deps/openssl/openssl/crypto/ec/asm/ecp_nistz256-x86_64.pl @@ -128,6 +128,7 @@ push %r13 mov 8*0($a_ptr), $a0 + xor $t4,$t4 mov 8*1($a_ptr), $a1 add $a0, $a0 # a0:a3+a0:a3 mov 8*2($a_ptr), $a2 @@ -138,7 +139,7 @@ adc $a2, $a2 adc $a3, $a3 mov $a1, $t1 - sbb $t4, $t4 + adc \$0, $t4 sub 8*0($a_ptr), $a0 mov $a2, $t2 @@ -146,14 +147,14 @@ sbb 8*2($a_ptr), $a2 mov $a3, $t3 sbb 8*3($a_ptr), $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovz $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovz $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -250,12 +251,12 @@ sbb \$0, $a2 mov $a3, $t3 sbb .Lpoly+8*3(%rip), $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 - cmovz $t2, $a2 - cmovz $t3, $a3 + cmovc $t0, $a0 + cmovc $t1, $a1 + cmovc $t2, $a2 + cmovc $t3, $a3 xor $t4, $t4 add 8*0($a_ptr), $a0 # a0:a3+=a_ptr[0:3] @@ -272,14 +273,14 @@ sbb \$0, $a2 mov $a3, $t3 sbb .Lpoly+8*3(%rip), $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovz $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovz $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -318,14 +319,14 @@ sbb 8*2($a_ptr), $a2 mov $a3, $t3 sbb 8*3($a_ptr), $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovz $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovz $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -1840,13 +1841,14 @@ () .type __ecp_nistz256_add_toq,\@abi-omnipotent .align 32 __ecp_nistz256_add_toq: + xor $t4,$t4 add 8*0($b_ptr), $a0 adc 8*1($b_ptr), $a1 mov $a0, $t0 adc 8*2($b_ptr), $a2 adc 8*3($b_ptr), $a3 mov $a1, $t1 - sbb $t4, $t4 + adc \$0, $t4 sub \$-1, $a0 mov $a2, $t2 @@ -1854,14 +1856,14 @@ () sbb \$0, $a2 mov $a3, $t3 sbb $poly3, $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovz $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovz $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -1929,13 +1931,14 @@ () .type __ecp_nistz256_mul_by_2q,\@abi-omnipotent .align 32 __ecp_nistz256_mul_by_2q: + xor $t4, $t4 add $a0, $a0 # a0:a3+a0:a3 adc $a1, $a1 mov $a0, $t0 adc $a2, $a2 adc $a3, $a3 mov $a1, $t1 - sbb $t4, $t4 + adc \$0, $t4 sub \$-1, $a0 mov $a2, $t2 @@ -1943,14 +1946,14 @@ () sbb \$0, $a2 mov $a3, $t3 sbb $poly3, $a3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $a0 - cmovz $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovz $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovz $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -2241,16 +2244,14 @@ () mov $b_org, $a_ptr # reassign movdqa %xmm0, $in1_x(%rsp) movdqa %xmm1, $in1_x+0x10(%rsp) - por %xmm0, %xmm1 movdqa %xmm2, $in1_y(%rsp) movdqa %xmm3, $in1_y+0x10(%rsp) - por %xmm2, %xmm3 movdqa %xmm4, $in1_z(%rsp) movdqa %xmm5, $in1_z+0x10(%rsp) - por %xmm1, %xmm3 + por %xmm4, %xmm5 movdqu 0x00($a_ptr), %xmm0 # copy *(P256_POINT *)$b_ptr - pshufd \$0xb1, %xmm3, %xmm5 + pshufd \$0xb1, %xmm5, %xmm3 movdqu 0x10($a_ptr), %xmm1 movdqu 0x20($a_ptr), %xmm2 por %xmm3, %xmm5 @@ -2262,14 +2263,14 @@ () movdqa %xmm0, $in2_x(%rsp) pshufd \$0x1e, %xmm5, %xmm4 movdqa %xmm1, $in2_x+0x10(%rsp) - por %xmm0, %xmm1 - movq $r_ptr, %xmm0 # save $r_ptr + movdqu 0x40($a_ptr),%xmm0 # in2_z again + movdqu 0x50($a_ptr),%xmm1 movdqa %xmm2, $in2_y(%rsp) movdqa %xmm3, $in2_y+0x10(%rsp) - por %xmm2, %xmm3 por %xmm4, %xmm5 pxor %xmm4, %xmm4 - por %xmm1, %xmm3 + por %xmm0, %xmm1 + movq $r_ptr, %xmm0 # save $r_ptr lea 0x40-$bias($a_ptr), $a_ptr # $a_ptr is still valid mov $src0, $in2_z+8*0(%rsp) # make in2_z copy @@ -2280,8 +2281,8 @@ () call __ecp_nistz256_sqr_mont$x # p256_sqr_mont(Z2sqr, in2_z); pcmpeqd %xmm4, %xmm5 - pshufd \$0xb1, %xmm3, %xmm4 - por %xmm3, %xmm4 + pshufd \$0xb1, %xmm1, %xmm4 + por %xmm1, %xmm4 pshufd \$0, %xmm5, %xmm5 # in1infty pshufd \$0x1e, %xmm4, %xmm3 por %xmm3, %xmm4 @@ -2405,6 +2406,7 @@ () #lea $Hsqr(%rsp), $r_ptr # 2*U1*H^2 #call __ecp_nistz256_mul_by_2 # ecp_nistz256_mul_by_2(Hsqr, U2); + xor $t4, $t4 add $acc0, $acc0 # a0:a3+a0:a3 lea $Rsqr(%rsp), $a_ptr adc $acc1, $acc1 @@ -2412,7 +2414,7 @@ () adc $acc2, $acc2 adc $acc3, $acc3 mov $acc1, $t1 - sbb $t4, $t4 + adc \$0, $t4 sub \$-1, $acc0 mov $acc2, $t2 @@ -2420,15 +2422,15 @@ () sbb \$0, $acc2 mov $acc3, $t3 sbb $poly3, $acc3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $acc0 + cmovc $t0, $acc0 mov 8*0($a_ptr), $t0 - cmovz $t1, $acc1 + cmovc $t1, $acc1 mov 8*1($a_ptr), $t1 - cmovz $t2, $acc2 + cmovc $t2, $acc2 mov 8*2($a_ptr), $t2 - cmovz $t3, $acc3 + cmovc $t3, $acc3 mov 8*3($a_ptr), $t3 call __ecp_nistz256_sub$x # p256_sub(res_x, Rsqr, Hsqr); @@ -2612,16 +2614,14 @@ () mov 0x40+8*3($a_ptr), $acc0 movdqa %xmm0, $in1_x(%rsp) movdqa %xmm1, $in1_x+0x10(%rsp) - por %xmm0, %xmm1 movdqa %xmm2, $in1_y(%rsp) movdqa %xmm3, $in1_y+0x10(%rsp) - por %xmm2, %xmm3 movdqa %xmm4, $in1_z(%rsp) movdqa %xmm5, $in1_z+0x10(%rsp) - por %xmm1, %xmm3 + por %xmm4, %xmm5 movdqu 0x00($b_ptr), %xmm0 # copy *(P256_POINT_AFFINE *)$b_ptr - pshufd \$0xb1, %xmm3, %xmm5 + pshufd \$0xb1, %xmm5, %xmm3 movdqu 0x10($b_ptr), %xmm1 movdqu 0x20($b_ptr), %xmm2 por %xmm3, %xmm5 @@ -2710,6 +2710,7 @@ () #lea $Hsqr(%rsp), $r_ptr # 2*U1*H^2 #call __ecp_nistz256_mul_by_2 # ecp_nistz256_mul_by_2(Hsqr, U2); + xor $t4, $t4 add $acc0, $acc0 # a0:a3+a0:a3 lea $Rsqr(%rsp), $a_ptr adc $acc1, $acc1 @@ -2717,7 +2718,7 @@ () adc $acc2, $acc2 adc $acc3, $acc3 mov $acc1, $t1 - sbb $t4, $t4 + adc \$0, $t4 sub \$-1, $acc0 mov $acc2, $t2 @@ -2725,15 +2726,15 @@ () sbb \$0, $acc2 mov $acc3, $t3 sbb $poly3, $acc3 - test $t4, $t4 + sbb \$0, $t4 - cmovz $t0, $acc0 + cmovc $t0, $acc0 mov 8*0($a_ptr), $t0 - cmovz $t1, $acc1 + cmovc $t1, $acc1 mov 8*1($a_ptr), $t1 - cmovz $t2, $acc2 + cmovc $t2, $acc2 mov 8*2($a_ptr), $t2 - cmovz $t3, $acc3 + cmovc $t3, $acc3 mov 8*3($a_ptr), $t3 call __ecp_nistz256_sub$x # p256_sub(res_x, Rsqr, Hsqr); @@ -2885,14 +2886,14 @@ () sbb \$0, $a2 mov $a3, $t3 sbb $poly3, $a3 + sbb \$0, $t4 - bt \$0, $t4 - cmovnc $t0, $a0 - cmovnc $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovnc $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovnc $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) @@ -2980,14 +2981,14 @@ () sbb \$0, $a2 mov $a3, $t3 sbb $poly3, $a3 + sbb \$0, $t4 - bt \$0, $t4 - cmovnc $t0, $a0 - cmovnc $t1, $a1 + cmovc $t0, $a0 + cmovc $t1, $a1 mov $a0, 8*0($r_ptr) - cmovnc $t2, $a2 + cmovc $t2, $a2 mov $a1, 8*1($r_ptr) - cmovnc $t3, $a3 + cmovc $t3, $a3 mov $a2, 8*2($r_ptr) mov $a3, 8*3($r_ptr) diff --git a/deps/openssl/openssl/crypto/ec/ec_ameth.c b/deps/openssl/openssl/crypto/ec/ec_ameth.c index 83e208cfe491c2..d089af7a28300b 100644 --- a/deps/openssl/openssl/crypto/ec/ec_ameth.c +++ b/deps/openssl/openssl/crypto/ec/ec_ameth.c @@ -66,9 +66,12 @@ #endif #include #include "asn1_locl.h" +#include "ec_lcl.h" +#ifndef OPENSSL_NO_CMS static int ecdh_cms_decrypt(CMS_RecipientInfo *ri); static int ecdh_cms_encrypt(CMS_RecipientInfo *ri); +#endif static int eckey_param2type(int *pptype, void **ppval, EC_KEY *ec_key) { @@ -221,6 +224,8 @@ static int eckey_pub_cmp(const EVP_PKEY *a, const EVP_PKEY *b) const EC_GROUP *group = EC_KEY_get0_group(b->pkey.ec); const EC_POINT *pa = EC_KEY_get0_public_key(a->pkey.ec), *pb = EC_KEY_get0_public_key(b->pkey.ec); + if (group == NULL || pa == NULL || pb == NULL) + return -2; r = EC_POINT_cmp(group, pa, pb, NULL); if (r == 0) return 1; @@ -299,15 +304,13 @@ static int eckey_priv_decode(EVP_PKEY *pkey, PKCS8_PRIV_KEY_INFO *p8) static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) { - EC_KEY *ec_key; + EC_KEY ec_key = *(pkey->pkey.ec); unsigned char *ep, *p; int eplen, ptype; void *pval; - unsigned int tmp_flags, old_flags; - - ec_key = pkey->pkey.ec; + unsigned int old_flags; - if (!eckey_param2type(&ptype, &pval, ec_key)) { + if (!eckey_param2type(&ptype, &pval, &ec_key)) { ECerr(EC_F_ECKEY_PRIV_ENCODE, EC_R_DECODE_ERROR); return 0; } @@ -318,30 +321,25 @@ static int eckey_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey) * do not include the parameters in the SEC1 private key see PKCS#11 * 12.11 */ - old_flags = EC_KEY_get_enc_flags(ec_key); - tmp_flags = old_flags | EC_PKEY_NO_PARAMETERS; - EC_KEY_set_enc_flags(ec_key, tmp_flags); - eplen = i2d_ECPrivateKey(ec_key, NULL); + old_flags = EC_KEY_get_enc_flags(&ec_key); + EC_KEY_set_enc_flags(&ec_key, old_flags | EC_PKEY_NO_PARAMETERS); + + eplen = i2d_ECPrivateKey(&ec_key, NULL); if (!eplen) { - EC_KEY_set_enc_flags(ec_key, old_flags); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); return 0; } ep = (unsigned char *)OPENSSL_malloc(eplen); if (!ep) { - EC_KEY_set_enc_flags(ec_key, old_flags); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_MALLOC_FAILURE); return 0; } p = ep; - if (!i2d_ECPrivateKey(ec_key, &p)) { - EC_KEY_set_enc_flags(ec_key, old_flags); + if (!i2d_ECPrivateKey(&ec_key, &p)) { OPENSSL_free(ep); ECerr(EC_F_ECKEY_PRIV_ENCODE, ERR_R_EC_LIB); return 0; } - /* restore old encoding flags */ - EC_KEY_set_enc_flags(ec_key, old_flags); if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(NID_X9_62_id_ecPublicKey), 0, ptype, pval, ep, eplen)) @@ -378,7 +376,7 @@ static int ec_bits(const EVP_PKEY *pkey) static int ec_missing_parameters(const EVP_PKEY *pkey) { - if (EC_KEY_get0_group(pkey->pkey.ec) == NULL) + if (pkey->pkey.ec == NULL || EC_KEY_get0_group(pkey->pkey.ec) == NULL) return 1; return 0; } @@ -398,6 +396,8 @@ static int ec_cmp_parameters(const EVP_PKEY *a, const EVP_PKEY *b) { const EC_GROUP *group_a = EC_KEY_get0_group(a->pkey.ec), *group_b = EC_KEY_get0_group(b->pkey.ec); + if (group_a == NULL || group_b == NULL) + return -2; if (EC_GROUP_cmp(group_a, group_b, NULL)) return 0; else diff --git a/deps/openssl/openssl/crypto/ec/ec_key.c b/deps/openssl/openssl/crypto/ec/ec_key.c index bc94ab5661ffed..456080ecfede4b 100644 --- a/deps/openssl/openssl/crypto/ec/ec_key.c +++ b/deps/openssl/openssl/crypto/ec/ec_key.c @@ -377,9 +377,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, return 0; } ctx = BN_CTX_new(); - if (!ctx) - goto err; - + if (ctx == NULL) + return 0; + BN_CTX_start(ctx); point = EC_POINT_new(key->group); if (!point) @@ -432,10 +432,9 @@ int EC_KEY_set_public_key_affine_coordinates(EC_KEY *key, BIGNUM *x, ok = 1; err: - if (ctx) - BN_CTX_free(ctx); - if (point) - EC_POINT_free(point); + BN_CTX_end(ctx); + BN_CTX_free(ctx); + EC_POINT_free(point); return ok; } diff --git a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c index ca44d0aaeec451..99b8d613c8337e 100644 --- a/deps/openssl/openssl/crypto/ec/ecp_nistz256.c +++ b/deps/openssl/openssl/crypto/ec/ecp_nistz256.c @@ -82,19 +82,36 @@ typedef struct ec_pre_comp_st { } EC_PRE_COMP; /* Functions implemented in assembly */ +/* + * Most of below mentioned functions *preserve* the property of inputs + * being fully reduced, i.e. being in [0, modulus) range. Simply put if + * inputs are fully reduced, then output is too. Note that reverse is + * not true, in sense that given partially reduced inputs output can be + * either, not unlikely reduced. And "most" in first sentence refers to + * the fact that given the calculations flow one can tolerate that + * addition, 1st function below, produces partially reduced result *if* + * multiplications by 2 and 3, which customarily use addition, fully + * reduce it. This effectively gives two options: a) addition produces + * fully reduced result [as long as inputs are, just like remaining + * functions]; b) addition is allowed to produce partially reduced + * result, but multiplications by 2 and 3 perform additional reduction + * step. Choice between the two can be platform-specific, but it was a) + * in all cases so far... + */ +/* Modular add: res = a+b mod P */ +void ecp_nistz256_add(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS], + const BN_ULONG b[P256_LIMBS]); /* Modular mul by 2: res = 2*a mod P */ void ecp_nistz256_mul_by_2(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); -/* Modular div by 2: res = a/2 mod P */ -void ecp_nistz256_div_by_2(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS]); /* Modular mul by 3: res = 3*a mod P */ void ecp_nistz256_mul_by_3(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS]); -/* Modular add: res = a+b mod P */ -void ecp_nistz256_add(BN_ULONG res[P256_LIMBS], - const BN_ULONG a[P256_LIMBS], - const BN_ULONG b[P256_LIMBS]); + +/* Modular div by 2: res = a/2 mod P */ +void ecp_nistz256_div_by_2(BN_ULONG res[P256_LIMBS], + const BN_ULONG a[P256_LIMBS]); /* Modular sub: res = a-b mod P */ void ecp_nistz256_sub(BN_ULONG res[P256_LIMBS], const BN_ULONG a[P256_LIMBS], @@ -205,21 +222,29 @@ static BN_ULONG is_equal(const BN_ULONG a[P256_LIMBS], return is_zero(res); } -static BN_ULONG is_one(const BN_ULONG a[P256_LIMBS]) +static BN_ULONG is_one(const BIGNUM *z) { - BN_ULONG res; - - res = a[0] ^ ONE[0]; - res |= a[1] ^ ONE[1]; - res |= a[2] ^ ONE[2]; - res |= a[3] ^ ONE[3]; - if (P256_LIMBS == 8) { - res |= a[4] ^ ONE[4]; - res |= a[5] ^ ONE[5]; - res |= a[6] ^ ONE[6]; + BN_ULONG res = 0; + BN_ULONG *a = z->d; + + if (z->top == (P256_LIMBS - P256_LIMBS / 8)) { + res = a[0] ^ ONE[0]; + res |= a[1] ^ ONE[1]; + res |= a[2] ^ ONE[2]; + res |= a[3] ^ ONE[3]; + if (P256_LIMBS == 8) { + res |= a[4] ^ ONE[4]; + res |= a[5] ^ ONE[5]; + res |= a[6] ^ ONE[6]; + /* + * no check for a[7] (being zero) on 32-bit platforms, + * because value of "one" takes only 7 limbs. + */ + } + res = is_zero(res); } - return is_zero(res); + return res; } static int ecp_nistz256_set_words(BIGNUM *a, BN_ULONG words[P256_LIMBS]) @@ -315,19 +340,16 @@ static void ecp_nistz256_point_add(P256_POINT *r, const BN_ULONG *in2_y = b->Y; const BN_ULONG *in2_z = b->Z; - /* We encode infinity as (0,0), which is not on the curve, - * so it is OK. */ - in1infty = (in1_x[0] | in1_x[1] | in1_x[2] | in1_x[3] | - in1_y[0] | in1_y[1] | in1_y[2] | in1_y[3]); + /* + * Infinity in encoded as (,,0) + */ + in1infty = (in1_z[0] | in1_z[1] | in1_z[2] | in1_z[3]); if (P256_LIMBS == 8) - in1infty |= (in1_x[4] | in1_x[5] | in1_x[6] | in1_x[7] | - in1_y[4] | in1_y[5] | in1_y[6] | in1_y[7]); + in1infty |= (in1_z[4] | in1_z[5] | in1_z[6] | in1_z[7]); - in2infty = (in2_x[0] | in2_x[1] | in2_x[2] | in2_x[3] | - in2_y[0] | in2_y[1] | in2_y[2] | in2_y[3]); + in2infty = (in2_z[0] | in2_z[1] | in2_z[2] | in2_z[3]); if (P256_LIMBS == 8) - in2infty |= (in2_x[4] | in2_x[5] | in2_x[6] | in2_x[7] | - in2_y[4] | in2_y[5] | in2_y[6] | in2_y[7]); + in2infty |= (in2_z[4] | in2_z[5] | in2_z[6] | in2_z[7]); in1infty = is_zero(in1infty); in2infty = is_zero(in2infty); @@ -416,15 +438,16 @@ static void ecp_nistz256_point_add_affine(P256_POINT *r, const BN_ULONG *in2_y = b->Y; /* - * In affine representation we encode infty as (0,0), which is not on the - * curve, so it is OK + * Infinity in encoded as (,,0) */ - in1infty = (in1_x[0] | in1_x[1] | in1_x[2] | in1_x[3] | - in1_y[0] | in1_y[1] | in1_y[2] | in1_y[3]); + in1infty = (in1_z[0] | in1_z[1] | in1_z[2] | in1_z[3]); if (P256_LIMBS == 8) - in1infty |= (in1_x[4] | in1_x[5] | in1_x[6] | in1_x[7] | - in1_y[4] | in1_y[5] | in1_y[6] | in1_y[7]); + in1infty |= (in1_z[4] | in1_z[5] | in1_z[6] | in1_z[7]); + /* + * In affine representation we encode infinity as (0,0), which is + * not on the curve, so it is OK + */ in2infty = (in2_x[0] | in2_x[1] | in2_x[2] | in2_x[3] | in2_y[0] | in2_y[1] | in2_y[2] | in2_y[3]); if (P256_LIMBS == 8) @@ -741,9 +764,8 @@ static int ecp_nistz256_is_affine_G(const EC_POINT *generator) { return (generator->X.top == P256_LIMBS) && (generator->Y.top == P256_LIMBS) && - (generator->Z.top == (P256_LIMBS - P256_LIMBS / 8)) && is_equal(generator->X.d, def_xG) && - is_equal(generator->Y.d, def_yG) && is_one(generator->Z.d); + is_equal(generator->Y.d, def_yG) && is_one(&generator->Z); } static int ecp_nistz256_mult_precompute(EC_GROUP *group, BN_CTX *ctx) @@ -1249,6 +1271,8 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group, } else #endif { + BN_ULONG infty; + /* First window */ wvalue = (p_str[0] << 1) & mask; index += window_size; @@ -1260,7 +1284,30 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group, ecp_nistz256_neg(p.p.Z, p.p.Y); copy_conditional(p.p.Y, p.p.Z, wvalue & 1); - memcpy(p.p.Z, ONE, sizeof(ONE)); + /* + * Since affine infinity is encoded as (0,0) and + * Jacobian ias (,,0), we need to harmonize them + * by assigning "one" or zero to Z. + */ + infty = (p.p.X[0] | p.p.X[1] | p.p.X[2] | p.p.X[3] | + p.p.Y[0] | p.p.Y[1] | p.p.Y[2] | p.p.Y[3]); + if (P256_LIMBS == 8) + infty |= (p.p.X[4] | p.p.X[5] | p.p.X[6] | p.p.X[7] | + p.p.Y[4] | p.p.Y[5] | p.p.Y[6] | p.p.Y[7]); + + infty = 0 - is_zero(infty); + infty = ~infty; + + p.p.Z[0] = ONE[0] & infty; + p.p.Z[1] = ONE[1] & infty; + p.p.Z[2] = ONE[2] & infty; + p.p.Z[3] = ONE[3] & infty; + if (P256_LIMBS == 8) { + p.p.Z[4] = ONE[4] & infty; + p.p.Z[5] = ONE[5] & infty; + p.p.Z[6] = ONE[6] & infty; + p.p.Z[7] = ONE[7] & infty; + } for (i = 1; i < 37; i++) { unsigned int off = (index - 1) / 8; @@ -1331,7 +1378,7 @@ static int ecp_nistz256_points_mul(const EC_GROUP *group, !ecp_nistz256_set_words(&r->Z, p.p.Z)) { goto err; } - r->Z_is_one = is_one(p.p.Z) & 1; + r->Z_is_one = is_one(&r->Z) & 1; ret = 1; diff --git a/deps/openssl/openssl/crypto/engine/eng_cryptodev.c b/deps/openssl/openssl/crypto/engine/eng_cryptodev.c index 8fb9c3373dd67a..2a2b95ce837e24 100644 --- a/deps/openssl/openssl/crypto/engine/eng_cryptodev.c +++ b/deps/openssl/openssl/crypto/engine/eng_cryptodev.c @@ -26,6 +26,7 @@ * */ +#include #include #include #include @@ -934,11 +935,15 @@ static int cryptodev_digest_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) return (0); } + dstate->mac_len = fstate->mac_len; if (fstate->mac_len != 0) { if (fstate->mac_data != NULL) { dstate->mac_data = OPENSSL_malloc(fstate->mac_len); + if (dstate->mac_data == NULL) { + printf("cryptodev_digest_init: malloc failed\n"); + return 0; + } memcpy(dstate->mac_data, fstate->mac_data, fstate->mac_len); - dstate->mac_len = fstate->mac_len; } } @@ -1064,8 +1069,7 @@ static void zapparams(struct crypt_kop *kop) int i; for (i = 0; i < kop->crk_iparams + kop->crk_oparams; i++) { - if (kop->crk_param[i].crp_p) - free(kop->crk_param[i].crp_p); + OPENSSL_free(kop->crk_param[i].crp_p); kop->crk_param[i].crp_p = NULL; kop->crk_param[i].crp_nbits = 0; } @@ -1078,16 +1082,25 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, int fd, ret = -1; if ((fd = get_asym_dev_crypto()) < 0) - return (ret); + return ret; if (r) { - kop->crk_param[kop->crk_iparams].crp_p = calloc(rlen, sizeof(char)); + kop->crk_param[kop->crk_iparams].crp_p = OPENSSL_malloc(rlen); + if (kop->crk_param[kop->crk_iparams].crp_p == NULL) + return ret; + memset(kop->crk_param[kop->crk_iparams].crp_p, 0, (size_t)rlen); kop->crk_param[kop->crk_iparams].crp_nbits = rlen * 8; kop->crk_oparams++; } if (s) { - kop->crk_param[kop->crk_iparams + 1].crp_p = - calloc(slen, sizeof(char)); + kop->crk_param[kop->crk_iparams + 1].crp_p = OPENSSL_malloc(slen); + /* No need to free the kop->crk_iparams parameter if it was allocated, + * callers of this routine have to free allocated parameters through + * zapparams both in case of success and failure + */ + if (kop->crk_param[kop->crk_iparams+1].crp_p == NULL) + return ret; + memset(kop->crk_param[kop->crk_iparams + 1].crp_p, 0, (size_t)slen); kop->crk_param[kop->crk_iparams + 1].crp_nbits = slen * 8; kop->crk_oparams++; } @@ -1100,7 +1113,7 @@ cryptodev_asym(struct crypt_kop *kop, int rlen, BIGNUM *r, int slen, ret = 0; } - return (ret); + return ret; } static int diff --git a/deps/openssl/openssl/crypto/err/openssl.ec b/deps/openssl/openssl/crypto/err/openssl.ec index 139afe3234f537..04dc9ce66ae0d5 100644 --- a/deps/openssl/openssl/crypto/err/openssl.ec +++ b/deps/openssl/openssl/crypto/err/openssl.ec @@ -32,7 +32,7 @@ L ECDSA crypto/ecdsa/ecdsa.h crypto/ecdsa/ecs_err.c L ECDH crypto/ecdh/ecdh.h crypto/ecdh/ech_err.c L STORE crypto/store/store.h crypto/store/str_err.c L TS crypto/ts/ts.h crypto/ts/ts_err.c -L HMAC crypto/hmac/hmac.h crypto/hmac/hmac_err.c +#L HMAC crypto/hmac/hmac.h crypto/hmac/hmac_err.c L CMS crypto/cms/cms.h crypto/cms/cms_err.c L JPAKE crypto/jpake/jpake.h crypto/jpake/jpake_err.c diff --git a/deps/openssl/openssl/crypto/evp/bio_enc.c b/deps/openssl/openssl/crypto/evp/bio_enc.c index 363e0246aedc91..0806f233b67d0c 100644 --- a/deps/openssl/openssl/crypto/evp/bio_enc.c +++ b/deps/openssl/openssl/crypto/evp/bio_enc.c @@ -201,9 +201,14 @@ static int enc_read(BIO *b, char *out, int outl) break; } } else { - EVP_CipherUpdate(&(ctx->cipher), - (unsigned char *)ctx->buf, &ctx->buf_len, - (unsigned char *)&(ctx->buf[BUF_OFFSET]), i); + if (!EVP_CipherUpdate(&ctx->cipher, + (unsigned char *)ctx->buf, &ctx->buf_len, + (unsigned char *)&(ctx->buf[BUF_OFFSET]), + i)) { + BIO_clear_retry_flags(b); + ctx->ok = 0; + return 0; + } ctx->cont = 1; /* * Note: it is possible for EVP_CipherUpdate to decrypt zero @@ -260,9 +265,13 @@ static int enc_write(BIO *b, const char *in, int inl) ctx->buf_off = 0; while (inl > 0) { n = (inl > ENC_BLOCK_SIZE) ? ENC_BLOCK_SIZE : inl; - EVP_CipherUpdate(&(ctx->cipher), - (unsigned char *)ctx->buf, &ctx->buf_len, - (unsigned char *)in, n); + if (!EVP_CipherUpdate(&ctx->cipher, + (unsigned char *)ctx->buf, &ctx->buf_len, + (unsigned char *)in, n)) { + BIO_clear_retry_flags(b); + ctx->ok = 0; + return 0; + } inl -= n; in += n; diff --git a/deps/openssl/openssl/crypto/evp/bio_ok.c b/deps/openssl/openssl/crypto/evp/bio_ok.c index 5c32e35e17b9cf..16e151f1101700 100644 --- a/deps/openssl/openssl/crypto/evp/bio_ok.c +++ b/deps/openssl/openssl/crypto/evp/bio_ok.c @@ -491,7 +491,7 @@ static int sig_out(BIO *b) * FIXME: there's absolutely no guarantee this makes any sense at all, * particularly now EVP_MD_CTX has been restructured. */ - if (RAND_pseudo_bytes(md->md_data, md->digest->md_size) < 0) + if (RAND_bytes(md->md_data, md->digest->md_size) <= 0) goto berr; memcpy(&(ctx->buf[ctx->buf_len]), md->md_data, md->digest->md_size); longswap(&(ctx->buf[ctx->buf_len]), md->digest->md_size); diff --git a/deps/openssl/openssl/crypto/evp/c_all.c b/deps/openssl/openssl/crypto/evp/c_all.c index a3ed00d4c1691f..719e34d22fde83 100644 --- a/deps/openssl/openssl/crypto/evp/c_all.c +++ b/deps/openssl/openssl/crypto/evp/c_all.c @@ -82,9 +82,4 @@ void OPENSSL_add_all_algorithms_noconf(void) OPENSSL_cpuid_setup(); OpenSSL_add_all_ciphers(); OpenSSL_add_all_digests(); -#ifndef OPENSSL_NO_ENGINE -# if defined(__OpenBSD__) || defined(__FreeBSD__) || defined(HAVE_CRYPTODEV) - ENGINE_setup_bsd_cryptodev(); -# endif -#endif } diff --git a/deps/openssl/openssl/crypto/evp/digest.c b/deps/openssl/openssl/crypto/evp/digest.c index 5b642b23fc1c62..4db179629d0404 100644 --- a/deps/openssl/openssl/crypto/evp/digest.c +++ b/deps/openssl/openssl/crypto/evp/digest.c @@ -253,10 +253,10 @@ int EVP_DigestInit_ex(EVP_MD_CTX *ctx, const EVP_MD *type, ENGINE *impl) int EVP_DigestUpdate(EVP_MD_CTX *ctx, const void *data, size_t count) { #ifdef OPENSSL_FIPS - return FIPS_digestupdate(ctx, data, count); -#else - return ctx->update(ctx, data, count); + if (FIPS_mode()) + return FIPS_digestupdate(ctx, data, count); #endif + return ctx->update(ctx, data, count); } /* The caller can assume that this removes any secret data from the context */ @@ -271,10 +271,11 @@ int EVP_DigestFinal(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) /* The caller can assume that this removes any secret data from the context */ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) { -#ifdef OPENSSL_FIPS - return FIPS_digestfinal(ctx, md, size); -#else int ret; +#ifdef OPENSSL_FIPS + if (FIPS_mode()) + return FIPS_digestfinal(ctx, md, size); +#endif OPENSSL_assert(ctx->digest->md_size <= EVP_MAX_MD_SIZE); ret = ctx->digest->final(ctx, md); @@ -284,9 +285,8 @@ int EVP_DigestFinal_ex(EVP_MD_CTX *ctx, unsigned char *md, unsigned int *size) ctx->digest->cleanup(ctx); EVP_MD_CTX_set_flags(ctx, EVP_MD_CTX_FLAG_CLEANED); } - memset(ctx->md_data, 0, ctx->digest->ctx_size); + OPENSSL_cleanse(ctx->md_data, ctx->digest->ctx_size); return ret; -#endif } int EVP_MD_CTX_copy(EVP_MD_CTX *out, const EVP_MD_CTX *in) diff --git a/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c b/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c index 2da11178294dd4..5e92855dfdc01e 100644 --- a/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c +++ b/deps/openssl/openssl/crypto/evp/e_rc4_hmac_md5.c @@ -99,7 +99,7 @@ static int rc4_hmac_md5_init_key(EVP_CIPHER_CTX *ctx, return 1; } -# if !defined(OPENSSL_NO_ASM) && ( \ +# if defined(RC4_ASM) && defined(MD5_ASM) && ( \ defined(__x86_64) || defined(__x86_64__) || \ defined(_M_AMD64) || defined(_M_X64) || \ defined(__INTEL__) ) && \ @@ -254,6 +254,8 @@ static int rc4_hmac_md5_ctrl(EVP_CIPHER_CTX *ctx, int type, int arg, MD5_Init(&key->tail); MD5_Update(&key->tail, hmac_key, sizeof(hmac_key)); + OPENSSL_cleanse(hmac_key, sizeof(hmac_key)); + return 1; } case EVP_CTRL_AEAD_TLS1_AAD: diff --git a/deps/openssl/openssl/crypto/evp/e_seed.c b/deps/openssl/openssl/crypto/evp/e_seed.c index 7249d1b1eecb46..3d01eacac06e7c 100644 --- a/deps/openssl/openssl/crypto/evp/e_seed.c +++ b/deps/openssl/openssl/crypto/evp/e_seed.c @@ -70,7 +70,8 @@ typedef struct { } EVP_SEED_KEY; IMPLEMENT_BLOCK_CIPHER(seed, ks, SEED, EVP_SEED_KEY, NID_seed, - 16, 16, 16, 128, 0, seed_init_key, 0, 0, 0, 0) + 16, 16, 16, 128, EVP_CIPH_FLAG_DEFAULT_ASN1, + seed_init_key, 0, 0, 0, 0) static int seed_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, const unsigned char *iv, int enc) diff --git a/deps/openssl/openssl/crypto/evp/evp_enc.c b/deps/openssl/openssl/crypto/evp/evp_enc.c index 7d7be245b021a3..0e40f09f2f91f4 100644 --- a/deps/openssl/openssl/crypto/evp/evp_enc.c +++ b/deps/openssl/openssl/crypto/evp/evp_enc.c @@ -170,7 +170,7 @@ int EVP_CipherInit_ex(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, #ifdef OPENSSL_FIPS if (FIPS_mode()) { - const EVP_CIPHER *fcipher; + const EVP_CIPHER *fcipher = NULL; if (cipher) fcipher = evp_get_fips_cipher(cipher); if (fcipher) diff --git a/deps/openssl/openssl/crypto/evp/evp_test.c b/deps/openssl/openssl/crypto/evp/evp_test.c old mode 100644 new mode 100755 index d7441ec7b70282..98796427bf49d3 --- a/deps/openssl/openssl/crypto/evp/evp_test.c +++ b/deps/openssl/openssl/crypto/evp/evp_test.c @@ -76,6 +76,7 @@ static void hexdump(FILE *f, const char *title, const unsigned char *s, int l) static int convert(unsigned char *s) { unsigned char *d; + int digits = 0; for (d = s; *s; s += 2, ++d) { unsigned int n; @@ -86,8 +87,9 @@ static int convert(unsigned char *s) } sscanf((char *)s, "%2x", &n); *d = (unsigned char)n; + digits++; } - return s - d; + return digits; } static char *sstrsep(char **string, const char *delim) diff --git a/deps/openssl/openssl/crypto/evp/openbsd_hw.c b/deps/openssl/openssl/crypto/evp/openbsd_hw.c index 75d12e2330282d..07decf26743376 100644 --- a/deps/openssl/openssl/crypto/evp/openbsd_hw.c +++ b/deps/openssl/openssl/crypto/evp/openbsd_hw.c @@ -133,6 +133,10 @@ static int dev_crypto_init_key(EVP_CIPHER_CTX *ctx, int cipher, return 0; CDATA(ctx)->key = OPENSSL_malloc(MAX_HW_KEY); + if (CDATA(ctx)->key == NULL { + err("CDATA(ctx)->key memory allocation failed"); + return 0; + } assert(ctx->cipher->iv_len <= MAX_HW_IV); @@ -186,6 +190,11 @@ static int dev_crypto_cipher(EVP_CIPHER_CTX *ctx, unsigned char *out, if (((unsigned long)in & 3) || cinl != inl) { cin = OPENSSL_malloc(cinl); + if (cin == NULL) { + err("cin - memory allocation failed"); + abort(); + return 0; + } memcpy(cin, in, inl); cryp.src = cin; } @@ -334,6 +343,11 @@ static int do_digest(int ses, unsigned char *md, const void *data, int len) char *dcopy; dcopy = OPENSSL_malloc(len); + if (dcopy == NULL) { + err("dcopy - memory allocation failed"); + abort(); + return 0; + } memcpy(dcopy, data, len); cryp.src = dcopy; cryp.dst = cryp.src; // FIXME!!! @@ -364,6 +378,10 @@ static int dev_crypto_md5_update(EVP_MD_CTX *ctx, const void *data, return do_digest(md_data->sess.ses, md_data->md, data, len); md_data->data = OPENSSL_realloc(md_data->data, md_data->len + len); + if (md_data->data == NULL) { + err("DEV_CRYPTO_MD5_UPDATE: unable to allocate memory"); + abort(); + } memcpy(md_data->data + md_data->len, data, len); md_data->len += len; @@ -397,6 +415,10 @@ static int dev_crypto_md5_copy(EVP_MD_CTX *to, const EVP_MD_CTX *from) assert(from->digest->flags & EVP_MD_FLAG_ONESHOT); to_md->data = OPENSSL_malloc(from_md->len); + if (to_md->data == NULL) { + err("DEV_CRYPTO_MD5_COPY: unable to allocate memory"); + abort(); + } memcpy(to_md->data, from_md->data, from_md->len); return 1; diff --git a/deps/openssl/openssl/crypto/evp/p_lib.c b/deps/openssl/openssl/crypto/evp/p_lib.c index c0171244d5d010..545d04fd7744f0 100644 --- a/deps/openssl/openssl/crypto/evp/p_lib.c +++ b/deps/openssl/openssl/crypto/evp/p_lib.c @@ -130,6 +130,14 @@ int EVP_PKEY_copy_parameters(EVP_PKEY *to, const EVP_PKEY *from) EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_MISSING_PARAMETERS); goto err; } + + if (!EVP_PKEY_missing_parameters(to)) { + if (EVP_PKEY_cmp_parameters(to, from) == 1) + return 1; + EVPerr(EVP_F_EVP_PKEY_COPY_PARAMETERS, EVP_R_DIFFERENT_PARAMETERS); + return 0; + } + if (from->ameth && from->ameth->param_copy) return from->ameth->param_copy(to, from); err: diff --git a/deps/openssl/openssl/crypto/evp/pmeth_gn.c b/deps/openssl/openssl/crypto/evp/pmeth_gn.c index 6435f1b632cfe8..6a4d3573ff7673 100644 --- a/deps/openssl/openssl/crypto/evp/pmeth_gn.c +++ b/deps/openssl/openssl/crypto/evp/pmeth_gn.c @@ -149,8 +149,10 @@ int EVP_PKEY_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) if (!ppkey) return -1; - if (!*ppkey) + if (*ppkey == NULL) *ppkey = EVP_PKEY_new(); + if (*ppkey == NULL) + return -1; ret = ctx->pmeth->keygen(ctx, *ppkey); if (ret <= 0) { diff --git a/deps/openssl/openssl/crypto/evp/pmeth_lib.c b/deps/openssl/openssl/crypto/evp/pmeth_lib.c index 9f81d10021a065..9668b3a9bcfb9c 100644 --- a/deps/openssl/openssl/crypto/evp/pmeth_lib.c +++ b/deps/openssl/openssl/crypto/evp/pmeth_lib.c @@ -91,7 +91,9 @@ static const EVP_PKEY_METHOD *standard_methods[] = { &ec_pkey_meth, #endif &hmac_pkey_meth, +#ifndef OPENSSL_NO_CMAC &cmac_pkey_meth, +#endif #ifndef OPENSSL_NO_DH &dhx_pkey_meth #endif diff --git a/deps/openssl/openssl/crypto/hmac/hmac.c b/deps/openssl/openssl/crypto/hmac/hmac.c index 51a0a3efcd672d..213504e85fee58 100644 --- a/deps/openssl/openssl/crypto/hmac/hmac.c +++ b/deps/openssl/openssl/crypto/hmac/hmac.c @@ -234,7 +234,7 @@ void HMAC_CTX_cleanup(HMAC_CTX *ctx) EVP_MD_CTX_cleanup(&ctx->i_ctx); EVP_MD_CTX_cleanup(&ctx->o_ctx); EVP_MD_CTX_cleanup(&ctx->md_ctx); - memset(ctx, 0, sizeof *ctx); + OPENSSL_cleanse(ctx, sizeof *ctx); } unsigned char *HMAC(const EVP_MD *evp_md, const void *key, int key_len, diff --git a/deps/openssl/openssl/crypto/jpake/jpake.c b/deps/openssl/openssl/crypto/jpake/jpake.c index ebc09755756d31..2ba75f0172c1cf 100644 --- a/deps/openssl/openssl/crypto/jpake/jpake.c +++ b/deps/openssl/openssl/crypto/jpake/jpake.c @@ -116,6 +116,8 @@ JPAKE_CTX *JPAKE_CTX_new(const char *name, const char *peer_name, const BIGNUM *secret) { JPAKE_CTX *ctx = OPENSSL_malloc(sizeof *ctx); + if (ctx == NULL) + return NULL; JPAKE_CTX_init(ctx, name, peer_name, p, g, q, secret); @@ -151,6 +153,8 @@ static void hashbn(SHA_CTX *sha, const BIGNUM *bn) size_t l = BN_num_bytes(bn); unsigned char *bin = OPENSSL_malloc(l); + if (bin == NULL) + return; hashlength(sha, l); BN_bn2bin(bn, bin); SHA1_Update(sha, bin, l); diff --git a/deps/openssl/openssl/crypto/lhash/lhash.c b/deps/openssl/openssl/crypto/lhash/lhash.c index 53c5c138bb67ad..f20353aea33f4f 100644 --- a/deps/openssl/openssl/crypto/lhash/lhash.c +++ b/deps/openssl/openssl/crypto/lhash/lhash.c @@ -335,8 +335,8 @@ static void expand(_LHASH *lh) n = (LHASH_NODE **)OPENSSL_realloc(lh->b, (int)(sizeof(LHASH_NODE *) * j)); if (n == NULL) { -/* fputs("realloc error in lhash",stderr); */ lh->error++; + lh->num_nodes--; lh->p = 0; return; } diff --git a/deps/openssl/openssl/crypto/md2/md2_dgst.c b/deps/openssl/openssl/crypto/md2/md2_dgst.c index 9cd79f8d70c38d..7f5d9ba69ba234 100644 --- a/deps/openssl/openssl/crypto/md2/md2_dgst.c +++ b/deps/openssl/openssl/crypto/md2/md2_dgst.c @@ -219,6 +219,6 @@ int MD2_Final(unsigned char *md, MD2_CTX *c) for (i = 0; i < 16; i++) md[i] = (UCHAR) (p1[i] & 0xff); - memset((char *)&c, 0, sizeof(c)); + OPENSSL_cleanse(c, sizeof(*c)); return 1; } diff --git a/deps/openssl/openssl/crypto/md32_common.h b/deps/openssl/openssl/crypto/md32_common.h index 96828d2693a1d2..b5a04bf133bdf2 100644 --- a/deps/openssl/openssl/crypto/md32_common.h +++ b/deps/openssl/openssl/crypto/md32_common.h @@ -109,6 +109,8 @@ * */ +#include + #if !defined(DATA_ORDER_IS_BIG_ENDIAN) && !defined(DATA_ORDER_IS_LITTLE_ENDIAN) # error "DATA_ORDER must be defined!" #endif @@ -329,6 +331,12 @@ int HASH_UPDATE(HASH_CTX *c, const void *data_, size_t len) data += n; len -= n; c->num = 0; + /* + * We use memset rather than OPENSSL_cleanse() here deliberately. + * Using OPENSSL_cleanse() here could be a performance issue. It + * will get properly cleansed on finalisation so this isn't a + * security problem. + */ memset(p, 0, HASH_CBLOCK); /* keep it zeroed */ } else { memcpy(p + n, data, len); @@ -384,7 +392,7 @@ int HASH_FINAL(unsigned char *md, HASH_CTX *c) p -= HASH_CBLOCK; HASH_BLOCK_DATA_ORDER(c, p, 1); c->num = 0; - memset(p, 0, HASH_CBLOCK); + OPENSSL_cleanse(p, HASH_CBLOCK); #ifndef HASH_MAKE_STRING # error "HASH_MAKE_STRING must be defined!" diff --git a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c index 6615cf84d7d2a2..2dce4936337a03 100644 --- a/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c +++ b/deps/openssl/openssl/crypto/mdc2/mdc2dgst.c @@ -91,7 +91,7 @@ int MDC2_Update(MDC2_CTX *c, const unsigned char *in, size_t len) i = c->num; if (i != 0) { - if (i + len < MDC2_BLOCK) { + if (len < MDC2_BLOCK - i) { /* partial block */ memcpy(&(c->data[i]), in, len); c->num += (int)len; diff --git a/deps/openssl/openssl/crypto/mem.c b/deps/openssl/openssl/crypto/mem.c index fdad49b76ec00a..06c3960cc6c05b 100644 --- a/deps/openssl/openssl/crypto/mem.c +++ b/deps/openssl/openssl/crypto/mem.c @@ -82,6 +82,14 @@ static void *default_malloc_ex(size_t num, const char *file, int line) static void *(*malloc_ex_func) (size_t, const char *file, int line) = default_malloc_ex; +#ifdef OPENSSL_SYS_VMS +# if __INITIAL_POINTER_SIZE == 64 +# define realloc _realloc64 +# elif __INITIAL_POINTER_SIZE == 32 +# define realloc _realloc32 +# endif +#endif + static void *(*realloc_func) (void *, size_t) = realloc; static void *default_realloc_ex(void *str, size_t num, const char *file, int line) @@ -92,7 +100,11 @@ static void *default_realloc_ex(void *str, size_t num, static void *(*realloc_ex_func) (void *, size_t, const char *file, int line) = default_realloc_ex; -static void (*free_func) (void *) = free; +#ifdef OPENSSL_SYS_VMS + static void (*free_func) (__void_ptr64) = free; +#else + static void (*free_func) (void *) = free; +#endif static void *(*malloc_locked_func) (size_t) = malloc; static void *default_malloc_locked_ex(size_t num, const char *file, int line) @@ -103,7 +115,11 @@ static void *default_malloc_locked_ex(size_t num, const char *file, int line) static void *(*malloc_locked_ex_func) (size_t, const char *file, int line) = default_malloc_locked_ex; -static void (*free_locked_func) (void *) = free; +#ifdef OPENSSL_SYS_VMS + static void (*free_locked_func) (__void_ptr64) = free; +#else + static void (*free_locked_func) (void *) = free; +#endif /* may be changed as long as 'allow_customize_debug' is set */ /* XXX use correct function pointer types */ @@ -298,18 +314,6 @@ void *CRYPTO_malloc_locked(int num, const char *file, int line) if (malloc_debug_func != NULL) malloc_debug_func(ret, num, file, line, 1); -#ifndef OPENSSL_CPUID_OBJ - /* - * Create a dependency on the value of 'cleanse_ctr' so our memory - * sanitisation function can't be optimised out. NB: We only do this for - * >2Kb so the overhead doesn't bother us. - */ - if (ret && (num > 2048)) { - extern unsigned char cleanse_ctr; - ((unsigned char *)ret)[0] = cleanse_ctr; - } -#endif - return ret; } @@ -346,18 +350,6 @@ void *CRYPTO_malloc(int num, const char *file, int line) if (malloc_debug_func != NULL) malloc_debug_func(ret, num, file, line, 1); -#ifndef OPENSSL_CPUID_OBJ - /* - * Create a dependency on the value of 'cleanse_ctr' so our memory - * sanitisation function can't be optimised out. NB: We only do this for - * >2Kb so the overhead doesn't bother us. - */ - if (ret && (num > 2048)) { - extern unsigned char cleanse_ctr; - ((unsigned char *)ret)[0] = cleanse_ctr; - } -#endif - return ret; } diff --git a/deps/openssl/openssl/crypto/mem_clr.c b/deps/openssl/openssl/crypto/mem_clr.c index ab85344eef386b..579e9d18251d51 100644 --- a/deps/openssl/openssl/crypto/mem_clr.c +++ b/deps/openssl/openssl/crypto/mem_clr.c @@ -60,22 +60,16 @@ #include #include -unsigned char cleanse_ctr = 0; +/* + * Pointer to memset is volatile so that compiler must de-reference + * the pointer and can't assume that it points to any function in + * particular (such as memset, which it then might further "optimize") + */ +typedef void *(*memset_t)(void *,int,size_t); + +static volatile memset_t memset_func = memset; void OPENSSL_cleanse(void *ptr, size_t len) { - unsigned char *p = ptr; - size_t loop = len, ctr = cleanse_ctr; - - if (ptr == NULL) - return; - - while (loop--) { - *(p++) = (unsigned char)ctr; - ctr += (17 + ((size_t)p & 0xF)); - } - p = memchr(ptr, (unsigned char)ctr, len); - if (p) - ctr += (63 + (size_t)p); - cleanse_ctr = (unsigned char)ctr; + memset_func(ptr, 0, len); } diff --git a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl index 5bc28702019a17..b129ba706f0f01 100644 --- a/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl +++ b/deps/openssl/openssl/crypto/modes/asm/ghash-sparcv9.pl @@ -445,6 +445,8 @@ .align 32 gcm_ghash_vis3: save %sp,-$frame,%sp + nop + srln $len,0,$len ! needed on v8+, "nop" on v9 ldx [$Xip+8],$C2 ! load Xi ldx [$Xip+0],$C3 diff --git a/deps/openssl/openssl/crypto/o_init.c b/deps/openssl/openssl/crypto/o_init.c index 2088388128e60f..185841ea048c59 100644 --- a/deps/openssl/openssl/crypto/o_init.c +++ b/deps/openssl/openssl/crypto/o_init.c @@ -73,6 +73,9 @@ void OPENSSL_init(void) done = 1; #ifdef OPENSSL_FIPS FIPS_set_locking_callbacks(CRYPTO_lock, CRYPTO_add_lock); +# ifndef OPENSSL_NO_DEPRECATED + FIPS_crypto_set_id_callback(CRYPTO_thread_id); +# endif FIPS_set_error_callbacks(ERR_put_error, ERR_add_error_vdata); FIPS_set_malloc_callbacks(CRYPTO_malloc, CRYPTO_free); RAND_init_fips(); diff --git a/deps/openssl/openssl/crypto/o_time.c b/deps/openssl/openssl/crypto/o_time.c old mode 100644 new mode 100755 index 635dae184d2fee..b99e5990b4e4e9 --- a/deps/openssl/openssl/crypto/o_time.c +++ b/deps/openssl/openssl/crypto/o_time.c @@ -78,7 +78,28 @@ # include # include # endif /* ndef VMS_GMTIME_OK */ -#endif + + +/* + * Needed to pick up the correct definitions and declarations in some of the + * DEC C Header Files (*.H). + */ +# define __NEW_STARLET 1 + +# if (defined(__alpha) || defined(__ia64)) +# include +# else + +/* VAX */ +typedef struct _ile3 { /* Copied from ILEDEF.H for Alpha */ +# pragma __nomember_alignment + unsigned short int ile3$w_length; /* Length of buffer in bytes */ + unsigned short int ile3$w_code; /* Item code value */ + void *ile3$ps_bufaddr; /* Buffer address */ + unsigned short int *ile3$ps_retlen_addr; /* Address of word for returned length */ +} ILE3; +# endif /* alpha || ia64 */ +#endif /* OPENSSL_SYS_VMS */ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) { @@ -105,26 +126,42 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) static $DESCRIPTOR(lognam, "SYS$TIMEZONE_DIFFERENTIAL"); char logvalue[256]; unsigned int reslen = 0; - struct { - short buflen; - short code; - void *bufaddr; - unsigned int *reslen; - } itemlist[] = { - { - 0, LNM$_STRING, 0, 0 - }, - { - 0, 0, 0, 0 - }, - }; +# if __INITIAL_POINTER_SIZE == 64 + ILEB_64 itemlist[2], *pitem; +# else + ILE3 itemlist[2], *pitem; +# endif int status; time_t t; + + /* + * Setup an itemlist for the call to $TRNLNM - Translate Logical Name. + */ + pitem = itemlist; + +# if __INITIAL_POINTER_SIZE == 64 + pitem->ileb_64$w_mbo = 1; + pitem->ileb_64$w_code = LNM$_STRING; + pitem->ileb_64$l_mbmo = -1; + pitem->ileb_64$q_length = sizeof (logvalue); + pitem->ileb_64$pq_bufaddr = logvalue; + pitem->ileb_64$pq_retlen_addr = (unsigned __int64 *) &reslen; + pitem++; + /* Last item of the item list is null terminated */ + pitem->ileb_64$q_length = pitem->ileb_64$w_code = 0; +# else + pitem->ile3$w_length = sizeof (logvalue); + pitem->ile3$w_code = LNM$_STRING; + pitem->ile3$ps_bufaddr = logvalue; + pitem->ile3$ps_retlen_addr = (unsigned short int *) &reslen; + pitem++; + /* Last item of the item list is null terminated */ + pitem->ile3$w_length = pitem->ile3$w_code = 0; +# endif + + /* Get the value for SYS$TIMEZONE_DIFFERENTIAL */ - itemlist[0].buflen = sizeof(logvalue); - itemlist[0].bufaddr = logvalue; - itemlist[0].reslen = &reslen; status = sys$trnlnm(0, &tabnam, &lognam, 0, itemlist); if (!(status & 1)) return NULL; @@ -132,7 +169,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result) t = *timer; -/* The following is extracted from the DEC C header time.h */ + /* The following is extracted from the DEC C header time.h */ /* ** Beginning in OpenVMS Version 7.0 mktime, time, ctime, strftime ** have two implementations. One implementation is provided diff --git a/deps/openssl/openssl/crypto/objects/o_names.c b/deps/openssl/openssl/crypto/objects/o_names.c index 24859926ace6d9..f106905ffa77f4 100644 --- a/deps/openssl/openssl/crypto/objects/o_names.c +++ b/deps/openssl/openssl/crypto/objects/o_names.c @@ -191,7 +191,7 @@ int OBJ_NAME_add(const char *name, int type, const char *data) onp = (OBJ_NAME *)OPENSSL_malloc(sizeof(OBJ_NAME)); if (onp == NULL) { /* ERROR */ - return (0); + return 0; } onp->name = name; @@ -216,10 +216,11 @@ int OBJ_NAME_add(const char *name, int type, const char *data) } else { if (lh_OBJ_NAME_error(names_lh)) { /* ERROR */ - return (0); + OPENSSL_free(onp); + return 0; } } - return (1); + return 1; } int OBJ_NAME_remove(const char *name, int type) diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c b/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c index b3612c8dfc7974..fca7db0b71d6b6 100644 --- a/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c +++ b/deps/openssl/openssl/crypto/ocsp/ocsp_cl.c @@ -93,8 +93,10 @@ OCSP_ONEREQ *OCSP_request_add0_id(OCSP_REQUEST *req, OCSP_CERTID *cid) if (one->reqCert) OCSP_CERTID_free(one->reqCert); one->reqCert = cid; - if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one)) + if (req && !sk_OCSP_ONEREQ_push(req->tbsRequest->requestList, one)) { + one->reqCert = NULL; /* do not free on error */ goto err; + } return one; err: OCSP_ONEREQ_free(one); diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c b/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c index c19648c7329b3b..55af31b5734a14 100644 --- a/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c +++ b/deps/openssl/openssl/crypto/ocsp/ocsp_ext.c @@ -361,7 +361,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL); if (val) memcpy(tmpval, val, len); - else if (RAND_pseudo_bytes(tmpval, len) < 0) + else if (RAND_bytes(tmpval, len) <= 0) goto err; if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce, &os, 0, X509V3_ADD_REPLACE)) diff --git a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c index cabf53933a4422..ff781e56e73ea2 100644 --- a/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c +++ b/deps/openssl/openssl/crypto/ocsp/ocsp_lib.c @@ -271,12 +271,18 @@ int OCSP_parse_url(const char *url, char **phost, char **pport, char **ppath, err: if (buf) OPENSSL_free(buf); - if (*ppath) + if (*ppath) { OPENSSL_free(*ppath); - if (*pport) + *ppath = NULL; + } + if (*pport) { OPENSSL_free(*pport); - if (*phost) + *pport = NULL; + } + if (*phost) { OPENSSL_free(*phost); + *phost = NULL; + } return 0; } diff --git a/deps/openssl/openssl/crypto/opensslv.h b/deps/openssl/openssl/crypto/opensslv.h index 13fe440231cd73..88faad652259b4 100644 --- a/deps/openssl/openssl/crypto/opensslv.h +++ b/deps/openssl/openssl/crypto/opensslv.h @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000208fL +# define OPENSSL_VERSION_NUMBER 0x100020afL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h-fips 3 May 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j-fips 26 Sep 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h 3 May 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j 26 Sep 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/deps/openssl/openssl/crypto/ossl_typ.h b/deps/openssl/openssl/crypto/ossl_typ.h index 9144ea2cf60b3a..364d26238e8c4d 100644 --- a/deps/openssl/openssl/crypto/ossl_typ.h +++ b/deps/openssl/openssl/crypto/ossl_typ.h @@ -178,6 +178,8 @@ typedef struct engine_st ENGINE; typedef struct ssl_st SSL; typedef struct ssl_ctx_st SSL_CTX; +typedef struct comp_method_st COMP_METHOD; + typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; diff --git a/deps/openssl/openssl/crypto/pem/pem.h b/deps/openssl/openssl/crypto/pem/pem.h index d3b23fc997d61e..aac72fb21eda39 100644 --- a/deps/openssl/openssl/crypto/pem/pem.h +++ b/deps/openssl/openssl/crypto/pem/pem.h @@ -531,6 +531,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_PEM_strings(void); /* Error codes for the PEM functions. */ @@ -592,6 +593,7 @@ void ERR_load_PEM_strings(void); # define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 # define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 # define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 +# define PEM_R_HEADER_TOO_LONG 128 # define PEM_R_INCONSISTENT_HEADER 121 # define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 # define PEM_R_KEYBLOB_TOO_SHORT 123 @@ -609,7 +611,7 @@ void ERR_load_PEM_strings(void); # define PEM_R_UNSUPPORTED_ENCRYPTION 114 # define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif diff --git a/deps/openssl/openssl/crypto/pem/pem_err.c b/deps/openssl/openssl/crypto/pem/pem_err.c index e1f4fdb432d03b..4e5f8e936cd17b 100644 --- a/deps/openssl/openssl/crypto/pem/pem_err.c +++ b/deps/openssl/openssl/crypto/pem/pem_err.c @@ -1,6 +1,6 @@ /* crypto/pem/pem_err.c */ /* ==================================================================== - * Copyright (c) 1999-2011 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -132,6 +132,7 @@ static ERR_STRING_DATA PEM_str_reasons[] = { "expecting private key blob"}, {ERR_REASON(PEM_R_EXPECTING_PUBLIC_KEY_BLOB), "expecting public key blob"}, + {ERR_REASON(PEM_R_HEADER_TOO_LONG), "header too long"}, {ERR_REASON(PEM_R_INCONSISTENT_HEADER), "inconsistent header"}, {ERR_REASON(PEM_R_KEYBLOB_HEADER_PARSE_ERROR), "keyblob header parse error"}, diff --git a/deps/openssl/openssl/crypto/pem/pem_lib.c b/deps/openssl/openssl/crypto/pem/pem_lib.c index fe881d664171dc..c82b3c0ae263d0 100644 --- a/deps/openssl/openssl/crypto/pem/pem_lib.c +++ b/deps/openssl/openssl/crypto/pem/pem_lib.c @@ -105,17 +105,23 @@ int PEM_def_callback(char *buf, int num, int w, void *key) prompt = "Enter PEM pass phrase:"; for (;;) { - i = EVP_read_pw_string_min(buf, MIN_LENGTH, num, prompt, w); + /* + * We assume that w == 0 means decryption, + * while w == 1 means encryption + */ + int min_len = w ? MIN_LENGTH : 0; + + i = EVP_read_pw_string_min(buf, min_len, num, prompt, w); if (i != 0) { PEMerr(PEM_F_PEM_DEF_CALLBACK, PEM_R_PROBLEMS_GETTING_PASSWORD); memset(buf, 0, (unsigned int)num); return (-1); } j = strlen(buf); - if (j < MIN_LENGTH) { + if (min_len && j < min_len) { fprintf(stderr, "phrase is too short, needs to be at least %d chars\n", - MIN_LENGTH); + min_len); } else break; } @@ -387,7 +393,7 @@ int PEM_ASN1_write_bio(i2d_of_void *i2d, const char *name, BIO *bp, } RAND_add(data, i, 0); /* put in the RSA key. */ OPENSSL_assert(enc->iv_len <= (int)sizeof(iv)); - if (RAND_pseudo_bytes(iv, enc->iv_len) < 0) /* Generate a salt */ + if (RAND_bytes(iv, enc->iv_len) <= 0) /* Generate a salt */ goto err; /* * The 'iv' is used as the iv and as a salt. It is NOT taken from diff --git a/deps/openssl/openssl/crypto/pem/pvkfmt.c b/deps/openssl/openssl/crypto/pem/pvkfmt.c index 61864468f6d490..1ce5a1e319c56c 100644 --- a/deps/openssl/openssl/crypto/pem/pvkfmt.c +++ b/deps/openssl/openssl/crypto/pem/pvkfmt.c @@ -127,6 +127,9 @@ static int read_lebn(const unsigned char **in, unsigned int nbyte, BIGNUM **r) # define MS_KEYTYPE_KEYX 0x1 # define MS_KEYTYPE_SIGN 0x2 +/* Maximum length of a blob after header */ +# define BLOB_MAX_LENGTH 102400 + /* The PVK file magic number: seems to spell out "bobsfile", who is Bob? */ # define MS_PVKMAGIC 0xb0b5f11eL /* Salt length for PVK files */ @@ -272,6 +275,10 @@ static EVP_PKEY *do_b2i_bio(BIO *in, int ispub) return NULL; length = blob_length(bitlen, isdss, ispub); + if (length > BLOB_MAX_LENGTH) { + PEMerr(PEM_F_DO_B2I_BIO, PEM_R_HEADER_TOO_LONG); + return NULL; + } buf = OPENSSL_malloc(length); if (!buf) { PEMerr(PEM_F_DO_B2I_BIO, ERR_R_MALLOC_FAILURE); diff --git a/deps/openssl/openssl/crypto/perlasm/sparcv9_modes.pl b/deps/openssl/openssl/crypto/perlasm/sparcv9_modes.pl index eb267a57ed8151..ac8da328b00eb4 100644 --- a/deps/openssl/openssl/crypto/perlasm/sparcv9_modes.pl +++ b/deps/openssl/openssl/crypto/perlasm/sparcv9_modes.pl @@ -37,6 +37,7 @@ sub alg_cbc_encrypt_implement { save %sp, -$::frame, %sp cmp $len, 0 be,pn $::size_t_cc, .L${bits}_cbc_enc_abort + srln $len, 0, $len ! needed on v8+, "nop" on v9 sub $inp, $out, $blk_init ! $inp!=$out ___ $::code.=<<___ if (!$::evp); @@ -254,6 +255,7 @@ sub alg_cbc_decrypt_implement { save %sp, -$::frame, %sp cmp $len, 0 be,pn $::size_t_cc, .L${bits}_cbc_dec_abort + srln $len, 0, $len ! needed on v8+, "nop" on v9 sub $inp, $out, $blk_init ! $inp!=$out ___ $::code.=<<___ if (!$::evp); @@ -613,6 +615,7 @@ sub alg_ctr32_implement { .align 32 ${alg}${bits}_t4_ctr32_encrypt: save %sp, -$::frame, %sp + srln $len, 0, $len ! needed on v8+, "nop" on v9 prefetch [$inp], 20 prefetch [$inp + 63], 20 @@ -916,6 +919,7 @@ sub alg_xts_implement { .align 32 ${alg}${bits}_t4_xts_${dir}crypt: save %sp, -$::frame-16, %sp + srln $len, 0, $len ! needed on v8+, "nop" on v9 mov $ivec, %o0 add %fp, $::bias-16, %o1 diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c index a9277827ff2df5..cbf34da05adadb 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_mutl.c @@ -179,7 +179,7 @@ int PKCS12_setup_mac(PKCS12 *p12, int iter, unsigned char *salt, int saltlen, } p12->mac->salt->length = saltlen; if (!salt) { - if (RAND_pseudo_bytes(p12->mac->salt->data, saltlen) < 0) + if (RAND_bytes(p12->mac->salt->data, saltlen) <= 0) return 0; } else memcpy(p12->mac->salt->data, salt, saltlen); diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_npas.c b/deps/openssl/openssl/crypto/pkcs12/p12_npas.c index a89b61abab373e..9e8ebb2a78c322 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_npas.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_npas.c @@ -66,17 +66,18 @@ /* PKCS#12 password change routine */ -static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass); -static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, - char *newpass); -static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass); +static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass); +static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, + const char *newpass); +static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, + const char *newpass); static int alg_get(X509_ALGOR *alg, int *pnid, int *piter, int *psaltlen); /* * Change the password on a PKCS#12 structure. */ -int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass) { /* Check for NULL PKCS12 structure */ @@ -103,20 +104,21 @@ int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass) /* Parse the outer PKCS#12 structure */ -static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) +static int newpass_p12(PKCS12 *p12, const char *oldpass, const char *newpass) { - STACK_OF(PKCS7) *asafes, *newsafes; - STACK_OF(PKCS12_SAFEBAG) *bags; + STACK_OF(PKCS7) *asafes = NULL, *newsafes = NULL; + STACK_OF(PKCS12_SAFEBAG) *bags = NULL; int i, bagnid, pbe_nid = 0, pbe_iter = 0, pbe_saltlen = 0; PKCS7 *p7, *p7new; - ASN1_OCTET_STRING *p12_data_tmp = NULL, *macnew = NULL; + ASN1_OCTET_STRING *p12_data_tmp = NULL; unsigned char mac[EVP_MAX_MD_SIZE]; unsigned int maclen; + int rv = 0; - if (!(asafes = PKCS12_unpack_authsafes(p12))) - return 0; - if (!(newsafes = sk_PKCS7_new_null())) - return 0; + if ((asafes = PKCS12_unpack_authsafes(p12)) == NULL) + goto err; + if ((newsafes = sk_PKCS7_new_null()) == NULL) + goto err; for (i = 0; i < sk_PKCS7_num(asafes); i++) { p7 = sk_PKCS7_value(asafes, i); bagnid = OBJ_obj2nid(p7->type); @@ -125,67 +127,57 @@ static int newpass_p12(PKCS12 *p12, char *oldpass, char *newpass) } else if (bagnid == NID_pkcs7_encrypted) { bags = PKCS12_unpack_p7encdata(p7, oldpass, -1); if (!alg_get(p7->d.encrypted->enc_data->algorithm, - &pbe_nid, &pbe_iter, &pbe_saltlen)) { - sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); - bags = NULL; - } - } else + &pbe_nid, &pbe_iter, &pbe_saltlen)) + goto err; + } else { continue; - if (!bags) { - sk_PKCS7_pop_free(asafes, PKCS7_free); - return 0; - } - if (!newpass_bags(bags, oldpass, newpass)) { - sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); - sk_PKCS7_pop_free(asafes, PKCS7_free); - return 0; } + if (bags == NULL) + goto err; + if (!newpass_bags(bags, oldpass, newpass)) + goto err; /* Repack bag in same form with new password */ if (bagnid == NID_pkcs7_data) p7new = PKCS12_pack_p7data(bags); else p7new = PKCS12_pack_p7encdata(pbe_nid, newpass, -1, NULL, pbe_saltlen, pbe_iter, bags); + if (!p7new || !sk_PKCS7_push(newsafes, p7new)) + goto err; sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); - if (!p7new) { - sk_PKCS7_pop_free(asafes, PKCS7_free); - return 0; - } - sk_PKCS7_push(newsafes, p7new); + bags = NULL; } - sk_PKCS7_pop_free(asafes, PKCS7_free); /* Repack safe: save old safe in case of error */ p12_data_tmp = p12->authsafes->d.data; - if (!(p12->authsafes->d.data = ASN1_OCTET_STRING_new())) - goto saferr; + if ((p12->authsafes->d.data = ASN1_OCTET_STRING_new()) == NULL) + goto err; if (!PKCS12_pack_authsafes(p12, newsafes)) - goto saferr; - + goto err; if (!PKCS12_gen_mac(p12, newpass, -1, mac, &maclen)) - goto saferr; - if (!(macnew = ASN1_OCTET_STRING_new())) - goto saferr; - if (!ASN1_OCTET_STRING_set(macnew, mac, maclen)) - goto saferr; - ASN1_OCTET_STRING_free(p12->mac->dinfo->digest); - p12->mac->dinfo->digest = macnew; - ASN1_OCTET_STRING_free(p12_data_tmp); - - return 1; - - saferr: - /* Restore old safe */ - ASN1_OCTET_STRING_free(p12->authsafes->d.data); - ASN1_OCTET_STRING_free(macnew); - p12->authsafes->d.data = p12_data_tmp; - return 0; - + goto err; + if (!ASN1_OCTET_STRING_set(p12->mac->dinfo->digest, mac, maclen)) + goto err; + + rv = 1; + +err: + /* Restore old safe if necessary */ + if (rv == 1) { + ASN1_OCTET_STRING_free(p12_data_tmp); + } else if (p12_data_tmp != NULL) { + ASN1_OCTET_STRING_free(p12->authsafes->d.data); + p12->authsafes->d.data = p12_data_tmp; + } + sk_PKCS12_SAFEBAG_pop_free(bags, PKCS12_SAFEBAG_free); + sk_PKCS7_pop_free(asafes, PKCS7_free); + sk_PKCS7_pop_free(newsafes, PKCS7_free); + return rv; } -static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, - char *newpass) +static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, const char *oldpass, + const char *newpass) { int i; for (i = 0; i < sk_PKCS12_SAFEBAG_num(bags); i++) { @@ -197,7 +189,8 @@ static int newpass_bags(STACK_OF(PKCS12_SAFEBAG) *bags, char *oldpass, /* Change password of safebag: only needs handle shrouded keybags */ -static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) +static int newpass_bag(PKCS12_SAFEBAG *bag, const char *oldpass, + const char *newpass) { PKCS8_PRIV_KEY_INFO *p8; X509_SIG *p8new; @@ -210,8 +203,10 @@ static int newpass_bag(PKCS12_SAFEBAG *bag, char *oldpass, char *newpass) return 0; if (!alg_get(bag->value.shkeybag->algor, &p8_nid, &p8_iter, &p8_saltlen)) return 0; - if (!(p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen, - p8_iter, p8))) + p8new = PKCS8_encrypt(p8_nid, NULL, newpass, -1, NULL, p8_saltlen, + p8_iter, p8); + PKCS8_PRIV_KEY_INFO_free(p8); + if (p8new == NULL) return 0; X509_SIG_free(bag->value.shkeybag); bag->value.shkeybag = p8new; diff --git a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c index a0b992eab66cc0..e466f762ffda2e 100644 --- a/deps/openssl/openssl/crypto/pkcs12/p12_utl.c +++ b/deps/openssl/openssl/crypto/pkcs12/p12_utl.c @@ -91,6 +91,10 @@ char *OPENSSL_uni2asc(unsigned char *uni, int unilen) { int asclen, i; char *asctmp; + + /* string must contain an even number of bytes */ + if (unilen & 1) + return NULL; asclen = unilen / 2; /* If no terminating zero allow for one */ if (!unilen || uni[unilen - 1]) diff --git a/deps/openssl/openssl/crypto/pkcs12/pkcs12.h b/deps/openssl/openssl/crypto/pkcs12/pkcs12.h index a39adf5eb52eb5..21f1f62b36c66f 100644 --- a/deps/openssl/openssl/crypto/pkcs12/pkcs12.h +++ b/deps/openssl/openssl/crypto/pkcs12/pkcs12.h @@ -270,7 +270,7 @@ int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); -int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); /* BEGIN ERROR CODES */ /* diff --git a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c index 946aaa65435b33..6cf8253bc23857 100644 --- a/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c +++ b/deps/openssl/openssl/crypto/pkcs7/pk7_doit.c @@ -340,7 +340,7 @@ BIO *PKCS7_dataInit(PKCS7 *p7, BIO *bio) ivlen = EVP_CIPHER_iv_length(evp_cipher); xalg->algorithm = OBJ_nid2obj(EVP_CIPHER_type(evp_cipher)); if (ivlen > 0) - if (RAND_pseudo_bytes(iv, ivlen) <= 0) + if (RAND_bytes(iv, ivlen) <= 0) goto err; if (EVP_CipherInit_ex(ctx, evp_cipher, NULL, NULL, NULL, 1) <= 0) goto err; @@ -642,6 +642,8 @@ BIO *PKCS7_dataDecode(PKCS7 *p7, EVP_PKEY *pkey, BIO *in_bio, X509 *pcert) } else { # if 0 bio = BIO_new(BIO_s_mem()); + if (bio == NULL) + goto err; /* * We need to set this so that when we have read all the data, the * encrypt BIO, if present, will read EOF and encode the last few diff --git a/deps/openssl/openssl/crypto/rand/md_rand.c b/deps/openssl/openssl/crypto/rand/md_rand.c index 5c13d57765b0d7..bd76e23e3deb33 100644 --- a/deps/openssl/openssl/crypto/rand/md_rand.c +++ b/deps/openssl/openssl/crypto/rand/md_rand.c @@ -136,7 +136,7 @@ /* #define PREDICT 1 */ #define STATE_SIZE 1023 -static int state_num = 0, state_index = 0; +static size_t state_num = 0, state_index = 0; static unsigned char state[STATE_SIZE + MD_DIGEST_LENGTH]; static unsigned char md[MD_DIGEST_LENGTH]; static long md_count[2] = { 0, 0 }; @@ -336,8 +336,8 @@ static void ssleay_rand_seed(const void *buf, int num) int ssleay_rand_bytes(unsigned char *buf, int num, int pseudo, int lock) { static volatile int stirred_pool = 0; - int i, j, k, st_num, st_idx; - int num_ceil; + int i, j, k; + size_t num_ceil, st_idx, st_num; int ok; long md_c[2]; unsigned char local_md[MD_DIGEST_LENGTH]; diff --git a/deps/openssl/openssl/crypto/rand/rand_unix.c b/deps/openssl/openssl/crypto/rand/rand_unix.c index 266111edda8c1d..6c5b65da0070ee 100644 --- a/deps/openssl/openssl/crypto/rand/rand_unix.c +++ b/deps/openssl/openssl/crypto/rand/rand_unix.c @@ -235,7 +235,7 @@ int RAND_poll(void) rnd >>= 8; } RAND_add(buf, sizeof(buf), ENTROPY_NEEDED); - memset(buf, 0, sizeof(buf)); + OPENSSL_cleanse(buf, sizeof(buf)); return 1; } diff --git a/deps/openssl/openssl/crypto/rand/rand_vms.c b/deps/openssl/openssl/crypto/rand/rand_vms.c old mode 100644 new mode 100755 index 0e10c363e2b512..be4ff4cc877df6 --- a/deps/openssl/openssl/crypto/rand/rand_vms.c +++ b/deps/openssl/openssl/crypto/rand/rand_vms.c @@ -3,6 +3,11 @@ * Written by Richard Levitte for the OpenSSL project * 2000. */ +/* + * Modified by VMS Software, Inc (2016) + * Eliminate looping through all processes (performance) + * Add additional randomizations using rand() function + */ /* ==================================================================== * Copyright (c) 1998-2000 The OpenSSL Project. All rights reserved. * @@ -61,11 +66,11 @@ #include "rand_lcl.h" #if defined(OPENSSL_SYS_VMS) - # include # include # include # include +# include # ifdef __DECC # pragma message disable DOLLARID # endif @@ -83,77 +88,93 @@ # endif /* __INITIAL_POINTER_SIZE == 64 [else] */ static struct items_data_st { - short length, code; /* length is amount of bytes */ + short length, code; /* length is number of bytes */ } items_data[] = { - { - 4, JPI$_BUFIO - }, - { - 4, JPI$_CPUTIM - }, - { - 4, JPI$_DIRIO - }, - { - 8, JPI$_LOGINTIM - }, - { - 4, JPI$_PAGEFLTS - }, - { - 4, JPI$_PID - }, - { - 4, JPI$_WSSIZE - }, - { - 0, 0 - } + {4, JPI$_BUFIO}, + {4, JPI$_CPUTIM}, + {4, JPI$_DIRIO}, + {4, JPI$_IMAGECOUNT}, + {8, JPI$_LAST_LOGIN_I}, + {8, JPI$_LOGINTIM}, + {4, JPI$_PAGEFLTS}, + {4, JPI$_PID}, + {4, JPI$_PPGCNT}, + {4, JPI$_WSPEAK}, + {4, JPI$_FINALEXC}, + {0, 0} /* zero terminated */ }; int RAND_poll(void) { - long pid, iosb[2]; - int status = 0; + + /* determine the number of items in the JPI array */ + + struct items_data_st item_entry; + int item_entry_count = sizeof(items_data)/sizeof(item_entry); + + /* Create the JPI itemlist array to hold item_data content */ + struct { short length, code; - long *buffer; + int *buffer; int *retlen; - } item[32], *pitem; - unsigned char data_buffer[256]; - short total_length = 0; - struct items_data_st *pitems_data; + } item[item_entry_count], *pitem; /* number of entries in items_data */ + struct items_data_st *pitems_data; pitems_data = items_data; pitem = item; + int data_buffer[(item_entry_count*2)+4]; /* 8 bytes per entry max */ + int iosb[2]; + int sys_time[2]; + int *ptr; + int i, j ; + int tmp_length = 0; + int total_length = 0; + + /* Setup itemlist for GETJPI */ - /* Setup */ - while (pitems_data->length && (total_length + pitems_data->length <= 256)) { + while (pitems_data->length) { pitem->length = pitems_data->length; - pitem->code = pitems_data->code; - pitem->buffer = (long *)&data_buffer[total_length]; + pitem->code = pitems_data->code; + pitem->buffer = &data_buffer[total_length]; pitem->retlen = 0; - total_length += pitems_data->length; + /* total_length is in longwords */ + total_length += pitems_data->length/4; pitems_data++; pitem ++; } pitem->length = pitem->code = 0; - /* - * Scan through all the processes in the system and add entropy with - * results from the processes that were possible to look at. - * However, view the information as only half trustable. - */ - pid = -1; /* search context */ - while ((status = sys$getjpiw(0, &pid, 0, item, iosb, 0, 0)) - != SS$_NOMOREPROC) { - if (status == SS$_NORMAL) { - RAND_add((PTR_T) data_buffer, total_length, total_length / 2); + /* Fill data_buffer with various info bits from this process */ + /* and twist that data to seed the SSL random number init */ + + if (sys$getjpiw(EFN$C_ENF, NULL, NULL, item, &iosb, 0, 0) == SS$_NORMAL) { + for (i = 0; i < total_length; i++) { + sys$gettim((struct _generic_64 *)&sys_time[0]); + srand(sys_time[0] * data_buffer[0] * data_buffer[1] + i); + + if (i == (total_length - 1)) { /* for JPI$_FINALEXC */ + ptr = &data_buffer[i]; + for (j = 0; j < 4; j++) { + data_buffer[i + j] = ptr[j]; + /* OK to use rand() just to scramble the seed */ + data_buffer[i + j] ^= (sys_time[0] ^ rand()); + tmp_length++; + } + } else { + /* OK to use rand() just to scramble the seed */ + data_buffer[i] ^= (sys_time[0] ^ rand()); + } } + + total_length += (tmp_length - 1); + + /* size of seed is total_length*4 bytes (64bytes) */ + RAND_add((PTR_T) data_buffer, total_length*4, total_length * 2); + } else { + return 0; } - sys$gettim(iosb); - RAND_add((PTR_T) iosb, sizeof(iosb), sizeof(iosb) / 2); + return 1; } - #endif diff --git a/deps/openssl/openssl/crypto/rand/randfile.c b/deps/openssl/openssl/crypto/rand/randfile.c index 9537c56a78959d..728fd0a721b5b0 100644 --- a/deps/openssl/openssl/crypto/rand/randfile.c +++ b/deps/openssl/openssl/crypto/rand/randfile.c @@ -56,11 +56,6 @@ * [including the GNU Public Licence.] */ -/* We need to define this to get macros like S_IFBLK and S_IFCHR */ -#if !defined(OPENSSL_SYS_VXWORKS) -# define _XOPEN_SOURCE 500 -#endif - #include #include #include @@ -80,6 +75,29 @@ #ifndef OPENSSL_NO_POSIX_IO # include # include +/* + * Following should not be needed, and we could have been stricter + * and demand S_IS*. But some systems just don't comply... Formally + * below macros are "anatomically incorrect", because normally they + * would look like ((m) & MASK == TYPE), but since MASK availability + * is as questionable, we settle for this poor-man fallback... + */ +# if !defined(S_ISBLK) +# if defined(_S_IFBLK) +# define S_ISBLK(m) ((m) & _S_IFBLK) +# elif defined(S_IFBLK) +# define S_ISBLK(m) ((m) & S_IFBLK) +# elif defined(_WIN32) +# define S_ISBLK(m) 0 /* no concept of block devices on Windows */ +# endif +# endif +# if !defined(S_ISCHR) +# if defined(_S_IFCHR) +# define S_ISCHR(m) ((m) & _S_IFCHR) +# elif defined(S_IFCHR) +# define S_ISCHR(m) ((m) & S_IFCHR) +# endif +# endif #endif #ifdef _WIN32 @@ -93,7 +111,7 @@ #define BUFSIZE 1024 #define RAND_DATA 1024 -#ifdef OPENSSL_SYS_VMS +#if (defined(OPENSSL_SYS_VMS) && (defined(__alpha) || defined(__ia64))) /* * This declaration is a nasty hack to get around vms' extension to fopen for * passing in sharing options being disabled by our /STANDARD=ANSI89 @@ -122,7 +140,24 @@ int RAND_load_file(const char *file, long bytes) struct stat sb; #endif int i, ret = 0, n; +/* + * If setvbuf() is to be called, then the FILE pointer + * to it must be 32 bit. +*/ + +#if !defined OPENSSL_NO_SETVBUF_IONBF && defined(OPENSSL_SYS_VMS) && defined(__VMS_VER) && (__VMS_VER >= 70000000) + /* For 64-bit-->32 bit API Support*/ +#if __INITIAL_POINTER_SIZE == 64 +#pragma __required_pointer_size __save +#pragma __required_pointer_size 32 +#endif + FILE *in; /* setvbuf() requires 32-bit pointers */ +#if __INITIAL_POINTER_SIZE == 64 +#pragma __required_pointer_size __restore +#endif +#else FILE *in; +#endif /* OPENSSL_SYS_VMS */ if (file == NULL) return (0); @@ -151,8 +186,8 @@ int RAND_load_file(const char *file, long bytes) #endif if (in == NULL) goto err; -#if defined(S_IFBLK) && defined(S_IFCHR) && !defined(OPENSSL_NO_POSIX_IO) - if (sb.st_mode & (S_IFBLK | S_IFCHR)) { +#if defined(S_ISBLK) && defined(S_ISCHR) && !defined(OPENSSL_NO_POSIX_IO) + if (S_ISBLK(sb.st_mode) || S_ISCHR(sb.st_mode)) { /* * this file is a device. we don't want read an infinite number of * bytes from a random device, nor do we want to use buffered I/O @@ -231,7 +266,7 @@ int RAND_write_file(const char *file) } #endif -#ifdef OPENSSL_SYS_VMS +#if (defined(OPENSSL_SYS_VMS) && (defined(__alpha) || defined(__ia64))) /* * VMS NOTE: Prior versions of this routine created a _new_ version of * the rand file for each call into this routine, then deleted all diff --git a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c index 4e0621827cf3ed..951e1d5ca32b98 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_ameth.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_ameth.c @@ -68,10 +68,12 @@ #endif #include "asn1_locl.h" +#ifndef OPENSSL_NO_CMS static int rsa_cms_sign(CMS_SignerInfo *si); static int rsa_cms_verify(CMS_SignerInfo *si); static int rsa_cms_decrypt(CMS_RecipientInfo *ri); static int rsa_cms_encrypt(CMS_RecipientInfo *ri); +#endif static int rsa_pub_encode(X509_PUBKEY *pk, const EVP_PKEY *pkey) { @@ -665,6 +667,7 @@ static int rsa_pss_to_ctx(EVP_MD_CTX *ctx, EVP_PKEY_CTX *pkctx, return rv; } +#ifndef OPENSSL_NO_CMS static int rsa_cms_verify(CMS_SignerInfo *si) { int nid, nid2; @@ -683,6 +686,7 @@ static int rsa_cms_verify(CMS_SignerInfo *si) } return 0; } +#endif /* * Customised RSA item verification routine. This is called when a signature @@ -705,6 +709,7 @@ static int rsa_item_verify(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, return -1; } +#ifndef OPENSSL_NO_CMS static int rsa_cms_sign(CMS_SignerInfo *si) { int pad_mode = RSA_PKCS1_PADDING; @@ -729,6 +734,7 @@ static int rsa_cms_sign(CMS_SignerInfo *si) X509_ALGOR_set0(alg, OBJ_nid2obj(NID_rsassaPss), V_ASN1_SEQUENCE, os); return 1; } +#endif static int rsa_item_sign(EVP_MD_CTX *ctx, const ASN1_ITEM *it, void *asn, X509_ALGOR *alg1, X509_ALGOR *alg2, @@ -785,6 +791,7 @@ static RSA_OAEP_PARAMS *rsa_oaep_decode(const X509_ALGOR *alg, return pss; } +#ifndef OPENSSL_NO_CMS static int rsa_cms_decrypt(CMS_RecipientInfo *ri) { EVP_PKEY_CTX *pkctx; @@ -920,6 +927,7 @@ static int rsa_cms_encrypt(CMS_RecipientInfo *ri) ASN1_STRING_free(os); return rv; } +#endif const EVP_PKEY_ASN1_METHOD rsa_asn1_meths[] = { { diff --git a/deps/openssl/openssl/crypto/rsa/rsa_chk.c b/deps/openssl/openssl/crypto/rsa/rsa_chk.c index 607faa00171ed4..475dfc56289a1f 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_chk.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_chk.c @@ -56,7 +56,6 @@ int RSA_check_key(const RSA *key) { BIGNUM *i, *j, *k, *l, *m; BN_CTX *ctx; - int r; int ret = 1; if (!key->p || !key->q || !key->n || !key->e || !key->d) { @@ -70,75 +69,68 @@ int RSA_check_key(const RSA *key) l = BN_new(); m = BN_new(); ctx = BN_CTX_new(); - if (i == NULL || j == NULL || k == NULL || l == NULL || - m == NULL || ctx == NULL) { + if (i == NULL || j == NULL || k == NULL || l == NULL + || m == NULL || ctx == NULL) { ret = -1; RSAerr(RSA_F_RSA_CHECK_KEY, ERR_R_MALLOC_FAILURE); goto err; } + if (BN_is_one(key->e)) { + ret = 0; + RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_BAD_E_VALUE); + } + if (!BN_is_odd(key->e)) { + ret = 0; + RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_BAD_E_VALUE); + } + /* p prime? */ - r = BN_is_prime_ex(key->p, BN_prime_checks, NULL, NULL); - if (r != 1) { - ret = r; - if (r != 0) - goto err; + if (BN_is_prime_ex(key->p, BN_prime_checks, NULL, NULL) != 1) { + ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_P_NOT_PRIME); } /* q prime? */ - r = BN_is_prime_ex(key->q, BN_prime_checks, NULL, NULL); - if (r != 1) { - ret = r; - if (r != 0) - goto err; + if (BN_is_prime_ex(key->q, BN_prime_checks, NULL, NULL) != 1) { + ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_Q_NOT_PRIME); } /* n = p*q? */ - r = BN_mul(i, key->p, key->q, ctx); - if (!r) { + if (!BN_mul(i, key->p, key->q, ctx)) { ret = -1; goto err; } - if (BN_cmp(i, key->n) != 0) { ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_N_DOES_NOT_EQUAL_P_Q); } /* d*e = 1 mod lcm(p-1,q-1)? */ - - r = BN_sub(i, key->p, BN_value_one()); - if (!r) { + if (!BN_sub(i, key->p, BN_value_one())) { ret = -1; goto err; } - r = BN_sub(j, key->q, BN_value_one()); - if (!r) { + if (!BN_sub(j, key->q, BN_value_one())) { ret = -1; goto err; } /* now compute k = lcm(i,j) */ - r = BN_mul(l, i, j, ctx); - if (!r) { + if (!BN_mul(l, i, j, ctx)) { ret = -1; goto err; } - r = BN_gcd(m, i, j, ctx); - if (!r) { + if (!BN_gcd(m, i, j, ctx)) { ret = -1; goto err; } - r = BN_div(k, NULL, l, m, ctx); /* remainder is 0 */ - if (!r) { + if (!BN_div(k, NULL, l, m, ctx)) { /* remainder is 0 */ ret = -1; goto err; } - - r = BN_mod_mul(i, key->d, key->e, k, ctx); - if (!r) { + if (!BN_mod_mul(i, key->d, key->e, k, ctx)) { ret = -1; goto err; } @@ -150,36 +142,28 @@ int RSA_check_key(const RSA *key) if (key->dmp1 != NULL && key->dmq1 != NULL && key->iqmp != NULL) { /* dmp1 = d mod (p-1)? */ - r = BN_sub(i, key->p, BN_value_one()); - if (!r) { + if (!BN_sub(i, key->p, BN_value_one())) { ret = -1; goto err; } - - r = BN_mod(j, key->d, i, ctx); - if (!r) { + if (!BN_mod(j, key->d, i, ctx)) { ret = -1; goto err; } - if (BN_cmp(j, key->dmp1) != 0) { ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_DMP1_NOT_CONGRUENT_TO_D); } /* dmq1 = d mod (q-1)? */ - r = BN_sub(i, key->q, BN_value_one()); - if (!r) { + if (!BN_sub(i, key->q, BN_value_one())) { ret = -1; goto err; } - - r = BN_mod(j, key->d, i, ctx); - if (!r) { + if (!BN_mod(j, key->d, i, ctx)) { ret = -1; goto err; } - if (BN_cmp(j, key->dmq1) != 0) { ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_DMQ1_NOT_CONGRUENT_TO_D); @@ -190,7 +174,6 @@ int RSA_check_key(const RSA *key) ret = -1; goto err; } - if (BN_cmp(i, key->iqmp) != 0) { ret = 0; RSAerr(RSA_F_RSA_CHECK_KEY, RSA_R_IQMP_NOT_INVERSE_OF_Q); @@ -198,17 +181,11 @@ int RSA_check_key(const RSA *key) } err: - if (i != NULL) - BN_free(i); - if (j != NULL) - BN_free(j); - if (k != NULL) - BN_free(k); - if (l != NULL) - BN_free(l); - if (m != NULL) - BN_free(m); - if (ctx != NULL) - BN_CTX_free(ctx); - return (ret); + BN_free(i); + BN_free(j); + BN_free(k); + BN_free(l); + BN_free(m); + BN_CTX_free(ctx); + return ret; } diff --git a/deps/openssl/openssl/crypto/rsa/rsa_lib.c b/deps/openssl/openssl/crypto/rsa/rsa_lib.c index a6805debc890a2..6ea6b40dc6fd03 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_lib.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_lib.c @@ -143,6 +143,7 @@ RSA *RSA_new_method(ENGINE *engine) RSAerr(RSA_F_RSA_NEW_METHOD, ERR_R_MALLOC_FAILURE); return NULL; } + memset(ret,0,sizeof(RSA)); ret->meth = RSA_get_default_method(); #ifndef OPENSSL_NO_ENGINE diff --git a/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c b/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c index 203635595f4cce..94db87a0637d1f 100644 --- a/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c +++ b/deps/openssl/openssl/crypto/rsa/rsa_pmeth.c @@ -545,8 +545,10 @@ static int pkey_rsa_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return 1; case EVP_PKEY_CTRL_RSA_KEYGEN_PUBEXP: - if (!p2) + if (p2 == NULL || !BN_is_odd((BIGNUM *)p2) || BN_is_one((BIGNUM *)p2)) { + RSAerr(RSA_F_PKEY_RSA_CTRL, RSA_R_BAD_E_VALUE); return -2; + } BN_free(rctx->pub_exp); rctx->pub_exp = p2; return 1; diff --git a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl index 5f375fc6886b3a..752138b0eac15d 100755 --- a/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl +++ b/deps/openssl/openssl/crypto/sha/asm/sha1-x86_64.pl @@ -372,9 +372,9 @@ sub BODY_40_59 { .align 16 .Loop_shaext: dec $num - lea 0x40($inp),%rax # next input block + lea 0x40($inp),%r8 # next input block paddd @MSG[0],$E - cmovne %rax,$inp + cmovne %r8,$inp movdqa $ABCD,$ABCD_SAVE # offload $ABCD ___ for($i=0;$i<20-4;$i+=2) { diff --git a/deps/openssl/openssl/crypto/sparccpuid.S b/deps/openssl/openssl/crypto/sparccpuid.S index 7b12ec29315436..51ba441440bb5b 100644 --- a/deps/openssl/openssl/crypto/sparccpuid.S +++ b/deps/openssl/openssl/crypto/sparccpuid.S @@ -429,6 +429,7 @@ OPENSSL_cleanse: .size OPENSSL_cleanse,.-OPENSSL_cleanse .global _sparcv9_vis1_instrument_bus +.weak _sparcv9_vis1_instrument_bus .align 8 _sparcv9_vis1_instrument_bus: mov %o1,%o3 ! save cnt @@ -467,6 +468,7 @@ _sparcv9_vis1_instrument_bus: .size _sparcv9_vis1_instrument_bus,.-_sparcv9_vis1_instrument_bus .global _sparcv9_vis1_instrument_bus2 +.weak _sparcv9_vis1_instrument_bus2 .align 8 _sparcv9_vis1_instrument_bus2: mov %o1,%o3 ! save cnt diff --git a/deps/openssl/openssl/crypto/srp/srp_lib.c b/deps/openssl/openssl/crypto/srp/srp_lib.c index e9a2e058f68774..6df3b1cee72e3a 100644 --- a/deps/openssl/openssl/crypto/srp/srp_lib.c +++ b/deps/openssl/openssl/crypto/srp/srp_lib.c @@ -159,8 +159,7 @@ BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, if (u == NULL || A == NULL || v == NULL || b == NULL || N == NULL) return NULL; - if ((bn_ctx = BN_CTX_new()) == NULL || - (tmp = BN_new()) == NULL || (S = BN_new()) == NULL) + if ((bn_ctx = BN_CTX_new()) == NULL || (tmp = BN_new()) == NULL) goto err; /* S = (A*v**u) ** b */ @@ -169,8 +168,12 @@ BIGNUM *SRP_Calc_server_key(BIGNUM *A, BIGNUM *v, BIGNUM *u, BIGNUM *b, goto err; if (!BN_mod_mul(tmp, A, tmp, N, bn_ctx)) goto err; - if (!BN_mod_exp(S, tmp, b, N, bn_ctx)) - goto err; + + S = BN_new(); + if (S != NULL && !BN_mod_exp(S, tmp, b, N, bn_ctx)) { + BN_free(S); + S = NULL; + } err: BN_CTX_free(bn_ctx); BN_clear_free(tmp); @@ -267,7 +270,7 @@ BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, if ((tmp = BN_new()) == NULL || (tmp2 = BN_new()) == NULL || - (tmp3 = BN_new()) == NULL || (K = BN_new()) == NULL) + (tmp3 = BN_new()) == NULL) goto err; if (!BN_mod_exp(tmp, g, x, N, bn_ctx)) @@ -279,12 +282,15 @@ BIGNUM *SRP_Calc_client_key(BIGNUM *N, BIGNUM *B, BIGNUM *g, BIGNUM *x, if (!BN_mod_sub(tmp, B, tmp2, N, bn_ctx)) goto err; - if (!BN_mod_mul(tmp3, u, x, N, bn_ctx)) + if (!BN_mul(tmp3, u, x, bn_ctx)) goto err; - if (!BN_mod_add(tmp2, a, tmp3, N, bn_ctx)) - goto err; - if (!BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) + if (!BN_add(tmp2, a, tmp3)) goto err; + K = BN_new(); + if (K != NULL && !BN_mod_exp(K, tmp, tmp2, N, bn_ctx)) { + BN_free(K); + K = NULL; + } err: BN_CTX_free(bn_ctx); diff --git a/deps/openssl/openssl/crypto/srp/srp_vfy.c b/deps/openssl/openssl/crypto/srp/srp_vfy.c index 26ad3e07b4bb3f..a8ec52a4dadc24 100644 --- a/deps/openssl/openssl/crypto/srp/srp_vfy.c +++ b/deps/openssl/openssl/crypto/srp/srp_vfy.c @@ -80,7 +80,7 @@ static char b64table[] = /* * Convert a base64 string into raw byte array representation. */ -static int t_fromb64(unsigned char *a, const char *src) +static int t_fromb64(unsigned char *a, size_t alen, const char *src) { char *loc; int i, j; @@ -89,6 +89,9 @@ static int t_fromb64(unsigned char *a, const char *src) while (*src && (*src == ' ' || *src == '\t' || *src == '\n')) ++src; size = strlen(src); + if (alen > INT_MAX || size > (int)alen) + return -1; + i = 0; while (i < size) { loc = strchr(b64table, src[i]); @@ -231,13 +234,25 @@ static int SRP_user_pwd_set_sv(SRP_user_pwd *vinfo, const char *s, unsigned char tmp[MAX_LEN]; int len; - if (strlen(s) > MAX_LEN || strlen(v) > MAX_LEN) + vinfo->v = NULL; + vinfo->s = NULL; + + len = t_fromb64(tmp, sizeof(tmp), v); + if (len < 0) return 0; - len = t_fromb64(tmp, v); if (NULL == (vinfo->v = BN_bin2bn(tmp, len, NULL))) return 0; - len = t_fromb64(tmp, s); - return ((vinfo->s = BN_bin2bn(tmp, len, NULL)) != NULL); + len = t_fromb64(tmp, sizeof(tmp), s); + if (len < 0) + goto err; + vinfo->s = BN_bin2bn(tmp, len, NULL); + if (vinfo->s == NULL) + goto err; + return 1; + err: + BN_free(vinfo->v); + vinfo->v = NULL; + return 0; } static int SRP_user_pwd_set_sv_BN(SRP_user_pwd *vinfo, BIGNUM *s, BIGNUM *v) @@ -307,10 +322,13 @@ static SRP_gN_cache *SRP_gN_new_init(const char *ch) if (newgN == NULL) return NULL; + len = t_fromb64(tmp, sizeof(tmp), ch); + if (len < 0) + goto err; + if ((newgN->b64_bn = BUF_strdup(ch)) == NULL) goto err; - len = t_fromb64(tmp, ch); if ((newgN->bn = BN_bin2bn(tmp, len, NULL))) return newgN; @@ -544,7 +562,7 @@ SRP_user_pwd *SRP_VBASE_get1_by_user(SRP_VBASE *vb, char *username) if (!SRP_user_pwd_set_ids(user, username, NULL)) goto err; - if (RAND_pseudo_bytes(digv, SHA_DIGEST_LENGTH) < 0) + if (RAND_bytes(digv, SHA_DIGEST_LENGTH) <= 0) goto err; EVP_MD_CTX_init(&ctxt); EVP_DigestInit_ex(&ctxt, EVP_sha1(), NULL); @@ -580,10 +598,10 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, goto err; if (N) { - if (!(len = t_fromb64(tmp, N))) + if (!(len = t_fromb64(tmp, sizeof(tmp), N))) goto err; N_bn = BN_bin2bn(tmp, len, NULL); - if (!(len = t_fromb64(tmp, g))) + if (!(len = t_fromb64(tmp, sizeof(tmp), g))) goto err; g_bn = BN_bin2bn(tmp, len, NULL); defgNid = "*"; @@ -597,12 +615,12 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, } if (*salt == NULL) { - if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0) + if (RAND_bytes(tmp2, SRP_RANDOM_SALT_LEN) <= 0) goto err; s = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL); } else { - if (!(len = t_fromb64(tmp2, *salt))) + if (!(len = t_fromb64(tmp2, sizeof(tmp2), *salt))) goto err; s = BN_bin2bn(tmp2, len, NULL); } @@ -635,7 +653,8 @@ char *SRP_create_verifier(const char *user, const char *pass, char **salt, BN_free(N_bn); BN_free(g_bn); } - OPENSSL_cleanse(vf, vfsize); + if (vf != NULL) + OPENSSL_cleanse(vf, vfsize); OPENSSL_free(vf); BN_clear_free(s); BN_clear_free(v); @@ -670,7 +689,7 @@ int SRP_create_verifier_BN(const char *user, const char *pass, BIGNUM **salt, srp_bn_print(g); if (*salt == NULL) { - if (RAND_pseudo_bytes(tmp2, SRP_RANDOM_SALT_LEN) < 0) + if (RAND_bytes(tmp2, SRP_RANDOM_SALT_LEN) <= 0) goto err; salttmp = BN_bin2bn(tmp2, SRP_RANDOM_SALT_LEN, NULL); diff --git a/deps/openssl/openssl/crypto/ts/ts.h b/deps/openssl/openssl/crypto/ts/ts.h index 16eccbb38d9504..2daa1b2fb5940e 100644 --- a/deps/openssl/openssl/crypto/ts/ts.h +++ b/deps/openssl/openssl/crypto/ts/ts.h @@ -565,6 +565,9 @@ int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx, /* At most we accept usec precision. */ # define TS_MAX_CLOCK_PRECISION_DIGITS 6 +/* Maximum status message length */ +# define TS_MAX_STATUS_LENGTH (1024 * 1024) + /* No flags are set by default. */ void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags); diff --git a/deps/openssl/openssl/crypto/ts/ts_lib.c b/deps/openssl/openssl/crypto/ts/ts_lib.c index c51538a17f4216..e0f10635372343 100644 --- a/deps/openssl/openssl/crypto/ts/ts_lib.c +++ b/deps/openssl/openssl/crypto/ts/ts_lib.c @@ -90,9 +90,8 @@ int TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj) { char obj_txt[128]; - int len = OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0); - BIO_write(bio, obj_txt, len); - BIO_write(bio, "\n", 1); + OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0); + BIO_printf(bio, "%s\n", obj_txt); return 1; } diff --git a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c index 29aa5a497e89ba..7918236287f3e5 100644 --- a/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c +++ b/deps/openssl/openssl/crypto/ts/ts_rsp_verify.c @@ -434,51 +434,58 @@ static int int_TS_RESP_verify_token(TS_VERIFY_CTX *ctx, unsigned char *imprint = NULL; unsigned imprint_len = 0; int ret = 0; + int flags = ctx->flags; + + /* Some options require us to also check the signature */ + if (((flags & TS_VFY_SIGNER) && tsa_name != NULL) + || (flags & TS_VFY_TSA_NAME)) { + flags |= TS_VFY_SIGNATURE; + } /* Verify the signature. */ - if ((ctx->flags & TS_VFY_SIGNATURE) + if ((flags & TS_VFY_SIGNATURE) && !TS_RESP_verify_signature(token, ctx->certs, ctx->store, &signer)) goto err; /* Check version number of response. */ - if ((ctx->flags & TS_VFY_VERSION) + if ((flags & TS_VFY_VERSION) && TS_TST_INFO_get_version(tst_info) != 1) { TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_UNSUPPORTED_VERSION); goto err; } /* Check policies. */ - if ((ctx->flags & TS_VFY_POLICY) + if ((flags & TS_VFY_POLICY) && !TS_check_policy(ctx->policy, tst_info)) goto err; /* Check message imprints. */ - if ((ctx->flags & TS_VFY_IMPRINT) + if ((flags & TS_VFY_IMPRINT) && !TS_check_imprints(ctx->md_alg, ctx->imprint, ctx->imprint_len, tst_info)) goto err; /* Compute and check message imprints. */ - if ((ctx->flags & TS_VFY_DATA) + if ((flags & TS_VFY_DATA) && (!TS_compute_imprint(ctx->data, tst_info, &md_alg, &imprint, &imprint_len) || !TS_check_imprints(md_alg, imprint, imprint_len, tst_info))) goto err; /* Check nonces. */ - if ((ctx->flags & TS_VFY_NONCE) + if ((flags & TS_VFY_NONCE) && !TS_check_nonces(ctx->nonce, tst_info)) goto err; /* Check whether TSA name and signer certificate match. */ - if ((ctx->flags & TS_VFY_SIGNER) + if ((flags & TS_VFY_SIGNER) && tsa_name && !TS_check_signer_name(tsa_name, signer)) { TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_NAME_MISMATCH); goto err; } /* Check whether the TSA is the expected one. */ - if ((ctx->flags & TS_VFY_TSA_NAME) + if ((flags & TS_VFY_TSA_NAME) && !TS_check_signer_name(ctx->tsa_name, signer)) { TSerr(TS_F_INT_TS_RESP_VERIFY_TOKEN, TS_R_TSA_UNTRUSTED); goto err; @@ -548,13 +555,15 @@ static int TS_check_status_info(TS_RESP *response) static char *TS_get_status_text(STACK_OF(ASN1_UTF8STRING) *text) { int i; - unsigned int length = 0; + int length = 0; char *result = NULL; char *p; /* Determine length first. */ for (i = 0; i < sk_ASN1_UTF8STRING_num(text); ++i) { ASN1_UTF8STRING *current = sk_ASN1_UTF8STRING_value(text, i); + if (ASN1_STRING_length(current) > TS_MAX_STATUS_LENGTH - length - 1) + return NULL; length += ASN1_STRING_length(current); length += 1; /* separator character */ } diff --git a/deps/openssl/openssl/crypto/ui/ui_lib.c b/deps/openssl/openssl/crypto/ui/ui_lib.c index 2f580352ce8f47..d25b4f37bd114c 100644 --- a/deps/openssl/openssl/crypto/ui/ui_lib.c +++ b/deps/openssl/openssl/crypto/ui/ui_lib.c @@ -413,6 +413,8 @@ char *UI_construct_prompt(UI *ui, const char *object_desc, len += sizeof(prompt3) - 1; prompt = (char *)OPENSSL_malloc(len + 1); + if (prompt == NULL) + return NULL; BUF_strlcpy(prompt, prompt1, len + 1); BUF_strlcat(prompt, object_desc, len + 1); if (object_name) { diff --git a/deps/openssl/openssl/crypto/whrlpool/wp_dgst.c b/deps/openssl/openssl/crypto/whrlpool/wp_dgst.c index e33bb4f833b594..807d1c49b2d3b7 100644 --- a/deps/openssl/openssl/crypto/whrlpool/wp_dgst.c +++ b/deps/openssl/openssl/crypto/whrlpool/wp_dgst.c @@ -51,6 +51,7 @@ * input. This is done for perfomance. */ +#include #include "wp_locl.h" #include #include @@ -237,7 +238,7 @@ int WHIRLPOOL_Final(unsigned char *md, WHIRLPOOL_CTX *c) if (md) { memcpy(md, c->H.c, WHIRLPOOL_DIGEST_LENGTH); - memset(c, 0, sizeof(*c)); + OPENSSL_cleanse(c, sizeof(*c)); return (1); } return (0); diff --git a/deps/openssl/openssl/crypto/x509/by_dir.c b/deps/openssl/openssl/crypto/x509/by_dir.c index 9ee8f8d8597aa5..bbc3189381e55e 100644 --- a/deps/openssl/openssl/crypto/x509/by_dir.c +++ b/deps/openssl/openssl/crypto/x509/by_dir.c @@ -401,6 +401,10 @@ static int get_cert_by_subject(X509_LOOKUP *xl, int type, X509_NAME *name, } if (!hent) { hent = OPENSSL_malloc(sizeof(BY_DIR_HASH)); + if (hent == NULL) { + X509err(X509_F_GET_CERT_BY_SUBJECT, ERR_R_MALLOC_FAILURE); + goto finish; + } hent->hash = h; hent->suffix = k; if (!sk_BY_DIR_HASH_push(ent->hashes, hent)) { diff --git a/deps/openssl/openssl/crypto/x509/x509.h b/deps/openssl/openssl/crypto/x509/x509.h index fc613ce63526d2..6fa28ebada465b 100644 --- a/deps/openssl/openssl/crypto/x509/x509.h +++ b/deps/openssl/openssl/crypto/x509/x509.h @@ -1234,6 +1234,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp); * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_X509_strings(void); /* Error codes for the X509 functions. */ @@ -1241,6 +1242,7 @@ void ERR_load_X509_strings(void); /* Function codes. */ # define X509_F_ADD_CERT_DIR 100 # define X509_F_BY_FILE_CTRL 101 +# define X509_F_CHECK_NAME_CONSTRAINTS 106 # define X509_F_CHECK_POLICY 145 # define X509_F_DIR_CTRL 102 # define X509_F_GET_CERT_BY_SUBJECT 103 @@ -1322,7 +1324,7 @@ void ERR_load_X509_strings(void); # define X509_R_WRONG_LOOKUP_TYPE 112 # define X509_R_WRONG_TYPE 122 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif diff --git a/deps/openssl/openssl/crypto/x509/x509_att.c b/deps/openssl/openssl/crypto/x509/x509_att.c index bd59281f9dac62..25010753078cf4 100644 --- a/deps/openssl/openssl/crypto/x509/x509_att.c +++ b/deps/openssl/openssl/crypto/x509/x509_att.c @@ -296,7 +296,7 @@ int X509_ATTRIBUTE_set1_object(X509_ATTRIBUTE *attr, const ASN1_OBJECT *obj) int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, const void *data, int len) { - ASN1_TYPE *ttmp; + ASN1_TYPE *ttmp = NULL; ASN1_STRING *stmp = NULL; int atype = 0; if (!attr) @@ -324,20 +324,26 @@ int X509_ATTRIBUTE_set1_data(X509_ATTRIBUTE *attr, int attrtype, * least one value but some types use and zero length SET and require * this. */ - if (attrtype == 0) + if (attrtype == 0) { + ASN1_STRING_free(stmp); return 1; + } if (!(ttmp = ASN1_TYPE_new())) goto err; if ((len == -1) && !(attrtype & MBSTRING_FLAG)) { if (!ASN1_TYPE_set1(ttmp, attrtype, data)) goto err; - } else + } else { ASN1_TYPE_set(ttmp, atype, stmp); + stmp = NULL; + } if (!sk_ASN1_TYPE_push(attr->value.set, ttmp)) goto err; return 1; err: X509err(X509_F_X509_ATTRIBUTE_SET1_DATA, ERR_R_MALLOC_FAILURE); + ASN1_TYPE_free(ttmp); + ASN1_STRING_free(stmp); return 0; } diff --git a/deps/openssl/openssl/crypto/x509/x509_err.c b/deps/openssl/openssl/crypto/x509/x509_err.c index 1e779fefd9c1c3..a2a8e1b08bb22e 100644 --- a/deps/openssl/openssl/crypto/x509/x509_err.c +++ b/deps/openssl/openssl/crypto/x509/x509_err.c @@ -1,6 +1,6 @@ /* crypto/x509/x509_err.c */ /* ==================================================================== - * Copyright (c) 1999-2012 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -72,6 +72,7 @@ static ERR_STRING_DATA X509_str_functs[] = { {ERR_FUNC(X509_F_ADD_CERT_DIR), "ADD_CERT_DIR"}, {ERR_FUNC(X509_F_BY_FILE_CTRL), "BY_FILE_CTRL"}, + {ERR_FUNC(X509_F_CHECK_NAME_CONSTRAINTS), "CHECK_NAME_CONSTRAINTS"}, {ERR_FUNC(X509_F_CHECK_POLICY), "CHECK_POLICY"}, {ERR_FUNC(X509_F_DIR_CTRL), "DIR_CTRL"}, {ERR_FUNC(X509_F_GET_CERT_BY_SUBJECT), "GET_CERT_BY_SUBJECT"}, diff --git a/deps/openssl/openssl/crypto/x509/x509_obj.c b/deps/openssl/openssl/crypto/x509/x509_obj.c index 3de3ac720411f0..0a839f3e54ce8d 100644 --- a/deps/openssl/openssl/crypto/x509/x509_obj.c +++ b/deps/openssl/openssl/crypto/x509/x509_obj.c @@ -129,7 +129,7 @@ char *X509_NAME_oneline(X509_NAME *a, char *buf, int len) type == V_ASN1_VISIBLESTRING || type == V_ASN1_PRINTABLESTRING || type == V_ASN1_TELETEXSTRING || - type == V_ASN1_VISIBLESTRING || type == V_ASN1_IA5STRING) { + type == V_ASN1_IA5STRING) { if (num > (int)sizeof(ebcdic_buf)) num = sizeof(ebcdic_buf); ascii2ebcdic(ebcdic_buf, q, num); diff --git a/deps/openssl/openssl/crypto/x509/x509_r2x.c b/deps/openssl/openssl/crypto/x509/x509_r2x.c index 0ff439c99f1bfe..2879569ead4122 100644 --- a/deps/openssl/openssl/crypto/x509/x509_r2x.c +++ b/deps/openssl/openssl/crypto/x509/x509_r2x.c @@ -70,10 +70,12 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) X509 *ret = NULL; X509_CINF *xi = NULL; X509_NAME *xn; + EVP_PKEY *pubkey = NULL; + int res; if ((ret = X509_new()) == NULL) { X509err(X509_F_X509_REQ_TO_X509, ERR_R_MALLOC_FAILURE); - goto err; + return NULL; } /* duplicate the request */ @@ -89,9 +91,9 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) } xn = X509_REQ_get_subject_name(r); - if (X509_set_subject_name(ret, X509_NAME_dup(xn)) == 0) + if (X509_set_subject_name(ret, xn) == 0) goto err; - if (X509_set_issuer_name(ret, X509_NAME_dup(xn)) == 0) + if (X509_set_issuer_name(ret, xn) == 0) goto err; if (X509_gmtime_adj(xi->validity->notBefore, 0) == NULL) @@ -100,9 +102,11 @@ X509 *X509_REQ_to_X509(X509_REQ *r, int days, EVP_PKEY *pkey) NULL) goto err; - X509_set_pubkey(ret, X509_REQ_get_pubkey(r)); + pubkey = X509_REQ_get_pubkey(r); + res = X509_set_pubkey(ret, pubkey); + EVP_PKEY_free(pubkey); - if (!X509_sign(ret, pkey, EVP_md5())) + if (!res || !X509_sign(ret, pkey, EVP_md5())) goto err; if (0) { err: diff --git a/deps/openssl/openssl/crypto/x509/x509_txt.c b/deps/openssl/openssl/crypto/x509/x509_txt.c index 3d46d3ff8366e4..35db095591331a 100644 --- a/deps/openssl/openssl/crypto/x509/x509_txt.c +++ b/deps/openssl/openssl/crypto/x509/x509_txt.c @@ -204,6 +204,13 @@ const char *X509_verify_cert_error_string(long n) case X509_V_ERR_IP_ADDRESS_MISMATCH: return ("IP address mismatch"); + case X509_V_ERR_INVALID_CALL: + return ("Invalid certificate verification context"); + case X509_V_ERR_STORE_LOOKUP: + return ("Issuer certificate lookup error"); + case X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION: + return ("proxy subject name violation"); + default: BIO_snprintf(buf, sizeof buf, "error number %ld", n); return (buf); diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.c b/deps/openssl/openssl/crypto/x509/x509_vfy.c index 4d34dbac93149e..b1472018baf75c 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.c +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.c @@ -199,6 +199,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (ctx->cert == NULL) { X509err(X509_F_X509_VERIFY_CERT, X509_R_NO_CERT_SET_FOR_US_TO_VERIFY); + ctx->error = X509_V_ERR_INVALID_CALL; return -1; } if (ctx->chain != NULL) { @@ -207,6 +208,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) * cannot do another one. */ X509err(X509_F_X509_VERIFY_CERT, ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED); + ctx->error = X509_V_ERR_INVALID_CALL; return -1; } @@ -219,6 +221,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (((ctx->chain = sk_X509_new_null()) == NULL) || (!sk_X509_push(ctx->chain, ctx->cert))) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; ok = -1; goto err; } @@ -229,6 +232,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (ctx->untrusted != NULL && (sktmp = sk_X509_dup(ctx->untrusted)) == NULL) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; ok = -1; goto err; } @@ -253,8 +257,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx) */ if (ctx->param->flags & X509_V_FLAG_TRUSTED_FIRST) { ok = ctx->get_issuer(&xtmp, ctx, x); - if (ok < 0) + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; goto err; + } /* * If successful for now free up cert so it will be picked up * again later. @@ -271,6 +277,7 @@ int X509_verify_cert(X509_STORE_CTX *ctx) if (xtmp != NULL) { if (!sk_X509_push(ctx->chain, xtmp)) { X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; ok = -1; goto err; } @@ -352,14 +359,17 @@ int X509_verify_cert(X509_STORE_CTX *ctx) break; ok = ctx->get_issuer(&xtmp, ctx, x); - if (ok < 0) + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; goto err; + } if (ok == 0) break; x = xtmp; if (!sk_X509_push(ctx->chain, x)) { X509_free(xtmp); X509err(X509_F_X509_VERIFY_CERT, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; ok = -1; goto err; } @@ -386,8 +396,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx) while (j-- > 1) { xtmp2 = sk_X509_value(ctx->chain, j - 1); ok = ctx->get_issuer(&xtmp, ctx, xtmp2); - if (ok < 0) + if (ok < 0) { + ctx->error = X509_V_ERR_STORE_LOOKUP; goto err; + } /* Check if we found an alternate chain */ if (ok > 0) { /* @@ -515,6 +527,10 @@ int X509_verify_cert(X509_STORE_CTX *ctx) sk_X509_free(sktmp); if (chain_ss != NULL) X509_free(chain_ss); + + /* Safety net, error returns must set ctx->error */ + if (ok <= 0 && ctx->error == X509_V_OK) + ctx->error = X509_V_ERR_UNSPECIFIED; return ok; } @@ -697,13 +713,27 @@ static int check_chain_extensions(X509_STORE_CTX *ctx) * the next certificate must be a CA certificate. */ if (x->ex_flags & EXFLAG_PROXY) { - if (x->ex_pcpathlen != -1 && i > x->ex_pcpathlen) { - ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; - ctx->error_depth = i; - ctx->current_cert = x; - ok = cb(0, ctx); - if (!ok) - goto end; + /* + * RFC3820, 4.1.3 (b)(1) stipulates that if pCPathLengthConstraint + * is less than max_path_length, the former should be copied to + * the latter, and 4.1.4 (a) stipulates that max_path_length + * should be verified to be larger than zero and decrement it. + * + * Because we're checking the certs in the reverse order, we start + * with verifying that proxy_path_length isn't larger than pcPLC, + * and copy the latter to the former if it is, and finally, + * increment proxy_path_length. + */ + if (x->ex_pcpathlen != -1) { + if (proxy_path_length > x->ex_pcpathlen) { + ctx->error = X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED; + ctx->error_depth = i; + ctx->current_cert = x; + ok = cb(0, ctx); + if (!ok) + goto end; + } + proxy_path_length = x->ex_pcpathlen; } proxy_path_length++; must_be_ca = 0; @@ -726,6 +756,81 @@ static int check_name_constraints(X509_STORE_CTX *ctx) /* Ignore self issued certs unless last in chain */ if (i && (x->ex_flags & EXFLAG_SI)) continue; + + /* + * Proxy certificates policy has an extra constraint, where the + * certificate subject MUST be the issuer with a single CN entry + * added. + * (RFC 3820: 3.4, 4.1.3 (a)(4)) + */ + if (x->ex_flags & EXFLAG_PROXY) { + X509_NAME *tmpsubject = X509_get_subject_name(x); + X509_NAME *tmpissuer = X509_get_issuer_name(x); + X509_NAME_ENTRY *tmpentry = NULL; + int last_object_nid = 0; + int err = X509_V_OK; + int last_object_loc = X509_NAME_entry_count(tmpsubject) - 1; + + /* Check that there are at least two RDNs */ + if (last_object_loc < 1) { + err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION; + goto proxy_name_done; + } + + /* + * Check that there is exactly one more RDN in subject as + * there is in issuer. + */ + if (X509_NAME_entry_count(tmpsubject) + != X509_NAME_entry_count(tmpissuer) + 1) { + err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION; + goto proxy_name_done; + } + + /* + * Check that the last subject component isn't part of a + * multivalued RDN + */ + if (X509_NAME_get_entry(tmpsubject, last_object_loc)->set + == X509_NAME_get_entry(tmpsubject, last_object_loc - 1)->set) { + err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION; + goto proxy_name_done; + } + + /* + * Check that the last subject RDN is a commonName, and that + * all the previous RDNs match the issuer exactly + */ + tmpsubject = X509_NAME_dup(tmpsubject); + if (tmpsubject == NULL) { + X509err(X509_F_CHECK_NAME_CONSTRAINTS, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; + return 0; + } + + tmpentry = + X509_NAME_delete_entry(tmpsubject, last_object_loc); + last_object_nid = + OBJ_obj2nid(X509_NAME_ENTRY_get_object(tmpentry)); + + if (last_object_nid != NID_commonName + || X509_NAME_cmp(tmpsubject, tmpissuer) != 0) { + err = X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION; + } + + X509_NAME_ENTRY_free(tmpentry); + X509_NAME_free(tmpsubject); + + proxy_name_done: + if (err != X509_V_OK) { + ctx->error = err; + ctx->error_depth = i; + ctx->current_cert = x; + if (!ctx->verify_cb(0, ctx)) + return 0; + } + } + /* * Check against constraints for all certificates higher in chain * including trust anchor. Trust anchor not strictly speaking needed @@ -736,12 +841,19 @@ static int check_name_constraints(X509_STORE_CTX *ctx) NAME_CONSTRAINTS *nc = sk_X509_value(ctx->chain, j)->nc; if (nc) { rv = NAME_CONSTRAINTS_check(x, nc); - if (rv != X509_V_OK) { + switch (rv) { + case X509_V_OK: + continue; + case X509_V_ERR_OUT_OF_MEM: + ctx->error = rv; + return 0; + default: ctx->error = rv; ctx->error_depth = i; ctx->current_cert = x; if (!ctx->verify_cb(0, ctx)) return 0; + break; } } } @@ -880,6 +992,8 @@ static int check_cert(X509_STORE_CTX *ctx) ctx->current_issuer = NULL; ctx->current_crl_score = 0; ctx->current_reasons = 0; + if (x->ex_flags & EXFLAG_PROXY) + return 1; while (ctx->current_reasons != CRLDP_ALL_REASONS) { last_reasons = ctx->current_reasons; /* Try to retrieve relevant CRL */ @@ -1010,13 +1124,25 @@ static int get_crl_sk(X509_STORE_CTX *ctx, X509_CRL **pcrl, X509_CRL **pdcrl, crl = sk_X509_CRL_value(crls, i); reasons = *preasons; crl_score = get_crl_score(ctx, &crl_issuer, &reasons, crl, x); - - if (crl_score > best_score) { - best_crl = crl; - best_crl_issuer = crl_issuer; - best_score = crl_score; - best_reasons = reasons; + if (crl_score < best_score || crl_score == 0) + continue; + /* If current CRL is equivalent use it if it is newer */ + if (crl_score == best_score && best_crl != NULL) { + int day, sec; + if (ASN1_TIME_diff(&day, &sec, X509_CRL_get_lastUpdate(best_crl), + X509_CRL_get_lastUpdate(crl)) == 0) + continue; + /* + * ASN1_TIME_diff never returns inconsistent signs for |day| + * and |sec|. + */ + if (day <= 0 && sec <= 0) + continue; } + best_crl = crl; + best_crl_issuer = crl_issuer; + best_score = crl_score; + best_reasons = reasons; } if (best_crl) { @@ -1630,6 +1756,7 @@ static int check_policy(X509_STORE_CTX *ctx) ctx->param->policies, ctx->param->flags); if (ret == 0) { X509err(X509_F_CHECK_POLICY, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; return 0; } /* Invalid or inconsistent extensions */ @@ -1658,7 +1785,12 @@ static int check_policy(X509_STORE_CTX *ctx) if (ctx->param->flags & X509_V_FLAG_NOTIFY_POLICY) { ctx->current_cert = NULL; - ctx->error = X509_V_OK; + /* + * Verification errors need to be "sticky", a callback may have allowed + * an SSL handshake to continue despite an error, and we must then + * remain in an error state. Therefore, we MUST NOT clear earlier + * verification errors by setting the error to X509_V_OK. + */ if (!ctx->verify_cb(2, ctx)) return 0; } diff --git a/deps/openssl/openssl/crypto/x509/x509_vfy.h b/deps/openssl/openssl/crypto/x509/x509_vfy.h index 2663e1c0a362aa..50626826e0b9e0 100644 --- a/deps/openssl/openssl/crypto/x509/x509_vfy.h +++ b/deps/openssl/openssl/crypto/x509/x509_vfy.h @@ -368,6 +368,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); # define X509_V_ERR_PERMITTED_VIOLATION 47 # define X509_V_ERR_EXCLUDED_VIOLATION 48 # define X509_V_ERR_SUBTREE_MINMAX 49 +# define X509_V_ERR_APPLICATION_VERIFICATION 50 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 # define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 @@ -386,8 +387,12 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); # define X509_V_ERR_EMAIL_MISMATCH 63 # define X509_V_ERR_IP_ADDRESS_MISMATCH 64 -/* The application is not happy */ -# define X509_V_ERR_APPLICATION_VERIFICATION 50 +/* Caller error */ +# define X509_V_ERR_INVALID_CALL 65 +/* Issuer lookup error */ +# define X509_V_ERR_STORE_LOOKUP 66 + +# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 67 /* Certificate verify flags */ diff --git a/deps/openssl/openssl/crypto/x509/x509spki.c b/deps/openssl/openssl/crypto/x509/x509spki.c index 2df84ead9ef90e..5ae5d30a35160a 100644 --- a/deps/openssl/openssl/crypto/x509/x509spki.c +++ b/deps/openssl/openssl/crypto/x509/x509spki.c @@ -112,6 +112,8 @@ char *NETSCAPE_SPKI_b64_encode(NETSCAPE_SPKI *spki) der_spki = OPENSSL_malloc(der_len); b64_str = OPENSSL_malloc(der_len * 2); if (!der_spki || !b64_str) { + OPENSSL_free(der_spki); + OPENSSL_free(b64_str); X509err(X509_F_NETSCAPE_SPKI_B64_ENCODE, ERR_R_MALLOC_FAILURE); return NULL; } diff --git a/deps/openssl/openssl/crypto/x509v3/v3_addr.c b/deps/openssl/openssl/crypto/x509v3/v3_addr.c index 94cfed050910da..1290dec9bb8c0c 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_addr.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_addr.c @@ -1211,6 +1211,11 @@ int v3_addr_subset(IPAddrBlocks *a, IPAddrBlocks *b) /* * Core code for RFC 3779 2.3 path validation. + * + * Returns 1 for success, 0 on error. + * + * When returning 0, ctx->error MUST be set to an appropriate value other than + * X509_V_OK. */ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx, STACK_OF(X509) *chain, @@ -1245,6 +1250,7 @@ static int v3_addr_validate_path_internal(X509_STORE_CTX *ctx, if ((child = sk_IPAddressFamily_dup(ext)) == NULL) { X509V3err(X509V3_F_V3_ADDR_VALIDATE_PATH_INTERNAL, ERR_R_MALLOC_FAILURE); + ctx->error = X509_V_ERR_OUT_OF_MEM; ret = 0; goto done; } diff --git a/deps/openssl/openssl/crypto/x509v3/v3_alt.c b/deps/openssl/openssl/crypto/x509v3/v3_alt.c index 22ec202846ec23..7f1e71dd1a4292 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_alt.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_alt.c @@ -573,6 +573,8 @@ static int do_othername(GENERAL_NAME *gen, char *value, X509V3_CTX *ctx) return 0; objlen = p - value; objtmp = OPENSSL_malloc(objlen + 1); + if (objtmp == NULL) + return 0; strncpy(objtmp, value, objlen); objtmp[objlen] = 0; gen->d.otherName->type_id = OBJ_txt2obj(objtmp, 0); diff --git a/deps/openssl/openssl/crypto/x509v3/v3_conf.c b/deps/openssl/openssl/crypto/x509v3/v3_conf.c index eeff8bd185022b..c1b4c1a89f74f3 100644 --- a/deps/openssl/openssl/crypto/x509v3/v3_conf.c +++ b/deps/openssl/openssl/crypto/x509v3/v3_conf.c @@ -135,11 +135,13 @@ static X509_EXTENSION *do_ext_nconf(CONF *conf, X509V3_CTX *ctx, int ext_nid, nval = NCONF_get_section(conf, value + 1); else nval = X509V3_parse_list(value); - if (sk_CONF_VALUE_num(nval) <= 0) { + if (nval == NULL || sk_CONF_VALUE_num(nval) <= 0) { X509V3err(X509V3_F_DO_EXT_NCONF, X509V3_R_INVALID_EXTENSION_STRING); ERR_add_error_data(4, "name=", OBJ_nid2sn(ext_nid), ",section=", value); + if (*value != '@') + sk_CONF_VALUE_free(nval); return NULL; } ext_struc = method->v2i(method, ctx, nval); diff --git a/deps/openssl/openssl/doc/apps/cms.pod b/deps/openssl/openssl/doc/apps/cms.pod index 4eaedbcd34c4b9..ac69804228ccda 100644 --- a/deps/openssl/openssl/doc/apps/cms.pod +++ b/deps/openssl/openssl/doc/apps/cms.pod @@ -86,6 +86,9 @@ encrypt mail for the given recipient certificates. Input file is the message to be encrypted. The output file is the encrypted mail in MIME format. The actual CMS type is EnvelopedData. +Note that no revocation check is done for the recipient cert, so if that +key has been compromised, others may be able to decrypt the text. + =item B<-decrypt> decrypt mail using the supplied certificate and private key. Expects an diff --git a/deps/openssl/openssl/doc/apps/s_client.pod b/deps/openssl/openssl/doc/apps/s_client.pod index 618df9659d3bc6..29675dd213f451 100644 --- a/deps/openssl/openssl/doc/apps/s_client.pod +++ b/deps/openssl/openssl/doc/apps/s_client.pod @@ -53,6 +53,7 @@ B B [B<-rand file(s)>] [B<-serverinfo types>] [B<-status>] +[B<-alpn protocols>] [B<-nextprotoneg protocols>] =head1 DESCRIPTION @@ -277,9 +278,13 @@ file. sends a certificate status request to the server (OCSP stapling). The server response (if any) is printed out. -=item B<-nextprotoneg protocols> +=item B<-alpn protocols>, B<-nextprotoneg protocols> -enable Next Protocol Negotiation TLS extension and provide a list of +these flags enable the +Enable the Application-Layer Protocol Negotiation or Next Protocol +Negotiation extension, respectively. ALPN is the IETF standard and +replaces NPN. +The B list is a comma-separated protocol names that the client should advertise support for. The list should contain most wanted protocols first. Protocol names are printable ASCII strings, for example "http/1.1" or diff --git a/deps/openssl/openssl/doc/apps/s_server.pod b/deps/openssl/openssl/doc/apps/s_server.pod index 6f4acb7006ffdc..fa17488d917359 100644 --- a/deps/openssl/openssl/doc/apps/s_server.pod +++ b/deps/openssl/openssl/doc/apps/s_server.pod @@ -62,6 +62,7 @@ B B [B<-status_verbose>] [B<-status_timeout nsec>] [B<-status_url url>] +[B<-alpn protocols>] [B<-nextprotoneg protocols>] =head1 DESCRIPTION @@ -327,9 +328,13 @@ sets a fallback responder URL to use if no responder URL is present in the server certificate. Without this option an error is returned if the server certificate does not contain a responder address. -=item B<-nextprotoneg protocols> +=item B<-alpn protocols>, B<-nextprotoneg protocols> -enable Next Protocol Negotiation TLS extension and provide a +these flags enable the +Enable the Application-Layer Protocol Negotiation or Next Protocol +Negotiation extension, respectively. ALPN is the IETF standard and +replaces NPN. +The B list is a comma-separated list of supported protocol names. The list should contain most wanted protocols first. Protocol names are printable ASCII strings, for example "http/1.1" or diff --git a/deps/openssl/openssl/doc/apps/smime.pod b/deps/openssl/openssl/doc/apps/smime.pod index d5618c8ff0dfd6..04a83ca8e427ba 100644 --- a/deps/openssl/openssl/doc/apps/smime.pod +++ b/deps/openssl/openssl/doc/apps/smime.pod @@ -53,6 +53,9 @@ The meaning of the other options varies according to the operation type. encrypt mail for the given recipient certificates. Input file is the message to be encrypted. The output file is the encrypted mail in MIME format. +Note that no revocation check is done for the recipient cert, so if that +key has been compromised, others may be able to decrypt the text. + =item B<-decrypt> decrypt mail using the supplied certificate and private key. Expects an diff --git a/deps/openssl/openssl/doc/apps/verify.pod b/deps/openssl/openssl/doc/apps/verify.pod index bffa6c0ec403e5..b3767325ae075a 100644 --- a/deps/openssl/openssl/doc/apps/verify.pod +++ b/deps/openssl/openssl/doc/apps/verify.pod @@ -27,6 +27,7 @@ B B [B<-use_deltas>] [B<-policy_print>] [B<-no_alt_chains>] +[B<-allow_proxy_certs>] [B<-untrusted file>] [B<-help>] [B<-issuer_checks>] @@ -139,6 +140,10 @@ be found that is trusted. With this option that behaviour is suppressed so that only the first chain found is ever used. Using this option will force the behaviour to match that of previous OpenSSL versions. +=item B<-allow_proxy_certs> + +Allow the verification of proxy certificates. + =item B<-trusted file> A file of additional trusted certificates. The file should contain multiple diff --git a/deps/openssl/openssl/doc/apps/x509.pod b/deps/openssl/openssl/doc/apps/x509.pod index 26f71c88329500..1479a749571677 100644 --- a/deps/openssl/openssl/doc/apps/x509.pod +++ b/deps/openssl/openssl/doc/apps/x509.pod @@ -642,8 +642,8 @@ hex dump unsupported extensions. =item B -the value used by the B utility, equivalent to B, B, B, -B, B and B. +the value used by the B utility, equivalent to B, B, +B, and B. =back diff --git a/deps/openssl/openssl/doc/apps/x509v3_config.pod b/deps/openssl/openssl/doc/apps/x509v3_config.pod index c82cea1da24ee4..fb5f79c356e6ea 100644 --- a/deps/openssl/openssl/doc/apps/x509v3_config.pod +++ b/deps/openssl/openssl/doc/apps/x509v3_config.pod @@ -104,7 +104,7 @@ Examples: This extensions consists of a list of usages indicating purposes for which the certificate public key can be used for, -These can either be object short names of the dotted numerical form of OIDs. +These can either be object short names or the dotted numerical form of OIDs. While any OID can be used only certain values make sense. In particular the following PKIX, NS and MS values are meaningful: diff --git a/deps/openssl/openssl/doc/crypto/BIO_s_bio.pod b/deps/openssl/openssl/doc/crypto/BIO_s_bio.pod index 8d0a55a025c73f..9fe88b26b0af8e 100644 --- a/deps/openssl/openssl/doc/crypto/BIO_s_bio.pod +++ b/deps/openssl/openssl/doc/crypto/BIO_s_bio.pod @@ -120,6 +120,9 @@ the application then waits for data to be available on the underlying transport before flushing the write buffer it will never succeed because the request was never sent! +BIO_eof() is true if no data is in the peer BIO and the peer BIO has been +shutdown. + =head1 RETURN VALUES BIO_new_bio_pair() returns 1 on success, with the new BIOs available in diff --git a/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod b/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod index a4b17ca60a891e..3bed47f8f1d553 100644 --- a/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod +++ b/deps/openssl/openssl/doc/crypto/BN_bn2bin.pod @@ -42,7 +42,9 @@ BN_hex2bn() converts the string B containing a hexadecimal number to a B and stores it in **B. If *B is NULL, a new B is created. If B is NULL, it only computes the number's length in hexadecimal digits. If the string starts with '-', the -number is negative. BN_dec2bn() is the same using the decimal system. +number is negative. +A "negative zero" is converted to zero. +BN_dec2bn() is the same using the decimal system. BN_print() and BN_print_fp() write the hexadecimal encoding of B
    , with a leading '-' for negative numbers, to the B or B diff --git a/deps/openssl/openssl/doc/crypto/BN_rand.pod b/deps/openssl/openssl/doc/crypto/BN_rand.pod index e8cbf658b47d81..a1513a952654ef 100644 --- a/deps/openssl/openssl/doc/crypto/BN_rand.pod +++ b/deps/openssl/openssl/doc/crypto/BN_rand.pod @@ -19,7 +19,11 @@ BN_rand, BN_pseudo_rand, BN_rand_range, BN_pseudo_rand_range - generate pseudo-r =head1 DESCRIPTION BN_rand() generates a cryptographically strong pseudo-random number of -B in length and stores it in B. If B is -1, the +B in length and stores it in B. +If B is less than zero, or too small to +accomodate the requirements specified by the B and B +parameters, an error is returned. +If B is -1, the most significant bit of the random number can be zero. If B is 0, it is set to 1, and if B is 1, the two most significant bits of the number will be set to 1, so that the product of two such random diff --git a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod index c69e6a6d700e4e..d9513338d8aacb 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_EncryptInit.pod @@ -165,10 +165,11 @@ similar way to EVP_EncryptInit_ex(), EVP_DecryptInit_ex and EVP_CipherInit_ex() except the B parameter does not need to be initialized and they always use the default cipher implementation. -EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() behave in a -similar way to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and -EVP_CipherFinal_ex() except B is automatically cleaned up -after the call. +EVP_EncryptFinal(), EVP_DecryptFinal() and EVP_CipherFinal() are +identical to EVP_EncryptFinal_ex(), EVP_DecryptFinal_ex() and +EVP_CipherFinal_ex(). In previous releases they also cleaned up +the B, but this is no longer done and EVP_CIPHER_CTX_clean() +must be called to free any context resources. EVP_get_cipherbyname(), EVP_get_cipherbynid() and EVP_get_cipherbyobj() return an EVP_CIPHER structure when passed a cipher name, a NID or an diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_cmp.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_cmp.pod index 0ff027c0d5f93b..f8e7ff1039eeb8 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_cmp.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_cmp.pod @@ -21,7 +21,9 @@ parameters of B are missing and 0 if they are present or the algorithm doesn't use parameters. The function EVP_PKEY_copy_parameters() copies the parameters from key -B to key B. +B to key B. An error is returned if the parameters are missing in +B or present in both B and B and mismatch. If the parameters +in B and B are both present and match this function has no effect. The function EVP_PKEY_cmp_parameters() compares the parameters of keys B and B. diff --git a/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod b/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod index 1e45dd40f6bb83..b8d289673deedc 100644 --- a/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod +++ b/deps/openssl/openssl/doc/crypto/OBJ_nid2obj.pod @@ -33,6 +33,12 @@ functions The ASN1 object utility functions process ASN1_OBJECT structures which are a representation of the ASN1 OBJECT IDENTIFIER (OID) type. +For convenience, OIDs are usually represented in source code as numeric +identifiers, or Bs. OpenSSL has an internal table of OIDs that +are generated when the library is built, and their corresponding NIDs +are available as defined constants. For the functions below, application +code should treat all returned values -- OIDs, NIDs, or names -- as +constants. OBJ_nid2obj(), OBJ_nid2ln() and OBJ_nid2sn() convert the NID B to an ASN1_OBJECT structure, its long name and its short name respectively, @@ -96,6 +102,16 @@ Objects do not need to be in the internal tables to be processed, the functions OBJ_txt2obj() and OBJ_obj2txt() can process the numerical form of an OID. +Some objects are used to represent algorithms which do not have a +corresponding ASN.1 OBJECT IDENTIFIER encoding (for example no OID currently +exists for a particular algorithm). As a result they B be encoded or +decoded as part of ASN.1 structures. Applications can determine if there +is a corresponding OBJECT IDENTIFIER by checking OBJ_length() is not zero. + +These functions cannot return B because an B can +represent both an internal, constant, OID and a dynamically-created one. +The latter cannot be constant because it needs to be freed after use. + =head1 EXAMPLES Create an object for B: @@ -106,12 +122,13 @@ Create an object for B: Check if an object is B if (OBJ_obj2nid(obj) == NID_commonName) - /* Do something */ + /* Do something */ Create a new NID and initialize an object from it: int new_nid; ASN1_OBJECT *obj; + new_nid = OBJ_create("1.2.3.4", "NewOID", "New Object Identifier"); obj = OBJ_nid2obj(new_nid); @@ -133,6 +150,8 @@ than enough to handle any OID encountered in practice. OBJ_nid2obj() returns an B structure or B is an error occurred. +It returns a pointer to an internal table and does not +allocate memory; ASN1_OBJECT_free() will have no effect. OBJ_nid2ln() and OBJ_nid2sn() returns a valid string or B on error. diff --git a/deps/openssl/openssl/doc/crypto/OPENSSL_config.pod b/deps/openssl/openssl/doc/crypto/OPENSSL_config.pod index 2d25b266951207..4e713653d09cc3 100644 --- a/deps/openssl/openssl/doc/crypto/OPENSSL_config.pod +++ b/deps/openssl/openssl/doc/crypto/OPENSSL_config.pod @@ -8,15 +8,14 @@ OPENSSL_config, OPENSSL_no_config - simple OpenSSL configuration functions #include - void OPENSSL_config(const char *config_name); + void OPENSSL_config(const char *appname); void OPENSSL_no_config(void); =head1 DESCRIPTION -OPENSSL_config() configures OpenSSL using the standard B -configuration file name using B. If B is NULL then -the file specified in the environment variable B will be used, -and if that is not set then a system default location is used. +OPENSSL_config() configures OpenSSL using the standard B and +reads from the application section B. If B is NULL then +the default section, B, will be used. Errors are silently ignored. Multiple calls have no effect. diff --git a/deps/openssl/openssl/doc/crypto/OPENSSL_ia32cap.pod b/deps/openssl/openssl/doc/crypto/OPENSSL_ia32cap.pod index 90156d21901b69..5bcb82e3cfedf6 100644 --- a/deps/openssl/openssl/doc/crypto/OPENSSL_ia32cap.pod +++ b/deps/openssl/openssl/doc/crypto/OPENSSL_ia32cap.pod @@ -6,7 +6,7 @@ OPENSSL_ia32cap, OPENSSL_ia32cap_loc - the IA-32 processor capabilities vector =head1 SYNOPSIS - unsigned int *OPENSSL_ia32cap_loc(void); + unsigned long *OPENSSL_ia32cap_loc(void); #define OPENSSL_ia32cap ((OPENSSL_ia32cap_loc())[0]) =head1 DESCRIPTION diff --git a/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod b/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod index a22e44118cfc07..4689e3afea4e03 100644 --- a/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod +++ b/deps/openssl/openssl/doc/crypto/X509_verify_cert.pod @@ -31,12 +31,13 @@ Applications rarely call this function directly but it is used by OpenSSL internally for certificate validation, in both the S/MIME and SSL/TLS code. -The negative return value from X509_verify_cert() can only occur if no -certificate is set in B (due to a programming error); if X509_verify_cert() -twice without reinitialising B in between; or if a retry -operation is requested during internal lookups (which never happens with -standard lookup methods). It is however recommended that application check -for <= 0 return value on error. +A negative return value from X509_verify_cert() can occur if it is invoked +incorrectly, such as with no certificate set in B, or when it is called +twice in succession without reinitialising B for the second call. +A negative return value can also happen due to internal resource problems or if +a retry operation is requested during internal lookups (which never happens +with standard lookup methods). +Applications must check for <= 0 return value on error. =head1 BUGS diff --git a/deps/openssl/openssl/doc/crypto/d2i_PrivateKey.pod b/deps/openssl/openssl/doc/crypto/d2i_PrivateKey.pod new file mode 100644 index 00000000000000..e06ab6c5dee85c --- /dev/null +++ b/deps/openssl/openssl/doc/crypto/d2i_PrivateKey.pod @@ -0,0 +1,59 @@ +=pod + +=head1 NAME + +d2i_Private_key, d2i_AutoPrivateKey, i2d_PrivateKey - decode and encode +functions for reading and saving EVP_PKEY structures. + +=head1 SYNOPSIS + + #include + + EVP_PKEY *d2i_PrivateKey(int type, EVP_PKEY **a, const unsigned char **pp, + long length); + EVP_PKEY *d2i_AutoPrivateKey(EVP_PKEY **a, const unsigned char **pp, + long length); + int i2d_PrivateKey(EVP_PKEY *a, unsigned char **pp); + +=head1 DESCRIPTION + +d2i_PrivateKey() decodes a private key using algorithm B. It attempts to +use any key specific format or PKCS#8 unencrypted PrivateKeyInfo format. The +B parameter should be a public key algorithm constant such as +B. An error occurs if the decoded key does not match B. + +d2i_AutoPrivateKey() is similar to d2i_PrivateKey() except it attempts to +automatically detect the private key format. + +i2d_PrivateKey() encodes B. It uses a key specific format or, if none is +defined for that key type, PKCS#8 unencrypted PrivateKeyInfo format. + +These functions are similar to the d2i_X509() functions, and you should refer to +that page for a detailed description (see L). + +=head1 NOTES + +All these functions use DER format and unencrypted keys. Applications wishing +to encrypt or decrypt private keys should use other functions such as +d2i_PKC8PrivateKey() instead. + +If the B<*a> is not NULL when calling d2i_PrivateKey() or d2i_AutoPrivateKey() +(i.e. an existing structure is being reused) and the key format is PKCS#8 +then B<*a> will be freed and replaced on a successful call. + +=head1 RETURN VALUES + +d2i_PrivateKey() and d2i_AutoPrivateKey() return a valid B structure +or B if an error occurs. The error code can be obtained by calling +L. + +i2d_PrivateKey() returns the number of bytes successfully encoded or a +negative value if an error occurs. The error code can be obtained by calling +L. + +=head1 SEE ALSO + +L, +L + +=cut diff --git a/deps/openssl/openssl/doc/crypto/d2i_X509.pod b/deps/openssl/openssl/doc/crypto/d2i_X509.pod index 5b7c16fd0316bc..2743bc73e70ef5 100644 --- a/deps/openssl/openssl/doc/crypto/d2i_X509.pod +++ b/deps/openssl/openssl/doc/crypto/d2i_X509.pod @@ -9,8 +9,10 @@ i2d_X509_fp - X509 encode and decode functions #include - X509 *d2i_X509(X509 **px, const unsigned char **in, int len); + X509 *d2i_X509(X509 **px, const unsigned char **in, long len); + X509 *d2i_X509_AUX(X509 **px, const unsigned char **in, long len); int i2d_X509(X509 *x, unsigned char **out); + int i2d_X509_AUX(X509 *x, unsigned char **out); X509 *d2i_X509_bio(BIO *bp, X509 **x); X509 *d2i_X509_fp(FILE *fp, X509 **x); @@ -37,6 +39,11 @@ below, and the discussion in the RETURN VALUES section). If the call is successful B<*in> is incremented to the byte following the parsed data. +d2i_X509_AUX() is similar to d2i_X509() but the input is expected to consist of +an X509 certificate followed by auxiliary trust information. +This is used by the PEM routines to read "TRUSTED CERTIFICATE" objects. +This function should not be called on untrusted input. + i2d_X509() encodes the structure pointed to by B into DER format. If B is not B is writes the DER encoded data to the buffer at B<*out>, and increments it to point after the data just written. @@ -48,6 +55,11 @@ allocated for a buffer and the encoded data written to it. In this case B<*out> is not incremented and it points to the start of the data just written. +i2d_X509_AUX() is similar to i2d_X509(), but the encoded output contains both +the certificate and any auxiliary trust information. +This is used by the PEM routines to write "TRUSTED CERTIFICATE" objects. +Note, this is a non-standard OpenSSL-specific data format. + d2i_X509_bio() is similar to d2i_X509() except it attempts to parse data from BIO B. diff --git a/deps/openssl/openssl/doc/crypto/hmac.pod b/deps/openssl/openssl/doc/crypto/hmac.pod index 58a57f47bb4fe4..2c8f20a2018869 100644 --- a/deps/openssl/openssl/doc/crypto/hmac.pod +++ b/deps/openssl/openssl/doc/crypto/hmac.pod @@ -60,13 +60,17 @@ function B and the key B which is B bytes long. It is deprecated and only included for backward compatibility with OpenSSL 0.9.6b. -HMAC_Init_ex() initializes or reuses a B structure to use -the function B and key B. Either can be NULL, in which -case the existing one will be reused. HMAC_CTX_init() must have been -called before the first use of an B in this -function. B. +HMAC_Init_ex() initializes or reuses a B structure to use the hash +function B and key B. If both are NULL (or B is the same +as the previous digest used by B and B is NULL) the existing key is +reused. B must have been created with HMAC_CTX_new() before the first use +of an B in this function. B. + +B NULL and B is not the +same as the previous digest used by B then an error is returned +because reuse of an existing key with a different digest is not supported.> HMAC_Update() can be called repeatedly with chunks of the message to be authenticated (B bytes at B). diff --git a/deps/openssl/openssl/doc/crypto/rand.pod b/deps/openssl/openssl/doc/crypto/rand.pod index d102df2eee8015..b754854bcf0590 100644 --- a/deps/openssl/openssl/doc/crypto/rand.pod +++ b/deps/openssl/openssl/doc/crypto/rand.pod @@ -14,7 +14,7 @@ rand - pseudo-random number generator int RAND_pseudo_bytes(unsigned char *buf, int num); void RAND_seed(const void *buf, int num); - void RAND_add(const void *buf, int num, int entropy); + void RAND_add(const void *buf, int num, double entropy); int RAND_status(void); int RAND_load_file(const char *file, long max_bytes); diff --git a/deps/openssl/openssl/doc/crypto/ui.pod b/deps/openssl/openssl/doc/crypto/ui.pod index 04f8e9c360a850..2e94d8c0f68999 100644 --- a/deps/openssl/openssl/doc/crypto/ui.pod +++ b/deps/openssl/openssl/doc/crypto/ui.pod @@ -109,12 +109,12 @@ that's connected to it, like duplicated input strings, results and others. UI_add_input_string() and UI_add_verify_string() add a prompt to the UI, as well as flags and a result buffer and the desired minimum and maximum -sizes of the result. The given information is used to prompt for -information, for example a password, and to verify a password (i.e. having -the user enter it twice and check that the same string was entered twice). -UI_add_verify_string() takes and extra argument that should be a pointer -to the result buffer of the input string that it's supposed to verify, or -verification will fail. +sizes of the result, not counting the final NUL character. The given +information is used to prompt for information, for example a password, +and to verify a password (i.e. having the user enter it twice and check +that the same string was entered twice). UI_add_verify_string() takes +and extra argument that should be a pointer to the result buffer of the +input string that it's supposed to verify, or verification will fail. UI_add_input_boolean() adds a prompt to the UI that's supposed to be answered in a boolean way, with a single character for yes and a different character diff --git a/deps/openssl/openssl/engines/ccgost/gost2001.c b/deps/openssl/openssl/engines/ccgost/gost2001.c index 9536295430d068..881d0d3c909750 100644 --- a/deps/openssl/openssl/engines/ccgost/gost2001.c +++ b/deps/openssl/openssl/engines/ccgost/gost2001.c @@ -434,8 +434,16 @@ int gost2001_compute_public(EC_KEY *ec) int gost2001_keygen(EC_KEY *ec) { BIGNUM *order = BN_new(), *d = BN_new(); - const EC_GROUP *group = EC_KEY_get0_group(ec); + const EC_GROUP *group = NULL; + + if (order == NULL || d == NULL) { + GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_MALLOC_FAILURE); + BN_free(d); + BN_free(order); + return 0; + } + group = EC_KEY_get0_group(ec); if(!group || !EC_GROUP_get_order(group, order, NULL)) { GOSTerr(GOST_F_GOST2001_KEYGEN, ERR_R_INTERNAL_ERROR); BN_free(d); diff --git a/deps/openssl/openssl/engines/ccgost/gost2001_keyx.c b/deps/openssl/openssl/engines/ccgost/gost2001_keyx.c index db1bdc18fd763b..ac7862eab55056 100644 --- a/deps/openssl/openssl/engines/ccgost/gost2001_keyx.c +++ b/deps/openssl/openssl/engines/ccgost/gost2001_keyx.c @@ -147,6 +147,8 @@ int pkey_GOST01cp_encrypt(EVP_PKEY_CTX *pctx, unsigned char *out, key_is_ephemeral = 1; if (out) { sec_key = EVP_PKEY_new(); + if (sec_key == NULL) + goto err; EVP_PKEY_assign(sec_key, EVP_PKEY_base_id(pubk), EC_KEY_new()); EVP_PKEY_copy_parameters(sec_key, pubk); if (!gost2001_keygen(EVP_PKEY_get0(sec_key))) { diff --git a/deps/openssl/openssl/engines/ccgost/gost94_keyx.c b/deps/openssl/openssl/engines/ccgost/gost94_keyx.c index ce57f17cbf32f1..3532bfff3e9691 100644 --- a/deps/openssl/openssl/engines/ccgost/gost94_keyx.c +++ b/deps/openssl/openssl/engines/ccgost/gost94_keyx.c @@ -126,6 +126,8 @@ int pkey_GOST94cp_encrypt(EVP_PKEY_CTX *ctx, unsigned char *out, key_is_ephemeral = 1; if (out) { mykey = EVP_PKEY_new(); + if (!mykey) + goto memerr; EVP_PKEY_assign(mykey, EVP_PKEY_base_id(pubk), DSA_new()); EVP_PKEY_copy_parameters(mykey, pubk); if (!gost_sign_keygen(EVP_PKEY_get0(mykey))) { diff --git a/deps/openssl/openssl/engines/ccgost/gost_ameth.c b/deps/openssl/openssl/engines/ccgost/gost_ameth.c index b7c5354c1ae293..8283f192f4aa79 100644 --- a/deps/openssl/openssl/engines/ccgost/gost_ameth.c +++ b/deps/openssl/openssl/engines/ccgost/gost_ameth.c @@ -617,6 +617,10 @@ static int pub_decode_gost94(EVP_PKEY *pk, X509_PUBKEY *pub) return 0; } databuf = OPENSSL_malloc(octet->length); + if (databuf == NULL) { + GOSTerr(GOST_F_PUB_DECODE_GOST94, ERR_R_MALLOC_FAILURE); + return 0; + } for (i = 0, j = octet->length - 1; i < octet->length; i++, j--) { databuf[j] = octet->data[i]; } @@ -646,6 +650,8 @@ static int pub_encode_gost94(X509_PUBKEY *pub, const EVP_PKEY *pk) } data_len = BN_num_bytes(dsa->pub_key); databuf = OPENSSL_malloc(data_len); + if (databuf == NULL) + return 0; BN_bn2bin(dsa->pub_key, databuf); octet = ASN1_OCTET_STRING_new(); ASN1_STRING_set(octet, NULL, data_len); @@ -686,6 +692,10 @@ static int pub_decode_gost01(EVP_PKEY *pk, X509_PUBKEY *pub) return 0; } databuf = OPENSSL_malloc(octet->length); + if (databuf == NULL) { + GOSTerr(GOST_F_PUB_DECODE_GOST01, ERR_R_MALLOC_FAILURE); + return 0; + } for (i = 0, j = octet->length - 1; i < octet->length; i++, j--) { databuf[j] = octet->data[i]; } @@ -760,6 +770,10 @@ static int pub_encode_gost01(X509_PUBKEY *pub, const EVP_PKEY *pk) data_len = 2 * BN_num_bytes(order); BN_free(order); databuf = OPENSSL_malloc(data_len); + if (databuf == NULL) { + GOSTerr(GOST_F_PUB_ENCODE_GOST01, ERR_R_MALLOC_FAILURE); + return 0; + } memset(databuf, 0, data_len); store_bignum(X, databuf + data_len / 2, data_len / 2); diff --git a/deps/openssl/openssl/engines/ccgost/gost_pmeth.c b/deps/openssl/openssl/engines/ccgost/gost_pmeth.c index 4a79a85cfc6203..696829253b62f2 100644 --- a/deps/openssl/openssl/engines/ccgost/gost_pmeth.c +++ b/deps/openssl/openssl/engines/ccgost/gost_pmeth.c @@ -107,6 +107,8 @@ static int pkey_gost_ctrl(EVP_PKEY_CTX *ctx, int type, int p1, void *p2) return 1; case EVP_PKEY_CTRL_SET_IV: pctx->shared_ukm = OPENSSL_malloc((int)p1); + if (pctx->shared_ukm == NULL) + return 0; memcpy(pctx->shared_ukm, p2, (int)p1); return 1; case EVP_PKEY_CTRL_PEER_KEY: @@ -533,6 +535,8 @@ static int pkey_gost_mac_keygen(EVP_PKEY_CTX *ctx, EVP_PKEY *pkey) return 0; } keydata = OPENSSL_malloc(32); + if (keydata == NULL) + return 0; memcpy(keydata, data->key, 32); EVP_PKEY_assign(pkey, NID_id_Gost28147_89_MAC, keydata); return 1; diff --git a/deps/openssl/openssl/engines/e_4758cca.c b/deps/openssl/openssl/engines/e_4758cca.c index 5f771986cfae2b..60ba4abcdfafd4 100644 --- a/deps/openssl/openssl/engines/e_4758cca.c +++ b/deps/openssl/openssl/engines/e_4758cca.c @@ -463,6 +463,10 @@ static EVP_PKEY *ibm_4758_load_privkey(ENGINE *e, const char *key_id, (*(long *)keyToken) = keyTokenLength; rtmp = RSA_new_method(e); + if (rtmp == NULL) { + CCA4758err(CCA4758_F_IBM_4758_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); + goto err; + } RSA_set_ex_data(rtmp, hndidx, (char *)keyToken); rtmp->e = BN_bin2bn(exponent, exponentLength, NULL); @@ -535,6 +539,10 @@ static EVP_PKEY *ibm_4758_load_pubkey(ENGINE *e, const char *key_id, (*(long *)keyToken) = keyTokenLength; rtmp = RSA_new_method(e); + if (rtmp == NULL) { + CCA4758err(CCA4758_F_IBM_4758_LOAD_PUBKEY, ERR_R_MALLOC_FAILURE); + goto err; + } RSA_set_ex_data(rtmp, hndidx, (char *)keyToken); rtmp->e = BN_bin2bn(exponent, exponentLength, NULL); rtmp->n = BN_bin2bn(modulus, modulusFieldLength, NULL); diff --git a/deps/openssl/openssl/engines/e_aep.c b/deps/openssl/openssl/engines/e_aep.c index 9bfda76a927d73..4e97d29497e74f 100644 --- a/deps/openssl/openssl/engines/e_aep.c +++ b/deps/openssl/openssl/engines/e_aep.c @@ -1137,7 +1137,8 @@ static AEP_RV ConvertAEPBigNum(void *ArbBigNum, AEP_U32 BigNumSize, /* * Expand the result bn so that it can hold our big num. Size is in bits */ - bn_expand(bn, (int)(BigNumSize << 3)); + if (bn_expand(bn, (int)(BigNumSize << 3)) == NULL) + return AEP_R_HOST_MEMORY; # ifdef SIXTY_FOUR_BIT_LONG bn->top = BigNumSize >> 3; diff --git a/deps/openssl/openssl/engines/e_capi.c b/deps/openssl/openssl/engines/e_capi.c index 6e524633f3f0f6..8c08872bfdf446 100644 --- a/deps/openssl/openssl/engines/e_capi.c +++ b/deps/openssl/openssl/engines/e_capi.c @@ -1106,6 +1106,10 @@ static int capi_get_provname(CAPI_CTX * ctx, LPSTR * pname, DWORD * ptype, name = alloca(len); else name = OPENSSL_malloc(len); + if (name == NULL) { + CAPIerr(CAPI_F_CAPI_GET_PROVNAME, ERR_R_MALLOC_FAILURE); + return 0; + } if (!CryptEnumProviders(idx, NULL, 0, ptype, name, &len)) { err = GetLastError(); if (err == ERROR_NO_MORE_ITEMS) @@ -1286,6 +1290,10 @@ char *capi_cert_get_fname(CAPI_CTX * ctx, PCCERT_CONTEXT cert) (cert, CERT_FRIENDLY_NAME_PROP_ID, NULL, &dlen)) return NULL; wfname = OPENSSL_malloc(dlen); + if (wfname == NULL) { + CAPIerr(CAPI_F_CAPI_CERT_GET_FNAME, ERR_R_MALLOC_FAILURE); + return NULL; + } if (CertGetCertificateContextProperty (cert, CERT_FRIENDLY_NAME_PROP_ID, wfname, &dlen)) { char *fname = wide_to_asc(wfname); @@ -1436,6 +1444,11 @@ static CAPI_KEY *capi_get_key(CAPI_CTX * ctx, const TCHAR *contname, CAPI_KEY *key; DWORD dwFlags = 0; key = OPENSSL_malloc(sizeof(CAPI_KEY)); + if (key == NULL) { + CAPIerr(CAPI_F_CAPI_GET_KEY, ERR_R_MALLOC_FAILURE); + capi_addlasterror(); + goto err; + } if (sizeof(TCHAR) == sizeof(char)) CAPI_trace(ctx, "capi_get_key, contname=%s, provname=%s, type=%d\n", contname, provname, ptype); diff --git a/deps/openssl/openssl/engines/e_chil.c b/deps/openssl/openssl/engines/e_chil.c index 5dfab513452761..d5e4cb67c44077 100644 --- a/deps/openssl/openssl/engines/e_chil.c +++ b/deps/openssl/openssl/engines/e_chil.c @@ -810,9 +810,17 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, # endif # ifndef OPENSSL_NO_RSA rtmp = RSA_new_method(eng); + if (rtmp == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); + goto err; + } RSA_set_ex_data(rtmp, hndidx_rsa, (char *)hptr); rtmp->e = BN_new(); rtmp->n = BN_new(); + if (rtmp->e == NULL || rtmp->n == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); + goto err; + } rtmp->flags |= RSA_FLAG_EXT_PKEY; MPI2BN(rtmp->e, e); MPI2BN(rtmp->n, n); @@ -823,8 +831,14 @@ static EVP_PKEY *hwcrhk_load_privkey(ENGINE *eng, const char *key_id, goto err; } - bn_expand2(rtmp->e, e.size / sizeof(BN_ULONG)); - bn_expand2(rtmp->n, n.size / sizeof(BN_ULONG)); + if (bn_expand2(rtmp->e, e.size / sizeof(BN_ULONG)) == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); + goto err; + } + if (bn_expand2(rtmp->n, n.size / sizeof(BN_ULONG)) == NULL) { + HWCRHKerr(HWCRHK_F_HWCRHK_LOAD_PRIVKEY, ERR_R_MALLOC_FAILURE); + goto err; + } MPI2BN(rtmp->e, e); MPI2BN(rtmp->n, n); @@ -923,7 +937,10 @@ static int hwcrhk_mod_exp(BIGNUM *r, const BIGNUM *a, const BIGNUM *p, goto err; } /* Prepare the params */ - bn_expand2(r, m->top); /* Check for error !! */ + if (bn_expand2(r, m->top) == NULL) { /* Check for error !! */ + HWCRHKerr(HWCRHK_F_HWCRHK_MOD_EXP, ERR_R_MALLOC_FAILURE); + goto err; + } BN2MPI(m_a, a); BN2MPI(m_p, p); BN2MPI(m_n, m); @@ -989,7 +1006,10 @@ static int hwcrhk_rsa_mod_exp(BIGNUM *r, const BIGNUM *I, RSA *rsa, } /* Prepare the params */ - bn_expand2(r, rsa->n->top); /* Check for error !! */ + if (bn_expand2(r, rsa->n->top) == NULL) { /* Check for error !! */ + HWCRHKerr(HWCRHK_F_HWCRHK_RSA_MOD_EXP, ERR_R_MALLOC_FAILURE); + goto err; + } BN2MPI(m_a, I); MPI2BN(r, m_r); @@ -1026,7 +1046,10 @@ static int hwcrhk_rsa_mod_exp(BIGNUM *r, const BIGNUM *I, RSA *rsa, } /* Prepare the params */ - bn_expand2(r, rsa->n->top); /* Check for error !! */ + if (bn_expand2(r, rsa->n->top) == NULL) { /* Check for error !! */ + HWCRHKerr(HWCRHK_F_HWCRHK_RSA_MOD_EXP, ERR_R_MALLOC_FAILURE); + goto err; + } BN2MPI(m_a, I); BN2MPI(m_p, rsa->p); BN2MPI(m_q, rsa->q); @@ -1272,7 +1295,7 @@ static int hwcrhk_insert_card(const char *prompt_info, ui = UI_new_method(ui_method); if (ui) { - char answer; + char answer = '\0'; char buf[BUFSIZ]; /* * Despite what the documentation says wrong_info can be an empty diff --git a/deps/openssl/openssl/include/openssl/bio.h b/deps/openssl/openssl/include/openssl/bio.h index 6790aed28e0bae..8f2438cdad7018 100644 --- a/deps/openssl/openssl/include/openssl/bio.h +++ b/deps/openssl/openssl/include/openssl/bio.h @@ -559,11 +559,11 @@ int BIO_read_filename(BIO *b, const char *name); # define BIO_get_ssl(b,sslp) BIO_ctrl(b,BIO_C_GET_SSL,0,(char *)sslp) # define BIO_set_ssl_mode(b,client) BIO_ctrl(b,BIO_C_SSL_MODE,client,NULL) # define BIO_set_ssl_renegotiate_bytes(b,num) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL); + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_BYTES,num,NULL) # define BIO_get_num_renegotiates(b) \ - BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL); + BIO_ctrl(b,BIO_C_GET_SSL_NUM_RENEGOTIATES,0,NULL) # define BIO_set_ssl_renegotiate_timeout(b,seconds) \ - BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL); + BIO_ctrl(b,BIO_C_SET_SSL_RENEGOTIATE_TIMEOUT,seconds,NULL) /* defined in evp.h */ /* #define BIO_set_md(b,md) BIO_ctrl(b,BIO_C_SET_MD,1,(char *)md) */ diff --git a/deps/openssl/openssl/include/openssl/bn.h b/deps/openssl/openssl/include/openssl/bn.h index 86264ae6315fb1..633d1b1f60136e 100644 --- a/deps/openssl/openssl/include/openssl/bn.h +++ b/deps/openssl/openssl/include/openssl/bn.h @@ -842,6 +842,8 @@ int RAND_pseudo_bytes(unsigned char *buf, int num); if (*(ftl--)) break; \ (a)->top = tmp_top; \ } \ + if ((a)->top == 0) \ + (a)->neg = 0; \ bn_pollute(a); \ } diff --git a/deps/openssl/openssl/include/openssl/comp.h b/deps/openssl/openssl/include/openssl/comp.h index 60a073404e922f..df599ba3314bfb 100644 --- a/deps/openssl/openssl/include/openssl/comp.h +++ b/deps/openssl/openssl/include/openssl/comp.h @@ -14,7 +14,7 @@ extern "C" { typedef struct comp_ctx_st COMP_CTX; -typedef struct comp_method_st { +struct comp_method_st { int type; /* NID for compression library */ const char *name; /* A text string to identify the library */ int (*init) (COMP_CTX *ctx); @@ -30,7 +30,7 @@ typedef struct comp_method_st { */ long (*ctrl) (void); long (*callback_ctrl) (void); -} COMP_METHOD; +}; struct comp_ctx_st { COMP_METHOD *meth; diff --git a/deps/openssl/openssl/include/openssl/opensslv.h b/deps/openssl/openssl/include/openssl/opensslv.h index 13fe440231cd73..88faad652259b4 100644 --- a/deps/openssl/openssl/include/openssl/opensslv.h +++ b/deps/openssl/openssl/include/openssl/opensslv.h @@ -30,11 +30,11 @@ extern "C" { * (Prior to 0.9.5a beta1, a different scheme was used: MMNNFFRBB for * major minor fix final patch/beta) */ -# define OPENSSL_VERSION_NUMBER 0x1000208fL +# define OPENSSL_VERSION_NUMBER 0x100020afL # ifdef OPENSSL_FIPS -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h-fips 3 May 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j-fips 26 Sep 2016" # else -# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2h 3 May 2016" +# define OPENSSL_VERSION_TEXT "OpenSSL 1.0.2j 26 Sep 2016" # endif # define OPENSSL_VERSION_PTEXT " part of " OPENSSL_VERSION_TEXT diff --git a/deps/openssl/openssl/include/openssl/ossl_typ.h b/deps/openssl/openssl/include/openssl/ossl_typ.h index 9144ea2cf60b3a..364d26238e8c4d 100644 --- a/deps/openssl/openssl/include/openssl/ossl_typ.h +++ b/deps/openssl/openssl/include/openssl/ossl_typ.h @@ -178,6 +178,8 @@ typedef struct engine_st ENGINE; typedef struct ssl_st SSL; typedef struct ssl_ctx_st SSL_CTX; +typedef struct comp_method_st COMP_METHOD; + typedef struct X509_POLICY_NODE_st X509_POLICY_NODE; typedef struct X509_POLICY_LEVEL_st X509_POLICY_LEVEL; typedef struct X509_POLICY_TREE_st X509_POLICY_TREE; diff --git a/deps/openssl/openssl/include/openssl/pem.h b/deps/openssl/openssl/include/openssl/pem.h index d3b23fc997d61e..aac72fb21eda39 100644 --- a/deps/openssl/openssl/include/openssl/pem.h +++ b/deps/openssl/openssl/include/openssl/pem.h @@ -531,6 +531,7 @@ int i2b_PVK_bio(BIO *out, EVP_PKEY *pk, int enclevel, * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_PEM_strings(void); /* Error codes for the PEM functions. */ @@ -592,6 +593,7 @@ void ERR_load_PEM_strings(void); # define PEM_R_ERROR_CONVERTING_PRIVATE_KEY 115 # define PEM_R_EXPECTING_PRIVATE_KEY_BLOB 119 # define PEM_R_EXPECTING_PUBLIC_KEY_BLOB 120 +# define PEM_R_HEADER_TOO_LONG 128 # define PEM_R_INCONSISTENT_HEADER 121 # define PEM_R_KEYBLOB_HEADER_PARSE_ERROR 122 # define PEM_R_KEYBLOB_TOO_SHORT 123 @@ -609,7 +611,7 @@ void ERR_load_PEM_strings(void); # define PEM_R_UNSUPPORTED_ENCRYPTION 114 # define PEM_R_UNSUPPORTED_KEY_COMPONENTS 126 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif diff --git a/deps/openssl/openssl/include/openssl/pkcs12.h b/deps/openssl/openssl/include/openssl/pkcs12.h index a39adf5eb52eb5..21f1f62b36c66f 100644 --- a/deps/openssl/openssl/include/openssl/pkcs12.h +++ b/deps/openssl/openssl/include/openssl/pkcs12.h @@ -270,7 +270,7 @@ int i2d_PKCS12_bio(BIO *bp, PKCS12 *p12); int i2d_PKCS12_fp(FILE *fp, PKCS12 *p12); PKCS12 *d2i_PKCS12_bio(BIO *bp, PKCS12 **p12); PKCS12 *d2i_PKCS12_fp(FILE *fp, PKCS12 **p12); -int PKCS12_newpass(PKCS12 *p12, char *oldpass, char *newpass); +int PKCS12_newpass(PKCS12 *p12, const char *oldpass, const char *newpass); /* BEGIN ERROR CODES */ /* diff --git a/deps/openssl/openssl/include/openssl/ssl.h b/deps/openssl/openssl/include/openssl/ssl.h index 5ef56faa509903..90aeb0ce4e1ead 100644 --- a/deps/openssl/openssl/include/openssl/ssl.h +++ b/deps/openssl/openssl/include/openssl/ssl.h @@ -2532,7 +2532,6 @@ void SSL_set_tmp_ecdh_callback(SSL *ssl, int keylength)); # endif -# ifndef OPENSSL_NO_COMP const COMP_METHOD *SSL_get_current_compression(SSL *s); const COMP_METHOD *SSL_get_current_expansion(SSL *s); const char *SSL_COMP_get_name(const COMP_METHOD *comp); @@ -2541,13 +2540,6 @@ STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); void SSL_COMP_free_compression_methods(void); int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); -# else -const void *SSL_get_current_compression(SSL *s); -const void *SSL_get_current_expansion(SSL *s); -const char *SSL_COMP_get_name(const void *comp); -void *SSL_COMP_get_compression_methods(void); -int SSL_COMP_add_compression_method(int id, void *cm); -# endif const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); @@ -2623,6 +2615,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_DTLS1_HEARTBEAT 305 # define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 # define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 +# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 424 # define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 # define SSL_F_DTLS1_PROCESS_RECORD 257 # define SSL_F_DTLS1_READ_BYTES 258 @@ -3114,6 +3107,7 @@ void ERR_load_SSL_strings(void); # define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 # define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 # define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 +# define SSL_R_TOO_MANY_WARN_ALERTS 409 # define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 # define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 # define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 diff --git a/deps/openssl/openssl/include/openssl/ts.h b/deps/openssl/openssl/include/openssl/ts.h index 16eccbb38d9504..2daa1b2fb5940e 100644 --- a/deps/openssl/openssl/include/openssl/ts.h +++ b/deps/openssl/openssl/include/openssl/ts.h @@ -565,6 +565,9 @@ int TS_RESP_CTX_set_clock_precision_digits(TS_RESP_CTX *ctx, /* At most we accept usec precision. */ # define TS_MAX_CLOCK_PRECISION_DIGITS 6 +/* Maximum status message length */ +# define TS_MAX_STATUS_LENGTH (1024 * 1024) + /* No flags are set by default. */ void TS_RESP_CTX_add_flags(TS_RESP_CTX *ctx, int flags); diff --git a/deps/openssl/openssl/include/openssl/x509.h b/deps/openssl/openssl/include/openssl/x509.h index fc613ce63526d2..6fa28ebada465b 100644 --- a/deps/openssl/openssl/include/openssl/x509.h +++ b/deps/openssl/openssl/include/openssl/x509.h @@ -1234,6 +1234,7 @@ int X509_TRUST_get_trust(X509_TRUST *xp); * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + void ERR_load_X509_strings(void); /* Error codes for the X509 functions. */ @@ -1241,6 +1242,7 @@ void ERR_load_X509_strings(void); /* Function codes. */ # define X509_F_ADD_CERT_DIR 100 # define X509_F_BY_FILE_CTRL 101 +# define X509_F_CHECK_NAME_CONSTRAINTS 106 # define X509_F_CHECK_POLICY 145 # define X509_F_DIR_CTRL 102 # define X509_F_GET_CERT_BY_SUBJECT 103 @@ -1322,7 +1324,7 @@ void ERR_load_X509_strings(void); # define X509_R_WRONG_LOOKUP_TYPE 112 # define X509_R_WRONG_TYPE 122 -#ifdef __cplusplus +# ifdef __cplusplus } -#endif +# endif #endif diff --git a/deps/openssl/openssl/include/openssl/x509_vfy.h b/deps/openssl/openssl/include/openssl/x509_vfy.h index 2663e1c0a362aa..50626826e0b9e0 100644 --- a/deps/openssl/openssl/include/openssl/x509_vfy.h +++ b/deps/openssl/openssl/include/openssl/x509_vfy.h @@ -368,6 +368,7 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); # define X509_V_ERR_PERMITTED_VIOLATION 47 # define X509_V_ERR_EXCLUDED_VIOLATION 48 # define X509_V_ERR_SUBTREE_MINMAX 49 +# define X509_V_ERR_APPLICATION_VERIFICATION 50 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_TYPE 51 # define X509_V_ERR_UNSUPPORTED_CONSTRAINT_SYNTAX 52 # define X509_V_ERR_UNSUPPORTED_NAME_SYNTAX 53 @@ -386,8 +387,12 @@ void X509_STORE_CTX_set_depth(X509_STORE_CTX *ctx, int depth); # define X509_V_ERR_EMAIL_MISMATCH 63 # define X509_V_ERR_IP_ADDRESS_MISMATCH 64 -/* The application is not happy */ -# define X509_V_ERR_APPLICATION_VERIFICATION 50 +/* Caller error */ +# define X509_V_ERR_INVALID_CALL 65 +/* Issuer lookup error */ +# define X509_V_ERR_STORE_LOOKUP 66 + +# define X509_V_ERR_PROXY_SUBJECT_NAME_VIOLATION 67 /* Certificate verify flags */ diff --git a/deps/openssl/openssl/openssl.spec b/deps/openssl/openssl/openssl.spec index 55c05c4aff2496..880a5c322fd1ca 100644 --- a/deps/openssl/openssl/openssl.spec +++ b/deps/openssl/openssl/openssl.spec @@ -1,4 +1,5 @@ %define _unpackaged_files_terminate_build 0 +%define debug_package %{nil} Release: 1 @@ -6,7 +7,7 @@ Release: 1 Summary: Secure Sockets Layer and cryptography libraries and tools Name: openssl -Version: 1.0.2h +Version: 1.0.2j Source0: ftp://ftp.openssl.org/source/%{name}-%{version}.tar.gz License: OpenSSL Group: System Environment/Libraries @@ -80,7 +81,7 @@ documentation and POD files from which the man pages were produced. %build -%define CONFIG_FLAGS -DSSL_ALLOW_ADH --prefix=/usr --openssldir=%{openssldir} +%define CONFIG_FLAGS -DSSL_ALLOW_ADH --prefix=%{_exec_prefix} --openssldir=%{openssldir} perl util/perlpath.pl /usr/bin/perl @@ -102,7 +103,7 @@ LD_LIBRARY_PATH=`pwd` make test %install rm -rf $RPM_BUILD_ROOT -make MANDIR=/usr/man MANSUFFIX=ssl INSTALL_PREFIX="$RPM_BUILD_ROOT" install +make MANDIR=%{_mandir} MANSUFFIX=ssl INSTALL_PREFIX="$RPM_BUILD_ROOT" install # Make backwards-compatibility symlink to ssleay ln -sf /usr/bin/openssl $RPM_BUILD_ROOT/usr/bin/ssleay @@ -114,10 +115,12 @@ rm -rf $RPM_BUILD_ROOT %defattr(0644,root,root,0755) %doc CHANGES CHANGES.SSLeay LICENSE NEWS README -%attr(0755,root,root) /usr/bin/* -%attr(0755,root,root) /usr/lib/*.so* +%attr(0755,root,root) %{_bindir}/* +%attr(0755,root,root) %{_libdir}/*.so* +%attr(0755,root,root) %{_libdir}/engines/*.so* +%attr(0755,root,root) %{_libdir}/pkgconfig/* %attr(0755,root,root) %{openssldir}/misc/* -%attr(0644,root,root) /usr/man/man[157]/* +%attr(0644,root,root) %{_mandir}/man[157]/* %config %attr(0644,root,root) %{openssldir}/openssl.cnf %dir %attr(0755,root,root) %{openssldir}/certs @@ -128,10 +131,10 @@ rm -rf $RPM_BUILD_ROOT %defattr(0644,root,root,0755) %doc CHANGES CHANGES.SSLeay LICENSE NEWS README -%attr(0644,root,root) /usr/lib/*.a -%attr(0644,root,root) /usr/lib/pkgconfig/openssl.pc -%attr(0644,root,root) /usr/include/openssl/* -%attr(0644,root,root) /usr/man/man[3]/* +%attr(0644,root,root) %{_libdir}/*.a +%attr(0644,root,root) %{_libdir}/pkgconfig/openssl.pc +%attr(0644,root,root) %{_includedir}/openssl/* +%attr(0644,root,root) %{_mandir}/man[3]/* %files doc %defattr(0644,root,root,0755) diff --git a/deps/openssl/openssl/ssl/Makefile b/deps/openssl/openssl/ssl/Makefile index b6dee5b5ea522a..dd1296225006ef 100644 --- a/deps/openssl/openssl/ssl/Makefile +++ b/deps/openssl/openssl/ssl/Makefile @@ -15,7 +15,7 @@ KRB5_INCLUDES= CFLAGS= $(INCLUDES) $(CFLAG) GENERAL=Makefile README ssl-lib.com install.com -TEST=ssltest.c heartbeat_test.c clienthellotest.c sslv2conftest.c +TEST=ssltest.c heartbeat_test.c clienthellotest.c sslv2conftest.c dtlstest.c bad_dtls_test.c APPS= LIB=$(TOP)/libssl.a diff --git a/deps/openssl/openssl/ssl/bad_dtls_test.c b/deps/openssl/openssl/ssl/bad_dtls_test.c new file mode 100644 index 00000000000000..d42817fc329e69 --- /dev/null +++ b/deps/openssl/openssl/ssl/bad_dtls_test.c @@ -0,0 +1,923 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +/* + * Unit test for Cisco DTLS1_BAD_VER session resume, as used by + * AnyConnect VPN protocol. + * + * This is designed to exercise the code paths in + * http://git.infradead.org/users/dwmw2/openconnect.git/blob/HEAD:/dtls.c + * which have frequently been affected by regressions in DTLS1_BAD_VER + * support. + * + * Note that unlike other SSL tests, we don't test against our own SSL + * server method. Firstly because we don't have one; we *only* support + * DTLS1_BAD_VER as a client. And secondly because even if that were + * fixed up it's the wrong thing to test against — because if changes + * are made in generic DTLS code which don't take DTLS1_BAD_VER into + * account, there's plenty of scope for making those changes such that + * they break *both* the client and the server in the same way. + * + * So we handle the server side manually. In a session resume there isn't + * much to be done anyway. + */ +#include + +/* On Windows this will include and thus it needs to be + * included *before* anything that includes . Ick. */ +#include "e_os.h" /* for 'inline' */ + +#include +#include +#include +#include +#include +#include + +/* PACKET functions lifted from OpenSSL 1.1's ssl/packet_locl.h */ +typedef struct { + /* Pointer to where we are currently reading from */ + const unsigned char *curr; + /* Number of bytes remaining */ + size_t remaining; +} PACKET; + +/* Internal unchecked shorthand; don't use outside this file. */ +static inline void packet_forward(PACKET *pkt, size_t len) +{ + pkt->curr += len; + pkt->remaining -= len; +} + +/* + * Returns the number of bytes remaining to be read in the PACKET + */ +static inline size_t PACKET_remaining(const PACKET *pkt) +{ + return pkt->remaining; +} + +/* + * Initialise a PACKET with |len| bytes held in |buf|. This does not make a + * copy of the data so |buf| must be present for the whole time that the PACKET + * is being used. + */ +static inline int PACKET_buf_init(PACKET *pkt, + const unsigned char *buf, + size_t len) +{ + /* Sanity check for negative values. */ + if (len > (size_t)65536) + return 0; + + pkt->curr = buf; + pkt->remaining = len; + return 1; +} + +/* + * Returns 1 if the packet has length |num| and its contents equal the |num| + * bytes read from |ptr|. Returns 0 otherwise (lengths or contents not equal). + * If lengths are equal, performs the comparison in constant time. + */ +static inline int PACKET_equal(const PACKET *pkt, const void *ptr, + size_t num) +{ + if (PACKET_remaining(pkt) != num) + return 0; + return CRYPTO_memcmp(pkt->curr, ptr, num) == 0; +} + +/* + * Peek ahead at 2 bytes in network order from |pkt| and store the value in + * |*data| + */ +static inline int PACKET_peek_net_2(const PACKET *pkt, + unsigned int *data) +{ + if (PACKET_remaining(pkt) < 2) + return 0; + + *data = ((unsigned int)(*pkt->curr)) << 8; + *data |= *(pkt->curr + 1); + + return 1; +} + +/* Equivalent of n2s */ +/* Get 2 bytes in network order from |pkt| and store the value in |*data| */ +static inline int PACKET_get_net_2(PACKET *pkt, + unsigned int *data) +{ + if (!PACKET_peek_net_2(pkt, data)) + return 0; + + packet_forward(pkt, 2); + + return 1; +} + +/* Peek ahead at 1 byte from |pkt| and store the value in |*data| */ +static inline int PACKET_peek_1(const PACKET *pkt, + unsigned int *data) +{ + if (!PACKET_remaining(pkt)) + return 0; + + *data = *pkt->curr; + + return 1; +} + +/* Get 1 byte from |pkt| and store the value in |*data| */ +static inline int PACKET_get_1(PACKET *pkt, unsigned int *data) +{ + if (!PACKET_peek_1(pkt, data)) + return 0; + + packet_forward(pkt, 1); + + return 1; +} + +/* + * Peek ahead at |len| bytes from the |pkt| and store a pointer to them in + * |*data|. This just points at the underlying buffer that |pkt| is using. The + * caller should not free this data directly (it will be freed when the + * underlying buffer gets freed + */ +static inline int PACKET_peek_bytes(const PACKET *pkt, + const unsigned char **data, + size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + *data = pkt->curr; + + return 1; +} + +/* + * Read |len| bytes from the |pkt| and store a pointer to them in |*data|. This + * just points at the underlying buffer that |pkt| is using. The caller should + * not free this data directly (it will be freed when the underlying buffer gets + * freed + */ +static inline int PACKET_get_bytes(PACKET *pkt, + const unsigned char **data, + size_t len) +{ + if (!PACKET_peek_bytes(pkt, data, len)) + return 0; + + packet_forward(pkt, len); + + return 1; +} + +/* Peek ahead at |len| bytes from |pkt| and copy them to |data| */ +static inline int PACKET_peek_copy_bytes(const PACKET *pkt, + unsigned char *data, + size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + memcpy(data, pkt->curr, len); + + return 1; +} + +/* + * Read |len| bytes from |pkt| and copy them to |data|. + * The caller is responsible for ensuring that |data| can hold |len| bytes. + */ +static inline int PACKET_copy_bytes(PACKET *pkt, + unsigned char *data, + size_t len) +{ + if (!PACKET_peek_copy_bytes(pkt, data, len)) + return 0; + + packet_forward(pkt, len); + + return 1; +} + + +/* Move the current reading position forward |len| bytes */ +static inline int PACKET_forward(PACKET *pkt, size_t len) +{ + if (PACKET_remaining(pkt) < len) + return 0; + + packet_forward(pkt, len); + + return 1; +} + +/* + * Reads a variable-length vector prefixed with a one-byte length, and stores + * the contents in |subpkt|. |pkt| can equal |subpkt|. + * Data is not copied: the |subpkt| packet will share its underlying buffer with + * the original |pkt|, so data wrapped by |pkt| must outlive the |subpkt|. + * Upon failure, the original |pkt| and |subpkt| are not modified. + */ +static inline int PACKET_get_length_prefixed_1(PACKET *pkt, + PACKET *subpkt) +{ + unsigned int length; + const unsigned char *data; + PACKET tmp = *pkt; + if (!PACKET_get_1(&tmp, &length) || + !PACKET_get_bytes(&tmp, &data, (size_t)length)) { + return 0; + } + + *pkt = tmp; + subpkt->curr = data; + subpkt->remaining = length; + + return 1; +} + +#define OSSL_NELEM(x) (sizeof(x)/sizeof(x[0])) + +/* For DTLS1_BAD_VER packets the MAC doesn't include the handshake header */ +#define MAC_OFFSET (DTLS1_RT_HEADER_LENGTH + DTLS1_HM_HEADER_LENGTH) + +static unsigned char client_random[SSL3_RANDOM_SIZE]; +static unsigned char server_random[SSL3_RANDOM_SIZE]; + +/* These are all generated locally, sized purely according to our own whim */ +static unsigned char session_id[32]; +static unsigned char master_secret[48]; +static unsigned char cookie[20]; + +/* We've hard-coded the cipher suite; we know it's 104 bytes */ +static unsigned char key_block[104]; +#define mac_key (key_block + 20) +#define dec_key (key_block + 40) +#define enc_key (key_block + 56) + +static EVP_MD_CTX handshake_md5; +static EVP_MD_CTX handshake_sha1; + +/* PRF lifted from ssl/t1_enc.c since we can't easily use it directly */ +static int tls1_P_hash(const EVP_MD *md, const unsigned char *sec, + int sec_len, + const void *seed1, int seed1_len, + const void *seed2, int seed2_len, + const void *seed3, int seed3_len, + unsigned char *out, int olen) +{ + int chunk; + size_t j; + EVP_MD_CTX ctx, ctx_tmp, ctx_init; + EVP_PKEY *prf_mac_key; + unsigned char A1[EVP_MAX_MD_SIZE]; + size_t A1_len; + int ret = 0; + + chunk = EVP_MD_size(md); + OPENSSL_assert(chunk >= 0); + + EVP_MD_CTX_init(&ctx); + EVP_MD_CTX_init(&ctx_tmp); + EVP_MD_CTX_init(&ctx_init); + EVP_MD_CTX_set_flags(&ctx_init, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); + prf_mac_key = EVP_PKEY_new_mac_key(EVP_PKEY_HMAC, NULL, sec, sec_len); + if (!prf_mac_key) + goto err; + if (!EVP_DigestSignInit(&ctx_init, NULL, md, NULL, prf_mac_key)) + goto err; + if (!EVP_MD_CTX_copy_ex(&ctx, &ctx_init)) + goto err; + if (seed1 && !EVP_DigestSignUpdate(&ctx, seed1, seed1_len)) + goto err; + if (seed2 && !EVP_DigestSignUpdate(&ctx, seed2, seed2_len)) + goto err; + if (seed3 && !EVP_DigestSignUpdate(&ctx, seed3, seed3_len)) + goto err; + if (!EVP_DigestSignFinal(&ctx, A1, &A1_len)) + goto err; + + for (;;) { + /* Reinit mac contexts */ + if (!EVP_MD_CTX_copy_ex(&ctx, &ctx_init)) + goto err; + if (!EVP_DigestSignUpdate(&ctx, A1, A1_len)) + goto err; + if (olen > chunk && !EVP_MD_CTX_copy_ex(&ctx_tmp, &ctx)) + goto err; + if (seed1 && !EVP_DigestSignUpdate(&ctx, seed1, seed1_len)) + goto err; + if (seed2 && !EVP_DigestSignUpdate(&ctx, seed2, seed2_len)) + goto err; + if (seed3 && !EVP_DigestSignUpdate(&ctx, seed3, seed3_len)) + goto err; + + if (olen > chunk) { + if (!EVP_DigestSignFinal(&ctx, out, &j)) + goto err; + out += j; + olen -= j; + /* calc the next A1 value */ + if (!EVP_DigestSignFinal(&ctx_tmp, A1, &A1_len)) + goto err; + } else { /* last one */ + + if (!EVP_DigestSignFinal(&ctx, A1, &A1_len)) + goto err; + memcpy(out, A1, olen); + break; + } + } + ret = 1; + err: + EVP_PKEY_free(prf_mac_key); + EVP_MD_CTX_cleanup(&ctx); + EVP_MD_CTX_cleanup(&ctx_tmp); + EVP_MD_CTX_cleanup(&ctx_init); + OPENSSL_cleanse(A1, sizeof(A1)); + return ret; +} + +/* seed1 through seed5 are virtually concatenated */ +static int do_PRF(const void *seed1, int seed1_len, + const void *seed2, int seed2_len, + const void *seed3, int seed3_len, + unsigned char *out, int olen) +{ + unsigned char out2[104]; + int i, len; + + if (olen > (int)sizeof(out2)) + return 0; + + len = sizeof(master_secret) / 2; + + if (!tls1_P_hash(EVP_md5(), master_secret, len, + seed1, seed1_len, seed2, seed2_len, seed3, + seed3_len, out, olen)) + return 0; + + if (!tls1_P_hash(EVP_sha1(), master_secret + len, len, + seed1, seed1_len, seed2, seed2_len, seed3, + seed3_len, out2, olen)) + return 0; + + for (i = 0; i < olen; i++) { + out[i] ^= out2[i]; + } + + return 1; +} + +static SSL_SESSION *client_session(void) +{ + static unsigned char session_asn1[] = { + 0x30, 0x5F, /* SEQUENCE, length 0x5F */ + 0x02, 0x01, 0x01, /* INTEGER, SSL_SESSION_ASN1_VERSION */ + 0x02, 0x02, 0x01, 0x00, /* INTEGER, DTLS1_BAD_VER */ + 0x04, 0x02, 0x00, 0x2F, /* OCTET_STRING, AES128-SHA */ + 0x04, 0x20, /* OCTET_STRING, session id */ +#define SS_SESSID_OFS 15 /* Session ID goes here */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x30, /* OCTET_STRING, master secret */ +#define SS_SECRET_OFS 49 /* Master secret goes here */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + }; + const unsigned char *p = session_asn1; + + /* Copy the randomly-generated fields into the above ASN1 */ + memcpy(session_asn1 + SS_SESSID_OFS, session_id, sizeof(session_id)); + memcpy(session_asn1 + SS_SECRET_OFS, master_secret, sizeof(master_secret)); + + return d2i_SSL_SESSION(NULL, &p, sizeof(session_asn1)); +} + +/* Returns 1 for initial ClientHello, 2 for ClientHello with cookie */ +static int validate_client_hello(BIO *wbio) +{ + PACKET pkt, pkt2; + long len; + unsigned char *data; + int cookie_found = 0; + unsigned int u; + + len = BIO_get_mem_data(wbio, (char **)&data); + if (!PACKET_buf_init(&pkt, data, len)) + return 0; + + /* Check record header type */ + if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_HANDSHAKE) + return 0; + /* Version */ + if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER) + return 0; + /* Skip the rest of the record header */ + if (!PACKET_forward(&pkt, DTLS1_RT_HEADER_LENGTH - 3)) + return 0; + + /* Check it's a ClientHello */ + if (!PACKET_get_1(&pkt, &u) || u != SSL3_MT_CLIENT_HELLO) + return 0; + /* Skip the rest of the handshake message header */ + if (!PACKET_forward(&pkt, DTLS1_HM_HEADER_LENGTH - 1)) + return 0; + + /* Check client version */ + if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER) + return 0; + + /* Store random */ + if (!PACKET_copy_bytes(&pkt, client_random, SSL3_RANDOM_SIZE)) + return 0; + + /* Check session id length and content */ + if (!PACKET_get_length_prefixed_1(&pkt, &pkt2) || + !PACKET_equal(&pkt2, session_id, sizeof(session_id))) + return 0; + + /* Check cookie */ + if (!PACKET_get_length_prefixed_1(&pkt, &pkt2)) + return 0; + if (PACKET_remaining(&pkt2)) { + if (!PACKET_equal(&pkt2, cookie, sizeof(cookie))) + return 0; + cookie_found = 1; + } + + /* Skip ciphers */ + if (!PACKET_get_net_2(&pkt, &u) || !PACKET_forward(&pkt, u)) + return 0; + + /* Skip compression */ + if (!PACKET_get_1(&pkt, &u) || !PACKET_forward(&pkt, u)) + return 0; + + /* Skip extensions */ + if (!PACKET_get_net_2(&pkt, &u) || !PACKET_forward(&pkt, u)) + return 0; + + /* Now we are at the end */ + if (PACKET_remaining(&pkt)) + return 0; + + /* Update handshake MAC for second ClientHello (with cookie) */ + if (cookie_found && (!EVP_DigestUpdate(&handshake_md5, data + MAC_OFFSET, + len - MAC_OFFSET) || + !EVP_DigestUpdate(&handshake_sha1, data + MAC_OFFSET, + len - MAC_OFFSET))) + printf("EVP_DigestUpdate() failed\n"); + + (void)BIO_reset(wbio); + + return 1 + cookie_found; +} + +static int send_hello_verify(BIO *rbio) +{ + static unsigned char hello_verify[] = { + 0x16, /* Handshake */ + 0x01, 0x00, /* DTLS1_BAD_VER */ + 0x00, 0x00, /* Epoch 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* Seq# 0 */ + 0x00, 0x23, /* Length */ + 0x03, /* Hello Verify */ + 0x00, 0x00, 0x17, /* Length */ + 0x00, 0x00, /* Seq# 0 */ + 0x00, 0x00, 0x00, /* Fragment offset */ + 0x00, 0x00, 0x17, /* Fragment length */ + 0x01, 0x00, /* DTLS1_BAD_VER */ + 0x14, /* Cookie length */ +#define HV_COOKIE_OFS 28 /* Cookie goes here */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + }; + + memcpy(hello_verify + HV_COOKIE_OFS, cookie, sizeof(cookie)); + + BIO_write(rbio, hello_verify, sizeof(hello_verify)); + + return 1; +} + +static int send_server_hello(BIO *rbio) +{ + static unsigned char server_hello[] = { + 0x16, /* Handshake */ + 0x01, 0x00, /* DTLS1_BAD_VER */ + 0x00, 0x00, /* Epoch 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, /* Seq# 1 */ + 0x00, 0x52, /* Length */ + 0x02, /* Server Hello */ + 0x00, 0x00, 0x46, /* Length */ + 0x00, 0x01, /* Seq# */ + 0x00, 0x00, 0x00, /* Fragment offset */ + 0x00, 0x00, 0x46, /* Fragment length */ + 0x01, 0x00, /* DTLS1_BAD_VER */ +#define SH_RANDOM_OFS 27 /* Server random goes here */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x20, /* Session ID length */ +#define SH_SESSID_OFS 60 /* Session ID goes here */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x2f, /* Cipher suite AES128-SHA */ + 0x00, /* Compression null */ + }; + static unsigned char change_cipher_spec[] = { + 0x14, /* Change Cipher Spec */ + 0x01, 0x00, /* DTLS1_BAD_VER */ + 0x00, 0x00, /* Epoch 0 */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, /* Seq# 2 */ + 0x00, 0x03, /* Length */ + 0x01, 0x00, 0x02, /* Message */ + }; + + memcpy(server_hello + SH_RANDOM_OFS, server_random, sizeof(server_random)); + memcpy(server_hello + SH_SESSID_OFS, session_id, sizeof(session_id)); + + if (!EVP_DigestUpdate(&handshake_md5, server_hello + MAC_OFFSET, + sizeof(server_hello) - MAC_OFFSET) || + !EVP_DigestUpdate(&handshake_sha1, server_hello + MAC_OFFSET, + sizeof(server_hello) - MAC_OFFSET)) + printf("EVP_DigestUpdate() failed\n"); + + BIO_write(rbio, server_hello, sizeof(server_hello)); + BIO_write(rbio, change_cipher_spec, sizeof(change_cipher_spec)); + + return 1; +} + +/* Create header, HMAC, pad, encrypt and send a record */ +static int send_record(BIO *rbio, unsigned char type, unsigned long seqnr, + const void *msg, size_t len) +{ + /* Note that the order of the record header fields on the wire, + * and in the HMAC, is different. So we just keep them in separate + * variables and handle them individually. */ + static unsigned char epoch[2] = { 0x00, 0x01 }; + static unsigned char seq[6] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; + static unsigned char ver[2] = { 0x01, 0x00 }; /* DTLS1_BAD_VER */ + unsigned char lenbytes[2]; + HMAC_CTX ctx; + EVP_CIPHER_CTX enc_ctx; + unsigned char iv[16]; + unsigned char pad; + unsigned char *enc; + +#ifdef SIXTY_FOUR_BIT_LONG + seq[0] = (seqnr >> 40) & 0xff; + seq[1] = (seqnr >> 32) & 0xff; +#endif + seq[2] = (seqnr >> 24) & 0xff; + seq[3] = (seqnr >> 16) & 0xff; + seq[4] = (seqnr >> 8) & 0xff; + seq[5] = seqnr & 0xff; + + pad = 15 - ((len + SHA_DIGEST_LENGTH) % 16); + enc = OPENSSL_malloc(len + SHA_DIGEST_LENGTH + 1 + pad); + if (enc == NULL) + return 0; + + /* Copy record to encryption buffer */ + memcpy(enc, msg, len); + + /* Append HMAC to data */ + HMAC_Init(&ctx, mac_key, 20, EVP_sha1()); + HMAC_Update(&ctx, epoch, 2); + HMAC_Update(&ctx, seq, 6); + HMAC_Update(&ctx, &type, 1); + HMAC_Update(&ctx, ver, 2); /* Version */ + lenbytes[0] = len >> 8; + lenbytes[1] = len & 0xff; + HMAC_Update(&ctx, lenbytes, 2); /* Length */ + HMAC_Update(&ctx, enc, len); /* Finally the data itself */ + HMAC_Final(&ctx, enc + len, NULL); + HMAC_CTX_cleanup(&ctx); + + /* Append padding bytes */ + len += SHA_DIGEST_LENGTH; + do { + enc[len++] = pad; + } while (len % 16); + + /* Generate IV, and encrypt */ + RAND_bytes(iv, sizeof(iv)); + EVP_CIPHER_CTX_init(&enc_ctx); + EVP_CipherInit_ex(&enc_ctx, EVP_aes_128_cbc(), NULL, enc_key, iv, 1); + EVP_Cipher(&enc_ctx, enc, enc, len); + EVP_CIPHER_CTX_cleanup(&enc_ctx); + + /* Finally write header (from fragmented variables), IV and encrypted record */ + BIO_write(rbio, &type, 1); + BIO_write(rbio, ver, 2); + BIO_write(rbio, epoch, 2); + BIO_write(rbio, seq, 6); + lenbytes[0] = (len + sizeof(iv)) >> 8; + lenbytes[1] = (len + sizeof(iv)) & 0xff; + BIO_write(rbio, lenbytes, 2); + + BIO_write(rbio, iv, sizeof(iv)); + BIO_write(rbio, enc, len); + + OPENSSL_free(enc); + return 1; +} + +static int send_finished(SSL *s, BIO *rbio) +{ + static unsigned char finished_msg[DTLS1_HM_HEADER_LENGTH + + TLS1_FINISH_MAC_LENGTH] = { + 0x14, /* Finished */ + 0x00, 0x00, 0x0c, /* Length */ + 0x00, 0x03, /* Seq# 3 */ + 0x00, 0x00, 0x00, /* Fragment offset */ + 0x00, 0x00, 0x0c, /* Fragment length */ + /* Finished MAC (12 bytes) */ + }; + unsigned char handshake_hash[EVP_MAX_MD_SIZE * 2]; + + /* Derive key material */ + do_PRF(TLS_MD_KEY_EXPANSION_CONST, TLS_MD_KEY_EXPANSION_CONST_SIZE, + server_random, SSL3_RANDOM_SIZE, + client_random, SSL3_RANDOM_SIZE, + key_block, sizeof(key_block)); + + /* Generate Finished MAC */ + if (!EVP_DigestFinal_ex(&handshake_md5, handshake_hash, NULL) || + !EVP_DigestFinal_ex(&handshake_sha1, handshake_hash + EVP_MD_CTX_size(&handshake_md5), NULL)) + printf("EVP_DigestFinal_ex() failed\n"); + + do_PRF(TLS_MD_SERVER_FINISH_CONST, TLS_MD_SERVER_FINISH_CONST_SIZE, + handshake_hash, EVP_MD_CTX_size(&handshake_md5) + EVP_MD_CTX_size(&handshake_sha1), + NULL, 0, + finished_msg + DTLS1_HM_HEADER_LENGTH, TLS1_FINISH_MAC_LENGTH); + + return send_record(rbio, SSL3_RT_HANDSHAKE, 0, + finished_msg, sizeof(finished_msg)); +} + +static int validate_ccs(BIO *wbio) +{ + PACKET pkt; + long len; + unsigned char *data; + unsigned int u; + + len = BIO_get_mem_data(wbio, (char **)&data); + if (!PACKET_buf_init(&pkt, data, len)) + return 0; + + /* Check record header type */ + if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_CHANGE_CIPHER_SPEC) + return 0; + /* Version */ + if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER) + return 0; + /* Skip the rest of the record header */ + if (!PACKET_forward(&pkt, DTLS1_RT_HEADER_LENGTH - 3)) + return 0; + + /* Check ChangeCipherSpec message */ + if (!PACKET_get_1(&pkt, &u) || u != SSL3_MT_CCS) + return 0; + /* A DTLS1_BAD_VER ChangeCipherSpec also contains the + * handshake sequence number (which is 2 here) */ + if (!PACKET_get_net_2(&pkt, &u) || u != 0x0002) + return 0; + + /* Now check the Finished packet */ + if (!PACKET_get_1(&pkt, &u) || u != SSL3_RT_HANDSHAKE) + return 0; + if (!PACKET_get_net_2(&pkt, &u) || u != DTLS1_BAD_VER) + return 0; + + /* Check epoch is now 1 */ + if (!PACKET_get_net_2(&pkt, &u) || u != 0x0001) + return 0; + + /* That'll do for now. If OpenSSL accepted *our* Finished packet + * then it's evidently remembered that DTLS1_BAD_VER doesn't + * include the handshake header in the MAC. There's not a lot of + * point in implementing decryption here, just to check that it + * continues to get it right for one more packet. */ + + return 1; +} + +#define NODROP(x) { x##UL, 0 } +#define DROP(x) { x##UL, 1 } + +static struct { + unsigned long seq; + int drop; +} tests[] = { + NODROP(1), NODROP(3), NODROP(2), + NODROP(0x1234), NODROP(0x1230), NODROP(0x1235), + NODROP(0xffff), NODROP(0x10001), NODROP(0xfffe), NODROP(0x10000), + DROP(0x10001), DROP(0xff), NODROP(0x100000), NODROP(0x800000), NODROP(0x7fffe1), + NODROP(0xffffff), NODROP(0x1000000), NODROP(0xfffffe), DROP(0xffffff), NODROP(0x1000010), + NODROP(0xfffffd), NODROP(0x1000011), DROP(0x12), NODROP(0x1000012), + NODROP(0x1ffffff), NODROP(0x2000000), DROP(0x1ff00fe), NODROP(0x2000001), + NODROP(0x20fffff), NODROP(0x2105500), DROP(0x20ffffe), NODROP(0x21054ff), + NODROP(0x211ffff), DROP(0x2110000), NODROP(0x2120000) + /* The last test should be NODROP, because a DROP wouldn't get tested. */ +}; + +int main(int argc, char *argv[]) +{ + SSL_SESSION *sess; + SSL_CTX *ctx; + SSL *con; + BIO *rbio; + BIO *wbio; + BIO *err; + int testresult = 0; + int ret; + int i; + + SSL_library_init(); + SSL_load_error_strings(); + + err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT); + + CRYPTO_malloc_debug_init(); + CRYPTO_set_mem_debug_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + RAND_bytes(session_id, sizeof(session_id)); + RAND_bytes(master_secret, sizeof(master_secret)); + RAND_bytes(cookie, sizeof(cookie)); + RAND_bytes(server_random + 4, sizeof(server_random) - 4); + time((void *)server_random); + + sess = client_session(); + if (sess == NULL) { + printf("Failed to generate SSL_SESSION\n"); + goto end; + } + + if (!EVP_DigestInit_ex(&handshake_md5, EVP_md5(), NULL) || + !EVP_DigestInit_ex(&handshake_sha1, EVP_sha1(), NULL)) { + printf("Failed to initialise handshake_md\n"); + goto end; + } + + ctx = SSL_CTX_new(DTLSv1_client_method()); + if (ctx == NULL) { + printf("Failed to allocate SSL_CTX\n"); + goto end_md; + } + SSL_CTX_set_options(ctx, SSL_OP_CISCO_ANYCONNECT); + + if (!SSL_CTX_set_cipher_list(ctx, "AES128-SHA")) { + printf("SSL_CTX_set_cipher_list() failed\n"); + goto end_ctx; + } + + con = SSL_new(ctx); + if (!SSL_set_session(con, sess)) { + printf("SSL_set_session() failed\n"); + goto end_con; + } + SSL_SESSION_free(sess); + + rbio = BIO_new(BIO_s_mem()); + wbio = BIO_new(BIO_s_mem()); + + BIO_set_nbio(rbio, 1); + BIO_set_nbio(wbio, 1); + + SSL_set_bio(con, rbio, wbio); + SSL_set_connect_state(con); + + /* Send initial ClientHello */ + ret = SSL_do_handshake(con); + if (ret > 0 || SSL_get_error(con, ret) != SSL_ERROR_WANT_READ) { + printf("Unexpected handshake result at initial call!\n"); + goto end_con; + } + + if (validate_client_hello(wbio) != 1) { + printf("Initial ClientHello failed validation\n"); + goto end_con; + } + if (send_hello_verify(rbio) != 1) { + printf("Failed to send HelloVerify\n"); + goto end_con; + } + ret = SSL_do_handshake(con); + if (ret > 0 || SSL_get_error(con, ret) != SSL_ERROR_WANT_READ) { + printf("Unexpected handshake result after HelloVerify!\n"); + goto end_con; + } + if (validate_client_hello(wbio) != 2) { + printf("Second ClientHello failed validation\n"); + goto end_con; + } + if (send_server_hello(rbio) != 1) { + printf("Failed to send ServerHello\n"); + goto end_con; + } + ret = SSL_do_handshake(con); + if (ret > 0 || SSL_get_error(con, ret) != SSL_ERROR_WANT_READ) { + printf("Unexpected handshake result after ServerHello!\n"); + goto end_con; + } + if (send_finished(con, rbio) != 1) { + printf("Failed to send Finished\n"); + goto end_con; + } + ret = SSL_do_handshake(con); + if (ret < 1) { + printf("Handshake not successful after Finished!\n"); + goto end_con; + } + if (validate_ccs(wbio) != 1) { + printf("Failed to validate client CCS/Finished\n"); + goto end_con; + } + + /* While we're here and crafting packets by hand, we might as well do a + bit of a stress test on the DTLS record replay handling. Not Cisco-DTLS + specific but useful anyway for the general case. It's been broken + before, and in fact was broken even for a basic 0, 2, 1 test case + when this test was first added.... */ + for (i = 0; i < (int)OSSL_NELEM(tests); i++) { + unsigned long recv_buf[2]; + + if (send_record(rbio, SSL3_RT_APPLICATION_DATA, tests[i].seq, + &tests[i].seq, sizeof(unsigned long)) != 1) { + printf("Failed to send data seq #0x%lx (%d)\n", + tests[i].seq, i); + goto end_con; + } + + if (tests[i].drop) + continue; + + ret = SSL_read(con, recv_buf, 2 * sizeof(unsigned long)); + if (ret != sizeof(unsigned long)) { + printf("SSL_read failed or wrong size on seq#0x%lx (%d)\n", + tests[i].seq, i); + goto end_con; + } + if (recv_buf[0] != tests[i].seq) { + printf("Wrong data packet received (0x%lx not 0x%lx) at packet %d\n", + recv_buf[0], tests[i].seq, i); + goto end_con; + } + } + if (tests[i-1].drop) { + printf("Error: last test cannot be DROP()\n"); + goto end_con; + } + testresult=1; + + end_con: + SSL_free(con); + end_ctx: + SSL_CTX_free(ctx); + end_md: + EVP_MD_CTX_cleanup(&handshake_md5); + EVP_MD_CTX_cleanup(&handshake_sha1); + end: + ERR_print_errors_fp(stderr); + + if (!testresult) { + printf("Cisco BadDTLS test: FAILED\n"); + } + + ERR_free_strings(); + ERR_remove_thread_state(NULL); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + CRYPTO_mem_leaks(err); + BIO_free(err); + + return testresult?0:1; +} diff --git a/deps/openssl/openssl/ssl/d1_both.c b/deps/openssl/openssl/ssl/d1_both.c index 5d26c949265ffd..9bc61536101b5c 100644 --- a/deps/openssl/openssl/ssl/d1_both.c +++ b/deps/openssl/openssl/ssl/d1_both.c @@ -581,9 +581,12 @@ static int dtls1_preprocess_fragment(SSL *s, struct hm_header_st *msg_hdr, /* * msg_len is limited to 2^24, but is effectively checked against max * above + * + * Make buffer slightly larger than message length as a precaution + * against small OOB reads e.g. CVE-2016-6306 */ if (!BUF_MEM_grow_clean - (s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH)) { + (s->init_buf, msg_len + DTLS1_HM_HEADER_LENGTH + 16)) { SSLerr(SSL_F_DTLS1_PREPROCESS_FRAGMENT, ERR_R_BUF_LIB); return SSL_AD_INTERNAL_ERROR; } @@ -618,11 +621,23 @@ static int dtls1_retrieve_buffered_fragment(SSL *s, long max, int *ok) int al; *ok = 0; - item = pqueue_peek(s->d1->buffered_messages); - if (item == NULL) - return 0; + do { + item = pqueue_peek(s->d1->buffered_messages); + if (item == NULL) + return 0; + + frag = (hm_fragment *)item->data; + + if (frag->msg_header.seq < s->d1->handshake_read_seq) { + /* This is a stale message that has been buffered so clear it */ + pqueue_pop(s->d1->buffered_messages); + dtls1_hm_fragment_free(frag); + pitem_free(item); + item = NULL; + frag = NULL; + } + } while (item == NULL); - frag = (hm_fragment *)item->data; /* Don't return if reassembly still in progress */ if (frag->reassembly != NULL) @@ -1211,7 +1226,7 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, unsigned long header_length; unsigned char seq64be[8]; struct dtls1_retransmit_state saved_state; - unsigned char save_write_sequence[8]; + unsigned char save_write_sequence[8] = {0, 0, 0, 0, 0, 0, 0, 0}; /*- OPENSSL_assert(s->init_num == 0); @@ -1296,18 +1311,6 @@ dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, return ret; } -/* call this function when the buffered messages are no longer needed */ -void dtls1_clear_record_buffer(SSL *s) -{ - pitem *item; - - for (item = pqueue_pop(s->d1->sent_messages); - item != NULL; item = pqueue_pop(s->d1->sent_messages)) { - dtls1_hm_fragment_free((hm_fragment *)item->data); - pitem_free(item); - } -} - unsigned char *dtls1_set_message_header(SSL *s, unsigned char *p, unsigned char mt, unsigned long len, unsigned long frag_off, @@ -1469,7 +1472,7 @@ int dtls1_process_heartbeat(SSL *s) memcpy(bp, pl, payload); bp += payload; /* Random padding */ - if (RAND_pseudo_bytes(bp, padding) < 0) { + if (RAND_bytes(bp, padding) <= 0) { OPENSSL_free(buffer); return -1; } @@ -1546,6 +1549,8 @@ int dtls1_heartbeat(SSL *s) * - Padding */ buf = OPENSSL_malloc(1 + 2 + payload + padding); + if (buf == NULL) + goto err; p = buf; /* Message Type */ *p++ = TLS1_HB_REQUEST; @@ -1554,11 +1559,11 @@ int dtls1_heartbeat(SSL *s) /* Sequence number */ s2n(s->tlsext_hb_seq, p); /* 16 random bytes */ - if (RAND_pseudo_bytes(p, 16) < 0) + if (RAND_bytes(p, 16) <= 0) goto err; p += 16; /* Random padding */ - if (RAND_pseudo_bytes(p, padding) < 0) + if (RAND_bytes(p, padding) <= 0) goto err; ret = dtls1_write_bytes(s, TLS1_RT_HEARTBEAT, buf, 3 + payload + padding); diff --git a/deps/openssl/openssl/ssl/d1_clnt.c b/deps/openssl/openssl/ssl/d1_clnt.c index 3ddfa7bca4b79e..7e2f5c2830b512 100644 --- a/deps/openssl/openssl/ssl/d1_clnt.c +++ b/deps/openssl/openssl/ssl/d1_clnt.c @@ -769,6 +769,7 @@ int dtls1_connect(SSL *s) /* done with handshaking */ s->d1->handshake_read_seq = 0; s->d1->next_handshake_write_seq = 0; + dtls1_clear_received_buffer(s); goto end; /* break; */ diff --git a/deps/openssl/openssl/ssl/d1_lib.c b/deps/openssl/openssl/ssl/d1_lib.c index ee78921ba8b0d3..debd4fd5dcca40 100644 --- a/deps/openssl/openssl/ssl/d1_lib.c +++ b/deps/openssl/openssl/ssl/d1_lib.c @@ -170,7 +170,6 @@ int dtls1_new(SSL *s) static void dtls1_clear_queues(SSL *s) { pitem *item = NULL; - hm_fragment *frag = NULL; DTLS1_RECORD_DATA *rdata; while ((item = pqueue_pop(s->d1->unprocessed_rcds.q)) != NULL) { @@ -191,28 +190,44 @@ static void dtls1_clear_queues(SSL *s) pitem_free(item); } + while ((item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) { + rdata = (DTLS1_RECORD_DATA *)item->data; + if (rdata->rbuf.buf) { + OPENSSL_free(rdata->rbuf.buf); + } + OPENSSL_free(item->data); + pitem_free(item); + } + + dtls1_clear_received_buffer(s); + dtls1_clear_sent_buffer(s); +} + +void dtls1_clear_received_buffer(SSL *s) +{ + pitem *item = NULL; + hm_fragment *frag = NULL; + while ((item = pqueue_pop(s->d1->buffered_messages)) != NULL) { frag = (hm_fragment *)item->data; dtls1_hm_fragment_free(frag); pitem_free(item); } +} + +void dtls1_clear_sent_buffer(SSL *s) +{ + pitem *item = NULL; + hm_fragment *frag = NULL; while ((item = pqueue_pop(s->d1->sent_messages)) != NULL) { frag = (hm_fragment *)item->data; dtls1_hm_fragment_free(frag); pitem_free(item); } - - while ((item = pqueue_pop(s->d1->buffered_app_data.q)) != NULL) { - rdata = (DTLS1_RECORD_DATA *)item->data; - if (rdata->rbuf.buf) { - OPENSSL_free(rdata->rbuf.buf); - } - OPENSSL_free(item->data); - pitem_free(item); - } } + void dtls1_free(SSL *s) { ssl3_free(s); @@ -456,7 +471,7 @@ void dtls1_stop_timer(SSL *s) BIO_ctrl(SSL_get_rbio(s), BIO_CTRL_DGRAM_SET_NEXT_TIMEOUT, 0, &(s->d1->next_timeout)); /* Clear retransmission buffer */ - dtls1_clear_record_buffer(s); + dtls1_clear_sent_buffer(s); } int dtls1_check_timeout_num(SSL *s) diff --git a/deps/openssl/openssl/ssl/d1_pkt.c b/deps/openssl/openssl/ssl/d1_pkt.c index fe30ec7d004235..7a02459f2b7876 100644 --- a/deps/openssl/openssl/ssl/d1_pkt.c +++ b/deps/openssl/openssl/ssl/d1_pkt.c @@ -125,7 +125,7 @@ /* mod 128 saturating subtract of two 64-bit values in big-endian order */ static int satsub64be(const unsigned char *v1, const unsigned char *v2) { - int ret, sat, brw, i; + int ret, i; if (sizeof(long) == 8) do { @@ -157,28 +157,51 @@ static int satsub64be(const unsigned char *v1, const unsigned char *v2) return (int)l; } while (0); - ret = (int)v1[7] - (int)v2[7]; - sat = 0; - brw = ret >> 8; /* brw is either 0 or -1 */ - if (ret & 0x80) { - for (i = 6; i >= 0; i--) { - brw += (int)v1[i] - (int)v2[i]; - sat |= ~brw; - brw >>= 8; - } - } else { - for (i = 6; i >= 0; i--) { - brw += (int)v1[i] - (int)v2[i]; - sat |= brw; - brw >>= 8; + ret = 0; + for (i=0; i<7; i++) { + if (v1[i] > v2[i]) { + /* v1 is larger... but by how much? */ + if (v1[i] != v2[i] + 1) + return 128; + while (++i <= 6) { + if (v1[i] != 0x00 || v2[i] != 0xff) + return 128; /* too much */ + } + /* We checked all the way to the penultimate byte, + * so despite higher bytes changing we actually + * know that it only changed from (e.g.) + * ... (xx) ff ff ff ?? + * to ... (xx+1) 00 00 00 ?? + * so we add a 'bias' of 256 for the carry that + * happened, and will eventually return + * 256 + v1[7] - v2[7]. */ + ret = 256; + break; + } else if (v2[i] > v1[i]) { + /* v2 is larger... but by how much? */ + if (v2[i] != v1[i] + 1) + return -128; + while (++i <= 6) { + if (v2[i] != 0x00 || v1[i] != 0xff) + return -128; /* too much */ + } + /* Similar to the case above, we know it changed + * from ... (xx) 00 00 00 ?? + * to ... (xx-1) ff ff ff ?? + * so we add a 'bias' of -256 for the borrow, + * to return -256 + v1[7] - v2[7]. */ + ret = -256; } } - brw <<= 8; /* brw is either 0 or -256 */ - if (sat & 0xff) - return brw | 0x80; + ret += (int)v1[7] - (int)v2[7]; + + if (ret > 128) + return 128; + else if (ret < -128) + return -128; else - return brw + (ret & 0xFF); + return ret; } static int have_handshake_fragment(SSL *s, int type, unsigned char *buf, @@ -194,7 +217,7 @@ static int dtls1_record_needs_buffering(SSL *s, SSL3_RECORD *rr, #endif static int dtls1_buffer_record(SSL *s, record_pqueue *q, unsigned char *priority); -static int dtls1_process_record(SSL *s); +static int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap); /* copy buffered record into SSL structure */ static int dtls1_copy_record(SSL *s, pitem *item) @@ -319,21 +342,70 @@ static int dtls1_retrieve_buffered_record(SSL *s, record_pqueue *queue) static int dtls1_process_buffered_records(SSL *s) { pitem *item; + SSL3_BUFFER *rb; + SSL3_RECORD *rr; + DTLS1_BITMAP *bitmap; + unsigned int is_next_epoch; + int replayok = 1; item = pqueue_peek(s->d1->unprocessed_rcds.q); if (item) { /* Check if epoch is current. */ if (s->d1->unprocessed_rcds.epoch != s->d1->r_epoch) - return (1); /* Nothing to do. */ + return 1; /* Nothing to do. */ + + rr = &s->s3->rrec; + rb = &s->s3->rbuf; + + if (rb->left > 0) { + /* + * We've still got data from the current packet to read. There could + * be a record from the new epoch in it - so don't overwrite it + * with the unprocessed records yet (we'll do it when we've + * finished reading the current packet). + */ + return 1; + } + /* Process all the records. */ while (pqueue_peek(s->d1->unprocessed_rcds.q)) { dtls1_get_unprocessed_record(s); - if (!dtls1_process_record(s)) - return (0); + bitmap = dtls1_get_bitmap(s, rr, &is_next_epoch); + if (bitmap == NULL) { + /* + * Should not happen. This will only ever be NULL when the + * current record is from a different epoch. But that cannot + * be the case because we already checked the epoch above + */ + SSLerr(SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS, + ERR_R_INTERNAL_ERROR); + return 0; + } +#ifndef OPENSSL_NO_SCTP + /* Only do replay check if no SCTP bio */ + if (!BIO_dgram_is_sctp(SSL_get_rbio(s))) +#endif + { + /* + * Check whether this is a repeat, or aged record. We did this + * check once already when we first received the record - but + * we might have updated the window since then due to + * records we subsequently processed. + */ + replayok = dtls1_record_replay_check(s, bitmap); + } + + if (!replayok || !dtls1_process_record(s, bitmap)) { + /* dump this record */ + rr->length = 0; + s->packet_length = 0; + continue; + } + if (dtls1_buffer_record(s, &(s->d1->processed_rcds), s->s3->rrec.seq_num) < 0) - return -1; + return 0; } } @@ -344,7 +416,7 @@ static int dtls1_process_buffered_records(SSL *s) s->d1->processed_rcds.epoch = s->d1->r_epoch; s->d1->unprocessed_rcds.epoch = s->d1->r_epoch + 1; - return (1); + return 1; } #if 0 @@ -391,7 +463,7 @@ static int dtls1_get_buffered_record(SSL *s) #endif -static int dtls1_process_record(SSL *s) +static int dtls1_process_record(SSL *s, DTLS1_BITMAP *bitmap) { int i, al; int enc_err; @@ -551,6 +623,10 @@ static int dtls1_process_record(SSL *s) /* we have pulled in a full packet so zero things */ s->packet_length = 0; + + /* Mark receipt of record. */ + dtls1_record_bitmap_update(s, bitmap); + return (1); f_err: @@ -581,11 +657,12 @@ int dtls1_get_record(SSL *s) rr = &(s->s3->rrec); + again: /* * The epoch may have changed. If so, process all the pending records. * This is a non-blocking operation. */ - if (dtls1_process_buffered_records(s) < 0) + if (!dtls1_process_buffered_records(s)) return -1; /* if we're renegotiating, then there may be buffered records */ @@ -593,7 +670,6 @@ int dtls1_get_record(SSL *s) return 1; /* get something from the wire */ - again: /* check if we have the header */ if ((s->rstate != SSL_ST_READ_BODY) || (s->packet_length < DTLS1_RT_HEADER_LENGTH)) { @@ -721,20 +797,17 @@ int dtls1_get_record(SSL *s) if (dtls1_buffer_record (s, &(s->d1->unprocessed_rcds), rr->seq_num) < 0) return -1; - /* Mark receipt of record. */ - dtls1_record_bitmap_update(s, bitmap); } rr->length = 0; s->packet_length = 0; goto again; } - if (!dtls1_process_record(s)) { + if (!dtls1_process_record(s, bitmap)) { rr->length = 0; s->packet_length = 0; /* dump this record */ goto again; /* get another record */ } - dtls1_record_bitmap_update(s, bitmap); /* Mark receipt of record. */ return (1); @@ -878,6 +951,13 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) goto start; } + /* + * Reset the count of consecutive warning alerts if we've got a non-empty + * record that isn't an alert. + */ + if (rr->type != SSL3_RT_ALERT && rr->length != 0) + s->cert->alert_count = 0; + /* we now have a packet which can be read and processed */ if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec, @@ -1144,6 +1224,14 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; + + s->cert->alert_count++; + if (s->cert->alert_count == MAX_WARN_ALERT_COUNT) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_DTLS1_READ_BYTES, SSL_R_TOO_MANY_WARN_ALERTS); + goto f_err; + } + if (alert_descr == SSL_AD_CLOSE_NOTIFY) { #ifndef OPENSSL_NO_SCTP /* @@ -1201,7 +1289,7 @@ int dtls1_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr); ERR_add_error_data(2, "SSL alert number ", tmp); s->shutdown |= SSL_RECEIVED_SHUTDOWN; - SSL_CTX_remove_session(s->ctx, s->session); + SSL_CTX_remove_session(s->session_ctx, s->session); return (0); } else { al = SSL_AD_ILLEGAL_PARAMETER; @@ -1830,8 +1918,13 @@ static DTLS1_BITMAP *dtls1_get_bitmap(SSL *s, SSL3_RECORD *rr, if (rr->epoch == s->d1->r_epoch) return &s->d1->bitmap; - /* Only HM and ALERT messages can be from the next epoch */ + /* + * Only HM and ALERT messages can be from the next epoch and only if we + * have already processed all of the unprocessed records from the last + * epoch + */ else if (rr->epoch == (unsigned long)(s->d1->r_epoch + 1) && + s->d1->unprocessed_rcds.epoch != s->d1->r_epoch && (rr->type == SSL3_RT_HANDSHAKE || rr->type == SSL3_RT_ALERT)) { *is_next_epoch = 1; return &s->d1->next_bitmap; @@ -1910,6 +2003,12 @@ void dtls1_reset_seq_numbers(SSL *s, int rw) s->d1->r_epoch++; memcpy(&(s->d1->bitmap), &(s->d1->next_bitmap), sizeof(DTLS1_BITMAP)); memset(&(s->d1->next_bitmap), 0x00, sizeof(DTLS1_BITMAP)); + + /* + * We must not use any buffered messages received from the previous + * epoch + */ + dtls1_clear_received_buffer(s); } else { seq = s->s3->write_sequence; memcpy(s->d1->last_write_sequence, seq, diff --git a/deps/openssl/openssl/ssl/d1_srvr.c b/deps/openssl/openssl/ssl/d1_srvr.c index e677d880f0ac92..bc875b53c9a0d9 100644 --- a/deps/openssl/openssl/ssl/d1_srvr.c +++ b/deps/openssl/openssl/ssl/d1_srvr.c @@ -313,7 +313,7 @@ int dtls1_accept(SSL *s) case SSL3_ST_SW_HELLO_REQ_B: s->shutdown = 0; - dtls1_clear_record_buffer(s); + dtls1_clear_sent_buffer(s); dtls1_start_timer(s); ret = ssl3_send_hello_request(s); if (ret <= 0) @@ -894,6 +894,7 @@ int dtls1_accept(SSL *s) /* next message is server hello */ s->d1->handshake_write_seq = 0; s->d1->next_handshake_write_seq = 0; + dtls1_clear_received_buffer(s); goto end; /* break; */ diff --git a/deps/openssl/openssl/ssl/dtlstest.c b/deps/openssl/openssl/ssl/dtlstest.c new file mode 100644 index 00000000000000..78ebc67744c493 --- /dev/null +++ b/deps/openssl/openssl/ssl/dtlstest.c @@ -0,0 +1,147 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include +#include +#include + +#include "ssltestlib.h" +#include "testutil.h" + +static char *cert = NULL; +static char *privkey = NULL; + +#define NUM_TESTS 2 + + +#define DUMMY_CERT_STATUS_LEN 12 + +unsigned char certstatus[] = { + SSL3_RT_HANDSHAKE, /* Content type */ + 0xfe, 0xfd, /* Record version */ + 0, 1, /* Epoch */ + 0, 0, 0, 0, 0, 0x0f, /* Record sequence number */ + 0, DTLS1_HM_HEADER_LENGTH + DUMMY_CERT_STATUS_LEN - 2, + SSL3_MT_CERTIFICATE_STATUS, /* Cert Status handshake message type */ + 0, 0, DUMMY_CERT_STATUS_LEN, /* Message len */ + 0, 5, /* Message sequence */ + 0, 0, 0, /* Fragment offset */ + 0, 0, DUMMY_CERT_STATUS_LEN - 2, /* Fragment len */ + 0x80, 0x80, 0x80, 0x80, 0x80, + 0x80, 0x80, 0x80, 0x80, 0x80 /* Dummy data */ +}; + +#define RECORD_SEQUENCE 10 + +static int test_dtls_unprocessed(int testidx) +{ + SSL_CTX *sctx = NULL, *cctx = NULL; + SSL *serverssl1 = NULL, *clientssl1 = NULL; + BIO *c_to_s_fbio, *c_to_s_mempacket; + int testresult = 0; + + printf("Starting Test %d\n", testidx); + + if (!create_ssl_ctx_pair(DTLS_server_method(), DTLS_client_method(), &sctx, + &cctx, cert, privkey)) { + printf("Unable to create SSL_CTX pair\n"); + return 0; + } + + if (!SSL_CTX_set_ecdh_auto(sctx, 1)) { + printf("Failed configuring auto ECDH\n"); + } + + if (!SSL_CTX_set_cipher_list(cctx, "AES128-SHA")) { + printf("Failed setting cipher list\n"); + } + + c_to_s_fbio = BIO_new(bio_f_tls_dump_filter()); + if (c_to_s_fbio == NULL) { + printf("Failed to create filter BIO\n"); + goto end; + } + + /* BIO is freed by create_ssl_connection on error */ + if (!create_ssl_objects(sctx, cctx, &serverssl1, &clientssl1, NULL, + c_to_s_fbio)) { + printf("Unable to create SSL objects\n"); + ERR_print_errors_fp(stdout); + goto end; + } + + if (testidx == 1) + certstatus[RECORD_SEQUENCE] = 0xff; + + /* + * Inject a dummy record from the next epoch. In test 0, this should never + * get used because the message sequence number is too big. In test 1 we set + * the record sequence number to be way off in the future. This should not + * have an impact on the record replay protection because the record should + * be dropped before it is marked as arrivedg + */ + c_to_s_mempacket = SSL_get_wbio(clientssl1); + c_to_s_mempacket = BIO_next(c_to_s_mempacket); + mempacket_test_inject(c_to_s_mempacket, (char *)certstatus, + sizeof(certstatus), 1, INJECT_PACKET_IGNORE_REC_SEQ); + + if (!create_ssl_connection(serverssl1, clientssl1)) { + printf("Unable to create SSL connection\n"); + ERR_print_errors_fp(stdout); + goto end; + } + + testresult = 1; + end: + SSL_free(serverssl1); + SSL_free(clientssl1); + SSL_CTX_free(sctx); + SSL_CTX_free(cctx); + + return testresult; +} + +int main(int argc, char *argv[]) +{ + BIO *err = NULL; + int testresult = 0; + + if (argc != 3) { + printf("Invalid argument count\n"); + return 1; + } + + cert = argv[1]; + privkey = argv[2]; + + err = BIO_new_fp(stderr, BIO_NOCLOSE | BIO_FP_TEXT); + + SSL_library_init(); + SSL_load_error_strings(); + + CRYPTO_malloc_debug_init(); + CRYPTO_dbg_set_options(V_CRYPTO_MDEBUG_ALL); + CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON); + + if (!test_dtls_unprocessed(0) || !test_dtls_unprocessed(1)) + testresult = 1; + + ERR_free_strings(); + ERR_remove_thread_state(NULL); + EVP_cleanup(); + CRYPTO_cleanup_all_ex_data(); + CRYPTO_mem_leaks(err); + BIO_free(err); + + if (!testresult) + printf("PASS\n"); + + return testresult; +} diff --git a/deps/openssl/openssl/ssl/s23_clnt.c b/deps/openssl/openssl/ssl/s23_clnt.c index f782010c4782c8..6850dc0c670444 100644 --- a/deps/openssl/openssl/ssl/s23_clnt.c +++ b/deps/openssl/openssl/ssl/s23_clnt.c @@ -289,9 +289,9 @@ int ssl_fill_hello_random(SSL *s, int server, unsigned char *result, int len) unsigned long Time = (unsigned long)time(NULL); unsigned char *p = result; l2n(Time, p); - return RAND_pseudo_bytes(p, len - 4); + return RAND_bytes(p, len - 4); } else - return RAND_pseudo_bytes(result, len); + return RAND_bytes(result, len); } static int ssl23_client_hello(SSL *s) @@ -466,8 +466,8 @@ static int ssl23_client_hello(SSL *s) i = ch_len; s2n(i, d); memset(&(s->s3->client_random[0]), 0, SSL3_RANDOM_SIZE); - if (RAND_pseudo_bytes - (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i) <= 0) + if (RAND_bytes (&(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i) + <= 0) return -1; memcpy(p, &(s->s3->client_random[SSL3_RANDOM_SIZE - i]), i); diff --git a/deps/openssl/openssl/ssl/s2_clnt.c b/deps/openssl/openssl/ssl/s2_clnt.c index 69da6b1421dfd4..20de1a82178f95 100644 --- a/deps/openssl/openssl/ssl/s2_clnt.c +++ b/deps/openssl/openssl/ssl/s2_clnt.c @@ -581,7 +581,7 @@ static int client_hello(SSL *s) /* * challenge id data */ - if (RAND_pseudo_bytes(s->s2->challenge, SSL2_CHALLENGE_LENGTH) <= 0) + if (RAND_bytes(s->s2->challenge, SSL2_CHALLENGE_LENGTH) <= 0) return -1; memcpy(d, s->s2->challenge, SSL2_CHALLENGE_LENGTH); d += SSL2_CHALLENGE_LENGTH; @@ -629,7 +629,7 @@ static int client_master_key(SSL *s) return -1; } if (i > 0) - if (RAND_pseudo_bytes(sess->key_arg, i) <= 0) + if (RAND_bytes(sess->key_arg, i) <= 0) return -1; /* make a master key */ diff --git a/deps/openssl/openssl/ssl/s2_srvr.c b/deps/openssl/openssl/ssl/s2_srvr.c index 07e9df82820a9e..d3b243c27e02d5 100644 --- a/deps/openssl/openssl/ssl/s2_srvr.c +++ b/deps/openssl/openssl/ssl/s2_srvr.c @@ -526,11 +526,8 @@ static int get_client_master_key(SSL *s) * fails. See https://tools.ietf.org/html/rfc5246#section-7.4.7.1 */ - /* - * should be RAND_bytes, but we cannot work around a failure. - */ - if (RAND_pseudo_bytes(rand_premaster_secret, - (int)num_encrypted_key_bytes) <= 0) + if (RAND_bytes(rand_premaster_secret, + (int)num_encrypted_key_bytes) <= 0) return 0; i = ssl_rsa_private_decrypt(s->cert, s->s2->tmp.enc, @@ -822,8 +819,7 @@ static int server_hello(SSL *s) /* make and send conn_id */ s2n(SSL2_CONNECTION_ID_LENGTH, p); /* add conn_id length */ s->s2->conn_id_length = SSL2_CONNECTION_ID_LENGTH; - if (RAND_pseudo_bytes(s->s2->conn_id, (int)s->s2->conn_id_length) <= - 0) + if (RAND_bytes(s->s2->conn_id, (int)s->s2->conn_id_length) <= 0) return -1; memcpy(d, s->s2->conn_id, SSL2_CONNECTION_ID_LENGTH); d += SSL2_CONNECTION_ID_LENGTH; @@ -962,7 +958,7 @@ static int request_certificate(SSL *s) p = (unsigned char *)s->init_buf->data; *(p++) = SSL2_MT_REQUEST_CERTIFICATE; *(p++) = SSL2_AT_MD5_WITH_RSA_ENCRYPTION; - if (RAND_pseudo_bytes(ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH) <= 0) + if (RAND_bytes(ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH) <= 0) return -1; memcpy(p, ccd, SSL2_MIN_CERT_CHALLENGE_LENGTH); diff --git a/deps/openssl/openssl/ssl/s3_both.c b/deps/openssl/openssl/ssl/s3_both.c index 09d0661e81f64e..054ded1c99039b 100644 --- a/deps/openssl/openssl/ssl/s3_both.c +++ b/deps/openssl/openssl/ssl/s3_both.c @@ -356,21 +356,22 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) } *ok = 1; s->state = stn; - s->init_msg = s->init_buf->data + 4; + s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH; s->init_num = (int)s->s3->tmp.message_size; return s->init_num; } p = (unsigned char *)s->init_buf->data; - if (s->state == st1) { /* s->init_num < 4 */ + if (s->state == st1) { /* s->init_num < SSL3_HM_HEADER_LENGTH */ int skip_message; do { - while (s->init_num < 4) { + while (s->init_num < SSL3_HM_HEADER_LENGTH) { i = s->method->ssl_read_bytes(s, SSL3_RT_HANDSHAKE, &p[s->init_num], - 4 - s->init_num, 0); + SSL3_HM_HEADER_LENGTH - + s->init_num, 0); if (i <= 0) { s->rwstate = SSL_READING; *ok = 0; @@ -394,12 +395,13 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, - p, 4, s, s->msg_callback_arg); + p, SSL3_HM_HEADER_LENGTH, s, + s->msg_callback_arg); } } while (skip_message); - /* s->init_num == 4 */ + /* s->init_num == SSL3_HM_HEADER_LENGTH */ if ((mt >= 0) && (*p != mt)) { al = SSL_AD_UNEXPECTED_MESSAGE; @@ -415,19 +417,20 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE); goto f_err; } - if (l > (INT_MAX - 4)) { /* BUF_MEM_grow takes an 'int' parameter */ - al = SSL_AD_ILLEGAL_PARAMETER; - SSLerr(SSL_F_SSL3_GET_MESSAGE, SSL_R_EXCESSIVE_MESSAGE_SIZE); - goto f_err; - } - if (l && !BUF_MEM_grow_clean(s->init_buf, (int)l + 4)) { + /* + * Make buffer slightly larger than message length as a precaution + * against small OOB reads e.g. CVE-2016-6306 + */ + if (l + && !BUF_MEM_grow_clean(s->init_buf, + (int)l + SSL3_HM_HEADER_LENGTH + 16)) { SSLerr(SSL_F_SSL3_GET_MESSAGE, ERR_R_BUF_LIB); goto err; } s->s3->tmp.message_size = l; s->state = stn; - s->init_msg = s->init_buf->data + 4; + s->init_msg = s->init_buf->data + SSL3_HM_HEADER_LENGTH; s->init_num = 0; } @@ -456,10 +459,12 @@ long ssl3_get_message(SSL *s, int st1, int stn, int mt, long max, int *ok) #endif /* Feed this message into MAC computation. */ - ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, s->init_num + 4); + ssl3_finish_mac(s, (unsigned char *)s->init_buf->data, + s->init_num + SSL3_HM_HEADER_LENGTH); if (s->msg_callback) s->msg_callback(0, s->version, SSL3_RT_HANDSHAKE, s->init_buf->data, - (size_t)s->init_num + 4, s, s->msg_callback_arg); + (size_t)s->init_num + SSL3_HM_HEADER_LENGTH, s, + s->msg_callback_arg); *ok = 1; return s->init_num; f_err: @@ -535,6 +540,9 @@ int ssl_verify_alarm_type(long type) case X509_V_ERR_CRL_NOT_YET_VALID: case X509_V_ERR_CERT_UNTRUSTED: case X509_V_ERR_CERT_REJECTED: + case X509_V_ERR_HOSTNAME_MISMATCH: + case X509_V_ERR_EMAIL_MISMATCH: + case X509_V_ERR_IP_ADDRESS_MISMATCH: al = SSL_AD_BAD_CERTIFICATE; break; case X509_V_ERR_CERT_SIGNATURE_FAILURE: @@ -548,7 +556,10 @@ int ssl_verify_alarm_type(long type) case X509_V_ERR_CERT_REVOKED: al = SSL_AD_CERTIFICATE_REVOKED; break; + case X509_V_ERR_UNSPECIFIED: case X509_V_ERR_OUT_OF_MEM: + case X509_V_ERR_INVALID_CALL: + case X509_V_ERR_STORE_LOOKUP: al = SSL_AD_INTERNAL_ERROR; break; case X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT: diff --git a/deps/openssl/openssl/ssl/s3_clnt.c b/deps/openssl/openssl/ssl/s3_clnt.c index 19dc8648b952dd..218534734dd7e7 100644 --- a/deps/openssl/openssl/ssl/s3_clnt.c +++ b/deps/openssl/openssl/ssl/s3_clnt.c @@ -1216,6 +1216,12 @@ int ssl3_get_server_certificate(SSL *s) goto f_err; } for (nc = 0; nc < llen;) { + if (nc + 3 > llen) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_SERVER_CERTIFICATE, + SSL_R_CERT_LENGTH_MISMATCH); + goto f_err; + } n2l3(p, l); if ((l + nc + 3) > llen) { al = SSL_AD_DECODE_ERROR; @@ -2111,6 +2117,10 @@ int ssl3_get_certificate_request(SSL *s) if (ctype_num > SSL3_CT_NUMBER) { /* If we exceed static buffer copy all to cert structure */ s->cert->ctypes = OPENSSL_malloc(ctype_num); + if (s->cert->ctypes == NULL) { + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, ERR_R_MALLOC_FAILURE); + goto err; + } memcpy(s->cert->ctypes, p, ctype_num); s->cert->ctype_num = (size_t)ctype_num; ctype_num = SSL3_CT_NUMBER; @@ -2167,6 +2177,11 @@ int ssl3_get_certificate_request(SSL *s) } for (nc = 0; nc < llen;) { + if (nc + 2 > llen) { + ssl3_send_alert(s, SSL3_AL_FATAL, SSL_AD_DECODE_ERROR); + SSLerr(SSL_F_SSL3_GET_CERTIFICATE_REQUEST, SSL_R_CA_DN_TOO_LONG); + goto err; + } n2s(p, l); if ((l + nc + 2) > llen) { if ((s->options & SSL_OP_NETSCAPE_CA_DN_BUG)) @@ -2998,19 +3013,6 @@ int ssl3_send_client_key_exchange(SSL *s) ERR_R_INTERNAL_ERROR); goto err; } - /* - * If we have client certificate, use its secret as peer key - */ - if (s->s3->tmp.cert_req && s->cert->key->privatekey) { - if (EVP_PKEY_derive_set_peer - (pkey_ctx, s->cert->key->privatekey) <= 0) { - /* - * If there was an error - just ignore it. Ephemeral key - * * would be used - */ - ERR_clear_error(); - } - } /* * Compute shared IV and store it in algorithm-specific context * data @@ -3057,12 +3059,6 @@ int ssl3_send_client_key_exchange(SSL *s) n = msglen + 2; } memcpy(p, tmp, msglen); - /* Check if pubkey from client certificate was used */ - if (EVP_PKEY_CTX_ctrl - (pkey_ctx, -1, -1, EVP_PKEY_CTRL_PEER_KEY, 2, NULL) > 0) { - /* Set flag "skip certificate verify" */ - s->s3->flags |= TLS1_FLAGS_SKIP_CERT_VERIFY; - } EVP_PKEY_CTX_free(pkey_ctx); s->session->master_key_length = s->method->ssl3_enc->generate_master_secret(s, diff --git a/deps/openssl/openssl/ssl/s3_enc.c b/deps/openssl/openssl/ssl/s3_enc.c index 47a0ec9fe04b18..fbc954d43c70c7 100644 --- a/deps/openssl/openssl/ssl/s3_enc.c +++ b/deps/openssl/openssl/ssl/s3_enc.c @@ -607,6 +607,10 @@ int ssl3_digest_cached_records(SSL *s) ssl3_free_digest_list(s); s->s3->handshake_dgst = OPENSSL_malloc(SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *)); + if (s->s3->handshake_dgst == NULL) { + SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_MALLOC_FAILURE); + return 0; + } memset(s->s3->handshake_dgst, 0, SSL_MAX_DIGEST * sizeof(EVP_MD_CTX *)); hdatalen = BIO_get_mem_data(s->s3->handshake_buffer, &hdata); if (hdatalen <= 0) { @@ -624,8 +628,12 @@ int ssl3_digest_cached_records(SSL *s) EVP_MD_CTX_FLAG_NON_FIPS_ALLOW); } #endif - EVP_DigestInit_ex(s->s3->handshake_dgst[i], md, NULL); - EVP_DigestUpdate(s->s3->handshake_dgst[i], hdata, hdatalen); + if (!EVP_DigestInit_ex(s->s3->handshake_dgst[i], md, NULL) + || !EVP_DigestUpdate(s->s3->handshake_dgst[i], hdata, + hdatalen)) { + SSLerr(SSL_F_SSL3_DIGEST_CACHED_RECORDS, ERR_R_INTERNAL_ERROR); + return 0; + } } else { s->s3->handshake_dgst[i] = NULL; } diff --git a/deps/openssl/openssl/ssl/s3_lib.c b/deps/openssl/openssl/ssl/s3_lib.c index 872e636af9e190..0385e039c8d46c 100644 --- a/deps/openssl/openssl/ssl/s3_lib.c +++ b/deps/openssl/openssl/ssl/s3_lib.c @@ -329,7 +329,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -382,7 +382,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -434,7 +434,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -487,7 +487,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -539,7 +539,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -625,7 +625,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -712,7 +712,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -778,7 +778,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_MD5, SSL_SSLV3, - SSL_NOT_EXP | SSL_HIGH, + SSL_NOT_EXP | SSL_MEDIUM, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -1728,7 +1728,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2120,7 +2120,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2200,7 +2200,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2280,7 +2280,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2360,7 +2360,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2440,7 +2440,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_HIGH | SSL_FIPS, + SSL_NOT_DEFAULT | SSL_NOT_EXP | SSL_MEDIUM | SSL_FIPS, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2490,7 +2490,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, + SSL_NOT_EXP | SSL_MEDIUM, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2506,7 +2506,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, + SSL_NOT_EXP | SSL_MEDIUM, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -2522,7 +2522,7 @@ OPENSSL_GLOBAL SSL_CIPHER ssl3_ciphers[] = { SSL_3DES, SSL_SHA1, SSL_TLSV1, - SSL_NOT_EXP | SSL_HIGH, + SSL_NOT_EXP | SSL_MEDIUM, SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF, 112, 168, @@ -4528,7 +4528,10 @@ int ssl3_renegotiate_check(SSL *s) */ long ssl_get_algorithm2(SSL *s) { - long alg2 = s->s3->tmp.new_cipher->algorithm2; + long alg2; + if (s->s3 == NULL || s->s3->tmp.new_cipher == NULL) + return -1; + alg2 = s->s3->tmp.new_cipher->algorithm2; if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF && alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF)) return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256; diff --git a/deps/openssl/openssl/ssl/s3_pkt.c b/deps/openssl/openssl/ssl/s3_pkt.c index 379890237e8663..be37ef0e50d8b0 100644 --- a/deps/openssl/openssl/ssl/s3_pkt.c +++ b/deps/openssl/openssl/ssl/s3_pkt.c @@ -1229,6 +1229,13 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) return (ret); } + /* + * Reset the count of consecutive warning alerts if we've got a non-empty + * record that isn't an alert. + */ + if (rr->type != SSL3_RT_ALERT && rr->length != 0) + s->cert->alert_count = 0; + /* we now have a packet which can be read and processed */ if (s->s3->change_cipher_spec /* set when we receive ChangeCipherSpec, @@ -1443,6 +1450,14 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) if (alert_level == SSL3_AL_WARNING) { s->s3->warn_alert = alert_descr; + + s->cert->alert_count++; + if (s->cert->alert_count == MAX_WARN_ALERT_COUNT) { + al = SSL_AD_UNEXPECTED_MESSAGE; + SSLerr(SSL_F_SSL3_READ_BYTES, SSL_R_TOO_MANY_WARN_ALERTS); + goto f_err; + } + if (alert_descr == SSL_AD_CLOSE_NOTIFY) { s->shutdown |= SSL_RECEIVED_SHUTDOWN; return (0); @@ -1473,7 +1488,7 @@ int ssl3_read_bytes(SSL *s, int type, unsigned char *buf, int len, int peek) BIO_snprintf(tmp, sizeof tmp, "%d", alert_descr); ERR_add_error_data(2, "SSL alert number ", tmp); s->shutdown |= SSL_RECEIVED_SHUTDOWN; - SSL_CTX_remove_session(s->ctx, s->session); + SSL_CTX_remove_session(s->session_ctx, s->session); return (0); } else { al = SSL_AD_ILLEGAL_PARAMETER; @@ -1698,7 +1713,7 @@ int ssl3_send_alert(SSL *s, int level, int desc) return -1; /* If a fatal one, remove from cache */ if ((level == 2) && (s->session != NULL)) - SSL_CTX_remove_session(s->ctx, s->session); + SSL_CTX_remove_session(s->session_ctx, s->session); s->s3->alert_dispatch = 1; s->s3->send_alert[0] = level; diff --git a/deps/openssl/openssl/ssl/s3_srvr.c b/deps/openssl/openssl/ssl/s3_srvr.c index ab28702ee972da..01ccd5d2ae78d4 100644 --- a/deps/openssl/openssl/ssl/s3_srvr.c +++ b/deps/openssl/openssl/ssl/s3_srvr.c @@ -980,7 +980,8 @@ int ssl3_get_client_hello(SSL *s) session_length = *(p + SSL3_RANDOM_SIZE); - if (p + SSL3_RANDOM_SIZE + session_length + 1 >= d + n) { + if (SSL3_RANDOM_SIZE + session_length + 1 + >= (unsigned int)((d + n) - p)) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -998,7 +999,7 @@ int ssl3_get_client_hello(SSL *s) /* get the session-id */ j = *(p++); - if (p + j > d + n) { + if ((d + n) - p < j) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1054,14 +1055,14 @@ int ssl3_get_client_hello(SSL *s) if (SSL_IS_DTLS(s)) { /* cookie stuff */ - if (p + 1 > d + n) { + if ((d + n) - p < 1) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; } cookie_len = *(p++); - if (p + cookie_len > d + n) { + if ((unsigned int)((d + n ) - p) < cookie_len) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1131,7 +1132,7 @@ int ssl3_get_client_hello(SSL *s) } } - if (p + 2 > d + n) { + if ((d + n ) - p < 2) { al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_TOO_SHORT); goto f_err; @@ -1145,7 +1146,7 @@ int ssl3_get_client_hello(SSL *s) } /* i bytes of cipher data + 1 byte for compression length later */ - if ((p + i + 1) > (d + n)) { + if ((d + n) - p < i + 1) { /* not enough data */ al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); @@ -1211,7 +1212,7 @@ int ssl3_get_client_hello(SSL *s) /* compression */ i = *(p++); - if ((p + i) > (d + n)) { + if ((d + n) - p < i) { /* not enough data */ al = SSL_AD_DECODE_ERROR; SSLerr(SSL_F_SSL3_GET_CLIENT_HELLO, SSL_R_LENGTH_MISMATCH); @@ -1872,6 +1873,11 @@ int ssl3_send_server_key_exchange(SSL *s) goto f_err; } kn = EVP_PKEY_size(pkey); + /* Allow space for signature algorithm */ + if (SSL_USE_SIGALGS(s)) + kn += 2; + /* Allow space for signature length */ + kn += 2; } else { pkey = NULL; kn = 0; @@ -2229,11 +2235,8 @@ int ssl3_get_client_key_exchange(SSL *s) * fails. See https://tools.ietf.org/html/rfc5246#section-7.4.7.1 */ - /* - * should be RAND_bytes, but we cannot work around a failure. - */ - if (RAND_pseudo_bytes(rand_premaster_secret, - sizeof(rand_premaster_secret)) <= 0) + if (RAND_bytes(rand_premaster_secret, + sizeof(rand_premaster_secret)) <= 0) goto err; decrypt_len = RSA_private_decrypt((int)n, p, p, rsa, RSA_PKCS1_PADDING); @@ -2323,7 +2326,8 @@ int ssl3_get_client_key_exchange(SSL *s) if (!(s->options & SSL_OP_SSLEAY_080_CLIENT_DH_BUG)) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG); - goto err; + al = SSL_AD_HANDSHAKE_FAILURE; + goto f_err; } else { p -= 2; i = (int)n; @@ -2376,9 +2380,10 @@ int ssl3_get_client_key_exchange(SSL *s) i = DH_compute_key(p, pub, dh_srvr); if (i <= 0) { + al = SSL_AD_HANDSHAKE_FAILURE; SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_DH_LIB); BN_clear_free(pub); - goto err; + goto f_err; } DH_free(s->s3->tmp.dh); @@ -2676,12 +2681,14 @@ int ssl3_get_client_key_exchange(SSL *s) i = *p; p += 1; if (n != 1 + i) { - SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB); - goto err; + SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, SSL_R_LENGTH_MISMATCH); + al = SSL_AD_DECODE_ERROR; + goto f_err; } if (EC_POINT_oct2point(group, clnt_ecpoint, p, i, bn_ctx) == 0) { SSLerr(SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE, ERR_R_EC_LIB); - goto err; + al = SSL_AD_HANDSHAKE_FAILURE; + goto f_err; } /* * p is pointing to somewhere in the buffer currently, so set it @@ -3213,6 +3220,12 @@ int ssl3_get_client_certificate(SSL *s) goto f_err; } for (nc = 0; nc < llen;) { + if (nc + 3 > llen) { + al = SSL_AD_DECODE_ERROR; + SSLerr(SSL_F_SSL3_GET_CLIENT_CERTIFICATE, + SSL_R_CERT_LENGTH_MISMATCH); + goto f_err; + } n2l3(p, l); if ((l + nc + 3) > llen) { al = SSL_AD_DECODE_ERROR; @@ -3497,37 +3510,34 @@ int ssl3_send_cert_status(SSL *s) { if (s->state == SSL3_ST_SW_CERT_STATUS_A) { unsigned char *p; + size_t msglen; + /*- * Grow buffer if need be: the length calculation is as - * follows 1 (message type) + 3 (message length) + + * follows handshake_header_length + * 1 (ocsp response type) + 3 (ocsp response length) * + (ocsp response) */ - if (!BUF_MEM_grow(s->init_buf, 8 + s->tlsext_ocsp_resplen)) { + msglen = 4 + s->tlsext_ocsp_resplen; + if (!BUF_MEM_grow(s->init_buf, SSL_HM_HEADER_LENGTH(s) + msglen)) { s->state = SSL_ST_ERR; return -1; } - p = (unsigned char *)s->init_buf->data; + p = ssl_handshake_start(s); - /* do the header */ - *(p++) = SSL3_MT_CERTIFICATE_STATUS; - /* message length */ - l2n3(s->tlsext_ocsp_resplen + 4, p); /* status type */ *(p++) = s->tlsext_status_type; /* length of OCSP response */ l2n3(s->tlsext_ocsp_resplen, p); /* actual response */ memcpy(p, s->tlsext_ocsp_resp, s->tlsext_ocsp_resplen); - /* number of bytes to write */ - s->init_num = 8 + s->tlsext_ocsp_resplen; - s->state = SSL3_ST_SW_CERT_STATUS_B; - s->init_off = 0; + + ssl_set_handshake_header(s, SSL3_MT_CERTIFICATE_STATUS, msglen); } /* SSL3_ST_SW_CERT_STATUS_B */ - return (ssl3_do_write(s, SSL3_RT_HANDSHAKE)); + return (ssl_do_write(s)); } # ifndef OPENSSL_NO_NEXTPROTONEG diff --git a/deps/openssl/openssl/ssl/ssl-lib.com b/deps/openssl/openssl/ssl/ssl-lib.com index 43fea17541722d..bf67265a46e947 100644 --- a/deps/openssl/openssl/ssl/ssl-lib.com +++ b/deps/openssl/openssl/ssl/ssl-lib.com @@ -941,7 +941,7 @@ $ CC = "CC" $ IF ARCH.EQS."VAX" .AND. F$TRNLNM("DECC$CC_DEFAULT").NES."/DECC" - THEN CC = "CC/DECC" $ CC = CC + " /''CC_OPTIMIZE' /''DEBUGGER' /STANDARD=RELAXED"+ - - "''POINTER_SIZE' /NOLIST /PREFIX=ALL" + - + "''POINTER_SIZE' /NOLIST /PREFIX=ALL /EXTERN_MODEL=STRICT_REFDEF" + - " /INCLUDE=(''CC_INCLUDES') " + CCEXTRAFLAGS $! $! Define The Linker Options File Name. diff --git a/deps/openssl/openssl/ssl/ssl.h b/deps/openssl/openssl/ssl/ssl.h index 5ef56faa509903..90aeb0ce4e1ead 100644 --- a/deps/openssl/openssl/ssl/ssl.h +++ b/deps/openssl/openssl/ssl/ssl.h @@ -2532,7 +2532,6 @@ void SSL_set_tmp_ecdh_callback(SSL *ssl, int keylength)); # endif -# ifndef OPENSSL_NO_COMP const COMP_METHOD *SSL_get_current_compression(SSL *s); const COMP_METHOD *SSL_get_current_expansion(SSL *s); const char *SSL_COMP_get_name(const COMP_METHOD *comp); @@ -2541,13 +2540,6 @@ STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) *meths); void SSL_COMP_free_compression_methods(void); int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm); -# else -const void *SSL_get_current_compression(SSL *s); -const void *SSL_get_current_expansion(SSL *s); -const char *SSL_COMP_get_name(const void *comp); -void *SSL_COMP_get_compression_methods(void); -int SSL_COMP_add_compression_method(int id, void *cm); -# endif const SSL_CIPHER *SSL_CIPHER_find(SSL *ssl, const unsigned char *ptr); @@ -2623,6 +2615,7 @@ void ERR_load_SSL_strings(void); # define SSL_F_DTLS1_HEARTBEAT 305 # define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 255 # define SSL_F_DTLS1_PREPROCESS_FRAGMENT 288 +# define SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS 424 # define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 256 # define SSL_F_DTLS1_PROCESS_RECORD 257 # define SSL_F_DTLS1_READ_BYTES 258 @@ -3114,6 +3107,7 @@ void ERR_load_SSL_strings(void); # define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST 157 # define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 # define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 +# define SSL_R_TOO_MANY_WARN_ALERTS 409 # define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 # define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 # define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 313 diff --git a/deps/openssl/openssl/ssl/ssl_asn1.c b/deps/openssl/openssl/ssl/ssl_asn1.c index 35cc27c5e9855e..499f0e85addf2e 100644 --- a/deps/openssl/openssl/ssl/ssl_asn1.c +++ b/deps/openssl/openssl/ssl/ssl_asn1.c @@ -527,6 +527,9 @@ SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp, if (os.length > SSL_MAX_SID_CTX_LENGTH) { c.error = SSL_R_BAD_LENGTH; c.line = __LINE__; + OPENSSL_free(os.data); + os.data = NULL; + os.length = 0; goto err; } else { ret->sid_ctx_length = os.length; diff --git a/deps/openssl/openssl/ssl/ssl_ciph.c b/deps/openssl/openssl/ssl/ssl_ciph.c index 302464e643ea7a..2ad8f4392236e6 100644 --- a/deps/openssl/openssl/ssl/ssl_ciph.c +++ b/deps/openssl/openssl/ssl/ssl_ciph.c @@ -1932,17 +1932,27 @@ SSL_COMP *ssl3_comp_find(STACK_OF(SSL_COMP) *sk, int n) } #ifdef OPENSSL_NO_COMP -void *SSL_COMP_get_compression_methods(void) +STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void) { return NULL; } -int SSL_COMP_add_compression_method(int id, void *cm) +STACK_OF(SSL_COMP) *SSL_COMP_set0_compression_methods(STACK_OF(SSL_COMP) + *meths) +{ + return NULL; +} + +void SSL_COMP_free_compression_methods(void) +{ +} + +int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) { return 1; } -const char *SSL_COMP_get_name(const void *comp) +const char *SSL_COMP_get_name(const COMP_METHOD *comp) { return NULL; } @@ -1996,6 +2006,11 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) MemCheck_off(); comp = (SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP)); + if (comp == NULL) { + MemCheck_on(); + SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD, ERR_R_MALLOC_FAILURE); + return 1; + } comp->id = id; comp->method = cm; load_builtin_compressions(); diff --git a/deps/openssl/openssl/ssl/ssl_err.c b/deps/openssl/openssl/ssl/ssl_err.c index 704088dc469ed9..79aaf1a838b71b 100644 --- a/deps/openssl/openssl/ssl/ssl_err.c +++ b/deps/openssl/openssl/ssl/ssl_err.c @@ -1,6 +1,6 @@ /* ssl/ssl_err.c */ /* ==================================================================== - * Copyright (c) 1999-2015 The OpenSSL Project. All rights reserved. + * Copyright (c) 1999-2016 The OpenSSL Project. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -93,6 +93,8 @@ static ERR_STRING_DATA SSL_str_functs[] = { {ERR_FUNC(SSL_F_DTLS1_HEARTBEAT), "dtls1_heartbeat"}, {ERR_FUNC(SSL_F_DTLS1_OUTPUT_CERT_CHAIN), "dtls1_output_cert_chain"}, {ERR_FUNC(SSL_F_DTLS1_PREPROCESS_FRAGMENT), "DTLS1_PREPROCESS_FRAGMENT"}, + {ERR_FUNC(SSL_F_DTLS1_PROCESS_BUFFERED_RECORDS), + "DTLS1_PROCESS_BUFFERED_RECORDS"}, {ERR_FUNC(SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE), "DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE"}, {ERR_FUNC(SSL_F_DTLS1_PROCESS_RECORD), "DTLS1_PROCESS_RECORD"}, diff --git a/deps/openssl/openssl/ssl/ssl_lib.c b/deps/openssl/openssl/ssl/ssl_lib.c index fd94325bb3a47d..42b980ac26a05f 100644 --- a/deps/openssl/openssl/ssl/ssl_lib.c +++ b/deps/openssl/openssl/ssl/ssl_lib.c @@ -1828,7 +1828,7 @@ int SSL_export_keying_material(SSL *s, unsigned char *out, size_t olen, const unsigned char *p, size_t plen, int use_context) { - if (s->version < TLS1_VERSION) + if (s->version < TLS1_VERSION && s->version != DTLS1_BAD_VER) return -1; return s->method->ssl3_enc->export_keying_material(s, out, olen, label, @@ -2000,7 +2000,7 @@ SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth) ret->tlsext_servername_callback = 0; ret->tlsext_servername_arg = NULL; /* Setup RFC4507 ticket keys */ - if ((RAND_pseudo_bytes(ret->tlsext_tick_key_name, 16) <= 0) + if ((RAND_bytes(ret->tlsext_tick_key_name, 16) <= 0) || (RAND_bytes(ret->tlsext_tick_hmac_key, 16) <= 0) || (RAND_bytes(ret->tlsext_tick_aes_key, 16) <= 0)) ret->options |= SSL_OP_NO_TICKET; @@ -3050,12 +3050,12 @@ const SSL_CIPHER *SSL_get_current_cipher(const SSL *s) } #ifdef OPENSSL_NO_COMP -const void *SSL_get_current_compression(SSL *s) +const COMP_METHOD *SSL_get_current_compression(SSL *s) { return NULL; } -const void *SSL_get_current_expansion(SSL *s) +const COMP_METHOD *SSL_get_current_expansion(SSL *s) { return NULL; } diff --git a/deps/openssl/openssl/ssl/ssl_locl.h b/deps/openssl/openssl/ssl/ssl_locl.h index 747e718a52bfce..6df725f7d73afa 100644 --- a/deps/openssl/openssl/ssl/ssl_locl.h +++ b/deps/openssl/openssl/ssl/ssl_locl.h @@ -491,6 +491,12 @@ # define SSL_CLIENT_USE_TLS1_2_CIPHERS(s) \ ((SSL_IS_DTLS(s) && s->client_version <= DTLS1_2_VERSION) || \ (!SSL_IS_DTLS(s) && s->client_version >= TLS1_2_VERSION)) +/* + * Determine if a client should send signature algorithms extension: + * as with TLS1.2 cipher we can't rely on method flags. + */ +# define SSL_CLIENT_USE_SIGALGS(s) \ + SSL_CLIENT_USE_TLS1_2_CIPHERS(s) /* Mostly for SSLv3 */ # define SSL_PKEY_RSA_ENC 0 @@ -585,6 +591,8 @@ typedef struct { */ # define SSL_EXT_FLAG_SENT 0x2 +# define MAX_WARN_ALERT_COUNT 5 + typedef struct { custom_ext_method *meths; size_t meths_count; @@ -692,6 +700,8 @@ typedef struct cert_st { unsigned char *alpn_proposed; /* server */ unsigned int alpn_proposed_len; int alpn_sent; /* client */ + /* Count of the number of consecutive warning alerts received */ + unsigned int alert_count; } CERT; typedef struct sess_cert_st { @@ -1242,7 +1252,8 @@ int dtls1_retransmit_message(SSL *s, unsigned short seq, unsigned long frag_off, int *found); int dtls1_get_queue_priority(unsigned short seq, int is_ccs); int dtls1_retransmit_buffered_messages(SSL *s); -void dtls1_clear_record_buffer(SSL *s); +void dtls1_clear_received_buffer(SSL *s); +void dtls1_clear_sent_buffer(SSL *s); void dtls1_get_message_header(unsigned char *data, struct hm_header_st *msg_hdr); void dtls1_get_ccs_header(unsigned char *data, struct ccs_header_st *ccs_hdr); diff --git a/deps/openssl/openssl/ssl/ssl_rsa.c b/deps/openssl/openssl/ssl/ssl_rsa.c index 82022470bfd775..f679801a297c8f 100644 --- a/deps/openssl/openssl/ssl/ssl_rsa.c +++ b/deps/openssl/openssl/ssl/ssl_rsa.c @@ -912,6 +912,8 @@ static int serverinfo_process_buffer(const unsigned char *serverinfo, int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, size_t serverinfo_length) { + unsigned char *new_serverinfo; + if (ctx == NULL || serverinfo == NULL || serverinfo_length == 0) { SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_PASSED_NULL_PARAMETER); return 0; @@ -928,12 +930,13 @@ int SSL_CTX_use_serverinfo(SSL_CTX *ctx, const unsigned char *serverinfo, SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_INTERNAL_ERROR); return 0; } - ctx->cert->key->serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo, - serverinfo_length); - if (ctx->cert->key->serverinfo == NULL) { + new_serverinfo = OPENSSL_realloc(ctx->cert->key->serverinfo, + serverinfo_length); + if (new_serverinfo == NULL) { SSLerr(SSL_F_SSL_CTX_USE_SERVERINFO, ERR_R_MALLOC_FAILURE); return 0; } + ctx->cert->key->serverinfo = new_serverinfo; memcpy(ctx->cert->key->serverinfo, serverinfo, serverinfo_length); ctx->cert->key->serverinfo_length = serverinfo_length; diff --git a/deps/openssl/openssl/ssl/ssl_sess.c b/deps/openssl/openssl/ssl/ssl_sess.c index b182998343844a..ed9855f90cf812 100644 --- a/deps/openssl/openssl/ssl/ssl_sess.c +++ b/deps/openssl/openssl/ssl/ssl_sess.c @@ -382,7 +382,7 @@ static int def_generate_session_id(const SSL *ssl, unsigned char *id, { unsigned int retry = 0; do - if (RAND_pseudo_bytes(id, *id_len) <= 0) + if (RAND_bytes(id, *id_len) <= 0) return 0; while (SSL_has_matching_session_id(ssl, id, *id_len) && (++retry < MAX_SESS_ID_ATTEMPTS)) ; @@ -573,7 +573,7 @@ int ssl_get_prev_session(SSL *s, unsigned char *session_id, int len, int r; #endif - if (session_id + len > limit) { + if (limit - session_id < len) { fatal = 1; goto err; } @@ -919,6 +919,10 @@ int SSL_set_session(SSL *s, SSL_SESSION *session) session->krb5_client_princ_len > 0) { s->kssl_ctx->client_princ = (char *)OPENSSL_malloc(session->krb5_client_princ_len + 1); + if (s->kssl_ctx->client_princ == NULL) { + SSLerr(SSL_F_SSL_SET_SESSION, ERR_R_MALLOC_FAILURE); + return 0; + } memcpy(s->kssl_ctx->client_princ, session->krb5_client_princ, session->krb5_client_princ_len); s->kssl_ctx->client_princ[session->krb5_client_princ_len] = '\0'; @@ -1123,7 +1127,7 @@ int ssl_clear_bad_session(SSL *s) if ((s->session != NULL) && !(s->shutdown & SSL_SENT_SHUTDOWN) && !(SSL_in_init(s) || SSL_in_before(s))) { - SSL_CTX_remove_session(s->ctx, s->session); + SSL_CTX_remove_session(s->session_ctx, s->session); return (1); } else return (0); diff --git a/deps/openssl/openssl/ssl/ssltest.c b/deps/openssl/openssl/ssl/ssltest.c index 1db84ad5f9aade..890e47685350bb 100644 --- a/deps/openssl/openssl/ssl/ssltest.c +++ b/deps/openssl/openssl/ssl/ssltest.c @@ -3141,9 +3141,12 @@ static unsigned int psk_server_callback(SSL *ssl, const char *identity, static int do_test_cipherlist(void) { +#if !defined(OPENSSL_NO_SSL2) || !defined(OPENSSL_NO_SSL3) || \ + !defined(OPENSSL_NO_TLS1) int i = 0; const SSL_METHOD *meth; const SSL_CIPHER *ci, *tci = NULL; +#endif #ifndef OPENSSL_NO_SSL2 fprintf(stderr, "testing SSLv2 cipher list order: "); diff --git a/deps/openssl/openssl/ssl/sslv2conftest.c b/deps/openssl/openssl/ssl/sslv2conftest.c index 1fd748b11866e0..2aed9950b91dc9 100644 --- a/deps/openssl/openssl/ssl/sslv2conftest.c +++ b/deps/openssl/openssl/ssl/sslv2conftest.c @@ -84,7 +84,7 @@ int main(int argc, char *argv[]) { BIO *err; int testresult = 0; - int currtest; + int currtest = 0; SSL_library_init(); SSL_load_error_strings(); diff --git a/deps/openssl/openssl/ssl/t1_enc.c b/deps/openssl/openssl/ssl/t1_enc.c index 514fcb3e4e74c4..b6d1ee95a5212b 100644 --- a/deps/openssl/openssl/ssl/t1_enc.c +++ b/deps/openssl/openssl/ssl/t1_enc.c @@ -673,7 +673,6 @@ int tls1_setup_key_block(SSL *s) if ((p2 = (unsigned char *)OPENSSL_malloc(num)) == NULL) { SSLerr(SSL_F_TLS1_SETUP_KEY_BLOCK, ERR_R_MALLOC_FAILURE); - OPENSSL_free(p1); goto err; } #ifdef TLS_DEBUG diff --git a/deps/openssl/openssl/ssl/t1_ext.c b/deps/openssl/openssl/ssl/t1_ext.c index 724ddf76acb3df..79ed946a514226 100644 --- a/deps/openssl/openssl/ssl/t1_ext.c +++ b/deps/openssl/openssl/ssl/t1_ext.c @@ -275,7 +275,9 @@ int SSL_extension_supported(unsigned int ext_type) case TLSEXT_TYPE_ec_point_formats: case TLSEXT_TYPE_elliptic_curves: case TLSEXT_TYPE_heartbeat: +# ifndef OPENSSL_NO_NEXTPROTONEG case TLSEXT_TYPE_next_proto_neg: +# endif case TLSEXT_TYPE_padding: case TLSEXT_TYPE_renegotiate: case TLSEXT_TYPE_server_name: diff --git a/deps/openssl/openssl/ssl/t1_lib.c b/deps/openssl/openssl/ssl/t1_lib.c index dd5bd0050d89f5..7831046b926139 100644 --- a/deps/openssl/openssl/ssl/t1_lib.c +++ b/deps/openssl/openssl/ssl/t1_lib.c @@ -1429,7 +1429,7 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *buf, } skip_ext: - if (SSL_USE_SIGALGS(s)) { + if (SSL_CLIENT_USE_SIGALGS(s)) { size_t salglen; const unsigned char *salg; salglen = tls12_get_psigalgs(s, &salg); @@ -1867,11 +1867,11 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, 0x02, 0x03, /* SHA-1/ECDSA */ }; - if (data >= (limit - 2)) + if (limit - data <= 2) return; data += 2; - if (data > (limit - 4)) + if (limit - data < 4) return; n2s(data, type); n2s(data, size); @@ -1879,7 +1879,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, if (type != TLSEXT_TYPE_server_name) return; - if (data + size > limit) + if (limit - data < size) return; data += size; @@ -1887,7 +1887,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, const size_t len1 = sizeof(kSafariExtensionsBlock); const size_t len2 = sizeof(kSafariTLS12ExtensionsBlock); - if (data + len1 + len2 != limit) + if (limit - data != (int)(len1 + len2)) return; if (memcmp(data, kSafariExtensionsBlock, len1) != 0) return; @@ -1896,7 +1896,7 @@ static void ssl_check_for_safari(SSL *s, const unsigned char *data, } else { const size_t len = sizeof(kSafariExtensionsBlock); - if (data + len != limit) + if (limit - data != (int)(len)) return; if (memcmp(data, kSafariExtensionsBlock, len) != 0) return; @@ -2053,19 +2053,19 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, if (data == limit) goto ri_check; - if (data > (limit - 2)) + if (limit - data < 2) goto err; n2s(data, len); - if (data + len != limit) + if (limit - data != len) goto err; - while (data <= (limit - 4)) { + while (limit - data >= 4) { n2s(data, type); n2s(data, size); - if (data + size > (limit)) + if (limit - data < size) goto err; # if 0 fprintf(stderr, "Received extension type %d size %d\n", type, size); @@ -2316,6 +2316,23 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, size -= 2; if (dsize > size) goto err; + + /* + * We remove any OCSP_RESPIDs from a previous handshake + * to prevent unbounded memory growth - CVE-2016-6304 + */ + sk_OCSP_RESPID_pop_free(s->tlsext_ocsp_ids, + OCSP_RESPID_free); + if (dsize > 0) { + s->tlsext_ocsp_ids = sk_OCSP_RESPID_new_null(); + if (s->tlsext_ocsp_ids == NULL) { + *al = SSL_AD_INTERNAL_ERROR; + return 0; + } + } else { + s->tlsext_ocsp_ids = NULL; + } + while (dsize > 0) { OCSP_RESPID *id; int idsize; @@ -2335,13 +2352,6 @@ static int ssl_scan_clienthello_tlsext(SSL *s, unsigned char **p, OCSP_RESPID_free(id); goto err; } - if (!s->tlsext_ocsp_ids - && !(s->tlsext_ocsp_ids = - sk_OCSP_RESPID_new_null())) { - OCSP_RESPID_free(id); - *al = SSL_AD_INTERNAL_ERROR; - return 0; - } if (!sk_OCSP_RESPID_push(s->tlsext_ocsp_ids, id)) { OCSP_RESPID_free(id); *al = SSL_AD_INTERNAL_ERROR; @@ -2472,18 +2482,18 @@ static int ssl_scan_clienthello_custom_tlsext(SSL *s, if (s->hit || s->cert->srv_ext.meths_count == 0) return 1; - if (data >= limit - 2) + if (limit - data <= 2) return 1; n2s(data, len); - if (data > limit - len) + if (limit - data < len) return 1; - while (data <= limit - 4) { + while (limit - data >= 4) { n2s(data, type); n2s(data, size); - if (data + size > limit) + if (limit - data < size) return 1; if (custom_ext_parse(s, 1 /* server */ , type, data, size, al) <= 0) return 0; @@ -2569,20 +2579,20 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, SSL_TLSEXT_HB_DONT_SEND_REQUESTS); # endif - if (data >= (d + n - 2)) + if ((d + n) - data <= 2) goto ri_check; n2s(data, length); - if (data + length != d + n) { + if ((d + n) - data != length) { *al = SSL_AD_DECODE_ERROR; return 0; } - while (data <= (d + n - 4)) { + while ((d + n) - data >= 4) { n2s(data, type); n2s(data, size); - if (data + size > (d + n)) + if ((d + n) - data < size) goto ri_check; if (s->tlsext_debug_cb) @@ -2712,6 +2722,11 @@ static int ssl_scan_serverhello_tlsext(SSL *s, unsigned char **p, *al = TLS1_AD_INTERNAL_ERROR; return 0; } + /* + * Could be non-NULL if server has sent multiple NPN extensions in + * a single Serverhello + */ + OPENSSL_free(s->next_proto_negotiated); s->next_proto_negotiated = OPENSSL_malloc(selected_len); if (!s->next_proto_negotiated) { *al = TLS1_AD_INTERNAL_ERROR; @@ -3307,29 +3322,33 @@ int tls1_process_ticket(SSL *s, unsigned char *session_id, int len, /* Skip past DTLS cookie */ if (SSL_IS_DTLS(s)) { i = *(p++); - p += i; - if (p >= limit) + + if (limit - p <= i) return -1; + + p += i; } /* Skip past cipher list */ n2s(p, i); - p += i; - if (p >= limit) + if (limit - p <= i) return -1; + p += i; + /* Skip past compression algorithm list */ i = *(p++); - p += i; - if (p > limit) + if (limit - p < i) return -1; + p += i; + /* Now at start of extensions */ - if ((p + 2) >= limit) + if (limit - p <= 2) return 0; n2s(p, i); - while ((p + 4) <= limit) { + while (limit - p >= 4) { unsigned short type, size; n2s(p, type); n2s(p, size); - if (p + size > limit) + if (limit - p < size) return 0; if (type == TLSEXT_TYPE_session_ticket) { int r; @@ -3397,9 +3416,7 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, HMAC_CTX hctx; EVP_CIPHER_CTX ctx; SSL_CTX *tctx = s->initial_ctx; - /* Need at least keyname + iv + some encrypted data */ - if (eticklen < 48) - return 2; + /* Initialize session ticket encryption and HMAC contexts */ HMAC_CTX_init(&hctx); EVP_CIPHER_CTX_init(&ctx); @@ -3433,6 +3450,13 @@ static int tls_decrypt_ticket(SSL *s, const unsigned char *etick, if (mlen < 0) { goto err; } + /* Sanity check ticket length: must exceed keyname + IV + HMAC */ + if (eticklen <= 16 + EVP_CIPHER_CTX_iv_length(&ctx) + mlen) { + HMAC_CTX_cleanup(&hctx); + EVP_CIPHER_CTX_cleanup(&ctx); + return 2; + } + eticklen -= mlen; /* Check HMAC of encrypted ticket */ if (HMAC_Update(&hctx, etick, eticklen) <= 0 @@ -3902,7 +3926,7 @@ int tls1_process_heartbeat(SSL *s) memcpy(bp, pl, payload); bp += payload; /* Random padding */ - if (RAND_pseudo_bytes(bp, padding) < 0) { + if (RAND_bytes(bp, padding) <= 0) { OPENSSL_free(buffer); return -1; } @@ -3980,6 +4004,8 @@ int tls1_heartbeat(SSL *s) * - Padding */ buf = OPENSSL_malloc(1 + 2 + payload + padding); + if (buf == NULL) + return -1; p = buf; /* Message Type */ *p++ = TLS1_HB_REQUEST; @@ -3988,13 +4014,13 @@ int tls1_heartbeat(SSL *s) /* Sequence number */ s2n(s->tlsext_hb_seq, p); /* 16 random bytes */ - if (RAND_pseudo_bytes(p, 16) < 0) { + if (RAND_bytes(p, 16) <= 0) { SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR); goto err; } p += 16; /* Random padding */ - if (RAND_pseudo_bytes(p, padding) < 0) { + if (RAND_bytes(p, padding) <= 0) { SSLerr(SSL_F_TLS1_HEARTBEAT, ERR_R_INTERNAL_ERROR); goto err; } diff --git a/deps/openssl/openssl/test/Makefile b/deps/openssl/openssl/test/Makefile index e566babfa59d42..8f272ef99d5ee2 100644 --- a/deps/openssl/openssl/test/Makefile +++ b/deps/openssl/openssl/test/Makefile @@ -70,7 +70,9 @@ HEARTBEATTEST= heartbeat_test CONSTTIMETEST= constant_time_test VERIFYEXTRATEST= verify_extra_test CLIENTHELLOTEST= clienthellotest +BADDTLSTEST= bad_dtls_test SSLV2CONFTEST = sslv2conftest +DTLSTEST = dtlstest TESTS= alltests @@ -84,7 +86,8 @@ EXE= $(BNTEST)$(EXE_EXT) $(ECTEST)$(EXE_EXT) $(ECDSATEST)$(EXE_EXT) $(ECDHTEST) $(EVPTEST)$(EXE_EXT) $(EVPEXTRATEST)$(EXE_EXT) $(IGETEST)$(EXE_EXT) $(JPAKETEST)$(EXE_EXT) $(SRPTEST)$(EXE_EXT) \ $(ASN1TEST)$(EXE_EXT) $(V3NAMETEST)$(EXE_EXT) $(HEARTBEATTEST)$(EXE_EXT) \ $(CONSTTIMETEST)$(EXE_EXT) $(VERIFYEXTRATEST)$(EXE_EXT) \ - $(CLIENTHELLOTEST)$(EXE_EXT) $(SSLV2CONFTEST)$(EXE_EXT) + $(CLIENTHELLOTEST)$(EXE_EXT) $(SSLV2CONFTEST)$(EXE_EXT) $(DTLSTEST)$(EXE_EXT) \ + $(BADDTLSTEST)$(EXE_EXT) # $(METHTEST)$(EXE_EXT) @@ -98,7 +101,8 @@ OBJ= $(BNTEST).o $(ECTEST).o $(ECDSATEST).o $(ECDHTEST).o $(IDEATEST).o \ $(BFTEST).o $(SSLTEST).o $(DSATEST).o $(EXPTEST).o $(RSATEST).o \ $(EVPTEST).o $(EVPEXTRATEST).o $(IGETEST).o $(JPAKETEST).o $(ASN1TEST).o $(V3NAMETEST).o \ $(HEARTBEATTEST).o $(CONSTTIMETEST).o $(VERIFYEXTRATEST).o \ - $(CLIENTHELLOTEST).o $(SSLV2CONFTEST).o + $(CLIENTHELLOTEST).o $(SSLV2CONFTEST).o $(DTLSTEST).o ssltestlib.o \ + $(BADDTLSTEST).o SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(MD2TEST).c $(MD4TEST).c $(MD5TEST).c \ @@ -109,10 +113,11 @@ SRC= $(BNTEST).c $(ECTEST).c $(ECDSATEST).c $(ECDHTEST).c $(IDEATEST).c \ $(BFTEST).c $(SSLTEST).c $(DSATEST).c $(EXPTEST).c $(RSATEST).c \ $(EVPTEST).c $(EVPEXTRATEST).c $(IGETEST).c $(JPAKETEST).c $(SRPTEST).c $(ASN1TEST).c \ $(V3NAMETEST).c $(HEARTBEATTEST).c $(CONSTTIMETEST).c $(VERIFYEXTRATEST).c \ - $(CLIENTHELLOTEST).c $(SSLV2CONFTEST).c + $(CLIENTHELLOTEST).c $(SSLV2CONFTEST).c $(DTLSTEST).c ssltestlib.c \ + $(BADDTLSTEST).c EXHEADER= -HEADER= testutil.h $(EXHEADER) +HEADER= testutil.h ssltestlib.h $(EXHEADER) ALL= $(GENERAL) $(SRC) $(HEADER) @@ -153,7 +158,8 @@ alltests: \ test_gen test_req test_pkcs7 test_verify test_dh test_dsa \ test_ss test_ca test_engine test_evp test_evp_extra test_ssl test_tsa test_ige \ test_jpake test_srp test_cms test_ocsp test_v3name test_heartbeat \ - test_constant_time test_verify_extra test_clienthello test_sslv2conftest + test_constant_time test_verify_extra test_clienthello test_sslv2conftest \ + test_dtls test_bad_dtls test_evp: $(EVPTEST)$(EXE_EXT) evptests.txt ../util/shlib_wrap.sh ./$(EVPTEST) evptests.txt @@ -362,10 +368,18 @@ test_clienthello: $(CLIENTHELLOTEST)$(EXE_EXT) @echo $(START) $@ ../util/shlib_wrap.sh ./$(CLIENTHELLOTEST) +test_bad_dtls: $(BADDTLSTEST)$(EXE_EXT) + @echo $(START) $@ + ../util/shlib_wrap.sh ./$(BADDTLSTEST) + test_sslv2conftest: $(SSLV2CONFTEST)$(EXE_EXT) @echo $(START) $@ ../util/shlib_wrap.sh ./$(SSLV2CONFTEST) +test_dtls: $(DTLSTEST)$(EXE_EXT) + @echo $(START) $@ + ../util/shlib_wrap.sh ./$(DTLSTEST) ../apps/server.pem ../apps/server.pem + lint: lint -DLINT $(INCLUDES) $(SRC)>fluff @@ -397,7 +411,7 @@ BUILD_CMD=shlib_target=; if [ -n "$(SHARED_LIBS)" ]; then \ fi; \ LIBRARIES="$(LIBSSL) $(LIBCRYPTO) $(LIBKRB5)"; \ $(MAKE) -f $(TOP)/Makefile.shared -e \ - CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o" \ + CC="$${CC}" APPNAME=$$target$(EXE_EXT) OBJECTS="$$target.o $$exobj" \ LIBDEPS="$(PEX_LIBS) $$LIBRARIES $(EX_LIBS)" \ link_app.$${shlib_target} @@ -543,9 +557,15 @@ $(VERIFYEXTRATEST)$(EXE_EXT): $(VERIFYEXTRATEST).o $(CLIENTHELLOTEST)$(EXE_EXT): $(CLIENTHELLOTEST).o @target=$(CLIENTHELLOTEST) $(BUILD_CMD) +$(BADDTLSTEST)$(EXE_EXT): $(BADDTLSTEST).o + @target=$(BADDTLSTEST) $(BUILD_CMD) + $(SSLV2CONFTEST)$(EXE_EXT): $(SSLV2CONFTEST).o @target=$(SSLV2CONFTEST) $(BUILD_CMD) +$(DTLSTEST)$(EXE_EXT): $(DTLSTEST).o ssltestlib.o $(DLIBSSL) $(DLIBCRYPTO) + @target=$(DTLSTEST); exobj=ssltestlib.o; $(BUILD_CMD) + #$(AESTEST).o: $(AESTEST).c # $(CC) -c $(CFLAGS) -DINTERMEDIATE_VALUE_KAT -DTRACE_KAT_MCT $(AESTEST).c @@ -573,6 +593,25 @@ asn1test.o: ../include/openssl/pkcs7.h ../include/openssl/safestack.h asn1test.o: ../include/openssl/sha.h ../include/openssl/stack.h asn1test.o: ../include/openssl/symhacks.h ../include/openssl/x509.h asn1test.o: ../include/openssl/x509_vfy.h asn1test.c +bad_dtls_test.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h +bad_dtls_test.o: ../include/openssl/buffer.h ../include/openssl/comp.h +bad_dtls_test.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h +bad_dtls_test.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +bad_dtls_test.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +bad_dtls_test.o: ../include/openssl/err.h ../include/openssl/evp.h +bad_dtls_test.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +bad_dtls_test.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +bad_dtls_test.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +bad_dtls_test.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +bad_dtls_test.o: ../include/openssl/pem.h ../include/openssl/pem2.h +bad_dtls_test.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +bad_dtls_test.o: ../include/openssl/rand.h ../include/openssl/safestack.h +bad_dtls_test.o: ../include/openssl/sha.h ../include/openssl/srtp.h +bad_dtls_test.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +bad_dtls_test.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +bad_dtls_test.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +bad_dtls_test.o: ../include/openssl/tls1.h ../include/openssl/x509.h +bad_dtls_test.o: ../include/openssl/x509_vfy.h bad_dtls_test.c bftest.o: ../e_os.h ../include/openssl/blowfish.h ../include/openssl/e_os2.h bftest.o: ../include/openssl/opensslconf.h bftest.c bntest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h @@ -634,6 +673,25 @@ dsatest.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h dsatest.o: ../include/openssl/ossl_typ.h ../include/openssl/rand.h dsatest.o: ../include/openssl/safestack.h ../include/openssl/stack.h dsatest.o: ../include/openssl/symhacks.h dsatest.c +dtlstest.o: ../include/openssl/asn1.h ../include/openssl/bio.h +dtlstest.o: ../include/openssl/buffer.h ../include/openssl/comp.h +dtlstest.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h +dtlstest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +dtlstest.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +dtlstest.o: ../include/openssl/err.h ../include/openssl/evp.h +dtlstest.o: ../include/openssl/hmac.h ../include/openssl/kssl.h +dtlstest.o: ../include/openssl/lhash.h ../include/openssl/obj_mac.h +dtlstest.o: ../include/openssl/objects.h ../include/openssl/opensslconf.h +dtlstest.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h +dtlstest.o: ../include/openssl/pem.h ../include/openssl/pem2.h +dtlstest.o: ../include/openssl/pkcs7.h ../include/openssl/pqueue.h +dtlstest.o: ../include/openssl/safestack.h ../include/openssl/sha.h +dtlstest.o: ../include/openssl/srtp.h ../include/openssl/ssl.h +dtlstest.o: ../include/openssl/ssl2.h ../include/openssl/ssl23.h +dtlstest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h +dtlstest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h +dtlstest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h dtlstest.c +dtlstest.o: ssltestlib.h testutil.h ecdhtest.o: ../e_os.h ../include/openssl/asn1.h ../include/openssl/bio.h ecdhtest.o: ../include/openssl/bn.h ../include/openssl/crypto.h ecdhtest.o: ../include/openssl/e_os2.h ../include/openssl/ec.h @@ -856,6 +914,24 @@ ssltest.o: ../include/openssl/ssl3.h ../include/openssl/stack.h ssltest.o: ../include/openssl/symhacks.h ../include/openssl/tls1.h ssltest.o: ../include/openssl/x509.h ../include/openssl/x509_vfy.h ssltest.o: ../include/openssl/x509v3.h ssltest.c +ssltestlib.o: ../include/openssl/asn1.h ../include/openssl/bio.h +ssltestlib.o: ../include/openssl/buffer.h ../include/openssl/comp.h +ssltestlib.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h +ssltestlib.o: ../include/openssl/e_os2.h ../include/openssl/ec.h +ssltestlib.o: ../include/openssl/ecdh.h ../include/openssl/ecdsa.h +ssltestlib.o: ../include/openssl/evp.h ../include/openssl/hmac.h +ssltestlib.o: ../include/openssl/kssl.h ../include/openssl/lhash.h +ssltestlib.o: ../include/openssl/obj_mac.h ../include/openssl/objects.h +ssltestlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h +ssltestlib.o: ../include/openssl/ossl_typ.h ../include/openssl/pem.h +ssltestlib.o: ../include/openssl/pem2.h ../include/openssl/pkcs7.h +ssltestlib.o: ../include/openssl/pqueue.h ../include/openssl/safestack.h +ssltestlib.o: ../include/openssl/sha.h ../include/openssl/srtp.h +ssltestlib.o: ../include/openssl/ssl.h ../include/openssl/ssl2.h +ssltestlib.o: ../include/openssl/ssl23.h ../include/openssl/ssl3.h +ssltestlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h +ssltestlib.o: ../include/openssl/tls1.h ../include/openssl/x509.h +ssltestlib.o: ../include/openssl/x509_vfy.h ssltestlib.c ssltestlib.h sslv2conftest.o: ../include/openssl/asn1.h ../include/openssl/bio.h sslv2conftest.o: ../include/openssl/buffer.h ../include/openssl/comp.h sslv2conftest.o: ../include/openssl/crypto.h ../include/openssl/dtls1.h diff --git a/deps/openssl/openssl/test/evptests.txt b/deps/openssl/openssl/test/evptests.txt index 3b9bc13e82eb88..4e9958b3b5bc07 100644 --- a/deps/openssl/openssl/test/evptests.txt +++ b/deps/openssl/openssl/test/evptests.txt @@ -66,29 +66,29 @@ AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:3 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:F5D3D58503B9699DE785895A96FDBAAF AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:43B1CD7F598ECE23881B00E3ED030688 AES-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:7B0C785E27E8AD3F8223207104725DD4 -# ECB-AES192.Encrypt and ECB-AES192.Decrypt +# ECB-AES192.Encrypt and ECB-AES192.Decrypt AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:BD334F1D6E45F25FF712A214571FA5CC AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:974104846D0AD3AD7734ECB3ECEE4EEF AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:EF7AFD2270E2E60ADCE0BA2FACE6444E AES-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:9A4B41BA738D6C72FB16691603C18E0E -# ECB-AES256.Encrypt and ECB-AES256.Decrypt +# ECB-AES256.Encrypt and ECB-AES256.Decrypt AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:F3EED1BDB5D2A03C064B5A7E3DB181F8 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:591CCB10D410ED26DC5BA74A31362870 AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:B6ED21B99CA6F4F9F153E7B1BEAFED1D AES-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::F69F2445DF4F9B17AD2B417BE66C3710:23304B7A39F9F3FF067D8D8F9E24ECC7 # For all CBC encrypts and decrypts, the transformed sequence is # AES-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-AES128.Encrypt and CBC-AES128.Decrypt +# CBC-AES128.Encrypt and CBC-AES128.Decrypt AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:7649ABAC8119B246CEE98E9B12E9197D AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:7649ABAC8119B246CEE98E9B12E9197D:AE2D8A571E03AC9C9EB76FAC45AF8E51:5086CB9B507219EE95DB113A917678B2 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:5086CB9B507219EE95DB113A917678B2:30C81C46A35CE411E5FBC1191A0A52EF:73BED6B8E3C1743B7116E69E22229516 AES-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:73BED6B8E3C1743B7116E69E22229516:F69F2445DF4F9B17AD2B417BE66C3710:3FF1CAA1681FAC09120ECA307586E1A7 -# CBC-AES192.Encrypt and CBC-AES192.Decrypt +# CBC-AES192.Encrypt and CBC-AES192.Decrypt AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:4F021DB243BC633D7178183A9FA071E8 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:4F021DB243BC633D7178183A9FA071E8:AE2D8A571E03AC9C9EB76FAC45AF8E51:B4D9ADA9AD7DEDF4E5E738763F69145A AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:B4D9ADA9AD7DEDF4E5E738763F69145A:30C81C46A35CE411E5FBC1191A0A52EF:571B242012FB7AE07FA9BAAC3DF102E0 AES-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:571B242012FB7AE07FA9BAAC3DF102E0:F69F2445DF4F9B17AD2B417BE66C3710:08B0E27988598881D920A9E64F5615CD -# CBC-AES256.Encrypt and CBC-AES256.Decrypt +# CBC-AES256.Encrypt and CBC-AES256.Decrypt AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:F58C4C04D6E5F1BA779EABFB5F7BFBD6 AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:F58C4C04D6E5F1BA779EABFB5F7BFBD6:AE2D8A571E03AC9C9EB76FAC45AF8E51:9CFC4E967EDB808D679F777BC6702C7D AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:9CFC4E967EDB808D679F777BC6702C7D:30C81C46A35CE411E5FBC1191A0A52EF:39F23369A9D9BACFA530E26304231461 @@ -96,12 +96,12 @@ AES-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39F # We don't support CFB{1,8}-AESxxx.{En,De}crypt # For all CFB128 encrypts and decrypts, the transformed sequence is # AES-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-AES128.Encrypt +# CFB128-AES128.Encrypt AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:1 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:26751F67A3CBB140B1808CF187A4F4DF:F69F2445DF4F9B17AD2B417BE66C3710:C04B05357C5D1C0EEAC4C66F9FF7F2E6:1 -# CFB128-AES128.Decrypt +# CFB128-AES128.Decrypt AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:3B3FD92EB72DAD20333449F8E83CFB4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:C8A64537A0B3A93FCDE3CDAD9F1CE58B:0 AES-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:C8A64537A0B3A93FCDE3CDAD9F1CE58B:30C81C46A35CE411E5FBC1191A0A52EF:26751F67A3CBB140B1808CF187A4F4DF:0 @@ -116,44 +116,44 @@ AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:0001020304050607080 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:CDC80D6FDDF18CAB34C25909C99A4174:AE2D8A571E03AC9C9EB76FAC45AF8E51:67CE7F7F81173621961A2B70171D3D7A:0 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:67CE7F7F81173621961A2B70171D3D7A:30C81C46A35CE411E5FBC1191A0A52EF:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:0 AES-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2E1E8A1DD59B88B1C8E60FED1EFAC4C9:F69F2445DF4F9B17AD2B417BE66C3710:C05F9F9CA9834FA042AE8FBA584B09FF:0 -# CFB128-AES256.Encrypt +# CFB128-AES256.Encrypt AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:1 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:1 -# CFB128-AES256.Decrypt +# CFB128-AES256.Decrypt AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DC7E84BFDA79164B7ECD8486985D3860:AE2D8A571E03AC9C9EB76FAC45AF8E51:39FFED143B28B1C832113C6331E5407B:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:39FFED143B28B1C832113C6331E5407B:30C81C46A35CE411E5FBC1191A0A52EF:DF10132415E54B92A13ED0A8267AE2F9:0 AES-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:DF10132415E54B92A13ED0A8267AE2F9:F69F2445DF4F9B17AD2B417BE66C3710:75A385741AB9CEF82031623D55B1E471:0 # For all OFB encrypts and decrypts, the transformed sequence is # AES-bits-CFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-AES128.Encrypt -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 -AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 -# OFB-AES128.Decrypt +# OFB-AES128.Encrypt +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:1 +AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:1 +# OFB-AES128.Decrypt AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:3B3FD92EB72DAD20333449F8E83CFB4A:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:7789508D16918F03F53C52DAC54ED825:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:9740051E9C5FECF64344F7A82260EDCC:0 AES-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:304C6528F659C77866A510D9C1D6AE5E:0 -# OFB-AES192.Encrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 -# OFB-AES192.Decrypt -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 -AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 -# OFB-AES256.Encrypt +# OFB-AES192.Encrypt +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:1 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:1 +# OFB-AES192.Decrypt +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CDC80D6FDDF18CAB34C25909C99A4174:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:FCC28B8D4C63837C09E81700C1100401:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:8D9A9AEAC0F6596F559C6D4DAF59A5F2:0 +AES-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:6D9F200857CA6C3E9CAC524BD9ACC92A:0 +# OFB-AES256.Encrypt AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:1 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0126141D67F37BE8538F5A8BE740E484:1 -# OFB-AES256.Decrypt +# OFB-AES256.Decrypt AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:DC7E84BFDA79164B7ECD8486985D3860:0 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:4FEBDC6740D20B3AC88F6AD82A4FB08D:0 AES-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:71AB47A086E86EEDF39D1C5BBA97C408:0 @@ -209,19 +209,19 @@ CAMELLIA-128-ECB:000102030405060708090A0B0C0D0E0F::00112233445566778899AABBCCDDE CAMELLIA-192-ECB:000102030405060708090A0B0C0D0E0F1011121314151617::00112233445566778899AABBCCDDEEFF:B22F3C36B72D31329EEE8ADDC2906C68:1 CAMELLIA-256-ECB:000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F::00112233445566778899AABBCCDDEEFF:2EDF1F3418D53B88841FC8985FB1ECF2:1 -# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt +# ECB-CAMELLIA128.Encrypt and ECB-CAMELLIA128.Decrypt CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::6BC1BEE22E409F96E93D7E117393172A:432FC5DCD628115B7C388D770B270C96 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::AE2D8A571E03AC9C9EB76FAC45AF8E51:0BE1F14023782A22E8384C5ABB7FAB2B CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::30C81C46A35CE411E5FBC1191A0A52EF:A0A1ABCD1893AB6FE0FE5B65DF5F8636 CAMELLIA-128-ECB:2B7E151628AED2A6ABF7158809CF4F3C::F69F2445DF4F9B17AD2B417BE66C3710:E61925E0D5DFAA9BB29F815B3076E51A -# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt +# ECB-CAMELLIA192.Encrypt and ECB-CAMELLIA192.Decrypt CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::6BC1BEE22E409F96E93D7E117393172A:CCCC6C4E138B45848514D48D0D3439D3 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::AE2D8A571E03AC9C9EB76FAC45AF8E51:5713C62C14B2EC0F8393B6AFD6F5785A CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::30C81C46A35CE411E5FBC1191A0A52EF:B40ED2B60EB54D09D030CF511FEEF366 CAMELLIA-192-ECB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B::F69F2445DF4F9B17AD2B417BE66C3710:909DBD95799096748CB27357E73E1D26 -# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt +# ECB-CAMELLIA256.Encrypt and ECB-CAMELLIA256.Decrypt CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::6BC1BEE22E409F96E93D7E117393172A:BEFD219B112FA00098919CD101C9CCFA CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::AE2D8A571E03AC9C9EB76FAC45AF8E51:C91D3A8F1AEA08A9386CF4B66C0169EA CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4::30C81C46A35CE411E5FBC1191A0A52EF:A623D711DC5F25A51BB8A80D56397D28 @@ -229,19 +229,19 @@ CAMELLIA-256-ECB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF # For all CBC encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-CBC:key:IV/ciphertext':plaintext:ciphertext:encdec -# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt +# CBC-CAMELLIA128.Encrypt and CBC-CAMELLIA128.Decrypt CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:1607CF494B36BBF00DAEB0B503C831AB CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:1607CF494B36BBF00DAEB0B503C831AB:AE2D8A571E03AC9C9EB76FAC45AF8E51:A2F2CF671629EF7840C5A5DFB5074887 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:A2F2CF671629EF7840C5A5DFB5074887:30C81C46A35CE411E5FBC1191A0A52EF:0F06165008CF8B8B5A63586362543E54 CAMELLIA-128-CBC:2B7E151628AED2A6ABF7158809CF4F3C:36A84CDAFD5F9A85ADA0F0A993D6D577:F69F2445DF4F9B17AD2B417BE66C3710:74C64268CDB8B8FAF5B34E8AF3732980 -# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt +# CBC-CAMELLIA192.Encrypt and CBC-CAMELLIA192.Decrypt CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:2A4830AB5AC4A1A2405955FD2195CF93 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:2A4830AB5AC4A1A2405955FD2195CF93:AE2D8A571E03AC9C9EB76FAC45AF8E51:5D5A869BD14CE54264F892A6DD2EC3D5 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:5D5A869BD14CE54264F892A6DD2EC3D5:30C81C46A35CE411E5FBC1191A0A52EF:37D359C3349836D884E310ADDF68C449 CAMELLIA-192-CBC:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:37D359C3349836D884E310ADDF68C449:F69F2445DF4F9B17AD2B417BE66C3710:01FAAA930B4AB9916E9668E1428C6B08 -# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt +# CBC-CAMELLIA256.Encrypt and CBC-CAMELLIA256.Decrypt CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:E6CFA35FC02B134A4D2C0B6737AC3EDA CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E6CFA35FC02B134A4D2C0B6737AC3EDA:AE2D8A571E03AC9C9EB76FAC45AF8E51:36CBEB73BD504B4070B1B7DE2B21EB50 CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:36CBEB73BD504B4070B1B7DE2B21EB50:30C81C46A35CE411E5FBC1191A0A52EF:E31A6055297D96CA3330CDF1B1860A83 @@ -250,13 +250,13 @@ CAMELLIA-256-CBC:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF # We don't support CFB{1,8}-CAMELLIAxxx.{En,De}crypt # For all CFB128 encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-CFB:key:IV/ciphertext':plaintext:ciphertext:encdec -# CFB128-CAMELLIA128.Encrypt +# CFB128-CAMELLIA128.Encrypt CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:1 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:9C2157A664626D1DEF9EA420FDE69B96:F69F2445DF4F9B17AD2B417BE66C3710:742A25F0542340C7BAEF24CA8482BB09:1 -# CFB128-CAMELLIA128.Decrypt +# CFB128-CAMELLIA128.Decrypt CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:14F7646187817EB586599146B82BD719:AE2D8A571E03AC9C9EB76FAC45AF8E51:A53D28BB82DF741103EA4F921A44880B:0 CAMELLIA-128-CFB:2B7E151628AED2A6ABF7158809CF4F3C:A53D28BB82DF741103EA4F921A44880B:30C81C46A35CE411E5FBC1191A0A52EF:9C2157A664626D1DEF9EA420FDE69B96:0 @@ -274,13 +274,13 @@ CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:C832BB9780677D CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:86F8491627906D780C7A6D46EA331F98:30C81C46A35CE411E5FBC1191A0A52EF:69511CCE594CF710CB98BB63D7221F01:0 CAMELLIA-192-CFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:69511CCE594CF710CB98BB63D7221F01:F69F2445DF4F9B17AD2B417BE66C3710:D5B5378A3ABED55803F25565D8907B84:0 -# CFB128-CAMELLIA256.Encrypt +# CFB128-CAMELLIA256.Encrypt CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:1 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:555FC3F34BDD2D54C62D9E3BF338C1C4:F69F2445DF4F9B17AD2B417BE66C3710:5953ADCE14DB8C7F39F1BD39F359BFFA:1 -# CFB128-CAMELLIA256.Decrypt +# CFB128-CAMELLIA256.Decrypt CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:CF6107BB0CEA7D7FB1BD31F5E7B06C93:AE2D8A571E03AC9C9EB76FAC45AF8E51:89BEDB4CCDD864EA11BA4CBE849B5E2B:0 CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:89BEDB4CCDD864EA11BA4CBE849B5E2B:30C81C46A35CE411E5FBC1191A0A52EF:555FC3F34BDD2D54C62D9E3BF338C1C4:0 @@ -288,37 +288,37 @@ CAMELLIA-256-CFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF # For all OFB encrypts and decrypts, the transformed sequence is # CAMELLIA-bits-OFB:key:IV/output':plaintext:ciphertext:encdec -# OFB-CAMELLIA128.Encrypt +# OFB-CAMELLIA128.Encrypt CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:1 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:1 -# OFB-CAMELLIA128.Decrypt +# OFB-CAMELLIA128.Decrypt CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:14F7646187817EB586599146B82BD719:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:50FE67CC996D32B6DA0937E99BAFEC60:AE2D8A571E03AC9C9EB76FAC45AF8E51:25623DB569CA51E01482649977E28D84:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:D9A4DADA0892239F6B8B3D7680E15674:30C81C46A35CE411E5FBC1191A0A52EF:C776634A60729DC657D12B9FCA801E98:0 CAMELLIA-128-OFB:2B7E151628AED2A6ABF7158809CF4F3C:A78819583F0308E7A6BF36B1386ABF23:F69F2445DF4F9B17AD2B417BE66C3710:D776379BE0E50825E681DA1A4C980E8E:0 -# OFB-CAMELLIA192.Encrypt +# OFB-CAMELLIA192.Encrypt CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:1 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:1 -# OFB-CAMELLIA192.Decrypt +# OFB-CAMELLIA192.Decrypt CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:C832BB9780677DAA82D9B6860DCD565E:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:A609B38DF3B1133DDDFF2718BA09565E:AE2D8A571E03AC9C9EB76FAC45AF8E51:8ECEB7D0350D72C7F78562AEBDF99339:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:52EF01DA52602FE0975F78AC84BF8A50:30C81C46A35CE411E5FBC1191A0A52EF:BDD62DBBB9700846C53B507F544696F0:0 CAMELLIA-192-OFB:8E73B0F7DA0E6452C810F32B809079E562F8EAD2522C6B7B:BD5286AC63AABD7EB067AC54B553F71D:F69F2445DF4F9B17AD2B417BE66C3710:E28014E046B802F385C4C2E13EAD4A72:0 -# OFB-CAMELLIA256.Encrypt +# OFB-CAMELLIA256.Encrypt CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:1 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:41635BE625B48AFC1666DD42A09D96E7:F69F2445DF4F9B17AD2B417BE66C3710:0A4A0404E26AA78A27CB271E8BF3CF20:1 -# OFB-CAMELLIA256.Decrypt +# OFB-CAMELLIA256.Decrypt CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:000102030405060708090A0B0C0D0E0F:6BC1BEE22E409F96E93D7E117393172A:CF6107BB0CEA7D7FB1BD31F5E7B06C93:0 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:B7BF3A5DF43989DD97F0FA97EBCE2F4A:AE2D8A571E03AC9C9EB76FAC45AF8E51:127AD97E8E3994E4820027D7BA109368:0 CAMELLIA-256-OFB:603DEB1015CA71BE2B73AEF0857D77811F352C073B6108D72D9810A30914DFF4:E1C656305ED1A7A6563805746FE03EDC:30C81C46A35CE411E5FBC1191A0A52EF:6BFF6265A6A6B7A535BC65A80B17214E:0 diff --git a/deps/openssl/openssl/test/maketests.com b/deps/openssl/openssl/test/maketests.com index 7e2d939bbea631..6223659fb0d292 100644 --- a/deps/openssl/openssl/test/maketests.com +++ b/deps/openssl/openssl/test/maketests.com @@ -147,9 +147,10 @@ $ TEST_FILES = "BNTEST,ECTEST,ECDSATEST,ECDHTEST,IDEATEST,"+ - "MDC2TEST,RMDTEST,"+ - "RANDTEST,DHTEST,ENGINETEST,"+ - "BFTEST,CASTTEST,SSLTEST,EXPTEST,DSATEST,RSA_TEST,"+ - - "EVP_TEST,IGETEST,JPAKETEST,SRPTEST,"+ - + "EVP_TEST,EVP_EXTRA_TEST,IGETEST,JPAKETEST,SRPTEST,"+ - "ASN1TEST,V3NAMETEST,HEARTBEAT_TEST,"+ - - "CONSTANT_TIME_TEST" + "CONSTANT_TIME_TEST,VERIFY_EXTRA_TEST,"+ - + "CLIENTHELLOTEST,SSLV2CONFTEST,DTLSTEST" $! Should we add MTTEST,PQ_TEST,LH_TEST,DIVTEST,TABTEST as well? $! $! Additional directory information. @@ -183,6 +184,7 @@ $ T_D_EXPTEST := [-.crypto.bn] $ T_D_DSATEST := [-.crypto.dsa] $ T_D_RSA_TEST := [-.crypto.rsa] $ T_D_EVP_TEST := [-.crypto.evp] +$ T_D_EVP_EXTRA_TEST := [-.crypto.evp] $ T_D_IGETEST := [-.test] $ T_D_JPAKETEST := [-.crypto.jpake] $ T_D_SRPTEST := [-.crypto.srp] @@ -190,6 +192,12 @@ $ T_D_V3NAMETEST := [-.crypto.x509v3] $ T_D_ASN1TEST := [-.test] $ T_D_HEARTBEAT_TEST := [-.ssl] $ T_D_CONSTANT_TIME_TEST := [-.crypto] +$ T_D_VERIFY_EXTRA_TEST := [-.crypto.x509] +$ T_D_CLIENTHELLOTEST := [-.ssl] +$ T_D_SSLV2CONFTEST := [-.ssl] +$ T_D_DTLSTEST := [-.ssl] +$ +$ EXOBJ_DTLSTEST := SSLTESTLIB $! $ TCPIP_PROGRAMS = ",," $ IF COMPILER .EQS. "VAXC" THEN - @@ -222,10 +230,21 @@ $! $! Create The Object File Name. $! $ OBJECT_FILE = OBJ_DIR + FILE_NAME + ".OBJ" +$ OBJECT_FILES = OBJECT_FILE $! $! Create The Executable File Name. $! $ EXE_FILE = EXE_DIR + FILE_NAME + ".EXE" +$! +$! Do the same for the possible extra unit +$! +$ IF F$TYPE(EXOBJ_'FILE_NAME') .NES. "" +$ THEN +$ EXOBJ_SOURCE_FILE = "SYS$DISK:" + EXOBJ_'FILE_NAME' + ".C" +$ EXOBJ_OBJECT_FILE = OBJ_DIR + EXOBJ_'FILE_NAME' + ".OBJ" +$ OBJECT_FILES = OBJECT_FILES + "," + EXOBJ_OBJECT_FILE +$ ENDIF +$! $ ON WARNING THEN GOTO NEXT_FILE $! $! Check To See If The File We Want To Compile Actually Exists. @@ -252,6 +271,10 @@ $! Compile The File. $! $ ON ERROR THEN GOTO NEXT_FILE $ CC /OBJECT='OBJECT_FILE' 'SOURCE_FILE' +$ IF F$TYPE(EXOBJ_'FILE_NAME') .NES. "" +$ THEN +$ CC /OBJECT='EXOBJ_OBJECT_FILE' 'EXOBJ_SOURCE_FILE' +$ ENDIF $ ON WARNING THEN GOTO NEXT_FILE $! $! Check If What We Are About To Compile Works Without A TCP/IP Library. @@ -275,7 +298,7 @@ $! $! Don't Link With The RSAREF Routines And TCP/IP Library. $! $ LINK /'DEBUGGER' /'LINKMAP' /'TRACEBACK' /EXECTABLE = 'EXE_FILE' - - 'OBJECT_FILE', - + 'OBJECT_FILES', - 'SSL_LIB' /LIBRARY, - 'CRYPTO_LIB' /LIBRARY - 'TCPIP_LIB' - @@ -475,7 +498,7 @@ $ CHECK_OPTIONS: $! $! Set basic C compiler /INCLUDE directories. $! -$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO]" +$ CC_INCLUDES = "SYS$DISK:[-],SYS$DISK:[-.CRYPTO],SYS$DISK:[-.TEST]" $! $! Check To See If P1 Is Blank. $! diff --git a/deps/openssl/openssl/test/ssltestlib.c b/deps/openssl/openssl/test/ssltestlib.c new file mode 100644 index 00000000000000..a52669c82a6a64 --- /dev/null +++ b/deps/openssl/openssl/test/ssltestlib.c @@ -0,0 +1,687 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#include +#include + +#include "ssltestlib.h" + +#define SSL_IS_DTLS(s) (s->method->version == DTLS_ANY_VERSION \ + || s->method->version == DTLS1_2_VERSION \ + || s->method->version == DTLS1_VERSION) + +static int tls_dump_new(BIO *bi); +static int tls_dump_free(BIO *a); +static int tls_dump_read(BIO *b, char *out, int outl); +static int tls_dump_write(BIO *b, const char *in, int inl); +static long tls_dump_ctrl(BIO *b, int cmd, long num, void *ptr); +static int tls_dump_gets(BIO *bp, char *buf, int size); +static int tls_dump_puts(BIO *bp, const char *str); + +/* Choose a sufficiently large type likely to be unused for this custom BIO */ +# define BIO_TYPE_TLS_DUMP_FILTER (0x80 | BIO_TYPE_FILTER) + +# define BIO_TYPE_MEMPACKET_TEST 0x81 + +static BIO_METHOD method_tls_dump = { + BIO_TYPE_TLS_DUMP_FILTER, + "TLS dump filter", + tls_dump_write, + tls_dump_read, + tls_dump_puts, + tls_dump_gets, + tls_dump_ctrl, + tls_dump_new, + tls_dump_free +}; + +BIO_METHOD *bio_f_tls_dump_filter(void) +{ + return &method_tls_dump; +} + +static int tls_dump_new(BIO *bio) +{ + bio->init = 1; + return 1; +} + +static int tls_dump_free(BIO *bio) +{ + bio->init = 0; + + return 1; +} + +static void copy_flags(BIO *bio) +{ + int flags; + BIO *next = BIO_next(bio); + + flags = BIO_test_flags(next, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS); + BIO_clear_flags(bio, BIO_FLAGS_SHOULD_RETRY | BIO_FLAGS_RWS); + BIO_set_flags(bio, flags); +} + +#define RECORD_CONTENT_TYPE 0 +#define RECORD_VERSION_HI 1 +#define RECORD_VERSION_LO 2 +#define RECORD_EPOCH_HI 3 +#define RECORD_EPOCH_LO 4 +#define RECORD_SEQUENCE_START 5 +#define RECORD_SEQUENCE_END 10 +#define RECORD_LEN_HI 11 +#define RECORD_LEN_LO 12 + +#define MSG_TYPE 0 +#define MSG_LEN_HI 1 +#define MSG_LEN_MID 2 +#define MSG_LEN_LO 3 +#define MSG_SEQ_HI 4 +#define MSG_SEQ_LO 5 +#define MSG_FRAG_OFF_HI 6 +#define MSG_FRAG_OFF_MID 7 +#define MSG_FRAG_OFF_LO 8 +#define MSG_FRAG_LEN_HI 9 +#define MSG_FRAG_LEN_MID 10 +#define MSG_FRAG_LEN_LO 11 + + +static void dump_data(const char *data, int len) +{ + int rem, i, content, reclen, msglen, fragoff, fraglen, epoch; + unsigned char *rec; + + printf("---- START OF PACKET ----\n"); + + rem = len; + rec = (unsigned char *)data; + + while (rem > 0) { + if (rem != len) + printf("*\n"); + printf("*---- START OF RECORD ----\n"); + if (rem < DTLS1_RT_HEADER_LENGTH) { + printf("*---- RECORD TRUNCATED ----\n"); + break; + } + content = rec[RECORD_CONTENT_TYPE]; + printf("** Record Content-type: %d\n", content); + printf("** Record Version: %02x%02x\n", + rec[RECORD_VERSION_HI], rec[RECORD_VERSION_LO]); + epoch = (rec[RECORD_EPOCH_HI] << 8) | rec[RECORD_EPOCH_LO]; + printf("** Record Epoch: %d\n", epoch); + printf("** Record Sequence: "); + for (i = RECORD_SEQUENCE_START; i <= RECORD_SEQUENCE_END; i++) + printf("%02x", rec[i]); + reclen = (rec[RECORD_LEN_HI] << 8) | rec[RECORD_LEN_LO]; + printf("\n** Record Length: %d\n", reclen); + + /* Now look at message */ + rec += DTLS1_RT_HEADER_LENGTH; + rem -= DTLS1_RT_HEADER_LENGTH; + if (content == SSL3_RT_HANDSHAKE) { + printf("**---- START OF HANDSHAKE MESSAGE FRAGMENT ----\n"); + if (epoch > 0) { + printf("**---- HANDSHAKE MESSAGE FRAGMENT ENCRYPTED ----\n"); + } else if (rem < DTLS1_HM_HEADER_LENGTH + || reclen < DTLS1_HM_HEADER_LENGTH) { + printf("**---- HANDSHAKE MESSAGE FRAGMENT TRUNCATED ----\n"); + } else { + printf("*** Message Type: %d\n", rec[MSG_TYPE]); + msglen = (rec[MSG_LEN_HI] << 16) | (rec[MSG_LEN_MID] << 8) + | rec[MSG_LEN_LO]; + printf("*** Message Length: %d\n", msglen); + printf("*** Message sequence: %d\n", + (rec[MSG_SEQ_HI] << 8) | rec[MSG_SEQ_LO]); + fragoff = (rec[MSG_FRAG_OFF_HI] << 16) + | (rec[MSG_FRAG_OFF_MID] << 8) + | rec[MSG_FRAG_OFF_LO]; + printf("*** Message Fragment offset: %d\n", fragoff); + fraglen = (rec[MSG_FRAG_LEN_HI] << 16) + | (rec[MSG_FRAG_LEN_MID] << 8) + | rec[MSG_FRAG_LEN_LO]; + printf("*** Message Fragment len: %d\n", fraglen); + if (fragoff + fraglen > msglen) + printf("***---- HANDSHAKE MESSAGE FRAGMENT INVALID ----\n"); + else if(reclen < fraglen) + printf("**---- HANDSHAKE MESSAGE FRAGMENT TRUNCATED ----\n"); + else + printf("**---- END OF HANDSHAKE MESSAGE FRAGMENT ----\n"); + } + } + if (rem < reclen) { + printf("*---- RECORD TRUNCATED ----\n"); + rem = 0; + } else { + rec += reclen; + rem -= reclen; + printf("*---- END OF RECORD ----\n"); + } + } + printf("---- END OF PACKET ----\n\n"); + fflush(stdout); +} + +static int tls_dump_read(BIO *bio, char *out, int outl) +{ + int ret; + BIO *next = BIO_next(bio); + + ret = BIO_read(next, out, outl); + copy_flags(bio); + + if (ret > 0) { + dump_data(out, ret); + } + + return ret; +} + +static int tls_dump_write(BIO *bio, const char *in, int inl) +{ + int ret; + BIO *next = BIO_next(bio); + + ret = BIO_write(next, in, inl); + copy_flags(bio); + + return ret; +} + +static long tls_dump_ctrl(BIO *bio, int cmd, long num, void *ptr) +{ + long ret; + BIO *next = BIO_next(bio); + + if (next == NULL) + return 0; + + switch (cmd) { + case BIO_CTRL_DUP: + ret = 0L; + break; + default: + ret = BIO_ctrl(next, cmd, num, ptr); + break; + } + return ret; +} + +static int tls_dump_gets(BIO *bio, char *buf, int size) +{ + /* We don't support this - not needed anyway */ + return -1; +} + +static int tls_dump_puts(BIO *bio, const char *str) +{ + return tls_dump_write(bio, str, strlen(str)); +} + + +typedef struct mempacket_st { + unsigned char *data; + int len; + unsigned int num; + unsigned int type; +} MEMPACKET; + +/* + * These defines would normally be auto-generated and in safestack.h...but this + * is just for tests so its probably not an appropriate place + */ +# define sk_MEMPACKET_new(cmp) SKM_sk_new(MEMPACKET, (cmp)) +# define sk_MEMPACKET_new_null() SKM_sk_new_null(MEMPACKET) +# define sk_MEMPACKET_free(st) SKM_sk_free(MEMPACKET, (st)) +# define sk_MEMPACKET_num(st) SKM_sk_num(MEMPACKET, (st)) +# define sk_MEMPACKET_value(st, i) SKM_sk_value(MEMPACKET, (st), (i)) +# define sk_MEMPACKET_set(st, i, val) SKM_sk_set(MEMPACKET, (st), (i), (val)) +# define sk_MEMPACKET_zero(st) SKM_sk_zero(MEMPACKET, (st)) +# define sk_MEMPACKET_push(st, val) SKM_sk_push(MEMPACKET, (st), (val)) +# define sk_MEMPACKET_unshift(st, val) SKM_sk_unshift(MEMPACKET, (st), (val)) +# define sk_MEMPACKET_find(st, val) SKM_sk_find(MEMPACKET, (st), (val)) +# define sk_MEMPACKET_find_ex(st, val) SKM_sk_find_ex(MEMPACKET, (st), (val)) +# define sk_MEMPACKET_delete(st, i) SKM_sk_delete(MEMPACKET, (st), (i)) +# define sk_MEMPACKET_delete_ptr(st, ptr) SKM_sk_delete_ptr(MEMPACKET, (st), (ptr)) +# define sk_MEMPACKET_insert(st, val, i) SKM_sk_insert(MEMPACKET, (st), (val), (i)) +# define sk_MEMPACKET_set_cmp_func(st, cmp) SKM_sk_set_cmp_func(MEMPACKET, (st), (cmp)) +# define sk_MEMPACKET_dup(st) SKM_sk_dup(MEMPACKET, st) +# define sk_MEMPACKET_pop_free(st, free_func) SKM_sk_pop_free(MEMPACKET, (st), (free_func)) +# define sk_MEMPACKET_deep_copy(st, copy_func, free_func) SKM_sk_deep_copy(MEMPACKET, (st), (copy_func), (free_func)) +# define sk_MEMPACKET_shift(st) SKM_sk_shift(MEMPACKET, (st)) +# define sk_MEMPACKET_pop(st) SKM_sk_pop(MEMPACKET, (st)) +# define sk_MEMPACKET_sort(st) SKM_sk_sort(MEMPACKET, (st)) +# define sk_MEMPACKET_is_sorted(st) SKM_sk_is_sorted(MEMPACKET, (st)) + +static void mempacket_free(MEMPACKET *pkt) +{ + if (pkt->data != NULL) + OPENSSL_free(pkt->data); + OPENSSL_free(pkt); +} + +typedef struct mempacket_test_ctx_st { + STACK_OF(MEMPACKET) *pkts; + unsigned int epoch; + unsigned int currrec; + unsigned int currpkt; + unsigned int lastpkt; + unsigned int noinject; +} MEMPACKET_TEST_CTX; + +static int mempacket_test_new(BIO *bi); +static int mempacket_test_free(BIO *a); +static int mempacket_test_read(BIO *b, char *out, int outl); +static int mempacket_test_write(BIO *b, const char *in, int inl); +static long mempacket_test_ctrl(BIO *b, int cmd, long num, void *ptr); +static int mempacket_test_gets(BIO *bp, char *buf, int size); +static int mempacket_test_puts(BIO *bp, const char *str); + +static BIO_METHOD method_mempacket_test = { + BIO_TYPE_MEMPACKET_TEST, + "Mem Packet Test", + mempacket_test_write, + mempacket_test_read, + mempacket_test_puts, + mempacket_test_gets, + mempacket_test_ctrl, + mempacket_test_new, + mempacket_test_free +}; + +BIO_METHOD *bio_s_mempacket_test(void) +{ + return &method_mempacket_test; +} + +static int mempacket_test_new(BIO *bio) +{ + MEMPACKET_TEST_CTX *ctx = OPENSSL_malloc(sizeof(*ctx)); + if (ctx == NULL) + return 0; + memset(ctx, 0, sizeof(*ctx)); + + ctx->pkts = sk_MEMPACKET_new_null(); + if (ctx->pkts == NULL) { + OPENSSL_free(ctx); + return 0; + } + bio->init = 1; + bio->ptr = ctx; + return 1; +} + +static int mempacket_test_free(BIO *bio) +{ + MEMPACKET_TEST_CTX *ctx = bio->ptr; + + sk_MEMPACKET_pop_free(ctx->pkts, mempacket_free); + OPENSSL_free(ctx); + bio->ptr = NULL; + bio->init = 0; + + return 1; +} + +/* Record Header values */ +#define EPOCH_HI 4 +#define EPOCH_LO 5 +#define RECORD_SEQUENCE 10 +#define RECORD_LEN_HI 11 +#define RECORD_LEN_LO 12 + +#define STANDARD_PACKET 0 + +static int mempacket_test_read(BIO *bio, char *out, int outl) +{ + MEMPACKET_TEST_CTX *ctx = bio->ptr; + MEMPACKET *thispkt; + unsigned char *rec; + int rem; + unsigned int seq, offset, len, epoch; + + BIO_clear_retry_flags(bio); + + thispkt = sk_MEMPACKET_value(ctx->pkts, 0); + if (thispkt == NULL || thispkt->num != ctx->currpkt) { + /* Probably run out of data */ + BIO_set_retry_read(bio); + return -1; + } + (void)sk_MEMPACKET_shift(ctx->pkts); + ctx->currpkt++; + + if (outl > thispkt->len) + outl = thispkt->len; + + if (thispkt->type != INJECT_PACKET_IGNORE_REC_SEQ) { + /* + * Overwrite the record sequence number. We strictly number them in + * the order received. Since we are actually a reliable transport + * we know that there won't be any re-ordering. We overwrite to deal + * with any packets that have been injected + */ + rem = thispkt->len; + rec = thispkt->data; + while (rem > 0) { + if (rem < DTLS1_RT_HEADER_LENGTH) { + return -1; + } + epoch = (rec[EPOCH_HI] << 8) | rec[EPOCH_LO]; + if (epoch != ctx->epoch) { + ctx->epoch = epoch; + ctx->currrec = 0; + } + seq = ctx->currrec; + offset = 0; + do { + rec[RECORD_SEQUENCE - offset] = seq & 0xFF; + seq >>= 8; + offset++; + } while (seq > 0); + ctx->currrec++; + + len = ((rec[RECORD_LEN_HI] << 8) | rec[RECORD_LEN_LO]) + + DTLS1_RT_HEADER_LENGTH; + + rec += len; + rem -= len; + } + } + + memcpy(out, thispkt->data, outl); + + mempacket_free(thispkt); + + return outl; +} + +int mempacket_test_inject(BIO *bio, const char *in, int inl, int pktnum, + int type) +{ + MEMPACKET_TEST_CTX *ctx = bio->ptr; + MEMPACKET *thispkt, *looppkt, *nextpkt; + int i; + + if (ctx == NULL) + return -1; + + /* We only allow injection before we've started writing any data */ + if (pktnum >= 0) { + if (ctx->noinject) + return -1; + } else { + ctx->noinject = 1; + } + + thispkt = OPENSSL_malloc(sizeof(MEMPACKET)); + if (thispkt == NULL) + return -1; + + thispkt->data = OPENSSL_malloc(inl); + if (thispkt->data == NULL) { + mempacket_free(thispkt); + return -1; + } + + memcpy(thispkt->data, in, inl); + thispkt->len = inl; + thispkt->num = (pktnum >= 0) ? (unsigned int)pktnum : ctx->lastpkt; + thispkt->type = type; + + for(i = 0; (looppkt = sk_MEMPACKET_value(ctx->pkts, i)) != NULL; i++) { + /* Check if we found the right place to insert this packet */ + if (looppkt->num > thispkt->num) { + if (sk_MEMPACKET_insert(ctx->pkts, thispkt, i) == 0) { + mempacket_free(thispkt); + return -1; + } + /* If we're doing up front injection then we're done */ + if (pktnum >= 0) + return inl; + /* + * We need to do some accounting on lastpkt. We increment it first, + * but it might now equal the value of injected packets, so we need + * to skip over those + */ + ctx->lastpkt++; + do { + i++; + nextpkt = sk_MEMPACKET_value(ctx->pkts, i); + if (nextpkt != NULL && nextpkt->num == ctx->lastpkt) + ctx->lastpkt++; + else + return inl; + } while(1); + } else if(looppkt->num == thispkt->num) { + if (!ctx->noinject) { + /* We injected two packets with the same packet number! */ + return -1; + } + ctx->lastpkt++; + thispkt->num++; + } + } + /* + * We didn't find any packets with a packet number equal to or greater than + * this one, so we just add it onto the end + */ + if (!sk_MEMPACKET_push(ctx->pkts, thispkt)) { + mempacket_free(thispkt); + return -1; + } + + if (pktnum < 0) + ctx->lastpkt++; + + return inl; +} + +static int mempacket_test_write(BIO *bio, const char *in, int inl) +{ + return mempacket_test_inject(bio, in, inl, -1, STANDARD_PACKET); +} + +static long mempacket_test_ctrl(BIO *bio, int cmd, long num, void *ptr) +{ + long ret = 1; + MEMPACKET_TEST_CTX *ctx = bio->ptr; + MEMPACKET *thispkt; + + switch (cmd) { + case BIO_CTRL_EOF: + ret = (long)(sk_MEMPACKET_num(ctx->pkts) == 0); + break; + case BIO_CTRL_GET_CLOSE: + ret = bio->shutdown; + break; + case BIO_CTRL_SET_CLOSE: + bio->shutdown = (int)num; + break; + case BIO_CTRL_WPENDING: + ret = 0L; + break; + case BIO_CTRL_PENDING: + thispkt = sk_MEMPACKET_value(ctx->pkts, 0); + if (thispkt == NULL) + ret = 0; + else + ret = thispkt->len; + break; + case BIO_CTRL_FLUSH: + ret = 1; + break; + case BIO_CTRL_RESET: + case BIO_CTRL_DUP: + case BIO_CTRL_PUSH: + case BIO_CTRL_POP: + default: + ret = 0; + break; + } + return ret; +} + +static int mempacket_test_gets(BIO *bio, char *buf, int size) +{ + /* We don't support this - not needed anyway */ + return -1; +} + +static int mempacket_test_puts(BIO *bio, const char *str) +{ + return mempacket_test_write(bio, str, strlen(str)); +} + +int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm, + SSL_CTX **sctx, SSL_CTX **cctx, char *certfile, + char *privkeyfile) +{ + SSL_CTX *serverctx = NULL; + SSL_CTX *clientctx = NULL; + + serverctx = SSL_CTX_new(sm); + clientctx = SSL_CTX_new(cm); + if (serverctx == NULL || clientctx == NULL) { + printf("Failed to create SSL_CTX\n"); + goto err; + } + + if (SSL_CTX_use_certificate_file(serverctx, certfile, + SSL_FILETYPE_PEM) <= 0) { + printf("Failed to load server certificate\n"); + goto err; + } + if (SSL_CTX_use_PrivateKey_file(serverctx, privkeyfile, + SSL_FILETYPE_PEM) <= 0) { + printf("Failed to load server private key\n"); + } + if (SSL_CTX_check_private_key(serverctx) <= 0) { + printf("Failed to check private key\n"); + goto err; + } + + *sctx = serverctx; + *cctx = clientctx; + + return 1; + err: + SSL_CTX_free(serverctx); + SSL_CTX_free(clientctx); + return 0; +} + +#define MAXLOOPS 100000 + +/* + * NOTE: Transfers control of the BIOs - this function will free them on error + */ +int create_ssl_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl, + SSL **cssl, BIO *s_to_c_fbio, BIO *c_to_s_fbio) +{ + SSL *serverssl, *clientssl; + BIO *s_to_c_bio = NULL, *c_to_s_bio = NULL; + + serverssl = SSL_new(serverctx); + clientssl = SSL_new(clientctx); + + if (serverssl == NULL || clientssl == NULL) { + printf("Failed to create SSL object\n"); + goto error; + } + + if (SSL_IS_DTLS(clientssl)) { + s_to_c_bio = BIO_new(bio_s_mempacket_test()); + c_to_s_bio = BIO_new(bio_s_mempacket_test());; + } else { + s_to_c_bio = BIO_new(BIO_s_mem()); + c_to_s_bio = BIO_new(BIO_s_mem()); + } + if (s_to_c_bio == NULL || c_to_s_bio == NULL) { + printf("Failed to create mem BIOs\n"); + goto error; + } + + if (s_to_c_fbio != NULL) + s_to_c_bio = BIO_push(s_to_c_fbio, s_to_c_bio); + if (c_to_s_fbio != NULL) + c_to_s_bio = BIO_push(c_to_s_fbio, c_to_s_bio); + if (s_to_c_bio == NULL || c_to_s_bio == NULL) { + printf("Failed to create chained BIOs\n"); + goto error; + } + + /* Set Non-blocking IO behaviour */ + BIO_set_mem_eof_return(s_to_c_bio, -1); + BIO_set_mem_eof_return(c_to_s_bio, -1); + + /* Up ref these as we are passing them to two SSL objects */ + CRYPTO_add(&s_to_c_bio->references, 1, CRYPTO_LOCK_BIO); + CRYPTO_add(&c_to_s_bio->references, 1, CRYPTO_LOCK_BIO); + + SSL_set_bio(serverssl, c_to_s_bio, s_to_c_bio); + SSL_set_bio(clientssl, s_to_c_bio, c_to_s_bio); + + /* BIOs will now be freed when SSL objects are freed */ + s_to_c_bio = c_to_s_bio = NULL; + s_to_c_fbio = c_to_s_fbio = NULL; + + *sssl = serverssl; + *cssl = clientssl; + + return 1; + + error: + SSL_free(serverssl); + SSL_free(clientssl); + BIO_free(s_to_c_bio); + BIO_free(c_to_s_bio); + BIO_free(s_to_c_fbio); + BIO_free(c_to_s_fbio); + + return 0; +} + +int create_ssl_connection(SSL *serverssl, SSL *clientssl) +{ + int retc = -1, rets = -1, err, abortctr = 0; + + do { + err = SSL_ERROR_WANT_WRITE; + while (retc <= 0 && err == SSL_ERROR_WANT_WRITE) { + retc = SSL_connect(clientssl); + if (retc <= 0) + err = SSL_get_error(clientssl, retc); + } + + if (retc <= 0 && err != SSL_ERROR_WANT_READ) { + printf("SSL_connect() failed %d, %d\n", retc, err); + return 0; + } + + err = SSL_ERROR_WANT_WRITE; + while (rets <= 0 && err == SSL_ERROR_WANT_WRITE) { + rets = SSL_accept(serverssl); + if (rets <= 0) + err = SSL_get_error(serverssl, rets); + } + + if (rets <= 0 && err != SSL_ERROR_WANT_READ) { + printf("SSL_accept() failed %d, %d\n", retc, err); + return 0; + } + if (++abortctr == MAXLOOPS) { + printf("No progress made\n"); + return 0; + } + } while (retc <=0 || rets <= 0); + + return 1; +} diff --git a/deps/openssl/openssl/test/ssltestlib.h b/deps/openssl/openssl/test/ssltestlib.h new file mode 100644 index 00000000000000..b23d8f4d102ae9 --- /dev/null +++ b/deps/openssl/openssl/test/ssltestlib.h @@ -0,0 +1,36 @@ +/* + * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. + * + * Licensed under the OpenSSL license (the "License"). You may not use + * this file except in compliance with the License. You can obtain a copy + * in the file LICENSE in the source distribution or at + * https://www.openssl.org/source/license.html + */ + +#ifndef HEADER_SSLTESTLIB_H +# define HEADER_SSLTESTLIB_H + +# include + +int create_ssl_ctx_pair(const SSL_METHOD *sm, const SSL_METHOD *cm, + SSL_CTX **sctx, SSL_CTX **cctx, char *certfile, + char *privkeyfile); +int create_ssl_objects(SSL_CTX *serverctx, SSL_CTX *clientctx, SSL **sssl, + SSL **cssl, BIO *s_to_c_fbio, BIO *c_to_s_fbio); +int create_ssl_connection(SSL *serverssl, SSL *clientssl); + +/* Note: Not thread safe! */ +BIO_METHOD *bio_f_tls_dump_filter(void); +void bio_f_tls_dump_filter_free(void); + +BIO_METHOD *bio_s_mempacket_test(void); +void bio_s_mempacket_test_free(void); + +/* Packet types - value 0 is reserved */ +#define INJECT_PACKET 1 +#define INJECT_PACKET_IGNORE_REC_SEQ 2 + +int mempacket_test_inject(BIO *bio, const char *in, int inl, int pktnum, + int type); + +#endif /* HEADER_SSLTESTLIB_H */ diff --git a/deps/openssl/openssl/test/tests.com b/deps/openssl/openssl/test/tests.com index 6e1c818e7ac4bc..59745e14c702cb 100644 --- a/deps/openssl/openssl/test/tests.com +++ b/deps/openssl/openssl/test/tests.com @@ -55,9 +55,9 @@ $ tests := - test_rand,test_bn,test_ec,test_ecdsa,test_ecdh,- test_enc,test_x509,test_rsa,test_crl,test_sid,- test_gen,test_req,test_pkcs7,test_verify,test_dh,test_dsa,- - test_ss,test_ca,test_engine,test_evp,test_ssl,test_tsa,test_ige,- + test_ss,test_ca,test_engine,test_evp,test_evp_extra,test_ssl,test_tsa,test_ige,- test_jpake,test_srp,test_cms,test_ocsp,test_v3name,test_heartbeat,- - test_constant_time + test_constant_time,test_verify_extra,test_clienthello,test_sslv2conftest,test_dtls $ endif $ tests = f$edit(tests,"COLLAPSE") $ @@ -92,6 +92,7 @@ $ SSLTEST := ssltest $ RSATEST := rsa_test $ ENGINETEST := enginetest $ EVPTEST := evp_test +$ EVPEXTRATEST := evp_extra_test $ IGETEST := igetest $ JPAKETEST := jpaketest $ SRPTEST := srptest @@ -99,6 +100,10 @@ $ V3NAMETEST := v3nametest $ ASN1TEST := asn1test $ HEARTBEATTEST := heartbeat_test $ CONSTTIMETEST := constant_time_test +$ VERIFYEXTRATEST := verify_extra_test +$ CLIENTHELLOTEST := clienthellotest +$ SSLV2CONFTEST := sslv2conftest +$ DTLSTEST := dtlstest $! $ tests_i = 0 $ loop_tests: @@ -112,6 +117,9 @@ $ $ test_evp: $ mcr 'texe_dir''evptest' 'ROOT'.CRYPTO.EVP]evptests.txt $ return +$ test_evp_extra: +$ mcr 'texe_dir''evpextratest' +$ return $ test_des: $ mcr 'texe_dir''destest' $ return @@ -386,7 +394,22 @@ $ test_constant_time: $ write sys$output "Test constant time utilities" $ mcr 'texe_dir''consttimetest' $ return -$ +$ test_verify_extra: +$ write sys$output "''START' test_verify_extra" +$ mcr 'texe_dir''verifyextratest' +$ return +$ test_clienthello: +$ write sys$output "''START' test_clienthello" +$ mcr 'texe_dir''clienthellotest' +$ return +$ test_sslv2conftest: +$ write sys$output "''START' test_sslv2conftest" +$ mcr 'texe_dir''sslv2conftest' +$ return +$ test_dtls: +$ write sys$output "''START' test_dtls" +$ mcr 'texe_dir''dtlstest' 'ROOT'.APPS]server.pem 'ROOT'.APPS]server.pem +$ return $ $ exit: $ on error then goto exit2 ! In case openssl.exe didn't build. diff --git a/deps/openssl/openssl/tools/c_rehash b/deps/openssl/openssl/tools/c_rehash index c0caf1c9ccd1f9..6a27c02245e917 100644 --- a/deps/openssl/openssl/tools/c_rehash +++ b/deps/openssl/openssl/tools/c_rehash @@ -61,7 +61,7 @@ if(! -x $openssl) { $found = 1; $openssl = "$_/$openssl"; last; - } + } } if($found == 0) { print STDERR "c_rehash: rehashing skipped ('openssl' program not available)\n"; @@ -207,3 +207,4 @@ sub link_hash_crl { } $hashlist{$hash} = $fprint; } + diff --git a/deps/openssl/openssl/util/mk1mf.pl b/deps/openssl/openssl/util/mk1mf.pl index 128a405efc353a..7a3ae11f7865fe 100755 --- a/deps/openssl/openssl/util/mk1mf.pl +++ b/deps/openssl/openssl/util/mk1mf.pl @@ -277,6 +277,7 @@ $cflags.=" -DOPENSSL_NO_SSL2" if $no_ssl2; $cflags.=" -DOPENSSL_NO_SSL3" if $no_ssl3; $cflags.=" -DOPENSSL_NO_TLSEXT" if $no_tlsext; +$cflags.=" -DOPENSSL_NO_TLS1" if $no_tls1; $cflags.=" -DOPENSSL_NO_SRP" if $no_srp; $cflags.=" -DOPENSSL_NO_CMS" if $no_cms; $cflags.=" -DOPENSSL_NO_ERR" if $no_err; @@ -692,8 +693,8 @@ $defs.=&do_defs("EXHEADER",$exheader,"\$(INCO_D)",""); $rules.=&do_copy_rule("\$(INCO_D)",$exheader,""); -$defs.=&do_defs("T_OBJ",$test,"\$(OBJ_D)",$obj); -$rules.=&do_compile_rule("\$(OBJ_D)",$test,"\$(APP_CFLAGS)"); +$defs.=&do_defs("T_OBJ","$test test${o}ssltestlib","\$(OBJ_D)",$obj); +$rules.=&do_compile_rule("\$(OBJ_D)","$test test${o}ssltestlib","\$(APP_CFLAGS)"); $defs.=&do_defs("E_OBJ",$e_exe,"\$(OBJ_D)",$obj); $rules.=&do_compile_rule("\$(OBJ_D)",$e_exe,'-DMONOLITH $(APP_CFLAGS)'); @@ -764,6 +765,7 @@ sub fix_asm { $t=&bname($_); $tt="\$(OBJ_D)${o}$t${obj}"; + $tt.=" \$(OBJ_D)${o}ssltestlib${obj}" if $t eq "dtlstest"; $rules.=&do_link_rule("\$(TEST_D)$o$t$exep",$tt,"\$(LIBS_DEP)","\$(L_LIBS) \$(EX_LIBS)"); } @@ -1204,6 +1206,7 @@ sub read_options "no-ssl3" => \$no_ssl3, "no-ssl3-method" => 0, "no-tlsext" => \$no_tlsext, + "no-tls1" => \$no_tls1, "no-srp" => \$no_srp, "no-cms" => \$no_cms, "no-jpake" => \$no_jpake, diff --git a/deps/openssl/openssl/util/mkerr.pl b/deps/openssl/openssl/util/mkerr.pl index 09ebebef9b52c4..c197f3a9546a00 100644 --- a/deps/openssl/openssl/util/mkerr.pl +++ b/deps/openssl/openssl/util/mkerr.pl @@ -158,8 +158,8 @@ while (($hdr, $lib) = each %libinc) { next if($hdr eq "NONE"); - print STDERR "Scanning header file $hdr\n" if $debug; - my $line = "", $def= "", $linenr = 0, $gotfile = 0; + print STDERR "Scanning header file $hdr\n" if $debug; + my $line = "", $def= "", $linenr = 0, $gotfile = 0, $cpp = 0; if (open(IN, "<$hdr")) { $gotfile = 1; while() { @@ -382,14 +382,21 @@ # Rewrite the header file + $cpp = 0; + $cplusplus = 0; if (open(IN, "<$hfile")) { # Copy across the old file while() { + $cplusplus = $cpp if /^#.*ifdef.*cplusplus/; + $cpp++ if /^#\s*if/; + $cpp-- if /^#\s*endif/; push @out, $_; last if (/BEGIN ERROR CODES/); } close IN; } else { + $cpp = 1; + $cplusplus = 1; push @out, "/* ====================================================================\n", " * Copyright (c) 2001-$year The OpenSSL Project. All rights reserved.\n", @@ -446,11 +453,11 @@ " */\n", "\n", "#ifndef HEADER_${lib}_ERR_H\n", -"#define HEADER_${lib}_ERR_H\n", +"# define HEADER_${lib}_ERR_H\n", "\n", -"#ifdef __cplusplus\n", +"# ifdef __cplusplus\n", "extern \"C\" {\n", -"#endif\n", +"# endif\n", "\n", "/* BEGIN ERROR CODES */\n"; } @@ -463,6 +470,7 @@ * The following lines are auto generated by the script mkerr.pl. Any changes * made after this point may be overwritten when the script is next run. */ + EOF if($static) { print OUT <<"EOF"; @@ -523,11 +531,17 @@ } print OUT <<"EOF"; -#ifdef __cplusplus -} -#endif -#endif EOF + do { + if ($cplusplus == $cpp) { + print OUT "#", " "x$cpp, "ifdef __cplusplus\n"; + print OUT "}\n"; + print OUT "#", " "x$cpp, "endif\n"; + } + if ($cpp-- > 0) { + print OUT "#", " "x$cpp, "endif\n"; + } + } while ($cpp); close OUT; # Rewrite the C source file containing the error details. @@ -559,8 +573,9 @@ my $hincf; if($static) { - $hfile =~ /([^\/]+)$/; - $hincf = "<${hprefix}$1>"; + $hincf = $hfile; + $hincf =~ s|.*/||g; + $hincf = "<${hprefix}${hincf}>"; } else { $hincf = "\"$hfile\""; } @@ -665,7 +680,7 @@ $fn = $ftrans{$fn}; } # print OUT "{ERR_PACK($pack_errcode,$i,0),\t\"$fn\"},\n"; - if(length($i) + length($fn) > 58) { + if(length($i) + length($fn) > 57) { print OUT " {ERR_FUNC($i),\n \"$fn\"},\n"; } else { print OUT " {ERR_FUNC($i), \"$fn\"},\n"; @@ -688,7 +703,7 @@ $rn = $1; $rn =~ tr/_[A-Z]/ [a-z]/; } - if(length($i) + length($rn) > 56) { + if(length($i) + length($rn) > 55) { print OUT " {${rstr},\n \"$rn\"},\n"; } else { print OUT " {${rstr}, \"$rn\"},\n"; diff --git a/deps/openssl/openssl/util/ssleay.num b/deps/openssl/openssl/util/ssleay.num index 5760bc42a2519b..e3fdaf2d0a5457 100755 --- a/deps/openssl/openssl/util/ssleay.num +++ b/deps/openssl/openssl/util/ssleay.num @@ -164,7 +164,7 @@ SSL_CTX_get_cert_store 180 EXIST::FUNCTION: SSL_CTX_set_cert_store 181 EXIST::FUNCTION: SSL_want 182 EXIST::FUNCTION: SSL_library_init 183 EXIST::FUNCTION: -SSL_COMP_add_compression_method 184 EXIST::FUNCTION:COMP +SSL_COMP_add_compression_method 184 EXIST::FUNCTION: SSL_add_file_cert_subjects_to_stack 185 EXIST:!VMS:FUNCTION:STDIO SSL_add_file_cert_subjs_to_stk 185 EXIST:VMS:FUNCTION:STDIO SSL_set_tmp_rsa_callback 186 EXIST::FUNCTION:RSA @@ -219,13 +219,13 @@ SSL_set_msg_callback 267 EXIST::FUNCTION: DTLSv1_client_method 268 EXIST::FUNCTION: SSL_CTX_set_tmp_ecdh_callback 269 EXIST::FUNCTION:ECDH SSL_set_tmp_ecdh_callback 270 EXIST::FUNCTION:ECDH -SSL_COMP_get_name 271 EXIST::FUNCTION:COMP -SSL_get_current_compression 272 EXIST::FUNCTION:COMP +SSL_COMP_get_name 271 EXIST::FUNCTION: +SSL_get_current_compression 272 EXIST::FUNCTION: DTLSv1_method 273 EXIST::FUNCTION: -SSL_get_current_expansion 274 EXIST::FUNCTION:COMP +SSL_get_current_expansion 274 EXIST::FUNCTION: DTLSv1_server_method 275 EXIST::FUNCTION: -SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION:COMP -SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION:COMP +SSL_COMP_get_compression_methods 276 EXIST:!VMS:FUNCTION: +SSL_COMP_get_compress_methods 276 EXIST:VMS:FUNCTION: SSL_SESSION_get_id 277 EXIST::FUNCTION: SSL_CTX_sess_set_new_cb 278 EXIST::FUNCTION: SSL_CTX_sess_get_get_cb 279 EXIST::FUNCTION: @@ -332,8 +332,8 @@ SSL_set_alpn_protos 370 EXIST::FUNCTION: SSL_CTX_set_srv_supp_data 371 NOEXIST::FUNCTION: SSL_CONF_cmd_argv 372 EXIST::FUNCTION: DTLSv1_2_server_method 373 EXIST::FUNCTION: -SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION:COMP -SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION:COMP +SSL_COMP_set0_compression_methods 374 EXIST:!VMS:FUNCTION: +SSL_COMP_set0_compress_methods 374 EXIST:VMS:FUNCTION: SSL_CTX_set_cert_cb 375 EXIST::FUNCTION: SSL_CTX_add_client_custom_ext 376 EXIST::FUNCTION:TLSEXT SSL_is_server 377 EXIST::FUNCTION: @@ -365,6 +365,6 @@ SSL_CTX_set_cli_supp_data 403 NOEXIST::FUNCTION: DTLSv1_2_method 404 EXIST::FUNCTION: DTLS_server_method 405 EXIST::FUNCTION: SSL_CTX_use_serverinfo_file 406 EXIST::FUNCTION:STDIO,TLSEXT -SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION:COMP -SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION:COMP +SSL_COMP_free_compression_methods 407 EXIST:!VMS:FUNCTION: +SSL_COMP_free_compress_methods 407 EXIST:VMS:FUNCTION: SSL_extension_supported 409 EXIST::FUNCTION:TLSEXT diff --git a/deps/v8/.gitignore b/deps/v8/.gitignore index 805f349a6e4300..ac9b0bd9ac59c4 100644 --- a/deps/v8/.gitignore +++ b/deps/v8/.gitignore @@ -40,15 +40,13 @@ gcsuspects shell shell_g /_* -/build/Debug -/build/gyp -/build/ipch -/build/Release -/build/win_toolchain.json +/build +/gypfiles/win_toolchain.json /buildtools /hydrogen.cfg /obj /out +/out.gn /perf.data /perf.data.old /test/benchmarks/data @@ -59,20 +57,35 @@ shell_g /test/simdjs/data /test/test262/data /test/test262/data.tar +/test/test262/harness /testing/gmock -/testing/gtest +/testing/gtest/* +!/testing/gtest/include +/testing/gtest/include/* +!/testing/gtest/include/gtest +/testing/gtest/include/gtest/* +!/testing/gtest/include/gtest/gtest_prod.h /third_party +/third_party/android_tools +/third_party/cygwin /third_party/icu +/third_party/instrumented_libraries +/third_party/inspector_protocol +/third_party/jinga2 /third_party/llvm /third_party/llvm-build +/third_party/markupsafe +/third_party/WebKit /tools/clang /tools/gcmole/gcmole-tools /tools/gcmole/gcmole-tools.tar.gz +/tools/gyp /tools/jsfunfuzz/jsfunfuzz /tools/jsfunfuzz/jsfunfuzz.tar.gz /tools/luci-go/linux64/isolate /tools/luci-go/mac64/isolate /tools/luci-go/win64/isolate.exe +/tools/mb /tools/oom_dump/oom_dump /tools/oom_dump/oom_dump.o /tools/swarming_client @@ -86,7 +99,9 @@ GTAGS GRTAGS GSYMS GPATH +tags gtags.files turbo*.cfg turbo*.dot turbo*.json +v8.ignition_dispatches_table.json diff --git a/deps/v8/.gn b/deps/v8/.gn new file mode 100644 index 00000000000000..a1c0ff8dceba56 --- /dev/null +++ b/deps/v8/.gn @@ -0,0 +1,51 @@ +# This file is used by the GN meta build system to find the root of the source +# tree and to set startup options. For documentation on the values set in this +# file, run "gn help dotfile" at the command line. + +# The location of the build configuration file. +buildconfig = "//build/config/BUILDCONFIG.gn" + +# The secondary source root is a parallel directory tree where +# GN build files are placed when they can not be placed directly +# in the source tree, e.g. for third party source trees. +secondary_source = "//build/secondary/" + +# These are the targets to check headers for by default. The files in targets +# matching these patterns (see "gn help label_pattern" for format) will have +# their includes checked for proper dependencies when you run either +# "gn check" or "gn gen --check". +check_targets = [ +] + +# These are the list of GN files that run exec_script. This whitelist exists +# to force additional review for new uses of exec_script, which is strongly +# discouraged except for gypi_to_gn calls. +exec_script_whitelist = [ + "//build/config/android/BUILD.gn", + "//build/config/android/config.gni", + "//build/config/android/internal_rules.gni", + "//build/config/android/rules.gni", + "//build/config/BUILD.gn", + "//build/config/compiler/BUILD.gn", + "//build/config/gcc/gcc_version.gni", + "//build/config/ios/ios_sdk.gni", + "//build/config/linux/atk/BUILD.gn", + "//build/config/linux/BUILD.gn", + "//build/config/linux/pkg_config.gni", + "//build/config/mac/mac_sdk.gni", + "//build/config/posix/BUILD.gn", + "//build/config/sysroot.gni", + "//build/config/win/BUILD.gn", + "//build/config/win/visual_studio_version.gni", + "//build/gn_helpers.py", + "//build/gypi_to_gn.py", + "//build/toolchain/concurrent_links.gni", + "//build/toolchain/gcc_toolchain.gni", + "//build/toolchain/mac/BUILD.gn", + "//build/toolchain/win/BUILD.gn", + "//build/util/branding.gni", + "//build/util/version.gni", + "//test/cctest/BUILD.gn", + "//test/test262/BUILD.gn", + "//test/unittests/BUILD.gn", +] diff --git a/deps/v8/AUTHORS b/deps/v8/AUTHORS index 60b6c51db5eb1a..d70be77d86dccc 100644 --- a/deps/v8/AUTHORS +++ b/deps/v8/AUTHORS @@ -40,6 +40,7 @@ Alexis Campailla Andreas Anyuru Andrew Paprocki Andrei Kashcha +Anna Henningsen Bangfu Tao Ben Noordhuis Benjamin Tan @@ -50,7 +51,9 @@ Craig Schlenter Chris Nardi Christopher A. Taylor Daniel Andersson +Daniel Bevenius Daniel James +Deon Dior Douglas Crosher Dusan Milosavljevic Erich Ocean @@ -62,6 +65,7 @@ Franziska Hinkelmann Geoffrey Garside Han Choongwoo Hirofumi Mako +Honggyu Kim Ioseb Dzmanashvili Isiah Meadows Jan de Mooij @@ -85,11 +89,13 @@ Matthew Sporleder Maxim Mossienko Michael Lutz Michael Smith +Michaël Zasso Mike Gilbert Mike Pennisi Milton Chiang Myeong-bo Shim Nicolas Antonius Ernst Leopold Maria Kaiser +Oleksandr Chekhovskyi Paolo Giarrusso Patrick Gansterer Peter Varga @@ -113,4 +119,4 @@ Vladimir Shutoff Yu Yin Zac Hansen Zhongping Wang -柳荣一 \ No newline at end of file +柳荣一 diff --git a/deps/v8/BUILD.gn b/deps/v8/BUILD.gn index 28aca24afc81c4..dcefe3706b84c1 100644 --- a/deps/v8/BUILD.gn +++ b/deps/v8/BUILD.gn @@ -4,6 +4,7 @@ import("//build/config/android/config.gni") import("//build/config/arm.gni") +import("//build/config/dcheck_always_on.gni") import("//build/config/mips.gni") import("//build/config/sanitizers/sanitizers.gni") @@ -11,16 +12,55 @@ if (is_android) { import("//build/config/android/rules.gni") } -# Because standalone V8 builds are not supported, assume this is part of a -# Chromium build. +import("gni/v8.gni") +import("gni/isolate.gni") import("//build_overrides/v8.gni") import("snapshot_toolchain.gni") declare_args() { - # Enable the snapshot feature, for fast context creation. - # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html - v8_use_snapshot = true + # Print to stdout on Android. + v8_android_log_stdout = false + + # Sets -DVERIFY_HEAP. + v8_enable_verify_heap = false + + # Enable compiler warnings when using V8_DEPRECATED apis. + v8_deprecation_warnings = false + + # Enable compiler warnings when using V8_DEPRECATE_SOON apis. + v8_imminent_deprecation_warnings = "" + + # Embeds the given script into the snapshot. + v8_embed_script = "" + + # Sets -dENABLE_DISASSEMBLER. + v8_enable_disassembler = "" + + # Sets -dENABLE_GDB_JIT_INTERFACE. + v8_enable_gdbjit = "" + + # Sets -dENABLE_HANDLE_ZAPPING. + v8_enable_handle_zapping = is_debug + + # Enable ECMAScript Internationalization API. Enabling this feature will + # add a dependency on the ICU library. + v8_enable_i18n_support = true + + # Enable slow dchecks. + v8_enable_slow_dchecks = false + + # Interpreted regexp engine exists as platform-independent alternative + # based where the regular expression is compiled to a bytecode. + v8_interpreted_regexp = false + + # Sets -dOBJECT_PRINT. + v8_object_print = "" + + # With post mortem support enabled, metadata is embedded into libv8 that + # describes various parameters of the VM for use by debuggers. See + # tools/gen-postmortem-metadata.py for details. + v8_postmortem_support = false # Similar to vfp but on MIPS. v8_can_use_fpu_instructions = true @@ -29,38 +69,35 @@ declare_args() { v8_use_mips_abi_hardfloat = true } -# TODO(jochen): These will need to be user-settable to support standalone V8 -# builds. -v8_deprecation_warnings = false -v8_enable_disassembler = false -v8_enable_gdbjit = false -v8_enable_handle_zapping = false -v8_enable_i18n_support = true -v8_enable_verify_heap = false -v8_interpreted_regexp = false -v8_object_print = false -v8_postmortem_support = false -v8_random_seed = "314159265" -v8_toolset_for_d8 = "host" - -if (is_msan) { - # Running the V8-generated code on an ARM simulator is a powerful hack that - # allows the tool to see the memory accesses from JITted code. Without this - # flag, JS code causes false positive reports from MSan. - v8_target_arch = "arm64" -} else { - v8_target_arch = target_cpu +# Set project-specific defaults for some args if not provided in args.gn. The +# defaults can be set in the respective build_overrides files. +if (v8_imminent_deprecation_warnings == "") { + if (defined(v8_imminent_deprecation_warnings_default)) { + v8_imminent_deprecation_warnings = v8_imminent_deprecation_warnings_default + } else { + v8_imminent_deprecation_warnings = false + } +} +if (v8_enable_gdbjit == "") { + if (defined(v8_enable_gdbjit_default)) { + v8_enable_gdbjit = v8_enable_gdbjit_default + } else { + v8_enable_gdbjit = false + } } -if (v8_use_snapshot && v8_use_external_startup_data) { - snapshot_target = ":v8_external_snapshot" -} else if (v8_use_snapshot) { - snapshot_target = ":v8_snapshot" -} else { - assert(!v8_use_external_startup_data) - snapshot_target = ":v8_nosnapshot" +# Derived defaults. +if (v8_object_print == "") { + v8_object_print = is_debug && !v8_optimized_debug +} +if (v8_enable_disassembler == "") { + v8_enable_disassembler = is_debug && !v8_optimized_debug } +v8_generated_peephole_source = "$target_gen_dir/bytecode-peephole-table.cc" +v8_random_seed = "314159265" +v8_toolset_for_shell = "host" + ############################################################################### # Configurations # @@ -88,6 +125,11 @@ config("libplatform_config") { include_dirs = [ "include" ] } +# This config should be applied to code using the libsampler. +config("libsampler_config") { + include_dirs = [ "include" ] +} + # This config should only be applied to code using V8 and not any V8 code # itself. config("external_config") { @@ -98,6 +140,10 @@ config("external_config") { ] } include_dirs = [ "include" ] + libs = [] + if (is_android && current_toolchain != host_toolchain) { + libs += [ "log" ] + } } # This config should only be applied to code that needs to be explicitly @@ -113,31 +159,34 @@ config("features") { defines = [] - if (v8_enable_disassembler == true) { + if (v8_enable_disassembler) { defines += [ "ENABLE_DISASSEMBLER" ] } - if (v8_enable_gdbjit == true) { + if (v8_enable_gdbjit) { defines += [ "ENABLE_GDB_JIT_INTERFACE" ] } - if (v8_object_print == true) { + if (v8_object_print) { defines += [ "OBJECT_PRINT" ] } - if (v8_enable_verify_heap == true) { + if (v8_enable_verify_heap) { defines += [ "VERIFY_HEAP" ] } - if (v8_interpreted_regexp == true) { + if (v8_interpreted_regexp) { defines += [ "V8_INTERPRETED_REGEXP" ] } - if (v8_deprecation_warnings == true) { + if (v8_deprecation_warnings) { defines += [ "V8_DEPRECATION_WARNINGS" ] } - if (v8_enable_i18n_support == true) { + if (v8_imminent_deprecation_warnings) { + defines += [ "V8_IMMINENT_DEPRECATION_WARNINGS" ] + } + if (v8_enable_i18n_support) { defines += [ "V8_I18N_SUPPORT" ] } - if (v8_enable_handle_zapping == true) { + if (v8_enable_handle_zapping) { defines += [ "ENABLE_HANDLE_ZAPPING" ] } - if (v8_use_external_startup_data == true) { + if (v8_use_external_startup_data) { defines += [ "V8_USE_EXTERNAL_STARTUP_DATA" ] } } @@ -147,8 +196,9 @@ config("toolchain") { defines = [] cflags = [] + ldflags = [] - if (v8_target_arch == "arm") { + if (v8_current_cpu == "arm") { defines += [ "V8_TARGET_ARCH_ARM" ] if (arm_version == 7) { defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ] @@ -167,6 +217,7 @@ config("toolchain") { "CAN_USE_NEON", ] } + # TODO(jochen): Add support for arm_test_noprobe. if (current_cpu != "arm") { @@ -178,11 +229,12 @@ config("toolchain") { } } } - if (v8_target_arch == "arm64") { + if (v8_current_cpu == "arm64") { defines += [ "V8_TARGET_ARCH_ARM64" ] } + # TODO(jochen): Add support for mips. - if (v8_target_arch == "mipsel") { + if (v8_current_cpu == "mipsel") { defines += [ "V8_TARGET_ARCH_MIPS" ] if (v8_can_use_fpu_instructions) { defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] @@ -212,14 +264,17 @@ config("toolchain") { } else if (mips_arch_variant == "r1") { defines += [ "FPU_MODE_FP32" ] } + # TODO(jochen): Add support for mips_arch_variant rx and loongson. } + # TODO(jochen): Add support for mips64. - if (v8_target_arch == "mips64el") { + if (v8_current_cpu == "mips64el") { defines += [ "V8_TARGET_ARCH_MIPS64" ] if (v8_can_use_fpu_instructions) { defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] } + # TODO(jochen): Add support for big endian host byteorder. defines += [ "V8_TARGET_ARCH_MIPS64_LE" ] if (v8_use_mips_abi_hardfloat) { @@ -236,30 +291,43 @@ config("toolchain") { defines += [ "_MIPS_ARCH_MIPS64R2" ] } } - if (v8_target_arch == "s390") { + if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { defines += [ "V8_TARGET_ARCH_S390" ] - } - if (v8_target_arch == "s390x") { - defines += [ - "V8_TARGET_ARCH_S390", - "V8_TARGET_ARCH_S390X", - ] + if (v8_current_cpu == "s390x") { + defines += [ "V8_TARGET_ARCH_S390X" ] + } + if (host_cpu == "x64" || host_cpu == "x86") { + defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ] + } } - if (v8_target_arch == "x86") { + if (v8_current_cpu == "x86") { defines += [ "V8_TARGET_ARCH_IA32" ] + if (is_win) { + # Ensure no surprising artifacts from 80bit double math with x86. + cflags += [ "/arch:SSE2" ] + } } - if (v8_target_arch == "x64") { + if (v8_current_cpu == "x64") { defines += [ "V8_TARGET_ARCH_X64" ] + if (is_win) { + # Increase the initial stack size. The default is 1MB, this is 2MB. This + # applies only to executables and shared libraries produced by V8 since + # ldflags are not pushed to dependants. + ldflags += [ "/STACK:2097152" ] + } } - - if (is_win) { - defines += [ "WIN32" ] - # TODO(jochen): Support v8_enable_prof. + if (is_android && v8_android_log_stdout) { + defines += [ "V8_ANDROID_LOG_STDOUT" ] } + # TODO(jochen): Support v8_enable_prof on Windows. # TODO(jochen): Add support for compiling with simulators. if (is_debug) { + if (is_linux && v8_enable_backtrace) { + ldflags += [ "-rdynamic" ] + } + # TODO(jochen): Add support for different debug optimization levels. defines += [ "ENABLE_DISASSEMBLER", @@ -267,8 +335,13 @@ config("toolchain") { "OBJECT_PRINT", "VERIFY_HEAP", "DEBUG", - "OPTIMIZED_DEBUG", + "TRACE_MAPS", ] + if (v8_enable_slow_dchecks) { + defines += [ "ENABLE_SLOW_DCHECKS" ] + } + } else if (dcheck_always_on) { + defines += [ "DEBUG" ] } } @@ -297,21 +370,16 @@ action("js2c") { "src/js/symbol.js", "src/js/array.js", "src/js/string.js", - "src/js/uri.js", "src/js/math.js", - "src/third_party/fdlibm/fdlibm.js", "src/js/regexp.js", "src/js/arraybuffer.js", "src/js/typedarray.js", "src/js/iterator-prototype.js", - "src/js/generator.js", - "src/js/object-observe.js", "src/js/collection.js", "src/js/weak-collection.js", "src/js/collection-iterator.js", "src/js/promise.js", "src/js/messages.js", - "src/js/json.js", "src/js/array-iterator.js", "src/js/string-iterator.js", "src/js/templates.js", @@ -359,22 +427,23 @@ action("js2c_experimental") { sources = [ "src/js/macros.py", "src/messages.h", - "src/js/generator.js", + "src/js/harmony-async-await.js", "src/js/harmony-atomics.js", - "src/js/harmony-regexp-exec.js", - "src/js/harmony-object-observe.js", - "src/js/harmony-sharedarraybuffer.js", "src/js/harmony-simd.js", - "src/js/harmony-species.js", - "src/js/harmony-unicode-regexps.js", "src/js/harmony-string-padding.js", - "src/js/promise-extra.js", ] outputs = [ "$target_gen_dir/experimental-libraries.cc", ] + if (v8_enable_i18n_support) { + sources += [ + "src/js/icu-case-mapping.js", + "src/js/intl-extra.js", + ] + } + args = [ rebase_path("$target_gen_dir/experimental-libraries.cc", root_build_dir), @@ -473,14 +542,22 @@ action("d8_js2c") { rebase_path(inputs, root_build_dir) } -if (is_android) { +if (is_android && enable_java_templates) { android_assets("v8_external_startup_data_assets") { if (v8_use_external_startup_data) { deps = [ "//v8", ] - renaming_sources = v8_external_startup_data_renaming_sources - renaming_destinations = v8_external_startup_data_renaming_destinations + sources = [ + "$root_out_dir/natives_blob.bin", + ] + renaming_sources = [ "$root_out_dir/snapshot_blob.bin" ] + if (current_cpu == "arm" || current_cpu == "x86" || + current_cpu == "mipsel") { + renaming_destinations = [ "snapshot_blob_32.bin" ] + } else { + renaming_destinations = [ "snapshot_blob_64.bin" ] + } disable_compression = true } } @@ -543,17 +620,19 @@ action("run_mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ - ":mksnapshot($snapshot_toolchain)", + ":mksnapshot($v8_snapshot_toolchain)", ] script = "tools/run.py" + sources = [] + outputs = [ "$target_gen_dir/snapshot.cc", ] args = [ - "./" + rebase_path(get_label_info(":mksnapshot($snapshot_toolchain)", + "./" + rebase_path(get_label_info(":mksnapshot($v8_snapshot_toolchain)", "root_out_dir") + "/mksnapshot", root_build_dir), "--startup_src", @@ -574,13 +653,79 @@ action("run_mksnapshot") { rebase_path("$root_out_dir/snapshot_blob.bin", root_build_dir), ] } + + if (v8_embed_script != "") { + sources += [ v8_embed_script ] + args += [ rebase_path(v8_embed_script, root_build_dir) ] + } +} + +action("run_mkpeephole") { + visibility = [ ":*" ] # Only targets in this file can depend on this. + + deps = [ + ":mkpeephole($v8_snapshot_toolchain)", + ] + + outputs = [ + v8_generated_peephole_source, + ] + + sources = [] + + script = "tools/run.py" + + args = [ + "./" + rebase_path(get_label_info(":mkpeephole($v8_snapshot_toolchain)", + "root_out_dir") + "/mkpeephole", + root_build_dir), + rebase_path(v8_generated_peephole_source, root_build_dir), + ] +} + +action("v8_dump_build_config") { + script = "tools/testrunner/utils/dump_build_config.py" + outputs = [ + "$root_out_dir/v8_build_config.json", + ] + args = [ + rebase_path("$root_out_dir/v8_build_config.json", root_build_dir), + "dcheck_always_on=$dcheck_always_on", + "is_asan=$is_asan", + "is_cfi=$is_cfi", + "is_component_build=$is_component_build", + "is_debug=$is_debug", + "is_msan=$is_msan", + "is_tsan=$is_tsan", + "target_cpu=\"$target_cpu\"", + "v8_enable_i18n_support=$v8_enable_i18n_support", + "v8_target_cpu=\"$v8_target_cpu\"", + "v8_use_snapshot=$v8_use_snapshot", + ] } ############################################################################### # Source Sets (aka static libraries) # -source_set("v8_nosnapshot") { +source_set("v8_maybe_snapshot") { + if (v8_use_snapshot && v8_use_external_startup_data) { + public_deps = [ + ":v8_external_snapshot", + ] + } else if (v8_use_snapshot) { + public_deps = [ + ":v8_snapshot", + ] + } else { + # Ignore v8_use_external_startup_data setting if no snapshot is used. + public_deps = [ + ":v8_nosnapshot", + ] + } +} + +v8_source_set("v8_nosnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ @@ -599,16 +744,10 @@ source_set("v8_nosnapshot") { "src/snapshot/snapshot-empty.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } -source_set("v8_snapshot") { +v8_source_set("v8_snapshot") { # Only targets in this file and the top-level visibility target can # depend on this. visibility = [ @@ -637,17 +776,11 @@ source_set("v8_snapshot") { "$target_gen_dir/snapshot.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } if (v8_use_external_startup_data) { - source_set("v8_external_snapshot") { + v8_source_set("v8_external_snapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. deps = [ @@ -667,22 +800,15 @@ if (v8_use_external_startup_data) { "src/snapshot/snapshot-external.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] } } -source_set("v8_base") { +v8_source_set("v8_base") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ - # TODO(fmeawad): This needs to be updated to support standalone V8 builds. - "../base/trace_event/common/trace_event_common.h", + "//base/trace_event/common/trace_event_common.h", "include/v8-debug.h", "include/v8-experimental.h", "include/v8-platform.h", @@ -700,6 +826,7 @@ source_set("v8_base") { "src/allocation-site-scopes.h", "src/allocation.cc", "src/allocation.h", + "src/api-arguments-inl.h", "src/api-arguments.cc", "src/api-arguments.h", "src/api-experimental.cc", @@ -710,22 +837,32 @@ source_set("v8_base") { "src/api.h", "src/arguments.cc", "src/arguments.h", + "src/asmjs/asm-js.cc", + "src/asmjs/asm-js.h", + "src/asmjs/asm-typer.cc", + "src/asmjs/asm-typer.h", + "src/asmjs/asm-types.cc", + "src/asmjs/asm-types.h", + "src/asmjs/asm-wasm-builder.cc", + "src/asmjs/asm-wasm-builder.h", "src/assembler.cc", "src/assembler.h", "src/assert-scope.cc", "src/assert-scope.h", "src/ast/ast-expression-rewriter.cc", "src/ast/ast-expression-rewriter.h", - "src/ast/ast-expression-visitor.cc", - "src/ast/ast-expression-visitor.h", "src/ast/ast-literal-reindexer.cc", "src/ast/ast-literal-reindexer.h", "src/ast/ast-numbering.cc", "src/ast/ast-numbering.h", + "src/ast/ast-traversal-visitor.h", + "src/ast/ast-type-bounds.h", "src/ast/ast-value-factory.cc", "src/ast/ast-value-factory.h", "src/ast/ast.cc", "src/ast/ast.h", + "src/ast/context-slot-cache.cc", + "src/ast/context-slot-cache.h", "src/ast/modules.cc", "src/ast/modules.h", "src/ast/prettyprinter.cc", @@ -736,7 +873,6 @@ source_set("v8_base") { "src/ast/scopes.h", "src/ast/variables.cc", "src/ast/variables.h", - "src/atomic-utils.h", "src/background-parsing-task.cc", "src/background-parsing-task.h", "src/bailout-reason.cc", @@ -751,8 +887,36 @@ source_set("v8_base") { "src/bit-vector.h", "src/bootstrapper.cc", "src/bootstrapper.h", - "src/builtins.cc", - "src/builtins.h", + "src/builtins/builtins-api.cc", + "src/builtins/builtins-array.cc", + "src/builtins/builtins-arraybuffer.cc", + "src/builtins/builtins-boolean.cc", + "src/builtins/builtins-call.cc", + "src/builtins/builtins-callsite.cc", + "src/builtins/builtins-conversion.cc", + "src/builtins/builtins-dataview.cc", + "src/builtins/builtins-date.cc", + "src/builtins/builtins-debug.cc", + "src/builtins/builtins-error.cc", + "src/builtins/builtins-function.cc", + "src/builtins/builtins-generator.cc", + "src/builtins/builtins-global.cc", + "src/builtins/builtins-handler.cc", + "src/builtins/builtins-internal.cc", + "src/builtins/builtins-interpreter.cc", + "src/builtins/builtins-json.cc", + "src/builtins/builtins-math.cc", + "src/builtins/builtins-number.cc", + "src/builtins/builtins-object.cc", + "src/builtins/builtins-proxy.cc", + "src/builtins/builtins-reflect.cc", + "src/builtins/builtins-sharedarraybuffer.cc", + "src/builtins/builtins-string.cc", + "src/builtins/builtins-symbol.cc", + "src/builtins/builtins-typedarray.cc", + "src/builtins/builtins-utils.h", + "src/builtins/builtins.cc", + "src/builtins/builtins.h", "src/cached-powers.cc", "src/cached-powers.h", "src/cancelable-task.cc", @@ -761,8 +925,11 @@ source_set("v8_base") { "src/char-predicates.cc", "src/char-predicates.h", "src/checks.h", + "src/code-events.h", "src/code-factory.cc", "src/code-factory.h", + "src/code-stub-assembler.cc", + "src/code-stub-assembler.h", "src/code-stubs-hydrogen.cc", "src/code-stubs.cc", "src/code-stubs.h", @@ -775,6 +942,10 @@ source_set("v8_base") { "src/compilation-dependencies.h", "src/compilation-statistics.cc", "src/compilation-statistics.h", + "src/compiler-dispatcher/compiler-dispatcher-job.cc", + "src/compiler-dispatcher/compiler-dispatcher-job.h", + "src/compiler-dispatcher/optimizing-compile-dispatcher.cc", + "src/compiler-dispatcher/optimizing-compile-dispatcher.h", "src/compiler.cc", "src/compiler.h", "src/compiler/access-builder.cc", @@ -795,16 +966,16 @@ source_set("v8_base") { "src/compiler/bytecode-branch-analysis.h", "src/compiler/bytecode-graph-builder.cc", "src/compiler/bytecode-graph-builder.h", + "src/compiler/bytecode-loop-analysis.cc", + "src/compiler/bytecode-loop-analysis.h", "src/compiler/c-linkage.cc", - "src/compiler/change-lowering.cc", - "src/compiler/change-lowering.h", - "src/compiler/coalesced-live-ranges.cc", - "src/compiler/coalesced-live-ranges.h", + "src/compiler/checkpoint-elimination.cc", + "src/compiler/checkpoint-elimination.h", + "src/compiler/code-assembler.cc", + "src/compiler/code-assembler.h", "src/compiler/code-generator-impl.h", "src/compiler/code-generator.cc", "src/compiler/code-generator.h", - "src/compiler/code-stub-assembler.cc", - "src/compiler/code-stub-assembler.h", "src/compiler/common-node-cache.cc", "src/compiler/common-node-cache.h", "src/compiler/common-operator-reducer.cc", @@ -820,6 +991,8 @@ source_set("v8_base") { "src/compiler/dead-code-elimination.cc", "src/compiler/dead-code-elimination.h", "src/compiler/diamond.h", + "src/compiler/effect-control-linearizer.cc", + "src/compiler/effect-control-linearizer.h", "src/compiler/escape-analysis-reducer.cc", "src/compiler/escape-analysis-reducer.h", "src/compiler/escape-analysis.cc", @@ -842,8 +1015,6 @@ source_set("v8_base") { "src/compiler/graph-visualizer.h", "src/compiler/graph.cc", "src/compiler/graph.h", - "src/compiler/greedy-allocator.cc", - "src/compiler/greedy-allocator.h", "src/compiler/instruction-codes.h", "src/compiler/instruction-scheduler.cc", "src/compiler/instruction-scheduler.h", @@ -895,10 +1066,15 @@ source_set("v8_base") { "src/compiler/loop-analysis.cc", "src/compiler/loop-analysis.h", "src/compiler/loop-peeling.cc", + "src/compiler/loop-peeling.h", + "src/compiler/loop-variable-optimizer.cc", + "src/compiler/loop-variable-optimizer.h", "src/compiler/machine-operator-reducer.cc", "src/compiler/machine-operator-reducer.h", "src/compiler/machine-operator.cc", "src/compiler/machine-operator.h", + "src/compiler/memory-optimizer.cc", + "src/compiler/memory-optimizer.h", "src/compiler/move-optimizer.cc", "src/compiler/move-optimizer.h", "src/compiler/node-aux-data.h", @@ -914,6 +1090,8 @@ source_set("v8_base") { "src/compiler/node.h", "src/compiler/opcodes.cc", "src/compiler/opcodes.h", + "src/compiler/operation-typer.cc", + "src/compiler/operation-typer.h", "src/compiler/operator-properties.cc", "src/compiler/operator-properties.h", "src/compiler/operator.cc", @@ -926,6 +1104,8 @@ source_set("v8_base") { "src/compiler/pipeline.h", "src/compiler/raw-machine-assembler.cc", "src/compiler/raw-machine-assembler.h", + "src/compiler/redundancy-elimination.cc", + "src/compiler/redundancy-elimination.h", "src/compiler/register-allocator-verifier.cc", "src/compiler/register-allocator-verifier.h", "src/compiler/register-allocator.cc", @@ -948,6 +1128,8 @@ source_set("v8_base") { "src/compiler/source-position.h", "src/compiler/state-values-utils.cc", "src/compiler/state-values-utils.h", + "src/compiler/store-store-elimination.cc", + "src/compiler/store-store-elimination.h", "src/compiler/tail-call-optimization.cc", "src/compiler/tail-call-optimization.h", "src/compiler/type-hint-analyzer.cc", @@ -956,6 +1138,7 @@ source_set("v8_base") { "src/compiler/type-hints.h", "src/compiler/typer.cc", "src/compiler/typer.h", + "src/compiler/unwinding-info-writer.h", "src/compiler/value-numbering-reducer.cc", "src/compiler/value-numbering-reducer.h", "src/compiler/verifier.cc", @@ -973,6 +1156,7 @@ source_set("v8_base") { "src/conversions-inl.h", "src/conversions.cc", "src/conversions.h", + "src/counters-inl.h", "src/counters.cc", "src/counters.h", "src/crankshaft/compilation-phase.cc", @@ -1052,6 +1236,8 @@ source_set("v8_base") { "src/debug/debug.h", "src/debug/liveedit.cc", "src/debug/liveedit.h", + "src/deoptimize-reason.cc", + "src/deoptimize-reason.h", "src/deoptimizer.cc", "src/deoptimizer.h", "src/disasm.h", @@ -1063,6 +1249,8 @@ source_set("v8_base") { "src/dtoa.cc", "src/dtoa.h", "src/effects.h", + "src/eh-frame.cc", + "src/eh-frame.h", "src/elements-kind.cc", "src/elements-kind.h", "src/elements.cc", @@ -1075,6 +1263,8 @@ source_set("v8_base") { "src/extensions/free-buffer-extension.h", "src/extensions/gc-extension.cc", "src/extensions/gc-extension.h", + "src/extensions/ignition-statistics-extension.cc", + "src/extensions/ignition-statistics-extension.h", "src/extensions/statistics-extension.cc", "src/extensions/statistics-extension.h", "src/extensions/trigger-failure-extension.cc", @@ -1111,10 +1301,12 @@ source_set("v8_base") { "src/handles-inl.h", "src/handles.cc", "src/handles.h", - "src/hashmap.h", "src/heap-symbols.h", + "src/heap/array-buffer-tracker-inl.h", "src/heap/array-buffer-tracker.cc", "src/heap/array-buffer-tracker.h", + "src/heap/code-stats.cc", + "src/heap/code-stats.h", "src/heap/gc-idle-time-handler.cc", "src/heap/gc-idle-time-handler.h", "src/heap/gc-tracer.cc", @@ -1129,6 +1321,7 @@ source_set("v8_base") { "src/heap/mark-compact-inl.h", "src/heap/mark-compact.cc", "src/heap/mark-compact.h", + "src/heap/marking.h", "src/heap/memory-reducer.cc", "src/heap/memory-reducer.h", "src/heap/object-stats.cc", @@ -1177,10 +1370,29 @@ source_set("v8_base") { "src/interpreter/bytecode-array-builder.h", "src/interpreter/bytecode-array-iterator.cc", "src/interpreter/bytecode-array-iterator.h", + "src/interpreter/bytecode-array-writer.cc", + "src/interpreter/bytecode-array-writer.h", + "src/interpreter/bytecode-dead-code-optimizer.cc", + "src/interpreter/bytecode-dead-code-optimizer.h", + "src/interpreter/bytecode-decoder.cc", + "src/interpreter/bytecode-decoder.h", + "src/interpreter/bytecode-flags.cc", + "src/interpreter/bytecode-flags.h", "src/interpreter/bytecode-generator.cc", "src/interpreter/bytecode-generator.h", + "src/interpreter/bytecode-label.cc", + "src/interpreter/bytecode-label.h", + "src/interpreter/bytecode-peephole-optimizer.cc", + "src/interpreter/bytecode-peephole-optimizer.h", + "src/interpreter/bytecode-peephole-table.h", + "src/interpreter/bytecode-pipeline.cc", + "src/interpreter/bytecode-pipeline.h", "src/interpreter/bytecode-register-allocator.cc", "src/interpreter/bytecode-register-allocator.h", + "src/interpreter/bytecode-register-optimizer.cc", + "src/interpreter/bytecode-register-optimizer.h", + "src/interpreter/bytecode-register.cc", + "src/interpreter/bytecode-register.h", "src/interpreter/bytecode-traits.h", "src/interpreter/bytecodes.cc", "src/interpreter/bytecodes.h", @@ -1196,12 +1408,12 @@ source_set("v8_base") { "src/interpreter/interpreter-intrinsics.h", "src/interpreter/interpreter.cc", "src/interpreter/interpreter.h", - "src/interpreter/source-position-table.cc", - "src/interpreter/source-position-table.h", "src/isolate-inl.h", "src/isolate.cc", "src/isolate.h", + "src/json-parser.cc", "src/json-parser.h", + "src/json-stringifier.cc", "src/json-stringifier.h", "src/keys.cc", "src/keys.h", @@ -1230,8 +1442,6 @@ source_set("v8_base") { "src/objects-printer.cc", "src/objects.cc", "src/objects.h", - "src/optimizing-compile-dispatcher.cc", - "src/optimizing-compile-dispatcher.h", "src/ostreams.cc", "src/ostreams.h", "src/parsing/expression-classifier.h", @@ -1239,6 +1449,8 @@ source_set("v8_base") { "src/parsing/func-name-inferrer.h", "src/parsing/parameter-initializer-rewriter.cc", "src/parsing/parameter-initializer-rewriter.h", + "src/parsing/parse-info.cc", + "src/parsing/parse-info.h", "src/parsing/parser-base.h", "src/parsing/parser.cc", "src/parsing/parser.h", @@ -1275,12 +1487,14 @@ source_set("v8_base") { "src/profiler/profile-generator-inl.h", "src/profiler/profile-generator.cc", "src/profiler/profile-generator.h", - "src/profiler/sampler.cc", - "src/profiler/sampler.h", + "src/profiler/profiler-listener.cc", + "src/profiler/profiler-listener.h", "src/profiler/sampling-heap-profiler.cc", "src/profiler/sampling-heap-profiler.h", "src/profiler/strings-storage.cc", "src/profiler/strings-storage.h", + "src/profiler/tick-sample.cc", + "src/profiler/tick-sample.h", "src/profiler/unbound-queue-inl.h", "src/profiler/unbound-queue.h", "src/property-descriptor.cc", @@ -1319,6 +1533,7 @@ source_set("v8_base") { "src/runtime/runtime-compiler.cc", "src/runtime/runtime-date.cc", "src/runtime/runtime-debug.cc", + "src/runtime/runtime-error.cc", "src/runtime/runtime-forin.cc", "src/runtime/runtime-function.cc", "src/runtime/runtime-futex.cc", @@ -1326,13 +1541,11 @@ source_set("v8_base") { "src/runtime/runtime-i18n.cc", "src/runtime/runtime-internal.cc", "src/runtime/runtime-interpreter.cc", - "src/runtime/runtime-json.cc", "src/runtime/runtime-literals.cc", "src/runtime/runtime-liveedit.cc", "src/runtime/runtime-maths.cc", "src/runtime/runtime-numbers.cc", "src/runtime/runtime-object.cc", - "src/runtime/runtime-observe.cc", "src/runtime/runtime-operators.cc", "src/runtime/runtime-proxy.cc", "src/runtime/runtime-regexp.cc", @@ -1342,8 +1555,8 @@ source_set("v8_base") { "src/runtime/runtime-symbol.cc", "src/runtime/runtime-test.cc", "src/runtime/runtime-typedarray.cc", - "src/runtime/runtime-uri.cc", "src/runtime/runtime-utils.h", + "src/runtime/runtime-wasm.cc", "src/runtime/runtime.cc", "src/runtime/runtime.h", "src/safepoint-table.cc", @@ -1369,6 +1582,8 @@ source_set("v8_base") { "src/snapshot/snapshot.h", "src/snapshot/startup-serializer.cc", "src/snapshot/startup-serializer.h", + "src/source-position-table.cc", + "src/source-position-table.h", "src/source-position.h", "src/splay-tree-inl.h", "src/splay-tree.h", @@ -1381,8 +1596,6 @@ source_set("v8_base") { "src/string-stream.h", "src/strtod.cc", "src/strtod.h", - "src/third_party/fdlibm/fdlibm.cc", - "src/third_party/fdlibm/fdlibm.h", "src/tracing/trace-event.cc", "src/tracing/trace-event.h", "src/transitions-inl.h", @@ -1397,10 +1610,6 @@ source_set("v8_base") { "src/type-info.h", "src/types.cc", "src/types.h", - "src/typing-asm.cc", - "src/typing-asm.h", - "src/typing-reset.cc", - "src/typing-reset.h", "src/unicode-cache-inl.h", "src/unicode-cache.h", "src/unicode-decoder.cc", @@ -1408,6 +1617,8 @@ source_set("v8_base") { "src/unicode-inl.h", "src/unicode.cc", "src/unicode.h", + "src/uri.cc", + "src/uri.h", "src/utils-inl.h", "src/utils.cc", "src/utils.h", @@ -1416,20 +1627,30 @@ source_set("v8_base") { "src/v8memory.h", "src/v8threads.cc", "src/v8threads.h", + "src/value-serializer.cc", + "src/value-serializer.h", "src/version.cc", "src/version.h", "src/vm-state-inl.h", "src/vm-state.h", - "src/wasm/asm-wasm-builder.cc", - "src/wasm/asm-wasm-builder.h", "src/wasm/ast-decoder.cc", "src/wasm/ast-decoder.h", "src/wasm/decoder.h", "src/wasm/encoder.cc", "src/wasm/encoder.h", + "src/wasm/leb-helper.h", "src/wasm/module-decoder.cc", "src/wasm/module-decoder.h", + "src/wasm/switch-logic.cc", + "src/wasm/switch-logic.h", + "src/wasm/wasm-debug.cc", + "src/wasm/wasm-debug.h", + "src/wasm/wasm-external-refs.cc", "src/wasm/wasm-external-refs.h", + "src/wasm/wasm-function-name-table.cc", + "src/wasm/wasm-function-name-table.h", + "src/wasm/wasm-interpreter.cc", + "src/wasm/wasm-interpreter.h", "src/wasm/wasm-js.cc", "src/wasm/wasm-js.h", "src/wasm/wasm-macro-gen.h", @@ -1445,8 +1666,9 @@ source_set("v8_base") { "src/zone.h", ] - if (v8_target_arch == "x86") { + if (v8_current_cpu == "x86") { sources += [ + "src/builtins/ia32/builtins-ia32.cc", "src/compiler/ia32/code-generator-ia32.cc", "src/compiler/ia32/instruction-codes-ia32.h", "src/compiler/ia32/instruction-scheduler-ia32.cc", @@ -1462,7 +1684,6 @@ source_set("v8_base") { "src/ia32/assembler-ia32-inl.h", "src/ia32/assembler-ia32.cc", "src/ia32/assembler-ia32.h", - "src/ia32/builtins-ia32.cc", "src/ia32/code-stubs-ia32.cc", "src/ia32/code-stubs-ia32.h", "src/ia32/codegen-ia32.cc", @@ -1483,12 +1704,15 @@ source_set("v8_base") { "src/regexp/ia32/regexp-macro-assembler-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.h", ] - } else if (v8_target_arch == "x64") { + } else if (v8_current_cpu == "x64") { sources += [ + "src/builtins/x64/builtins-x64.cc", "src/compiler/x64/code-generator-x64.cc", "src/compiler/x64/instruction-codes-x64.h", "src/compiler/x64/instruction-scheduler-x64.cc", "src/compiler/x64/instruction-selector-x64.cc", + "src/compiler/x64/unwinding-info-writer-x64.cc", + "src/compiler/x64/unwinding-info-writer-x64.h", "src/crankshaft/x64/lithium-codegen-x64.cc", "src/crankshaft/x64/lithium-codegen-x64.h", "src/crankshaft/x64/lithium-gap-resolver-x64.cc", @@ -1507,7 +1731,6 @@ source_set("v8_base") { "src/x64/assembler-x64-inl.h", "src/x64/assembler-x64.cc", "src/x64/assembler-x64.h", - "src/x64/builtins-x64.cc", "src/x64/code-stubs-x64.cc", "src/x64/code-stubs-x64.h", "src/x64/codegen-x64.cc", @@ -1515,18 +1738,18 @@ source_set("v8_base") { "src/x64/cpu-x64.cc", "src/x64/deoptimizer-x64.cc", "src/x64/disasm-x64.cc", + "src/x64/eh-frame-x64.cc", "src/x64/frames-x64.cc", "src/x64/frames-x64.h", "src/x64/interface-descriptors-x64.cc", "src/x64/macro-assembler-x64.cc", "src/x64/macro-assembler-x64.h", ] - } else if (v8_target_arch == "arm") { + } else if (v8_current_cpu == "arm") { sources += [ "src/arm/assembler-arm-inl.h", "src/arm/assembler-arm.cc", "src/arm/assembler-arm.h", - "src/arm/builtins-arm.cc", "src/arm/code-stubs-arm.cc", "src/arm/code-stubs-arm.h", "src/arm/codegen-arm.cc", @@ -1536,6 +1759,7 @@ source_set("v8_base") { "src/arm/cpu-arm.cc", "src/arm/deoptimizer-arm.cc", "src/arm/disasm-arm.cc", + "src/arm/eh-frame-arm.cc", "src/arm/frames-arm.cc", "src/arm/frames-arm.h", "src/arm/interface-descriptors-arm.cc", @@ -1544,10 +1768,13 @@ source_set("v8_base") { "src/arm/macro-assembler-arm.h", "src/arm/simulator-arm.cc", "src/arm/simulator-arm.h", + "src/builtins/arm/builtins-arm.cc", "src/compiler/arm/code-generator-arm.cc", "src/compiler/arm/instruction-codes-arm.h", "src/compiler/arm/instruction-scheduler-arm.cc", "src/compiler/arm/instruction-selector-arm.cc", + "src/compiler/arm/unwinding-info-writer-arm.cc", + "src/compiler/arm/unwinding-info-writer-arm.h", "src/crankshaft/arm/lithium-arm.cc", "src/crankshaft/arm/lithium-arm.h", "src/crankshaft/arm/lithium-codegen-arm.cc", @@ -1564,12 +1791,11 @@ source_set("v8_base") { "src/regexp/arm/regexp-macro-assembler-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.h", ] - } else if (v8_target_arch == "arm64") { + } else if (v8_current_cpu == "arm64") { sources += [ "src/arm64/assembler-arm64-inl.h", "src/arm64/assembler-arm64.cc", "src/arm64/assembler-arm64.h", - "src/arm64/builtins-arm64.cc", "src/arm64/code-stubs-arm64.cc", "src/arm64/code-stubs-arm64.h", "src/arm64/codegen-arm64.cc", @@ -1582,6 +1808,7 @@ source_set("v8_base") { "src/arm64/deoptimizer-arm64.cc", "src/arm64/disasm-arm64.cc", "src/arm64/disasm-arm64.h", + "src/arm64/eh-frame-arm64.cc", "src/arm64/frames-arm64.cc", "src/arm64/frames-arm64.h", "src/arm64/instructions-arm64.cc", @@ -1597,10 +1824,13 @@ source_set("v8_base") { "src/arm64/simulator-arm64.h", "src/arm64/utils-arm64.cc", "src/arm64/utils-arm64.h", + "src/builtins/arm64/builtins-arm64.cc", "src/compiler/arm64/code-generator-arm64.cc", "src/compiler/arm64/instruction-codes-arm64.h", "src/compiler/arm64/instruction-scheduler-arm64.cc", "src/compiler/arm64/instruction-selector-arm64.cc", + "src/compiler/arm64/unwinding-info-writer-arm64.cc", + "src/compiler/arm64/unwinding-info-writer-arm64.h", "src/crankshaft/arm64/delayed-masm-arm64-inl.h", "src/crankshaft/arm64/delayed-masm-arm64.cc", "src/crankshaft/arm64/delayed-masm-arm64.h", @@ -1620,8 +1850,9 @@ source_set("v8_base") { "src/regexp/arm64/regexp-macro-assembler-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.h", ] - } else if (v8_target_arch == "mipsel") { + } else if (v8_current_cpu == "mipsel") { sources += [ + "src/builtins/mips/builtins-mips.cc", "src/compiler/mips/code-generator-mips.cc", "src/compiler/mips/instruction-codes-mips.h", "src/compiler/mips/instruction-scheduler-mips.cc", @@ -1642,7 +1873,6 @@ source_set("v8_base") { "src/mips/assembler-mips-inl.h", "src/mips/assembler-mips.cc", "src/mips/assembler-mips.h", - "src/mips/builtins-mips.cc", "src/mips/code-stubs-mips.cc", "src/mips/code-stubs-mips.h", "src/mips/codegen-mips.cc", @@ -1662,12 +1892,13 @@ source_set("v8_base") { "src/regexp/mips/regexp-macro-assembler-mips.cc", "src/regexp/mips/regexp-macro-assembler-mips.h", ] - } else if (v8_target_arch == "mips64el") { + } else if (v8_current_cpu == "mips64el") { sources += [ - "compiler/mips64/code-generator-mips64.cc", - "compiler/mips64/instruction-codes-mips64.h", - "compiler/mips64/instruction-scheduler-mips64.cc", - "compiler/mips64/instruction-selector-mips64.cc", + "src/builtins/mips64/builtins-mips64.cc", + "src/compiler/mips64/code-generator-mips64.cc", + "src/compiler/mips64/instruction-codes-mips64.h", + "src/compiler/mips64/instruction-scheduler-mips64.cc", + "src/compiler/mips64/instruction-selector-mips64.cc", "src/crankshaft/mips64/lithium-codegen-mips64.cc", "src/crankshaft/mips64/lithium-codegen-mips64.h", "src/crankshaft/mips64/lithium-gap-resolver-mips64.cc", @@ -1684,7 +1915,6 @@ source_set("v8_base") { "src/mips64/assembler-mips64-inl.h", "src/mips64/assembler-mips64.cc", "src/mips64/assembler-mips64.h", - "src/mips64/builtins-mips64.cc", "src/mips64/code-stubs-mips64.cc", "src/mips64/code-stubs-mips64.h", "src/mips64/codegen-mips64.cc", @@ -1704,8 +1934,9 @@ source_set("v8_base") { "src/regexp/mips64/regexp-macro-assembler-mips64.cc", "src/regexp/mips64/regexp-macro-assembler-mips64.h", ] - } else if (v8_target_arch == "s390" || v8_target_arch == "s390x") { + } else if (v8_current_cpu == "s390" || v8_current_cpu == "s390x") { sources += [ + "src/builtins/s390/builtins-s390.cc", "src/compiler/s390/code-generator-s390.cc", "src/compiler/s390/instruction-codes-s390.h", "src/compiler/s390/instruction-scheduler-s390.cc", @@ -1728,7 +1959,6 @@ source_set("v8_base") { "src/s390/assembler-s390-inl.h", "src/s390/assembler-s390.cc", "src/s390/assembler-s390.h", - "src/s390/builtins-s390.cc", "src/s390/code-stubs-s390.cc", "src/s390/code-stubs-s390.h", "src/s390/codegen-s390.cc", @@ -1748,24 +1978,17 @@ source_set("v8_base") { ] } - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } + configs = [ ":internal_config" ] defines = [] deps = [ ":v8_libbase", + ":v8_libsampler", ] + sources += [ v8_generated_peephole_source ] + deps += [ ":run_mkpeephole" ] + if (is_win) { # TODO(jschuh): crbug.com/167187 fix size_t to int truncations. cflags = [ "/wd4267" ] @@ -1776,9 +1999,6 @@ source_set("v8_base") { if (is_win) { deps += [ "//third_party/icu:icudata" ] } - - # TODO(jochen): Add support for icu_use_data_file_flag - defines += [ "ICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE" ] } else { sources -= [ "src/i18n.cc", @@ -1792,13 +2012,14 @@ source_set("v8_base") { } } -source_set("v8_libbase") { +v8_source_set("v8_libbase") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ "src/base/accounting-allocator.cc", "src/base/accounting-allocator.h", "src/base/adapters.h", + "src/base/atomic-utils.h", "src/base/atomicops.h", "src/base/atomicops_internals_arm64_gcc.h", "src/base/atomicops_internals_arm_gcc.h", @@ -1806,7 +2027,6 @@ source_set("v8_libbase") { "src/base/atomicops_internals_mac.h", "src/base/atomicops_internals_mips64_gcc.h", "src/base/atomicops_internals_mips_gcc.h", - "src/base/atomicops_internals_portable.h", "src/base/atomicops_internals_s390_gcc.h", "src/base/atomicops_internals_tsan.h", "src/base/atomicops_internals_x86_gcc.cc", @@ -1817,11 +2037,20 @@ source_set("v8_libbase") { "src/base/build_config.h", "src/base/cpu.cc", "src/base/cpu.h", + "src/base/debug/stack_trace.cc", + "src/base/debug/stack_trace.h", "src/base/division-by-constant.cc", "src/base/division-by-constant.h", + "src/base/file-utils.cc", + "src/base/file-utils.h", "src/base/flags.h", + "src/base/format-macros.h", + "src/base/free_deleter.h", "src/base/functional.cc", "src/base/functional.h", + "src/base/hashmap.h", + "src/base/ieee754.cc", + "src/base/ieee754.h", "src/base/iterator.h", "src/base/lazy-instance.h", "src/base/logging.cc", @@ -1843,25 +2072,13 @@ source_set("v8_libbase") { "src/base/safe_conversions_impl.h", "src/base/safe_math.h", "src/base/safe_math_impl.h", - "src/base/smart-pointers.h", "src/base/sys-info.cc", "src/base/sys-info.h", "src/base/utils/random-number-generator.cc", "src/base/utils/random-number-generator.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":features", - ":toolchain", - ] - - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } + configs = [ ":internal_config_base" ] defines = [] @@ -1870,7 +2087,10 @@ source_set("v8_libbase") { } if (is_linux) { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-linux.cc", + ] libs = [ "dl", @@ -1883,18 +2103,31 @@ source_set("v8_libbase") { "rt", ] if (host_os == "mac") { - sources += [ "src/base/platform/platform-macos.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-macos.cc", + ] } else { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-linux.cc", + ] } } else { - sources += [ "src/base/platform/platform-linux.cc" ] + sources += [ + "src/base/debug/stack_trace_android.cc", + "src/base/platform/platform-linux.cc", + ] } } else if (is_mac) { - sources += [ "src/base/platform/platform-macos.cc" ] + sources += [ + "src/base/debug/stack_trace_posix.cc", + "src/base/platform/platform-macos.cc", + ] } else if (is_win) { # TODO(jochen): Add support for cygwin. sources += [ + "src/base/debug/stack_trace_win.cc", "src/base/platform/platform-win32.cc", "src/base/win32-headers.h", ] @@ -1902,6 +2135,8 @@ source_set("v8_libbase") { defines += [ "_CRT_RAND_S" ] # for rand_s() libs = [ + "dbghelp.lib", + "shlwapi.lib", "winmm.lib", "ws2_32.lib", ] @@ -1910,36 +2145,51 @@ source_set("v8_libbase") { # TODO(jochen): Add support for qnx, freebsd, openbsd, netbsd, and solaris. } -source_set("v8_libplatform") { +v8_source_set("v8_libplatform") { sources = [ + "//base/trace_event/common/trace_event_common.h", "include/libplatform/libplatform.h", + "include/libplatform/v8-tracing.h", "src/libplatform/default-platform.cc", "src/libplatform/default-platform.h", "src/libplatform/task-queue.cc", "src/libplatform/task-queue.h", + "src/libplatform/tracing/trace-buffer.cc", + "src/libplatform/tracing/trace-buffer.h", + "src/libplatform/tracing/trace-config.cc", + "src/libplatform/tracing/trace-object.cc", + "src/libplatform/tracing/trace-writer.cc", + "src/libplatform/tracing/trace-writer.h", + "src/libplatform/tracing/tracing-controller.cc", "src/libplatform/worker-thread.cc", "src/libplatform/worker-thread.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":features", - ":toolchain", + configs = [ ":internal_config_base" ] + + public_configs = [ ":libplatform_config" ] + + deps = [ + ":v8_libbase", ] +} - if (!is_debug) { - configs -= [ "//build/config/compiler:default_optimization" ] - configs += [ "//build/config/compiler:optimize_max" ] - } +v8_source_set("v8_libsampler") { + sources = [ + "src/libsampler/sampler.cc", + "src/libsampler/sampler.h", + ] + + configs = [ ":internal_config_base" ] + + public_configs = [ ":libsampler_config" ] deps = [ ":v8_libbase", ] } -source_set("fuzzer_support") { +v8_source_set("fuzzer_support") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ @@ -1947,136 +2197,317 @@ source_set("fuzzer_support") { "test/fuzzer/fuzzer-support.h", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config_base", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config_base" ] deps = [ + ":v8_maybe_snapshot", + ] + + public_deps = [ ":v8_libplatform", - snapshot_target, ] } +v8_source_set("simple_fuzzer") { + sources = [ + "test/fuzzer/fuzzer.cc", + ] + + configs = [ ":internal_config_base" ] +} + ############################################################################### # Executables # -if (current_toolchain == snapshot_toolchain) { - executable("mksnapshot") { +if (current_toolchain == v8_snapshot_toolchain) { + v8_executable("mksnapshot") { visibility = [ ":*" ] # Only targets in this file can depend on this. sources = [ "src/snapshot/mksnapshot.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] deps = [ ":v8_base", ":v8_libplatform", ":v8_nosnapshot", "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", ] } } +v8_executable("mkpeephole") { + # mkpeephole needs to be built for the build host so the peephole lookup + # table can built during build. The table depends on the properties of + # bytecodes that are described in bytecodes.{cc,h}. + visibility = [ ":*" ] # Only targets in this file can depend on this. + + sources = [ + "src/interpreter/bytecode-peephole-optimizer.h", + "src/interpreter/bytecodes.cc", + "src/interpreter/bytecodes.h", + "src/interpreter/mkpeephole.cc", + ] + + configs = [ + ":external_config", + ":internal_config", + ] + + deps = [ + ":v8_libbase", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] +} + ############################################################################### # Public targets # +want_v8_shell = + (current_toolchain == host_toolchain && v8_toolset_for_shell == "host") || + (current_toolchain == v8_snapshot_toolchain && + v8_toolset_for_shell == "host") || + (current_toolchain != host_toolchain && v8_toolset_for_shell == "target") + +group("gn_all") { + testonly = true + + deps = [ + ":d8", + ":v8_hello_world", + ":v8_parser_shell", + ":v8_sample_process", + ":v8_simple_json_fuzzer", + ":v8_simple_parser_fuzzer", + ":v8_simple_regexp_fuzzer", + ":v8_simple_wasm_asmjs_fuzzer", + ":v8_simple_wasm_fuzzer", + "test:gn_all", + "tools:gn_all", + ] + + if (want_v8_shell) { + deps += [ ":v8_shell" ] + } + + if (v8_test_isolation_mode != "noop") { + deps += [ ":d8_run" ] + } +} + if (is_component_build) { - component("v8") { + v8_component("v8") { sources = [ "src/v8dll-main.cc", ] + deps = [ + ":v8_dump_build_config", + ] + public_deps = [ ":v8_base", - snapshot_target, + ":v8_maybe_snapshot", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] public_configs = [ ":external_config" ] - - libs = [] - if (is_android && current_toolchain != host_toolchain) { - libs += [ "log" ] - } } } else { group("v8") { + deps = [ + ":v8_dump_build_config", + ] + public_deps = [ ":v8_base", - snapshot_target, + ":v8_maybe_snapshot", ] public_configs = [ ":external_config" ] } } -if ((current_toolchain == host_toolchain && v8_toolset_for_d8 == "host") || - (current_toolchain == snapshot_toolchain && v8_toolset_for_d8 == "host") || - (current_toolchain != host_toolchain && v8_toolset_for_d8 == "target")) { - executable("d8") { +v8_executable("d8") { + sources = [ + "src/d8.cc", + "src/d8.h", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":d8_js2c", + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + # TODO(jochen): Add support for vtunejit. + + if (is_posix) { + sources += [ "src/d8-posix.cc" ] + } else if (is_win) { + sources += [ "src/d8-windows.cc" ] + } + + if (!is_component_build) { + sources += [ "$target_gen_dir/d8-js.cc" ] + } + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_isolate_run("d8") { + deps = [ + ":d8", + ] + + isolate = "//src/d8.isolate" +} + +v8_executable("v8_hello_world") { + sources = [ + "samples/hello-world.cc", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_executable("v8_sample_process") { + sources = [ + "samples/process.cc", + ] + + configs = [ + # Note: don't use :internal_config here because this target will get + # the :external_config applied to it by virtue of depending on :v8, and + # you can't have both applied to the same target. + ":internal_config_base", + ] + + deps = [ + ":v8", + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } +} + +v8_executable("v8_parser_shell") { + sources = [ + "tools/parser-shell.cc", + "tools/shell-utils.h", + ] + + configs = [ + ":external_config", + ":internal_config_base", + ] + + deps = [ + ":v8_libplatform", + "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", + ] + + if (is_component_build) { + # v8_parser_shell can't be built against a shared library, so we + # need to depend on the underlying static target in that case. + deps += [ ":v8_maybe_snapshot" ] + } else { + deps += [ ":v8" ] + } + + if (v8_enable_i18n_support) { + deps += [ "//third_party/icu" ] + } + + if (is_win) { + # Suppress warnings about importing locally defined symbols. + if (is_component_build) { + ldflags = [ + "/ignore:4049", + "/ignore:4217", + ] + } + } +} + +if (want_v8_shell) { + v8_executable("v8_shell") { sources = [ - "src/d8.cc", - "src/d8.h", + "samples/shell.cc", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ + configs = [ # Note: don't use :internal_config here because this target will get # the :external_config applied to it by virtue of depending on :v8, and # you can't have both applied to the same target. ":internal_config_base", - ":features", - ":toolchain", ] deps = [ - ":d8_js2c", ":v8", ":v8_libplatform", "//build/config/sanitizers:deps", + "//build/win:default_exe_manifest", ] - # TODO(jochen): Add support for vtunejit. - - if (is_posix) { - sources += [ "src/d8-posix.cc" ] - } else if (is_win) { - sources += [ "src/d8-windows.cc" ] - } - - if (!is_component_build) { - sources += [ "$target_gen_dir/d8-js.cc" ] - } if (v8_enable_i18n_support) { deps += [ "//third_party/icu" ] } } } -source_set("json_fuzzer") { +template("v8_fuzzer") { + name = target_name + forward_variables_from(invoker, "*") + v8_executable("v8_simple_" + name) { + deps = [ + ":" + name, + ":simple_fuzzer", + "//build/win:default_exe_manifest", + ] + + configs = [ ":external_config" ] + } +} + +v8_source_set("json_fuzzer") { sources = [ "test/fuzzer/json.cc", ] @@ -2085,17 +2516,13 @@ source_set("json_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("json_fuzzer") { } -source_set("parser_fuzzer") { +v8_source_set("parser_fuzzer") { sources = [ "test/fuzzer/parser.cc", ] @@ -2104,17 +2531,13 @@ source_set("parser_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("parser_fuzzer") { } -source_set("regexp_fuzzer") { +v8_source_set("regexp_fuzzer") { sources = [ "test/fuzzer/regexp.cc", ] @@ -2123,17 +2546,13 @@ source_set("regexp_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("regexp_fuzzer") { } -source_set("wasm_fuzzer") { +v8_source_set("wasm_fuzzer") { sources = [ "test/fuzzer/wasm.cc", ] @@ -2142,17 +2561,13 @@ source_set("wasm_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("wasm_fuzzer") { } -source_set("wasm_asmjs_fuzzer") { +v8_source_set("wasm_asmjs_fuzzer") { sources = [ "test/fuzzer/wasm-asmjs.cc", ] @@ -2161,12 +2576,8 @@ source_set("wasm_asmjs_fuzzer") { ":fuzzer_support", ] - configs -= [ "//build/config/compiler:chromium_code" ] - configs += [ "//build/config/compiler:no_chromium_code" ] - configs += [ - ":internal_config", - ":libplatform_config", - ":features", - ":toolchain", - ] + configs = [ ":internal_config" ] +} + +v8_fuzzer("wasm_asmjs_fuzzer") { } diff --git a/deps/v8/ChangeLog b/deps/v8/ChangeLog index dc97b8042244cc..b2a43a11213240 100644 --- a/deps/v8/ChangeLog +++ b/deps/v8/ChangeLog @@ -1,2145 +1,6074 @@ -2016-04-06: Version 5.1.281 +2016-08-23: Version 5.4.500 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.280 +2016-08-23: Version 5.4.499 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.279 +2016-08-23: Version 5.4.498 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.497 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.496 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.495 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.494 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.493 + + Performance and stability improvements on all platforms. + + +2016-08-23: Version 5.4.492 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.491 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.490 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.489 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.488 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.487 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.486 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.485 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.484 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.483 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.482 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.481 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.480 + + Performance and stability improvements on all platforms. + + +2016-08-22: Version 5.4.479 + + Performance and stability improvements on all platforms. + + +2016-08-20: Version 5.4.478 + + Performance and stability improvements on all platforms. + + +2016-08-20: Version 5.4.477 + + Performance and stability improvements on all platforms. + + +2016-08-20: Version 5.4.476 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.475 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.474 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.473 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.472 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.471 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.470 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.469 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.468 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.467 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.466 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.465 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.464 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.463 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.462 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.461 + + Performance and stability improvements on all platforms. + + +2016-08-19: Version 5.4.460 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.459 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.458 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.457 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.456 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.455 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.454 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.453 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.452 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.451 + + Performance and stability improvements on all platforms. + + +2016-08-18: Version 5.4.450 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.449 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.448 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.447 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.446 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.445 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.444 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.443 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.442 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.441 + + Performance and stability improvements on all platforms. + + +2016-08-17: Version 5.4.440 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.439 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.438 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.437 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.436 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.435 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.434 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.433 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.432 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.431 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.430 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.429 + + Performance and stability improvements on all platforms. + + +2016-08-16: Version 5.4.428 + + Performance and stability improvements on all platforms. + + +2016-08-15: Version 5.4.427 + + Performance and stability improvements on all platforms. + + +2016-08-15: Version 5.4.426 + + Performance and stability improvements on all platforms. + + +2016-08-15: Version 5.4.425 + + Performance and stability improvements on all platforms. + + +2016-08-15: Version 5.4.424 + + Performance and stability improvements on all platforms. + + +2016-08-15: Version 5.4.423 + + Performance and stability improvements on all platforms. + + +2016-08-14: Version 5.4.422 + + Performance and stability improvements on all platforms. + + +2016-08-14: Version 5.4.421 + + Performance and stability improvements on all platforms. + + +2016-08-13: Version 5.4.420 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.419 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.418 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.417 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.416 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.415 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.414 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.413 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.412 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.411 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.410 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.409 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.408 + + Performance and stability improvements on all platforms. + + +2016-08-12: Version 5.4.407 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.406 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.405 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.404 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.403 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.402 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.401 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.400 + + Performance and stability improvements on all platforms. + + +2016-08-11: Version 5.4.399 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.398 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.397 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.396 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.395 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.394 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.393 + + Performance and stability improvements on all platforms. + + +2016-08-10: Version 5.4.392 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.391 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.390 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.389 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.388 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.387 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.386 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.385 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.384 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.383 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.382 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.381 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.380 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.379 + + Performance and stability improvements on all platforms. + + +2016-08-09: Version 5.4.378 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.377 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.376 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.375 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.374 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.373 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.372 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.371 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.370 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.369 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.368 + + Performance and stability improvements on all platforms. + + +2016-08-08: Version 5.4.367 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.366 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.365 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.364 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.363 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.362 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.361 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.360 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.359 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.358 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.357 + + Performance and stability improvements on all platforms. + + +2016-08-05: Version 5.4.356 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.355 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.354 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.353 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.352 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.351 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.350 + + Performance and stability improvements on all platforms. + + +2016-08-04: Version 5.4.349 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.348 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.347 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.346 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.345 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.344 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.343 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.342 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.341 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.340 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.339 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.338 + + Performance and stability improvements on all platforms. + + +2016-08-03: Version 5.4.337 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.336 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.335 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.334 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.333 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.332 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.331 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.330 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.329 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.328 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.327 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.326 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.325 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.324 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.323 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.322 + + Performance and stability improvements on all platforms. + + +2016-08-02: Version 5.4.321 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.320 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.319 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.318 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.317 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.316 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.315 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.314 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.313 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.312 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.311 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.310 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.309 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.308 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.307 + + Performance and stability improvements on all platforms. + + +2016-08-01: Version 5.4.306 + + Performance and stability improvements on all platforms. + + +2016-07-31: Version 5.4.305 + + Performance and stability improvements on all platforms. + + +2016-07-31: Version 5.4.304 + + Performance and stability improvements on all platforms. + + +2016-07-30: Version 5.4.303 + + Performance and stability improvements on all platforms. + + +2016-07-30: Version 5.4.302 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.301 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.300 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.299 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.298 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.297 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.296 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.295 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.294 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.293 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.292 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.291 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.290 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.289 + + Performance and stability improvements on all platforms. + + +2016-07-29: Version 5.4.288 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.287 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.286 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.285 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.284 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.283 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.282 + + Performance and stability improvements on all platforms. + + +2016-07-28: Version 5.4.281 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.280 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.279 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.278 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.277 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.276 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.275 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.274 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.273 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.272 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.271 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.270 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.269 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.268 + + Performance and stability improvements on all platforms. + + +2016-07-27: Version 5.4.267 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.266 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.265 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.264 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.263 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.262 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.261 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.260 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.259 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.258 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.257 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.256 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.255 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.254 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.253 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.252 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.251 + + Performance and stability improvements on all platforms. + + +2016-07-26: Version 5.4.250 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.249 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.248 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.247 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.246 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.245 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.244 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.243 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.242 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.241 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.240 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.239 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.238 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.237 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.236 + + Performance and stability improvements on all platforms. + + +2016-07-25: Version 5.4.235 + + Performance and stability improvements on all platforms. + + +2016-07-24: Version 5.4.234 + + Performance and stability improvements on all platforms. + + +2016-07-24: Version 5.4.233 + + Performance and stability improvements on all platforms. + + +2016-07-23: Version 5.4.232 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.231 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.230 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.229 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.228 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.227 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.226 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.225 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.224 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.223 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.222 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.221 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.220 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.219 + + Performance and stability improvements on all platforms. + + +2016-07-22: Version 5.4.218 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.217 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.216 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.215 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.214 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.213 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.212 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.211 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.210 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.209 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.208 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.207 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.206 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.205 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.204 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.203 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.202 + + Performance and stability improvements on all platforms. + + +2016-07-21: Version 5.4.201 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.200 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.199 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.198 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.197 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.196 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.195 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.194 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.193 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.192 + + Performance and stability improvements on all platforms. + + +2016-07-20: Version 5.4.191 + + Performance and stability improvements on all platforms. + + +2016-07-19: Version 5.4.190 + + Performance and stability improvements on all platforms. + + +2016-07-19: Version 5.4.189 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.188 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.187 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.186 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.185 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.184 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.183 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.182 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.181 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.180 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.179 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.178 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.177 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.176 + + Performance and stability improvements on all platforms. + + +2016-07-18: Version 5.4.175 + + Performance and stability improvements on all platforms. + + +2016-07-17: Version 5.4.174 + + Performance and stability improvements on all platforms. + + +2016-07-17: Version 5.4.173 + + Performance and stability improvements on all platforms. + + +2016-07-17: Version 5.4.172 + + Performance and stability improvements on all platforms. + + +2016-07-16: Version 5.4.171 + + Performance and stability improvements on all platforms. + + +2016-07-16: Version 5.4.170 + + Performance and stability improvements on all platforms. + + +2016-07-16: Version 5.4.169 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.168 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.167 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.166 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.165 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.164 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.163 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.162 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.161 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.160 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.159 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.158 + + Performance and stability improvements on all platforms. + + +2016-07-15: Version 5.4.157 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.156 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.155 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.154 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.153 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.152 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.151 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.150 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.149 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.148 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.147 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.146 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.145 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.144 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.143 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.142 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.141 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.140 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.139 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.138 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.137 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.136 + + Performance and stability improvements on all platforms. + + +2016-07-14: Version 5.4.135 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.134 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.133 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.132 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.131 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.130 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.129 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.128 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.127 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.126 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.125 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.124 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.123 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.122 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.121 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.120 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.119 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.118 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.117 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.116 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.115 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.114 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.113 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.112 + + Performance and stability improvements on all platforms. + + +2016-07-13: Version 5.4.111 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.110 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.109 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.108 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.107 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.106 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.105 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.104 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.103 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.102 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.101 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.100 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.99 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.98 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.97 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.96 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.95 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.94 + + Performance and stability improvements on all platforms. + + +2016-07-12: Version 5.4.93 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.92 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.91 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.90 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.89 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.88 + + Recognize HTMLCloseComment after multiline comment (issue 5142). + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.87 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.86 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.85 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.84 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.83 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.82 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.81 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.80 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.79 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.78 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.77 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.76 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.75 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.74 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.73 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.72 + + Performance and stability improvements on all platforms. + + +2016-07-11: Version 5.4.71 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.70 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.69 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.68 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.67 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.66 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.65 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.64 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.63 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.62 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.61 + + Performance and stability improvements on all platforms. + + +2016-07-08: Version 5.4.60 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.59 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.58 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.57 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.56 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.55 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.54 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.53 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.52 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.51 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.50 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.49 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.48 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.47 + + Performance and stability improvements on all platforms. + + +2016-07-07: Version 5.4.46 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.45 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.44 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.43 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.42 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.41 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.40 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.39 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.38 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.37 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.36 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.35 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.34 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.33 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.32 + + Performance and stability improvements on all platforms. + + +2016-07-06: Version 5.4.31 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.30 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.29 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.28 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.27 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.26 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.25 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.24 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.23 + + Performance and stability improvements on all platforms. + + +2016-07-05: Version 5.4.22 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.21 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.20 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.19 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.18 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.17 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.16 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.15 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.14 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.13 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.12 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.11 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.10 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.9 + + Performance and stability improvements on all platforms. + + +2016-07-04: Version 5.4.8 + + Performance and stability improvements on all platforms. + + +2016-07-03: Version 5.4.7 + + Performance and stability improvements on all platforms. + + +2016-07-03: Version 5.4.6 + + Performance and stability improvements on all platforms. + + +2016-07-03: Version 5.4.5 + + Performance and stability improvements on all platforms. + + +2016-07-03: Version 5.4.4 + + Performance and stability improvements on all platforms. + + +2016-07-01: Version 5.4.3 + + Performance and stability improvements on all platforms. + + +2016-07-01: Version 5.4.2 + + Performance and stability improvements on all platforms. + + +2016-07-01: Version 5.4.1 + + [stubs] GetPropertyStub added (issue 4911). + + [wasm] Fix receiver conversion for WASM->JS calls (Chromium issue + 624713). + + Performance and stability improvements on all platforms. + + +2016-06-30: Version 5.3.351 + + Performance and stability improvements on all platforms. + + +2016-06-30: Version 5.3.350 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.349 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.348 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.347 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.346 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.345 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.344 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.343 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.342 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.341 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.340 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.339 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.338 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.337 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.336 + + Performance and stability improvements on all platforms. + + +2016-06-29: Version 5.3.335 + + Allow trailing commas in function parameter lists (issue 5051). + + Performance and stability improvements on all platforms. + + +2016-06-28: Version 5.3.334 + + Performance and stability improvements on all platforms. + + +2016-06-28: Version 5.3.333 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.332 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.331 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.330 + + [stubs] Implementing CodeStubAssembler::GetOwnProperty() (issue 4911). + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.329 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.328 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.327 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.326 + + Performance and stability improvements on all platforms. + + +2016-06-27: Version 5.3.325 + + Performance and stability improvements on all platforms. + + +2016-06-26: Version 5.3.324 + + Performance and stability improvements on all platforms. + + +2016-06-26: Version 5.3.323 + + Performance and stability improvements on all platforms. + + +2016-06-26: Version 5.3.322 + + Performance and stability improvements on all platforms. + + +2016-06-26: Version 5.3.321 + + Performance and stability improvements on all platforms. + + +2016-06-24: Version 5.3.320 + + Performance and stability improvements on all platforms. + + +2016-06-24: Version 5.3.319 + + Performance and stability improvements on all platforms. + + +2016-06-24: Version 5.3.318 + + Performance and stability improvements on all platforms. + + +2016-06-24: Version 5.3.317 + + Performance and stability improvements on all platforms. + + +2016-06-24: Version 5.3.316 + + Performance and stability improvements on all platforms. + + +2016-06-23: Version 5.3.315 + + Performance and stability improvements on all platforms. + + +2016-06-23: Version 5.3.314 + + Performance and stability improvements on all platforms. + + +2016-06-23: Version 5.3.313 + + Performance and stability improvements on all platforms. + + +2016-06-23: Version 5.3.312 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.311 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.310 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.309 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.308 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.307 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.306 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.305 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.304 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.303 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.302 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.301 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.300 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.299 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.298 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.297 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.296 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.295 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.294 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.293 + + Performance and stability improvements on all platforms. + + +2016-06-22: Version 5.3.292 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.291 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.290 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.289 + + Reland: change most cases of variable redeclaration from TypeError to + SyntaxError (issue 4955). + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.288 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.287 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.286 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.285 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.284 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.283 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.282 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.281 + + Performance and stability improvements on all platforms. + + +2016-06-21: Version 5.3.280 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.279 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.278 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.277 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.276 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.275 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.274 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.273 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.272 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.271 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.270 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.269 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.268 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.267 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.266 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.265 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.264 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.263 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.262 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.261 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.260 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.259 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.258 + + Performance and stability improvements on all platforms. + + +2016-06-20: Version 5.3.257 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.256 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.255 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.254 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.253 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.252 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.251 + + Performance and stability improvements on all platforms. + + +2016-06-17: Version 5.3.250 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.249 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.248 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.247 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.246 + + [es8] Unstage syntactic tail calls (issue 4915). + + [ic] LoadICState cleanup (Chromium issue 576312). + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.245 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.244 + + [ic] Remove --new-load-global-ic switch (Chromium issue 576312). + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.243 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.242 + + Performance and stability improvements on all platforms. + + +2016-06-16: Version 5.3.241 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.240 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.239 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.238 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.237 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.236 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.235 + + [ic] Enable new LoadGlobalIC machinery (Chromium issue 576312). + + [ic] LoadGlobalIC is now able to cache PropertyCells in the feedback + vector (Chromium issue 576312). + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.234 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.233 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.232 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.231 + + Performance and stability improvements on all platforms. + + +2016-06-15: Version 5.3.230 + + Performance and stability improvements on all platforms. + + +2016-06-14: Version 5.3.229 + + [stubs] Ensure that StoreTransitionStub does not bailout after the + properties backing store is enlarged (Chromium issue 601420). + + Performance and stability improvements on all platforms. + + +2016-06-14: Version 5.3.228 + + [ic] Split LoadIC into LoadGlobalIC and LoadIC (Chromium issue 576312). + + Performance and stability improvements on all platforms. + + +2016-06-14: Version 5.3.227 + + Performance and stability improvements on all platforms. + + +2016-06-14: Version 5.3.226 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.225 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.224 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.223 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.222 + + change most cases of variable redeclaration from TypeError to + SyntaxError (issue 4955). + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.221 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.220 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.219 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.218 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.217 + + Performance and stability improvements on all platforms. + + +2016-06-13: Version 5.3.216 + + Performance and stability improvements on all platforms. + + +2016-06-12: Version 5.3.215 + + Performance and stability improvements on all platforms. + + +2016-06-12: Version 5.3.214 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.213 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.212 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.211 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.210 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.209 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.208 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.207 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.206 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.205 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.204 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.203 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.202 + + Performance and stability improvements on all platforms. + + +2016-06-10: Version 5.3.201 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.200 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.199 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.198 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.197 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.196 + + [ic] [stubs] Remove InlineCacheState field from the code flags (Chromium + issue 618701). + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.195 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.194 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.193 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.192 + + [build] Use icu data file by default (Chromium issue 616033). + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.191 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.190 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.189 + + Performance and stability improvements on all platforms. + + +2016-06-09: Version 5.3.188 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.187 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.186 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.185 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.184 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.183 + + [build] Use sysroot for linux compilation with clang (Chromium issues + 474921, 616032). + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.182 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.181 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.180 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.179 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.178 + + [icu] Support loading data file from default location (Chromium issue + 616033). + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.177 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.176 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.175 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.174 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.173 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.172 + + Performance and stability improvements on all platforms. + + +2016-06-08: Version 5.3.171 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.170 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.169 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.168 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.167 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.166 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.165 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.164 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.163 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.162 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.161 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.160 + + [runtime] Don't use ElementsTransitionAndStoreStub for transitions that + involve instance rewriting (issue 5009, Chromium issue 617524). + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.159 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.158 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.157 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.156 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.155 + + Performance and stability improvements on all platforms. + + +2016-06-07: Version 5.3.154 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.153 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.152 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.151 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.150 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.149 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.148 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.147 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.146 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.145 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.144 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.143 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.142 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.141 + + Performance and stability improvements on all platforms. + + +2016-06-06: Version 5.3.140 + + [build] Use sysroot for linux compilation with clang (Chromium issues + 474921, 616032). + + Performance and stability improvements on all platforms. + + +2016-06-05: Version 5.3.139 + + Performance and stability improvements on all platforms. + + +2016-06-04: Version 5.3.138 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.137 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.136 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.135 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.134 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.133 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.132 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.131 + + Performance and stability improvements on all platforms. - Ship --harmony-regexp-exec (issue 4602). + +2016-06-03: Version 5.3.130 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.129 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.128 + + Performance and stability improvements on all platforms. + + +2016-06-03: Version 5.3.127 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.278 +2016-06-03: Version 5.3.126 - [V8] Removed debugger V8::PromiseEvent (Chromium issue 526811). + Performance and stability improvements on all platforms. - [asm.js] Fix typing bug for non-literals in heap access (Chromium issue - 599825). - Ensure CreateDataProperty works correctly on TypedArrays (Chromium issue - 596394). +2016-06-03: Version 5.3.125 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.277 +2016-06-03: Version 5.3.124 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.276 +2016-06-03: Version 5.3.123 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.275 +2016-06-03: Version 5.3.122 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.274 +2016-06-03: Version 5.3.121 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.273 +2016-06-02: Version 5.3.120 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.272 +2016-06-02: Version 5.3.119 Performance and stability improvements on all platforms. -2016-04-05: Version 5.1.271 +2016-06-02: Version 5.3.118 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.270 +2016-06-02: Version 5.3.117 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.269 +2016-06-02: Version 5.3.116 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.268 +2016-06-02: Version 5.3.115 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.267 +2016-06-02: Version 5.3.114 + + [stubs] Extend HasProperty stub with dictionary-mode, string wrapper and + double-elements objects support (issue 2743). + + Performance and stability improvements on all platforms. + - [api] Restrict Template::Set to take templates or primitive values. +2016-06-02: Version 5.3.113 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.266 +2016-06-02: Version 5.3.112 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.265 +2016-06-02: Version 5.3.111 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.264 +2016-06-02: Version 5.3.110 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.263 +2016-06-02: Version 5.3.109 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.262 +2016-06-02: Version 5.3.108 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.261 +2016-06-02: Version 5.3.107 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.260 +2016-06-01: Version 5.3.106 Performance and stability improvements on all platforms. -2016-04-04: Version 5.1.259 +2016-06-01: Version 5.3.105 - Further ES2015 RegExp spec compliance fixes (issue 4602). + Extend HasProperty stub with dictionary-mode, string wrapper and double- + elements objects support (issue 2743). Performance and stability improvements on all platforms. -2016-04-03: Version 5.1.258 +2016-06-01: Version 5.3.104 Performance and stability improvements on all platforms. -2016-04-02: Version 5.1.257 +2016-06-01: Version 5.3.103 Performance and stability improvements on all platforms. -2016-04-02: Version 5.1.256 +2016-06-01: Version 5.3.102 Performance and stability improvements on all platforms. -2016-04-02: Version 5.1.255 +2016-06-01: Version 5.3.101 + + [runtime] Ensure that all elements kind transitions are chained to the + root map (issue 5009). Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.254 +2016-06-01: Version 5.3.100 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.253 +2016-06-01: Version 5.3.99 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.252 +2016-06-01: Version 5.3.98 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.251 +2016-06-01: Version 5.3.97 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.250 +2016-06-01: Version 5.3.96 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.249 +2016-06-01: Version 5.3.95 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.248 +2016-06-01: Version 5.3.94 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.247 +2016-06-01: Version 5.3.93 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.246 +2016-05-31: Version 5.3.92 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.245 +2016-05-31: Version 5.3.91 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.244 +2016-05-31: Version 5.3.90 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.243 +2016-05-31: Version 5.3.89 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.242 +2016-05-31: Version 5.3.88 Performance and stability improvements on all platforms. -2016-04-01: Version 5.1.241 +2016-05-31: Version 5.3.87 + + Performance and stability improvements on all platforms. - [GN] Define USE_EABI_HARDFLOAT=1 when arm_float_abi=="hard" (Chromium - issue 592660). - Ship --harmony-regexp-exec (issue 4602). +2016-05-31: Version 5.3.86 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.240 +2016-05-31: Version 5.3.85 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.239 +2016-05-31: Version 5.3.84 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.238 +2016-05-31: Version 5.3.83 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.237 +2016-05-30: Version 5.3.82 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.236 +2016-05-30: Version 5.3.81 + + [api] Remove deprectated memory allocation callback API (issue 4813). Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.235 +2016-05-30: Version 5.3.80 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.234 +2016-05-30: Version 5.3.79 + + Performance and stability improvements on all platforms. + - [arm/Linux] Don't rely on KUSER_HELPERS feature (Chromium issue 599051). +2016-05-30: Version 5.3.78 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.233 +2016-05-30: Version 5.3.77 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.232 +2016-05-30: Version 5.3.76 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.231 +2016-05-30: Version 5.3.75 + + Performance and stability improvements on all platforms. + - Turn scavenge_reclaim_unmodified_objects on by default (Chromium issue - 4880). +2016-05-30: Version 5.3.74 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.230 +2016-05-30: Version 5.3.73 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.229 +2016-05-30: Version 5.3.72 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.228 +2016-05-30: Version 5.3.71 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.227 +2016-05-30: Version 5.3.70 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.226 +2016-05-30: Version 5.3.69 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.225 +2016-05-30: Version 5.3.68 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.224 +2016-05-29: Version 5.3.67 + + Performance and stability improvements on all platforms. - Raise minimum Mac OS version to 10.7 (issue 4847). + +2016-05-28: Version 5.3.66 Performance and stability improvements on all platforms. -2016-03-31: Version 5.1.223 +2016-05-28: Version 5.3.65 Performance and stability improvements on all platforms. -2016-03-30: Version 5.1.222 +2016-05-27: Version 5.3.64 Performance and stability improvements on all platforms. -2016-03-30: Version 5.1.221 +2016-05-27: Version 5.3.63 Performance and stability improvements on all platforms. -2016-03-30: Version 5.1.220 +2016-05-27: Version 5.3.62 - Stage --harmony-regexp-exec (issue 4602). + Performance and stability improvements on all platforms. - Add fast paths for native RegExps in ES2015 subclass-aware code (issue - 4602). - [V8] Add FunctionMirror.prototype.contextDebugId method (Chromium issue - 595206). +2016-05-27: Version 5.3.61 Performance and stability improvements on all platforms. -2016-03-30: Version 5.1.219 +2016-05-27: Version 5.3.60 - Remove RegExp.prototype.source getter compat workaround (issue 4827, - Chromium issue 581577). + Performance and stability improvements on all platforms. - Check for proper types from error handling code (Chromium issue 596718). - Add ES2015 RegExp full subclassing semantics behind a flag (issue 4602). +2016-05-27: Version 5.3.59 Performance and stability improvements on all platforms. -2016-03-24: Version 5.1.218 +2016-05-27: Version 5.3.58 Performance and stability improvements on all platforms. -2016-03-24: Version 5.1.217 +2016-05-27: Version 5.3.57 + + Performance and stability improvements on all platforms. + - [esnext] implement String padding proposal. +2016-05-26: Version 5.3.56 Performance and stability improvements on all platforms. -2016-03-24: Version 5.1.216 +2016-05-26: Version 5.3.55 Performance and stability improvements on all platforms. -2016-03-24: Version 5.1.215 +2016-05-26: Version 5.3.54 Performance and stability improvements on all platforms. -2016-03-24: Version 5.1.214 +2016-05-26: Version 5.3.53 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.213 +2016-05-25: Version 5.3.52 + + Performance and stability improvements on all platforms. - Implement ES2015 labelled function declaration restrictions (Chromium - issue 595309). + +2016-05-25: Version 5.3.51 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.212 +2016-05-25: Version 5.3.50 + + TypedArray: Make byteOffset, byteLength, and length configurable (issue + 4902). + + Make %ThrowTypeError% function(s) strict (issue 4925). Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.211 +2016-05-25: Version 5.3.49 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.210 +2016-05-25: Version 5.3.48 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.209 +2016-05-25: Version 5.3.47 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.208 +2016-05-25: Version 5.3.46 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.207 +2016-05-25: Version 5.3.45 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.206 +2016-05-25: Version 5.3.44 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.205 +2016-05-25: Version 5.3.43 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.204 +2016-05-25: Version 5.3.42 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.203 +2016-05-25: Version 5.3.41 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.202 +2016-05-25: Version 5.3.40 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.201 +2016-05-25: Version 5.3.39 Performance and stability improvements on all platforms. -2016-03-23: Version 5.1.200 +2016-05-24: Version 5.3.38 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.199 +2016-05-24: Version 5.3.37 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.198 +2016-05-24: Version 5.3.36 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.197 +2016-05-24: Version 5.3.35 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.196 +2016-05-24: Version 5.3.34 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.195 +2016-05-24: Version 5.3.33 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.194 +2016-05-24: Version 5.3.32 + + Performance and stability improvements on all platforms. + - Fix match default behavior on strings for ES2015 semantics (issue 4602). +2016-05-24: Version 5.3.31 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.193 +2016-05-24: Version 5.3.30 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.192 +2016-05-24: Version 5.3.29 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.191 +2016-05-24: Version 5.3.28 + + Performance and stability improvements on all platforms. - [Interpreter] TurboFan implementation of intrinsics (issue 4822). + +2016-05-24: Version 5.3.27 Performance and stability improvements on all platforms. -2016-03-22: Version 5.1.190 +2016-05-24: Version 5.3.26 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.189 +2016-05-24: Version 5.3.25 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.188 +2016-05-24: Version 5.3.24 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.187 +2016-05-24: Version 5.3.23 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.186 +2016-05-24: Version 5.3.22 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.185 +2016-05-23: Version 5.3.21 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.184 +2016-05-23: Version 5.3.20 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.183 +2016-05-23: Version 5.3.19 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.182 +2016-05-23: Version 5.3.18 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.181 +2016-05-23: Version 5.3.17 + + Performance and stability improvements on all platforms. + - Temporarily undeprecate ForceSet (Chromium issue 595601). +2016-05-23: Version 5.3.16 Performance and stability improvements on all platforms. -2016-03-21: Version 5.1.180 +2016-05-23: Version 5.3.15 Performance and stability improvements on all platforms. -2016-03-20: Version 5.1.179 +2016-05-23: Version 5.3.14 Performance and stability improvements on all platforms. -2016-03-20: Version 5.1.178 +2016-05-23: Version 5.3.13 Performance and stability improvements on all platforms. -2016-03-20: Version 5.1.177 +2016-05-23: Version 5.3.12 Performance and stability improvements on all platforms. -2016-03-19: Version 5.1.176 +2016-05-23: Version 5.3.11 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.175 +2016-05-23: Version 5.3.10 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.174 +2016-05-23: Version 5.3.9 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.173 +2016-05-21: Version 5.3.8 + + Performance and stability improvements on all platforms. - Parser: Make skipping HTML comments optional (Chromium issue 573887). - [es7] implement exponentiation operator proposal (issue 3915). +2016-05-21: Version 5.3.7 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.172 +2016-05-21: Version 5.3.6 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.171 +2016-05-20: Version 5.3.5 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.170 +2016-05-20: Version 5.3.4 Performance and stability improvements on all platforms. -2016-03-18: Version 5.1.169 +2016-05-20: Version 5.3.3 + + Move case conversion with ICU to 'staged' (issues 4476, 4477). Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.168 +2016-05-20: Version 5.3.2 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.167 +2016-05-20: Version 5.3.1 + + Move case conversion with ICU to 'staged' (issues 4476, 4477). + + Performance and stability improvements on all platforms. + - Throw the right exceptions from setting elements in - Array.prototype.concat (Chromium issue 595319). +2016-05-19: Version 5.2.371 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.166 +2016-05-19: Version 5.2.370 + + Performance and stability improvements on all platforms. + - Throw exceptions from CreateDataProperty when should_throw (Chromium - issue 595319). +2016-05-19: Version 5.2.369 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.165 +2016-05-19: Version 5.2.368 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.164 +2016-05-18: Version 5.2.367 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.163 +2016-05-18: Version 5.2.366 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.162 +2016-05-18: Version 5.2.365 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.161 +2016-05-18: Version 5.2.364 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.160 +2016-05-18: Version 5.2.363 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.159 +2016-05-18: Version 5.2.362 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.158 +2016-05-18: Version 5.2.361 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.157 +2016-05-18: Version 5.2.360 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.156 +2016-05-18: Version 5.2.359 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.155 +2016-05-18: Version 5.2.358 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.154 +2016-05-18: Version 5.2.357 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.153 +2016-05-18: Version 5.2.356 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.152 +2016-05-18: Version 5.2.355 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.151 +2016-05-18: Version 5.2.354 - Move FastAccessorAssembler from RawMachineAssembler to CodeStubAssembler - (Chromium issue 508898). + Performance and stability improvements on all platforms. + + +2016-05-18: Version 5.2.353 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.150 +2016-05-18: Version 5.2.352 + + Performance and stability improvements on all platforms. + + +2016-05-18: Version 5.2.351 + + Performance and stability improvements on all platforms. + + +2016-05-18: Version 5.2.350 + + Performance and stability improvements on all platforms. + + +2016-05-18: Version 5.2.349 + + Performance and stability improvements on all platforms. + + +2016-05-18: Version 5.2.348 + + Performance and stability improvements on all platforms. + + +2016-05-17: Version 5.2.347 + + Performance and stability improvements on all platforms. + + +2016-05-17: Version 5.2.346 + + Performance and stability improvements on all platforms. - [serializer] Add API to warm up startup snapshot with an additional - script (issue 4836). + +2016-05-17: Version 5.2.345 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.149 +2016-05-17: Version 5.2.344 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.148 +2016-05-17: Version 5.2.343 Performance and stability improvements on all platforms. -2016-03-17: Version 5.1.147 +2016-05-17: Version 5.2.342 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.146 +2016-05-17: Version 5.2.341 + + Performance and stability improvements on all platforms. + - Ship ES2015 restrictions on function declaration locations (issue 4824). +2016-05-17: Version 5.2.340 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.145 +2016-05-17: Version 5.2.339 + + [wasm] remove extra nops in asm-wasm (issue 4203). Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.144 +2016-05-17: Version 5.2.338 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.143 +2016-05-17: Version 5.2.337 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.142 +2016-05-17: Version 5.2.336 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.141 +2016-05-17: Version 5.2.335 Performance and stability improvements on all platforms. -2016-03-16: Version 5.1.140 +2016-05-17: Version 5.2.334 + + Performance and stability improvements on all platforms. + - Put RegExp js code in strict mode (issue 4504). +2016-05-17: Version 5.2.333 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.139 +2016-05-17: Version 5.2.332 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.138 +2016-05-16: Version 5.2.331 + + Performance and stability improvements on all platforms. + - [builtins] Fix Array.prototype.concat bug (Chromium issue 594574). +2016-05-16: Version 5.2.330 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.137 +2016-05-16: Version 5.2.329 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.136 +2016-05-16: Version 5.2.328 + + Add UseCounter for decimal with leading zero (issue 4973). + + [esnext] implement frontend changes for async/await proposal (issue + 4483). Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.135 +2016-05-16: Version 5.2.327 + + Performance and stability improvements on all platforms. + - Ship Array.prototype.values (issue 4247). +2016-05-15: Version 5.2.326 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.134 +2016-05-14: Version 5.2.325 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.133 +2016-05-14: Version 5.2.324 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.132 +2016-05-13: Version 5.2.323 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.131 +2016-05-13: Version 5.2.322 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.130 +2016-05-13: Version 5.2.321 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.129 +2016-05-13: Version 5.2.320 Performance and stability improvements on all platforms. -2016-03-15: Version 5.1.128 +2016-05-13: Version 5.2.319 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.127 +2016-05-13: Version 5.2.318 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.126 +2016-05-13: Version 5.2.317 + + Performance and stability improvements on all platforms. + - Remove --harmony-modules flag and let embedder decide when modules are - used (issue 1569, Chromium issue 594639). +2016-05-13: Version 5.2.316 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.125 +2016-05-13: Version 5.2.315 + + Performance and stability improvements on all platforms. + - Make test262 test runner check for which exception is thrown (issue - 4803). +2016-05-13: Version 5.2.314 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.124 +2016-05-13: Version 5.2.313 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.123 +2016-05-13: Version 5.2.312 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.122 +2016-05-13: Version 5.2.311 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.121 +2016-05-13: Version 5.2.310 + + [api] Clarify expectations of ArrayBuffer::Allocator in API (Chromium + issue 611688). Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.120 +2016-05-13: Version 5.2.309 Performance and stability improvements on all platforms. -2016-03-14: Version 5.1.119 +2016-05-13: Version 5.2.308 Performance and stability improvements on all platforms. -2016-03-13: Version 5.1.118 +2016-05-13: Version 5.2.307 + + In parallel to the strict octal check that would reject `012` in strict + mode, this patch collects UseCounters for `089` in strict mode. The spec + says this should be an error, but this patch does not report it as such + (issue 4973). Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.117 +2016-05-12: Version 5.2.306 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.116 +2016-05-12: Version 5.2.305 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.115 +2016-05-12: Version 5.2.304 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.114 +2016-05-12: Version 5.2.303 + + Performance and stability improvements on all platforms. + - [arm64] Fix i/d cache line size confusion typo (Chromium issue 593867). +2016-05-12: Version 5.2.302 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.113 +2016-05-12: Version 5.2.301 + + Performance and stability improvements on all platforms. + - Fix expression positions for for-loops (issue 4690). +2016-05-12: Version 5.2.300 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.112 +2016-05-12: Version 5.2.299 Performance and stability improvements on all platforms. -2016-03-11: Version 5.1.111 +2016-05-12: Version 5.2.298 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.110 +2016-05-12: Version 5.2.297 + + Performance and stability improvements on all platforms. - Minor library function fixes for TypedArray spec compliance (issue - 4785). - Check that Promise subclasses have callable resolve/reject (issue 4633). +2016-05-12: Version 5.2.296 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.109 +2016-05-12: Version 5.2.295 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.108 +2016-05-11: Version 5.2.294 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.107 +2016-05-11: Version 5.2.293 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.106 +2016-05-11: Version 5.2.292 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.105 +2016-05-11: Version 5.2.291 + + Use ICU case conversion/transliterator for case conversion (issues 4476, + 4477). Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.104 +2016-05-11: Version 5.2.290 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.103 +2016-05-11: Version 5.2.289 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.102 +2016-05-11: Version 5.2.288 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.101 +2016-05-11: Version 5.2.287 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.100 +2016-05-11: Version 5.2.286 + + Performance and stability improvements on all platforms. + - [strong] Remove all remainders of strong mode (issue 3956). +2016-05-11: Version 5.2.285 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.99 +2016-05-11: Version 5.2.284 + + Performance and stability improvements on all platforms. + - Marks the label associated with the runtime call in - CodeStubAssembler::Allocate as deferred (Chromium issue 593359). +2016-05-10: Version 5.2.283 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.98 +2016-05-10: Version 5.2.282 - Implement iterator finalization in array destructuring (issue 3566). + Fix Map::AsArray to properly iterate over the backing store (issue + 4946). Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.97 +2016-05-10: Version 5.2.281 + + Remove LOG line checking from presubmit. Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.96 +2016-05-10: Version 5.2.280 Performance and stability improvements on all platforms. -2016-03-10: Version 5.1.95 +2016-05-10: Version 5.2.279 - String.prototype[Symbol.iterator] does RequireObjectCoercible(this) - (issue 4348). + Performance and stability improvements on all platforms. - Stage restrictive declarations flag (issue 4824). - Expose Array.prototype.values behind a flag and stage it (issue 4247). +2016-05-10: Version 5.2.278 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.94 +2016-05-10: Version 5.2.277 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.93 +2016-05-10: Version 5.2.276 + + Performance and stability improvements on all platforms. + - Ensure appropriate bounds checking for Array subclass concat (Chromium - issue 592340). +2016-05-10: Version 5.2.275 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.92 +2016-05-10: Version 5.2.274 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.91 +2016-05-10: Version 5.2.273 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.90 +2016-05-10: Version 5.2.272 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.89 +2016-05-10: Version 5.2.271 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.88 +2016-05-10: Version 5.2.270 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.87 +2016-05-10: Version 5.2.269 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.86 +2016-05-10: Version 5.2.268 Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.85 +2016-05-10: Version 5.2.267 + + Various species micro-optimizations (Chromium issue 609739). Performance and stability improvements on all platforms. -2016-03-09: Version 5.1.84 +2016-05-09: Version 5.2.266 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.83 +2016-05-09: Version 5.2.265 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.82 +2016-05-09: Version 5.2.264 + + Fix TypedArray Property optimizations (Chromium issue 593634). Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.81 +2016-05-09: Version 5.2.263 + + Performance and stability improvements on all platforms. - Optimize new TypedArray(typedArray) constructor (Chromium issue 592007). - Ensure the @@species protector is updated for accessors (issue 4093). +2016-05-09: Version 5.2.262 - Add UseCounters for various RegExp compatibility issues (Chromium issue - 581577). + [V8] Add v8::Value::TypeOf to API (Chromium issue 595206). Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.80 +2016-05-09: Version 5.2.261 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.79 +2016-05-09: Version 5.2.260 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.78 +2016-05-09: Version 5.2.259 + + Expose IsConstructor to the C++ API (issue 4993). Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.77 +2016-05-09: Version 5.2.258 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.76 +2016-05-09: Version 5.2.257 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.75 +2016-05-09: Version 5.2.256 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.74 +2016-05-09: Version 5.2.255 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.73 +2016-05-09: Version 5.2.254 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.72 +2016-05-08: Version 5.2.253 Performance and stability improvements on all platforms. -2016-03-08: Version 5.1.71 +2016-05-07: Version 5.2.252 + + fix Set::AsArray to not leave undefined holes in output array (issue + 4946). Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.70 +2016-05-06: Version 5.2.251 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.69 +2016-05-06: Version 5.2.250 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.68 +2016-05-06: Version 5.2.249 + + Performance and stability improvements on all platforms. - [key-accumulator] Starting to reimplement the key-accumulator (issue - 4758, Chromium issue 545503). + +2016-05-06: Version 5.2.248 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.67 +2016-05-06: Version 5.2.247 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.66 +2016-05-06: Version 5.2.246 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.65 +2016-05-06: Version 5.2.245 + + Performance and stability improvements on all platforms. + - [key-accumulator] Starting to reimplement the key-accumulator (issue - 4758, Chromium issue 545503). +2016-05-06: Version 5.2.244 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.64 +2016-05-06: Version 5.2.243 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.63 +2016-05-04: Version 5.2.242 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.62 +2016-05-04: Version 5.2.241 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.61 +2016-05-04: Version 5.2.240 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.60 +2016-05-04: Version 5.2.239 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.59 +2016-05-04: Version 5.2.238 + + Performance and stability improvements on all platforms. - Use v8::kGCCallbackFlagCollectAllAvailableGarbage in - Heap::CollectAllAvailableGarbage (Chromium issue 591463). - [key-accumulator] Starting to reimplement the key-accumulator (issue - 4758, Chromium issue 545503). +2016-05-04: Version 5.2.237 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.58 +2016-05-04: Version 5.2.236 - [regexp] Fix off-by-one in CharacterRange::Negate (Chromium issue - 592343). + S390: Add HasProperty code stub that tries simple lookups or jumps to + runtime otherwise (issue 2743). Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.57 +2016-05-04: Version 5.2.235 Performance and stability improvements on all platforms. -2016-03-07: Version 5.1.56 +2016-05-04: Version 5.2.234 + + Make array __proto__ manipulations not disturb the species protector + (Chromium issue 606207). + + Add v8::Object::GetOwnPropertyNames(context, filter) method (issue 3861, + Chromium issue 581495). + + Performance and stability improvements on all platforms. + - Use v8::kGCCallbackFlagCollectAllAvailableGarbage in - Heap::CollectAllAvailableGarbage (Chromium issue 591463). +2016-05-04: Version 5.2.233 Performance and stability improvements on all platforms. -2016-03-06: Version 5.1.55 +2016-05-04: Version 5.2.232 Performance and stability improvements on all platforms. -2016-03-06: Version 5.1.54 +2016-05-04: Version 5.2.231 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.53 +2016-05-04: Version 5.2.230 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.52 +2016-05-04: Version 5.2.229 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.51 +2016-05-04: Version 5.2.228 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.50 +2016-05-04: Version 5.2.227 + + MIPS64: Fix [turbofan] Length and index2 are unsigned in + CheckedLoad/CheckedStore (Chromium issue 599717). Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.49 +2016-05-04: Version 5.2.226 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.48 +2016-05-04: Version 5.2.225 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.47 +2016-05-04: Version 5.2.224 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.46 +2016-05-04: Version 5.2.223 + + Performance and stability improvements on all platforms. + - Introduce v8::MicrotasksScope (Chromium issue 585949). +2016-05-04: Version 5.2.222 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.45 +2016-05-04: Version 5.2.221 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.44 +2016-05-04: Version 5.2.220 - Use a different GCCallbackFlag for GCs triggered by - CollectAllAvailableGarbage (Chromium issue 591463). + [wasm] Fix for 608630: allow proxies as FFI (Chromium issue 608630). Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.43 +2016-05-04: Version 5.2.219 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.42 +2016-05-03: Version 5.2.218 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.41 +2016-05-03: Version 5.2.217 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.40 +2016-05-03: Version 5.2.216 + + [wasm] Disallow runtime calls in asm.js modules (Chromium issue 592352). + + [API] remove (deprecated) hidden properties. + + [wasm] Fix bug with empty input to Wasm.instantiateModuleFromAsm() + (Chromium issue 605488). + + Add HasProperty code stub that tries simple lookups or jumps to runtime + otherwise (issue 2743). + + Fix ExternalTwobyteStringUtf16CharacterStream::PushBack(kEndOfInput) + (Chromium issue 607903). Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.39 +2016-05-03: Version 5.2.215 + + Performance and stability improvements on all platforms. - Ship ES2015 Function.name reform (issue 3699, Chromium issue 588803). - Introduce v8::MicrotasksScope (Chromium issue 585949). +2016-05-03: Version 5.2.214 Performance and stability improvements on all platforms. -2016-03-04: Version 5.1.38 +2016-05-03: Version 5.2.213 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.37 +2016-05-03: Version 5.2.212 + + Performance and stability improvements on all platforms. - Restrict FunctionDeclarations in Statement position (issue 4647). + +2016-05-03: Version 5.2.211 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.36 +2016-05-02: Version 5.2.210 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.35 +2016-05-02: Version 5.2.209 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.34 +2016-05-02: Version 5.2.208 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.33 +2016-05-02: Version 5.2.207 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.32 +2016-05-02: Version 5.2.206 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.31 +2016-05-02: Version 5.2.205 Performance and stability improvements on all platforms. -2016-03-03: Version 5.1.30 +2016-05-02: Version 5.2.204 + + [debugger] Add JSProxy support in Runtime::GetInternalProperties + (Chromium issue 588705). + + Performance and stability improvements on all platforms. - Implement TypedArray(typedarray) constructor (issue 4726). + +2016-05-02: Version 5.2.203 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.29 +2016-05-02: Version 5.2.202 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.28 +2016-05-02: Version 5.2.201 + + Performance and stability improvements on all platforms. + - [turbofan] Adds an Allocate macro to the CodeStubAssembler (Chromium - issue 588692). +2016-05-02: Version 5.2.200 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.27 +2016-05-02: Version 5.2.199 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.26 +2016-05-02: Version 5.2.198 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.25 +2016-05-02: Version 5.2.197 Performance and stability improvements on all platforms. -2016-03-02: Version 5.1.24 +2016-05-02: Version 5.2.196 + + Performance and stability improvements on all platforms. - Devtools: expose scopes source location to debugger (Chromium issue - 327092). - CodeStubAssembler can generate code for builtins (issue 4614). +2016-05-02: Version 5.2.195 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.23 +2016-05-02: Version 5.2.194 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.22 +2016-05-02: Version 5.2.193 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.21 +2016-05-02: Version 5.2.192 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.20 +2016-05-02: Version 5.2.191 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.19 +2016-05-01: Version 5.2.190 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.18 +2016-05-01: Version 5.2.189 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.17 +2016-04-30: Version 5.2.188 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.16 +2016-04-30: Version 5.2.187 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.15 +2016-04-30: Version 5.2.186 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.14 +2016-04-29: Version 5.2.185 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.13 +2016-04-29: Version 5.2.184 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.12 +2016-04-29: Version 5.2.183 Performance and stability improvements on all platforms. -2016-03-01: Version 5.1.11 +2016-04-29: Version 5.2.182 + + Performance and stability improvements on all platforms. - Make %TypedArray%.from spec-compliant (issue 4782). + +2016-04-29: Version 5.2.181 Performance and stability improvements on all platforms. -2016-02-29: Version 5.1.10 +2016-04-29: Version 5.2.180 Performance and stability improvements on all platforms. -2016-02-29: Version 5.1.9 +2016-04-29: Version 5.2.179 Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.8 +2016-04-29: Version 5.2.178 Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.7 +2016-04-29: Version 5.2.177 + + Fix overflow issue in Zone::New (Chromium issue 606115). Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.6 +2016-04-29: Version 5.2.176 Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.5 +2016-04-29: Version 5.2.175 + + [wasm] Binary 11: Bump module version to 0xB. [wasm] Binary 11: Swap the + order of section name / section length. [wasm] Binary 11: Shorter + section names. [wasm] Binary 11: Add a prefix for function type + declarations. [wasm] Binary 11: Function types encoded as pcount, p*, + rcount, r* [wasm] Fix numeric names for functions (Chromium issue + 575167). + + [wasm] Binary 11: WASM AST is now postorder. [wasm] Binary 11: br_table + takes a value. [wasm] Binary 11: Add implicit blocks to if arms. [wasm] + Binary 11: Add arities to call, return, and breaks [wasm] Binary 11: Add + experimental version (Chromium issue 575167). Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.4 +2016-04-29: Version 5.2.174 + + Add checks for detached ArrayBuffers to ArrayBuffer.prototype.slice + (issue 4964). Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.3 +2016-04-28: Version 5.2.173 Performance and stability improvements on all platforms. -2016-02-28: Version 5.1.2 +2016-04-28: Version 5.2.172 Performance and stability improvements on all platforms. -2016-02-27: Version 5.1.1 +2016-04-28: Version 5.2.171 - Fix strict mode function error message (issue 2198). + Ship for-in initializer deprecation (issue 4942). + + Performance and stability improvements on all platforms. - Reland of Make Intl install properties more like how other builtins do - (patchset #1 id:1 of https://codereview.chromium.org/1733293003/ ) - (issue 4778). - [turbofan] Bailout if LoadBuffer typing assumption doesn't hold - (Chromium issue 589792). +2016-04-28: Version 5.2.170 + + Add GC request to libFuzzers in attempt to avoid parasitic coverage + (Chromium issue 584819). Performance and stability improvements on all platforms. -2016-02-26: Version 5.0.104 +2016-04-28: Version 5.2.169 Performance and stability improvements on all platforms. -2016-02-26: Version 5.0.103 +2016-04-28: Version 5.2.168 + + Prevent unnecessary memory (de-)allocations in LiteralBuffer::CopyFrom + (issue 4947). + + Performance and stability improvements on all platforms. - Make Intl install properties more like how other builtins do (issue - 4778). + +2016-04-28: Version 5.2.167 Performance and stability improvements on all platforms. -2016-02-26: Version 5.0.102 +2016-04-28: Version 5.2.166 + + Performance and stability improvements on all platforms. + - Make TypedArray.from and TypedArray.of writable and configurable (issue - 4315). +2016-04-28: Version 5.2.165 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.101 +2016-04-28: Version 5.2.164 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.100 +2016-04-27: Version 5.2.163 + + Performance and stability improvements on all platforms. + - Ship ES2015 iterator finalization (issue 3566). +2016-04-27: Version 5.2.162 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.99 +2016-04-27: Version 5.2.161 + + [esnext] stage --harmony-string-padding (issue 4954). - Introduce MicrotasksCompletedCallback (Chromium issue 585949). + Disallow generator declarations in certain locations (issue 4824). Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.98 +2016-04-27: Version 5.2.160 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.97 +2016-04-27: Version 5.2.159 + + [api] Expose FunctionCallbackInfo::NewTarget (issue 4261). Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.96 +2016-04-27: Version 5.2.158 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.95 +2016-04-27: Version 5.2.157 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.94 +2016-04-27: Version 5.2.156 + + [es8] Report proper syntax error for tail call expressions in for-in and + for-of bodies (issue 4915). Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.93 +2016-04-27: Version 5.2.155 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.92 +2016-04-27: Version 5.2.154 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.91 +2016-04-27: Version 5.2.153 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.90 +2016-04-27: Version 5.2.152 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.89 +2016-04-27: Version 5.2.151 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.88 +2016-04-26: Version 5.2.150 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.87 +2016-04-26: Version 5.2.149 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.86 +2016-04-26: Version 5.2.148 Performance and stability improvements on all platforms. -2016-02-25: Version 5.0.85 +2016-04-26: Version 5.2.147 + + Do not penalize performance when --harmony-species is off (Chromium + issue 606207). Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.84 +2016-04-26: Version 5.2.146 + + [es8] Initial set of changes to support syntactic tail calls (issue + 4915). Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.83 +2016-04-26: Version 5.2.145 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.82 +2016-04-26: Version 5.2.144 + + Performance and stability improvements on all platforms. - Ensure IteratorClose is called for errors in non-declaring assignments - (issue 4776). - Fix priority of exceptions being thrown from for-of loops (issue 4775). +2016-04-26: Version 5.2.143 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.81 +2016-04-26: Version 5.2.142 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.80 +2016-04-26: Version 5.2.141 + + Performance and stability improvements on all platforms. - Encode interpreter::SourcePositionTable as variable-length ints (issue - 4690). - Stage ES2015 iterator finalization (issue 3566). +2016-04-26: Version 5.2.140 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.79 +2016-04-26: Version 5.2.139 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.78 +2016-04-26: Version 5.2.138 + + [es6] Fix tail call elimination in single-expression arrow functions + (issue 4698). Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.77 +2016-04-26: Version 5.2.137 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.76 +2016-04-25: Version 5.2.136 Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.75 +2016-04-25: Version 5.2.135 + + Widen --harmony-for-in flag to throw errors in PreParser (issue 4942). Performance and stability improvements on all platforms. -2016-02-24: Version 5.0.74 +2016-04-25: Version 5.2.134 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.73 +2016-04-25: Version 5.2.133 - Intl: Use private symbols to memoize bound functions (issue 3785). + Performance and stability improvements on all platforms. - Ensure Array.prototype.indexOf returns +0 rather than -0. - Ship ES2015 Symbol.species (issue 4093). +2016-04-25: Version 5.2.132 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.72 +2016-04-25: Version 5.2.131 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.71 +2016-04-25: Version 5.2.130 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.70 +2016-04-25: Version 5.2.129 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.69 +2016-04-25: Version 5.2.128 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.68 +2016-04-25: Version 5.2.127 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.67 +2016-04-25: Version 5.2.126 Performance and stability improvements on all platforms. -2016-02-23: Version 5.0.66 +2016-04-25: Version 5.2.125 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.65 +2016-04-25: Version 5.2.124 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.64 +2016-04-25: Version 5.2.123 + + Performance and stability improvements on all platforms. - ES2015 web compat workaround: RegExp.prototype.flags => "" (Chromium - issue 581577). - Remove the Proxy enumerate trap (issue 4768). +2016-04-25: Version 5.2.122 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.63 +2016-04-22: Version 5.2.121 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.62 +2016-04-22: Version 5.2.120 + + Performance and stability improvements on all platforms. + - Remove Reflect.enumerate (issue 4768). +2016-04-22: Version 5.2.119 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.61 +2016-04-22: Version 5.2.118 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.60 +2016-04-22: Version 5.2.117 + + [debugger] Hide scopes that originate from desugaring (Chromium issue + 604458). Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.59 +2016-04-22: Version 5.2.116 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.58 +2016-04-22: Version 5.2.115 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.57 +2016-04-21: Version 5.2.114 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.56 +2016-04-21: Version 5.2.113 Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.55 +2016-04-21: Version 5.2.112 + + [ic] Restore PROPERTY key tracking in keyed ICs (Chromium issue 594183). Performance and stability improvements on all platforms. -2016-02-22: Version 5.0.54 +2016-04-21: Version 5.2.111 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.53 +2016-04-21: Version 5.2.110 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.52 +2016-04-21: Version 5.2.109 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.51 +2016-04-21: Version 5.2.108 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.50 +2016-04-21: Version 5.2.107 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.49 +2016-04-21: Version 5.2.106 Performance and stability improvements on all platforms. -2016-02-21: Version 5.0.48 +2016-04-21: Version 5.2.105 Performance and stability improvements on all platforms. -2016-02-20: Version 5.0.47 +2016-04-21: Version 5.2.104 Performance and stability improvements on all platforms. -2016-02-20: Version 5.0.46 +2016-04-21: Version 5.2.103 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.45 +2016-04-21: Version 5.2.102 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.44 +2016-04-20: Version 5.2.101 + + Performance and stability improvements on all platforms. - Return undefined from RegExp.prototype.compile (Chromium issue 585775). + +2016-04-20: Version 5.2.100 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.43 +2016-04-20: Version 5.2.99 + + Performance and stability improvements on all platforms. - Disable --harmony-object-observe (Chromium issue 552100). + +2016-04-20: Version 5.2.98 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.42 +2016-04-20: Version 5.2.97 + + Performance and stability improvements on all platforms. + - Introduce BeforeCallEnteredCallback (Chromium issue 585949). +2016-04-20: Version 5.2.96 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.41 +2016-04-20: Version 5.2.95 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.40 +2016-04-20: Version 5.2.94 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.39 +2016-04-20: Version 5.2.93 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.38 +2016-04-20: Version 5.2.92 + + Performance and stability improvements on all platforms. + - [wasm] Add support for import section (Chromium issue 575167). +2016-04-20: Version 5.2.91 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.37 +2016-04-20: Version 5.2.90 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.36 +2016-04-20: Version 5.2.89 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.35 +2016-04-20: Version 5.2.88 + + [turbofan] Length and index2 are unsigned in CheckedLoad/CheckedStore + (Chromium issue 599717). + + Prevent un-parsed LiteralFunction reaching the compiler (Chromium issue + 604044). Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.34 +2016-04-20: Version 5.2.87 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.33 +2016-04-20: Version 5.2.86 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.32 +2016-04-19: Version 5.2.85 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.31 +2016-04-19: Version 5.2.84 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.30 +2016-04-19: Version 5.2.83 + + Performance and stability improvements on all platforms. + - Mark old SetAccessCheckCallback as deprecated. +2016-04-19: Version 5.2.82 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.29 +2016-04-19: Version 5.2.81 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.28 +2016-04-19: Version 5.2.80 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.27 +2016-04-19: Version 5.2.79 Performance and stability improvements on all platforms. -2016-02-19: Version 5.0.26 +2016-04-19: Version 5.2.78 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.25 +2016-04-19: Version 5.2.77 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.24 +2016-04-19: Version 5.2.76 + + Performance and stability improvements on all platforms. + - Make Date.prototype.toGMTString an alias for Date.prototype.toUTCString - (issue 4708). +2016-04-19: Version 5.2.75 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.23 +2016-04-19: Version 5.2.74 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.22 +2016-04-19: Version 5.2.73 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.21 +2016-04-19: Version 5.2.72 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.20 +2016-04-19: Version 5.2.71 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.19 +2016-04-19: Version 5.2.70 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.18 +2016-04-19: Version 5.2.69 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.17 +2016-04-19: Version 5.2.68 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.16 +2016-04-19: Version 5.2.67 + + Performance and stability improvements on all platforms. + - [es6] Implement for-of iterator finalization (issue 2214). +2016-04-19: Version 5.2.66 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.15 +2016-04-18: Version 5.2.65 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.14 +2016-04-18: Version 5.2.64 + + Performance and stability improvements on all platforms. - Use displayName in Error.stack rendering if present (issue 4761). + +2016-04-18: Version 5.2.63 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.13 +2016-04-18: Version 5.2.62 Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.12 +2016-04-18: Version 5.2.61 + + [Atomics] Remove Atomics code stubs; use TF ops (issue 4614). Performance and stability improvements on all platforms. -2016-02-18: Version 5.0.11 +2016-04-18: Version 5.2.60 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.10 +2016-04-18: Version 5.2.59 + + Performance and stability improvements on all platforms. - [Atomics] Add dmb/dsb/isb instructions to ARM (issue 4614). + +2016-04-18: Version 5.2.58 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.9 +2016-04-18: Version 5.2.57 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.8 +2016-04-18: Version 5.2.56 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.7 +2016-04-18: Version 5.2.55 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.6 +2016-04-18: Version 5.2.54 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.5 +2016-04-18: Version 5.2.53 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.4 +2016-04-18: Version 5.2.52 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.3 +2016-04-18: Version 5.2.51 Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.2 +2016-04-18: Version 5.2.50 + + [Atomics] Remove Atomics code stubs; use TF ops (issue 4614). Performance and stability improvements on all platforms. -2016-02-17: Version 5.0.1 +2016-04-18: Version 5.2.49 + + [api] Bring back finalizers on global handles. Performance and stability improvements on all platforms. +2016-02-17: Sentinel + + The ChangeLog file is no longer maintained on master. This + sentinel should stay on top of this list. + 2016-02-17: Version 4.10.253 Performance and stability improvements on all platforms. @@ -7268,12 +11197,6 @@ Performance and stability improvements on all platforms. -2015-05-17: Sentinel - - The ChangeLog file is no longer maintained on bleeding_edge. This - sentinel should stay on top of this list. - - 2015-05-17: Version 4.5.2 Performance and stability improvements on all platforms. diff --git a/deps/v8/DEPS b/deps/v8/DEPS index 0559523283f74e..6cac01d5974c44 100644 --- a/deps/v8/DEPS +++ b/deps/v8/DEPS @@ -7,16 +7,28 @@ vars = { } deps = { - "v8/build/gyp": - Var("git_url") + "/external/gyp.git" + "@" + "4ec6c4e3a94bd04a6da2858163d40b2429b8aad1", + "v8/build": + Var("git_url") + "/chromium/src/build.git" + "@" + "59daf502c36f20b5c9292f4bd9af85791f8a5884", + "v8/tools/gyp": + Var("git_url") + "/external/gyp.git" + "@" + "702ac58e477214c635d9b541932e75a95d349352", "v8/third_party/icu": - Var("git_url") + "/chromium/deps/icu.git" + "@" + "c291cde264469b20ca969ce8832088acb21e0c48", + Var("git_url") + "/chromium/deps/icu.git" + "@" + "2341038bf72869a5683a893a2b319a48ffec7f62", + "v8/third_party/instrumented_libraries": + Var("git_url") + "/chromium/src/third_party/instrumented_libraries.git" + "@" + "f15768d7fdf68c0748d20738184120c8ab2e6db7", "v8/buildtools": - Var("git_url") + "/chromium/buildtools.git" + "@" + "80b5126f91be4eb359248d28696746ef09d5be67", + Var("git_url") + "/chromium/buildtools.git" + "@" + "adb8bf4e8fc92aa1717bf151b862d58e6f27c4f2", "v8/base/trace_event/common": - Var("git_url") + "/chromium/src/base/trace_event/common.git" + "@" + "c8c8665c2deaf1cc749d9f8e153256d4f67bf1b8", + Var("git_url") + "/chromium/src/base/trace_event/common.git" + "@" + "315bf1e2d45be7d53346c31cfcc37424a32c30c8", + "v8/third_party/WebKit/Source/platform/inspector_protocol": + Var("git_url") + "/chromium/src/third_party/WebKit/Source/platform/inspector_protocol.git" + "@" + "547960151fb364dd9a382fa79ffc9abfb184e3d1", + "v8/third_party/jinja2": + Var("git_url") + "/chromium/src/third_party/jinja2.git" + "@" + "2222b31554f03e62600cd7e383376a7c187967a1", + "v8/third_party/markupsafe": + Var("git_url") + "/chromium/src/third_party/markupsafe.git" + "@" + "484a5661041cac13bfc688a26ec5434b05d18961", + "v8/tools/mb": + Var('git_url') + '/chromium/src/tools/mb.git' + '@' + "99788b8b516c44d7db25cfb68695bc234fdee5ed", "v8/tools/swarming_client": - Var('git_url') + '/external/swarming.client.git' + '@' + "df6e95e7669883c8fe9ef956c69a544154701a49", + Var('git_url') + '/external/swarming.client.git' + '@' + "e4288c3040a32f2e7ad92f957668f2ee3d36e5a6", "v8/testing/gtest": Var("git_url") + "/external/github.com/google/googletest.git" + "@" + "6f8a66431cb592dad629028a50b3dd418a408c87", "v8/testing/gmock": @@ -25,17 +37,19 @@ deps = { Var("git_url") + "/v8/deps/third_party/benchmarks.git" + "@" + "05d7188267b4560491ff9155c5ee13e207ecd65f", "v8/test/mozilla/data": Var("git_url") + "/v8/deps/third_party/mozilla-tests.git" + "@" + "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be", - "v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "c8ef63c728283debc25891123eb00482fee4b8cd", + "v8/test/simdjs/data": Var("git_url") + "/external/github.com/tc39/ecmascript_simd.git" + "@" + "baf493985cb9ea7cdbd0d68704860a8156de9556", "v8/test/test262/data": - Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "57d3e2216fa86ad63b6c0a54914ba9dcbff96003", + Var("git_url") + "/external/github.com/tc39/test262.git" + "@" + "88bc7fe7586f161201c5f14f55c9c489f82b1b67", + "v8/test/test262/harness": + Var("git_url") + "/external/github.com/test262-utils/test262-harness-py.git" + "@" + "cbd968f54f7a95c6556d53ba852292a4c49d11d8", "v8/tools/clang": - Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "faee82e064e04e5cbf60cc7327e7a81d2a4557ad", + Var("git_url") + "/chromium/src/tools/clang.git" + "@" + "3afb04a8153e40ff00f9eaa14337851c3ab4a368", } deps_os = { "android": { "v8/third_party/android_tools": - Var("git_url") + "/android_tools.git" + "@" + "adfd31794011488cd0fc716b53558b2d8a67af8b", + Var("git_url") + "/android_tools.git" + "@" + "af1c5a4cd6329ccdcf8c2bc93d9eea02f9d74869", }, "win": { "v8/third_party/cygwin": @@ -43,6 +57,8 @@ deps_os = { } } +recursedeps = [ 'v8/third_party/android_tools' ] + include_rules = [ # Everybody can use some things. "+include", @@ -53,6 +69,7 @@ include_rules = [ # checkdeps.py shouldn't check for includes in these directories: skip_child_includes = [ "build", + "gypfiles", "third_party", ] @@ -65,7 +82,7 @@ hooks = [ 'pattern': '.', 'action': [ 'python', - 'v8/build/landmines.py', + 'v8/gypfiles/landmines.py', ], }, # Pull clang-format binaries using checked-in hashes. @@ -186,11 +203,33 @@ hooks = [ "-s", "v8/buildtools/linux64/gn.sha1", ], }, + { + # Downloads the current stable linux sysroot to build/linux/ if needed. + # This sysroot updates at about the same rate that the chrome build deps + # change. + 'name': 'sysroot', + 'pattern': '.', + 'action': [ + 'python', + 'v8/build/linux/sysroot_scripts/install-sysroot.py', + '--running-as-hook', + ], + }, + { + # Pull sanitizer-instrumented third-party libraries if requested via + # GYP_DEFINES. + 'name': 'instrumented_libraries', + 'pattern': '\\.sha1', + 'action': [ + 'python', + 'v8/third_party/instrumented_libraries/scripts/download_binaries.py', + ], + }, { # Update the Windows toolchain if necessary. 'name': 'win_toolchain', 'pattern': '.', - 'action': ['python', 'v8/build/vs_toolchain.py', 'update'], + 'action': ['python', 'v8/gypfiles/vs_toolchain.py', 'update'], }, # Pull binutils for linux, enabled debug fission for faster linking / # debugging when used with clang on Ubuntu Precise. @@ -208,7 +247,7 @@ hooks = [ # Note: This must run before the clang update. 'name': 'gold_plugin', 'pattern': '.', - 'action': ['python', 'v8/build/download_gold_plugin.py'], + 'action': ['python', 'v8/gypfiles/download_gold_plugin.py'], }, { # Pull clang if needed or requested via GYP_DEFINES. @@ -220,6 +259,6 @@ hooks = [ { # A change to a .gyp, .gypi, or to GYP itself should run the generator. "pattern": ".", - "action": ["python", "v8/build/gyp_v8"], + "action": ["python", "v8/gypfiles/gyp_v8"], }, ] diff --git a/deps/v8/src/third_party/fdlibm/LICENSE b/deps/v8/LICENSE.fdlibm similarity index 100% rename from deps/v8/src/third_party/fdlibm/LICENSE rename to deps/v8/LICENSE.fdlibm diff --git a/deps/v8/Makefile b/deps/v8/Makefile index a0c08a6d9634c7..a6d4d135da3da1 100644 --- a/deps/v8/Makefile +++ b/deps/v8/Makefile @@ -33,7 +33,6 @@ GYPFLAGS ?= TESTFLAGS ?= ANDROID_NDK_HOST_ARCH ?= ANDROID_V8 ?= /data/local/tmp/v8 -NACL_SDK_ROOT ?= # Special build flags. Use them like this: "make library=shared" @@ -122,10 +121,6 @@ endif ifeq ($(werror), no) GYPFLAGS += -Dwerror='' endif -# presubmit=no -ifeq ($(presubmit), no) - TESTFLAGS += --no-presubmit -endif # strictaliasing=off (workaround for GCC-4.5) ifeq ($(strictaliasing), off) GYPFLAGS += -Dv8_no_strict_aliasing=1 @@ -227,6 +222,11 @@ ifeq ($(no_omit_framepointer), on) GYPFLAGS += -Drelease_extra_cflags=-fno-omit-frame-pointer endif +ifdef android_ndk_root + GYPFLAGS += -Dandroid_ndk_root=$(android_ndk_root) + export ANDROID_NDK_ROOT = $(android_ndk_root) +endif + # ----------------- available targets: -------------------- # - "grokdump": rebuilds heap constants lists used by grokdump # - any arch listed in ARCHES (see below) @@ -235,7 +235,6 @@ endif # - "native": current host's architecture, release mode # - any of the above with .check appended, e.g. "ia32.release.check" # - "android": cross-compile for Android/ARM -# - "nacl" : cross-compile for Native Client (ia32 and x64) # - default (no target specified): build all DEFAULT_ARCHES and MODES # - "check": build all targets and run all tests # - ".clean" for any in ARCHES @@ -245,21 +244,22 @@ endif # Architectures and modes to be compiled. Consider these to be internal # variables, don't override them (use the targets instead). -ARCHES = ia32 x64 x32 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 \ - s390 s390x +ARCHES = ia32 x64 arm arm64 mips mipsel mips64 mips64el x87 ppc ppc64 s390 \ + s390x +ARCHES32 = ia32 arm mips mipsel x87 ppc s390 DEFAULT_ARCHES = ia32 x64 arm MODES = release debug optdebug DEFAULT_MODES = release debug ANDROID_ARCHES = android_ia32 android_x64 android_arm android_arm64 \ android_mipsel android_x87 -NACL_ARCHES = nacl_ia32 nacl_x64 # List of files that trigger Makefile regeneration: GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \ - build/shim_headers.gypi build/features.gypi build/standalone.gypi \ - build/toolchain.gypi build/all.gyp build/mac/asan.gyp \ + gypfiles/shim_headers.gypi gypfiles/features.gypi \ + gypfiles/standalone.gypi \ + gypfiles/toolchain.gypi gypfiles/all.gyp gypfiles/mac/asan.gyp \ test/cctest/cctest.gyp test/fuzzer/fuzzer.gyp \ - test/unittests/unittests.gyp tools/gyp/v8.gyp \ + test/unittests/unittests.gyp src/v8.gyp \ tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \ buildtools/third_party/libc++abi/libc++abi.gyp \ buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \ @@ -273,13 +273,10 @@ endif BUILDS = $(foreach mode,$(MODES),$(addsuffix .$(mode),$(ARCHES))) ANDROID_BUILDS = $(foreach mode,$(MODES), \ $(addsuffix .$(mode),$(ANDROID_ARCHES))) -NACL_BUILDS = $(foreach mode,$(MODES), \ - $(addsuffix .$(mode),$(NACL_ARCHES))) # Generates corresponding test targets, e.g. "ia32.release.check". CHECKS = $(addsuffix .check,$(BUILDS)) QUICKCHECKS = $(addsuffix .quickcheck,$(BUILDS)) ANDROID_CHECKS = $(addsuffix .check,$(ANDROID_BUILDS)) -NACL_CHECKS = $(addsuffix .check,$(NACL_BUILDS)) # File where previously used GYPFLAGS are stored. ENVFILE = $(OUTDIR)/environment @@ -288,9 +285,7 @@ ENVFILE = $(OUTDIR)/environment $(addsuffix .quickcheck,$(MODES)) $(addsuffix .quickcheck,$(ARCHES)) \ $(ARCHES) $(MODES) $(BUILDS) $(CHECKS) $(addsuffix .clean,$(ARCHES)) \ $(addsuffix .check,$(MODES)) $(addsuffix .check,$(ARCHES)) \ - $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) \ - $(NACL_ARCHES) $(NACL_BUILDS) $(NACL_CHECKS) \ - must-set-NACL_SDK_ROOT + $(ANDROID_ARCHES) $(ANDROID_BUILDS) $(ANDROID_CHECKS) # Target definitions. "all" is the default. all: $(DEFAULT_MODES) @@ -329,16 +324,6 @@ $(ANDROID_BUILDS): $(GYPFILES) $(ENVFILE) Makefile.android OUTDIR="$(OUTDIR)" \ GYPFLAGS="$(GYPFLAGS)" -$(NACL_ARCHES): $(addprefix $$@.,$(MODES)) - -$(NACL_BUILDS): $(GYPFILES) $(ENVFILE) \ - Makefile.nacl must-set-NACL_SDK_ROOT - @$(MAKE) -f Makefile.nacl $@ \ - ARCH="$(basename $@)" \ - MODE="$(subst .,,$(suffix $@))" \ - OUTDIR="$(OUTDIR)" \ - GYPFLAGS="$(GYPFLAGS)" - # Test targets. check: all @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ @@ -382,15 +367,6 @@ $(addsuffix .check, $(ANDROID_BUILDS)): $$(basename $$@).sync $(addsuffix .check, $(ANDROID_ARCHES)): \ $(addprefix $$(basename $$@).,$(MODES)).check -$(addsuffix .check, $(NACL_BUILDS)): $$(basename $$@) - @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR) \ - --arch-and-mode=$(basename $@) \ - --timeout=600 --nopresubmit --noi18n \ - --command-prefix="tools/nacl-run.py" - -$(addsuffix .check, $(NACL_ARCHES)): \ - $(addprefix $$(basename $$@).,$(MODES)).check - native.check: native @tools/run-tests.py $(TESTJOBS) --outdir=$(OUTDIR)/native \ --arch-and-mode=. $(TESTFLAGS) @@ -420,7 +396,7 @@ turbocheck: $(subst $(COMMA),$(SPACE),$(FASTCOMPILEMODES)) tc: turbocheck # Clean targets. You can clean each architecture individually, or everything. -$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)): +$(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)): rm -f $(OUTDIR)/Makefile.$(basename $@)* rm -rf $(OUTDIR)/$(basename $@).release rm -rf $(OUTDIR)/$(basename $@).debug @@ -432,7 +408,7 @@ native.clean: rm -rf $(OUTDIR)/native find $(OUTDIR) -regex '.*\(host\|target\)\.native\.mk' -delete -clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES) $(NACL_ARCHES)) native.clean gtags.clean +clean: $(addsuffix .clean, $(ARCHES) $(ANDROID_ARCHES)) native.clean gtags.clean tags.clean # GYP file generation targets. OUT_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(BUILDS)) @@ -441,34 +417,28 @@ $(OUT_MAKEFILES): $(GYPFILES) $(ENVFILE) cut -f 2 -d " " | cut -f 1 -d "-" )) $(eval CXX_TARGET_ARCH:=$(subst aarch64,arm64,$(CXX_TARGET_ARCH))) $(eval CXX_TARGET_ARCH:=$(subst x86_64,x64,$(CXX_TARGET_ARCH))) + $(eval CXX_TARGET_ARCH:=$(subst s390x,s390,$(CXX_TARGET_ARCH))) + $(eval CXX_TARGET_ARCH:=$(subst powerpc,ppc,$(CXX_TARGET_ARCH))) + $(eval CXX_TARGET_ARCH:=$(subst ppc64,ppc,$(CXX_TARGET_ARCH))) + $(eval CXX_TARGET_ARCH:=$(subst ppcle,ppc,$(CXX_TARGET_ARCH))) $(eval V8_TARGET_ARCH:=$(subst .,,$(suffix $(basename $@)))) - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \ GYP_GENERATORS=make \ - build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. \ + tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \ + -Igypfiles/standalone.gypi --depth=. \ -Dv8_target_arch=$(V8_TARGET_ARCH) \ $(if $(findstring $(CXX_TARGET_ARCH),$(V8_TARGET_ARCH)), \ - -Dtarget_arch=$(V8_TARGET_ARCH),) \ + -Dtarget_arch=$(V8_TARGET_ARCH), \ + $(if $(shell echo $(ARCHES32) | grep $(V8_TARGET_ARCH)), \ + -Dtarget_arch=ia32,)) \ $(if $(findstring optdebug,$@),-Dv8_optimized_debug=1,) \ -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) $(OUTDIR)/Makefile.native: $(GYPFILES) $(ENVFILE) - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH):$(shell pwd)/build/gyp/pylib:$(PYTHONPATH)" \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH):$(shell pwd)/tools/gyp/pylib:$(PYTHONPATH)" \ GYP_GENERATORS=make \ - build/gyp/gyp --generator-output="$(OUTDIR)" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. -S.native $(GYPFLAGS) - -# Note that NACL_SDK_ROOT must be set to point to an appropriate -# Native Client SDK before using this makefile. You can download -# an SDK here: -# https://developers.google.com/native-client/sdk/download -# The path indicated by NACL_SDK_ROOT will typically end with -# a folder for a pepper version such as "pepper_25" that should -# have "tools" and "toolchain" subdirectories. -must-set-NACL_SDK_ROOT: -ifndef NACL_SDK_ROOT - $(error NACL_SDK_ROOT must be set) -endif + tools/gyp/gyp --generator-output="$(OUTDIR)" gypfiles/all.gyp \ + -Igypfiles/standalone.gypi --depth=. -S.native $(GYPFLAGS) # Replaces the old with the new environment file if they're different, which # will trigger GYP to regenerate Makefiles. @@ -497,11 +467,21 @@ gtags.files: $(GYPFILES) $(ENVFILE) # We need to manually set the stack limit here, to work around bugs in # gmake-3.81 and global-5.7.1 on recent 64-bit Linux systems. -GPATH GRTAGS GSYMS GTAGS: gtags.files $(shell cat gtags.files 2> /dev/null) +# Using $(wildcard ...) gracefully ignores non-existing files, so that stale +# gtags.files after switching branches don't cause recipe failures. +GPATH GRTAGS GSYMS GTAGS: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null)) @bash -c 'ulimit -s 10240 && GTAGSFORCECPP=yes gtags -i -q -f $<' gtags.clean: rm -f gtags.files GPATH GRTAGS GSYMS GTAGS +tags: gtags.files $(wildcard $(shell cat gtags.files 2> /dev/null)) + @(ctags --version | grep 'Exuberant Ctags' >/dev/null) || \ + (echo "Please install Exuberant Ctags (check 'ctags --version')" >&2; false) + ctags --fields=+l -L $< + +tags.clean: + rm -r tags + dependencies builddeps: $(error Use 'gclient sync' instead) diff --git a/deps/v8/Makefile.android b/deps/v8/Makefile.android index c49cb85b9b6514..417152177d73c2 100644 --- a/deps/v8/Makefile.android +++ b/deps/v8/Makefile.android @@ -66,7 +66,7 @@ ANDROID_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(ANDROID_BUILDS)) $(ANDROID_MAKEFILES): GYP_GENERATORS=make-android \ GYP_DEFINES="${DEFINES}" \ - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ - build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. \ + PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/gypfiles:$(PYTHONPATH)" \ + tools/gyp/gyp --generator-output="${OUTDIR}" gypfiles/all.gyp \ + -Igypfiles/standalone.gypi --depth=. \ -S$(suffix $(basename $@))$(suffix $@) ${GYPFLAGS} diff --git a/deps/v8/Makefile.nacl b/deps/v8/Makefile.nacl deleted file mode 100644 index 3459c42c0d865c..00000000000000 --- a/deps/v8/Makefile.nacl +++ /dev/null @@ -1,97 +0,0 @@ -# -# Copyright 2013 the V8 project authors. All rights reserved. -# 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. -# * Neither the name of Google Inc. nor the names of its -# contributors may be used to endorse or promote products derived -# from this software without specific prior written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -# "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 -# OWNER OR CONTRIBUTORS 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. - -# Those definitions should be consistent with the main Makefile -NACL_ARCHES = nacl_ia32 nacl_x64 -MODES = release debug - -# Generates all combinations of NACL ARCHES and MODES, -# e.g. "nacl_ia32.release" or "nacl_x64.release" -NACL_BUILDS = $(foreach mode,$(MODES), \ - $(addsuffix .$(mode),$(NACL_ARCHES))) - -HOST_OS = $(shell uname -s | sed -e 's/Linux/linux/;s/Darwin/mac/') -TOOLCHAIN_PATH = $(realpath ${NACL_SDK_ROOT}/toolchain) -NACL_TOOLCHAIN ?= ${TOOLCHAIN_PATH}/linux_pnacl - -ifeq ($(wildcard $(NACL_TOOLCHAIN)),) - $(error Cannot find Native Client toolchain in "${NACL_TOOLCHAIN}") -endif - -ifeq ($(ARCH), nacl_ia32) - GYPENV = nacl_target_arch=nacl_ia32 v8_target_arch=arm v8_host_arch=ia32 - NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang" - NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++" - NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch x86-32" -else - ifeq ($(ARCH), nacl_x64) - GYPENV = nacl_target_arch=nacl_x64 v8_target_arch=arm v8_host_arch=ia32 - NACL_CC = "$(NACL_TOOLCHAIN)/bin/pnacl-clang" - NACL_CXX = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++" - NACL_LINK = "$(NACL_TOOLCHAIN)/bin/pnacl-clang++ --pnacl-allow-native -arch x86-64" - else - $(error Target architecture "${ARCH}" is not supported) - endif -endif - -# For mksnapshot host generation. -GYPENV += host_os=${HOST_OS} - -# ICU doesn't support NaCl. -GYPENV += v8_enable_i18n_support=0 - -# Disable strict aliasing - v8 code often relies on undefined behavior of C++. -GYPENV += v8_no_strict_aliasing=1 - -NACL_MAKEFILES = $(addprefix $(OUTDIR)/Makefile.,$(NACL_BUILDS)) -.SECONDEXPANSION: -# For some reason the $$(basename $$@) expansion didn't work here... -$(NACL_BUILDS): $(NACL_MAKEFILES) - @$(MAKE) -C "$(OUTDIR)" -f Makefile.$@ \ - CC=${NACL_CC} \ - CXX=${NACL_CXX} \ - AR="$(NACL_TOOLCHAIN)/bin/pnacl-ar" \ - RANLIB="$(NACL_TOOLCHAIN)/bin/pnacl-ranlib" \ - LD="$(NACL_TOOLCHAIN)/bin/pnacl-ld" \ - LINK=${NACL_LINK} \ - BUILDTYPE=$(shell echo $(subst .,,$(suffix $@)) | \ - python -c "print raw_input().capitalize()") \ - builddir="$(shell pwd)/$(OUTDIR)/$@" - -# NACL GYP file generation targets. -$(NACL_MAKEFILES): - GYP_GENERATORS=make \ - GYP_DEFINES="${GYPENV}" \ - CC=${NACL_CC} \ - CXX=${NACL_CXX} \ - LINK=${NACL_LINK} \ - PYTHONPATH="$(shell pwd)/tools/generate_shim_headers:$(shell pwd)/build:$(PYTHONPATH)" \ - build/gyp/gyp --generator-output="${OUTDIR}" build/all.gyp \ - -Ibuild/standalone.gypi --depth=. \ - -S$(suffix $(basename $@))$(suffix $@) $(GYPFLAGS) \ - -Dwno_array_bounds=-Wno-array-bounds diff --git a/deps/v8/OWNERS b/deps/v8/OWNERS index 3f2caecd498284..26701eef59b1b3 100644 --- a/deps/v8/OWNERS +++ b/deps/v8/OWNERS @@ -1,6 +1,9 @@ adamk@chromium.org ahaas@chromium.org +bbudge@chromium.org +binji@chromium.org bmeurer@chromium.org +bradnelson@chromium.org cbruni@chromium.org danno@chromium.org epertoso@chromium.org @@ -15,6 +18,7 @@ machenbach@chromium.org marja@chromium.org mlippautz@chromium.org mstarzinger@chromium.org +mtrofin@chromium.org mvstanton@chromium.org mythria@chromium.org neis@chromium.org diff --git a/deps/v8/PRESUBMIT.py b/deps/v8/PRESUBMIT.py index f8516afc44ef50..5255ca11fa257b 100644 --- a/deps/v8/PRESUBMIT.py +++ b/deps/v8/PRESUBMIT.py @@ -223,6 +223,8 @@ def _CommonChecks(input_api, output_api): input_api, output_api, source_file_filter=None)) results.extend(input_api.canned_checks.CheckPatchFormatted( input_api, output_api)) + results.extend(input_api.canned_checks.CheckGenderNeutral( + input_api, output_api)) results.extend(_V8PresubmitChecks(input_api, output_api)) results.extend(_CheckUnwantedDependencies(input_api, output_api)) results.extend( @@ -242,32 +244,15 @@ def _SkipTreeCheck(input_api, output_api): return input_api.environ.get('PRESUBMIT_TREE_CHECK') == 'skip' -def _CheckChangeLogFlag(input_api, output_api, warn): - """Checks usage of LOG= flag in the commit message.""" - results = [] - if (input_api.change.BUG and input_api.change.BUG != 'none' and - not 'LOG' in input_api.change.tags): - text = ('An issue reference (BUG=) requires a change log flag (LOG=). ' - 'Use LOG=Y for including this commit message in the change log. ' - 'Use LOG=N or leave blank otherwise.') - if warn: - results.append(output_api.PresubmitPromptWarning(text)) - else: - results.append(output_api.PresubmitError(text)) - return results - - def CheckChangeOnUpload(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) - results.extend(_CheckChangeLogFlag(input_api, output_api, True)) return results def CheckChangeOnCommit(input_api, output_api): results = [] results.extend(_CommonChecks(input_api, output_api)) - results.extend(_CheckChangeLogFlag(input_api, output_api, False)) results.extend(input_api.canned_checks.CheckChangeHasDescription( input_api, output_api)) if not _SkipTreeCheck(input_api, output_api): diff --git a/deps/v8/WATCHLISTS b/deps/v8/WATCHLISTS index 29b957b0917f00..bd07d318dadd55 100644 --- a/deps/v8/WATCHLISTS +++ b/deps/v8/WATCHLISTS @@ -44,7 +44,6 @@ }, 'interpreter': { 'filepath': 'src/interpreter/' \ - '|src/compiler/interpreter' \ '|src/compiler/bytecode' \ '|test/cctest/interpreter/' \ '|test/unittests/interpreter/', @@ -60,6 +59,9 @@ }, 'ia32': { 'filepath': '/ia32/', + }, + 'merges': { + 'filepath': '.', } }, @@ -91,5 +93,9 @@ 'ia32': [ 'v8-x87-ports@googlegroups.com', ], + 'merges': [ + # Only enabled on branches created with tools/release/create_release.py + 'v8-merges@googlegroups.com', + ], }, } diff --git a/deps/v8/base/trace_event/common/trace_event_common.h b/deps/v8/base/trace_event/common/trace_event_common.h index 7a1533ed822e88..0c16e7b72382d3 100644 --- a/deps/v8/base/trace_event/common/trace_event_common.h +++ b/deps/v8/base/trace_event/common/trace_event_common.h @@ -612,6 +612,13 @@ TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_BEGIN_WITH_TIMESTAMP2(category_group, name, id, \ + timestamp, arg1_name, \ + arg1_val, arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_BEGIN, category_group, name, id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) #define TRACE_EVENT_COPY_ASYNC_BEGIN_WITH_TIMESTAMP0(category_group, name, id, \ timestamp) \ INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ @@ -701,6 +708,13 @@ TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ arg1_name, arg1_val) +#define TRACE_EVENT_ASYNC_END_WITH_TIMESTAMP2(category_group, name, id, \ + timestamp, arg1_name, arg1_val, \ + arg2_name, arg2_val) \ + INTERNAL_TRACE_EVENT_ADD_WITH_ID_TID_AND_TIMESTAMP( \ + TRACE_EVENT_PHASE_ASYNC_END, category_group, name, id, \ + TRACE_EVENT_API_CURRENT_THREAD_ID, timestamp, TRACE_EVENT_FLAG_NONE, \ + arg1_name, arg1_val, arg2_name, arg2_val) // NESTABLE_ASYNC_* APIs are used to describe an async operation, which can // be nested within a NESTABLE_ASYNC event and/or have inner NESTABLE_ASYNC @@ -928,12 +942,8 @@ // Special trace event macro to trace task execution with the location where it // was posted from. -#define TRACE_TASK_EXECUTION(run_function, task) \ - TRACE_EVENT2("toplevel", run_function, "src_file", \ - (task).posted_from.file_name(), "src_func", \ - (task).posted_from.function_name()); \ - TRACE_EVENT_API_SCOPED_TASK_EXECUTION_EVENT INTERNAL_TRACE_EVENT_UID( \ - task_event)((task).posted_from.file_name()); +#define TRACE_TASK_EXECUTION(run_function, task) \ + INTERNAL_TRACE_TASK_EXECUTION(run_function, task) // TRACE_EVENT_METADATA* events are information related to other // injected events, not events in their own right. @@ -991,6 +1001,17 @@ INTERNAL_TRACE_EVENT_SCOPED_CONTEXT(category_group, name, \ TRACE_ID_DONT_MANGLE(context)) +// Macro to specify that two trace IDs are identical. For example, +// TRACE_BIND_IDS( +// "category", "name", +// TRACE_ID_WITH_SCOPE("net::URLRequest", 0x1000), +// TRACE_ID_WITH_SCOPE("blink::ResourceFetcher::FetchRequest", 0x2000)) +// tells the trace consumer that events with ID ("net::URLRequest", 0x1000) from +// the current process have the same ID as events with ID +// ("blink::ResourceFetcher::FetchRequest", 0x2000). +#define TRACE_BIND_IDS(category_group, name, id, bind_id) \ + INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id); + // Macro to efficiently determine if a given category group is enabled. #define TRACE_EVENT_CATEGORY_GROUP_ENABLED(category_group, ret) \ do { \ @@ -1056,6 +1077,7 @@ #define TRACE_EVENT_PHASE_CLOCK_SYNC ('c') #define TRACE_EVENT_PHASE_ENTER_CONTEXT ('(') #define TRACE_EVENT_PHASE_LEAVE_CONTEXT (')') +#define TRACE_EVENT_PHASE_BIND_IDS ('=') // Flags for changing the behavior of TRACE_EVENT_API_ADD_TRACE_EVENT. #define TRACE_EVENT_FLAG_NONE (static_cast(0)) diff --git a/deps/v8/build/has_valgrind.py b/deps/v8/build/has_valgrind.py deleted file mode 100755 index 83a848d50b3049..00000000000000 --- a/deps/v8/build/has_valgrind.py +++ /dev/null @@ -1,21 +0,0 @@ -#!/usr/bin/env python -# Copyright 2016 the V8 project authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import os - -BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -VALGRIND_DIR = os.path.join(BASE_DIR, 'third_party', 'valgrind') -LINUX32_DIR = os.path.join(VALGRIND_DIR, 'linux_x86') -LINUX64_DIR = os.path.join(VALGRIND_DIR, 'linux_x64') - - -def DoMain(_): - """Hook to be called from gyp without starting a separate python - interpreter.""" - return int(os.path.exists(LINUX32_DIR) and os.path.exists(LINUX64_DIR)) - - -if __name__ == '__main__': - print DoMain([]) diff --git a/deps/v8/build/vs_toolchain.py b/deps/v8/build/vs_toolchain.py deleted file mode 100644 index 95fbcf4993aacb..00000000000000 --- a/deps/v8/build/vs_toolchain.py +++ /dev/null @@ -1,268 +0,0 @@ -#!/usr/bin/env python -# Copyright 2015 the V8 project authors. All rights reserved. -# Copyright 2014 The Chromium Authors. All rights reserved. -# Use of this source code is governed by a BSD-style license that can be -# found in the LICENSE file. - -import json -import os -import pipes -import shutil -import subprocess -import sys -import vs_toolchain - - -script_dir = os.path.dirname(os.path.realpath(__file__)) -chrome_src = os.path.abspath(os.path.join(script_dir, os.pardir)) -SRC_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) -sys.path.insert(1, os.path.join(chrome_src, 'tools')) -sys.path.insert(0, os.path.join(chrome_src, 'build', 'gyp', 'pylib')) -json_data_file = os.path.join(script_dir, 'win_toolchain.json') - - -import gyp - - -def SetEnvironmentAndGetRuntimeDllDirs(): - """Sets up os.environ to use the depot_tools VS toolchain with gyp, and - returns the location of the VS runtime DLLs so they can be copied into - the output directory after gyp generation. - """ - vs2013_runtime_dll_dirs = None - depot_tools_win_toolchain = \ - bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) - # When running on a non-Windows host, only do this if the SDK has explicitly - # been downloaded before (in which case json_data_file will exist). - if ((sys.platform in ('win32', 'cygwin') or os.path.exists(json_data_file)) - and depot_tools_win_toolchain): - if not os.path.exists(json_data_file): - Update() - with open(json_data_file, 'r') as tempf: - toolchain_data = json.load(tempf) - - toolchain = toolchain_data['path'] - version = toolchain_data['version'] - win_sdk = toolchain_data.get('win_sdk') - if not win_sdk: - win_sdk = toolchain_data['win8sdk'] - wdk = toolchain_data['wdk'] - # TODO(scottmg): The order unfortunately matters in these. They should be - # split into separate keys for x86 and x64. (See CopyVsRuntimeDlls call - # below). http://crbug.com/345992 - vs2013_runtime_dll_dirs = toolchain_data['runtime_dirs'] - - os.environ['GYP_MSVS_OVERRIDE_PATH'] = toolchain - os.environ['GYP_MSVS_VERSION'] = version - # We need to make sure windows_sdk_path is set to the automated - # toolchain values in GYP_DEFINES, but don't want to override any - # otheroptions.express - # values there. - gyp_defines_dict = gyp.NameValueListToDict(gyp.ShlexEnv('GYP_DEFINES')) - gyp_defines_dict['windows_sdk_path'] = win_sdk - os.environ['GYP_DEFINES'] = ' '.join('%s=%s' % (k, pipes.quote(str(v))) - for k, v in gyp_defines_dict.iteritems()) - os.environ['WINDOWSSDKDIR'] = win_sdk - os.environ['WDK_DIR'] = wdk - # Include the VS runtime in the PATH in case it's not machine-installed. - runtime_path = ';'.join(vs2013_runtime_dll_dirs) - os.environ['PATH'] = runtime_path + ';' + os.environ['PATH'] - return vs2013_runtime_dll_dirs - - -def _VersionNumber(): - """Gets the standard version number ('120', '140', etc.) based on - GYP_MSVS_VERSION.""" - if os.environ['GYP_MSVS_VERSION'] == '2013': - return '120' - elif os.environ['GYP_MSVS_VERSION'] == '2015': - return '140' - else: - raise ValueError('Unexpected GYP_MSVS_VERSION') - - -def _CopyRuntimeImpl(target, source): - """Copy |source| to |target| if it doesn't already exist or if it - needs to be updated. - """ - if (os.path.isdir(os.path.dirname(target)) and - (not os.path.isfile(target) or - os.stat(target).st_mtime != os.stat(source).st_mtime)): - print 'Copying %s to %s...' % (source, target) - if os.path.exists(target): - os.unlink(target) - shutil.copy2(source, target) - - -def _CopyRuntime2013(target_dir, source_dir, dll_pattern): - """Copy both the msvcr and msvcp runtime DLLs, only if the target doesn't - exist, but the target directory does exist.""" - for file_part in ('p', 'r'): - dll = dll_pattern % file_part - target = os.path.join(target_dir, dll) - source = os.path.join(source_dir, dll) - _CopyRuntimeImpl(target, source) - - -def _CopyRuntime2015(target_dir, source_dir, dll_pattern): - """Copy both the msvcp and vccorlib runtime DLLs, only if the target doesn't - exist, but the target directory does exist.""" - for file_part in ('msvcp', 'vccorlib'): - dll = dll_pattern % file_part - target = os.path.join(target_dir, dll) - source = os.path.join(source_dir, dll) - _CopyRuntimeImpl(target, source) - - -def CopyVsRuntimeDlls(output_dir, runtime_dirs): - """Copies the VS runtime DLLs from the given |runtime_dirs| to the output - directory so that even if not system-installed, built binaries are likely to - be able to run. - - This needs to be run after gyp has been run so that the expected target - output directories are already created. - """ - x86, x64 = runtime_dirs - out_debug = os.path.join(output_dir, 'Debug') - out_debug_nacl64 = os.path.join(output_dir, 'Debug', 'x64') - out_release = os.path.join(output_dir, 'Release') - out_release_nacl64 = os.path.join(output_dir, 'Release', 'x64') - out_debug_x64 = os.path.join(output_dir, 'Debug_x64') - out_release_x64 = os.path.join(output_dir, 'Release_x64') - - if os.path.exists(out_debug) and not os.path.exists(out_debug_nacl64): - os.makedirs(out_debug_nacl64) - if os.path.exists(out_release) and not os.path.exists(out_release_nacl64): - os.makedirs(out_release_nacl64) - if os.environ.get('GYP_MSVS_VERSION') == '2015': - _CopyRuntime2015(out_debug, x86, '%s140d.dll') - _CopyRuntime2015(out_release, x86, '%s140.dll') - _CopyRuntime2015(out_debug_x64, x64, '%s140d.dll') - _CopyRuntime2015(out_release_x64, x64, '%s140.dll') - _CopyRuntime2015(out_debug_nacl64, x64, '%s140d.dll') - _CopyRuntime2015(out_release_nacl64, x64, '%s140.dll') - else: - # VS2013 is the default. - _CopyRuntime2013(out_debug, x86, 'msvc%s120d.dll') - _CopyRuntime2013(out_release, x86, 'msvc%s120.dll') - _CopyRuntime2013(out_debug_x64, x64, 'msvc%s120d.dll') - _CopyRuntime2013(out_release_x64, x64, 'msvc%s120.dll') - _CopyRuntime2013(out_debug_nacl64, x64, 'msvc%s120d.dll') - _CopyRuntime2013(out_release_nacl64, x64, 'msvc%s120.dll') - - # Copy the PGO runtime library to the release directories. - if os.environ.get('GYP_MSVS_OVERRIDE_PATH'): - pgo_x86_runtime_dir = os.path.join(os.environ.get('GYP_MSVS_OVERRIDE_PATH'), - 'VC', 'bin') - pgo_x64_runtime_dir = os.path.join(pgo_x86_runtime_dir, 'amd64') - pgo_runtime_dll = 'pgort' + _VersionNumber() + '.dll' - source_x86 = os.path.join(pgo_x86_runtime_dir, pgo_runtime_dll) - if os.path.exists(source_x86): - _CopyRuntimeImpl(os.path.join(out_release, pgo_runtime_dll), source_x86) - source_x64 = os.path.join(pgo_x64_runtime_dir, pgo_runtime_dll) - if os.path.exists(source_x64): - _CopyRuntimeImpl(os.path.join(out_release_x64, pgo_runtime_dll), - source_x64) - - -def CopyDlls(target_dir, configuration, target_cpu): - """Copy the VS runtime DLLs into the requested directory as needed. - - configuration is one of 'Debug' or 'Release'. - target_cpu is one of 'x86' or 'x64'. - - The debug configuration gets both the debug and release DLLs; the - release config only the latter. - """ - vs2013_runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() - if not vs2013_runtime_dll_dirs: - return - - x64_runtime, x86_runtime = vs2013_runtime_dll_dirs - runtime_dir = x64_runtime if target_cpu == 'x64' else x86_runtime - _CopyRuntime2013( - target_dir, runtime_dir, 'msvc%s' + _VersionNumber() + '.dll') - if configuration == 'Debug': - _CopyRuntime2013( - target_dir, runtime_dir, 'msvc%s' + _VersionNumber() + 'd.dll') - - -def _GetDesiredVsToolchainHashes(): - """Load a list of SHA1s corresponding to the toolchains that we want installed - to build with.""" - if os.environ.get('GYP_MSVS_VERSION') == '2015': - return ['5a85cf1ce842f7cc96b9d17039a445a9dc9cf0dd'] - else: - # Default to VS2013. - return ['9ff97c632ae1fee0c98bcd53e71770eb3a0d8deb'] - - -def Update(force=False): - """Requests an update of the toolchain to the specific hashes we have at - this revision. The update outputs a .json of the various configuration - information required to pass to gyp which we use in |GetToolchainDir()|. - """ - if force != False and force != '--force': - print >>sys.stderr, 'Unknown parameter "%s"' % force - return 1 - if force == '--force' or os.path.exists(json_data_file): - force = True - - depot_tools_win_toolchain = \ - bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) - if ((sys.platform in ('win32', 'cygwin') or force) and - depot_tools_win_toolchain): - import find_depot_tools - depot_tools_path = find_depot_tools.add_depot_tools_to_path() - get_toolchain_args = [ - sys.executable, - os.path.join(depot_tools_path, - 'win_toolchain', - 'get_toolchain_if_necessary.py'), - '--output-json', json_data_file, - ] + _GetDesiredVsToolchainHashes() - if force: - get_toolchain_args.append('--force') - subprocess.check_call(get_toolchain_args) - - return 0 - - -def GetToolchainDir(): - """Gets location information about the current toolchain (must have been - previously updated by 'update'). This is used for the GN build.""" - runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() - - # If WINDOWSSDKDIR is not set, search the default SDK path and set it. - if not 'WINDOWSSDKDIR' in os.environ: - default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\8.1' - if os.path.isdir(default_sdk_path): - os.environ['WINDOWSSDKDIR'] = default_sdk_path - - print '''vs_path = "%s" -sdk_path = "%s" -vs_version = "%s" -wdk_dir = "%s" -runtime_dirs = "%s" -''' % ( - os.environ['GYP_MSVS_OVERRIDE_PATH'], - os.environ['WINDOWSSDKDIR'], - os.environ['GYP_MSVS_VERSION'], - os.environ.get('WDK_DIR', ''), - ';'.join(runtime_dll_dirs or ['None'])) - - -def main(): - commands = { - 'update': Update, - 'get_toolchain_dir': GetToolchainDir, - 'copy_dlls': CopyDlls, - } - if len(sys.argv) < 2 or sys.argv[1] not in commands: - print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) - return 1 - return commands[sys.argv[1]](*sys.argv[2:]) - - -if __name__ == '__main__': - sys.exit(main()) diff --git a/deps/v8/build_overrides/build.gni b/deps/v8/build_overrides/build.gni new file mode 100644 index 00000000000000..da6d3e0ded6e6e --- /dev/null +++ b/deps/v8/build_overrides/build.gni @@ -0,0 +1,18 @@ +# Copyright 2016 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +mac_sdk_min_build_override = "10.10" +mac_deployment_target_build_override = "10.7" + +# Variable that can be used to support multiple build scenarios, like having +# Chromium specific targets in a client project's GN file etc. +build_with_chromium = false + +# Uncomment these to specify a different NDK location and version in +# non-Chromium builds. +# default_android_ndk_root = "//third_party/android_tools/ndk" +# default_android_ndk_version = "r10e" + +# Some non-Chromium builds don't support building java targets. +enable_java_templates = false diff --git a/deps/v8/build_overrides/gtest.gni b/deps/v8/build_overrides/gtest.gni new file mode 100644 index 00000000000000..54c16b149b4f47 --- /dev/null +++ b/deps/v8/build_overrides/gtest.gni @@ -0,0 +1,15 @@ +# Copyright 2016 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Exclude support for registering main function in multi-process tests. +gtest_include_multiprocess = false + +# Exclude support for platform-specific operations across unit tests. +gtest_include_platform_test = false + +# Exclude support for testing Objective C code on OS X and iOS. +gtest_include_objc_support = false + +# Exclude support for flushing coverage files on iOS. +gtest_include_ios_coverage = false diff --git a/deps/v8/build_overrides/v8.gni b/deps/v8/build_overrides/v8.gni new file mode 100644 index 00000000000000..fc4a70e579b78d --- /dev/null +++ b/deps/v8/build_overrides/v8.gni @@ -0,0 +1,26 @@ +# Copyright 2015 The V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/features.gni") +import("//build/config/ui.gni") +import("//build/config/v8_target_cpu.gni") +import("//gni/v8.gni") + +if (is_android) { + import("//build/config/android/config.gni") +} + +if (((v8_current_cpu == "x86" || + v8_current_cpu == "x64" || + v8_current_cpu=="x87") && + (is_linux || is_mac)) || + (v8_current_cpu == "ppc64" && is_linux)) { + v8_enable_gdbjit_default = true +} + +v8_imminent_deprecation_warnings_default = true + +# Add simple extras solely for the purpose of the cctests. +v8_extra_library_files = [ "//test/cctest/test-extra.js" ] +v8_experimental_extra_library_files = [ "//test/cctest/test-experimental-extra.js" ] diff --git a/deps/v8/gni/isolate.gni b/deps/v8/gni/isolate.gni new file mode 100644 index 00000000000000..93c828d2cdf0fb --- /dev/null +++ b/deps/v8/gni/isolate.gni @@ -0,0 +1,175 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/sanitizers/sanitizers.gni") +import("//third_party/icu/config.gni") +import("v8.gni") + +declare_args() { + # Sets the test isolation mode (noop|prepare|check). + v8_test_isolation_mode = "noop" +} + +template("v8_isolate_run") { + # Remember target name as within the action scope the target name will be + # different. + name = target_name + if (name != "" && invoker.isolate != "" && invoker.deps != [] && + v8_test_isolation_mode != "noop") { + action(name + "_run") { + testonly = true + + deps = invoker.deps + + script = "//tools/isolate_driver.py" + + sources = [ + invoker.isolate, + ] + + inputs = [ + # Files that are known to be involved in this step. + "//tools/swarming_client/isolate.py", + "//tools/swarming_client/run_isolated.py", + ] + + if (v8_test_isolation_mode == "prepare") { + outputs = [ + "$root_out_dir/$name.isolated.gen.json", + ] + } else if (v8_test_isolation_mode == "check") { + outputs = [ + "$root_out_dir/$name.isolated", + "$root_out_dir/$name.isolated.state", + ] + } + + # Translate gn to gyp variables. + if (is_asan) { + asan = "1" + } else { + asan = "0" + } + if (is_msan) { + msan = "1" + } else { + msan = "0" + } + if (is_tsan) { + tsan = "1" + } else { + tsan = "0" + } + if (is_cfi) { + cfi_vptr = "1" + } else { + cfi_vptr = "0" + } + if (target_cpu == "x86") { + target_arch = "ia32" + } else { + target_arch = target_cpu + } + if (is_debug) { + configuration_name = "Debug" + } else { + configuration_name = "Release" + } + if (is_component_build) { + component = "shared_library" + } else { + component = "static_library" + } + if (icu_use_data_file) { + icu_use_data_file_flag = "1" + } else { + icu_use_data_file_flag = "0" + } + if (v8_use_external_startup_data) { + use_external_startup_data = "1" + } else { + use_external_startup_data = "0" + } + if (v8_use_snapshot) { + use_snapshot = "true" + } else { + use_snapshot = "false" + } + if (v8_has_valgrind) { + has_valgrind = "1" + } else { + has_valgrind = "0" + } + if (v8_gcmole) { + gcmole = "1" + } else { + gcmole = "0" + } + + + # Note, all paths will be rebased in isolate_driver.py to be relative to + # the isolate file. + args = [ + v8_test_isolation_mode, + "--isolated", + rebase_path("$root_out_dir/$name.isolated", root_build_dir), + "--isolate", + rebase_path(invoker.isolate, root_build_dir), + + # Path variables are used to replace file paths when loading a .isolate + # file + "--path-variable", + "DEPTH", + rebase_path("//", root_build_dir), + "--path-variable", + "PRODUCT_DIR", + rebase_path(root_out_dir, root_build_dir), + + # TODO(machenbach): Set variables for remaining features. + "--config-variable", + "CONFIGURATION_NAME=$configuration_name", + "--config-variable", + "OS=$target_os", + "--config-variable", + "asan=$asan", + "--config-variable", + "cfi_vptr=$cfi_vptr", + "--config-variable", + "gcmole=$gcmole", + "--config-variable", + "has_valgrind=$has_valgrind", + "--config-variable", + "icu_use_data_file_flag=$icu_use_data_file_flag", + "--config-variable", + "msan=$msan", + "--config-variable", + "tsan=$tsan", + "--config-variable", + "coverage=0", + "--config-variable", + "sanitizer_coverage=0", + "--config-variable", + "component=$component", + "--config-variable", + "target_arch=$target_arch", + "--config-variable", + "v8_use_external_startup_data=$use_external_startup_data", + "--config-variable", + "v8_use_snapshot=$use_snapshot", + ] + + if (is_win) { + args += [ + "--config-variable", + "msvs_version=2013", + ] + } else { + args += [ + "--config-variable", + "msvs_version=0", + ] + } + } + } +} diff --git a/deps/v8/gni/v8.gni b/deps/v8/gni/v8.gni new file mode 100644 index 00000000000000..7ff7f6fb89ac36 --- /dev/null +++ b/deps/v8/gni/v8.gni @@ -0,0 +1,108 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +import("//build/config/sanitizers/sanitizers.gni") +import("//build/config/v8_target_cpu.gni") + +declare_args() { + # Indicate if valgrind was fetched as a custom deps to make it available on + # swarming. + v8_has_valgrind = false + + # Indicate if gcmole was fetched as a hook to make it available on swarming. + v8_gcmole = false + + # Turns on compiler optimizations in V8 in Debug build. + v8_optimized_debug = true + + # Support for backtrace_symbols on linux. + v8_enable_backtrace = "" + + # Enable the snapshot feature, for fast context creation. + # http://v8project.blogspot.com/2015/09/custom-startup-snapshots.html + v8_use_snapshot = true + + # Use external files for startup data blobs: + # the JS builtins sources and the start snapshot. + v8_use_external_startup_data = "" +} + +if (v8_use_external_startup_data == "") { + # If not specified as a gn arg, use external startup data by default if + # a snapshot is used and if we're not on ios. + v8_use_external_startup_data = v8_use_snapshot && !is_ios +} + +if (v8_enable_backtrace == "") { + v8_enable_backtrace = is_debug && !v8_optimized_debug +} + +############################################################################### +# Templates +# + +# Points to // in v8 stand-alone or to //v8/ in chromium. We need absolute +# paths for all configs in templates as they are shared in different +# subdirectories. +v8_path_prefix = get_path_info("../", "abspath") + +# Common configs to remove or add in all v8 targets. +v8_remove_configs = [ "//build/config/compiler:chromium_code" ] +v8_add_configs = [ + "//build/config/compiler:no_chromium_code", + v8_path_prefix + ":features", + v8_path_prefix + ":toolchain", +] + +if (is_debug && !v8_optimized_debug) { + v8_remove_configs += [ "//build/config/compiler:default_optimization" ] + v8_add_configs += [ "//build/config/compiler:no_optimize" ] +} else { + v8_remove_configs += [ "//build/config/compiler:default_optimization" ] + + # TODO(crbug.com/621335) Rework this so that we don't have the confusion + # between "optimize_speed" and "optimize_max". + if (is_posix && !is_android && !using_sanitizer) { + v8_add_configs += [ "//build/config/compiler:optimize_speed" ] + } else { + v8_add_configs += [ "//build/config/compiler:optimize_max" ] + } +} + +if (is_posix && v8_enable_backtrace) { + v8_remove_configs += [ "//build/config/gcc:symbol_visibility_hidden" ] + v8_add_configs += [ "//build/config/gcc:symbol_visibility_default" ] +} + +# All templates should be kept in sync. +template("v8_source_set") { + source_set(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + } +} + +template("v8_executable") { + executable(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + if (is_linux) { + # For enabling ASLR. + ldflags = [ "-pie" ] + } + } +} + +template("v8_component") { + component(target_name) { + forward_variables_from(invoker, "*", [ "configs" ]) + configs += invoker.configs + configs -= v8_remove_configs + configs += v8_add_configs + } +} diff --git a/deps/v8/build/OWNERS b/deps/v8/gypfiles/OWNERS similarity index 100% rename from deps/v8/build/OWNERS rename to deps/v8/gypfiles/OWNERS diff --git a/deps/v8/build/README.txt b/deps/v8/gypfiles/README.txt similarity index 100% rename from deps/v8/build/README.txt rename to deps/v8/gypfiles/README.txt diff --git a/deps/v8/build/all.gyp b/deps/v8/gypfiles/all.gyp similarity index 80% rename from deps/v8/build/all.gyp rename to deps/v8/gypfiles/all.gyp index feaf4fecccabf5..6b4ef82d6906c1 100644 --- a/deps/v8/build/all.gyp +++ b/deps/v8/gypfiles/all.gyp @@ -8,11 +8,7 @@ 'target_name': 'All', 'type': 'none', 'dependencies': [ - '../samples/samples.gyp:*', '../src/d8.gyp:d8', - '../test/cctest/cctest.gyp:*', - '../test/fuzzer/fuzzer.gyp:*', - '../test/unittests/unittests.gyp:*', ], 'conditions': [ ['component!="shared_library"', { @@ -20,12 +16,20 @@ '../tools/parser-shell.gyp:parser-shell', ], }], + # These items don't compile for Android on Mac. + ['host_os!="mac" or OS!="android"', { + 'dependencies': [ + '../samples/samples.gyp:*', + '../test/cctest/cctest.gyp:*', + '../test/fuzzer/fuzzer.gyp:*', + '../test/unittests/unittests.gyp:*', + ], + }], ['test_isolation_mode != "noop"', { 'dependencies': [ '../test/bot_default.gyp:*', '../test/benchmarks/benchmarks.gyp:*', '../test/default.gyp:*', - '../test/ignition.gyp:*', '../test/intl/intl.gyp:*', '../test/message/message.gyp:*', '../test/mjsunit/mjsunit.gyp:*', diff --git a/deps/v8/build/config/win/msvs_dependencies.isolate b/deps/v8/gypfiles/config/win/msvs_dependencies.isolate similarity index 100% rename from deps/v8/build/config/win/msvs_dependencies.isolate rename to deps/v8/gypfiles/config/win/msvs_dependencies.isolate diff --git a/deps/v8/build/coverage_wrapper.py b/deps/v8/gypfiles/coverage_wrapper.py similarity index 100% rename from deps/v8/build/coverage_wrapper.py rename to deps/v8/gypfiles/coverage_wrapper.py diff --git a/deps/v8/build/detect_v8_host_arch.py b/deps/v8/gypfiles/detect_v8_host_arch.py similarity index 100% rename from deps/v8/build/detect_v8_host_arch.py rename to deps/v8/gypfiles/detect_v8_host_arch.py diff --git a/deps/v8/build/download_gold_plugin.py b/deps/v8/gypfiles/download_gold_plugin.py similarity index 100% rename from deps/v8/build/download_gold_plugin.py rename to deps/v8/gypfiles/download_gold_plugin.py diff --git a/deps/v8/build/features.gypi b/deps/v8/gypfiles/features.gypi similarity index 100% rename from deps/v8/build/features.gypi rename to deps/v8/gypfiles/features.gypi diff --git a/deps/v8/build/get_landmines.py b/deps/v8/gypfiles/get_landmines.py similarity index 95% rename from deps/v8/build/get_landmines.py rename to deps/v8/gypfiles/get_landmines.py index 2bbf7a61bfe290..9fcca4b968a888 100755 --- a/deps/v8/build/get_landmines.py +++ b/deps/v8/gypfiles/get_landmines.py @@ -27,6 +27,7 @@ def main(): print 'Switching to pinned msvs toolchain.' print 'Clobbering to hopefully resolve problem with mksnapshot' print 'Clobber after ICU roll.' + print 'Clobber after Android NDK update.' return 0 diff --git a/deps/v8/build/gyp_environment.py b/deps/v8/gypfiles/gyp_environment.py similarity index 90% rename from deps/v8/build/gyp_environment.py rename to deps/v8/gypfiles/gyp_environment.py index 7a4e6221482688..76ae841ffb6a08 100644 --- a/deps/v8/build/gyp_environment.py +++ b/deps/v8/gypfiles/gyp_environment.py @@ -31,6 +31,7 @@ def apply_gyp_environment(file_path=None): supported_vars = ( 'V8_GYP_FILE', 'V8_GYP_SYNTAX_CHECK', 'GYP_DEFINES', + 'GYP_GENERATORS', 'GYP_GENERATOR_FLAGS', 'GYP_GENERATOR_OUTPUT', ) for var in supported_vars: @@ -51,4 +52,9 @@ def set_environment(): # Update the environment based on v8.gyp_env gyp_env_path = os.path.join(os.path.dirname(V8_ROOT), 'v8.gyp_env') apply_gyp_environment(gyp_env_path) + + if not os.environ.get('GYP_GENERATORS'): + # Default to ninja on all platforms. + os.environ['GYP_GENERATORS'] = 'ninja' + vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() diff --git a/deps/v8/build/gyp_v8 b/deps/v8/gypfiles/gyp_v8 similarity index 95% rename from deps/v8/build/gyp_v8 rename to deps/v8/gypfiles/gyp_v8 index 8813f2c12162ba..8be39d961536f1 100755 --- a/deps/v8/build/gyp_v8 +++ b/deps/v8/gypfiles/gyp_v8 @@ -43,7 +43,7 @@ import vs_toolchain script_dir = os.path.dirname(os.path.realpath(__file__)) v8_root = os.path.abspath(os.path.join(script_dir, os.pardir)) -sys.path.insert(0, os.path.join(v8_root, 'build', 'gyp', 'pylib')) +sys.path.insert(0, os.path.join(v8_root, 'tools', 'gyp', 'pylib')) import gyp # Add paths so that pymod_do_main(...) can import files. @@ -90,7 +90,7 @@ def additional_include_files(args=[]): result.append(path) # Always include standalone.gypi - AddInclude(os.path.join(v8_root, 'build', 'standalone.gypi')) + AddInclude(os.path.join(v8_root, 'gypfiles', 'standalone.gypi')) # Optionally add supplemental .gypi files if present. supplements = glob.glob(os.path.join(v8_root, '*', 'supplement.gypi')) @@ -118,6 +118,10 @@ def run_gyp(args): if __name__ == '__main__': args = sys.argv[1:] + if int(os.environ.get('GYP_CHROMIUM_NO_ACTION', 0)): + print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.' + sys.exit(0) + gyp_environment.set_environment() # This could give false positives since it doesn't actually do real option diff --git a/deps/v8/build/gyp_v8.py b/deps/v8/gypfiles/gyp_v8.py similarity index 100% rename from deps/v8/build/gyp_v8.py rename to deps/v8/gypfiles/gyp_v8.py diff --git a/deps/v8/build/isolate.gypi b/deps/v8/gypfiles/isolate.gypi similarity index 92% rename from deps/v8/build/isolate.gypi rename to deps/v8/gypfiles/isolate.gypi index 4cfbbfddd100d7..149818c8d0636f 100644 --- a/deps/v8/build/isolate.gypi +++ b/deps/v8/gypfiles/isolate.gypi @@ -17,7 +17,7 @@ # 'foo_test', # ], # 'includes': [ -# '../build/isolate.gypi', +# '../gypfiles/isolate.gypi', # ], # 'sources': [ # 'foo_test.isolate', @@ -73,15 +73,13 @@ '--config-variable', 'cfi_vptr=<(cfi_vptr)', '--config-variable', 'gcmole=<(gcmole)', '--config-variable', 'has_valgrind=<(has_valgrind)', - '--config-variable', 'icu_use_data_file_flag=0', + '--config-variable', 'icu_use_data_file_flag=<(icu_use_data_file_flag)', '--config-variable', 'msan=<(msan)', '--config-variable', 'tsan=<(tsan)', '--config-variable', 'coverage=<(coverage)', '--config-variable', 'sanitizer_coverage=<(sanitizer_coverage)', '--config-variable', 'component=<(component)', '--config-variable', 'target_arch=<(target_arch)', - '--config-variable', 'use_custom_libcxx=<(use_custom_libcxx)', - '--config-variable', 'v8_separate_ignition_snapshot=<(v8_separate_ignition_snapshot)', '--config-variable', 'v8_use_external_startup_data=<(v8_use_external_startup_data)', '--config-variable', 'v8_use_snapshot=<(v8_use_snapshot)', ], diff --git a/deps/v8/build/landmine_utils.py b/deps/v8/gypfiles/landmine_utils.py similarity index 100% rename from deps/v8/build/landmine_utils.py rename to deps/v8/gypfiles/landmine_utils.py diff --git a/deps/v8/build/landmines.py b/deps/v8/gypfiles/landmines.py similarity index 99% rename from deps/v8/build/landmines.py rename to deps/v8/gypfiles/landmines.py index 97c63901c1a904..2a81c66d1a6529 100755 --- a/deps/v8/build/landmines.py +++ b/deps/v8/gypfiles/landmines.py @@ -198,7 +198,7 @@ def process_options(): parser = optparse.OptionParser() parser.add_option( '-s', '--landmine-scripts', action='append', - default=[os.path.join(SRC_DIR, 'build', 'get_landmines.py')], + default=[os.path.join(SRC_DIR, 'gypfiles', 'get_landmines.py')], help='Path to the script which emits landmines to stdout. The target ' 'is passed to this script via option -t. Note that an extra ' 'script can be specified via an env var EXTRA_LANDMINES_SCRIPT.') diff --git a/deps/v8/build/mac/asan.gyp b/deps/v8/gypfiles/mac/asan.gyp similarity index 100% rename from deps/v8/build/mac/asan.gyp rename to deps/v8/gypfiles/mac/asan.gyp diff --git a/deps/v8/gypfiles/set_clang_warning_flags.gypi b/deps/v8/gypfiles/set_clang_warning_flags.gypi new file mode 100644 index 00000000000000..63d5f1435ccb51 --- /dev/null +++ b/deps/v8/gypfiles/set_clang_warning_flags.gypi @@ -0,0 +1,59 @@ +# Copyright 2016 the V8 project authors. All rights reserved. +# Copyright (c) 2014 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# This file is meant to be included to set clang-specific compiler flags. +# To use this the following variable can be defined: +# clang_warning_flags: list: Compiler flags to pass to clang. +# clang_warning_flags_unset: list: Compiler flags to not pass to clang. +# +# Only use this in third-party code. In chromium_code, fix your code to not +# warn instead! +# +# Note that the gypi file is included in target_defaults, so it does not need +# to be explicitly included. +# +# Warning flags set by this will be used on all platforms. If you want to set +# warning flags on only some platforms, you have to do so manually. +# +# To use this, create a gyp target with the following form: +# { +# 'target_name': 'my_target', +# 'variables': { +# 'clang_warning_flags': ['-Wno-awesome-warning'], +# 'clang_warning_flags_unset': ['-Wpreviously-set-flag'], +# } +# } + +{ + 'variables': { + 'clang_warning_flags_unset%': [], # Provide a default value. + }, + 'conditions': [ + ['clang==1', { + # This uses >@ instead of @< to also see clang_warning_flags set in + # targets directly, not just the clang_warning_flags in target_defaults. + 'cflags': [ '>@(clang_warning_flags)' ], + 'cflags!': [ '>@(clang_warning_flags_unset)' ], + 'xcode_settings': { + 'WARNING_CFLAGS': ['>@(clang_warning_flags)'], + 'WARNING_CFLAGS!': ['>@(clang_warning_flags_unset)'], + }, + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': [ '>@(clang_warning_flags)' ], + 'AdditionalOptions!': [ '>@(clang_warning_flags_unset)' ], + }, + }, + }], + ['clang==0 and host_clang==1', { + 'target_conditions': [ + ['_toolset=="host"', { + 'cflags': [ '>@(clang_warning_flags)' ], + 'cflags!': [ '>@(clang_warning_flags_unset)' ], + }], + ], + }], + ], +} diff --git a/deps/v8/build/shim_headers.gypi b/deps/v8/gypfiles/shim_headers.gypi similarity index 100% rename from deps/v8/build/shim_headers.gypi rename to deps/v8/gypfiles/shim_headers.gypi diff --git a/deps/v8/build/standalone.gypi b/deps/v8/gypfiles/standalone.gypi similarity index 85% rename from deps/v8/build/standalone.gypi rename to deps/v8/gypfiles/standalone.gypi index 6c88409dbee892..6599bb83512173 100644 --- a/deps/v8/build/standalone.gypi +++ b/deps/v8/gypfiles/standalone.gypi @@ -49,35 +49,70 @@ 'variables': { 'variables': { 'variables': { - 'conditions': [ - ['OS=="linux" or OS=="freebsd" or OS=="openbsd" or \ - OS=="netbsd" or OS=="mac" or OS=="qnx" or OS=="aix"', { - # This handles the Unix platforms we generally deal with. - # Anything else gets passed through, which probably won't work - # very well; such hosts should pass an explicit target_arch - # to gyp. - 'host_arch%': '>sys.stderr, 'Unknown parameter "%s"' % force + return 1 + if force == '--force' or os.path.exists(json_data_file): + force = True + + depot_tools_win_toolchain = \ + bool(int(os.environ.get('DEPOT_TOOLS_WIN_TOOLCHAIN', '1'))) + if ((sys.platform in ('win32', 'cygwin') or force) and + depot_tools_win_toolchain): + import find_depot_tools + depot_tools_path = find_depot_tools.add_depot_tools_to_path() + # Necessary so that get_toolchain_if_necessary.py will put the VS toolkit + # in the correct directory. + os.environ['GYP_MSVS_VERSION'] = GetVisualStudioVersion() + get_toolchain_args = [ + sys.executable, + os.path.join(depot_tools_path, + 'win_toolchain', + 'get_toolchain_if_necessary.py'), + '--output-json', json_data_file, + ] + _GetDesiredVsToolchainHashes() + if force: + get_toolchain_args.append('--force') + subprocess.check_call(get_toolchain_args) + + return 0 + + +def NormalizePath(path): + while path.endswith("\\"): + path = path[:-1] + return path + + +def GetToolchainDir(): + """Gets location information about the current toolchain (must have been + previously updated by 'update'). This is used for the GN build.""" + runtime_dll_dirs = SetEnvironmentAndGetRuntimeDllDirs() + + # If WINDOWSSDKDIR is not set, search the default SDK path and set it. + if not 'WINDOWSSDKDIR' in os.environ: + default_sdk_path = 'C:\\Program Files (x86)\\Windows Kits\\10' + if os.path.isdir(default_sdk_path): + os.environ['WINDOWSSDKDIR'] = default_sdk_path + + print '''vs_path = "%s" +sdk_path = "%s" +vs_version = "%s" +wdk_dir = "%s" +runtime_dirs = "%s" +''' % ( + NormalizePath(os.environ['GYP_MSVS_OVERRIDE_PATH']), + NormalizePath(os.environ['WINDOWSSDKDIR']), + GetVisualStudioVersion(), + NormalizePath(os.environ.get('WDK_DIR', '')), + os.path.pathsep.join(runtime_dll_dirs or ['None'])) + + +def main(): + commands = { + 'update': Update, + 'get_toolchain_dir': GetToolchainDir, + 'copy_dlls': CopyDlls, + } + if len(sys.argv) < 2 or sys.argv[1] not in commands: + print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) + return 1 + return commands[sys.argv[1]](*sys.argv[2:]) + + +if __name__ == '__main__': + sys.exit(main()) diff --git a/deps/v8/include/libplatform/DEPS b/deps/v8/include/libplatform/DEPS new file mode 100644 index 00000000000000..15e75e6b4ffe50 --- /dev/null +++ b/deps/v8/include/libplatform/DEPS @@ -0,0 +1,5 @@ +specific_include_rules = { + "libplatform\.h": [ + "+libplatform/v8-tracing.h", + ], +} diff --git a/deps/v8/include/libplatform/libplatform.h b/deps/v8/include/libplatform/libplatform.h index f180b4fe82ef33..5b5eee651319b5 100644 --- a/deps/v8/include/libplatform/libplatform.h +++ b/deps/v8/include/libplatform/libplatform.h @@ -5,6 +5,7 @@ #ifndef V8_LIBPLATFORM_LIBPLATFORM_H_ #define V8_LIBPLATFORM_LIBPLATFORM_H_ +#include "libplatform/v8-tracing.h" #include "v8-platform.h" // NOLINT(build/include) namespace v8 { @@ -31,6 +32,14 @@ v8::Platform* CreateDefaultPlatform(int thread_pool_size = 0); */ bool PumpMessageLoop(v8::Platform* platform, v8::Isolate* isolate); +/** + * Attempts to set the tracing controller for the given platform. + * + * The |platform| has to be created using |CreateDefaultPlatform|. + */ +void SetTracingController( + v8::Platform* platform, + v8::platform::tracing::TracingController* tracing_controller); } // namespace platform } // namespace v8 diff --git a/deps/v8/include/libplatform/v8-tracing.h b/deps/v8/include/libplatform/v8-tracing.h new file mode 100644 index 00000000000000..7646ea54896643 --- /dev/null +++ b/deps/v8/include/libplatform/v8-tracing.h @@ -0,0 +1,253 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_LIBPLATFORM_V8_TRACING_H_ +#define V8_LIBPLATFORM_V8_TRACING_H_ + +#include +#include +#include + +namespace v8 { +namespace platform { +namespace tracing { + +const int kTraceMaxNumArgs = 2; + +class TraceObject { + public: + union ArgValue { + bool as_bool; + uint64_t as_uint; + int64_t as_int; + double as_double; + const void* as_pointer; + const char* as_string; + }; + + TraceObject() {} + ~TraceObject(); + void Initialize(char phase, const uint8_t* category_enabled_flag, + const char* name, const char* scope, uint64_t id, + uint64_t bind_id, int num_args, const char** arg_names, + const uint8_t* arg_types, const uint64_t* arg_values, + unsigned int flags); + void UpdateDuration(); + void InitializeForTesting(char phase, const uint8_t* category_enabled_flag, + const char* name, const char* scope, uint64_t id, + uint64_t bind_id, int num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, unsigned int flags, + int pid, int tid, int64_t ts, int64_t tts, + uint64_t duration, uint64_t cpu_duration); + + int pid() const { return pid_; } + int tid() const { return tid_; } + char phase() const { return phase_; } + const uint8_t* category_enabled_flag() const { + return category_enabled_flag_; + } + const char* name() const { return name_; } + const char* scope() const { return scope_; } + uint64_t id() const { return id_; } + uint64_t bind_id() const { return bind_id_; } + int num_args() const { return num_args_; } + const char** arg_names() { return arg_names_; } + uint8_t* arg_types() { return arg_types_; } + ArgValue* arg_values() { return arg_values_; } + unsigned int flags() const { return flags_; } + int64_t ts() { return ts_; } + int64_t tts() { return tts_; } + uint64_t duration() { return duration_; } + uint64_t cpu_duration() { return cpu_duration_; } + + private: + int pid_; + int tid_; + char phase_; + const char* name_; + const char* scope_; + const uint8_t* category_enabled_flag_; + uint64_t id_; + uint64_t bind_id_; + int num_args_; + const char* arg_names_[kTraceMaxNumArgs]; + uint8_t arg_types_[kTraceMaxNumArgs]; + ArgValue arg_values_[kTraceMaxNumArgs]; + char* parameter_copy_storage_ = nullptr; + unsigned int flags_; + int64_t ts_; + int64_t tts_; + uint64_t duration_; + uint64_t cpu_duration_; + + // Disallow copy and assign + TraceObject(const TraceObject&) = delete; + void operator=(const TraceObject&) = delete; +}; + +class TraceWriter { + public: + TraceWriter() {} + virtual ~TraceWriter() {} + virtual void AppendTraceEvent(TraceObject* trace_event) = 0; + virtual void Flush() = 0; + + static TraceWriter* CreateJSONTraceWriter(std::ostream& stream); + + private: + // Disallow copy and assign + TraceWriter(const TraceWriter&) = delete; + void operator=(const TraceWriter&) = delete; +}; + +class TraceBufferChunk { + public: + explicit TraceBufferChunk(uint32_t seq); + + void Reset(uint32_t new_seq); + bool IsFull() const { return next_free_ == kChunkSize; } + TraceObject* AddTraceEvent(size_t* event_index); + TraceObject* GetEventAt(size_t index) { return &chunk_[index]; } + + uint32_t seq() const { return seq_; } + size_t size() const { return next_free_; } + + static const size_t kChunkSize = 64; + + private: + size_t next_free_ = 0; + TraceObject chunk_[kChunkSize]; + uint32_t seq_; + + // Disallow copy and assign + TraceBufferChunk(const TraceBufferChunk&) = delete; + void operator=(const TraceBufferChunk&) = delete; +}; + +class TraceBuffer { + public: + TraceBuffer() {} + virtual ~TraceBuffer() {} + + virtual TraceObject* AddTraceEvent(uint64_t* handle) = 0; + virtual TraceObject* GetEventByHandle(uint64_t handle) = 0; + virtual bool Flush() = 0; + + static const size_t kRingBufferChunks = 1024; + + static TraceBuffer* CreateTraceBufferRingBuffer(size_t max_chunks, + TraceWriter* trace_writer); + + private: + // Disallow copy and assign + TraceBuffer(const TraceBuffer&) = delete; + void operator=(const TraceBuffer&) = delete; +}; + +// Options determines how the trace buffer stores data. +enum TraceRecordMode { + // Record until the trace buffer is full. + RECORD_UNTIL_FULL, + + // Record until the user ends the trace. The trace buffer is a fixed size + // and we use it as a ring buffer during recording. + RECORD_CONTINUOUSLY, + + // Record until the trace buffer is full, but with a huge buffer size. + RECORD_AS_MUCH_AS_POSSIBLE, + + // Echo to console. Events are discarded. + ECHO_TO_CONSOLE, +}; + +class TraceConfig { + public: + typedef std::vector StringList; + + static TraceConfig* CreateDefaultTraceConfig(); + + TraceConfig() + : enable_sampling_(false), + enable_systrace_(false), + enable_argument_filter_(false) {} + TraceRecordMode GetTraceRecordMode() const { return record_mode_; } + bool IsSamplingEnabled() const { return enable_sampling_; } + bool IsSystraceEnabled() const { return enable_systrace_; } + bool IsArgumentFilterEnabled() const { return enable_argument_filter_; } + + void SetTraceRecordMode(TraceRecordMode mode) { record_mode_ = mode; } + void EnableSampling() { enable_sampling_ = true; } + void EnableSystrace() { enable_systrace_ = true; } + void EnableArgumentFilter() { enable_argument_filter_ = true; } + + void AddIncludedCategory(const char* included_category); + void AddExcludedCategory(const char* excluded_category); + + bool IsCategoryGroupEnabled(const char* category_group) const; + + private: + TraceRecordMode record_mode_; + bool enable_sampling_ : 1; + bool enable_systrace_ : 1; + bool enable_argument_filter_ : 1; + StringList included_categories_; + StringList excluded_categories_; + + // Disallow copy and assign + TraceConfig(const TraceConfig&) = delete; + void operator=(const TraceConfig&) = delete; +}; + +class TracingController { + public: + enum Mode { DISABLED = 0, RECORDING_MODE }; + + // The pointer returned from GetCategoryGroupEnabledInternal() points to a + // value with zero or more of the following bits. Used in this class only. + // The TRACE_EVENT macros should only use the value as a bool. + // These values must be in sync with macro values in TraceEvent.h in Blink. + enum CategoryGroupEnabledFlags { + // Category group enabled for the recording mode. + ENABLED_FOR_RECORDING = 1 << 0, + // Category group enabled by SetEventCallbackEnabled(). + ENABLED_FOR_EVENT_CALLBACK = 1 << 2, + // Category group enabled to export events to ETW. + ENABLED_FOR_ETW_EXPORT = 1 << 3 + }; + + TracingController() {} + void Initialize(TraceBuffer* trace_buffer); + const uint8_t* GetCategoryGroupEnabled(const char* category_group); + static const char* GetCategoryGroupName(const uint8_t* category_enabled_flag); + uint64_t AddTraceEvent(char phase, const uint8_t* category_enabled_flag, + const char* name, const char* scope, uint64_t id, + uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, unsigned int flags); + void UpdateTraceEventDuration(const uint8_t* category_enabled_flag, + const char* name, uint64_t handle); + + void StartTracing(TraceConfig* trace_config); + void StopTracing(); + + private: + const uint8_t* GetCategoryGroupEnabledInternal(const char* category_group); + void UpdateCategoryGroupEnabledFlag(size_t category_index); + void UpdateCategoryGroupEnabledFlags(); + + std::unique_ptr trace_buffer_; + std::unique_ptr trace_config_; + Mode mode_ = DISABLED; + + // Disallow copy and assign + TracingController(const TracingController&) = delete; + void operator=(const TracingController&) = delete; +}; + +} // namespace tracing +} // namespace platform +} // namespace v8 + +#endif // V8_LIBPLATFORM_V8_TRACING_H_ diff --git a/deps/v8/include/v8-debug.h b/deps/v8/include/v8-debug.h index 50314501e3b3b9..6385a31d85e80f 100644 --- a/deps/v8/include/v8-debug.h +++ b/deps/v8/include/v8-debug.h @@ -18,13 +18,11 @@ enum DebugEvent { Exception = 2, NewFunction = 3, BeforeCompile = 4, - AfterCompile = 5, + AfterCompile = 5, CompileError = 6, - PromiseEvent = 7, - AsyncTaskEvent = 8, + AsyncTaskEvent = 7, }; - class V8_EXPORT Debug { public: /** @@ -127,6 +125,8 @@ class V8_EXPORT Debug { */ virtual ClientData* GetClientData() const = 0; + virtual Isolate* GetIsolate() const = 0; + virtual ~EventDetails() {} }; @@ -157,9 +157,6 @@ class V8_EXPORT Debug { static bool SetDebugEventListener(Isolate* isolate, EventCallback that, Local data = Local()); - V8_DEPRECATED("Use version with an Isolate", - static bool SetDebugEventListener( - EventCallback that, Local data = Local())); // Schedule a debugger break to happen when JavaScript code is run // in the given isolate. @@ -174,8 +171,6 @@ class V8_EXPORT Debug { // Message based interface. The message protocol is JSON. static void SetMessageHandler(Isolate* isolate, MessageHandler handler); - V8_DEPRECATED("Use version with an Isolate", - static void SetMessageHandler(MessageHandler handler)); static void SendCommand(Isolate* isolate, const uint16_t* command, int length, @@ -199,9 +194,6 @@ class V8_EXPORT Debug { * } * \endcode */ - static V8_DEPRECATED("Use maybe version", - Local Call(v8::Local fun, - Local data = Local())); // TODO(dcarney): data arg should be a MaybeLocal static MaybeLocal Call(Local context, v8::Local fun, @@ -210,8 +202,6 @@ class V8_EXPORT Debug { /** * Returns a mirror object for the given object. */ - static V8_DEPRECATED("Use maybe version", - Local GetMirror(v8::Local obj)); static MaybeLocal GetMirror(Local context, v8::Local obj); @@ -247,8 +237,6 @@ class V8_EXPORT Debug { * of this method. */ static void ProcessDebugMessages(Isolate* isolate); - V8_DEPRECATED("Use version with an Isolate", - static void ProcessDebugMessages()); /** * Debugger is running in its own context which is entered while debugger @@ -258,9 +246,12 @@ class V8_EXPORT Debug { * least one DebugEventListener or MessageHandler is set. */ static Local GetDebugContext(Isolate* isolate); - V8_DEPRECATED("Use version with an Isolate", - static Local GetDebugContext()); + /** + * While in the debug context, this method returns the top-most non-debug + * context, if it exists. + */ + static MaybeLocal GetDebuggedContext(Isolate* isolate); /** * Enable/disable LiveEdit functionality for the given Isolate diff --git a/deps/v8/include/v8-experimental.h b/deps/v8/include/v8-experimental.h index 294ba647f03df9..1773345e09add4 100644 --- a/deps/v8/include/v8-experimental.h +++ b/deps/v8/include/v8-experimental.h @@ -31,13 +31,17 @@ class V8_EXPORT FastAccessorBuilder { ValueId IntegerConstant(int int_constant); ValueId GetReceiver(); ValueId LoadInternalField(ValueId value_id, int field_no); + ValueId LoadInternalFieldUnchecked(ValueId value_id, int field_no); ValueId LoadValue(ValueId value_id, int offset); ValueId LoadObject(ValueId value_id, int offset); + ValueId ToSmi(ValueId value_id); + void ReturnValue(ValueId value_id); void CheckFlagSetOrReturnNull(ValueId value_id, int mask); void CheckNotZeroOrReturnNull(ValueId value_id); LabelId MakeLabel(); void SetLabel(LabelId label_id); + void Goto(LabelId label_id); void CheckNotZeroOrJump(ValueId value_id, LabelId label_id); ValueId Call(v8::FunctionCallback callback, ValueId value_id); diff --git a/deps/v8/include/v8-platform.h b/deps/v8/include/v8-platform.h index 11f8d51f02573e..4023a5b234fd4b 100644 --- a/deps/v8/include/v8-platform.h +++ b/deps/v8/include/v8-platform.h @@ -152,9 +152,9 @@ class Platform { */ virtual uint64_t AddTraceEvent( char phase, const uint8_t* category_enabled_flag, const char* name, - uint64_t id, uint64_t bind_id, int32_t num_args, const char** arg_names, - const uint8_t* arg_types, const uint64_t* arg_values, - unsigned int flags) { + const char* scope, uint64_t id, uint64_t bind_id, int32_t num_args, + const char** arg_names, const uint8_t* arg_types, + const uint64_t* arg_values, unsigned int flags) { return 0; } diff --git a/deps/v8/include/v8-profiler.h b/deps/v8/include/v8-profiler.h index 007ae2eca55e41..bcb69f3763e1b7 100644 --- a/deps/v8/include/v8-profiler.h +++ b/deps/v8/include/v8-profiler.h @@ -46,6 +46,75 @@ template class V8_EXPORT std::vector; namespace v8 { +// TickSample captures the information collected for each sample. +struct TickSample { + // Internal profiling (with --prof + tools/$OS-tick-processor) wants to + // include the runtime function we're calling. Externally exposed tick + // samples don't care. + enum RecordCEntryFrame { kIncludeCEntryFrame, kSkipCEntryFrame }; + + TickSample() + : state(OTHER), + pc(nullptr), + external_callback_entry(nullptr), + frames_count(0), + has_external_callback(false), + update_stats(true) {} + + /** + * Initialize a tick sample from the isolate. + * \param isolate The isolate. + * \param state Execution state. + * \param record_c_entry_frame Include or skip the runtime function. + * \param update_stats Whether update the sample to the aggregated stats. + * \param use_simulator_reg_state When set to true and V8 is running under a + * simulator, the method will use the simulator + * register state rather than the one provided + * with |state| argument. Otherwise the method + * will use provided register |state| as is. + */ + void Init(Isolate* isolate, const v8::RegisterState& state, + RecordCEntryFrame record_c_entry_frame, bool update_stats, + bool use_simulator_reg_state = true); + /** + * Get a call stack sample from the isolate. + * \param isolate The isolate. + * \param state Register state. + * \param record_c_entry_frame Include or skip the runtime function. + * \param frames Caller allocated buffer to store stack frames. + * \param frames_limit Maximum number of frames to capture. The buffer must + * be large enough to hold the number of frames. + * \param sample_info The sample info is filled up by the function + * provides number of actual captured stack frames and + * the current VM state. + * \param use_simulator_reg_state When set to true and V8 is running under a + * simulator, the method will use the simulator + * register state rather than the one provided + * with |state| argument. Otherwise the method + * will use provided register |state| as is. + * \note GetStackSample is thread and signal safe and should only be called + * when the JS thread is paused or interrupted. + * Otherwise the behavior is undefined. + */ + static bool GetStackSample(Isolate* isolate, v8::RegisterState* state, + RecordCEntryFrame record_c_entry_frame, + void** frames, size_t frames_limit, + v8::SampleInfo* sample_info, + bool use_simulator_reg_state = true); + StateTag state; // The state of the VM. + void* pc; // Instruction pointer. + union { + void* tos; // Top stack value (*sp). + void* external_callback_entry; + }; + static const unsigned kMaxFramesCountLog2 = 8; + static const unsigned kMaxFramesCount = (1 << kMaxFramesCountLog2) - 1; + void* stack[kMaxFramesCount]; // Call stack. + unsigned frames_count : kMaxFramesCountLog2; // Number of captured frames. + bool has_external_callback : 1; + bool update_stats : 1; // Whether the sample should update aggregated stats. +}; + /** * CpuProfileNode represents a node in a call graph. */ @@ -103,7 +172,9 @@ class V8_EXPORT CpuProfileNode { unsigned GetHitCount() const; /** Returns function entry UID. */ - unsigned GetCallUid() const; + V8_DEPRECATE_SOON( + "Use GetScriptId, GetLineNumber, and GetColumnNumber instead.", + unsigned GetCallUid() const); /** Returns id of the node. The id is unique within the tree */ unsigned GetNodeId() const; @@ -173,13 +244,24 @@ class V8_EXPORT CpuProfile { void Delete(); }; - /** * Interface for controlling CPU profiling. Instance of the - * profiler can be retrieved using v8::Isolate::GetCpuProfiler. + * profiler can be created using v8::CpuProfiler::New method. */ class V8_EXPORT CpuProfiler { public: + /** + * Creates a new CPU profiler for the |isolate|. The isolate must be + * initialized. The profiler object must be disposed after use by calling + * |Dispose| method. + */ + static CpuProfiler* New(Isolate* isolate); + + /** + * Disposes the CPU profiler object. + */ + void Dispose(); + /** * Changes default CPU profiler sampling interval to the specified number * of microseconds. Default interval is 1000us. This method must be called @@ -515,6 +597,11 @@ class V8_EXPORT AllocationProfile { */ class V8_EXPORT HeapProfiler { public: + enum SamplingFlags { + kSamplingNoFlags = 0, + kSamplingForceGC = 1 << 0, + }; + /** * Callback function invoked for obtaining RetainedObjectInfo for * the given JavaScript wrapper object. It is prohibited to enter V8 @@ -640,7 +727,8 @@ class V8_EXPORT HeapProfiler { * Returns false if a sampling heap profiler is already running. */ bool StartSamplingHeapProfiler(uint64_t sample_interval = 512 * 1024, - int stack_depth = 16); + int stack_depth = 16, + SamplingFlags flags = kSamplingNoFlags); /** * Stops the sampling heap profile and discards the current profile. @@ -688,7 +776,6 @@ class V8_EXPORT HeapProfiler { HeapProfiler& operator=(const HeapProfiler&); }; - /** * Interface for providing information about embedder's objects * held by global handles. This information is reported in two ways: @@ -703,7 +790,7 @@ class V8_EXPORT HeapProfiler { * were not previously reported via AddObjectGroup. * * Thus, if an embedder wants to provide information about native - * objects for heap snapshots, he can do it in a GC prologue + * objects for heap snapshots, it can do it in a GC prologue * handler, and / or by assigning wrapper class ids in the following way: * * 1. Bind a callback to class id by calling SetWrapperClassInfoProvider. diff --git a/deps/v8/include/v8-util.h b/deps/v8/include/v8-util.h index 73ec658f7b0abe..8133fdd49dcf4f 100644 --- a/deps/v8/include/v8-util.h +++ b/deps/v8/include/v8-util.h @@ -95,12 +95,12 @@ class DefaultPersistentValueMapTraits : public StdMapTraits { MapType* map, const K& key, Local value) { return NULL; } - static MapType* MapFromWeakCallbackData( - const WeakCallbackData& data) { + static MapType* MapFromWeakCallbackInfo( + const WeakCallbackInfo& data) { return NULL; } - static K KeyFromWeakCallbackData( - const WeakCallbackData& data) { + static K KeyFromWeakCallbackInfo( + const WeakCallbackInfo& data) { return K(); } static void DisposeCallbackData(WeakCallbackDataType* data) { } @@ -205,6 +205,17 @@ class PersistentValueMapBase { reinterpret_cast(FromVal(Traits::Get(&impl_, key)))); } + /** + * Call V8::RegisterExternallyReferencedObject with the map value for given + * key. + */ + void RegisterExternallyReferencedObject(K& key) { + DCHECK(Contains(key)); + V8::RegisterExternallyReferencedObject( + reinterpret_cast(FromVal(Traits::Get(&impl_, key))), + reinterpret_cast(GetIsolate())); + } + /** * Return value for key and remove it from the map. */ @@ -402,11 +413,11 @@ class PersistentValueMap : public PersistentValueMapBase { private: static void WeakCallback( - const WeakCallbackData& data) { + const WeakCallbackInfo& data) { if (Traits::kCallbackType != kNotWeak) { PersistentValueMap* persistentValueMap = - Traits::MapFromWeakCallbackData(data); - K key = Traits::KeyFromWeakCallbackData(data); + Traits::MapFromWeakCallbackInfo(data); + K key = Traits::KeyFromWeakCallbackInfo(data); Traits::Dispose(data.GetIsolate(), persistentValueMap->Remove(key).Pass(), key); Traits::DisposeCallbackData(data.GetParameter()); diff --git a/deps/v8/include/v8-version.h b/deps/v8/include/v8-version.h index 9f61de82936dc4..7cc2493b83f8e9 100644 --- a/deps/v8/include/v8-version.h +++ b/deps/v8/include/v8-version.h @@ -9,9 +9,9 @@ // NOTE these macros are used by some of the tool scripts and the build // system so their names cannot be changed without changing the scripts. #define V8_MAJOR_VERSION 5 -#define V8_MINOR_VERSION 1 -#define V8_BUILD_NUMBER 281 -#define V8_PATCH_LEVEL 82 +#define V8_MINOR_VERSION 4 +#define V8_BUILD_NUMBER 500 +#define V8_PATCH_LEVEL 31 // Use 1 for candidates and 0 otherwise. // (Boolean macro values are not supported by all preprocessors.) diff --git a/deps/v8/include/v8.h b/deps/v8/include/v8.h index 8b7b7c2cc48c3b..d7e39adbaee349 100644 --- a/deps/v8/include/v8.h +++ b/deps/v8/include/v8.h @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -292,8 +293,8 @@ class Local { return Local(T::Cast(*that)); } - - template V8_INLINE Local As() { + template + V8_INLINE Local As() const { return Local::Cast(*this); } @@ -457,32 +458,12 @@ class WeakCallbackInfo { }; -template -class WeakCallbackData { - public: - typedef void (*Callback)(const WeakCallbackData& data); - - WeakCallbackData(Isolate* isolate, P* parameter, Local handle) - : isolate_(isolate), parameter_(parameter), handle_(handle) {} - - V8_INLINE Isolate* GetIsolate() const { return isolate_; } - V8_INLINE P* GetParameter() const { return parameter_; } - V8_INLINE Local GetValue() const { return handle_; } - - private: - Isolate* isolate_; - P* parameter_; - Local handle_; -}; - - -// TODO(dcarney): delete this with WeakCallbackData -template -using PhantomCallbackData = WeakCallbackInfo; - - -enum class WeakCallbackType { kParameter, kInternalFields }; - +// kParameter will pass a void* parameter back to the callback, kInternalFields +// will pass the first two internal fields back to the callback, kFinalizer +// will pass a void* parameter back, but is invoked before the object is +// actually collected, so it can be resurrected. In the last case, it is not +// possible to request a second pass callback. +enum class WeakCallbackType { kParameter, kInternalFields, kFinalizer }; /** * An object reference that is independent of any handle scope. Where @@ -561,36 +542,19 @@ template class PersistentBase { * critical form of resource management! */ template - V8_INLINE V8_DEPRECATED( - "use WeakCallbackInfo version", - void SetWeak(P* parameter, - typename WeakCallbackData::Callback callback)); - - template - V8_INLINE V8_DEPRECATED( - "use WeakCallbackInfo version", - void SetWeak(P* parameter, - typename WeakCallbackData::Callback callback)); - - // Phantom persistents work like weak persistents, except that the pointer to - // the object being collected is not available in the finalization callback. - // This enables the garbage collector to collect the object and any objects - // it references transitively in one GC cycle. At the moment you can either - // specify a parameter for the callback or the location of two internal - // fields in the dying object. - template - V8_INLINE V8_DEPRECATED( - "use SetWeak", - void SetPhantom(P* parameter, - typename WeakCallbackInfo

    ::Callback callback, - int internal_field_index1 = -1, - int internal_field_index2 = -1)); - - template V8_INLINE void SetWeak(P* parameter, typename WeakCallbackInfo

    ::Callback callback, WeakCallbackType type); + /** + * Turns this handle into a weak phantom handle without finalization callback. + * The handle will be reset automatically when the garbage collector detects + * that the object is no longer reachable. + * A related function Isolate::NumberOfPhantomHandleResetsSinceLastCall + * returns how many phantom handles were reset by the garbage collector. + */ + V8_INLINE void SetWeak(); + template V8_INLINE P* ClearWeak(); @@ -602,7 +566,7 @@ template class PersistentBase { * is alive. Only allowed when the embedder is asked to trace its heap by * EmbedderHeapTracer. */ - V8_INLINE void RegisterExternalReference(Isolate* isolate); + V8_INLINE void RegisterExternalReference(Isolate* isolate) const; /** * Marks the reference to this object independent. Garbage collector is free @@ -620,7 +584,9 @@ template class PersistentBase { * external dependencies. This mark is automatically cleared after each * garbage collection. */ - V8_INLINE void MarkPartiallyDependent(); + V8_INLINE V8_DEPRECATED( + "deprecated optimization, do not use partially dependent groups", + void MarkPartiallyDependent()); /** * Marks the reference to this object as active. The scavenge garbage @@ -778,17 +744,18 @@ template class Persistent : public PersistentBase { // TODO(dcarney): this is pretty useless, fix or remove template - V8_INLINE static Persistent& Cast(Persistent& that) { // NOLINT + V8_INLINE static Persistent& Cast(const Persistent& that) { // NOLINT #ifdef V8_ENABLE_CHECKS // If we're going to perform the type check then we have to check // that the handle isn't empty before doing the checked cast. if (!that.IsEmpty()) T::Cast(*that); #endif - return reinterpret_cast&>(that); + return reinterpret_cast&>(const_cast&>(that)); } // TODO(dcarney): this is pretty useless, fix or remove - template V8_INLINE Persistent& As() { // NOLINT + template + V8_INLINE Persistent& As() const { // NOLINT return Persistent::Cast(*this); } @@ -991,7 +958,7 @@ class V8_EXPORT SealHandleScope { void* operator new(size_t size); void operator delete(void*, size_t); - internal::Isolate* isolate_; + internal::Isolate* const isolate_; internal::Object** prev_limit_; int prev_sealed_level_; }; @@ -1648,26 +1615,25 @@ class V8_EXPORT StackFrame { // A StateTag represents a possible state of the VM. enum StateTag { JS, GC, COMPILER, OTHER, EXTERNAL, IDLE }; - // A RegisterState represents the current state of registers used // by the sampling profiler API. struct RegisterState { - RegisterState() : pc(NULL), sp(NULL), fp(NULL) {} + RegisterState() : pc(nullptr), sp(nullptr), fp(nullptr) {} void* pc; // Instruction pointer. void* sp; // Stack pointer. void* fp; // Frame pointer. }; - // The output structure filled up by GetStackSample API function. struct SampleInfo { - size_t frames_count; - StateTag vm_state; + size_t frames_count; // Number of frames collected. + StateTag vm_state; // Current VM state. + void* external_callback_entry; // External callback address if VM is + // executing an external callback. }; - /** - * A JSON Parser. + * A JSON Parser and Stringifier. */ class V8_EXPORT JSON { public: @@ -1678,10 +1644,24 @@ class V8_EXPORT JSON { * \param json_string The string to parse. * \return The corresponding value if successfully parsed. */ - static V8_DEPRECATED("Use maybe version", + static V8_DEPRECATED("Use the maybe version taking context", Local Parse(Local json_string)); + static V8_DEPRECATE_SOON("Use the maybe version taking context", + MaybeLocal Parse(Isolate* isolate, + Local json_string)); static V8_WARN_UNUSED_RESULT MaybeLocal Parse( - Isolate* isolate, Local json_string); + Local context, Local json_string); + + /** + * Tries to stringify the JSON-serializable object |json_object| and returns + * it as string if successful. + * + * \param json_object The JSON-serializable object to stringify. + * \return The corresponding string if successfully stringified. + */ + static V8_WARN_UNUSED_RESULT MaybeLocal Stringify( + Local context, Local json_object, + Local gap = Local()); }; @@ -1973,6 +1953,7 @@ class V8_EXPORT Value : public Data { */ bool IsProxy() const; + bool IsWebAssemblyCompiledModule() const; V8_WARN_UNUSED_RESULT MaybeLocal ToBoolean( Local context) const; @@ -2050,6 +2031,8 @@ class V8_EXPORT Value : public Data { template V8_INLINE static Value* Cast(T* value); + Local TypeOf(v8::Isolate*); + private: V8_INLINE bool QuickIsUndefined() const; V8_INLINE bool QuickIsNull() const; @@ -2639,6 +2622,33 @@ enum AccessControl { PROHIBITS_OVERWRITING = 1 << 2 }; +/** + * Property filter bits. They can be or'ed to build a composite filter. + */ +enum PropertyFilter { + ALL_PROPERTIES = 0, + ONLY_WRITABLE = 1, + ONLY_ENUMERABLE = 2, + ONLY_CONFIGURABLE = 4, + SKIP_STRINGS = 8, + SKIP_SYMBOLS = 16 +}; + +/** + * Keys/Properties filter enums: + * + * KeyCollectionMode limits the range of collected properties. kOwnOnly limits + * the collected properties to the given Object only. kIncludesPrototypes will + * include all keys of the objects's prototype chain as well. + */ +enum class KeyCollectionMode { kOwnOnly, kIncludePrototypes }; + +/** + * kIncludesIndices allows for integer indices to be collected, while + * kSkipIndices will exclude integer indicies from being collected. + */ +enum class IndexFilter { kIncludeIndices, kSkipIndices }; + /** * Integrity level for objects. */ @@ -2788,6 +2798,9 @@ class V8_EXPORT Object : public Value { V8_DEPRECATE_SOON("Use maybe version", Local GetPropertyNames()); V8_WARN_UNUSED_RESULT MaybeLocal GetPropertyNames( Local context); + V8_WARN_UNUSED_RESULT MaybeLocal GetPropertyNames( + Local context, KeyCollectionMode mode, + PropertyFilter property_filter, IndexFilter index_filter); /** * This function has the same functionality as GetPropertyNames but @@ -2798,6 +2811,15 @@ class V8_EXPORT Object : public Value { V8_WARN_UNUSED_RESULT MaybeLocal GetOwnPropertyNames( Local context); + /** + * Returns an array containing the names of the filtered properties + * of this object, including properties from prototype objects. The + * array returned by this method contains the same values as would + * be enumerated by a for-in statement over this object. + */ + V8_WARN_UNUSED_RESULT MaybeLocal GetOwnPropertyNames( + Local context, PropertyFilter filter); + /** * Get the prototype object. This does not skip objects marked to * be skipped by __proto__ and it does not consult the security @@ -2873,11 +2895,15 @@ class V8_EXPORT Object : public Value { * leads to undefined behavior. */ void SetAlignedPointerInInternalField(int index, void* value); + void SetAlignedPointerInInternalFields(int argc, int indices[], + void* values[]); // Testers for local properties. V8_DEPRECATED("Use maybe version", bool HasOwnProperty(Local key)); V8_WARN_UNUSED_RESULT Maybe HasOwnProperty(Local context, Local key); + V8_WARN_UNUSED_RESULT Maybe HasOwnProperty(Local context, + uint32_t index); V8_DEPRECATE_SOON("Use maybe version", bool HasRealNamedProperty(Local key)); V8_WARN_UNUSED_RESULT Maybe HasRealNamedProperty(Local context, @@ -2950,13 +2976,6 @@ class V8_EXPORT Object : public Value { */ int GetIdentityHash(); - V8_DEPRECATED("Use v8::Object::SetPrivate instead.", - bool SetHiddenValue(Local key, Local value)); - V8_DEPRECATED("Use v8::Object::GetPrivate instead.", - Local GetHiddenValue(Local key)); - V8_DEPRECATED("Use v8::Object::DeletePrivate instead.", - bool DeleteHiddenValue(Local key)); - /** * Clone this object with a fast but shallow copy. Values will point * to the same values as the original object. @@ -2976,6 +2995,11 @@ class V8_EXPORT Object : public Value { */ bool IsCallable(); + /** + * True if this object is a constructor. + */ + bool IsConstructor(); + /** * Call an Object as a function if a callback is set by the * ObjectTemplate::SetCallAsFunctionHandler method. @@ -3177,12 +3201,13 @@ class FunctionCallbackInfo { Local Callee() const); V8_INLINE Local This() const; V8_INLINE Local Holder() const; + V8_INLINE Local NewTarget() const; V8_INLINE bool IsConstructCall() const; V8_INLINE Local Data() const; V8_INLINE Isolate* GetIsolate() const; V8_INLINE ReturnValue GetReturnValue() const; // This shouldn't be public, but the arm compiler needs it. - static const int kArgsLength = 7; + static const int kArgsLength = 8; protected: friend class internal::FunctionCallbackArguments; @@ -3194,15 +3219,13 @@ class FunctionCallbackInfo { static const int kDataIndex = 4; static const int kCalleeIndex = 5; static const int kContextSaveIndex = 6; + static const int kNewTargetIndex = 7; V8_INLINE FunctionCallbackInfo(internal::Object** implicit_args, - internal::Object** values, - int length, - bool is_construct_call); + internal::Object** values, int length); internal::Object** implicit_args_; internal::Object** values_; int length_; - int is_construct_call_; }; @@ -3252,15 +3275,10 @@ class V8_EXPORT Function : public Object { * Create a function in the current execution context * for a given FunctionCallback. */ - static MaybeLocal New(Local context, - FunctionCallback callback, - Local data = Local(), - int length = 0); - static MaybeLocal New(Local context, - FunctionCallback callback, - Local data, - int length, - ConstructorBehavior behavior); + static MaybeLocal New( + Local context, FunctionCallback callback, + Local data = Local(), int length = 0, + ConstructorBehavior behavior = ConstructorBehavior::kAllow); static V8_DEPRECATE_SOON( "Use maybe version", Local New(Isolate* isolate, FunctionCallback callback, @@ -3390,12 +3408,6 @@ class V8_EXPORT Promise : public Object { * an argument. If the promise is already resolved/rejected, the handler is * invoked at the end of turn. */ - V8_DEPRECATED("Use maybe version of Then", - Local Chain(Local handler)); - V8_DEPRECATED("Use Then", - V8_WARN_UNUSED_RESULT MaybeLocal Chain( - Local context, Local handler)); - V8_DEPRECATED("Use maybe version", Local Catch(Local handler)); V8_WARN_UNUSED_RESULT MaybeLocal Catch(Local context, @@ -3445,6 +3457,19 @@ class V8_EXPORT Proxy : public Object { static void CheckCast(Value* obj); }; +class V8_EXPORT WasmCompiledModule : public Object { + public: + typedef std::pair, size_t> SerializedModule; + + SerializedModule Serialize(); + static MaybeLocal Deserialize( + Isolate* isolate, const SerializedModule& serialized_data); + V8_INLINE static WasmCompiledModule* Cast(Value* obj); + + private: + WasmCompiledModule(); + static void CheckCast(Value* obj); +}; #ifndef V8_ARRAY_BUFFER_INTERNAL_FIELD_COUNT // The number of required internal fields can be defined by embedder. @@ -3462,11 +3487,19 @@ enum class ArrayBufferCreationMode { kInternalized, kExternalized }; class V8_EXPORT ArrayBuffer : public Object { public: /** - * Allocator that V8 uses to allocate |ArrayBuffer|'s memory. + * A thread-safe allocator that V8 uses to allocate |ArrayBuffer|'s memory. * The allocator is a global V8 setting. It has to be set via * Isolate::CreateParams. * - * This API is experimental and may change significantly. + * Memory allocated through this allocator by V8 is accounted for as external + * memory by V8. Note that V8 keeps track of the memory for all internalized + * |ArrayBuffer|s. Responsibility for tracking external memory (using + * Isolate::AdjustAmountOfExternalAllocatedMemory) is handed over to the + * embedder upon externalization and taken over upon internalization (creating + * an internalized buffer from an existing buffer). + * + * Note that it is unsafe to call back into V8 from any of the allocator + * functions. */ class V8_EXPORT Allocator { // NOLINT public: @@ -3483,11 +3516,19 @@ class V8_EXPORT ArrayBuffer : public Object { * Memory does not have to be initialized. */ virtual void* AllocateUninitialized(size_t length) = 0; + /** * Free the memory block of size |length|, pointed to by |data|. * That memory is guaranteed to be previously allocated by |Allocate|. */ virtual void Free(void* data, size_t length) = 0; + + /** + * malloc/free based convenience allocator. + * + * Caller takes ownership. + */ + static Allocator* NewDefaultAllocator(); }; /** @@ -3560,7 +3601,7 @@ class V8_EXPORT ArrayBuffer : public Object { /** * Make this ArrayBuffer external. The pointer to underlying memory block * and byte length are returned as |Contents| structure. After ArrayBuffer - * had been etxrenalized, it does no longer owns the memory block. The caller + * had been externalized, it does no longer own the memory block. The caller * should take steps to free memory when it is no longer needed. * * The memory block is guaranteed to be allocated with |Allocator::Allocate| @@ -3571,7 +3612,7 @@ class V8_EXPORT ArrayBuffer : public Object { /** * Get a pointer to the ArrayBuffer's underlying memory block without * externalizing it. If the ArrayBuffer is not externalized, this pointer - * will become invalid as soon as the ArrayBuffer became garbage collected. + * will become invalid as soon as the ArrayBuffer gets garbage collected. * * The embedder should make sure to hold a strong reference to the * ArrayBuffer while accessing this pointer. @@ -3623,7 +3664,7 @@ class V8_EXPORT ArrayBufferView : public Object { * might incur. * * Will write at most min(|byte_length|, ByteLength) bytes starting at - * ByteOffset of the underling buffer to the memory starting at |dest|. + * ByteOffset of the underlying buffer to the memory starting at |dest|. * Returns the number of bytes actually written. */ size_t CopyContents(void* dest, size_t byte_length); @@ -3910,7 +3951,7 @@ class V8_EXPORT SharedArrayBuffer : public Object { /** * Make this SharedArrayBuffer external. The pointer to underlying memory * block and byte length are returned as |Contents| structure. After - * SharedArrayBuffer had been etxrenalized, it does no longer owns the memory + * SharedArrayBuffer had been externalized, it does no longer own the memory * block. The caller should take steps to free memory when it is no longer * needed. * @@ -4133,7 +4174,11 @@ enum Intrinsic { */ class V8_EXPORT Template : public Data { public: - /** Adds a property to each instance created by this template.*/ + /** + * Adds a property to each instance created by this template. + * + * The property must be defined either as a primitive value, or a template. + */ void Set(Local name, Local value, PropertyAttribute attributes = None); V8_INLINE void Set(Isolate* isolate, const char* name, Local value); @@ -4359,28 +4404,6 @@ enum AccessType { typedef bool (*AccessCheckCallback)(Local accessing_context, Local accessed_object, Local data); -typedef bool (*DeprecatedAccessCheckCallback)(Local accessing_context, - Local accessed_object); - -/** - * Returns true if cross-context access should be allowed to the named - * property with the given key on the host object. - */ -typedef bool (*NamedSecurityCallback)(Local host, - Local key, - AccessType type, - Local data); - - -/** - * Returns true if cross-context access should be allowed to the indexed - * property with the given index on the host object. - */ -typedef bool (*IndexedSecurityCallback)(Local host, - uint32_t index, - AccessType type, - Local data); - /** * A FunctionTemplate is used to create functions at runtime. There @@ -4391,7 +4414,7 @@ typedef bool (*IndexedSecurityCallback)(Local host, * preferred. * * Any modification of a FunctionTemplate after first instantiation will trigger - *a crash. + * a crash. * * A FunctionTemplate can have properties, these properties are added to the * function object when it is created. @@ -4407,17 +4430,21 @@ typedef bool (*IndexedSecurityCallback)(Local host, * The following example shows how to use a FunctionTemplate: * * \code - * v8::Local t = v8::FunctionTemplate::New(); - * t->Set("func_property", v8::Number::New(1)); + * v8::Local t = v8::FunctionTemplate::New(isolate); + * t->Set(isolate, "func_property", v8::Number::New(isolate, 1)); * * v8::Local proto_t = t->PrototypeTemplate(); - * proto_t->Set("proto_method", v8::FunctionTemplate::New(InvokeCallback)); - * proto_t->Set("proto_const", v8::Number::New(2)); + * proto_t->Set(isolate, + * "proto_method", + * v8::FunctionTemplate::New(isolate, InvokeCallback)); + * proto_t->Set(isolate, "proto_const", v8::Number::New(isolate, 2)); * * v8::Local instance_t = t->InstanceTemplate(); - * instance_t->SetAccessor("instance_accessor", InstanceAccessorCallback); - * instance_t->SetNamedPropertyHandler(PropertyHandlerCallback, ...); - * instance_t->Set("instance_property", Number::New(3)); + * instance_t->SetAccessor(String::NewFromUtf8(isolate, "instance_accessor"), + * InstanceAccessorCallback); + * instance_t->SetNamedPropertyHandler(PropertyHandlerCallback); + * instance_t->Set(String::NewFromUtf8(isolate, "instance_property"), + * Number::New(isolate, 3)); * * v8::Local function = t->GetFunction(); * v8::Local instance = function->NewInstance(); @@ -4483,10 +4510,12 @@ class V8_EXPORT FunctionTemplate : public Template { static Local New( Isolate* isolate, FunctionCallback callback = 0, Local data = Local(), - Local signature = Local(), int length = 0); - static Local New( - Isolate* isolate, FunctionCallback callback, Local data, - Local signature, int length, ConstructorBehavior behavior); + Local signature = Local(), int length = 0, + ConstructorBehavior behavior = ConstructorBehavior::kAllow); + + /** Get a template included in the snapshot by index. */ + static MaybeLocal FromSnapshot(Isolate* isolate, + size_t index); /** * Creates a function template with a fast handler. If a fast handler is set, @@ -4503,6 +4532,15 @@ class V8_EXPORT FunctionTemplate : public Template { V8_WARN_UNUSED_RESULT MaybeLocal GetFunction( Local context); + /** + * Similar to Context::NewRemoteContext, this creates an instance that + * isn't backed by an actual object. + * + * The InstanceTemplate of this FunctionTemplate must have access checks with + * handlers installed. + */ + V8_WARN_UNUSED_RESULT MaybeLocal NewRemoteInstance(); + /** * Set the call-handler callback for a FunctionTemplate. This * callback is called whenever the function created from this @@ -4663,6 +4701,10 @@ class V8_EXPORT ObjectTemplate : public Template { Local constructor = Local()); static V8_DEPRECATED("Use isolate version", Local New()); + /** Get a template included in the snapshot by index. */ + static MaybeLocal FromSnapshot(Isolate* isolate, + size_t index); + /** Creates a new instance of this template.*/ V8_DEPRECATE_SOON("Use maybe version", Local NewInstance()); V8_WARN_UNUSED_RESULT MaybeLocal NewInstance(Local context); @@ -4714,8 +4756,10 @@ class V8_EXPORT ObjectTemplate : public Template { * from this object template, the provided callback is invoked instead of * accessing the property directly on the JavaScript object. * - * Note that new code should use the second version that can intercept - * symbol-named properties as well as string-named properties. + * SetNamedPropertyHandler() is different from SetHandler(), in + * that the latter can intercept symbol-named properties as well as + * string-named properties when called with a + * NamedPropertyHandlerConfiguration. New code should use SetHandler(). * * \param getter The callback to invoke when getting a property. * \param setter The callback to invoke when setting a property. @@ -4734,6 +4778,18 @@ class V8_EXPORT ObjectTemplate : public Template { NamedPropertyDeleterCallback deleter = 0, NamedPropertyEnumeratorCallback enumerator = 0, Local data = Local()); + + /** + * Sets a named property handler on the object template. + * + * Whenever a property whose name is a string or a symbol is accessed on + * objects created from this object template, the provided callback is + * invoked instead of accessing the property directly on the JavaScript + * object. + * + * @param configuration The NamedPropertyHandlerConfiguration that defines the + * callbacks to invoke when accessing a property. + */ void SetHandler(const NamedPropertyHandlerConfiguration& configuration); /** @@ -4752,7 +4808,6 @@ class V8_EXPORT ObjectTemplate : public Template { * \param data A piece of data that will be passed to the callbacks * whenever they are invoked. */ - void SetHandler(const IndexedPropertyHandlerConfiguration& configuration); // TODO(dcarney): deprecate void SetIndexedPropertyHandler( IndexedPropertyGetterCallback getter, @@ -4764,6 +4819,19 @@ class V8_EXPORT ObjectTemplate : public Template { SetHandler(IndexedPropertyHandlerConfiguration(getter, setter, query, deleter, enumerator, data)); } + + /** + * Sets an indexed property handler on the object template. + * + * Whenever an indexed property is accessed on objects created from + * this object template, the provided callback is invoked instead of + * accessing the property directly on the JavaScript object. + * + * @param configuration The IndexedPropertyHandlerConfiguration that defines + * the callbacks to invoke when accessing a property. + */ + void SetHandler(const IndexedPropertyHandlerConfiguration& configuration); + /** * Sets the callback to be used when calling instances created from * this template as a function. If no callback is set, instances @@ -4793,16 +4861,18 @@ class V8_EXPORT ObjectTemplate : public Template { */ void SetAccessCheckCallback(AccessCheckCallback callback, Local data = Local()); - V8_DEPRECATED( - "Use SetAccessCheckCallback with new AccessCheckCallback signature.", - void SetAccessCheckCallback(DeprecatedAccessCheckCallback callback, - Local data = Local())); - V8_DEPRECATED( - "Use SetAccessCheckCallback instead", - void SetAccessCheckCallbacks(NamedSecurityCallback named_handler, - IndexedSecurityCallback indexed_handler, - Local data = Local())); + /** + * Like SetAccessCheckCallback but invokes an interceptor on failed access + * checks instead of looking up all-can-read properties. You can only use + * either this method or SetAccessCheckCallback, but not both at the same + * time. + */ + void SetAccessCheckCallbackAndHandler( + AccessCheckCallback callback, + const NamedPropertyHandlerConfiguration& named_handler, + const IndexedPropertyHandlerConfiguration& indexed_handler, + Local data = Local()); /** * Gets the number of internal fields for objects generated from @@ -4816,6 +4886,17 @@ class V8_EXPORT ObjectTemplate : public Template { */ void SetInternalFieldCount(int value); + /** + * Returns true if the object will be an immutable prototype exotic object. + */ + bool IsImmutableProto(); + + /** + * Makes the ObjectTempate for an immutable prototype exotic object, with an + * immutable __proto__. + */ + void SetImmutableProto(); + private: ObjectTemplate(); static Local New(internal::Isolate* isolate, @@ -4982,6 +5063,7 @@ class V8_EXPORT ResourceConstraints { typedef void (*FatalErrorCallback)(const char* location, const char* message); +typedef void (*OOMErrorCallback)(const char* location, bool is_heap_oom); typedef void (*MessageCallback)(Local message, Local error); @@ -5047,10 +5129,6 @@ enum ObjectSpace { kAllocationActionAll = kAllocationActionAllocate | kAllocationActionFree }; -typedef void (*MemoryAllocationCallback)(ObjectSpace space, - AllocationAction action, - int size); - // --- Enter/Leave Script Callback --- typedef void (*BeforeCallEnteredCallback)(Isolate*); typedef void (*CallCompletedCallback)(Isolate*); @@ -5130,6 +5208,11 @@ class V8_EXPORT MicrotasksScope { */ static int GetCurrentDepth(Isolate* isolate); + /** + * Returns true while microtasks are being executed. + */ + static bool IsRunningMicrotasks(Isolate* isolate); + private: internal::Isolate* const isolate_; bool run_; @@ -5189,6 +5272,7 @@ enum GCCallbackFlags { kGCCallbackFlagForced = 1 << 2, kGCCallbackFlagSynchronousPhantomCallbackProcessing = 1 << 3, kGCCallbackFlagCollectAllAvailableGarbage = 1 << 4, + kGCCallbackFlagCollectAllExternalMemory = 1 << 5, }; typedef void (*GCCallback)(GCType type, GCCallbackFlags flags); @@ -5211,6 +5295,8 @@ class V8_EXPORT HeapStatistics { size_t total_available_size() { return total_available_size_; } size_t used_heap_size() { return used_heap_size_; } size_t heap_size_limit() { return heap_size_limit_; } + size_t malloced_memory() { return malloced_memory_; } + size_t peak_malloced_memory() { return peak_malloced_memory_; } size_t does_zap_garbage() { return does_zap_garbage_; } private: @@ -5220,6 +5306,8 @@ class V8_EXPORT HeapStatistics { size_t total_available_size_; size_t used_heap_size_; size_t heap_size_limit_; + size_t malloced_memory_; + size_t peak_malloced_memory_; bool does_zap_garbage_; friend class V8; @@ -5264,6 +5352,18 @@ class V8_EXPORT HeapObjectStatistics { friend class Isolate; }; +class V8_EXPORT HeapCodeStatistics { + public: + HeapCodeStatistics(); + size_t code_and_metadata_size() { return code_and_metadata_size_; } + size_t bytecode_and_metadata_size() { return bytecode_and_metadata_size_; } + + private: + size_t code_and_metadata_size_; + size_t bytecode_and_metadata_size_; + + friend class Isolate; +}; class RetainedObjectInfo; @@ -5346,6 +5446,28 @@ struct JitCodeEvent { }; }; +/** + * Option flags passed to the SetRAILMode function. + * See documentation https://developers.google.com/web/tools/chrome-devtools/ + * profile/evaluate-performance/rail + */ +enum RAILMode { + // Response performance mode: In this mode very low virtual machine latency + // is provided. V8 will try to avoid JavaScript execution interruptions. + // Throughput may be throttled. + PERFORMANCE_RESPONSE, + // Animation performance mode: In this mode low virtual machine latency is + // provided. V8 will try to avoid as many JavaScript execution interruptions + // as possible. Throughput may be throttled. This is the default mode. + PERFORMANCE_ANIMATION, + // Idle performance mode: The embedder is idle. V8 can complete deferred work + // in this mode. + PERFORMANCE_IDLE, + // Load performance mode: In this mode high throughput is provided. V8 may + // turn off latency optimizations. + PERFORMANCE_LOAD +}; + /** * Option flags passed to the SetJitCodeEventHandler function. */ @@ -5401,31 +5523,56 @@ enum class MemoryPressureLevel { kNone, kModerate, kCritical }; * trace through its heap and call PersistentBase::RegisterExternalReference on * each js object reachable from any of the given wrappers. * - * Before the first call to the TraceWrappableFrom function v8 will call - * TraceRoots. When the v8 garbage collection is finished, v8 will call - * ClearTracingMarks. + * Before the first call to the TraceWrappersFrom function TracePrologue will be + * called. When the garbage collection cycle is finished, TraceEpilogue will be + * called. */ -class EmbedderHeapTracer { +class V8_EXPORT EmbedderHeapTracer { public: + enum ForceCompletionAction { FORCE_COMPLETION, DO_NOT_FORCE_COMPLETION }; + struct AdvanceTracingActions { + explicit AdvanceTracingActions(ForceCompletionAction force_completion_) + : force_completion(force_completion_) {} + + ForceCompletionAction force_completion; + }; + /** + * V8 will call this method with internal fields of found wrappers. + * Embedder is expected to store them in it's marking deque and trace + * reachable wrappers from them when asked by AdvanceTracing method. + */ + virtual void RegisterV8References( + const std::vector >& internal_fields) = 0; /** * V8 will call this method at the beginning of the gc cycle. */ - virtual void TraceRoots(Isolate* isolate) = 0; - + virtual void TracePrologue() = 0; /** - * V8 will call this method with internal fields of a potential wrappers. - * Embedder is expected to trace its heap (synchronously) and call - * PersistentBase::RegisterExternalReference() on all wrappers reachable from - * any of the given wrappers. + * Embedder is expected to trace its heap starting from wrappers reported by + * RegisterV8References method, and call + * PersistentBase::RegisterExternalReference() on all reachable wrappers. + * Embedder is expected to stop tracing by the given deadline. + * + * Returns true if there is still work to do. */ - virtual void TraceWrappableFrom( - Isolate* isolate, - const std::vector >& internal_fields) = 0; + virtual bool AdvanceTracing(double deadline_in_ms, + AdvanceTracingActions actions) = 0; /** * V8 will call this method at the end of the gc cycle. Allocation is *not* - * allowed in the ClearTracingMarks. + * allowed in the TraceEpilogue. + */ + virtual void TraceEpilogue() = 0; + + /** + * Let embedder know v8 entered final marking pause (no more incremental steps + * will follow). + */ + virtual void EnterFinalPause() {} + + /** + * Throw away all intermediate data and reset to the initial state. */ - virtual void ClearTracingMarks(Isolate* isolate) = 0; + virtual void AbortTracing() {} protected: virtual ~EmbedderHeapTracer() = default; @@ -5446,20 +5593,21 @@ class V8_EXPORT Isolate { */ struct CreateParams { CreateParams() - : entry_hook(NULL), - code_event_handler(NULL), - snapshot_blob(NULL), - counter_lookup_callback(NULL), - create_histogram_callback(NULL), - add_histogram_sample_callback(NULL), - array_buffer_allocator(NULL) {} + : entry_hook(nullptr), + code_event_handler(nullptr), + snapshot_blob(nullptr), + counter_lookup_callback(nullptr), + create_histogram_callback(nullptr), + add_histogram_sample_callback(nullptr), + array_buffer_allocator(nullptr), + external_references(nullptr) {} /** * The optional entry_hook allows the host application to provide the * address of a function that's invoked on entry to every V8-generated * function. Note that entry_hook is invoked at the very start of each - * generated function. Furthermore, if an entry_hook is given, V8 will - * always run without a context snapshot. + * generated function. Furthermore, if an entry_hook is given, V8 will + * not use a snapshot, including custom snapshots. */ FunctionEntryHook entry_hook; @@ -5500,6 +5648,14 @@ class V8_EXPORT Isolate { * store of ArrayBuffers. */ ArrayBuffer::Allocator* array_buffer_allocator; + + /** + * Specifies an optional nullptr-terminated array of raw addresses in the + * embedder that V8 can match against during serialization and use for + * deserialization. This array and its content must stay valid for the + * entire lifetime of the isolate. + */ + intptr_t* external_references; }; @@ -5573,7 +5729,7 @@ class V8_EXPORT Isolate { ~SuppressMicrotaskExecutionScope(); private: - internal::Isolate* isolate_; + internal::Isolate* const isolate_; // Prevent copying of Scope objects. SuppressMicrotaskExecutionScope(const SuppressMicrotaskExecutionScope&); @@ -5628,9 +5784,13 @@ class V8_EXPORT Isolate { kLegacyFunctionDeclaration = 29, kRegExpPrototypeSourceGetter = 30, kRegExpPrototypeOldFlagGetter = 31, + kDecimalWithLeadingZeroInStrictMode = 32, + kLegacyDateParser = 33, + kDefineGetterOrSetterWouldThrow = 34, + kFunctionConstructorReturnedUndefined = 35, - // If you add new values here, you'll also need to update V8Initializer.cpp - // in Chromium. + // If you add new values here, you'll also need to update Chromium's: + // UseCounter.h, V8PerIsolateData.cpp, histograms.xml kUseCounterFeatureCount // This enum value must be last. }; @@ -5771,6 +5931,15 @@ class V8_EXPORT Isolate { bool GetHeapObjectStatisticsAtLastGC(HeapObjectStatistics* object_statistics, size_t type_index); + /** + * Get statistics about code and its metadata in the heap. + * + * \param object_statistics The HeapCodeStatistics object to fill in + * statistics of code, bytecode and their metadata. + * \returns true on success. + */ + bool GetHeapCodeAndMetadataStatistics(HeapCodeStatistics* object_statistics); + /** * Get a call stack sample from the isolate. * \param state Execution state. @@ -5802,6 +5971,12 @@ class V8_EXPORT Isolate { V8_INLINE int64_t AdjustAmountOfExternalAllocatedMemory(int64_t change_in_bytes); + /** + * Returns the number of phantom handles without callbacks that were reset + * by the garbage collector since the last call to this function. + */ + size_t NumberOfPhantomHandleResetsSinceLastCall(); + /** * Returns heap profiler for this isolate. Will return NULL until the isolate * is initialized. @@ -5813,7 +5988,8 @@ class V8_EXPORT Isolate { * is initialized. It is the embedder's responsibility to stop all CPU * profiling activities if it has started any. */ - CpuProfiler* GetCpuProfiler(); + V8_DEPRECATE_SOON("CpuProfiler should be created with CpuProfiler::New call.", + CpuProfiler* GetCpuProfiler()); /** Returns true if this isolate has a current context. */ bool InContext(); @@ -6142,6 +6318,15 @@ class V8_EXPORT Isolate { */ void IsolateInBackgroundNotification(); + /** + * Optional notification to tell V8 the current performance requirements + * of the embedder based on RAIL. + * V8 uses these notifications to guide heuristics. + * This is an unfinished experimental feature. Semantics and implementation + * may change frequently. + */ + void SetRAILMode(RAILMode rail_mode); + /** * Allows the host application to provide the address of a function that is * notified each time code is added, moved or removed. @@ -6196,6 +6381,9 @@ class V8_EXPORT Isolate { /** Set the callback to invoke in case of fatal errors. */ void SetFatalErrorHandler(FatalErrorCallback that); + /** Set the callback to invoke in case of OOM errors. */ + void SetOOMErrorHandler(OOMErrorCallback that); + /** * Set the callback to invoke to check if code generation from * strings should be allowed. @@ -6237,18 +6425,6 @@ class V8_EXPORT Isolate { bool capture, int frame_limit = 10, StackTrace::StackTraceOptions options = StackTrace::kOverview); - /** - * Enables the host application to provide a mechanism to be notified - * and perform custom logging when V8 Allocates Executable Memory. - */ - void AddMemoryAllocationCallback(MemoryAllocationCallback callback, - ObjectSpace space, AllocationAction action); - - /** - * Removes callback that was installed by AddMemoryAllocationCallback. - */ - void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback); - /** * Iterates through all external resources referenced from current isolate * heap. GC is not invoked prior to iterating, therefore there is no @@ -6278,6 +6454,12 @@ class V8_EXPORT Isolate { */ void VisitWeakHandles(PersistentHandleVisitor* visitor); + /** + * Check if this isolate is in use. + * True if at least one thread Enter'ed this isolate. + */ + bool IsInUse(); + private: template friend class PersistentValueMapBase; @@ -6308,19 +6490,18 @@ class V8_EXPORT StartupData { */ typedef bool (*EntropySource)(unsigned char* buffer, size_t length); - /** * ReturnAddressLocationResolver is used as a callback function when v8 is * resolving the location of a return address on the stack. Profilers that * change the return address on the stack can use this to resolve the stack * location to whereever the profiler stashed the original return address. * - * \param return_addr_location points to a location on stack where a machine + * \param return_addr_location A location on stack where a machine * return address resides. - * \returns either return_addr_location, or else a pointer to the profiler's + * \returns Either return_addr_location, or else a pointer to the profiler's * copy of the original return address. * - * \note the resolver function must not cause garbage collection. + * \note The resolver function must not cause garbage collection. */ typedef uintptr_t (*ReturnAddressLocationResolver)( uintptr_t return_addr_location); @@ -6483,23 +6664,6 @@ class V8_EXPORT V8 { "Use isolate version", void RemoveGCEpilogueCallback(GCCallback callback)); - /** - * Enables the host application to provide a mechanism to be notified - * and perform custom logging when V8 Allocates Executable Memory. - */ - V8_INLINE static V8_DEPRECATED( - "Use isolate version", - void AddMemoryAllocationCallback(MemoryAllocationCallback callback, - ObjectSpace space, - AllocationAction action)); - - /** - * Removes callback that was installed by AddMemoryAllocationCallback. - */ - V8_INLINE static V8_DEPRECATED( - "Use isolate version", - void RemoveMemoryAllocationCallback(MemoryAllocationCallback callback)); - /** * Initializes V8. This function needs to be called before the first Isolate * is created. It always returns true. @@ -6620,7 +6784,24 @@ class V8_EXPORT V8 { * If V8 was compiled with the ICU data in an external file, the location * of the data file has to be provided. */ - static bool InitializeICU(const char* icu_data_file = NULL); + V8_DEPRECATE_SOON( + "Use version with default location.", + static bool InitializeICU(const char* icu_data_file = nullptr)); + + /** + * Initialize the ICU library bundled with V8. The embedder should only + * invoke this method when using the bundled ICU. If V8 was compiled with + * the ICU data in an external file and when the default location of that + * file should be used, a path to the executable must be provided. + * Returns true on success. + * + * The default is a file called icudtl.dat side-by-side with the executable. + * + * Optionally, the location of the data file can be provided to override the + * default. + */ + static bool InitializeICUDefaultLocation(const char* exec_path, + const char* icu_data_file = nullptr); /** * Initialize the external startup data. The embedder only needs to @@ -6660,26 +6841,27 @@ class V8_EXPORT V8 { internal::Object** handle); static internal::Object** CopyPersistent(internal::Object** handle); static void DisposeGlobal(internal::Object** global_handle); - typedef WeakCallbackData::Callback WeakCallback; - static void RegisterExternallyReferencedObject(internal::Object** object, - internal::Isolate* isolate); - static void MakeWeak(internal::Object** global_handle, void* data, - WeakCallback weak_callback); - static void MakeWeak(internal::Object** global_handle, void* data, + static void MakeWeak(internal::Object** location, void* data, WeakCallbackInfo::Callback weak_callback, WeakCallbackType type); - static void MakeWeak(internal::Object** global_handle, void* data, + static void MakeWeak(internal::Object** location, void* data, // Must be 0 or -1. int internal_field_index1, // Must be 1 or -1. int internal_field_index2, WeakCallbackInfo::Callback weak_callback); - static void* ClearWeak(internal::Object** global_handle); + static void MakeWeak(internal::Object*** location_addr); + static void* ClearWeak(internal::Object** location); static void Eternalize(Isolate* isolate, Value* handle, int* index); static Local GetEternal(Isolate* isolate, int index); + static void RegisterExternallyReferencedObject(internal::Object** object, + internal::Isolate* isolate); + template + friend class PersistentValueMapBase; + static void FromJustIsNothing(); static void ToLocalEmpty(); static void InternalFieldOutOfBounds(int index); @@ -6696,6 +6878,60 @@ class V8_EXPORT V8 { friend class Context; }; +/** + * Helper class to create a snapshot data blob. + */ +class SnapshotCreator { + public: + enum class FunctionCodeHandling { kClear, kKeep }; + + /** + * Create and enter an isolate, and set it up for serialization. + * The isolate is either created from scratch or from an existing snapshot. + * The caller keeps ownership of the argument snapshot. + * \param existing_blob existing snapshot from which to create this one. + * \param external_references a null-terminated array of external references + * that must be equivalent to CreateParams::external_references. + */ + SnapshotCreator(intptr_t* external_references = nullptr, + StartupData* existing_blob = nullptr); + + ~SnapshotCreator(); + + /** + * \returns the isolate prepared by the snapshot creator. + */ + Isolate* GetIsolate(); + + /** + * Add a context to be included in the snapshot blob. + * \returns the index of the context in the snapshot blob. + */ + size_t AddContext(Local context); + + /** + * Add a template to be included in the snapshot blob. + * \returns the index of the template in the snapshot blob. + */ + size_t AddTemplate(Local