aboutsummaryrefslogtreecommitdiffstats
path: root/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul
diff options
context:
space:
mode:
Diffstat (limited to 'vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul')
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/CHANGELOG.md304
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/LICENSE24
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/README.md269
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/index.js153
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/base.css182
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sort-arrow-sprite.pngbin0 -> 209 bytes
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sorter.js156
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.css1
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.js1
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/cli.js94
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/collector.js122
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/check-coverage.js195
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/common/run-with-cover.js261
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/cover.js33
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/help.js102
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/index.js33
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/instrument.js261
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/report.js123
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/test.js31
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/config.js483
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/hook.js198
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/instrumenter.js1040
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/object-utils.js425
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/register-plugins.js15
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/clover.js227
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/cobertura.js221
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/common/defaults.js49
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/html.js567
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/index.js104
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json-summary.js75
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json.js69
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcov.js65
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcovonly.js103
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/none.js41
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/teamcity.js92
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/foot.txt18
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/head.txt36
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-lcov.js50
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-summary.js93
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text.js234
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/reporter.js111
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/fslookup.js61
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/index.js123
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/memory.js56
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/tmp.js81
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/factory.js88
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-matcher.js76
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-writer.js154
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/help-formatter.js30
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/input-error.js12
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/insertion-text.js109
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/meta.js13
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/tree-summarizer.js213
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/writer.js92
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/yui-load-hook.js49
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse15
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse.cmd7
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate15
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate.cmd7
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/CHANGELOG.md125
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/LICENSE19
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/README.md1877
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.js1265
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.min.js2
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/lib/async.js1265
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/package.json157
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/ChangeLog143
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/LICENSE.BSD21
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/README.md22
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esparse.js126
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esvalidate.js199
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/esprima.js5637
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/package.json137
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.npmignore1
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.travis.yml6
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/CHANGELOG.md25
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/LICENSE-MIT22
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/README.md97
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/lib/fileset.js102
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/package.json87
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/fixtures/an (odd) filename.js1
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/helper.js61
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test-sync.js37
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test.js137
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/LICENSE18
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/README.markdown70
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/center.js10
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/meat.js3
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/index.js76
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/package.json94
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/break.js32
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/idleness.txt63
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/wrap.js33
-rw-r--r--vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/package.json349
94 files changed, 20181 insertions, 0 deletions
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/CHANGELOG.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/CHANGELOG.md
new file mode 100644
index 00000000..59351c89
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/CHANGELOG.md
@@ -0,0 +1,304 @@
+Changelog
+---------
+
+<table>
+<tr>
+<td>v0.3.21</td>
+<td>
+ <ul>
+ <li>Updated dependencies to the latest</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.20</td>
+<td>
+ <ul>
+ <li>Fix broken es6 `super` support, thanks @sterlinghw</li>
+ <li>Improve readability via better lineHeight, thanks @dhoko</li>
+ <li>Adding ability to set custom block name in teamcity report, thanks @aryelu</li>
+ <li>Replaced deprecated util.puts with console.log, thanks @arty-name
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.19</td>
+<td>Fix instrumenter for multiple blank array positions, thanks @alexdunphy</td>
+</tr>
+<tr>
+<tr>
+<td>v0.3.18</td>
+<td>Upgrade esprima, get support for more ES6 features</td>
+</tr>
+<tr>
+<td>v0.3.17</td>
+<td>Upgrade esprima, get correct for-of support</td>
+</tr>
+<tr>
+<td>v0.3.16</td>
+<td>
+ <ul>
+ <li>upgrades to filset and async modules, thanks to @roderickhsiao, @popomore</li>
+ <li>updated text reporter so that it displays a list of the lines missing coverage, thanks @bcoe</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.15</td>
+<td>
+ <ul>
+ <li>Fix #375: add nodir option to exclude directory for *.js matcher thanks to @yurenju</li>
+ <li>Fix #362: When setting up the `reportDir` add it to `reporter.dir`</li>
+ <li>Fixes #238 (added a poorman's clone)</li>
+ <li>Incrementing hits on ignored statements implemented</li>
+ <li>`a:visited color: #777` (a nice gray color)</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.14</td>
+<td>
+ Add text-lcov report format to emit lcov to console, thanks to @bcoe
+</td>
+</tr>
+<tr>
+<td>v0.3.13</td>
+<td>
+ Fix #339
+</td>
+</tr>
+<tr>
+<td>v0.3.12</td>
+<td>
+ Allow other-than-dot-js files to be hooked, thanks to @sethpollack
+</td>
+</tr>
+<tr>
+<td>v0.3.11</td>
+<td>
+ Avoid modification of global objects, thanks to @dominykas
+</td>
+</tr>
+<tr>
+<td>v0.3.10</td>
+<td>
+ Update escodegen to 1.6.x and add browser download script
+</td>
+</tr>
+<tr>
+<td>v0.3.9</td>
+<td>
+ <ul>
+ <li>Merge harmony branch and start adding ES6 features to istanbul</li>
+ <li>Arrow functions are the only feature of interest now</li>
+ <li>`for-of` and `yield` support exist but not present in mainline esprima yet</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.8</td>
+<td>
+ <ul>
+ <li>Fail check coverage command when no coverage files found, thanks to @nexus-uw</li>
+ <li>handle relative paths in check-coverage, thanks to @dragn</li>
+ <li>support explicit includes for cover, thanks to @tonylukasavage</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.7</td>
+<td>
+ Fix asset paths on windows, thanks to @juangabreil
+</td>
+</tr>
+<tr>
+<td>v0.3.6</td>
+<td>
+ <ul>
+ <li>Update to Esprima 2.0</li>
+ <li>Remove YUI dependency and provide custom sort code. No network access needed for HTML report view</li>
+ <li>use supports-color module to colorize output, thanks to @gustavnikolaj</li>
+ <li>Fix tests to work on Windows, thanks to @dougwilson</li>
+ <li>Docs: "Instrument code" API example correction thanks to @robatron</li>
+ <li>Extracted embedded CSS and JavaScript and made them external files, thanks to @booleangate</td>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.3.5</td>
+<td>
+<p>Merge #275 - `--include-all-sources` option. Thanks @gustavnikolaj</p>
+<p>
+The `--preload-sources` option is now deprecated and superseded by the
+`--include-all-sources` option instead. This provides a better coverage representation
+of the code that has not been included for testing.
+</p>
+</td>
+</tr>
+<tr>
+<td>v0.3.4</td>
+<td>Merge #219 - Support reporting within symlink/junction. Thanks to @dougwilson</td>
+</tr>
+<tr>
+<td>v0.3.3</td>
+<td>Merge #268 - per file coverage enforcement. Thanks to @ryan-roemer</td>
+</tr>
+<tr>
+<td>v0.3.2</td>
+<td>Republish 0.3.1 because of bad shasum</td>
+</tr>
+<tr>
+<td>v0.3.1</td>
+<td>Fixes #249</td>
+</tr>
+<tr>
+<td>v0.3.0</td>
+<td>
+ The *reports* release. **Potentially backwards-incompatible** if you are using
+ undocumented features or custom report implementations.
+ <ul>
+ <li>Change report command line to support multiple reports, add back-compat processing with warnings</li>
+ <li>Enable `report` command to read report list from config, thanks to @piuccio</li>
+ <li>Support multiple reports for `cover` and `report` commands</li>
+ <li>Support per-report config options in configuration file</li>
+ <li>Turn reports into event emitters so they can signal `done`</li>
+ <li>Add `Reporter` class to be able to generate multiple reports</li>
+ <li>Add a bunch of API docs, refactor README</li>
+ </ul>
+</td>
+</tr>
+<tr>
+<td>v0.2.16</td><td>Make YUI links https-always since relative links break local
+filesystem use-case
+</td>
+</tr>
+<tr>
+<td>v0.2.15</td><td>make link protocols relative so they don't break on https connections
+(thanks to @yasyf)
+</td>
+</tr>
+<tr>
+<td>v0.2.14</td><td>Fix hook to deal with non-string/ missing filenames
+(thanks to @jason0x43), update dependencies
+</td>
+</tr>
+<tr>
+<td>v0.2.13</td><td>Add `--preload-sources` option to `cover` command to make
+code not required by tests to appear in the coverage report.
+</td>
+</tr>
+<tr>
+<td>v0.2.12</td><td>Text summary as valid markdown, thanks to @smikes</td>
+</tr>
+<tr>
+<td>v0.2.11</td><td>Allow source map generation, thanks to @jason0x43</td>
+</tr>
+<tr>
+<td>v0.2.10</td><td>Add flag to handle sigints and dump coverage, thanks to @samccone</td>
+</tr>
+<tr>
+<td>v0.2.9</td><td>Fix #202</td>
+</tr>
+<tr>
+<tr>
+<td>v0.2.8</td><td>Upgrade esprima</td>
+</tr>
+<tr>
+<td>v0.2.7</td><td><ul>
+ <li>Upgrade esprima</li>
+ <li>Misc jshint fixes</li>
+</ul></td>
+</tr>
+<tr>
+<td>v0.2.6</td><td><ul>
+ <li>Revert bad commit for tree summarizer</li>
+</ul></td>
+</tr>
+<tr>
+<td>v0.2.5</td><td><ul>
+ <li>Add clover report, thanks to @bixdeng, @mpderbec</li>
+ <li>Fix cobertura report bug for relative paths, thanks to @jxiaodev</li>
+ <li>Run self-coverage on tests always</li>
+ <li>Fix tree summarizer when relative paths are involved, thanks to @Swatinem</li>
+</ul></td>
+</tr>
+<tr>
+<td>v0.2.4</td><td><ul>
+ <li>Fix line-split algo to handle Mac lin separators, thanks to @asifrc</li>
+ <li>Update README for quick intro to ignoring code for coverage, thanks to @gergelyke</li>
+</ul></td>
+</tr>
+<tr>
+<td>v0.2.3</td><td><ul>
+ <li>Add YAML config file. `istanbul help config` has more details</li>
+ <li>Support custom reporting thresholds using the `watermarks` section of the config file</li>
+</ul></td>
+</tr>
+<tr><td>v0.2.2</td><td>update escodegen, handlebars and resolve dependency versions</td></tr>
+<tr>
+<td>v0.2.1</td><td><ul>
+ <li>Add ability to skip branches and other hard-to-test code using comments.
+ See <a href="https://github.com/gotwarlost/istanbul/blob/master/ignoring-code-for-coverage.md">the doc</a> for more details</li>
+ <li>Turn `util.error` into `console.error` for node 0.11 compatibility, thanks to @pornel</li>
+</ul></td>
+</tr>
+<tr><td>v0.2.0</td><td><ul>
+ <li>Add --preserve-comments to instrumenter options, thanks to @arikon</li>
+ <li>Support 'use strict;' in file scope, thanks to @pornel</li>
+</ul>
+ Up minor version due to the new way in which the global object is accessed.
+ This _should_ be backwards-compatible but has not been tested in the wild.
+</td></tr>
+<tr><td>v0.1.46</td><td>Fix #114</td></tr>
+<tr><td>v0.1.45</td><td>Add teamcity reporter, thanks to @chrisgladd</td></tr>
+<tr><td>v0.1.44</td><td>Fix inconsistency in processing empty switch with latest esprima, up deps</td></tr>
+<tr><td>v0.1.43</td><td>Add colors to text report thanks to @runk</td></tr>
+<tr><td>v0.1.42</td><td>fix #78: embed source regression introduced in v0.1.38. Fix broken test for this</td></tr>
+<tr><td>v0.1.41</td><td>add json report to dump coverage object for certain use cases</td></tr>
+<tr><td>v0.1.40</td><td>forward sourceStore from lcov to html report, pull request by @vojtajina</td></tr>
+<tr><td>v0.1.39</td><td>add <source> tag to cobertura report, pull request by @jhansche</td></tr>
+<tr><td>v0.1.38</td><td><ul>
+ <li>factor out AST instrumentation into own instrumentASTSync method</li>
+ <li>always set function declaration coverage stats to 1 since every such declaration is "executed" exactly one time by the compiler</li>
+ </ul></td></tr>
+<tr><td>v0.1.37</td><td>--complete-copy flag contrib from @kami, correct strict mode semantics for instrumented functions</td></tr>
+<tr><td>v0.1.36</td><td>real quiet when --print=none specified, add repo URL to package.json, add contributors</td></tr>
+<tr><td>v0.1.35</td><td>accept cobertura contrib from @nbrownus, fix #52</td></tr>
+<tr><td>v0.1.34</td><td>fix async reporting, update dependencies, accept html cleanup contrib from @mathiasbynens</td></tr>
+<tr><td>v0.1.33</td><td>initialize global coverage object before running tests to workaround mocha leak detection</td></tr>
+<tr><td>v0.1.32</td><td>Fix for null nodes in array expressions, add @unindented as contributor</td></tr>
+<tr><td>v0.1.31</td><td>Misc internal fixes and test changes</td></tr>
+<tr><td>v0.1.30</td><td>Write standard blurbs ("writing coverage object..." etc.) to stderr rather than stdout</td></tr>
+<tr><td>v0.1.29</td><td>Allow --post-require-hook to be a module that can be `require`-d</td></tr>
+<tr><td>v0.1.28</td><td>Add --post-require-hook switch to support use-cases similar to the YUI loader</td></tr>
+<tr><td>v0.1.27</td><td>Add --hook-run-in-context switch to support RequireJS modules. Thanks to @millermedeiros for the pull request</td></tr>
+<tr><td>v0.1.26</td><td>Add support for minimum uncovered unit for check-coverage. Fixes #25</td></tr>
+<tr><td>v0.1.25</td><td>Allow for relative paths in the YUI loader hook</td></tr>
+<tr><td>v0.1.24</td><td>Add lcov summaries. Fixes issue #20</td></tr>
+<tr><td>v0.1.23</td><td>Add ability to save a baseline coverage file for the instrument command. Fixes issue #19</td></tr>
+<tr><td>v0.1.22</td><td>Add signature attribute to cobertura method tags to fix NPE by the Hudson publisher</td></tr>
+<tr><td>v0.1.21</td><td>Add cobertura XML report format; exprimental for now</td></tr>
+<tr><td>v0.1.20</td><td>Fix HTML/ lcov report interface to be more customizable for middleware needs</td></tr>
+<tr><td>v0.1.19</td><td>make all hooking non-destructive in that already loaded modules are never reloaded. Add self-test mode so that already loaded istanbul modules can be unloaded prior to hooking.</td></tr>
+<tr><td>v0.1.18</td><td>Add option to hook in non-destructive mode; i.e. the require cache is not unloaded when hooking</td></tr>
+<tr><td>v0.1.17</td><td>Export some more objects; undocumented for now</td></tr>
+<tr><td>v0.1.16</td><td>Fix npm keywords for istanbul which expects an array of strings but was being fed a single string with keywords instead</td></tr>
+<tr><td>v0.1.15</td><td>Add the 'check-coverage' command so that Istanbul can be used as a posttest script to enforce minimum coverage</td></tr>
+<tr><td>v0.1.14</td><td>Expose the experimental YUI load hook in the interface</td></tr>
+<tr><td>v0.1.13</td><td>Internal jshint cleanup, no features or fixes</td></tr>
+<tr><td>v0.1.12</td><td>Give npm the README that was getting inadvertently excluded</td></tr>
+<tr><td>v0.1.11</td><td>Merge pull request #14 for HTML tweaks. Thanks @davglass. Add @davglass and @nowamasa as contributors in `package.json`</td></tr>
+<tr><td>v0.1.10</td><td>Fix to issue #12. Do not install `uncaughtException` handler and pass input error back to CLI using a callback as opposed to throwing.</td></tr>
+<tr><td>v0.1.9</td><td>Attempt to create reporting directory again just before writing coverage in addition to initial creation</td></tr>
+<tr><td>v0.1.8</td><td>Fix issue #11.</td></tr>
+<tr><td>v0.1.7</td><td>Add text summary and detailed reporting available as --print [summary|detail|both|none]. summary is the default if nothing specified.</td></tr>
+<tr><td>v0.1.6</td><td>Handle backslashes in the file path correctly in emitted code. Fixes #9. Thanks to @nowamasa for bug report and fix</td></tr>
+<tr><td>v0.1.5</td><td>make object-utils.js work on a browser as-is</td></tr>
+<tr><td>v0.1.4</td><td>partial fix for issue #4; add titles to missing coverage spans, remove negative margin for missing if/else indicators</td></tr>
+<tr><td>v0.1.3</td><td>Set the environment variable running_under_istanbul to 1 when that is the case. This allows test runners that use istanbul as a library to back off on using it when set.</td></tr>
+<tr><td>v0.1.2</td><td>HTML reporting cosmetics. Reports now show syntax-colored JS using `prettify`. Summary tables no longer wrap in awkward places.</td></tr>
+<tr><td>v0.1.1</td><td>Fixes issue #1. HTML reports use sources embedded inside the file coverage objects if found rather than reading from the filesystem</td></tr>
+<tr><td>v0.1.0</td><td>Initial version</td></tr>
+</td></tr>
+</table>
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/LICENSE b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/LICENSE
new file mode 100644
index 00000000..45a650b0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/LICENSE
@@ -0,0 +1,24 @@
+Copyright 2012 Yahoo! Inc.
+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 the Yahoo! 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 YAHOO! INC. 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.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/README.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/README.md
new file mode 100644
index 00000000..c5b4a5a0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/README.md
@@ -0,0 +1,269 @@
+## Istanbul - a JS code coverage tool written in JS
+
+[![Build Status](https://secure.travis-ci.org/gotwarlost/istanbul.png)](http://travis-ci.org/gotwarlost/istanbul)
+[![Dependency Status](https://gemnasium.com/gotwarlost/istanbul.png)](https://gemnasium.com/gotwarlost/istanbul)
+[![Coverage Status](https://img.shields.io/coveralls/gotwarlost/istanbul.svg)](https://coveralls.io/r/gotwarlost/istanbul?branch=master)
+[![bitHound Score](https://www.bithound.io/github/gotwarlost/istanbul/badges/score.svg)](https://www.bithound.io/github/gotwarlost/istanbul)
+
+[![NPM](https://nodei.co/npm/istanbul.png?downloads=true)](https://nodei.co/npm/istanbul/)
+
+* [Features and use cases](#features)
+* [Getting started and configuration](#getting-started)
+* [The command line](#the-command-line)
+* [Ignoring code for coverage](#ignoring-code-for-coverage)
+* [API](#api)
+* [Changelog](https://github.com/gotwarlost/istanbul/blob/master/CHANGELOG.md)
+* [License and credits](#license)
+
+### Features
+
+* All-javascript instrumentation library that tracks **statement, branch,
+and function coverage**.
+* **Module loader hooks** to instrument code on the fly
+* **Command line tools** to run node unit tests "with coverage turned on" and no cooperation
+whatsoever from the test runner
+* Multiple report formats: **HTML**, **LCOV**, **Cobertura** and more.
+* Ability to use as [middleware](https://github.com/gotwarlost/istanbul-middleware) when serving JS files that need to be tested on the browser.
+* Can be used on the **command line** as well as a **library**
+* Based on the awesome `esprima` parser and the equally awesome `escodegen` code generator
+* Well-tested on node (prev, current and next versions) and the browser (instrumentation library only)
+
+### Use cases
+
+Supports the following use cases and more
+
+* transparent coverage of nodejs unit tests
+* instrumentation/ reporting of files in batch mode for browser tests
+* Server side code coverage for nodejs by embedding it as [custom middleware](https://github.com/gotwarlost/istanbul-middleware)
+
+### Getting started
+
+ $ npm install -g istanbul
+
+The best way to see it in action is to run node unit tests. Say you have a test
+script `test.js` that runs all tests for your node project without coverage.
+
+Simply:
+
+ $ cd /path/to/your/source/root
+ $ istanbul cover test.js
+
+and this should produce a `coverage.json`, `lcov.info` and `lcov-report/*html` under `./coverage`
+
+Sample of code coverage reports produced by this tool (for this tool!):
+
+[HTML reports](http://gotwarlost.github.com/istanbul/public/coverage/lcov-report/index.html)
+
+
+### Configuring
+
+Drop a `.istanbul.yml` file at the top of the source tree to configure istanbul.
+`istanbul help config` tells you more about the config file format.
+
+### The command line
+
+ $ istanbul help
+
+gives you detailed help on all commands.
+
+```
+Usage: istanbul help config | <command>
+
+`config` provides help with istanbul configuration
+
+Available commands are:
+
+ check-coverage
+ checks overall/per-file coverage against thresholds from coverage
+ JSON files. Exits 1 if thresholds are not met, 0 otherwise
+
+
+ cover transparently adds coverage information to a node command. Saves
+ coverage.json and reports at the end of execution
+
+
+ help shows help
+
+
+ instrument
+ instruments a file or a directory tree and writes the
+ instrumented code to the desired output location
+
+
+ report writes reports for coverage JSON objects produced in a previous
+ run
+
+
+ test cover a node command only when npm_config_coverage is set. Use in
+ an `npm test` script for conditional coverage
+
+
+Command names can be abbreviated as long as the abbreviation is unambiguous
+```
+
+To get detailed help for a command and what command-line options it supports, run:
+
+ istanbul help <command>
+
+(Most of the command line options are not covered in this document.)
+
+#### The `cover` command
+
+ $ istanbul cover my-test-script.js -- my test args
+ # note the -- between the command name and the arguments to be passed
+
+The `cover` command can be used to get a coverage object and reports for any arbitrary
+node script. By default, coverage information is written under `./coverage` - this
+can be changed using command-line options.
+
+The `cover` command can also be passed an optional `--handle-sigint` flag to
+enable writing reports when a user triggers a manual SIGINT of the process that is
+being covered. This can be useful when you are generating coverage for a long lived process.
+
+#### The `test` command
+
+The `test` command has almost the same behavior as the `cover` command, except that
+it skips coverage unless the `npm_config_coverage` environment variable is set.
+
+**This command is deprecated** since the latest versions of npm do not seem to
+set the `npm_config_coverage` variable.
+
+#### The `instrument` command
+
+Instruments a single JS file or an entire directory tree and produces an output
+directory tree with instrumented code. This should not be required for running node
+unit tests but is useful for tests to be run on the browser.
+
+#### The `report` command
+
+Writes reports using `coverage*.json` files as the source of coverage information.
+Reports are available in multiple formats and can be individually configured
+using the istanbul config file. See `istanbul help report` for more details.
+
+#### The `check-coverage` command
+
+Checks the coverage of statements, functions, branches, and lines against the
+provided thresholds. Positive thresholds are taken to be the minimum percentage
+required and negative numbers are taken to be the number of uncovered entities
+allowed.
+
+### Ignoring code for coverage
+
+* Skip an `if` or `else` path with `/* istanbul ignore if */` or `/* istanbul ignore else */` respectively.
+* For all other cases, skip the next 'thing' in the source with: `/* istanbul ignore next */`
+
+See [ignoring-code-for-coverage.md](ignoring-code-for-coverage.md) for the spec.
+
+
+### API
+
+All the features of istanbul can be accessed as a library.
+
+#### Instrument code
+
+```javascript
+ var istanbul = require('istanbul');
+ var instrumenter = new istanbul.Instrumenter();
+
+ var generatedCode = instrumenter.instrumentSync('function meaningOfLife() { return 42; }',
+ 'filename.js');
+```
+
+#### Generate reports given a bunch of coverage JSON objects
+
+```javascript
+ var istanbul = require('istanbul'),
+ collector = new istanbul.Collector(),
+ reporter = new istanbul.Reporter(),
+ sync = false;
+
+ collector.add(obj1);
+ collector.add(obj2); //etc.
+
+ reporter.add('text');
+ reporter.addAll([ 'lcov', 'clover' ]);
+ reporter.write(collector, sync, function () {
+ console.log('All reports generated');
+ });
+```
+
+For the gory details consult the [public API](http://gotwarlost.github.com/istanbul/public/apidocs/index.html)
+
+
+### Multiple Process Usage
+
+Istanbul can be used in a multiple process environment by running each process
+with Istanbul, writing a unique coverage file for each process, and combining
+the results when generating reports. The method used to perform this will
+depend on the process forking API used. For example when using the
+[cluster module](http://nodejs.org/api/cluster.html) you must setup the master
+to start child processes with Istanbul coverage, disable reporting, and output
+coverage files that include the PID in the filename. Before each run you may
+need to clear out the coverage data directory.
+
+```javascript
+ if(cluster.isMaster) {
+ // setup cluster if running with istanbul coverage
+ if(process.env.running_under_istanbul) {
+ // use coverage for forked process
+ // disabled reporting and output for child process
+ // enable pid in child process coverage filename
+ cluster.setupMaster({
+ exec: './node_modules/.bin/istanbul',
+ args: [
+ 'cover', '--report', 'none', '--print', 'none', '--include-pid',
+ process.argv[1], '--'].concat(process.argv.slice(2))
+ });
+ }
+ // ...
+ // ... cluster.fork();
+ // ...
+ } else {
+ // ... worker code
+ }
+```
+
+### Coverage.json
+
+For details on the format of the coverage.json object, [see here](./coverage.json.md).
+
+### License
+
+istanbul is licensed under the [BSD License](http://github.com/gotwarlost/istanbul/raw/master/LICENSE).
+
+### Third-party libraries
+
+The following third-party libraries are used by this module:
+
+* abbrev: https://github.com/isaacs/abbrev-js - to handle command abbreviations
+* async: https://github.com/caolan/async - for parallel instrumentation of files
+* escodegen: https://github.com/Constellation/escodegen - for JS code generation
+* esprima: https://github.com/ariya/esprima - for JS parsing
+* fileset: https://github.com/mklabs/node-fileset - for loading and matching path expressions
+* handlebars: https://github.com/wycats/handlebars.js/ - for report template expansion
+* js-yaml: https://github.com/nodeca/js-yaml - for YAML config file load
+* mkdirp: https://github.com/substack/node-mkdirp - to create output directories
+* nodeunit: https://github.com/caolan/nodeunit - dev dependency for unit tests
+* nopt: https://github.com/isaacs/nopt - for option parsing
+* once: https://github.com/isaacs/once - to ensure callbacks are called once
+* resolve: https://github.com/substack/node-resolve - for resolving a post-require hook module name into its main file.
+* rimraf - https://github.com/isaacs/rimraf - dev dependency for unit tests
+* which: https://github.com/isaacs/node-which - to resolve a node command to a file for the `cover` command
+* wordwrap: https://github.com/substack/node-wordwrap - for prettier help
+* prettify: http://code.google.com/p/google-code-prettify/ - for syntax colored HTML reports. Files checked in under `lib/vendor/`
+
+### Inspired by
+
+* YUI test coverage - https://github.com/yui/yuitest - the grand-daddy of JS coverage tools. Istanbul has been specifically designed to offer an alternative to this library with an easy migration path.
+* cover: https://github.com/itay/node-cover - the inspiration for the `cover` command, modeled after the `run` command in that tool. The coverage methodology used by istanbul is quite different, however
+
+### Shout out to
+
+ * [mfncooper](https://github.com/mfncooper) - for great brainstorming discussions
+ * [reid](https://github.com/reid), [davglass](https://github.com/davglass), the YUI dudes, for interesting conversations, encouragement, support and gentle pressure to get it done :)
+
+### Why the funky name?
+
+Since all the good ones are taken. Comes from the loose association of ideas across
+coverage, carpet-area coverage, the country that makes good carpets and so on...
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/index.js
new file mode 100644
index 00000000..3666cfb1
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/index.js
@@ -0,0 +1,153 @@
+/*
+Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+*/
+
+/*jslint nomen: true */
+var path = require('path'),
+ Store = require('./lib/store'),
+ Report = require('./lib/report'),
+ meta = require('./lib/util/meta');
+
+//register our standard plugins
+require('./lib/register-plugins');
+
+/**
+ * the top-level API for `istanbul`. provides access to the key libraries in
+ * istanbul so you can write your own tools using `istanbul` as a library.
+ *
+ * Usage
+ * -----
+ *
+ * var istanbul = require('istanbul');
+ *
+ *
+ * @class Istanbul
+ * @static
+ * @module main
+ * @main main
+ */
+
+module.exports = {
+ /**
+ * the Instrumenter class.
+ * @property Instrumenter
+ * @type Instrumenter
+ * @static
+ */
+ Instrumenter: require('./lib/instrumenter'),
+ /**
+ * the Store class.
+ * @property Store
+ * @type Store
+ * @static
+ */
+ Store: Store,
+ /**
+ * the Collector class
+ * @property Collector
+ * @type Collector
+ * @static
+ */
+ Collector: require('./lib/collector'),
+ /**
+ * the hook module
+ * @property hook
+ * @type Hook
+ * @static
+ */
+ hook: require('./lib/hook'),
+ /**
+ * the Report class
+ * @property Report
+ * @type Report
+ * @static
+ */
+ Report: Report,
+ /**
+ * the config module
+ * @property config
+ * @type Config
+ * @static
+ */
+ config: require('./lib/config'),
+ /**
+ * the Reporter class
+ * @property Reporter
+ * @type Reporter
+ * @static
+ */
+ Reporter: require('./lib/reporter'),
+ /**
+ * utility for processing coverage objects
+ * @property utils
+ * @type ObjectUtils
+ * @static
+ */
+ utils: require('./lib/object-utils'),
+ /**
+ * asynchronously returns a function that can match filesystem paths.
+ * The function returned in the callback may be passed directly as a `matcher`
+ * to the functions in the `hook` module.
+ *
+ * When no options are passed, the match function is one that matches all JS
+ * files under the current working directory except ones under `node_modules`
+ *
+ * Match patterns are `ant`-style patterns processed using the `fileset` library.
+ * Examples not provided due to limitations in putting asterisks inside
+ * jsdoc comments. Please refer to tests under `test/other/test-matcher.js`
+ * for examples.
+ *
+ * @method matcherFor
+ * @static
+ * @param {Object} options Optional. Lookup options.
+ * @param {String} [options.root] the root of the filesystem tree under
+ * which to match files. Defaults to `process.cwd()`
+ * @param {Array} [options.includes] an array of include patterns to match.
+ * Defaults to all JS files under the root.
+ * @param {Array} [options.excludes] and array of exclude patterns. File paths
+ * matching these patterns will be excluded by the returned matcher.
+ * Defaults to files under `node_modules` found anywhere under root.
+ * @param {Function(err, matchFunction)} callback The callback that is
+ * called with two arguments. The first is an `Error` object in case
+ * of errors or a falsy value if there were no errors. The second
+ * is a function that may be use as a matcher.
+ */
+ matcherFor: require('./lib/util/file-matcher').matcherFor,
+ /**
+ * the version of the library
+ * @property VERSION
+ * @type String
+ * @static
+ */
+ VERSION: meta.VERSION,
+ /**
+ * the abstract Writer class
+ * @property Writer
+ * @type Writer
+ * @static
+ */
+ Writer: require('./lib/util/writer').Writer,
+ /**
+ * the abstract ContentWriter class
+ * @property ContentWriter
+ * @type ContentWriter
+ * @static
+ */
+ ContentWriter: require('./lib/util/writer').ContentWriter,
+ /**
+ * the concrete FileWriter class
+ * @property FileWriter
+ * @type FileWriter
+ * @static
+ */
+ FileWriter: require('./lib/util/file-writer'),
+ //undocumented
+ _yuiLoadHook: require('./lib/util/yui-load-hook'),
+ //undocumented
+ TreeSummarizer: require('./lib/util/tree-summarizer'),
+ //undocumented
+ assetsDir: path.resolve(__dirname, 'lib', 'vendor')
+};
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/base.css b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/base.css
new file mode 100644
index 00000000..a6a2f328
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/base.css
@@ -0,0 +1,182 @@
+body, html {
+ margin:0; padding: 0;
+}
+body {
+ font-family: Helvetica Neue, Helvetica,Arial;
+ font-size: 10pt;
+}
+div.header, div.footer {
+ background: #eee;
+ padding: 1em;
+}
+div.header {
+ z-index: 100;
+ position: fixed;
+ top: 0;
+ border-bottom: 1px solid #666;
+ width: 100%;
+}
+div.footer {
+ border-top: 1px solid #666;
+}
+div.body {
+ margin-top: 10em;
+}
+div.meta {
+ font-size: 90%;
+ text-align: center;
+}
+h1, h2, h3 {
+ font-weight: normal;
+}
+h1 {
+ font-size: 12pt;
+}
+h2 {
+ font-size: 10pt;
+}
+pre {
+ font-family: Consolas, Menlo, Monaco, monospace;
+ margin: 0;
+ padding: 0;
+ line-height: 1.3;
+ font-size: 14px;
+ -moz-tab-size: 2;
+ -o-tab-size: 2;
+ tab-size: 2;
+}
+
+div.path { font-size: 110%; }
+div.path a:link, div.path a:visited { color: #000; }
+table.coverage { border-collapse: collapse; margin:0; padding: 0 }
+
+table.coverage td {
+ margin: 0;
+ padding: 0;
+ color: #111;
+ vertical-align: top;
+}
+table.coverage td.line-count {
+ width: 50px;
+ text-align: right;
+ padding-right: 5px;
+}
+table.coverage td.line-coverage {
+ color: #777 !important;
+ text-align: right;
+ border-left: 1px solid #666;
+ border-right: 1px solid #666;
+}
+
+table.coverage td.text {
+}
+
+table.coverage td span.cline-any {
+ display: inline-block;
+ padding: 0 5px;
+ width: 40px;
+}
+table.coverage td span.cline-neutral {
+ background: #eee;
+}
+table.coverage td span.cline-yes {
+ background: #b5d592;
+ color: #999;
+}
+table.coverage td span.cline-no {
+ background: #fc8c84;
+}
+
+.cstat-yes { color: #111; }
+.cstat-no { background: #fc8c84; color: #111; }
+.fstat-no { background: #ffc520; color: #111 !important; }
+.cbranch-no { background: yellow !important; color: #111; }
+
+.cstat-skip { background: #ddd; color: #111; }
+.fstat-skip { background: #ddd; color: #111 !important; }
+.cbranch-skip { background: #ddd !important; color: #111; }
+
+.missing-if-branch {
+ display: inline-block;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: black;
+ color: yellow;
+}
+
+.skip-if-branch {
+ display: none;
+ margin-right: 10px;
+ position: relative;
+ padding: 0 4px;
+ background: #ccc;
+ color: white;
+}
+
+.missing-if-branch .typ, .skip-if-branch .typ {
+ color: inherit !important;
+}
+
+.entity, .metric { font-weight: bold; }
+.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
+.metric small { font-size: 80%; font-weight: normal; color: #666; }
+
+div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
+div.coverage-summary td, div.coverage-summary table th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
+div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
+div.coverage-summary th.file { border-right: none !important; }
+div.coverage-summary th.pic { border-left: none !important; text-align: right; }
+div.coverage-summary th.pct { border-right: none !important; }
+div.coverage-summary th.abs { border-left: none !important; text-align: right; }
+div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
+div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
+div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap; }
+div.coverage-summary td.pic { min-width: 120px !important; }
+div.coverage-summary a:link { text-decoration: none; color: #000; }
+div.coverage-summary a:visited { text-decoration: none; color: #777; }
+div.coverage-summary a:hover { text-decoration: underline; }
+div.coverage-summary tfoot td { border-top: 1px solid #666; }
+
+div.coverage-summary .sorter {
+ height: 10px;
+ width: 7px;
+ display: inline-block;
+ margin-left: 0.5em;
+ background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
+}
+div.coverage-summary .sorted .sorter {
+ background-position: 0 -20px;
+}
+div.coverage-summary .sorted-desc .sorter {
+ background-position: 0 -10px;
+}
+
+.high { background: #b5d592 !important; }
+.medium { background: #ffe87c !important; }
+.low { background: #fc8c84 !important; }
+
+span.cover-fill, span.cover-empty {
+ display:inline-block;
+ border:1px solid #444;
+ background: white;
+ height: 12px;
+}
+span.cover-fill {
+ background: #ccc;
+ border-right: 1px solid #444;
+}
+span.cover-empty {
+ background: white;
+ border-left: none;
+}
+span.cover-full {
+ border-right: none !important;
+}
+pre.prettyprint {
+ border: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+}
+.com { color: #999 !important; }
+.ignore-none { color: #999; font-weight: normal; }
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sort-arrow-sprite.png b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sort-arrow-sprite.png
new file mode 100644
index 00000000..03f704a6
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sort-arrow-sprite.png
Binary files differ
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sorter.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sorter.js
new file mode 100644
index 00000000..6afb736c
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/sorter.js
@@ -0,0 +1,156 @@
+var addSorting = (function () {
+ "use strict";
+ var cols,
+ currentSort = {
+ index: 0,
+ desc: false
+ };
+
+ // returns the summary table element
+ function getTable() { return document.querySelector('.coverage-summary table'); }
+ // returns the thead element of the summary table
+ function getTableHeader() { return getTable().querySelector('thead tr'); }
+ // returns the tbody element of the summary table
+ function getTableBody() { return getTable().querySelector('tbody'); }
+ // returns the th element for nth column
+ function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
+
+ // loads all columns
+ function loadColumns() {
+ var colNodes = getTableHeader().querySelectorAll('th'),
+ colNode,
+ cols = [],
+ col,
+ i;
+
+ for (i = 0; i < colNodes.length; i += 1) {
+ colNode = colNodes[i];
+ col = {
+ key: colNode.getAttribute('data-col'),
+ sortable: !colNode.getAttribute('data-nosort'),
+ type: colNode.getAttribute('data-type') || 'string'
+ };
+ cols.push(col);
+ if (col.sortable) {
+ col.defaultDescSort = col.type === 'number';
+ colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
+ }
+ }
+ return cols;
+ }
+ // attaches a data attribute to every tr element with an object
+ // of data values keyed by column name
+ function loadRowData(tableRow) {
+ var tableCols = tableRow.querySelectorAll('td'),
+ colNode,
+ col,
+ data = {},
+ i,
+ val;
+ for (i = 0; i < tableCols.length; i += 1) {
+ colNode = tableCols[i];
+ col = cols[i];
+ val = colNode.getAttribute('data-value');
+ if (col.type === 'number') {
+ val = Number(val);
+ }
+ data[col.key] = val;
+ }
+ return data;
+ }
+ // loads all row data
+ function loadData() {
+ var rows = getTableBody().querySelectorAll('tr'),
+ i;
+
+ for (i = 0; i < rows.length; i += 1) {
+ rows[i].data = loadRowData(rows[i]);
+ }
+ }
+ // sorts the table using the data for the ith column
+ function sortByIndex(index, desc) {
+ var key = cols[index].key,
+ sorter = function (a, b) {
+ a = a.data[key];
+ b = b.data[key];
+ return a < b ? -1 : a > b ? 1 : 0;
+ },
+ finalSorter = sorter,
+ tableBody = document.querySelector('.coverage-summary tbody'),
+ rowNodes = tableBody.querySelectorAll('tr'),
+ rows = [],
+ i;
+
+ if (desc) {
+ finalSorter = function (a, b) {
+ return -1 * sorter(a, b);
+ };
+ }
+
+ for (i = 0; i < rowNodes.length; i += 1) {
+ rows.push(rowNodes[i]);
+ tableBody.removeChild(rowNodes[i]);
+ }
+
+ rows.sort(finalSorter);
+
+ for (i = 0; i < rows.length; i += 1) {
+ tableBody.appendChild(rows[i]);
+ }
+ }
+ // removes sort indicators for current column being sorted
+ function removeSortIndicators() {
+ var col = getNthColumn(currentSort.index),
+ cls = col.className;
+
+ cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
+ col.className = cls;
+ }
+ // adds sort indicators for current column being sorted
+ function addSortIndicators() {
+ getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
+ }
+ // adds event listeners for all sorter widgets
+ function enableUI() {
+ var i,
+ el,
+ ithSorter = function ithSorter(i) {
+ var col = cols[i];
+
+ return function () {
+ var desc = col.defaultDescSort;
+
+ if (currentSort.index === i) {
+ desc = !currentSort.desc;
+ }
+ sortByIndex(i, desc);
+ removeSortIndicators();
+ currentSort.index = i;
+ currentSort.desc = desc;
+ addSortIndicators();
+ };
+ };
+ for (i =0 ; i < cols.length; i += 1) {
+ if (cols[i].sortable) {
+ el = getNthColumn(i).querySelector('.sorter');
+ if (el.addEventListener) {
+ el.addEventListener('click', ithSorter(i));
+ } else {
+ el.attachEvent('onclick', ithSorter(i));
+ }
+ }
+ }
+ }
+ // adds sorting functionality to the UI
+ return function () {
+ if (!getTable()) {
+ return;
+ }
+ cols = loadColumns();
+ loadData(cols);
+ addSortIndicators();
+ enableUI();
+ };
+})();
+
+window.addEventListener('load', addSorting);
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.css b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.css
new file mode 100644
index 00000000..b317a7cd
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.css
@@ -0,0 +1 @@
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.js
new file mode 100644
index 00000000..ef51e038
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/assets/vendor/prettify.js
@@ -0,0 +1 @@
+window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.ignoreCase){ac=true}else{if(/[a-z]/i.test(ae.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){S=true;ac=false;break}}}var Y={b:8,t:9,n:10,v:11,f:12,r:13};function ab(ah){var ag=ah.charCodeAt(0);if(ag!==92){return ag}var af=ah.charAt(1);ag=Y[af];if(ag){return ag}else{if("0"<=af&&af<="7"){return parseInt(ah.substring(1),8)}else{if(af==="u"||af==="x"){return parseInt(ah.substring(2),16)}else{return ah.charCodeAt(1)}}}}function T(af){if(af<32){return(af<16?"\\x0":"\\x")+af.toString(16)}var ag=String.fromCharCode(af);if(ag==="\\"||ag==="-"||ag==="["||ag==="]"){ag="\\"+ag}return ag}function X(am){var aq=am.substring(1,am.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g"));var ak=[];var af=[];var ao=aq[0]==="^";for(var ar=ao?1:0,aj=aq.length;ar<aj;++ar){var ah=aq[ar];if(/\\[bdsw]/i.test(ah)){ak.push(ah)}else{var ag=ab(ah);var al;if(ar+2<aj&&"-"===aq[ar+1]){al=ab(aq[ar+2]);ar+=2}else{al=ag}af.push([ag,al]);if(!(al<65||ag>122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;ar<af.length;++ar){var at=af[ar];if(at[0]<=ap[1]+1){ap[1]=Math.max(ap[1],at[1])}else{ai.push(ap=at)}}var an=["["];if(ao){an.push("^")}an.push.apply(an,ak);for(var ar=0;ar<ai.length;++ar){var at=ai[ar];an.push(T(at[0]));if(at[1]>at[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){an[af]=-1}}}}for(var ak=1;ak<an.length;++ak){if(-1===an[ak]){an[ak]=++ad}}for(var ak=0,am=0;ak<ah;++ak){var ag=aj[ak];if(ag==="("){++am;if(an[am]===undefined){aj[ak]="(?:"}}else{if("\\"===ag.charAt(0)){var af=+ag.substring(1);if(af&&af<=am){aj[ak]="\\"+an[am]}}}}for(var ak=0,am=0;ak<ah;++ak){if("^"===aj[ak]&&"^"!==aj[ak+1]){aj[ak]=""}}if(al.ignoreCase&&S){for(var ak=0;ak<ah;++ak){var ag=aj[ak];var ai=ag.charAt(0);if(ag.length>=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V<U;++V){var ae=Z[V];if(ae.global||ae.multiline){throw new Error(""+ae)}aa.push("(?:"+W(ae)+")")}return new RegExp(aa.join("|"),ac?"gi":"g")}function a(V){var U=/(?:^|\s)nocode(?:\s|$)/;var X=[];var T=0;var Z=[];var W=0;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=document.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Y=S&&"pre"===S.substring(0,3);function aa(ab){switch(ab.nodeType){case 1:if(U.test(ab.className)){return}for(var ae=ab.firstChild;ae;ae=ae.nextSibling){aa(ae)}var ad=ab.nodeName;if("BR"===ad||"LI"===ad){X[W]="\n";Z[W<<1]=T++;Z[(W++<<1)|1]=ab}break;case 3:case 4:var ac=ab.nodeValue;if(ac.length){if(!Y){ac=ac.replace(/[ \t\r\n]+/g," ")}else{ac=ac.replace(/\r\n?/g,"\n")}X[W]=ac;Z[W<<1]=T;T+=ac.length;Z[(W++<<1)|1]=ab}break}}aa(V);return{sourceCode:X.join("").replace(/\n$/,""),spans:Z}}function B(S,U,W,T){if(!U){return}var V={sourceCode:U,basePos:S};W(V);T.push.apply(T,V.decorations)}var v=/\S/;function o(S){var V=undefined;for(var U=S.firstChild;U;U=U.nextSibling){var T=U.nodeType;V=(T===1)?(V?S:U):(T===3)?(v.test(U.nodeValue)?S:V):V}return V===S?undefined:V}function g(U,T){var S={};var V;(function(){var ad=U.concat(T);var ah=[];var ag={};for(var ab=0,Z=ad.length;ab<Z;++ab){var Y=ad[ab];var ac=Y[3];if(ac){for(var ae=ac.length;--ae>=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae<aq;++ae){var ag=an[ae];var ap=aj[ag];var ai=void 0;var am;if(typeof ap==="string"){am=false}else{var aa=S[ag.charAt(0)];if(aa){ai=ag.match(aa[1]);ap=aa[0]}else{for(var ao=0;ao<X;++ao){aa=T[ao];ai=ag.match(aa[1]);if(ai){ap=aa[0];break}}if(!ai){ap=F}}am=ap.length>=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y<W.length;++Y){ae(W[Y])}if(ag===(ag|0)){W[0].setAttribute("value",ag)}var aa=ac.createElement("OL");aa.className="linenums";var X=Math.max(0,((ag-1))|0)||0;for(var Y=0,T=W.length;Y<T;++Y){af=W[Y];af.className="L"+((Y+X)%10);if(!af.firstChild){af.appendChild(ac.createTextNode("\xA0"))}aa.appendChild(af)}V.appendChild(aa)}function D(ac){var aj=/\bMSIE\b/.test(navigator.userAgent);var am=/\n/g;var al=ac.sourceCode;var an=al.length;var V=0;var aa=ac.spans;var T=aa.length;var ah=0;var X=ac.decorations;var Y=X.length;var Z=0;X[Y]=an;var ar,aq;for(aq=ar=0;aq<Y;){if(X[aq]!==X[aq+2]){X[ar++]=X[aq++];X[ar++]=X[aq++]}else{aq+=2}}Y=ar;for(aq=ar=0;aq<Y;){var at=X[aq];var ab=X[aq+1];var W=aq+2;while(W+2<=Y&&X[W+1]===ab){W+=2}X[ar++]=at;X[ar++]=ab;aq=W}Y=X.length=ar;var ae=null;while(ah<T){var af=aa[ah];var S=aa[ah+2]||an;var ag=X[Z];var ap=X[Z+2]||an;var W=Math.min(S,ap);var ak=aa[ah+1];var U;if(ak.nodeType!==1&&(U=al.substring(V,W))){if(aj){U=U.replace(am,"\r")}ak.nodeValue=U;var ai=ak.ownerDocument;var ao=ai.createElement("SPAN");ao.className=X[Z+1];var ad=ak.parentNode;ad.replaceChild(ao,ak);ao.appendChild(ak);if(V<S){aa[ah+1]=ak=ai.createTextNode(al.substring(W,S));ad.insertBefore(ak,ao.nextSibling)}}V=W;if(V>=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*</.test(S)?"default-markup":"default-code"}return t[T]}c(K,["default-code"]);c(g([],[[F,/^[^<?]+/],[E,/^<!\w[^>]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa<ac.length;++aa){for(var Z=0,V=ac[aa].length;Z<V;++Z){T.push(ac[aa][Z])}}ac=null;var W=Date;if(!W.now){W={now:function(){return +(new Date)}}}var X=0;var S;var ab=/\blang(?:uage)?-([\w.]+)(?!\S)/;var ae=/\bprettyprint\b/;function U(){var ag=(window.PR_SHOULD_USE_CONTINUATION?W.now()+250:Infinity);for(;X<T.length&&W.now()<ag;X++){var aj=T[X];var ai=aj.className;if(ai.indexOf("prettyprint")>=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X<T.length){setTimeout(U,250)}else{if(ad){ad()}}}U()}window.prettyPrintOne=y;window.prettyPrint=b;window.PR={createSimpleLexer:g,registerLangHandler:c,sourceDecorator:i,PR_ATTRIB_NAME:P,PR_ATTRIB_VALUE:n,PR_COMMENT:j,PR_DECLARATION:E,PR_KEYWORD:z,PR_LITERAL:G,PR_NOCODE:N,PR_PLAIN:F,PR_PUNCTUATION:L,PR_SOURCE:J,PR_STRING:C,PR_TAG:m,PR_TYPE:O}})();PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_DECLARATION,/^<!\w[^>]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^<script\b[^>]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:<!--|-->)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]);
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/cli.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/cli.js
new file mode 100644
index 00000000..19b3b273
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/cli.js
@@ -0,0 +1,94 @@
+#!/usr/bin/env node
+
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+
+var async = require('async'),
+ Command = require('./command'),
+ inputError = require('./util/input-error'),
+ exitProcess = process.exit; //hold a reference to original process.exit so that we are not affected even when a test changes it
+
+require('./register-plugins');
+
+function findCommandPosition(args) {
+ var i;
+
+ for (i = 0; i < args.length; i += 1) {
+ if (args[i].charAt(0) !== '-') {
+ return i;
+ }
+ }
+
+ return -1;
+}
+
+function exit(ex, code) {
+ // flush output for Node.js Windows pipe bug
+ // https://github.com/joyent/node/issues/6247 is just one bug example
+ // https://github.com/visionmedia/mocha/issues/333 has a good discussion
+ var streams = [process.stdout, process.stderr];
+ async.forEach(streams, function (stream, done) {
+ // submit a write request and wait until it's written
+ stream.write('', done);
+ }, function () {
+ if (ex) {
+ throw ex; // turn it into an uncaught exception
+ } else {
+ exitProcess(code);
+ }
+ });
+}
+
+function errHandler (ex) {
+ if (!ex) { return; }
+ if (!ex.inputError) {
+ // exit with exception stack trace
+ exit(ex);
+ } else {
+ //don't print nasty traces but still exit(1)
+ console.error(ex.message);
+ console.error('Try "istanbul help" for usage');
+ exit(null, 1);
+ }
+}
+
+function runCommand(args, callback) {
+ var pos = findCommandPosition(args),
+ command,
+ commandArgs,
+ commandObject;
+
+ if (pos < 0) {
+ return callback(inputError.create('Need a command to run'));
+ }
+
+ commandArgs = args.slice(0, pos);
+ command = args[pos];
+ commandArgs.push.apply(commandArgs, args.slice(pos + 1));
+
+ try {
+ commandObject = Command.create(command);
+ } catch (ex) {
+ errHandler(inputError.create(ex.message));
+ return;
+ }
+ commandObject.run(commandArgs, errHandler);
+}
+
+function runToCompletion(args) {
+ runCommand(args, errHandler);
+}
+
+/* istanbul ignore if: untestable */
+if (require.main === module) {
+ var args = Array.prototype.slice.call(process.argv, 2);
+ runToCompletion(args);
+}
+
+module.exports = {
+ runToCompletion: runToCompletion
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/collector.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/collector.js
new file mode 100644
index 00000000..f1b6b606
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/collector.js
@@ -0,0 +1,122 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+"use strict";
+var MemoryStore = require('./store/memory'),
+ utils = require('./object-utils');
+
+/**
+ * a mechanism to merge multiple coverage objects into one. Handles the use case
+ * of overlapping coverage information for the same files in multiple coverage
+ * objects and does not double-count in this situation. For example, if
+ * you pass the same coverage object multiple times, the final merged object will be
+ * no different that any of the objects passed in (except for execution counts).
+ *
+ * The `Collector` is built for scale to handle thousands of coverage objects.
+ * By default, all processing is done in memory since the common use-case is of
+ * one or a few coverage objects. You can work around memory
+ * issues by passing in a `Store` implementation that stores temporary computations
+ * on disk (the `tmp` store, for example).
+ *
+ * The `getFinalCoverage` method returns an object with merged coverage information
+ * and is provided as a convenience for implementors working with coverage information
+ * that can fit into memory. Reporters, in the interest of generality, should *not* use this method for
+ * creating reports.
+ *
+ * Usage
+ * -----
+ *
+ * var collector = new require('istanbul').Collector();
+ *
+ * files.forEach(function (f) {
+ * //each coverage object can have overlapping information about multiple files
+ * collector.add(JSON.parse(fs.readFileSync(f, 'utf8')));
+ * });
+ *
+ * collector.files().forEach(function(file) {
+ * var fileCoverage = collector.fileCoverageFor(file);
+ * console.log('Coverage for ' + file + ' is:' + JSON.stringify(fileCoverage));
+ * });
+ *
+ * // convenience method: do not use this when dealing with a large number of files
+ * var finalCoverage = collector.getFinalCoverage();
+ *
+ * @class Collector
+ * @module main
+ * @constructor
+ * @param {Object} options Optional. Configuration options.
+ * @param {Store} options.store - an implementation of `Store` to use for temporary
+ * calculations.
+ */
+function Collector(options) {
+ options = options || {};
+ this.store = options.store || new MemoryStore();
+}
+
+Collector.prototype = {
+ /**
+ * adds a coverage object to the collector.
+ *
+ * @method add
+ * @param {Object} coverage the coverage object.
+ * @param {String} testName Optional. The name of the test used to produce the object.
+ * This is currently not used.
+ */
+ add: function (coverage /*, testName */) {
+ var store = this.store;
+ Object.keys(coverage).forEach(function (key) {
+ var fileCoverage = coverage[key];
+ if (store.hasKey(key)) {
+ store.setObject(key, utils.mergeFileCoverage(fileCoverage, store.getObject(key)));
+ } else {
+ store.setObject(key, fileCoverage);
+ }
+ });
+ },
+ /**
+ * returns a list of unique file paths for which coverage information has been added.
+ * @method files
+ * @return {Array} an array of file paths for which coverage information is present.
+ */
+ files: function () {
+ return this.store.keys();
+ },
+ /**
+ * return file coverage information for a single file
+ * @method fileCoverageFor
+ * @param {String} fileName the path for the file for which coverage information is
+ * required. Must be one of the values returned in the `files()` method.
+ * @return {Object} the coverage information for the specified file.
+ */
+ fileCoverageFor: function (fileName) {
+ var ret = this.store.getObject(fileName);
+ utils.addDerivedInfoForFile(ret);
+ return ret;
+ },
+ /**
+ * returns file coverage information for all files. This has the same format as
+ * any of the objects passed in to the `add` method. The number of keys in this
+ * object will be a superset of all keys found in the objects passed to `add()`
+ * @method getFinalCoverage
+ * @return {Object} the merged coverage information
+ */
+ getFinalCoverage: function () {
+ var ret = {},
+ that = this;
+ this.files().forEach(function (file) {
+ ret[file] = that.fileCoverageFor(file);
+ });
+ return ret;
+ },
+ /**
+ * disposes this collector and reclaims temporary resources used in the
+ * computation. Calls `dispose()` on the underlying store.
+ * @method dispose
+ */
+ dispose: function () {
+ this.store.dispose();
+ }
+};
+
+module.exports = Collector; \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/check-coverage.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/check-coverage.js
new file mode 100644
index 00000000..a7e0a9c7
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/check-coverage.js
@@ -0,0 +1,195 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var nopt = require('nopt'),
+ path = require('path'),
+ fs = require('fs'),
+ Collector = require('../collector'),
+ formatOption = require('../util/help-formatter').formatOption,
+ util = require('util'),
+ utils = require('../object-utils'),
+ filesFor = require('../util/file-matcher').filesFor,
+ Command = require('./index'),
+ configuration = require('../config');
+
+function isAbsolute(file) {
+ if (path.isAbsolute) {
+ return path.isAbsolute(file);
+ }
+
+ return path.resolve(file) === path.normalize(file);
+}
+
+function CheckCoverageCommand() {
+ Command.call(this);
+}
+
+function removeFiles(covObj, root, files) {
+ var filesObj = {},
+ obj = {};
+
+ // Create lookup table.
+ files.forEach(function (file) {
+ filesObj[file] = true;
+ });
+
+ Object.keys(covObj).forEach(function (key) {
+ // Exclude keys will always be relative, but covObj keys can be absolute or relative
+ var excludeKey = isAbsolute(key) ? path.relative(root, key) : key;
+ // Also normalize for files that start with `./`, etc.
+ excludeKey = path.normalize(excludeKey);
+ if (filesObj[excludeKey] !== true) {
+ obj[key] = covObj[key];
+ }
+ });
+
+ return obj;
+}
+
+CheckCoverageCommand.TYPE = 'check-coverage';
+util.inherits(CheckCoverageCommand, Command);
+
+Command.mix(CheckCoverageCommand, {
+ synopsis: function () {
+ return "checks overall/per-file coverage against thresholds from coverage JSON files. Exits 1 if thresholds are not met, 0 otherwise";
+ },
+
+ usage: function () {
+ console.error('\nUsage: ' + this.toolName() + ' ' + this.type() + ' <options> [<include-pattern>]\n\nOptions are:\n\n' +
+ [
+ formatOption('--statements <threshold>', 'global statement coverage threshold'),
+ formatOption('--functions <threshold>', 'global function coverage threshold'),
+ formatOption('--branches <threshold>', 'global branch coverage threshold'),
+ formatOption('--lines <threshold>', 'global line coverage threshold')
+ ].join('\n\n') + '\n');
+
+ console.error('\n\n');
+
+ console.error('Thresholds, when specified as a positive number are taken to be the minimum percentage required.');
+ console.error('When a threshold is specified as a negative number it represents the maximum number of uncovered entities allowed.\n');
+ console.error('For example, --statements 90 implies minimum statement coverage is 90%.');
+ console.error(' --statements -10 implies that no more than 10 uncovered statements are allowed\n');
+ console.error('Per-file thresholds can be specified via a configuration file.\n');
+ console.error('<include-pattern> is a fileset pattern that can be used to select one or more coverage files ' +
+ 'for merge. This defaults to "**/coverage*.json"');
+
+ console.error('\n');
+ },
+
+ run: function (args, callback) {
+
+ var template = {
+ config: path,
+ root: path,
+ statements: Number,
+ lines: Number,
+ branches: Number,
+ functions: Number,
+ verbose: Boolean
+ },
+ opts = nopt(template, { v : '--verbose' }, args, 0),
+ // Translate to config opts.
+ config = configuration.loadFile(opts.config, {
+ verbose: opts.verbose,
+ check: {
+ global: {
+ statements: opts.statements,
+ lines: opts.lines,
+ branches: opts.branches,
+ functions: opts.functions
+ }
+ }
+ }),
+ includePattern = '**/coverage*.json',
+ root,
+ collector = new Collector(),
+ errors = [];
+
+ if (opts.argv.remain.length > 0) {
+ includePattern = opts.argv.remain[0];
+ }
+
+ root = opts.root || process.cwd();
+ filesFor({
+ root: root,
+ includes: [ includePattern ]
+ }, function (err, files) {
+ if (err) { throw err; }
+ if (files.length === 0) {
+ return callback('ERROR: No coverage files found.');
+ }
+ files.forEach(function (file) {
+ var coverageObject = JSON.parse(fs.readFileSync(file, 'utf8'));
+ collector.add(coverageObject);
+ });
+ var thresholds = {
+ global: {
+ statements: config.check.global.statements || 0,
+ branches: config.check.global.branches || 0,
+ lines: config.check.global.lines || 0,
+ functions: config.check.global.functions || 0,
+ excludes: config.check.global.excludes || []
+ },
+ each: {
+ statements: config.check.each.statements || 0,
+ branches: config.check.each.branches || 0,
+ lines: config.check.each.lines || 0,
+ functions: config.check.each.functions || 0,
+ excludes: config.check.each.excludes || []
+ }
+ },
+ rawCoverage = collector.getFinalCoverage(),
+ globalResults = utils.summarizeCoverage(removeFiles(rawCoverage, root, thresholds.global.excludes)),
+ eachResults = removeFiles(rawCoverage, root, thresholds.each.excludes);
+
+ // Summarize per-file results and mutate original results.
+ Object.keys(eachResults).forEach(function (key) {
+ eachResults[key] = utils.summarizeFileCoverage(eachResults[key]);
+ });
+
+ if (config.verbose) {
+ console.log('Compare actuals against thresholds');
+ console.log(JSON.stringify({ global: globalResults, each: eachResults, thresholds: thresholds }, undefined, 4));
+ }
+
+ function check(name, thresholds, actuals) {
+ [
+ "statements",
+ "branches",
+ "lines",
+ "functions"
+ ].forEach(function (key) {
+ var actual = actuals[key].pct,
+ actualUncovered = actuals[key].total - actuals[key].covered,
+ threshold = thresholds[key];
+
+ if (threshold < 0) {
+ if (threshold * -1 < actualUncovered) {
+ errors.push('ERROR: Uncovered count for ' + key + ' (' + actualUncovered +
+ ') exceeds ' + name + ' threshold (' + -1 * threshold + ')');
+ }
+ } else {
+ if (actual < threshold) {
+ errors.push('ERROR: Coverage for ' + key + ' (' + actual +
+ '%) does not meet ' + name + ' threshold (' + threshold + '%)');
+ }
+ }
+ });
+ }
+
+ check("global", thresholds.global, globalResults);
+
+ Object.keys(eachResults).forEach(function (key) {
+ check("per-file" + " (" + key + ") ", thresholds.each, eachResults[key]);
+ });
+
+ return callback(errors.length === 0 ? null : errors.join("\n"));
+ });
+ }
+});
+
+module.exports = CheckCoverageCommand;
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/common/run-with-cover.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/common/run-with-cover.js
new file mode 100644
index 00000000..b87bd4a5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/common/run-with-cover.js
@@ -0,0 +1,261 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+var Module = require('module'),
+ path = require('path'),
+ fs = require('fs'),
+ nopt = require('nopt'),
+ which = require('which'),
+ mkdirp = require('mkdirp'),
+ existsSync = fs.existsSync || path.existsSync,
+ inputError = require('../../util/input-error'),
+ matcherFor = require('../../util/file-matcher').matcherFor,
+ Instrumenter = require('../../instrumenter'),
+ Collector = require('../../collector'),
+ formatOption = require('../../util/help-formatter').formatOption,
+ hook = require('../../hook'),
+ Reporter = require('../../reporter'),
+ resolve = require('resolve'),
+ configuration = require('../../config');
+
+function usage(arg0, command) {
+
+ console.error('\nUsage: ' + arg0 + ' ' + command + ' [<options>] <executable-js-file-or-command> [-- <arguments-to-jsfile>]\n\nOptions are:\n\n'
+ + [
+ formatOption('--config <path-to-config>', 'the configuration file to use, defaults to .istanbul.yml'),
+ formatOption('--root <path> ', 'the root path to look for files to instrument, defaults to .'),
+ formatOption('-x <exclude-pattern> [-x <exclude-pattern>]', 'one or more fileset patterns e.g. "**/vendor/**"'),
+ formatOption('-i <include-pattern> [-i <include-pattern>]', 'one or more fileset patterns e.g. "**/*.js"'),
+ formatOption('--[no-]default-excludes', 'apply default excludes [ **/node_modules/**, **/test/**, **/tests/** ], defaults to true'),
+ formatOption('--hook-run-in-context', 'hook vm.runInThisContext in addition to require (supports RequireJS), defaults to false'),
+ formatOption('--post-require-hook <file> | <module>', 'JS module that exports a function for post-require processing'),
+ formatOption('--report <format> [--report <format>] ', 'report format, defaults to lcov (= lcov.info + HTML)'),
+ formatOption('--dir <report-dir>', 'report directory, defaults to ./coverage'),
+ formatOption('--print <type>', 'type of report to print to console, one of summary (default), detail, both or none'),
+ formatOption('--verbose, -v', 'verbose mode'),
+ formatOption('--[no-]preserve-comments', 'remove / preserve comments in the output, defaults to false'),
+ formatOption('--include-all-sources', 'instrument all unused sources after running tests, defaults to false'),
+ formatOption('--[no-]include-pid', 'include PID in output coverage filename')
+ ].join('\n\n') + '\n');
+ console.error('\n');
+}
+
+function run(args, commandName, enableHooks, callback) {
+
+ var template = {
+ config: path,
+ root: path,
+ x: [ Array, String ],
+ report: [Array, String ],
+ dir: path,
+ verbose: Boolean,
+ yui: Boolean,
+ 'default-excludes': Boolean,
+ print: String,
+ 'self-test': Boolean,
+ 'hook-run-in-context': Boolean,
+ 'post-require-hook': String,
+ 'preserve-comments': Boolean,
+ 'include-all-sources': Boolean,
+ 'preload-sources': Boolean,
+ i: [ Array, String ],
+ 'include-pid': Boolean
+ },
+ opts = nopt(template, { v : '--verbose' }, args, 0),
+ overrides = {
+ verbose: opts.verbose,
+ instrumentation: {
+ root: opts.root,
+ 'default-excludes': opts['default-excludes'],
+ excludes: opts.x,
+ 'include-all-sources': opts['include-all-sources'],
+ 'preload-sources': opts['preload-sources'],
+ 'include-pid': opts['include-pid']
+ },
+ reporting: {
+ reports: opts.report,
+ print: opts.print,
+ dir: opts.dir
+ },
+ hooks: {
+ 'hook-run-in-context': opts['hook-run-in-context'],
+ 'post-require-hook': opts['post-require-hook'],
+ 'handle-sigint': opts['handle-sigint']
+ }
+ },
+ config = configuration.loadFile(opts.config, overrides),
+ verbose = config.verbose,
+ cmdAndArgs = opts.argv.remain,
+ preserveComments = opts['preserve-comments'],
+ includePid = opts['include-pid'],
+ cmd,
+ cmdArgs,
+ reportingDir,
+ reporter = new Reporter(config),
+ runFn,
+ excludes;
+
+ if (cmdAndArgs.length === 0) {
+ return callback(inputError.create('Need a filename argument for the ' + commandName + ' command!'));
+ }
+
+ cmd = cmdAndArgs.shift();
+ cmdArgs = cmdAndArgs;
+
+ if (!existsSync(cmd)) {
+ try {
+ cmd = which.sync(cmd);
+ } catch (ex) {
+ return callback(inputError.create('Unable to resolve file [' + cmd + ']'));
+ }
+ } else {
+ cmd = path.resolve(cmd);
+ }
+
+ runFn = function () {
+ process.argv = ["node", cmd].concat(cmdArgs);
+ if (verbose) {
+ console.log('Running: ' + process.argv.join(' '));
+ }
+ process.env.running_under_istanbul=1;
+ Module.runMain(cmd, null, true);
+ };
+
+ excludes = config.instrumentation.excludes(true);
+
+ if (enableHooks) {
+ reportingDir = path.resolve(config.reporting.dir());
+ mkdirp.sync(reportingDir); //ensure we fail early if we cannot do this
+ reporter.dir = reportingDir;
+ reporter.addAll(config.reporting.reports());
+ if (config.reporting.print() !== 'none') {
+ switch (config.reporting.print()) {
+ case 'detail':
+ reporter.add('text');
+ break;
+ case 'both':
+ reporter.add('text');
+ reporter.add('text-summary');
+ break;
+ default:
+ reporter.add('text-summary');
+ break;
+ }
+ }
+
+ excludes.push(path.relative(process.cwd(), path.join(reportingDir, '**', '*')));
+ matcherFor({
+ root: config.instrumentation.root() || process.cwd(),
+ includes: opts.i || config.instrumentation.extensions().map(function (ext) {
+ return '**/*' + ext;
+ }),
+ excludes: excludes
+ },
+ function (err, matchFn) {
+ if (err) { return callback(err); }
+
+ var coverageVar = '$$cov_' + new Date().getTime() + '$$',
+ instrumenter = new Instrumenter({ coverageVariable: coverageVar , preserveComments: preserveComments}),
+ transformer = instrumenter.instrumentSync.bind(instrumenter),
+ hookOpts = { verbose: verbose, extensions: config.instrumentation.extensions() },
+ postRequireHook = config.hooks.postRequireHook(),
+ postLoadHookFile;
+
+ if (postRequireHook) {
+ postLoadHookFile = path.resolve(postRequireHook);
+ } else if (opts.yui) { //EXPERIMENTAL code: do not rely on this in anyway until the docs say it is allowed
+ postLoadHookFile = path.resolve(__dirname, '../../util/yui-load-hook');
+ }
+
+ if (postRequireHook) {
+ if (!existsSync(postLoadHookFile)) { //assume it is a module name and resolve it
+ try {
+ postLoadHookFile = resolve.sync(postRequireHook, { basedir: process.cwd() });
+ } catch (ex) {
+ if (verbose) { console.error('Unable to resolve [' + postRequireHook + '] as a node module'); }
+ callback(ex);
+ return;
+ }
+ }
+ }
+ if (postLoadHookFile) {
+ if (verbose) { console.error('Use post-load-hook: ' + postLoadHookFile); }
+ hookOpts.postLoadHook = require(postLoadHookFile)(matchFn, transformer, verbose);
+ }
+
+ if (opts['self-test']) {
+ hook.unloadRequireCache(matchFn);
+ }
+ // runInThisContext is used by RequireJS [issue #23]
+ if (config.hooks.hookRunInContext()) {
+ hook.hookRunInThisContext(matchFn, transformer, hookOpts);
+ }
+ hook.hookRequire(matchFn, transformer, hookOpts);
+
+ //initialize the global variable to stop mocha from complaining about leaks
+ global[coverageVar] = {};
+
+ // enable passing --handle-sigint to write reports on SIGINT.
+ // This allows a user to manually kill a process while
+ // still getting the istanbul report.
+ if (config.hooks.handleSigint()) {
+ process.once('SIGINT', process.exit);
+ }
+
+ process.once('exit', function () {
+ var pidExt = includePid ? ('-' + process.pid) : '',
+ file = path.resolve(reportingDir, 'coverage' + pidExt + '.json'),
+ collector,
+ cov;
+ if (typeof global[coverageVar] === 'undefined' || Object.keys(global[coverageVar]).length === 0) {
+ console.error('No coverage information was collected, exit without writing coverage information');
+ return;
+ } else {
+ cov = global[coverageVar];
+ }
+ //important: there is no event loop at this point
+ //everything that happens in this exit handler MUST be synchronous
+ if (config.instrumentation.includeAllSources()) {
+ // Files that are not touched by code ran by the test runner is manually instrumented, to
+ // illustrate the missing coverage.
+ matchFn.files.forEach(function (file) {
+ if (!cov[file]) {
+ transformer(fs.readFileSync(file, 'utf-8'), file);
+
+ // When instrumenting the code, istanbul will give each FunctionDeclaration a value of 1 in coverState.s,
+ // presumably to compensate for function hoisting. We need to reset this, as the function was not hoisted,
+ // as it was never loaded.
+ Object.keys(instrumenter.coverState.s).forEach(function (key) {
+ instrumenter.coverState.s[key] = 0;
+ });
+
+ cov[file] = instrumenter.coverState;
+ }
+ });
+ }
+ mkdirp.sync(reportingDir); //yes, do this again since some test runners could clean the dir initially created
+ if (config.reporting.print() !== 'none') {
+ console.error('=============================================================================');
+ console.error('Writing coverage object [' + file + ']');
+ }
+ fs.writeFileSync(file, JSON.stringify(cov), 'utf8');
+ collector = new Collector();
+ collector.add(cov);
+ if (config.reporting.print() !== 'none') {
+ console.error('Writing coverage reports at [' + reportingDir + ']');
+ console.error('=============================================================================');
+ }
+ reporter.write(collector, true, callback);
+ });
+ runFn();
+ });
+ } else {
+ runFn();
+ }
+}
+
+module.exports = {
+ run: run,
+ usage: usage
+};
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/cover.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/cover.js
new file mode 100644
index 00000000..ee824291
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/cover.js
@@ -0,0 +1,33 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var runWithCover = require('./common/run-with-cover'),
+ util = require('util'),
+ Command = require('./index');
+
+function CoverCommand() {
+ Command.call(this);
+}
+
+CoverCommand.TYPE = 'cover';
+util.inherits(CoverCommand, Command);
+
+Command.mix(CoverCommand, {
+ synopsis: function () {
+ return "transparently adds coverage information to a node command. Saves coverage.json and reports at the end of execution";
+ },
+
+ usage: function () {
+ runWithCover.usage(this.toolName(), this.type());
+ },
+
+ run: function (args, callback) {
+ runWithCover.run(args, this.type(), true, callback);
+ }
+});
+
+
+module.exports = CoverCommand;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/help.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/help.js
new file mode 100644
index 00000000..e3f6d76b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/help.js
@@ -0,0 +1,102 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var Command = require('./index.js'),
+ util = require('util'),
+ formatOption = require('../util/help-formatter').formatOption,
+ VERSION = require('../../index').VERSION,
+ configuration = require('../config'),
+ yaml = require('js-yaml'),
+ formatPara = require('../util/help-formatter').formatPara;
+
+function showConfigHelp(toolName) {
+
+ console.error('\nConfiguring ' + toolName);
+ console.error('====================');
+ console.error('\n' +
+ formatPara(toolName + ' can be configured globally using a .istanbul.yml YAML file ' +
+ 'at the root of your source tree. Every command also accepts a --config=<config-file> argument to ' +
+ 'customize its location per command. The alternate config file can be in YAML, JSON or node.js ' +
+ '(exporting the config object).'));
+ console.error('\n' +
+ formatPara('The config file currently has four sections for instrumentation, reporting, hooks, ' +
+ 'and checking. Note that certain commands (like `cover`) use information from multiple sections.'));
+ console.error('\n' +
+ formatPara('Keys in the config file usually correspond to command line parameters with the same name. ' +
+ 'The verbose option for every command shows you the exact configuration used. See the api ' +
+ 'docs for an explanation of each key.'));
+
+ console.error('\n' +
+ formatPara('You only need to specify the keys that you want to override. Your overrides will be merged ' +
+ 'with the default config.'));
+ console.error('\nThe default configuration is as follows:\n');
+ console.error(yaml.safeDump(configuration.defaultConfig(), { indent: 4, flowLevel: 3 }));
+ console.error('\n' +
+ formatPara('The `watermarks` section does not have a command line equivalent. It allows you to set up ' +
+ 'low and high watermark percentages for reporting. These are honored by all reporters that colorize ' +
+ 'their output based on low/ medium/ high coverage.'));
+ console.error('\n' +
+ formatPara('The `reportConfig` section allows you to configure each report format independently ' +
+ 'and has no command-line equivalent either.'));
+ console.error('\n' +
+ formatPara('The `check` section configures minimum threshold enforcement for coverage results. ' +
+ '`global` applies to all files together and `each` on a per-file basis. A list of files can ' +
+ 'be excluded from enforcement relative to root via the `exclude` property.'));
+ console.error('');
+}
+
+function HelpCommand() {
+ Command.call(this);
+}
+
+HelpCommand.TYPE = 'help';
+util.inherits(HelpCommand, Command);
+
+Command.mix(HelpCommand, {
+ synopsis: function () {
+ return "shows help";
+ },
+
+ usage: function () {
+
+ console.error('\nUsage: ' + this.toolName() + ' ' + this.type() + ' config | <command>\n');
+ console.error('`config` provides help with istanbul configuration\n');
+ console.error('Available commands are:\n');
+
+ var commandObj;
+ Command.getCommandList().forEach(function (cmd) {
+ commandObj = Command.create(cmd);
+ console.error(formatOption(cmd, commandObj.synopsis()));
+ console.error("\n");
+ });
+ console.error("Command names can be abbreviated as long as the abbreviation is unambiguous");
+ console.error(this.toolName() + ' version:' + VERSION);
+ console.error("\n");
+ },
+ run: function (args, callback) {
+ var command;
+ if (args.length === 0) {
+ this.usage();
+ } else {
+ if (args[0] === 'config') {
+ showConfigHelp(this.toolName());
+ } else {
+ try {
+ command = Command.create(args[0]);
+ command.usage('istanbul', Command.resolveCommandName(args[0]));
+ } catch (ex) {
+ console.error('Invalid command: ' + args[0]);
+ this.usage();
+ }
+ }
+ }
+ return callback();
+ }
+});
+
+
+module.exports = HelpCommand;
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/index.js
new file mode 100644
index 00000000..754cf1d0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/index.js
@@ -0,0 +1,33 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var Factory = require('../util/factory'),
+ factory = new Factory('command', __dirname, true);
+
+function Command() {}
+// add register, create, mix, loadAll, getCommandList, resolveCommandName to the Command object
+factory.bindClassMethods(Command);
+
+Command.prototype = {
+ toolName: function () {
+ return require('../util/meta').NAME;
+ },
+
+ type: function () {
+ return this.constructor.TYPE;
+ },
+ synopsis: /* istanbul ignore next: base method */ function () {
+ return "the developer has not written a one-line summary of the " + this.type() + " command";
+ },
+ usage: /* istanbul ignore next: base method */ function () {
+ console.error("the developer has not provided a usage for the " + this.type() + " command");
+ },
+ run: /* istanbul ignore next: abstract method */ function (args, callback) {
+ return callback(new Error("run: must be overridden for the " + this.type() + " command"));
+ }
+};
+
+module.exports = Command;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/instrument.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/instrument.js
new file mode 100644
index 00000000..71faf32f
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/instrument.js
@@ -0,0 +1,261 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ mkdirp = require('mkdirp'),
+ once = require('once'),
+ async = require('async'),
+ fs = require('fs'),
+ filesFor = require('../util/file-matcher').filesFor,
+ nopt = require('nopt'),
+ Instrumenter = require('../instrumenter'),
+ inputError = require('../util/input-error'),
+ formatOption = require('../util/help-formatter').formatOption,
+ util = require('util'),
+ Command = require('./index'),
+ Collector = require('../collector'),
+ configuration = require('../config'),
+ verbose;
+
+
+/*
+ * Chunk file size to use when reading non JavaScript files in memory
+ * and copying them over when using complete-copy flag.
+ */
+var READ_FILE_CHUNK_SIZE = 64 * 1024;
+
+function BaselineCollector(instrumenter) {
+ this.instrumenter = instrumenter;
+ this.collector = new Collector();
+ this.instrument = instrumenter.instrument.bind(this.instrumenter);
+
+ var origInstrumentSync = instrumenter.instrumentSync;
+ this.instrumentSync = function () {
+ var args = Array.prototype.slice.call(arguments),
+ ret = origInstrumentSync.apply(this.instrumenter, args),
+ baseline = this.instrumenter.lastFileCoverage(),
+ coverage = {};
+ coverage[baseline.path] = baseline;
+ this.collector.add(coverage);
+ return ret;
+ };
+ //monkey patch the instrumenter to call our version instead
+ instrumenter.instrumentSync = this.instrumentSync.bind(this);
+}
+
+BaselineCollector.prototype = {
+ getCoverage: function () {
+ return this.collector.getFinalCoverage();
+ }
+};
+
+
+function processFiles(instrumenter, inputDir, outputDir, relativeNames, extensions) {
+ var processor = function (name, callback) {
+ var inputFile = path.resolve(inputDir, name),
+ outputFile = path.resolve(outputDir, name),
+ inputFileExtenstion = path.extname(inputFile),
+ isJavaScriptFile = extensions.indexOf(inputFileExtenstion) > -1,
+ oDir = path.dirname(outputFile),
+ readStream, writeStream;
+
+ callback = once(callback);
+ mkdirp.sync(oDir);
+
+ if (fs.statSync(inputFile).isDirectory()) {
+ return callback(null, name);
+ }
+
+ if (isJavaScriptFile) {
+ fs.readFile(inputFile, 'utf8', function (err, data) {
+ if (err) { return callback(err, name); }
+ instrumenter.instrument(data, inputFile, function (iErr, instrumented) {
+ if (iErr) { return callback(iErr, name); }
+ fs.writeFile(outputFile, instrumented, 'utf8', function (err) {
+ return callback(err, name);
+ });
+ });
+ });
+ }
+ else {
+ // non JavaScript file, copy it as is
+ readStream = fs.createReadStream(inputFile, {'bufferSize': READ_FILE_CHUNK_SIZE});
+ writeStream = fs.createWriteStream(outputFile);
+
+ readStream.on('error', callback);
+ writeStream.on('error', callback);
+
+ readStream.pipe(writeStream);
+ readStream.on('end', function() {
+ callback(null, name);
+ });
+ }
+ },
+ q = async.queue(processor, 10),
+ errors = [],
+ count = 0,
+ startTime = new Date().getTime();
+
+ q.push(relativeNames, function (err, name) {
+ var inputFile, outputFile;
+ if (err) {
+ errors.push({ file: name, error: err.message || err.toString() });
+ inputFile = path.resolve(inputDir, name);
+ outputFile = path.resolve(outputDir, name);
+ fs.writeFileSync(outputFile, fs.readFileSync(inputFile));
+ }
+ if (verbose) {
+ console.log('Processed: ' + name);
+ } else {
+ if (count % 100 === 0) { process.stdout.write('.'); }
+ }
+ count += 1;
+ });
+
+ q.drain = function () {
+ var endTime = new Date().getTime();
+ console.log('\nProcessed [' + count + '] files in ' + Math.floor((endTime - startTime) / 1000) + ' secs');
+ if (errors.length > 0) {
+ console.log('The following ' + errors.length + ' file(s) had errors and were copied as-is');
+ console.log(errors);
+ }
+ };
+}
+
+
+function InstrumentCommand() {
+ Command.call(this);
+}
+
+InstrumentCommand.TYPE = 'instrument';
+util.inherits(InstrumentCommand, Command);
+
+Command.mix(InstrumentCommand, {
+ synopsis: function synopsis() {
+ return "instruments a file or a directory tree and writes the instrumented code to the desired output location";
+ },
+
+ usage: function () {
+ console.error('\nUsage: ' + this.toolName() + ' ' + this.type() + ' <options> <file-or-directory>\n\nOptions are:\n\n' +
+ [
+ formatOption('--config <path-to-config>', 'the configuration file to use, defaults to .istanbul.yml'),
+ formatOption('--output <file-or-dir>', 'The output file or directory. This is required when the input is a directory, ' +
+ 'defaults to standard output when input is a file'),
+ formatOption('-x <exclude-pattern> [-x <exclude-pattern>]', 'one or more fileset patterns (e.g. "**/vendor/**" to ignore all files ' +
+ 'under a vendor directory). Also see the --default-excludes option'),
+ formatOption('--variable <global-coverage-variable-name>', 'change the variable name of the global coverage variable from the ' +
+ 'default value of `__coverage__` to something else'),
+ formatOption('--embed-source', 'embed source code into the coverage object, defaults to false'),
+ formatOption('--[no-]compact', 'produce [non]compact output, defaults to compact'),
+ formatOption('--[no-]preserve-comments', 'remove / preserve comments in the output, defaults to false'),
+ formatOption('--[no-]complete-copy', 'also copy non-javascript files to the ouput directory as is, defaults to false'),
+ formatOption('--save-baseline', 'produce a baseline coverage.json file out of all files instrumented'),
+ formatOption('--baseline-file <file>', 'filename of baseline file, defaults to coverage/coverage-baseline.json')
+ ].join('\n\n') + '\n');
+ console.error('\n');
+ },
+
+ run: function (args, callback) {
+
+ var template = {
+ config: path,
+ output: path,
+ x: [Array, String],
+ variable: String,
+ compact: Boolean,
+ 'complete-copy': Boolean,
+ verbose: Boolean,
+ 'save-baseline': Boolean,
+ 'baseline-file': path,
+ 'embed-source': Boolean,
+ 'preserve-comments': Boolean
+ },
+ opts = nopt(template, { v : '--verbose' }, args, 0),
+ overrides = {
+ verbose: opts.verbose,
+ instrumentation: {
+ variable: opts.variable,
+ compact: opts.compact,
+ 'embed-source': opts['embed-source'],
+ 'preserve-comments': opts['preserve-comments'],
+ excludes: opts.x,
+ 'complete-copy': opts['complete-copy'],
+ 'save-baseline': opts['save-baseline'],
+ 'baseline-file': opts['baseline-file']
+ }
+ },
+ config = configuration.loadFile(opts.config, overrides),
+ iOpts = config.instrumentation,
+ cmdArgs = opts.argv.remain,
+ file,
+ stats,
+ stream,
+ includes,
+ instrumenter,
+ needBaseline = iOpts.saveBaseline(),
+ baselineFile = path.resolve(iOpts.baselineFile()),
+ output = opts.output;
+
+ verbose = config.verbose;
+ if (cmdArgs.length !== 1) {
+ return callback(inputError.create('Need exactly one filename/ dirname argument for the instrument command!'));
+ }
+
+ if (iOpts.completeCopy()) {
+ includes = ['**/*'];
+ }
+ else {
+ includes = iOpts.extensions().map(function(ext) {
+ return '**/*' + ext;
+ });
+ }
+
+ instrumenter = new Instrumenter({
+ coverageVariable: iOpts.variable(),
+ embedSource: iOpts.embedSource(),
+ noCompact: !iOpts.compact(),
+ preserveComments: iOpts.preserveComments()
+ });
+
+ if (needBaseline) {
+ mkdirp.sync(path.dirname(baselineFile));
+ instrumenter = new BaselineCollector(instrumenter);
+ process.on('exit', function () {
+ console.log('Saving baseline coverage at: ' + baselineFile);
+ fs.writeFileSync(baselineFile, JSON.stringify(instrumenter.getCoverage()), 'utf8');
+ });
+ }
+
+ file = path.resolve(cmdArgs[0]);
+ stats = fs.statSync(file);
+ if (stats.isDirectory()) {
+ if (!output) { return callback(inputError.create('Need an output directory [-o <dir>] when input is a directory!')); }
+ if (output === file) { return callback(inputError.create('Cannot instrument into the same directory/ file as input!')); }
+ mkdirp.sync(output);
+ filesFor({
+ root: file,
+ includes: includes,
+ excludes: opts.x || iOpts.excludes(false), // backwards-compat, *sigh*
+ relative: true
+ }, function (err, files) {
+ if (err) { return callback(err); }
+ processFiles(instrumenter, file, output, files, iOpts.extensions());
+ });
+ } else {
+ if (output) {
+ stream = fs.createWriteStream(output);
+ } else {
+ stream = process.stdout;
+ }
+ stream.write(instrumenter.instrumentSync(fs.readFileSync(file, 'utf8'), file));
+ if (stream !== process.stdout) {
+ stream.end();
+ }
+ }
+ }
+});
+
+module.exports = InstrumentCommand;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/report.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/report.js
new file mode 100644
index 00000000..f705a42a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/report.js
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var nopt = require('nopt'),
+ Report = require('../report'),
+ Reporter = require('../reporter'),
+ path = require('path'),
+ fs = require('fs'),
+ Collector = require('../collector'),
+ helpFormatter = require('../util/help-formatter'),
+ formatOption = helpFormatter.formatOption,
+ formatPara = helpFormatter.formatPara,
+ filesFor = require('../util/file-matcher').filesFor,
+ util = require('util'),
+ Command = require('./index'),
+ configuration = require('../config');
+
+function ReportCommand() {
+ Command.call(this);
+}
+
+ReportCommand.TYPE = 'report';
+util.inherits(ReportCommand, Command);
+
+function printDeprecationMessage(pat, fmt) {
+ console.error('**********************************************************************');
+ console.error('DEPRECATION WARNING! You are probably using the old format of the report command');
+ console.error('This will stop working soon, see `istanbul help report` for the new command format');
+ console.error('Assuming you meant: istanbul report --include=' + pat + ' ' + fmt);
+ console.error('**********************************************************************');
+}
+
+Command.mix(ReportCommand, {
+ synopsis: function () {
+ return "writes reports for coverage JSON objects produced in a previous run";
+ },
+
+ usage: function () {
+ console.error('\nUsage: ' + this.toolName() + ' ' + this.type() + ' <options> [ <format> ... ]\n\nOptions are:\n\n' +
+ [
+ formatOption('--config <path-to-config>', 'the configuration file to use, defaults to .istanbul.yml'),
+ formatOption('--root <input-directory>', 'The input root directory for finding coverage files'),
+ formatOption('--dir <report-directory>', 'The output directory where files will be written. This defaults to ./coverage/'),
+ formatOption('--include <glob>', 'The fileset pattern to select one or more coverage files, defaults to **/coverage*.json'),
+ formatOption('--verbose, -v', 'verbose mode')
+ ].join('\n\n'));
+
+ console.error('\n');
+ console.error('<format> is one of ');
+ Report.getReportList().forEach(function (name) {
+ console.error(formatOption(name, Report.create(name).synopsis()));
+ });
+ console.error("");
+ console.error(formatPara([
+ 'Default format is lcov unless otherwise specified in the config file.',
+ 'In addition you can tweak the file names for various reports using the config file.',
+ 'Type `istanbul help config` to see what can be tweaked.'
+ ].join(' ')));
+ console.error('\n');
+ },
+
+ run: function (args, callback) {
+
+ var template = {
+ config: path,
+ root: path,
+ dir: path,
+ include: String,
+ verbose: Boolean
+ },
+ opts = nopt(template, { v : '--verbose' }, args, 0),
+ includePattern = opts.include || '**/coverage*.json',
+ root,
+ collector = new Collector(),
+ config = configuration.loadFile(opts.config, {
+ verbose: opts.verbose,
+ reporting: {
+ dir: opts.dir
+ }
+ }),
+ formats = opts.argv.remain,
+ reporter = new Reporter(config);
+
+ // Start: backward compatible processing
+ if (formats.length === 2 &&
+ Report.getReportList().indexOf(formats[1]) < 0) {
+ includePattern = formats[1];
+ formats = [ formats[0] ];
+ printDeprecationMessage(includePattern, formats[0]);
+ }
+ // End: backward compatible processing
+
+ if (formats.length === 0) {
+ formats = config.reporting.reports();
+ }
+ if (formats.length === 0) {
+ formats = [ 'lcov' ];
+ }
+ reporter.addAll(formats);
+
+ root = opts.root || process.cwd();
+ filesFor({
+ root: root,
+ includes: [ includePattern ]
+ }, function (err, files) {
+ if (err) { throw err; }
+ files.forEach(function (file) {
+ var coverageObject = JSON.parse(fs.readFileSync(file, 'utf8'));
+ collector.add(coverageObject);
+ });
+ reporter.write(collector, false, function (err) {
+ console.log('Done');
+ return callback(err);
+ });
+ });
+ }
+});
+
+module.exports = ReportCommand;
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/test.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/test.js
new file mode 100644
index 00000000..59305074
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/command/test.js
@@ -0,0 +1,31 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var runWithCover = require('./common/run-with-cover'),
+ util = require('util'),
+ Command = require('./index');
+
+function TestCommand() {
+ Command.call(this);
+}
+
+TestCommand.TYPE = 'test';
+util.inherits(TestCommand, Command);
+
+Command.mix(TestCommand, {
+ synopsis: function () {
+ return "cover a node command only when npm_config_coverage is set. Use in an `npm test` script for conditional coverage";
+ },
+
+ usage: function () {
+ runWithCover.usage(this.toolName(), this.type());
+ },
+
+ run: function (args, callback) {
+ runWithCover.run(args, this.type(), !!process.env.npm_config_coverage, callback);
+ }
+});
+
+module.exports = TestCommand;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/config.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/config.js
new file mode 100644
index 00000000..47670ce5
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/config.js
@@ -0,0 +1,483 @@
+/*
+ Copyright (c) 2013, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+var path = require('path'),
+ fs = require('fs'),
+ existsSync = fs.existsSync || path.existsSync,
+ CAMEL_PATTERN = /([a-z])([A-Z])/g,
+ YML_PATTERN = /\.ya?ml$/,
+ yaml = require('js-yaml'),
+ defaults = require('./report/common/defaults');
+
+function defaultConfig(includeBackCompatAttrs) {
+ var ret = {
+ verbose: false,
+ instrumentation: {
+ root: '.',
+ extensions: ['.js'],
+ 'default-excludes': true,
+ excludes: [],
+ 'embed-source': false,
+ variable: '__coverage__',
+ compact: true,
+ 'preserve-comments': false,
+ 'complete-copy': false,
+ 'save-baseline': false,
+ 'baseline-file': './coverage/coverage-baseline.json',
+ 'include-all-sources': false,
+ 'include-pid': false
+ },
+ reporting: {
+ print: 'summary',
+ reports: [ 'lcov' ],
+ dir: './coverage'
+ },
+ hooks: {
+ 'hook-run-in-context': false,
+ 'post-require-hook': null,
+ 'handle-sigint': false
+ },
+ check: {
+ global: {
+ statements: 0,
+ lines: 0,
+ branches: 0,
+ functions: 0,
+ excludes: [] // Currently list of files (root + path). For future, extend to patterns.
+ },
+ each: {
+ statements: 0,
+ lines: 0,
+ branches: 0,
+ functions: 0,
+ excludes: []
+ }
+ }
+ };
+ ret.reporting.watermarks = defaults.watermarks();
+ ret.reporting['report-config'] = defaults.defaultReportConfig();
+
+ if (includeBackCompatAttrs) {
+ ret.instrumentation['preload-sources'] = false;
+ }
+
+ return ret;
+}
+
+function dasherize(word) {
+ return word.replace(CAMEL_PATTERN, function (match, lch, uch) {
+ return lch + '-' + uch.toLowerCase();
+ });
+}
+function isScalar(v) {
+ if (v === null) { return true; }
+ return v !== undefined && !Array.isArray(v) && typeof v !== 'object';
+}
+
+function isObject(v) {
+ return typeof v === 'object' && v !== null && !Array.isArray(v);
+}
+
+function mergeObjects(explicit, template) {
+
+ var ret = {};
+
+ Object.keys(template).forEach(function (k) {
+ var v1 = template[k],
+ v2 = explicit[k];
+
+ if (Array.isArray(v1)) {
+ ret[k] = Array.isArray(v2) && v2.length > 0 ? v2 : v1;
+ } else if (isObject(v1)) {
+ v2 = isObject(v2) ? v2 : {};
+ ret[k] = mergeObjects(v2, v1);
+ } else {
+ ret[k] = isScalar(v2) ? v2 : v1;
+ }
+ });
+ return ret;
+}
+
+function mergeDefaults(explicit, implicit) {
+ return mergeObjects(explicit || {}, implicit);
+}
+
+function addMethods() {
+ var args = Array.prototype.slice.call(arguments),
+ cons = args.shift();
+
+ args.forEach(function (arg) {
+ var method = arg,
+ property = dasherize(arg);
+ cons.prototype[method] = function () {
+ return this.config[property];
+ };
+ });
+}
+
+/**
+ * Object that returns instrumentation options
+ * @class InstrumentOptions
+ * @module config
+ * @constructor
+ * @param config the instrumentation part of the config object
+ */
+function InstrumentOptions(config) {
+ if (config['preload-sources']) {
+ console.error('The preload-sources option is deprecated, please use include-all-sources instead.');
+ config['include-all-sources'] = config['preload-sources'];
+ }
+ this.config = config;
+}
+
+/**
+ * returns if default excludes should be turned on. Used by the `cover` command.
+ * @method defaultExcludes
+ * @return {Boolean} true if default excludes should be turned on
+ */
+/**
+ * returns if non-JS files should be copied during instrumentation. Used by the
+ * `instrument` command.
+ * @method completeCopy
+ * @return {Boolean} true if non-JS files should be copied
+ */
+/**
+ * returns if the source should be embedded in the instrumented code. Used by the
+ * `instrument` command.
+ * @method embedSource
+ * @return {Boolean} true if the source should be embedded in the instrumented code
+ */
+/**
+ * the coverage variable name to use. Used by the `instrument` command.
+ * @method variable
+ * @return {String} the coverage variable name to use
+ */
+/**
+ * returns if the output should be compact JS. Used by the `instrument` command.
+ * @method compact
+ * @return {Boolean} true if the output should be compact
+ */
+/**
+ * returns if comments should be preserved in the generated JS. Used by the
+ * `cover` and `instrument` commands.
+ * @method preserveComments
+ * @return {Boolean} true if comments should be preserved in the generated JS
+ */
+/**
+ * returns if a zero-coverage baseline file should be written as part of
+ * instrumentation. This allows reporting to display numbers for files that have
+ * no tests. Used by the `instrument` command.
+ * @method saveBaseline
+ * @return {Boolean} true if a baseline coverage file should be written.
+ */
+/**
+ * Sets the baseline coverage filename. Used by the `instrument` command.
+ * @method baselineFile
+ * @return {String} the name of the baseline coverage file.
+ */
+/**
+ * returns if the coverage filename should include the PID. Used by the `instrument` command.
+ * @method includePid
+ * @return {Boolean} true to include pid in coverage filename.
+ */
+
+
+addMethods(InstrumentOptions,
+ 'extensions', 'defaultExcludes', 'completeCopy',
+ 'embedSource', 'variable', 'compact', 'preserveComments',
+ 'saveBaseline', 'baselineFile',
+ 'includeAllSources', 'includePid');
+
+/**
+ * returns the root directory used by istanbul which is typically the root of the
+ * source tree. Used by the `cover` and `report` commands.
+ * @method root
+ * @return {String} the root directory used by istanbul.
+ */
+InstrumentOptions.prototype.root = function () { return path.resolve(this.config.root); };
+/**
+ * returns an array of fileset patterns that should be excluded for instrumentation.
+ * Used by the `instrument` and `cover` commands.
+ * @method excludes
+ * @return {Array} an array of fileset patterns that should be excluded for
+ * instrumentation.
+ */
+InstrumentOptions.prototype.excludes = function (excludeTests) {
+ var defs;
+ if (this.defaultExcludes()) {
+ defs = [ '**/node_modules/**' ];
+ if (excludeTests) {
+ defs = defs.concat(['**/test/**', '**/tests/**']);
+ }
+ return defs.concat(this.config.excludes);
+ }
+ return this.config.excludes;
+};
+
+/**
+ * Object that returns reporting options
+ * @class ReportingOptions
+ * @module config
+ * @constructor
+ * @param config the reporting part of the config object
+ */
+function ReportingOptions(config) {
+ this.config = config;
+}
+
+/**
+ * returns the kind of information to be printed on the console. May be one
+ * of `summary`, `detail`, `both` or `none`. Used by the
+ * `cover` command.
+ * @method print
+ * @return {String} the kind of information to print to the console at the end
+ * of the `cover` command execution.
+ */
+/**
+ * returns a list of reports that should be generated at the end of a run. Used
+ * by the `cover` and `report` commands.
+ * @method reports
+ * @return {Array} an array of reports that should be produced
+ */
+/**
+ * returns the directory under which reports should be generated. Used by the
+ * `cover` and `report` commands.
+ *
+ * @method dir
+ * @return {String} the directory under which reports should be generated.
+ */
+/**
+ * returns an object that has keys that are report format names and values that are objects
+ * containing detailed configuration for each format. Running `istanbul help config`
+ * will give you all the keys per report format that can be overridden.
+ * Used by the `cover` and `report` commands.
+ * @method reportConfig
+ * @return {Object} detailed report configuration per report format.
+ */
+addMethods(ReportingOptions, 'print', 'reports', 'dir', 'reportConfig');
+
+function isInvalidMark(v, key) {
+ var prefix = 'Watermark for [' + key + '] :';
+
+ if (v.length !== 2) {
+ return prefix + 'must be an array of length 2';
+ }
+ v[0] = Number(v[0]);
+ v[1] = Number(v[1]);
+
+ if (isNaN(v[0]) || isNaN(v[1])) {
+ return prefix + 'must have valid numbers';
+ }
+ if (v[0] < 0 || v[1] < 0) {
+ return prefix + 'must be positive numbers';
+ }
+ if (v[1] > 100) {
+ return prefix + 'cannot exceed 100';
+ }
+ if (v[1] <= v[0]) {
+ return prefix + 'low must be less than high';
+ }
+ return null;
+}
+
+/**
+ * returns the low and high watermarks to be used to designate whether coverage
+ * is `low`, `medium` or `high`. Statements, functions, branches and lines can
+ * have independent watermarks. These are respected by all reports
+ * that color for low, medium and high coverage. See the default configuration for exact syntax
+ * using `istanbul help config`. Used by the `cover` and `report` commands.
+ *
+ * @method watermarks
+ * @return {Object} an object containing low and high watermarks for statements,
+ * branches, functions and lines.
+ */
+ReportingOptions.prototype.watermarks = function () {
+ var v = this.config.watermarks,
+ defs = defaults.watermarks(),
+ ret = {};
+
+ Object.keys(defs).forEach(function (k) {
+ var mark = v[k], //it will already be a non-zero length array because of the way the merge works
+ message = isInvalidMark(mark, k);
+ if (message) {
+ console.error(message);
+ ret[k] = defs[k];
+ } else {
+ ret[k] = mark;
+ }
+ });
+ return ret;
+};
+
+/**
+ * Object that returns hook options. Note that istanbul does not provide an
+ * option to hook `require`. This is always done by the `cover` command.
+ * @class HookOptions
+ * @module config
+ * @constructor
+ * @param config the hooks part of the config object
+ */
+function HookOptions(config) {
+ this.config = config;
+}
+
+/**
+ * returns if `vm.runInThisContext` needs to be hooked, in addition to the standard
+ * `require` hooks added by istanbul. This should be true for code that uses
+ * RequireJS for example. Used by the `cover` command.
+ * @method hookRunInContext
+ * @return {Boolean} true if `vm.runInThisContext` needs to be hooked for coverage
+ */
+/**
+ * returns a path to JS file or a dependent module that should be used for
+ * post-processing files after they have been required. See the `yui-istanbul` module for
+ * an example of a post-require hook. This particular hook modifies the yui loader when
+ * that file is required to add istanbul interceptors. Use by the `cover` command
+ *
+ * @method postRequireHook
+ * @return {String} a path to a JS file or the name of a node module that needs
+ * to be used as a `require` post-processor
+ */
+/**
+ * returns if istanbul needs to add a SIGINT (control-c, usually) handler to
+ * save coverage information. Useful for getting code coverage out of processes
+ * that run forever and need a SIGINT to terminate.
+ * @method handleSigint
+ * @return {Boolean} true if SIGINT needs to be hooked to write coverage information
+ */
+
+addMethods(HookOptions, 'hookRunInContext', 'postRequireHook', 'handleSigint');
+
+/**
+ * represents the istanbul configuration and provides sub-objects that can
+ * return instrumentation, reporting and hook options respectively.
+ * Usage
+ * -----
+ *
+ * var configObj = require('istanbul').config.loadFile();
+ *
+ * console.log(configObj.reporting.reports());
+ *
+ * @class Configuration
+ * @module config
+ * @param {Object} obj the base object to use as the configuration
+ * @param {Object} overrides optional - override attributes that are merged into
+ * the base config
+ * @constructor
+ */
+function Configuration(obj, overrides) {
+
+ var config = mergeDefaults(obj, defaultConfig(true));
+ if (isObject(overrides)) {
+ config = mergeDefaults(overrides, config);
+ }
+ if (config.verbose) {
+ console.error('Using configuration');
+ console.error('-------------------');
+ console.error(yaml.safeDump(config, { indent: 4, flowLevel: 3 }));
+ console.error('-------------------\n');
+ }
+ this.verbose = config.verbose;
+ this.instrumentation = new InstrumentOptions(config.instrumentation);
+ this.reporting = new ReportingOptions(config.reporting);
+ this.hooks = new HookOptions(config.hooks);
+ this.check = config.check; // Pass raw config sub-object.
+}
+
+/**
+ * true if verbose logging is required
+ * @property verbose
+ * @type Boolean
+ */
+/**
+ * instrumentation options
+ * @property instrumentation
+ * @type InstrumentOptions
+ */
+/**
+ * reporting options
+ * @property reporting
+ * @type ReportingOptions
+ */
+/**
+ * hook options
+ * @property hooks
+ * @type HookOptions
+ */
+
+
+function loadFile(file, overrides) {
+ var defaultConfigFile = path.resolve('.istanbul.yml'),
+ configObject;
+
+ if (file) {
+ if (!existsSync(file)) {
+ throw new Error('Invalid configuration file specified:' + file);
+ }
+ } else {
+ if (existsSync(defaultConfigFile)) {
+ file = defaultConfigFile;
+ }
+ }
+
+ if (file) {
+ console.error('Loading config: ' + file);
+ configObject = file.match(YML_PATTERN) ?
+ yaml.safeLoad(fs.readFileSync(file, 'utf8'), { filename: file }) :
+ require(path.resolve(file));
+ }
+
+ return new Configuration(configObject, overrides);
+}
+
+function loadObject(obj, overrides) {
+ return new Configuration(obj, overrides);
+}
+
+/**
+ * methods to load the configuration object.
+ * Usage
+ * -----
+ *
+ * var config = require('istanbul').config,
+ * configObj = config.loadFile();
+ *
+ * console.log(configObj.reporting.reports());
+ *
+ * @class Config
+ * @module main
+ * @static
+ */
+module.exports = {
+ /**
+ * loads the specified configuration file with optional overrides. Throws
+ * when a file is specified and it is not found.
+ * @method loadFile
+ * @static
+ * @param {String} file the file to load. If falsy, the default config file, if present, is loaded.
+ * If not a default config is used.
+ * @param {Object} overrides - an object with override keys that are merged into the
+ * config object loaded
+ * @return {Configuration} the config object with overrides applied
+ */
+ loadFile: loadFile,
+ /**
+ * loads the specified configuration object with optional overrides.
+ * @method loadObject
+ * @static
+ * @param {Object} obj the object to use as the base configuration.
+ * @param {Object} overrides - an object with override keys that are merged into the
+ * config object
+ * @return {Configuration} the config object with overrides applied
+ */
+ loadObject: loadObject,
+ /**
+ * returns the default configuration object. Note that this is a plain object
+ * and not a `Configuration` instance.
+ * @method defaultConfig
+ * @static
+ * @return {Object} an object that represents the default config
+ */
+ defaultConfig: defaultConfig
+};
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/hook.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/hook.js
new file mode 100644
index 00000000..4ec9dc52
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/hook.js
@@ -0,0 +1,198 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+/**
+ * provides a mechanism to transform code in the scope of `require` or `vm.createScript`.
+ * This mechanism is general and relies on a user-supplied `matcher` function that determines when transformations should be
+ * performed and a user-supplied `transformer` function that performs the actual transform.
+ * Instrumenting code for coverage is one specific example of useful hooking.
+ *
+ * Note that both the `matcher` and `transformer` must execute synchronously.
+ *
+ * For the common case of matching filesystem paths based on inclusion/ exclusion patterns, use the `matcherFor`
+ * function in the istanbul API to get a matcher.
+ *
+ * It is up to the transformer to perform processing with side-effects, such as caching, storing the original
+ * source code to disk in case of dynamically generated scripts etc. The `Store` class can help you with this.
+ *
+ * Usage
+ * -----
+ *
+ * var hook = require('istanbul').hook,
+ * myMatcher = function (file) { return file.match(/foo/); },
+ * myTransformer = function (code, file) { return 'console.log("' + file + '");' + code; };
+ *
+ * hook.hookRequire(myMatcher, myTransformer);
+ *
+ * var foo = require('foo'); //will now print foo's module path to console
+ *
+ * @class Hook
+ * @module main
+ */
+var path = require('path'),
+ fs = require('fs'),
+ Module = require('module'),
+ vm = require('vm'),
+ originalLoaders = {},
+ originalCreateScript = vm.createScript,
+ originalRunInThisContext = vm.runInThisContext;
+
+function transformFn(matcher, transformer, verbose) {
+
+ return function (code, filename) {
+ var shouldHook = typeof filename === 'string' && matcher(path.resolve(filename)),
+ transformed,
+ changed = false;
+
+ if (shouldHook) {
+ if (verbose) {
+ console.error('Module load hook: transform [' + filename + ']');
+ }
+ try {
+ transformed = transformer(code, filename);
+ changed = true;
+ } catch (ex) {
+ console.error('Transformation error; return original code');
+ console.error(ex);
+ transformed = code;
+ }
+ } else {
+ transformed = code;
+ }
+ return { code: transformed, changed: changed };
+ };
+}
+
+function unloadRequireCache(matcher) {
+ if (matcher && typeof require !== 'undefined' && require && require.cache) {
+ Object.keys(require.cache).forEach(function (filename) {
+ if (matcher(filename)) {
+ delete require.cache[filename];
+ }
+ });
+ }
+}
+/**
+ * hooks `require` to return transformed code to the node module loader.
+ * Exceptions in the transform result in the original code being used instead.
+ * @method hookRequire
+ * @static
+ * @param matcher {Function(filePath)} a function that is called with the absolute path to the file being
+ * `require`-d. Should return a truthy value when transformations need to be applied to the code, a falsy value otherwise
+ * @param transformer {Function(code, filePath)} a function called with the original code and the associated path of the file
+ * from where the code was loaded. Should return the transformed code.
+ * @param options {Object} options Optional.
+ * @param {Boolean} [options.verbose] write a line to standard error every time the transformer is called
+ * @param {Function} [options.postLoadHook] a function that is called with the name of the file being
+ * required. This is called after the require is processed irrespective of whether it was transformed.
+ */
+function hookRequire(matcher, transformer, options) {
+ options = options || {};
+ var extensions,
+ fn = transformFn(matcher, transformer, options.verbose),
+ postLoadHook = options.postLoadHook &&
+ typeof options.postLoadHook === 'function' ? options.postLoadHook : null;
+
+ extensions = options.extensions || ['.js'];
+
+ extensions.forEach(function(ext){
+ if (!(ext in originalLoaders)) {
+ originalLoaders[ext] = Module._extensions[ext] || Module._extensions['.js'];
+ }
+ Module._extensions[ext] = function (module, filename) {
+ var ret = fn(fs.readFileSync(filename, 'utf8'), filename);
+ if (ret.changed) {
+ module._compile(ret.code, filename);
+ } else {
+ originalLoaders[ext](module, filename);
+ }
+ if (postLoadHook) {
+ postLoadHook(filename);
+ }
+ };
+ });
+}
+/**
+ * unhook `require` to restore it to its original state.
+ * @method unhookRequire
+ * @static
+ */
+function unhookRequire() {
+ Object.keys(originalLoaders).forEach(function(ext) {
+ Module._extensions[ext] = originalLoaders[ext];
+ });
+}
+/**
+ * hooks `vm.createScript` to return transformed code out of which a `Script` object will be created.
+ * Exceptions in the transform result in the original code being used instead.
+ * @method hookCreateScript
+ * @static
+ * @param matcher {Function(filePath)} a function that is called with the filename passed to `vm.createScript`
+ * Should return a truthy value when transformations need to be applied to the code, a falsy value otherwise
+ * @param transformer {Function(code, filePath)} a function called with the original code and the filename passed to
+ * `vm.createScript`. Should return the transformed code.
+ * @param options {Object} options Optional.
+ * @param {Boolean} [options.verbose] write a line to standard error every time the transformer is called
+ */
+function hookCreateScript(matcher, transformer, opts) {
+ opts = opts || {};
+ var fn = transformFn(matcher, transformer, opts.verbose);
+ vm.createScript = function (code, file) {
+ var ret = fn(code, file);
+ return originalCreateScript(ret.code, file);
+ };
+}
+
+/**
+ * unhooks vm.createScript, restoring it to its original state.
+ * @method unhookCreateScript
+ * @static
+ */
+function unhookCreateScript() {
+ vm.createScript = originalCreateScript;
+}
+
+
+/**
+ * hooks `vm.runInThisContext` to return transformed code.
+ * @method hookRunInThisContext
+ * @static
+ * @param matcher {Function(filePath)} a function that is called with the filename passed to `vm.createScript`
+ * Should return a truthy value when transformations need to be applied to the code, a falsy value otherwise
+ * @param transformer {Function(code, filePath)} a function called with the original code and the filename passed to
+ * `vm.createScript`. Should return the transformed code.
+ * @param options {Object} options Optional.
+ * @param {Boolean} [options.verbose] write a line to standard error every time the transformer is called
+ */
+function hookRunInThisContext(matcher, transformer, opts) {
+ opts = opts || {};
+ var fn = transformFn(matcher, transformer, opts.verbose);
+ vm.runInThisContext = function (code, file) {
+ var ret = fn(code, file);
+ return originalRunInThisContext(ret.code, file);
+ };
+}
+
+/**
+ * unhooks vm.runInThisContext, restoring it to its original state.
+ * @method unhookRunInThisContext
+ * @static
+ */
+function unhookRunInThisContext() {
+ vm.runInThisContext = originalRunInThisContext;
+}
+
+
+module.exports = {
+ hookRequire: hookRequire,
+ unhookRequire: unhookRequire,
+ hookCreateScript: hookCreateScript,
+ unhookCreateScript: unhookCreateScript,
+ hookRunInThisContext : hookRunInThisContext,
+ unhookRunInThisContext : unhookRunInThisContext,
+ unloadRequireCache: unloadRequireCache
+};
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/instrumenter.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/instrumenter.js
new file mode 100644
index 00000000..122342ad
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/instrumenter.js
@@ -0,0 +1,1040 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+/*global esprima, escodegen, window */
+(function (isNode) {
+ "use strict";
+ var SYNTAX,
+ nodeType,
+ ESP = isNode ? require('esprima') : esprima,
+ ESPGEN = isNode ? require('escodegen') : escodegen, //TODO - package as dependency
+ crypto = isNode ? require('crypto') : null,
+ LEADER_WRAP = '(function () { ',
+ TRAILER_WRAP = '\n}());',
+ COMMENT_RE = /^\s*istanbul\s+ignore\s+(if|else|next)(?=\W|$)/,
+ astgen,
+ preconditions,
+ cond,
+ isArray = Array.isArray;
+
+ /* istanbul ignore if: untestable */
+ if (!isArray) {
+ isArray = function (thing) { return thing && Object.prototype.toString.call(thing) === '[object Array]'; };
+ }
+
+ if (!isNode) {
+ preconditions = {
+ 'Could not find esprima': ESP,
+ 'Could not find escodegen': ESPGEN,
+ 'JSON object not in scope': JSON,
+ 'Array does not implement push': [].push,
+ 'Array does not implement unshift': [].unshift
+ };
+ /* istanbul ignore next: untestable */
+ for (cond in preconditions) {
+ if (preconditions.hasOwnProperty(cond)) {
+ if (!preconditions[cond]) { throw new Error(cond); }
+ }
+ }
+ }
+
+ function generateTrackerVar(filename, omitSuffix) {
+ var hash, suffix;
+ if (crypto !== null) {
+ hash = crypto.createHash('md5');
+ hash.update(filename);
+ suffix = hash.digest('base64');
+ //trim trailing equal signs, turn identifier unsafe chars to safe ones + => _ and / => $
+ suffix = suffix.replace(new RegExp('=', 'g'), '')
+ .replace(new RegExp('\\+', 'g'), '_')
+ .replace(new RegExp('/', 'g'), '$');
+ } else {
+ window.__cov_seq = window.__cov_seq || 0;
+ window.__cov_seq += 1;
+ suffix = window.__cov_seq;
+ }
+ return '__cov_' + (omitSuffix ? '' : suffix);
+ }
+
+ function pushAll(ary, thing) {
+ if (!isArray(thing)) {
+ thing = [ thing ];
+ }
+ Array.prototype.push.apply(ary, thing);
+ }
+
+ SYNTAX = {
+ // keep in sync with estraverse's VisitorKeys
+ AssignmentExpression: ['left', 'right'],
+ AssignmentPattern: ['left', 'right'],
+ ArrayExpression: ['elements'],
+ ArrayPattern: ['elements'],
+ ArrowFunctionExpression: ['params', 'body'],
+ AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
+ BlockStatement: ['body'],
+ BinaryExpression: ['left', 'right'],
+ BreakStatement: ['label'],
+ CallExpression: ['callee', 'arguments'],
+ CatchClause: ['param', 'body'],
+ ClassBody: ['body'],
+ ClassDeclaration: ['id', 'superClass', 'body'],
+ ClassExpression: ['id', 'superClass', 'body'],
+ ComprehensionBlock: ['left', 'right'], // CAUTION: It's deferred to ES7.
+ ComprehensionExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
+ ConditionalExpression: ['test', 'consequent', 'alternate'],
+ ContinueStatement: ['label'],
+ DebuggerStatement: [],
+ DirectiveStatement: [],
+ DoWhileStatement: ['body', 'test'],
+ EmptyStatement: [],
+ ExportAllDeclaration: ['source'],
+ ExportDefaultDeclaration: ['declaration'],
+ ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
+ ExportSpecifier: ['exported', 'local'],
+ ExpressionStatement: ['expression'],
+ ForStatement: ['init', 'test', 'update', 'body'],
+ ForInStatement: ['left', 'right', 'body'],
+ ForOfStatement: ['left', 'right', 'body'],
+ FunctionDeclaration: ['id', 'params', 'body'],
+ FunctionExpression: ['id', 'params', 'body'],
+ GeneratorExpression: ['blocks', 'filter', 'body'], // CAUTION: It's deferred to ES7.
+ Identifier: [],
+ IfStatement: ['test', 'consequent', 'alternate'],
+ ImportDeclaration: ['specifiers', 'source'],
+ ImportDefaultSpecifier: ['local'],
+ ImportNamespaceSpecifier: ['local'],
+ ImportSpecifier: ['imported', 'local'],
+ Literal: [],
+ LabeledStatement: ['label', 'body'],
+ LogicalExpression: ['left', 'right'],
+ MemberExpression: ['object', 'property'],
+ MethodDefinition: ['key', 'value'],
+ ModuleSpecifier: [],
+ NewExpression: ['callee', 'arguments'],
+ ObjectExpression: ['properties'],
+ ObjectPattern: ['properties'],
+ Program: ['body'],
+ Property: ['key', 'value'],
+ RestElement: [ 'argument' ],
+ ReturnStatement: ['argument'],
+ SequenceExpression: ['expressions'],
+ SpreadElement: ['argument'],
+ Super: [],
+ SwitchStatement: ['discriminant', 'cases'],
+ SwitchCase: ['test', 'consequent'],
+ TaggedTemplateExpression: ['tag', 'quasi'],
+ TemplateElement: [],
+ TemplateLiteral: ['quasis', 'expressions'],
+ ThisExpression: [],
+ ThrowStatement: ['argument'],
+ TryStatement: ['block', 'handler', 'finalizer'],
+ UnaryExpression: ['argument'],
+ UpdateExpression: ['argument'],
+ VariableDeclaration: ['declarations'],
+ VariableDeclarator: ['id', 'init'],
+ WhileStatement: ['test', 'body'],
+ WithStatement: ['object', 'body'],
+ YieldExpression: ['argument']
+ };
+
+ for (nodeType in SYNTAX) {
+ /* istanbul ignore else: has own property */
+ if (SYNTAX.hasOwnProperty(nodeType)) {
+ SYNTAX[nodeType] = { name: nodeType, children: SYNTAX[nodeType] };
+ }
+ }
+
+ astgen = {
+ variable: function (name) { return { type: SYNTAX.Identifier.name, name: name }; },
+ stringLiteral: function (str) { return { type: SYNTAX.Literal.name, value: String(str) }; },
+ numericLiteral: function (num) { return { type: SYNTAX.Literal.name, value: Number(num) }; },
+ statement: function (contents) { return { type: SYNTAX.ExpressionStatement.name, expression: contents }; },
+ dot: function (obj, field) { return { type: SYNTAX.MemberExpression.name, computed: false, object: obj, property: field }; },
+ subscript: function (obj, sub) { return { type: SYNTAX.MemberExpression.name, computed: true, object: obj, property: sub }; },
+ postIncrement: function (obj) { return { type: SYNTAX.UpdateExpression.name, operator: '++', prefix: false, argument: obj }; },
+ sequence: function (one, two) { return { type: SYNTAX.SequenceExpression.name, expressions: [one, two] }; },
+ returnStatement: function (expr) { return { type: SYNTAX.ReturnStatement.name, argument: expr }; }
+ };
+
+ function Walker(walkMap, preprocessor, scope, debug) {
+ this.walkMap = walkMap;
+ this.preprocessor = preprocessor;
+ this.scope = scope;
+ this.debug = debug;
+ if (this.debug) {
+ this.level = 0;
+ this.seq = true;
+ }
+ }
+
+ function defaultWalker(node, walker) {
+
+ var type = node.type,
+ preprocessor,
+ postprocessor,
+ children = SYNTAX[type],
+ // don't run generated nodes thru custom walks otherwise we will attempt to instrument the instrumentation code :)
+ applyCustomWalker = !!node.loc || node.type === SYNTAX.Program.name,
+ walkerFn = applyCustomWalker ? walker.walkMap[type] : null,
+ i,
+ j,
+ walkFnIndex,
+ childType,
+ childNode,
+ ret,
+ childArray,
+ childElement,
+ pathElement,
+ assignNode,
+ isLast;
+
+ if (!SYNTAX[type]) {
+ console.error(node);
+ console.error('Unsupported node type:' + type);
+ return;
+ }
+ children = SYNTAX[type].children;
+ /* istanbul ignore if: guard */
+ if (node.walking) { throw new Error('Infinite regress: Custom walkers may NOT call walker.apply(node)'); }
+ node.walking = true;
+
+ ret = walker.apply(node, walker.preprocessor);
+
+ preprocessor = ret.preprocessor;
+ if (preprocessor) {
+ delete ret.preprocessor;
+ ret = walker.apply(node, preprocessor);
+ }
+
+ if (isArray(walkerFn)) {
+ for (walkFnIndex = 0; walkFnIndex < walkerFn.length; walkFnIndex += 1) {
+ isLast = walkFnIndex === walkerFn.length - 1;
+ ret = walker.apply(ret, walkerFn[walkFnIndex]);
+ /*istanbul ignore next: paranoid check */
+ if (ret.type !== type && !isLast) {
+ throw new Error('Only the last walker is allowed to change the node type: [type was: ' + type + ' ]');
+ }
+ }
+ } else {
+ if (walkerFn) {
+ ret = walker.apply(node, walkerFn);
+ }
+ }
+
+ for (i = 0; i < children.length; i += 1) {
+ childType = children[i];
+ childNode = node[childType];
+ if (childNode && !childNode.skipWalk) {
+ pathElement = { node: node, property: childType };
+ if (isArray(childNode)) {
+ childArray = [];
+ for (j = 0; j < childNode.length; j += 1) {
+ childElement = childNode[j];
+ pathElement.index = j;
+ if (childElement) {
+ assignNode = walker.apply(childElement, null, pathElement);
+ if (isArray(assignNode.prepend)) {
+ pushAll(childArray, assignNode.prepend);
+ delete assignNode.prepend;
+ }
+ } else {
+ assignNode = undefined;
+ }
+ pushAll(childArray, assignNode);
+ }
+ node[childType] = childArray;
+ } else {
+ assignNode = walker.apply(childNode, null, pathElement);
+ /*istanbul ignore if: paranoid check */
+ if (isArray(assignNode.prepend)) {
+ throw new Error('Internal error: attempt to prepend statements in disallowed (non-array) context');
+ /* if this should be allowed, this is how to solve it
+ tmpNode = { type: 'BlockStatement', body: [] };
+ pushAll(tmpNode.body, assignNode.prepend);
+ pushAll(tmpNode.body, assignNode);
+ node[childType] = tmpNode;
+ delete assignNode.prepend;
+ */
+ } else {
+ node[childType] = assignNode;
+ }
+ }
+ }
+ }
+
+ postprocessor = ret.postprocessor;
+ if (postprocessor) {
+ delete ret.postprocessor;
+ ret = walker.apply(ret, postprocessor);
+ }
+
+ delete node.walking;
+
+ return ret;
+ }
+
+ Walker.prototype = {
+ startWalk: function (node) {
+ this.path = [];
+ this.apply(node);
+ },
+
+ apply: function (node, walkFn, pathElement) {
+ var ret, i, seq, prefix;
+
+ walkFn = walkFn || defaultWalker;
+ if (this.debug) {
+ this.seq += 1;
+ this.level += 1;
+ seq = this.seq;
+ prefix = '';
+ for (i = 0; i < this.level; i += 1) { prefix += ' '; }
+ console.log(prefix + 'Enter (' + seq + '):' + node.type);
+ }
+ if (pathElement) { this.path.push(pathElement); }
+ ret = walkFn.call(this.scope, node, this);
+ if (pathElement) { this.path.pop(); }
+ if (this.debug) {
+ this.level -= 1;
+ console.log(prefix + 'Return (' + seq + '):' + node.type);
+ }
+ return ret || node;
+ },
+
+ startLineForNode: function (node) {
+ return node && node.loc && node.loc.start ? node.loc.start.line : /* istanbul ignore next: guard */ null;
+ },
+
+ ancestor: function (n) {
+ return this.path.length > n - 1 ? this.path[this.path.length - n] : /* istanbul ignore next: guard */ null;
+ },
+
+ parent: function () {
+ return this.ancestor(1);
+ },
+
+ isLabeled: function () {
+ var el = this.parent();
+ return el && el.node.type === SYNTAX.LabeledStatement.name;
+ }
+ };
+
+ /**
+ * mechanism to instrument code for coverage. It uses the `esprima` and
+ * `escodegen` libraries for JS parsing and code generation respectively.
+ *
+ * Works on `node` as well as the browser.
+ *
+ * Usage on nodejs
+ * ---------------
+ *
+ * var instrumenter = new require('istanbul').Instrumenter(),
+ * changed = instrumenter.instrumentSync('function meaningOfLife() { return 42; }', 'filename.js');
+ *
+ * Usage in a browser
+ * ------------------
+ *
+ * Load `esprima.js`, `escodegen.js` and `instrumenter.js` (this file) using `script` tags or other means.
+ *
+ * Create an instrumenter object as:
+ *
+ * var instrumenter = new Instrumenter(),
+ * changed = instrumenter.instrumentSync('function meaningOfLife() { return 42; }', 'filename.js');
+ *
+ * Aside from demonstration purposes, it is unclear why you would want to instrument code in a browser.
+ *
+ * @class Instrumenter
+ * @constructor
+ * @param {Object} options Optional. Configuration options.
+ * @param {String} [options.coverageVariable] the global variable name to use for
+ * tracking coverage. Defaults to `__coverage__`
+ * @param {Boolean} [options.embedSource] whether to embed the source code of every
+ * file as an array in the file coverage object for that file. Defaults to `false`
+ * @param {Boolean} [options.preserveComments] whether comments should be preserved in the output. Defaults to `false`
+ * @param {Boolean} [options.noCompact] emit readable code when set. Defaults to `false`
+ * @param {Boolean} [options.noAutoWrap] do not automatically wrap the source in
+ * an anonymous function before covering it. By default, code is wrapped in
+ * an anonymous function before it is parsed. This is done because
+ * some nodejs libraries have `return` statements outside of
+ * a function which is technically invalid Javascript and causes the parser to fail.
+ * This construct, however, works correctly in node since module loading
+ * is done in the context of an anonymous function.
+ *
+ * Note that the semantics of the code *returned* by the instrumenter does not change in any way.
+ * The function wrapper is "unwrapped" before the instrumented code is generated.
+ * @param {Object} [options.codeGenerationOptions] an object that is directly passed to the `escodegen`
+ * library as configuration for code generation. The `noCompact` setting is not honored when this
+ * option is specified
+ * @param {Boolean} [options.debug] assist in debugging. Currently, the only effect of
+ * setting this option is a pretty-print of the coverage variable. Defaults to `false`
+ * @param {Boolean} [options.walkDebug] assist in debugging of the AST walker used by this class.
+ *
+ */
+ function Instrumenter(options) {
+ this.opts = options || {
+ debug: false,
+ walkDebug: false,
+ coverageVariable: '__coverage__',
+ codeGenerationOptions: undefined,
+ noAutoWrap: false,
+ noCompact: false,
+ embedSource: false,
+ preserveComments: false
+ };
+
+ this.walker = new Walker({
+ ArrowFunctionExpression: [ this.arrowBlockConverter ],
+ ExpressionStatement: this.coverStatement,
+ BreakStatement: this.coverStatement,
+ ContinueStatement: this.coverStatement,
+ DebuggerStatement: this.coverStatement,
+ ReturnStatement: this.coverStatement,
+ ThrowStatement: this.coverStatement,
+ TryStatement: [ this.paranoidHandlerCheck, this.coverStatement],
+ VariableDeclaration: this.coverStatement,
+ IfStatement: [ this.ifBlockConverter, this.coverStatement, this.ifBranchInjector ],
+ ForStatement: [ this.skipInit, this.loopBlockConverter, this.coverStatement ],
+ ForInStatement: [ this.skipLeft, this.loopBlockConverter, this.coverStatement ],
+ ForOfStatement: [ this.skipLeft, this.loopBlockConverter, this.coverStatement ],
+ WhileStatement: [ this.loopBlockConverter, this.coverStatement ],
+ DoWhileStatement: [ this.loopBlockConverter, this.coverStatement ],
+ SwitchStatement: [ this.coverStatement, this.switchBranchInjector ],
+ SwitchCase: [ this.switchCaseInjector ],
+ WithStatement: [ this.withBlockConverter, this.coverStatement ],
+ FunctionDeclaration: [ this.coverFunction, this.coverStatement ],
+ FunctionExpression: this.coverFunction,
+ LabeledStatement: this.coverStatement,
+ ConditionalExpression: this.conditionalBranchInjector,
+ LogicalExpression: this.logicalExpressionBranchInjector,
+ ObjectExpression: this.maybeAddType
+ }, this.extractCurrentHint, this, this.opts.walkDebug);
+
+ //unit testing purposes only
+ if (this.opts.backdoor && this.opts.backdoor.omitTrackerSuffix) {
+ this.omitTrackerSuffix = true;
+ }
+ }
+
+ Instrumenter.prototype = {
+ /**
+ * synchronous instrumentation method. Throws when illegal code is passed to it
+ * @method instrumentSync
+ * @param {String} code the code to be instrumented as a String
+ * @param {String} filename Optional. The name of the file from which
+ * the code was read. A temporary filename is generated when not specified.
+ * Not specifying a filename is only useful for unit tests and demonstrations
+ * of this library.
+ */
+ instrumentSync: function (code, filename) {
+ var program;
+
+ //protect from users accidentally passing in a Buffer object instead
+ if (typeof code !== 'string') { throw new Error('Code must be string'); }
+ if (code.charAt(0) === '#') { //shebang, 'comment' it out, won't affect syntax tree locations for things we care about
+ code = '//' + code;
+ }
+ if (!this.opts.noAutoWrap) {
+ code = LEADER_WRAP + code + TRAILER_WRAP;
+ }
+ program = ESP.parse(code, {
+ loc: true,
+ range: true,
+ tokens: this.opts.preserveComments,
+ comment: true
+ });
+ if (this.opts.preserveComments) {
+ program = ESPGEN.attachComments(program, program.comments, program.tokens);
+ }
+ if (!this.opts.noAutoWrap) {
+ program = {
+ type: SYNTAX.Program.name,
+ body: program.body[0].expression.callee.body.body,
+ comments: program.comments
+ };
+ }
+ return this.instrumentASTSync(program, filename, code);
+ },
+ filterHints: function (comments) {
+ var ret = [],
+ i,
+ comment,
+ groups;
+ if (!(comments && isArray(comments))) {
+ return ret;
+ }
+ for (i = 0; i < comments.length; i += 1) {
+ comment = comments[i];
+ /* istanbul ignore else: paranoid check */
+ if (comment && comment.value && comment.range && isArray(comment.range)) {
+ groups = String(comment.value).match(COMMENT_RE);
+ if (groups) {
+ ret.push({ type: groups[1], start: comment.range[0], end: comment.range[1] });
+ }
+ }
+ }
+ return ret;
+ },
+ extractCurrentHint: function (node) {
+ if (!node.range) { return; }
+ var i = this.currentState.lastHintPosition + 1,
+ hints = this.currentState.hints,
+ nodeStart = node.range[0],
+ hint;
+ this.currentState.currentHint = null;
+ while (i < hints.length) {
+ hint = hints[i];
+ if (hint.end < nodeStart) {
+ this.currentState.currentHint = hint;
+ this.currentState.lastHintPosition = i;
+ i += 1;
+ } else {
+ break;
+ }
+ }
+ },
+ /**
+ * synchronous instrumentation method that instruments an AST instead.
+ * @method instrumentASTSync
+ * @param {String} program the AST to be instrumented
+ * @param {String} filename Optional. The name of the file from which
+ * the code was read. A temporary filename is generated when not specified.
+ * Not specifying a filename is only useful for unit tests and demonstrations
+ * of this library.
+ * @param {String} originalCode the original code corresponding to the AST,
+ * used for embedding the source into the coverage object
+ */
+ instrumentASTSync: function (program, filename, originalCode) {
+ var usingStrict = false,
+ codegenOptions,
+ generated,
+ preamble,
+ lineCount,
+ i;
+ filename = filename || String(new Date().getTime()) + '.js';
+ this.sourceMap = null;
+ this.coverState = {
+ path: filename,
+ s: {},
+ b: {},
+ f: {},
+ fnMap: {},
+ statementMap: {},
+ branchMap: {}
+ };
+ this.currentState = {
+ trackerVar: generateTrackerVar(filename, this.omitTrackerSuffix),
+ func: 0,
+ branch: 0,
+ variable: 0,
+ statement: 0,
+ hints: this.filterHints(program.comments),
+ currentHint: null,
+ lastHintPosition: -1,
+ ignoring: 0
+ };
+ if (program.body && program.body.length > 0 && this.isUseStrictExpression(program.body[0])) {
+ //nuke it
+ program.body.shift();
+ //and add it back at code generation time
+ usingStrict = true;
+ }
+ this.walker.startWalk(program);
+ codegenOptions = this.opts.codeGenerationOptions || { format: { compact: !this.opts.noCompact }};
+ codegenOptions.comment = this.opts.preserveComments;
+ //console.log(JSON.stringify(program, undefined, 2));
+
+ generated = ESPGEN.generate(program, codegenOptions);
+ preamble = this.getPreamble(originalCode || '', usingStrict);
+
+ if (generated.map && generated.code) {
+ lineCount = preamble.split(/\r\n|\r|\n/).length;
+ // offset all the generated line numbers by the number of lines in the preamble
+ for (i = 0; i < generated.map._mappings._array.length; i += 1) {
+ generated.map._mappings._array[i].generatedLine += lineCount;
+ }
+ this.sourceMap = generated.map;
+ generated = generated.code;
+ }
+
+ return preamble + '\n' + generated + '\n';
+ },
+ /**
+ * Callback based instrumentation. Note that this still executes synchronously in the same process tick
+ * and calls back immediately. It only provides the options for callback style error handling as
+ * opposed to a `try-catch` style and nothing more. Implemented as a wrapper over `instrumentSync`
+ *
+ * @method instrument
+ * @param {String} code the code to be instrumented as a String
+ * @param {String} filename Optional. The name of the file from which
+ * the code was read. A temporary filename is generated when not specified.
+ * Not specifying a filename is only useful for unit tests and demonstrations
+ * of this library.
+ * @param {Function(err, instrumentedCode)} callback - the callback function
+ */
+ instrument: function (code, filename, callback) {
+
+ if (!callback && typeof filename === 'function') {
+ callback = filename;
+ filename = null;
+ }
+ try {
+ callback(null, this.instrumentSync(code, filename));
+ } catch (ex) {
+ callback(ex);
+ }
+ },
+ /**
+ * returns the file coverage object for the code that was instrumented
+ * just before calling this method. Note that this represents a
+ * "zero-coverage" object which is not even representative of the code
+ * being loaded in node or a browser (which would increase the statement
+ * counts for mainline code).
+ * @method lastFileCoverage
+ * @return {Object} a "zero-coverage" file coverage object for the code last instrumented
+ * by this instrumenter
+ */
+ lastFileCoverage: function () {
+ return this.coverState;
+ },
+ /**
+ * returns the source map object for the code that was instrumented
+ * just before calling this method.
+ * @method lastSourceMap
+ * @return {Object} a source map object for the code last instrumented
+ * by this instrumenter
+ */
+ lastSourceMap: function () {
+ return this.sourceMap;
+ },
+ fixColumnPositions: function (coverState) {
+ var offset = LEADER_WRAP.length,
+ fixer = function (loc) {
+ if (loc.start.line === 1) {
+ loc.start.column -= offset;
+ }
+ if (loc.end.line === 1) {
+ loc.end.column -= offset;
+ }
+ },
+ k,
+ obj,
+ i,
+ locations;
+
+ obj = coverState.statementMap;
+ for (k in obj) {
+ /* istanbul ignore else: has own property */
+ if (obj.hasOwnProperty(k)) { fixer(obj[k]); }
+ }
+ obj = coverState.fnMap;
+ for (k in obj) {
+ /* istanbul ignore else: has own property */
+ if (obj.hasOwnProperty(k)) { fixer(obj[k].loc); }
+ }
+ obj = coverState.branchMap;
+ for (k in obj) {
+ /* istanbul ignore else: has own property */
+ if (obj.hasOwnProperty(k)) {
+ locations = obj[k].locations;
+ for (i = 0; i < locations.length; i += 1) {
+ fixer(locations[i]);
+ }
+ }
+ }
+ },
+
+ getPreamble: function (sourceCode, emitUseStrict) {
+ var varName = this.opts.coverageVariable || '__coverage__',
+ file = this.coverState.path.replace(/\\/g, '\\\\'),
+ tracker = this.currentState.trackerVar,
+ coverState,
+ strictLine = emitUseStrict ? '"use strict";' : '',
+ // return replacements using the function to ensure that the replacement is
+ // treated like a dumb string and not as a string with RE replacement patterns
+ replacer = function (s) {
+ return function () { return s; };
+ },
+ code;
+ if (!this.opts.noAutoWrap) {
+ this.fixColumnPositions(this.coverState);
+ }
+ if (this.opts.embedSource) {
+ this.coverState.code = sourceCode.split(/(?:\r?\n)|\r/);
+ }
+ coverState = this.opts.debug ? JSON.stringify(this.coverState, undefined, 4) : JSON.stringify(this.coverState);
+ code = [
+ "%STRICT%",
+ "var %VAR% = (Function('return this'))();",
+ "if (!%VAR%.%GLOBAL%) { %VAR%.%GLOBAL% = {}; }",
+ "%VAR% = %VAR%.%GLOBAL%;",
+ "if (!(%VAR%['%FILE%'])) {",
+ " %VAR%['%FILE%'] = %OBJECT%;",
+ "}",
+ "%VAR% = %VAR%['%FILE%'];"
+ ].join("\n")
+ .replace(/%STRICT%/g, replacer(strictLine))
+ .replace(/%VAR%/g, replacer(tracker))
+ .replace(/%GLOBAL%/g, replacer(varName))
+ .replace(/%FILE%/g, replacer(file))
+ .replace(/%OBJECT%/g, replacer(coverState));
+ return code;
+ },
+
+ startIgnore: function () {
+ this.currentState.ignoring += 1;
+ },
+
+ endIgnore: function () {
+ this.currentState.ignoring -= 1;
+ },
+
+ convertToBlock: function (node) {
+ if (!node) {
+ return { type: 'BlockStatement', body: [] };
+ } else if (node.type === 'BlockStatement') {
+ return node;
+ } else {
+ return { type: 'BlockStatement', body: [ node ] };
+ }
+ },
+
+ arrowBlockConverter: function (node) {
+ var retStatement;
+ if (node.expression) { // turn expression nodes into a block with a return statement
+ retStatement = astgen.returnStatement(node.body);
+ // ensure the generated return statement is covered
+ retStatement.loc = node.body.loc;
+ node.body = this.convertToBlock(retStatement);
+ node.expression = false;
+ }
+ },
+
+ paranoidHandlerCheck: function (node) {
+ // if someone is using an older esprima on the browser
+ // convert handlers array to single handler attribute
+ // containing its first element
+ /* istanbul ignore next */
+ if (!node.handler && node.handlers) {
+ node.handler = node.handlers[0];
+ }
+ },
+
+ ifBlockConverter: function (node) {
+ node.consequent = this.convertToBlock(node.consequent);
+ node.alternate = this.convertToBlock(node.alternate);
+ },
+
+ loopBlockConverter: function (node) {
+ node.body = this.convertToBlock(node.body);
+ },
+
+ withBlockConverter: function (node) {
+ node.body = this.convertToBlock(node.body);
+ },
+
+ statementName: function (location, initValue) {
+ var sName,
+ ignoring = !!this.currentState.ignoring;
+
+ location.skip = ignoring || undefined;
+ initValue = initValue || 0;
+ this.currentState.statement += 1;
+ sName = this.currentState.statement;
+ this.coverState.statementMap[sName] = location;
+ this.coverState.s[sName] = initValue;
+ return sName;
+ },
+
+ skipInit: function (node /*, walker */) {
+ if (node.init) {
+ node.init.skipWalk = true;
+ }
+ },
+
+ skipLeft: function (node /*, walker */) {
+ node.left.skipWalk = true;
+ },
+
+ isUseStrictExpression: function (node) {
+ return node && node.type === SYNTAX.ExpressionStatement.name &&
+ node.expression && node.expression.type === SYNTAX.Literal.name &&
+ node.expression.value === 'use strict';
+ },
+
+ maybeSkipNode: function (node, type) {
+ var alreadyIgnoring = !!this.currentState.ignoring,
+ hint = this.currentState.currentHint,
+ ignoreThis = !alreadyIgnoring && hint && hint.type === type;
+
+ if (ignoreThis) {
+ this.startIgnore();
+ node.postprocessor = this.endIgnore;
+ return true;
+ }
+ return false;
+ },
+
+ coverStatement: function (node, walker) {
+ var sName,
+ incrStatementCount,
+ grandParent;
+
+ this.maybeSkipNode(node, 'next');
+
+ if (this.isUseStrictExpression(node)) {
+ grandParent = walker.ancestor(2);
+ /* istanbul ignore else: difficult to test */
+ if (grandParent) {
+ if ((grandParent.node.type === SYNTAX.FunctionExpression.name ||
+ grandParent.node.type === SYNTAX.FunctionDeclaration.name) &&
+ walker.parent().node.body[0] === node) {
+ return;
+ }
+ }
+ }
+ if (node.type === SYNTAX.FunctionDeclaration.name) {
+ sName = this.statementName(node.loc, 1);
+ } else {
+ sName = this.statementName(node.loc);
+ incrStatementCount = astgen.statement(
+ astgen.postIncrement(
+ astgen.subscript(
+ astgen.dot(astgen.variable(this.currentState.trackerVar), astgen.variable('s')),
+ astgen.stringLiteral(sName)
+ )
+ )
+ );
+ this.splice(incrStatementCount, node, walker);
+ }
+ },
+
+ splice: function (statements, node, walker) {
+ var targetNode = walker.isLabeled() ? walker.parent().node : node;
+ targetNode.prepend = targetNode.prepend || [];
+ pushAll(targetNode.prepend, statements);
+ },
+
+ functionName: function (node, line, location) {
+ this.currentState.func += 1;
+ var id = this.currentState.func,
+ ignoring = !!this.currentState.ignoring,
+ name = node.id ? node.id.name : '(anonymous_' + id + ')',
+ clone = function (attr) {
+ var obj = location[attr] || /* istanbul ignore next */ {};
+ return { line: obj.line, column: obj.column };
+ };
+ this.coverState.fnMap[id] = {
+ name: name, line: line,
+ loc: {
+ start: clone('start'),
+ end: clone('end')
+ },
+ skip: ignoring || undefined
+ };
+ this.coverState.f[id] = 0;
+ return id;
+ },
+
+ coverFunction: function (node, walker) {
+ var id,
+ body = node.body,
+ blockBody = body.body,
+ popped;
+
+ this.maybeSkipNode(node, 'next');
+
+ id = this.functionName(node, walker.startLineForNode(node), {
+ start: node.loc.start,
+ end: { line: node.body.loc.start.line, column: node.body.loc.start.column }
+ });
+
+ if (blockBody.length > 0 && this.isUseStrictExpression(blockBody[0])) {
+ popped = blockBody.shift();
+ }
+ blockBody.unshift(
+ astgen.statement(
+ astgen.postIncrement(
+ astgen.subscript(
+ astgen.dot(astgen.variable(this.currentState.trackerVar), astgen.variable('f')),
+ astgen.stringLiteral(id)
+ )
+ )
+ )
+ );
+ if (popped) {
+ blockBody.unshift(popped);
+ }
+ },
+
+ branchName: function (type, startLine, pathLocations) {
+ var bName,
+ paths = [],
+ locations = [],
+ i,
+ ignoring = !!this.currentState.ignoring;
+ this.currentState.branch += 1;
+ bName = this.currentState.branch;
+ for (i = 0; i < pathLocations.length; i += 1) {
+ pathLocations[i].skip = pathLocations[i].skip || ignoring || undefined;
+ locations.push(pathLocations[i]);
+ paths.push(0);
+ }
+ this.coverState.b[bName] = paths;
+ this.coverState.branchMap[bName] = { line: startLine, type: type, locations: locations };
+ return bName;
+ },
+
+ branchIncrementExprAst: function (varName, branchIndex, down) {
+ var ret = astgen.postIncrement(
+ astgen.subscript(
+ astgen.subscript(
+ astgen.dot(astgen.variable(this.currentState.trackerVar), astgen.variable('b')),
+ astgen.stringLiteral(varName)
+ ),
+ astgen.numericLiteral(branchIndex)
+ ),
+ down
+ );
+ return ret;
+ },
+
+ locationsForNodes: function (nodes) {
+ var ret = [],
+ i;
+ for (i = 0; i < nodes.length; i += 1) {
+ ret.push(nodes[i].loc);
+ }
+ return ret;
+ },
+
+ ifBranchInjector: function (node, walker) {
+ var alreadyIgnoring = !!this.currentState.ignoring,
+ hint = this.currentState.currentHint,
+ ignoreThen = !alreadyIgnoring && hint && hint.type === 'if',
+ ignoreElse = !alreadyIgnoring && hint && hint.type === 'else',
+ line = node.loc.start.line,
+ col = node.loc.start.column,
+ makeLoc = function () { return { line: line, column: col }; },
+ bName = this.branchName('if', walker.startLineForNode(node), [
+ { start: makeLoc(), end: makeLoc(), skip: ignoreThen || undefined },
+ { start: makeLoc(), end: makeLoc(), skip: ignoreElse || undefined }
+ ]),
+ thenBody = node.consequent.body,
+ elseBody = node.alternate.body,
+ child;
+ thenBody.unshift(astgen.statement(this.branchIncrementExprAst(bName, 0)));
+ elseBody.unshift(astgen.statement(this.branchIncrementExprAst(bName, 1)));
+ if (ignoreThen) { child = node.consequent; child.preprocessor = this.startIgnore; child.postprocessor = this.endIgnore; }
+ if (ignoreElse) { child = node.alternate; child.preprocessor = this.startIgnore; child.postprocessor = this.endIgnore; }
+ },
+
+ branchLocationFor: function (name, index) {
+ return this.coverState.branchMap[name].locations[index];
+ },
+
+ switchBranchInjector: function (node, walker) {
+ var cases = node.cases,
+ bName,
+ i;
+
+ if (!(cases && cases.length > 0)) {
+ return;
+ }
+ bName = this.branchName('switch', walker.startLineForNode(node), this.locationsForNodes(cases));
+ for (i = 0; i < cases.length; i += 1) {
+ cases[i].branchLocation = this.branchLocationFor(bName, i);
+ cases[i].consequent.unshift(astgen.statement(this.branchIncrementExprAst(bName, i)));
+ }
+ },
+
+ switchCaseInjector: function (node) {
+ var location = node.branchLocation;
+ delete node.branchLocation;
+ if (this.maybeSkipNode(node, 'next')) {
+ location.skip = true;
+ }
+ },
+
+ conditionalBranchInjector: function (node, walker) {
+ var bName = this.branchName('cond-expr', walker.startLineForNode(node), this.locationsForNodes([ node.consequent, node.alternate ])),
+ ast1 = this.branchIncrementExprAst(bName, 0),
+ ast2 = this.branchIncrementExprAst(bName, 1);
+
+ node.consequent.preprocessor = this.maybeAddSkip(this.branchLocationFor(bName, 0));
+ node.alternate.preprocessor = this.maybeAddSkip(this.branchLocationFor(bName, 1));
+ node.consequent = astgen.sequence(ast1, node.consequent);
+ node.alternate = astgen.sequence(ast2, node.alternate);
+ },
+
+ maybeAddSkip: function (branchLocation) {
+ return function (node) {
+ var alreadyIgnoring = !!this.currentState.ignoring,
+ hint = this.currentState.currentHint,
+ ignoreThis = !alreadyIgnoring && hint && hint.type === 'next';
+ if (ignoreThis) {
+ this.startIgnore();
+ node.postprocessor = this.endIgnore;
+ }
+ if (ignoreThis || alreadyIgnoring) {
+ branchLocation.skip = true;
+ }
+ };
+ },
+
+ logicalExpressionBranchInjector: function (node, walker) {
+ var parent = walker.parent(),
+ leaves = [],
+ bName,
+ tuple,
+ i;
+
+ this.maybeSkipNode(node, 'next');
+
+ if (parent && parent.node.type === SYNTAX.LogicalExpression.name) {
+ //already covered
+ return;
+ }
+
+ this.findLeaves(node, leaves);
+ bName = this.branchName('binary-expr',
+ walker.startLineForNode(node),
+ this.locationsForNodes(leaves.map(function (item) { return item.node; }))
+ );
+ for (i = 0; i < leaves.length; i += 1) {
+ tuple = leaves[i];
+ tuple.parent[tuple.property] = astgen.sequence(this.branchIncrementExprAst(bName, i), tuple.node);
+ tuple.node.preprocessor = this.maybeAddSkip(this.branchLocationFor(bName, i));
+ }
+ },
+
+ findLeaves: function (node, accumulator, parent, property) {
+ if (node.type === SYNTAX.LogicalExpression.name) {
+ this.findLeaves(node.left, accumulator, node, 'left');
+ this.findLeaves(node.right, accumulator, node, 'right');
+ } else {
+ accumulator.push({ node: node, parent: parent, property: property });
+ }
+ },
+ maybeAddType: function (node /*, walker */) {
+ var props = node.properties,
+ i,
+ child;
+ for (i = 0; i < props.length; i += 1) {
+ child = props[i];
+ if (!child.type) {
+ child.type = SYNTAX.Property.name;
+ }
+ }
+ }
+ };
+
+ if (isNode) {
+ module.exports = Instrumenter;
+ } else {
+ window.Instrumenter = Instrumenter;
+ }
+
+}(typeof module !== 'undefined' && typeof module.exports !== 'undefined' && typeof exports !== 'undefined'));
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/object-utils.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/object-utils.js
new file mode 100644
index 00000000..ab88ae0b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/object-utils.js
@@ -0,0 +1,425 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+/**
+ * utility methods to process coverage objects. A coverage object has the following
+ * format.
+ *
+ * {
+ * "/path/to/file1.js": { file1 coverage },
+ * "/path/to/file2.js": { file2 coverage }
+ * }
+ *
+ * The internals of the file coverage object are intentionally not documented since
+ * it is not a public interface.
+ *
+ * *Note:* When a method of this module has the word `File` in it, it will accept
+ * one of the sub-objects of the main coverage object as an argument. Other
+ * methods accept the higher level coverage object with multiple keys.
+ *
+ * Works on `node` as well as the browser.
+ *
+ * Usage on nodejs
+ * ---------------
+ *
+ * var objectUtils = require('istanbul').utils;
+ *
+ * Usage in a browser
+ * ------------------
+ *
+ * Load this file using a `script` tag or other means. This will set `window.coverageUtils`
+ * to this module's exports.
+ *
+ * @class ObjectUtils
+ * @module main
+ * @static
+ */
+(function (isNode) {
+ /**
+ * adds line coverage information to a file coverage object, reverse-engineering
+ * it from statement coverage. The object passed in is updated in place.
+ *
+ * Note that if line coverage information is already present in the object,
+ * it is not recomputed.
+ *
+ * @method addDerivedInfoForFile
+ * @static
+ * @param {Object} fileCoverage the coverage object for a single file
+ */
+ function addDerivedInfoForFile(fileCoverage) {
+ var statementMap = fileCoverage.statementMap,
+ statements = fileCoverage.s,
+ lineMap;
+
+ if (!fileCoverage.l) {
+ fileCoverage.l = lineMap = {};
+ Object.keys(statements).forEach(function (st) {
+ var line = statementMap[st].start.line,
+ count = statements[st],
+ prevVal = lineMap[line];
+ if (count === 0 && statementMap[st].skip) { count = 1; }
+ if (typeof prevVal === 'undefined' || prevVal < count) {
+ lineMap[line] = count;
+ }
+ });
+ }
+ }
+ /**
+ * adds line coverage information to all file coverage objects.
+ *
+ * @method addDerivedInfo
+ * @static
+ * @param {Object} coverage the coverage object
+ */
+ function addDerivedInfo(coverage) {
+ Object.keys(coverage).forEach(function (k) {
+ addDerivedInfoForFile(coverage[k]);
+ });
+ }
+ /**
+ * removes line coverage information from all file coverage objects
+ * @method removeDerivedInfo
+ * @static
+ * @param {Object} coverage the coverage object
+ */
+ function removeDerivedInfo(coverage) {
+ Object.keys(coverage).forEach(function (k) {
+ delete coverage[k].l;
+ });
+ }
+
+ function percent(covered, total) {
+ var tmp;
+ if (total > 0) {
+ tmp = 1000 * 100 * covered / total + 5;
+ return Math.floor(tmp / 10) / 100;
+ } else {
+ return 100.00;
+ }
+ }
+
+ function computeSimpleTotals(fileCoverage, property, mapProperty) {
+ var stats = fileCoverage[property],
+ map = mapProperty ? fileCoverage[mapProperty] : null,
+ ret = { total: 0, covered: 0, skipped: 0 };
+
+ Object.keys(stats).forEach(function (key) {
+ var covered = !!stats[key],
+ skipped = map && map[key].skip;
+ ret.total += 1;
+ if (covered || skipped) {
+ ret.covered += 1;
+ }
+ if (!covered && skipped) {
+ ret.skipped += 1;
+ }
+ });
+ ret.pct = percent(ret.covered, ret.total);
+ return ret;
+ }
+
+ function computeBranchTotals(fileCoverage) {
+ var stats = fileCoverage.b,
+ branchMap = fileCoverage.branchMap,
+ ret = { total: 0, covered: 0, skipped: 0 };
+
+ Object.keys(stats).forEach(function (key) {
+ var branches = stats[key],
+ map = branchMap[key],
+ covered,
+ skipped,
+ i;
+ for (i = 0; i < branches.length; i += 1) {
+ covered = branches[i] > 0;
+ skipped = map.locations && map.locations[i] && map.locations[i].skip;
+ if (covered || skipped) {
+ ret.covered += 1;
+ }
+ if (!covered && skipped) {
+ ret.skipped += 1;
+ }
+ }
+ ret.total += branches.length;
+ });
+ ret.pct = percent(ret.covered, ret.total);
+ return ret;
+ }
+ /**
+ * returns a blank summary metrics object. A metrics object has the following
+ * format.
+ *
+ * {
+ * lines: lineMetrics,
+ * statements: statementMetrics,
+ * functions: functionMetrics,
+ * branches: branchMetrics
+ * linesCovered: lineCoveredCount
+ * }
+ *
+ * Each individual metric object looks as follows:
+ *
+ * {
+ * total: n,
+ * covered: m,
+ * pct: percent
+ * }
+ *
+ * @method blankSummary
+ * @static
+ * @return {Object} a blank metrics object
+ */
+ function blankSummary() {
+ return {
+ lines: {
+ total: 0,
+ covered: 0,
+ skipped: 0,
+ pct: 'Unknown'
+ },
+ statements: {
+ total: 0,
+ covered: 0,
+ skipped: 0,
+ pct: 'Unknown'
+ },
+ functions: {
+ total: 0,
+ covered: 0,
+ skipped: 0,
+ pct: 'Unknown'
+ },
+ branches: {
+ total: 0,
+ covered: 0,
+ skipped: 0,
+ pct: 'Unknown'
+ },
+ linesCovered: {}
+ };
+ }
+ /**
+ * returns the summary metrics given the coverage object for a single file. See `blankSummary()`
+ * to understand the format of the returned object.
+ *
+ * @method summarizeFileCoverage
+ * @static
+ * @param {Object} fileCoverage the coverage object for a single file.
+ * @return {Object} the summary metrics for the file
+ */
+ function summarizeFileCoverage(fileCoverage) {
+ var ret = blankSummary();
+ addDerivedInfoForFile(fileCoverage);
+ ret.lines = computeSimpleTotals(fileCoverage, 'l');
+ ret.functions = computeSimpleTotals(fileCoverage, 'f', 'fnMap');
+ ret.statements = computeSimpleTotals(fileCoverage, 's', 'statementMap');
+ ret.branches = computeBranchTotals(fileCoverage);
+ ret.linesCovered = fileCoverage.l;
+ return ret;
+ }
+ /**
+ * merges two instances of file coverage objects *for the same file*
+ * such that the execution counts are correct.
+ *
+ * @method mergeFileCoverage
+ * @static
+ * @param {Object} first the first file coverage object for a given file
+ * @param {Object} second the second file coverage object for the same file
+ * @return {Object} an object that is a result of merging the two. Note that
+ * the input objects are not changed in any way.
+ */
+ function mergeFileCoverage(first, second) {
+ var ret = JSON.parse(JSON.stringify(first)),
+ i;
+
+ delete ret.l; //remove derived info
+
+ Object.keys(second.s).forEach(function (k) {
+ ret.s[k] += second.s[k];
+ });
+ Object.keys(second.f).forEach(function (k) {
+ ret.f[k] += second.f[k];
+ });
+ Object.keys(second.b).forEach(function (k) {
+ var retArray = ret.b[k],
+ secondArray = second.b[k];
+ for (i = 0; i < retArray.length; i += 1) {
+ retArray[i] += secondArray[i];
+ }
+ });
+
+ return ret;
+ }
+ /**
+ * merges multiple summary metrics objects by summing up the `totals` and
+ * `covered` fields and recomputing the percentages. This function is generic
+ * and can accept any number of arguments.
+ *
+ * @method mergeSummaryObjects
+ * @static
+ * @param {Object} summary... multiple summary metrics objects
+ * @return {Object} the merged summary metrics
+ */
+ function mergeSummaryObjects() {
+ var ret = blankSummary(),
+ args = Array.prototype.slice.call(arguments),
+ keys = ['lines', 'statements', 'branches', 'functions'],
+ increment = function (obj) {
+ if (obj) {
+ keys.forEach(function (key) {
+ ret[key].total += obj[key].total;
+ ret[key].covered += obj[key].covered;
+ ret[key].skipped += obj[key].skipped;
+ });
+
+ // keep track of all lines we have coverage for.
+ Object.keys(obj.linesCovered).forEach(function (key) {
+ if (!ret.linesCovered[key]) {
+ ret.linesCovered[key] = obj.linesCovered[key];
+ } else {
+ ret.linesCovered[key] += obj.linesCovered[key];
+ }
+ });
+ }
+ };
+ args.forEach(function (arg) {
+ increment(arg);
+ });
+ keys.forEach(function (key) {
+ ret[key].pct = percent(ret[key].covered, ret[key].total);
+ });
+
+ return ret;
+ }
+ /**
+ * returns the coverage summary for a single coverage object. This is
+ * wrapper over `summarizeFileCoverage` and `mergeSummaryObjects` for
+ * the common case of a single coverage object
+ * @method summarizeCoverage
+ * @static
+ * @param {Object} coverage the coverage object
+ * @return {Object} summary coverage metrics across all files in the coverage object
+ */
+ function summarizeCoverage(coverage) {
+ var fileSummary = [];
+ Object.keys(coverage).forEach(function (key) {
+ fileSummary.push(summarizeFileCoverage(coverage[key]));
+ });
+ return mergeSummaryObjects.apply(null, fileSummary);
+ }
+
+ /**
+ * makes the coverage object generated by this library yuitest_coverage compatible.
+ * Note that this transformation is lossy since the returned object will not have
+ * statement and branch coverage.
+ *
+ * @method toYUICoverage
+ * @static
+ * @param {Object} coverage The `istanbul` coverage object
+ * @return {Object} a coverage object in `yuitest_coverage` format.
+ */
+ function toYUICoverage(coverage) {
+ var ret = {};
+
+ addDerivedInfo(coverage);
+
+ Object.keys(coverage).forEach(function (k) {
+ var fileCoverage = coverage[k],
+ lines = fileCoverage.l,
+ functions = fileCoverage.f,
+ fnMap = fileCoverage.fnMap,
+ o;
+
+ o = ret[k] = {
+ lines: {},
+ calledLines: 0,
+ coveredLines: 0,
+ functions: {},
+ calledFunctions: 0,
+ coveredFunctions: 0
+ };
+ Object.keys(lines).forEach(function (k) {
+ o.lines[k] = lines[k];
+ o.coveredLines += 1;
+ if (lines[k] > 0) {
+ o.calledLines += 1;
+ }
+ });
+ Object.keys(functions).forEach(function (k) {
+ var name = fnMap[k].name + ':' + fnMap[k].line;
+ o.functions[name] = functions[k];
+ o.coveredFunctions += 1;
+ if (functions[k] > 0) {
+ o.calledFunctions += 1;
+ }
+ });
+ });
+ return ret;
+ }
+
+ /**
+ * Creates new file coverage object with incremented hits count
+ * on skipped statements, branches and functions
+ *
+ * @method incrementIgnoredTotals
+ * @static
+ * @param {Object} cov File coverage object
+ * @return {Object} New file coverage object
+ */
+ function incrementIgnoredTotals(cov) {
+ //TODO: This may be slow in the browser and may break in older browsers
+ // Look into using a library that works in Node and the browser
+ var fileCoverage = JSON.parse(JSON.stringify(cov));
+
+ [
+ {mapKey: 'statementMap', hitsKey: 's'},
+ {mapKey: 'branchMap', hitsKey: 'b'},
+ {mapKey: 'fnMap', hitsKey: 'f'}
+ ].forEach(function (keys) {
+ Object.keys(fileCoverage[keys.mapKey])
+ .forEach(function (key) {
+ var map = fileCoverage[keys.mapKey][key];
+ var hits = fileCoverage[keys.hitsKey];
+
+ if (keys.mapKey === 'branchMap') {
+ var locations = map.locations;
+
+ locations.forEach(function (location, index) {
+ if (hits[key][index] === 0 && location.skip) {
+ hits[key][index] = 1;
+ }
+ });
+
+ return;
+ }
+
+ if (hits[key] === 0 && map.skip) {
+ hits[key] = 1;
+ }
+ });
+ });
+
+ return fileCoverage;
+ }
+
+ var exportables = {
+ addDerivedInfo: addDerivedInfo,
+ addDerivedInfoForFile: addDerivedInfoForFile,
+ removeDerivedInfo: removeDerivedInfo,
+ blankSummary: blankSummary,
+ summarizeFileCoverage: summarizeFileCoverage,
+ summarizeCoverage: summarizeCoverage,
+ mergeFileCoverage: mergeFileCoverage,
+ mergeSummaryObjects: mergeSummaryObjects,
+ toYUICoverage: toYUICoverage,
+ incrementIgnoredTotals: incrementIgnoredTotals
+ };
+
+ /* istanbul ignore else: windows */
+ if (isNode) {
+ module.exports = exportables;
+ } else {
+ window.coverageUtils = exportables;
+ }
+}(typeof module !== 'undefined' && typeof module.exports !== 'undefined' && typeof exports !== 'undefined'));
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/register-plugins.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/register-plugins.js
new file mode 100644
index 00000000..50462bec
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/register-plugins.js
@@ -0,0 +1,15 @@
+
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+var Store = require('./store'),
+ Report = require('./report'),
+ Command = require('./command');
+
+Store.loadAll();
+Report.loadAll();
+Command.loadAll();
+
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/clover.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/clover.js
new file mode 100644
index 00000000..fe73aefc
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/clover.js
@@ -0,0 +1,227 @@
+var path = require('path'),
+ util = require('util'),
+ Report = require('./index'),
+ FileWriter = require('../util/file-writer'),
+ TreeSummarizer = require('../util/tree-summarizer'),
+ utils = require('../object-utils');
+
+/**
+ * a `Report` implementation that produces a clover-style XML file.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('clover');
+ *
+ * @class CloverReport
+ * @module report
+ * @extends Report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the clover.xml will be written
+ * @param {String} [opts.file] the file name, defaulted to config attribute or 'clover.xml'
+ */
+function CloverReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ this.projectRoot = process.cwd();
+ this.dir = opts.dir || this.projectRoot;
+ this.file = opts.file || this.getDefaultConfig().file;
+ this.opts = opts;
+}
+
+CloverReport.TYPE = 'clover';
+util.inherits(CloverReport, Report);
+
+function asJavaPackage(node) {
+ return node.displayShortName().
+ replace(/\//g, '.').
+ replace(/\\/g, '.').
+ replace(/\.$/, '');
+}
+
+function asClassName(node) {
+ /*jslint regexp: true */
+ return node.fullPath().replace(/.*[\\\/]/, '');
+}
+
+function quote(thing) {
+ return '"' + thing + '"';
+}
+
+function attr(n, v) {
+ return ' ' + n + '=' + quote(v) + ' ';
+}
+
+function branchCoverageByLine(fileCoverage) {
+ var branchMap = fileCoverage.branchMap,
+ branches = fileCoverage.b,
+ ret = {};
+ Object.keys(branchMap).forEach(function (k) {
+ var line = branchMap[k].line,
+ branchData = branches[k];
+ ret[line] = ret[line] || [];
+ ret[line].push.apply(ret[line], branchData);
+ });
+ Object.keys(ret).forEach(function (k) {
+ var dataArray = ret[k],
+ covered = dataArray.filter(function (item) { return item > 0; }),
+ coverage = covered.length / dataArray.length * 100;
+ ret[k] = { covered: covered.length, total: dataArray.length, coverage: coverage };
+ });
+ return ret;
+}
+
+function addClassStats(node, fileCoverage, writer) {
+ fileCoverage = utils.incrementIgnoredTotals(fileCoverage);
+
+ var metrics = node.metrics,
+ branchByLine = branchCoverageByLine(fileCoverage),
+ fnMap,
+ lines;
+
+ writer.println('\t\t\t<file' +
+ attr('name', asClassName(node)) +
+ attr('path', node.fullPath()) +
+ '>');
+
+ writer.println('\t\t\t\t<metrics' +
+ attr('statements', metrics.lines.total) +
+ attr('coveredstatements', metrics.lines.covered) +
+ attr('conditionals', metrics.branches.total) +
+ attr('coveredconditionals', metrics.branches.covered) +
+ attr('methods', metrics.functions.total) +
+ attr('coveredmethods', metrics.functions.covered) +
+ '/>');
+
+ fnMap = fileCoverage.fnMap;
+ lines = fileCoverage.l;
+ Object.keys(lines).forEach(function (k) {
+ var str = '\t\t\t\t<line' +
+ attr('num', k) +
+ attr('count', lines[k]),
+ branchDetail = branchByLine[k];
+
+ if (!branchDetail) {
+ str += ' type="stmt" ';
+ } else {
+ str += ' type="cond" ' +
+ attr('truecount', branchDetail.covered) +
+ attr('falsecount', (branchDetail.total - branchDetail.covered));
+ }
+ writer.println(str + '/>');
+ });
+
+ writer.println('\t\t\t</file>');
+}
+
+function walk(node, collector, writer, level, projectRoot) {
+ var metrics,
+ totalFiles = 0,
+ totalPackages = 0,
+ totalLines = 0,
+ tempLines = 0;
+ if (level === 0) {
+ metrics = node.metrics;
+ writer.println('<?xml version="1.0" encoding="UTF-8"?>');
+ writer.println('<coverage' +
+ attr('generated', Date.now()) +
+ 'clover="3.2.0">');
+
+ writer.println('\t<project' +
+ attr('timestamp', Date.now()) +
+ attr('name', 'All Files') +
+ '>');
+
+ node.children.filter(function (child) { return child.kind === 'dir'; }).
+ forEach(function (child) {
+ totalPackages += 1;
+ child.children.filter(function (child) { return child.kind !== 'dir'; }).
+ forEach(function (child) {
+ Object.keys(collector.fileCoverageFor(child.fullPath()).l).forEach(function (k){
+ tempLines = k;
+ });
+ totalLines += Number(tempLines);
+ totalFiles += 1;
+ });
+ });
+
+ writer.println('\t\t<metrics' +
+ attr('statements', metrics.lines.total) +
+ attr('coveredstatements', metrics.lines.covered) +
+ attr('conditionals', metrics.branches.total) +
+ attr('coveredconditionals', metrics.branches.covered) +
+ attr('methods', metrics.functions.total) +
+ attr('coveredmethods', metrics.functions.covered) +
+ attr('elements', metrics.lines.total + metrics.branches.total + metrics.functions.total) +
+ attr('coveredelements', metrics.lines.covered + metrics.branches.covered + metrics.functions.covered) +
+ attr('complexity', 0) +
+ attr('packages', totalPackages) +
+ attr('files', totalFiles) +
+ attr('classes', totalFiles) +
+ attr('loc', totalLines) +
+ attr('ncloc', totalLines) +
+ '/>');
+ }
+ if (node.packageMetrics) {
+ metrics = node.packageMetrics;
+ writer.println('\t\t<package' +
+ attr('name', asJavaPackage(node)) +
+ '>');
+
+ writer.println('\t\t\t<metrics' +
+ attr('statements', metrics.lines.total) +
+ attr('coveredstatements', metrics.lines.covered) +
+ attr('conditionals', metrics.branches.total) +
+ attr('coveredconditionals', metrics.branches.covered) +
+ attr('methods', metrics.functions.total) +
+ attr('coveredmethods', metrics.functions.covered) +
+ '/>');
+
+ node.children.filter(function (child) { return child.kind !== 'dir'; }).
+ forEach(function (child) {
+ addClassStats(child, collector.fileCoverageFor(child.fullPath()), writer);
+ });
+ writer.println('\t\t</package>');
+ }
+ node.children.filter(function (child) { return child.kind === 'dir'; }).
+ forEach(function (child) {
+ walk(child, collector, writer, level + 1, projectRoot);
+ });
+
+ if (level === 0) {
+ writer.println('\t</project>');
+ writer.println('</coverage>');
+ }
+}
+
+Report.mix(CloverReport, {
+ synopsis: function () {
+ return 'XML coverage report that can be consumed by the clover tool';
+ },
+ getDefaultConfig: function () {
+ return { file: 'clover.xml' };
+ },
+ writeReport: function (collector, sync) {
+ var summarizer = new TreeSummarizer(),
+ outputFile = path.join(this.dir, this.file),
+ writer = this.opts.writer || new FileWriter(sync),
+ projectRoot = this.projectRoot,
+ that = this,
+ tree,
+ root;
+
+ collector.files().forEach(function (key) {
+ summarizer.addFileCoverageSummary(key, utils.summarizeFileCoverage(collector.fileCoverageFor(key)));
+ });
+ tree = summarizer.getTreeSummary();
+ root = tree.root;
+ writer.on('done', function () { that.emit('done'); });
+ writer.writeFile(outputFile, function (contentWriter) {
+ walk(root, collector, contentWriter, 0, projectRoot);
+ writer.done();
+ });
+ }
+});
+
+module.exports = CloverReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/cobertura.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/cobertura.js
new file mode 100644
index 00000000..d63456c9
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/cobertura.js
@@ -0,0 +1,221 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ util = require('util'),
+ Report = require('./index'),
+ FileWriter = require('../util/file-writer'),
+ TreeSummarizer = require('../util/tree-summarizer'),
+ utils = require('../object-utils');
+
+/**
+ * a `Report` implementation that produces a cobertura-style XML file that conforms to the
+ * http://cobertura.sourceforge.net/xml/coverage-04.dtd DTD.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('cobertura');
+ *
+ * @class CoberturaReport
+ * @module report
+ * @extends Report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the cobertura-coverage.xml will be written
+ */
+function CoberturaReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ this.projectRoot = process.cwd();
+ this.dir = opts.dir || this.projectRoot;
+ this.file = opts.file || this.getDefaultConfig().file;
+ this.opts = opts;
+}
+
+CoberturaReport.TYPE = 'cobertura';
+util.inherits(CoberturaReport, Report);
+
+function asJavaPackage(node) {
+ return node.displayShortName().
+ replace(/\//g, '.').
+ replace(/\\/g, '.').
+ replace(/\.$/, '');
+}
+
+function asClassName(node) {
+ /*jslint regexp: true */
+ return node.fullPath().replace(/.*[\\\/]/, '');
+}
+
+function quote(thing) {
+ return '"' + thing + '"';
+}
+
+function attr(n, v) {
+ return ' ' + n + '=' + quote(v) + ' ';
+}
+
+function branchCoverageByLine(fileCoverage) {
+ var branchMap = fileCoverage.branchMap,
+ branches = fileCoverage.b,
+ ret = {};
+ Object.keys(branchMap).forEach(function (k) {
+ var line = branchMap[k].line,
+ branchData = branches[k];
+ ret[line] = ret[line] || [];
+ ret[line].push.apply(ret[line], branchData);
+ });
+ Object.keys(ret).forEach(function (k) {
+ var dataArray = ret[k],
+ covered = dataArray.filter(function (item) { return item > 0; }),
+ coverage = covered.length / dataArray.length * 100;
+ ret[k] = { covered: covered.length, total: dataArray.length, coverage: coverage };
+ });
+ return ret;
+}
+
+function addClassStats(node, fileCoverage, writer, projectRoot) {
+ fileCoverage = utils.incrementIgnoredTotals(fileCoverage);
+
+ var metrics = node.metrics,
+ branchByLine = branchCoverageByLine(fileCoverage),
+ fnMap,
+ lines;
+
+ writer.println('\t\t<class' +
+ attr('name', asClassName(node)) +
+ attr('filename', path.relative(projectRoot, node.fullPath())) +
+ attr('line-rate', metrics.lines.pct / 100.0) +
+ attr('branch-rate', metrics.branches.pct / 100.0) +
+ '>');
+
+ writer.println('\t\t<methods>');
+ fnMap = fileCoverage.fnMap;
+ Object.keys(fnMap).forEach(function (k) {
+ var name = fnMap[k].name,
+ hits = fileCoverage.f[k];
+
+ writer.println(
+ '\t\t\t<method' +
+ attr('name', name) +
+ attr('hits', hits) +
+ attr('signature', '()V') + //fake out a no-args void return
+ '>'
+ );
+
+ //Add the function definition line and hits so that jenkins cobertura plugin records method hits
+ writer.println(
+ '\t\t\t\t<lines>' +
+ '<line' +
+ attr('number', fnMap[k].line) +
+ attr('hits', fileCoverage.f[k]) +
+ '/>' +
+ '</lines>'
+ );
+
+ writer.println('\t\t\t</method>');
+
+ });
+ writer.println('\t\t</methods>');
+
+ writer.println('\t\t<lines>');
+ lines = fileCoverage.l;
+ Object.keys(lines).forEach(function (k) {
+ var str = '\t\t\t<line' +
+ attr('number', k) +
+ attr('hits', lines[k]),
+ branchDetail = branchByLine[k];
+
+ if (!branchDetail) {
+ str += attr('branch', false);
+ } else {
+ str += attr('branch', true) +
+ attr('condition-coverage', branchDetail.coverage +
+ '% (' + branchDetail.covered + '/' + branchDetail.total + ')');
+ }
+ writer.println(str + '/>');
+ });
+ writer.println('\t\t</lines>');
+
+ writer.println('\t\t</class>');
+}
+
+function walk(node, collector, writer, level, projectRoot) {
+ var metrics;
+ if (level === 0) {
+ metrics = node.metrics;
+ writer.println('<?xml version="1.0" ?>');
+ writer.println('<!DOCTYPE coverage SYSTEM "http://cobertura.sourceforge.net/xml/coverage-04.dtd">');
+ writer.println('<coverage' +
+ attr('lines-valid', metrics.lines.total) +
+ attr('lines-covered', metrics.lines.covered) +
+ attr('line-rate', metrics.lines.pct / 100.0) +
+ attr('branches-valid', metrics.branches.total) +
+ attr('branches-covered', metrics.branches.covered) +
+ attr('branch-rate', metrics.branches.pct / 100.0) +
+ attr('timestamp', Date.now()) +
+ 'complexity="0" version="0.1">');
+ writer.println('<sources>');
+ writer.println('\t<source>' + projectRoot + '</source>');
+ writer.println('</sources>');
+ writer.println('<packages>');
+ }
+ if (node.packageMetrics) {
+ metrics = node.packageMetrics;
+ writer.println('\t<package' +
+ attr('name', asJavaPackage(node)) +
+ attr('line-rate', metrics.lines.pct / 100.0) +
+ attr('branch-rate', metrics.branches.pct / 100.0) +
+ '>');
+ writer.println('\t<classes>');
+ node.children.filter(function (child) { return child.kind !== 'dir'; }).
+ forEach(function (child) {
+ addClassStats(child, collector.fileCoverageFor(child.fullPath()), writer, projectRoot);
+ });
+ writer.println('\t</classes>');
+ writer.println('\t</package>');
+ }
+ node.children.filter(function (child) { return child.kind === 'dir'; }).
+ forEach(function (child) {
+ walk(child, collector, writer, level + 1, projectRoot);
+ });
+
+ if (level === 0) {
+ writer.println('</packages>');
+ writer.println('</coverage>');
+ }
+}
+
+Report.mix(CoberturaReport, {
+ synopsis: function () {
+ return 'XML coverage report that can be consumed by the cobertura tool';
+ },
+ getDefaultConfig: function () {
+ return { file: 'cobertura-coverage.xml' };
+ },
+ writeReport: function (collector, sync) {
+ var summarizer = new TreeSummarizer(),
+ outputFile = path.join(this.dir, this.file),
+ writer = this.opts.writer || new FileWriter(sync),
+ projectRoot = this.projectRoot,
+ that = this,
+ tree,
+ root;
+
+ collector.files().forEach(function (key) {
+ summarizer.addFileCoverageSummary(key, utils.summarizeFileCoverage(collector.fileCoverageFor(key)));
+ });
+ tree = summarizer.getTreeSummary();
+ root = tree.root;
+ writer.on('done', function () { that.emit('done'); });
+ writer.writeFile(outputFile, function (contentWriter) {
+ walk(root, collector, contentWriter, 0, projectRoot);
+ writer.done();
+ });
+ }
+});
+
+module.exports = CoberturaReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/common/defaults.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/common/defaults.js
new file mode 100644
index 00000000..c9796028
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/common/defaults.js
@@ -0,0 +1,49 @@
+/*
+ Copyright (c) 2013, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var Report = require('../index');
+var supportsColor = require('supports-color');
+
+module.exports = {
+ watermarks: function () {
+ return {
+ statements: [ 50, 80 ],
+ lines: [ 50, 80 ],
+ functions: [ 50, 80],
+ branches: [ 50, 80 ]
+ };
+ },
+
+ classFor: function (type, metrics, watermarks) {
+ var mark = watermarks[type],
+ value = metrics[type].pct;
+ return value >= mark[1] ? 'high' : value >= mark[0] ? 'medium' : 'low';
+ },
+
+ colorize: function (str, clazz) {
+ /* istanbul ignore if: untestable in batch mode */
+ if (supportsColor) {
+ switch (clazz) {
+ case 'low' : str = '\033[91m' + str + '\033[0m'; break;
+ case 'medium': str = '\033[93m' + str + '\033[0m'; break;
+ case 'high': str = '\033[92m' + str + '\033[0m'; break;
+ }
+ }
+ return str;
+ },
+
+ defaultReportConfig: function () {
+ var cfg = {};
+ Report.getReportList().forEach(function (type) {
+ var rpt = Report.create(type),
+ c = rpt.getDefaultConfig();
+ if (c) {
+ cfg[type] = c;
+ }
+ });
+ return cfg;
+ }
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/html.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/html.js
new file mode 100644
index 00000000..86edd19d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/html.js
@@ -0,0 +1,567 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+/*jshint maxlen: 300 */
+var handlebars = require('handlebars'),
+ defaults = require('./common/defaults'),
+ path = require('path'),
+ fs = require('fs'),
+ util = require('util'),
+ FileWriter = require('../util/file-writer'),
+ Report = require('./index'),
+ Store = require('../store'),
+ InsertionText = require('../util/insertion-text'),
+ TreeSummarizer = require('../util/tree-summarizer'),
+ utils = require('../object-utils'),
+ templateFor = function (name) { return handlebars.compile(fs.readFileSync(path.resolve(__dirname, 'templates', name + '.txt'), 'utf8')); },
+ headerTemplate = templateFor('head'),
+ footerTemplate = templateFor('foot'),
+ pathTemplate = handlebars.compile('<div class="path">{{{html}}}</div>'),
+ detailTemplate = handlebars.compile([
+ '<tr>',
+ '<td class="line-count">{{#show_lines}}{{maxLines}}{{/show_lines}}</td>',
+ '<td class="line-coverage">{{#show_line_execution_counts fileCoverage}}{{maxLines}}{{/show_line_execution_counts}}</td>',
+ '<td class="text"><pre class="prettyprint lang-js">{{#show_code structured}}{{/show_code}}</pre></td>',
+ '</tr>\n'
+ ].join('')),
+ summaryTableHeader = [
+ '<div class="coverage-summary">',
+ '<table>',
+ '<thead>',
+ '<tr>',
+ ' <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>',
+ ' <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>',
+ ' <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>',
+ ' <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>',
+ ' <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>',
+ ' <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>',
+ ' <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>',
+ ' <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>',
+ ' <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>',
+ ' <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>',
+ '</tr>',
+ '</thead>',
+ '<tbody>'
+ ].join('\n'),
+ summaryLineTemplate = handlebars.compile([
+ '<tr>',
+ '<td class="file {{reportClasses.statements}}" data-value="{{file}}"><a href="{{output}}">{{file}}</a></td>',
+ '<td data-value="{{metrics.statements.pct}}" class="pic {{reportClasses.statements}}">{{#show_picture}}{{metrics.statements.pct}}{{/show_picture}}</td>',
+ '<td data-value="{{metrics.statements.pct}}" class="pct {{reportClasses.statements}}">{{metrics.statements.pct}}%</td>',
+ '<td data-value="{{metrics.statements.total}}" class="abs {{reportClasses.statements}}">({{metrics.statements.covered}}&nbsp;/&nbsp;{{metrics.statements.total}})</td>',
+ '<td data-value="{{metrics.branches.pct}}" class="pct {{reportClasses.branches}}">{{metrics.branches.pct}}%</td>',
+ '<td data-value="{{metrics.branches.total}}" class="abs {{reportClasses.branches}}">({{metrics.branches.covered}}&nbsp;/&nbsp;{{metrics.branches.total}})</td>',
+ '<td data-value="{{metrics.functions.pct}}" class="pct {{reportClasses.functions}}">{{metrics.functions.pct}}%</td>',
+ '<td data-value="{{metrics.functions.total}}" class="abs {{reportClasses.functions}}">({{metrics.functions.covered}}&nbsp;/&nbsp;{{metrics.functions.total}})</td>',
+ '<td data-value="{{metrics.lines.pct}}" class="pct {{reportClasses.lines}}">{{metrics.lines.pct}}%</td>',
+ '<td data-value="{{metrics.lines.total}}" class="abs {{reportClasses.lines}}">({{metrics.lines.covered}}&nbsp;/&nbsp;{{metrics.lines.total}})</td>',
+ '</tr>\n'
+ ].join('\n\t')),
+ summaryTableFooter = [
+ '</tbody>',
+ '</table>',
+ '</div>'
+ ].join('\n'),
+ lt = '\u0001',
+ gt = '\u0002',
+ RE_LT = /</g,
+ RE_GT = />/g,
+ RE_AMP = /&/g,
+ RE_lt = /\u0001/g,
+ RE_gt = /\u0002/g;
+
+handlebars.registerHelper('show_picture', function (opts) {
+ var num = Number(opts.fn(this)),
+ rest,
+ cls = '';
+ if (isFinite(num)) {
+ if (num === 100) {
+ cls = ' cover-full';
+ }
+ num = Math.floor(num);
+ rest = 100 - num;
+ return '<span class="cover-fill' + cls + '" style="width: ' + num + 'px;"></span>' +
+ '<span class="cover-empty" style="width:' + rest + 'px;"></span>';
+ } else {
+ return '';
+ }
+});
+
+handlebars.registerHelper('show_ignores', function (metrics) {
+ var statements = metrics.statements.skipped,
+ functions = metrics.functions.skipped,
+ branches = metrics.branches.skipped,
+ result;
+
+ if (statements === 0 && functions === 0 && branches === 0) {
+ return '<span class="ignore-none">none</span>';
+ }
+
+ result = [];
+ if (statements >0) { result.push(statements === 1 ? '1 statement': statements + ' statements'); }
+ if (functions >0) { result.push(functions === 1 ? '1 function' : functions + ' functions'); }
+ if (branches >0) { result.push(branches === 1 ? '1 branch' : branches + ' branches'); }
+
+ return result.join(', ');
+});
+
+handlebars.registerHelper('show_lines', function (opts) {
+ var maxLines = Number(opts.fn(this)),
+ i,
+ array = [];
+
+ for (i = 0; i < maxLines; i += 1) {
+ array[i] = i + 1;
+ }
+ return array.join('\n');
+});
+
+handlebars.registerHelper('show_line_execution_counts', function (context, opts) {
+ var lines = context.l,
+ maxLines = Number(opts.fn(this)),
+ i,
+ lineNumber,
+ array = [],
+ covered,
+ value = '';
+
+ for (i = 0; i < maxLines; i += 1) {
+ lineNumber = i + 1;
+ value = '&nbsp;';
+ covered = 'neutral';
+ if (lines.hasOwnProperty(lineNumber)) {
+ if (lines[lineNumber] > 0) {
+ covered = 'yes';
+ value = lines[lineNumber];
+ } else {
+ covered = 'no';
+ }
+ }
+ array.push('<span class="cline-any cline-' + covered + '">' + value + '</span>');
+ }
+ return array.join('\n');
+});
+
+function customEscape(text) {
+ text = text.toString();
+ return text.replace(RE_AMP, '&amp;')
+ .replace(RE_LT, '&lt;')
+ .replace(RE_GT, '&gt;')
+ .replace(RE_lt, '<')
+ .replace(RE_gt, '>');
+}
+
+handlebars.registerHelper('show_code', function (context /*, opts */) {
+ var array = [];
+
+ context.forEach(function (item) {
+ array.push(customEscape(item.text) || '&nbsp;');
+ });
+ return array.join('\n');
+});
+
+function title(str) {
+ return ' title="' + str + '" ';
+}
+
+function annotateLines(fileCoverage, structuredText) {
+ var lineStats = fileCoverage.l;
+ if (!lineStats) { return; }
+ Object.keys(lineStats).forEach(function (lineNumber) {
+ var count = lineStats[lineNumber];
+ if (structuredText[lineNumber]) {
+ structuredText[lineNumber].covered = count > 0 ? 'yes' : 'no';
+ }
+ });
+ structuredText.forEach(function (item) {
+ if (item.covered === null) {
+ item.covered = 'neutral';
+ }
+ });
+}
+
+function annotateStatements(fileCoverage, structuredText) {
+ var statementStats = fileCoverage.s,
+ statementMeta = fileCoverage.statementMap;
+ Object.keys(statementStats).forEach(function (stName) {
+ var count = statementStats[stName],
+ meta = statementMeta[stName],
+ type = count > 0 ? 'yes' : 'no',
+ startCol = meta.start.column,
+ endCol = meta.end.column + 1,
+ startLine = meta.start.line,
+ endLine = meta.end.line,
+ openSpan = lt + 'span class="' + (meta.skip ? 'cstat-skip' : 'cstat-no') + '"' + title('statement not covered') + gt,
+ closeSpan = lt + '/span' + gt,
+ text;
+
+ if (type === 'no') {
+ if (endLine !== startLine) {
+ endLine = startLine;
+ endCol = structuredText[startLine].text.originalLength();
+ }
+ text = structuredText[startLine].text;
+ text.wrap(startCol,
+ openSpan,
+ startLine === endLine ? endCol : text.originalLength(),
+ closeSpan);
+ }
+ });
+}
+
+function annotateFunctions(fileCoverage, structuredText) {
+
+ var fnStats = fileCoverage.f,
+ fnMeta = fileCoverage.fnMap;
+ if (!fnStats) { return; }
+ Object.keys(fnStats).forEach(function (fName) {
+ var count = fnStats[fName],
+ meta = fnMeta[fName],
+ type = count > 0 ? 'yes' : 'no',
+ startCol = meta.loc.start.column,
+ endCol = meta.loc.end.column + 1,
+ startLine = meta.loc.start.line,
+ endLine = meta.loc.end.line,
+ openSpan = lt + 'span class="' + (meta.skip ? 'fstat-skip' : 'fstat-no') + '"' + title('function not covered') + gt,
+ closeSpan = lt + '/span' + gt,
+ text;
+
+ if (type === 'no') {
+ if (endLine !== startLine) {
+ endLine = startLine;
+ endCol = structuredText[startLine].text.originalLength();
+ }
+ text = structuredText[startLine].text;
+ text.wrap(startCol,
+ openSpan,
+ startLine === endLine ? endCol : text.originalLength(),
+ closeSpan);
+ }
+ });
+}
+
+function annotateBranches(fileCoverage, structuredText) {
+ var branchStats = fileCoverage.b,
+ branchMeta = fileCoverage.branchMap;
+ if (!branchStats) { return; }
+
+ Object.keys(branchStats).forEach(function (branchName) {
+ var branchArray = branchStats[branchName],
+ sumCount = branchArray.reduce(function (p, n) { return p + n; }, 0),
+ metaArray = branchMeta[branchName].locations,
+ i,
+ count,
+ meta,
+ type,
+ startCol,
+ endCol,
+ startLine,
+ endLine,
+ openSpan,
+ closeSpan,
+ text;
+
+ if (sumCount > 0) { //only highlight if partial branches are missing
+ for (i = 0; i < branchArray.length; i += 1) {
+ count = branchArray[i];
+ meta = metaArray[i];
+ type = count > 0 ? 'yes' : 'no';
+ startCol = meta.start.column;
+ endCol = meta.end.column + 1;
+ startLine = meta.start.line;
+ endLine = meta.end.line;
+ openSpan = lt + 'span class="branch-' + i + ' ' + (meta.skip ? 'cbranch-skip' : 'cbranch-no') + '"' + title('branch not covered') + gt;
+ closeSpan = lt + '/span' + gt;
+
+ if (count === 0) { //skip branches taken
+ if (endLine !== startLine) {
+ endLine = startLine;
+ endCol = structuredText[startLine].text.originalLength();
+ }
+ text = structuredText[startLine].text;
+ if (branchMeta[branchName].type === 'if') { // and 'if' is a special case since the else branch might not be visible, being non-existent
+ text.insertAt(startCol, lt + 'span class="' + (meta.skip ? 'skip-if-branch' : 'missing-if-branch') + '"' +
+ title((i === 0 ? 'if' : 'else') + ' path not taken') + gt +
+ (i === 0 ? 'I' : 'E') + lt + '/span' + gt, true, false);
+ } else {
+ text.wrap(startCol,
+ openSpan,
+ startLine === endLine ? endCol : text.originalLength(),
+ closeSpan);
+ }
+ }
+ }
+ }
+ });
+}
+
+function getReportClass(stats, watermark) {
+ var coveragePct = stats.pct,
+ identity = 1;
+ if (coveragePct * identity === coveragePct) {
+ return coveragePct >= watermark[1] ? 'high' : coveragePct >= watermark[0] ? 'medium' : 'low';
+ } else {
+ return '';
+ }
+}
+
+function cleanPath(name) {
+ var SEP = path.sep || '/';
+ return (SEP !== '/') ? name.split(SEP).join('/') : name;
+}
+
+function isEmptySourceStore(sourceStore) {
+ if (!sourceStore) {
+ return true;
+ }
+
+ var cache = sourceStore.sourceCache;
+ return cache && !Object.keys(cache).length;
+}
+
+/**
+ * a `Report` implementation that produces HTML coverage reports.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('html');
+ *
+ *
+ * @class HtmlReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to generate reports. Defaults to `./html-report`
+ */
+function HtmlReport(opts) {
+ Report.call(this);
+ this.opts = opts || {};
+ this.opts.dir = this.opts.dir || path.resolve(process.cwd(), 'html-report');
+ this.opts.sourceStore = isEmptySourceStore(this.opts.sourceStore) ?
+ Store.create('fslookup') : this.opts.sourceStore;
+ this.opts.linkMapper = this.opts.linkMapper || this.standardLinkMapper();
+ this.opts.writer = this.opts.writer || null;
+ this.opts.templateData = { datetime: Date() };
+ this.opts.watermarks = this.opts.watermarks || defaults.watermarks();
+}
+
+HtmlReport.TYPE = 'html';
+util.inherits(HtmlReport, Report);
+
+Report.mix(HtmlReport, {
+
+ synopsis: function () {
+ return 'Navigable HTML coverage report for every file and directory';
+ },
+
+ getPathHtml: function (node, linkMapper) {
+ var parent = node.parent,
+ nodePath = [],
+ linkPath = [],
+ i;
+
+ while (parent) {
+ nodePath.push(parent);
+ parent = parent.parent;
+ }
+
+ for (i = 0; i < nodePath.length; i += 1) {
+ linkPath.push('<a href="' + linkMapper.ancestor(node, i + 1) + '">' +
+ (cleanPath(nodePath[i].relativeName) || 'All files') + '</a>');
+ }
+ linkPath.reverse();
+ return linkPath.length > 0 ? linkPath.join(' &#187; ') + ' &#187; ' +
+ cleanPath(node.displayShortName()) : '';
+ },
+
+ fillTemplate: function (node, templateData) {
+ var opts = this.opts,
+ linkMapper = opts.linkMapper;
+
+ templateData.entity = node.name || 'All files';
+ templateData.metrics = node.metrics;
+ templateData.reportClass = getReportClass(node.metrics.statements, opts.watermarks.statements);
+ templateData.pathHtml = pathTemplate({ html: this.getPathHtml(node, linkMapper) });
+ templateData.base = {
+ css: linkMapper.asset(node, 'base.css')
+ };
+ templateData.sorter = {
+ js: linkMapper.asset(node, 'sorter.js'),
+ image: linkMapper.asset(node, 'sort-arrow-sprite.png')
+ };
+ templateData.prettify = {
+ js: linkMapper.asset(node, 'prettify.js'),
+ css: linkMapper.asset(node, 'prettify.css')
+ };
+ },
+ writeDetailPage: function (writer, node, fileCoverage) {
+ var opts = this.opts,
+ sourceStore = opts.sourceStore,
+ templateData = opts.templateData,
+ sourceText = fileCoverage.code && Array.isArray(fileCoverage.code) ?
+ fileCoverage.code.join('\n') + '\n' : sourceStore.get(fileCoverage.path),
+ code = sourceText.split(/(?:\r?\n)|\r/),
+ count = 0,
+ structured = code.map(function (str) { count += 1; return { line: count, covered: null, text: new InsertionText(str, true) }; }),
+ context;
+
+ structured.unshift({ line: 0, covered: null, text: new InsertionText("") });
+
+ this.fillTemplate(node, templateData);
+ writer.write(headerTemplate(templateData));
+ writer.write('<pre><table class="coverage">\n');
+
+ annotateLines(fileCoverage, structured);
+ //note: order is important, since statements typically result in spanning the whole line and doing branches late
+ //causes mismatched tags
+ annotateBranches(fileCoverage, structured);
+ annotateFunctions(fileCoverage, structured);
+ annotateStatements(fileCoverage, structured);
+
+ structured.shift();
+ context = {
+ structured: structured,
+ maxLines: structured.length,
+ fileCoverage: fileCoverage
+ };
+ writer.write(detailTemplate(context));
+ writer.write('</table></pre>\n');
+ writer.write(footerTemplate(templateData));
+ },
+
+ writeIndexPage: function (writer, node) {
+ var linkMapper = this.opts.linkMapper,
+ templateData = this.opts.templateData,
+ children = Array.prototype.slice.apply(node.children),
+ watermarks = this.opts.watermarks;
+
+ children.sort(function (a, b) {
+ return a.name < b.name ? -1 : 1;
+ });
+
+ this.fillTemplate(node, templateData);
+ writer.write(headerTemplate(templateData));
+ writer.write(summaryTableHeader);
+ children.forEach(function (child) {
+ var metrics = child.metrics,
+ reportClasses = {
+ statements: getReportClass(metrics.statements, watermarks.statements),
+ lines: getReportClass(metrics.lines, watermarks.lines),
+ functions: getReportClass(metrics.functions, watermarks.functions),
+ branches: getReportClass(metrics.branches, watermarks.branches)
+ },
+ data = {
+ metrics: metrics,
+ reportClasses: reportClasses,
+ file: cleanPath(child.displayShortName()),
+ output: linkMapper.fromParent(child)
+ };
+ writer.write(summaryLineTemplate(data) + '\n');
+ });
+ writer.write(summaryTableFooter);
+ writer.write(footerTemplate(templateData));
+ },
+
+ writeFiles: function (writer, node, dir, collector) {
+ var that = this,
+ indexFile = path.resolve(dir, 'index.html'),
+ childFile;
+ if (this.opts.verbose) { console.error('Writing ' + indexFile); }
+ writer.writeFile(indexFile, function (contentWriter) {
+ that.writeIndexPage(contentWriter, node);
+ });
+ node.children.forEach(function (child) {
+ if (child.kind === 'dir') {
+ that.writeFiles(writer, child, path.resolve(dir, child.relativeName), collector);
+ } else {
+ childFile = path.resolve(dir, child.relativeName + '.html');
+ if (that.opts.verbose) { console.error('Writing ' + childFile); }
+ writer.writeFile(childFile, function (contentWriter) {
+ that.writeDetailPage(contentWriter, child, collector.fileCoverageFor(child.fullPath()));
+ });
+ }
+ });
+ },
+
+ standardLinkMapper: function () {
+ return {
+ fromParent: function (node) {
+ var relativeName = cleanPath(node.relativeName);
+
+ return node.kind === 'dir' ? relativeName + 'index.html' : relativeName + '.html';
+ },
+ ancestorHref: function (node, num) {
+ var href = '',
+ notDot = function(part) {
+ return part !== '.';
+ },
+ separated,
+ levels,
+ i,
+ j;
+
+ for (i = 0; i < num; i += 1) {
+ separated = cleanPath(node.relativeName).split('/').filter(notDot);
+ levels = separated.length - 1;
+ for (j = 0; j < levels; j += 1) {
+ href += '../';
+ }
+ node = node.parent;
+ }
+ return href;
+ },
+ ancestor: function (node, num) {
+ return this.ancestorHref(node, num) + 'index.html';
+ },
+ asset: function (node, name) {
+ var i = 0,
+ parent = node.parent;
+ while (parent) { i += 1; parent = parent.parent; }
+ return this.ancestorHref(node, i) + name;
+ }
+ };
+ },
+
+ writeReport: function (collector, sync) {
+ var opts = this.opts,
+ dir = opts.dir,
+ summarizer = new TreeSummarizer(),
+ writer = opts.writer || new FileWriter(sync),
+ that = this,
+ tree,
+ copyAssets = function (subdir) {
+ var srcDir = path.resolve(__dirname, '..', 'assets', subdir);
+ fs.readdirSync(srcDir).forEach(function (f) {
+ var resolvedSource = path.resolve(srcDir, f),
+ resolvedDestination = path.resolve(dir, f),
+ stat = fs.statSync(resolvedSource);
+
+ if (stat.isFile()) {
+ if (opts.verbose) {
+ console.log('Write asset: ' + resolvedDestination);
+ }
+ writer.copyFile(resolvedSource, resolvedDestination);
+ }
+ });
+ };
+
+ collector.files().forEach(function (key) {
+ summarizer.addFileCoverageSummary(key, utils.summarizeFileCoverage(collector.fileCoverageFor(key)));
+ });
+ tree = summarizer.getTreeSummary();
+ [ '.', 'vendor'].forEach(function (subdir) {
+ copyAssets(subdir);
+ });
+ writer.on('done', function () { that.emit('done'); });
+ //console.log(JSON.stringify(tree.root, undefined, 4));
+ this.writeFiles(writer, tree.root, dir, collector);
+ writer.done();
+ }
+});
+
+module.exports = HtmlReport;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/index.js
new file mode 100644
index 00000000..13e7effb
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/index.js
@@ -0,0 +1,104 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ EventEmitter = require('events').EventEmitter,
+ Factory = require('../util/factory'),
+ factory = new Factory('report', __dirname, false);
+/**
+ * An abstraction for producing coverage reports.
+ * This class is both the base class as well as a factory for `Report` implementations.
+ * All reports are event emitters and are expected to emit a `done` event when
+ * the report writing is complete.
+ *
+ * See also the `Reporter` class for easily producing multiple coverage reports
+ * with a single call.
+ *
+ * Usage
+ * -----
+ *
+ * var Report = require('istanbul').Report,
+ * report = Report.create('html'),
+ * collector = new require('istanbul').Collector;
+ *
+ * collector.add(coverageObject);
+ * report.on('done', function () { console.log('done'); });
+ * report.writeReport(collector);
+ *
+ * @class Report
+ * @module report
+ * @main report
+ * @constructor
+ * @protected
+ * @param {Object} options Optional. The options supported by a specific store implementation.
+ */
+function Report(/* options */) {
+ EventEmitter.call(this);
+}
+
+util.inherits(Report, EventEmitter);
+
+//add register, create, mix, loadAll, getReportList as class methods
+factory.bindClassMethods(Report);
+
+/**
+ * registers a new report implementation.
+ * @method register
+ * @static
+ * @param {Function} constructor the constructor function for the report. This function must have a
+ * `TYPE` property of type String, that will be used in `Report.create()`
+ */
+/**
+ * returns a report implementation of the specified type.
+ * @method create
+ * @static
+ * @param {String} type the type of report to create
+ * @param {Object} opts Optional. Options specific to the report implementation
+ * @return {Report} a new store of the specified type
+ */
+/**
+ * returns the list of available reports as an array of strings
+ * @method getReportList
+ * @static
+ * @return an array of supported report formats
+ */
+
+var proto = {
+ /**
+ * returns a one-line summary of the report
+ * @method synopsis
+ * @return {String} a description of what the report is about
+ */
+ synopsis: function () {
+ throw new Error('synopsis must be overridden');
+ },
+ /**
+ * returns a config object that has override-able keys settable via config
+ * @method getDefaultConfig
+ * @return {Object|null} an object representing keys that can be overridden via
+ * the istanbul configuration where the values are the defaults used when
+ * not specified. A null return implies no config attributes
+ */
+ getDefaultConfig: function () {
+ return null;
+ },
+ /**
+ * writes the report for a set of coverage objects added to a collector.
+ * @method writeReport
+ * @param {Collector} collector the collector for getting the set of files and coverage
+ * @param {Boolean} sync true if reports must be written synchronously, false if they can be written using asynchronous means (e.g. stream.write)
+ */
+ writeReport: function (/* collector, sync */) {
+ throw new Error('writeReport: must be overridden');
+ }
+};
+
+Object.keys(proto).forEach(function (k) {
+ Report.prototype[k] = proto[k];
+});
+
+module.exports = Report;
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json-summary.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json-summary.js
new file mode 100644
index 00000000..6ab7caae
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json-summary.js
@@ -0,0 +1,75 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ objectUtils = require('../object-utils'),
+ Writer = require('../util/file-writer'),
+ util = require('util'),
+ Report = require('./index');
+/**
+ * a `Report` implementation that produces a coverage JSON object with summary info only.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('json-summary');
+ *
+ *
+ * @class JsonSummaryReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to write the `coverage-summary.json` file. Defaults to `process.cwd()`
+ */
+function JsonSummaryReport(opts) {
+ this.opts = opts || {};
+ this.opts.dir = this.opts.dir || process.cwd();
+ this.opts.file = this.opts.file || this.getDefaultConfig().file;
+ this.opts.writer = this.opts.writer || null;
+}
+JsonSummaryReport.TYPE = 'json-summary';
+util.inherits(JsonSummaryReport, Report);
+
+Report.mix(JsonSummaryReport, {
+ synopsis: function () {
+ return 'prints a summary coverage object as JSON to a file';
+ },
+ getDefaultConfig: function () {
+ return {
+ file: 'coverage-summary.json'
+ };
+ },
+ writeReport: function (collector, sync) {
+ var outputFile = path.resolve(this.opts.dir, this.opts.file),
+ writer = this.opts.writer || new Writer(sync),
+ that = this;
+
+ var summaries = [],
+ finalSummary;
+ collector.files().forEach(function (file) {
+ summaries.push(objectUtils.summarizeFileCoverage(collector.fileCoverageFor(file)));
+ });
+ finalSummary = objectUtils.mergeSummaryObjects.apply(null, summaries);
+
+ writer.on('done', function () { that.emit('done'); });
+ writer.writeFile(outputFile, function (contentWriter) {
+ contentWriter.println("{");
+ contentWriter.write('"total":');
+ contentWriter.write(JSON.stringify(finalSummary));
+
+ collector.files().forEach(function (key) {
+ contentWriter.println(",");
+ contentWriter.write(JSON.stringify(key));
+ contentWriter.write(":");
+ contentWriter.write(JSON.stringify(objectUtils.summarizeFileCoverage(collector.fileCoverageFor(key))));
+ });
+ contentWriter.println("}");
+ });
+ writer.done();
+ }
+});
+
+module.exports = JsonSummaryReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json.js
new file mode 100644
index 00000000..2def51ac
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/json.js
@@ -0,0 +1,69 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ Writer = require('../util/file-writer'),
+ util = require('util'),
+ Report = require('./index');
+/**
+ * a `Report` implementation that produces a coverage JSON object.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('json');
+ *
+ *
+ * @class JsonReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to write the `coverage-final.json` file. Defaults to `process.cwd()`
+ */
+function JsonReport(opts) {
+ this.opts = opts || {};
+ this.opts.dir = this.opts.dir || process.cwd();
+ this.opts.file = this.opts.file || this.getDefaultConfig().file;
+ this.opts.writer = this.opts.writer || null;
+}
+JsonReport.TYPE = 'json';
+util.inherits(JsonReport, Report);
+
+Report.mix(JsonReport, {
+ synopsis: function () {
+ return 'prints the coverage object as JSON to a file';
+ },
+ getDefaultConfig: function () {
+ return {
+ file: 'coverage-final.json'
+ };
+ },
+ writeReport: function (collector, sync) {
+ var outputFile = path.resolve(this.opts.dir, this.opts.file),
+ writer = this.opts.writer || new Writer(sync),
+ that = this;
+
+ writer.on('done', function () { that.emit('done'); });
+ writer.writeFile(outputFile, function (contentWriter) {
+ var first = true;
+ contentWriter.println("{");
+ collector.files().forEach(function (key) {
+ if (first) {
+ first = false;
+ } else {
+ contentWriter.println(",");
+ }
+ contentWriter.write(JSON.stringify(key));
+ contentWriter.write(":");
+ contentWriter.write(JSON.stringify(collector.fileCoverageFor(key)));
+ });
+ contentWriter.println("}");
+ });
+ writer.done();
+ }
+});
+
+module.exports = JsonReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcov.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcov.js
new file mode 100644
index 00000000..87e01eaa
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcov.js
@@ -0,0 +1,65 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ util = require('util'),
+ mkdirp = require('mkdirp'),
+ Report = require('./index'),
+ LcovOnlyReport = require('./lcovonly'),
+ HtmlReport = require('./html');
+
+/**
+ * a `Report` implementation that produces an LCOV coverage file and an associated HTML report from coverage objects.
+ * The name and behavior of this report is designed to ease migration for projects that currently use `yuitest_coverage`
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('lcov');
+ *
+ *
+ * @class LcovReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the `lcov.info` file.
+ * HTML files are written in a subdirectory called `lcov-report`. Defaults to `process.cwd()`
+ */
+function LcovReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ var baseDir = path.resolve(opts.dir || process.cwd()),
+ htmlDir = path.resolve(baseDir, 'lcov-report');
+
+ mkdirp.sync(baseDir);
+ this.lcov = new LcovOnlyReport({ dir: baseDir, watermarks: opts.watermarks });
+ this.html = new HtmlReport({ dir: htmlDir, watermarks: opts.watermarks, sourceStore: opts.sourceStore});
+}
+
+LcovReport.TYPE = 'lcov';
+util.inherits(LcovReport, Report);
+
+Report.mix(LcovReport, {
+ synopsis: function () {
+ return 'combined lcovonly and html report that generates an lcov.info file as well as HTML';
+ },
+ writeReport: function (collector, sync) {
+ var handler = this.handleDone.bind(this);
+ this.inProgress = 2;
+ this.lcov.on('done', handler);
+ this.html.on('done', handler);
+ this.lcov.writeReport(collector, sync);
+ this.html.writeReport(collector, sync);
+ },
+ handleDone: function () {
+ this.inProgress -= 1;
+ if (this.inProgress === 0) {
+ this.emit('done');
+ }
+ }
+});
+
+module.exports = LcovReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcovonly.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcovonly.js
new file mode 100644
index 00000000..2c1be46d
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/lcovonly.js
@@ -0,0 +1,103 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ Writer = require('../util/file-writer'),
+ util = require('util'),
+ Report = require('./index'),
+ utils = require('../object-utils');
+/**
+ * a `Report` implementation that produces an LCOV coverage file from coverage objects.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('lcovonly');
+ *
+ *
+ * @class LcovOnlyReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the `lcov.info` file. Defaults to `process.cwd()`
+ */
+function LcovOnlyReport(opts) {
+ this.opts = opts || {};
+ this.opts.dir = this.opts.dir || process.cwd();
+ this.opts.file = this.opts.file || this.getDefaultConfig().file;
+ this.opts.writer = this.opts.writer || null;
+}
+LcovOnlyReport.TYPE = 'lcovonly';
+util.inherits(LcovOnlyReport, Report);
+
+Report.mix(LcovOnlyReport, {
+ synopsis: function () {
+ return 'lcov coverage report that can be consumed by the lcov tool';
+ },
+ getDefaultConfig: function () {
+ return { file: 'lcov.info' };
+ },
+ writeFileCoverage: function (writer, fc) {
+ var functions = fc.f,
+ functionMap = fc.fnMap,
+ lines = fc.l,
+ branches = fc.b,
+ branchMap = fc.branchMap,
+ summary = utils.summarizeFileCoverage(fc);
+
+ writer.println('TN:'); //no test name
+ writer.println('SF:' + fc.path);
+
+ Object.keys(functions).forEach(function (key) {
+ var meta = functionMap[key];
+ writer.println('FN:' + [ meta.line, meta.name ].join(','));
+ });
+ writer.println('FNF:' + summary.functions.total);
+ writer.println('FNH:' + summary.functions.covered);
+
+ Object.keys(functions).forEach(function (key) {
+ var stats = functions[key],
+ meta = functionMap[key];
+ writer.println('FNDA:' + [ stats, meta.name ].join(','));
+ });
+
+ Object.keys(lines).forEach(function (key) {
+ var stat = lines[key];
+ writer.println('DA:' + [ key, stat ].join(','));
+ });
+ writer.println('LF:' + summary.lines.total);
+ writer.println('LH:' + summary.lines.covered);
+
+ Object.keys(branches).forEach(function (key) {
+ var branchArray = branches[key],
+ meta = branchMap[key],
+ line = meta.line,
+ i = 0;
+ branchArray.forEach(function (b) {
+ writer.println('BRDA:' + [line, key, i, b].join(','));
+ i += 1;
+ });
+ });
+ writer.println('BRF:' + summary.branches.total);
+ writer.println('BRH:' + summary.branches.covered);
+ writer.println('end_of_record');
+ },
+
+ writeReport: function (collector, sync) {
+ var outputFile = path.resolve(this.opts.dir, this.opts.file),
+ writer = this.opts.writer || new Writer(sync),
+ that = this;
+ writer.on('done', function () { that.emit('done'); });
+ writer.writeFile(outputFile, function (contentWriter) {
+ collector.files().forEach(function (key) {
+ that.writeFileCoverage(contentWriter, collector.fileCoverageFor(key));
+ });
+ });
+ writer.done();
+ }
+});
+
+module.exports = LcovOnlyReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/none.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/none.js
new file mode 100644
index 00000000..0fd5cfca
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/none.js
@@ -0,0 +1,41 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ Report = require('./index');
+
+/**
+ * a `Report` implementation that does nothing. Use to specify that no reporting
+ * is needed.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('none');
+ *
+ *
+ * @class NoneReport
+ * @extends Report
+ * @module report
+ * @constructor
+ */
+function NoneReport() {
+ Report.call(this);
+}
+
+NoneReport.TYPE = 'none';
+util.inherits(NoneReport, Report);
+
+Report.mix(NoneReport, {
+ synopsis: function () {
+ return 'Does nothing. Useful to override default behavior and suppress reporting entirely';
+ },
+ writeReport: function (/* collector, sync */) {
+ //noop
+ this.emit('done');
+ }
+});
+
+module.exports = NoneReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/teamcity.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/teamcity.js
new file mode 100644
index 00000000..f6b90fc9
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/teamcity.js
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ util = require('util'),
+ mkdirp = require('mkdirp'),
+ fs = require('fs'),
+ utils = require('../object-utils'),
+ Report = require('./index');
+
+/**
+ * a `Report` implementation that produces system messages interpretable by TeamCity.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('teamcity');
+ *
+ * @class TeamcityReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the text coverage report will be written, when writing to a file
+ * @param {String} [opts.file] the filename for the report. When omitted, the report is written to console
+ */
+function TeamcityReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ this.dir = opts.dir || process.cwd();
+ this.file = opts.file;
+ this.blockName = opts.blockName || this.getDefaultConfig().blockName;
+}
+
+TeamcityReport.TYPE = 'teamcity';
+util.inherits(TeamcityReport, Report);
+
+function lineForKey(value, teamcityVar) {
+ return '##teamcity[buildStatisticValue key=\'' + teamcityVar + '\' value=\'' + value + '\']';
+}
+
+Report.mix(TeamcityReport, {
+ synopsis: function () {
+ return 'report with system messages that can be interpreted with TeamCity';
+ },
+ getDefaultConfig: function () {
+ return { file: null , blockName: 'Code Coverage Summary'};
+ },
+ writeReport: function (collector /*, sync */) {
+ var summaries = [],
+ finalSummary,
+ lines = [],
+ text;
+
+ collector.files().forEach(function (file) {
+ summaries.push(utils.summarizeFileCoverage(collector.fileCoverageFor(file)));
+ });
+
+ finalSummary = utils.mergeSummaryObjects.apply(null, summaries);
+
+ lines.push('');
+ lines.push('##teamcity[blockOpened name=\''+ this.blockName +'\']');
+
+ //Statements Covered
+ lines.push(lineForKey(finalSummary.statements.pct, 'CodeCoverageB'));
+
+ //Methods Covered
+ lines.push(lineForKey(finalSummary.functions.covered, 'CodeCoverageAbsMCovered'));
+ lines.push(lineForKey(finalSummary.functions.total, 'CodeCoverageAbsMTotal'));
+ lines.push(lineForKey(finalSummary.functions.pct, 'CodeCoverageM'));
+
+ //Lines Covered
+ lines.push(lineForKey(finalSummary.lines.covered, 'CodeCoverageAbsLCovered'));
+ lines.push(lineForKey(finalSummary.lines.total, 'CodeCoverageAbsLTotal'));
+ lines.push(lineForKey(finalSummary.lines.pct, 'CodeCoverageL'));
+
+ lines.push('##teamcity[blockClosed name=\''+ this.blockName +'\']');
+
+ text = lines.join('\n');
+ if (this.file) {
+ mkdirp.sync(this.dir);
+ fs.writeFileSync(path.join(this.dir, this.file), text, 'utf8');
+ } else {
+ console.log(text);
+ }
+ this.emit('done');
+ }
+});
+
+module.exports = TeamcityReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/foot.txt b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/foot.txt
new file mode 100644
index 00000000..5fdaa5ab
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/foot.txt
@@ -0,0 +1,18 @@
+
+</div>
+<div class="footer">
+ <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at {{datetime}}</div>
+</div>
+{{#if prettify}}
+<script src="{{prettify.js}}"></script>
+<script>
+window.onload = function () {
+ if (typeof prettyPrint === 'function') {
+ prettyPrint();
+ }
+};
+</script>
+{{/if}}
+<script src="{{sorter.js}}"></script>
+</body>
+</html>
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/head.txt b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/head.txt
new file mode 100644
index 00000000..cb355ff9
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/templates/head.txt
@@ -0,0 +1,36 @@
+<!doctype html>
+<html lang="en">
+<head>
+ <title>Code coverage report for {{entity}}</title>
+ <meta charset="utf-8">
+{{#if prettify}}
+ <link rel="stylesheet" href="{{prettify.css}}">
+{{/if}}
+ <link rel="stylesheet" href="{{base.css}}">
+ <style type='text/css'>
+ div.coverage-summary .sorter {
+ background-image: url({{sorter.image}});
+ }
+ </style>
+</head>
+<body>
+<div class="header {{reportClass}}">
+ <h1>Code coverage report for <span class="entity">{{entity}}</span></h1>
+ <h2>
+ {{#with metrics.statements}}
+ Statements: <span class="metric">{{pct}}% <small>({{covered}} / {{total}})</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ {{/with}}
+ {{#with metrics.branches}}
+ Branches: <span class="metric">{{pct}}% <small>({{covered}} / {{total}})</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ {{/with}}
+ {{#with metrics.functions}}
+ Functions: <span class="metric">{{pct}}% <small>({{covered}} / {{total}})</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ {{/with}}
+ {{#with metrics.lines}}
+ Lines: <span class="metric">{{pct}}% <small>({{covered}} / {{total}})</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
+ {{/with}}
+ Ignored: <span class="metric">{{#show_ignores metrics}}{{/show_ignores}}</span> &nbsp;&nbsp;&nbsp;&nbsp;
+ </h2>
+ {{{pathHtml}}}
+</div>
+<div class="body">
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-lcov.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-lcov.js
new file mode 100644
index 00000000..15e1a48c
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-lcov.js
@@ -0,0 +1,50 @@
+var LcovOnly = require('./lcovonly'),
+ util = require('util');
+
+/**
+ * a `Report` implementation that produces an LCOV coverage and prints it
+ * to standard out.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('text-lcov');
+ *
+ * @class TextLcov
+ * @module report
+ * @extends LcovOnly
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.log] the method used to log to console.
+ */
+function TextLcov(opts) {
+ var that = this;
+
+ LcovOnly.call(this);
+
+ this.opts = opts || {};
+ this.opts.log = this.opts.log || console.log;
+ this.opts.writer = {
+ println: function (ln) {
+ that.opts.log(ln);
+ }
+ };
+}
+
+TextLcov.TYPE = 'text-lcov';
+util.inherits(TextLcov, LcovOnly);
+
+LcovOnly.super_.mix(TextLcov, {
+ writeReport: function (collector) {
+ var that = this,
+ writer = this.opts.writer;
+
+ collector.files().forEach(function (key) {
+ that.writeFileCoverage(writer, collector.fileCoverageFor(key));
+ });
+
+ this.emit('done');
+ }
+});
+
+module.exports = TextLcov;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-summary.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-summary.js
new file mode 100644
index 00000000..9537cbe2
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text-summary.js
@@ -0,0 +1,93 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ util = require('util'),
+ mkdirp = require('mkdirp'),
+ defaults = require('./common/defaults'),
+ fs = require('fs'),
+ utils = require('../object-utils'),
+ Report = require('./index');
+
+/**
+ * a `Report` implementation that produces text output for overall coverage in summary format.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('text-summary');
+ *
+ * @class TextSummaryReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the text coverage report will be written, when writing to a file
+ * @param {String} [opts.file] the filename for the report. When omitted, the report is written to console
+ */
+function TextSummaryReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ this.dir = opts.dir || process.cwd();
+ this.file = opts.file;
+ this.watermarks = opts.watermarks || defaults.watermarks();
+}
+
+TextSummaryReport.TYPE = 'text-summary';
+util.inherits(TextSummaryReport, Report);
+
+function lineForKey(summary, key, watermarks) {
+ var metrics = summary[key],
+ skipped,
+ result,
+ clazz = defaults.classFor(key, summary, watermarks);
+ key = key.substring(0, 1).toUpperCase() + key.substring(1);
+ if (key.length < 12) { key += ' '.substring(0, 12 - key.length); }
+ result = [ key , ':', metrics.pct + '%', '(', metrics.covered + '/' + metrics.total, ')'].join(' ');
+ skipped = metrics.skipped;
+ if (skipped > 0) {
+ result += ', ' + skipped + ' ignored';
+ }
+ return defaults.colorize(result, clazz);
+}
+
+Report.mix(TextSummaryReport, {
+ synopsis: function () {
+ return 'text report that prints a coverage summary across all files, typically to console';
+ },
+ getDefaultConfig: function () {
+ return { file: null };
+ },
+ writeReport: function (collector /*, sync */) {
+ var summaries = [],
+ finalSummary,
+ lines = [],
+ watermarks = this.watermarks,
+ text;
+ collector.files().forEach(function (file) {
+ summaries.push(utils.summarizeFileCoverage(collector.fileCoverageFor(file)));
+ });
+ finalSummary = utils.mergeSummaryObjects.apply(null, summaries);
+ lines.push('');
+ lines.push('=============================== Coverage summary ===============================');
+ lines.push.apply(lines, [
+ lineForKey(finalSummary, 'statements', watermarks),
+ lineForKey(finalSummary, 'branches', watermarks),
+ lineForKey(finalSummary, 'functions', watermarks),
+ lineForKey(finalSummary, 'lines', watermarks)
+ ]);
+ lines.push('================================================================================');
+ text = lines.join('\n');
+ if (this.file) {
+ mkdirp.sync(this.dir);
+ fs.writeFileSync(path.join(this.dir, this.file), text, 'utf8');
+ } else {
+ console.log(text);
+ }
+ this.emit('done');
+ }
+});
+
+module.exports = TextSummaryReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text.js
new file mode 100644
index 00000000..8ab2b7d1
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/report/text.js
@@ -0,0 +1,234 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ mkdirp = require('mkdirp'),
+ util = require('util'),
+ fs = require('fs'),
+ defaults = require('./common/defaults'),
+ Report = require('./index'),
+ TreeSummarizer = require('../util/tree-summarizer'),
+ utils = require('../object-utils'),
+ PCT_COLS = 9,
+ MISSING_COL = 15,
+ TAB_SIZE = 1,
+ DELIM = ' |',
+ COL_DELIM = '-|';
+
+/**
+ * a `Report` implementation that produces text output in a detailed table.
+ *
+ * Usage
+ * -----
+ *
+ * var report = require('istanbul').Report.create('text');
+ *
+ * @class TextReport
+ * @extends Report
+ * @module report
+ * @constructor
+ * @param {Object} opts optional
+ * @param {String} [opts.dir] the directory in which to the text coverage report will be written, when writing to a file
+ * @param {String} [opts.file] the filename for the report. When omitted, the report is written to console
+ * @param {Number} [opts.maxCols] the max column width of the report. By default, the width of the report is adjusted based on the length of the paths
+ * to be reported.
+ */
+function TextReport(opts) {
+ Report.call(this);
+ opts = opts || {};
+ this.dir = opts.dir || process.cwd();
+ this.file = opts.file;
+ this.summary = opts.summary;
+ this.maxCols = opts.maxCols || 0;
+ this.watermarks = opts.watermarks || defaults.watermarks();
+}
+
+TextReport.TYPE = 'text';
+util.inherits(TextReport, Report);
+
+function padding(num, ch) {
+ var str = '',
+ i;
+ ch = ch || ' ';
+ for (i = 0; i < num; i += 1) {
+ str += ch;
+ }
+ return str;
+}
+
+function fill(str, width, right, tabs, clazz) {
+ tabs = tabs || 0;
+ str = String(str);
+
+ var leadingSpaces = tabs * TAB_SIZE,
+ remaining = width - leadingSpaces,
+ leader = padding(leadingSpaces),
+ fmtStr = '',
+ fillStr,
+ strlen = str.length;
+
+ if (remaining > 0) {
+ if (remaining >= strlen) {
+ fillStr = padding(remaining - strlen);
+ fmtStr = right ? fillStr + str : str + fillStr;
+ } else {
+ fmtStr = str.substring(strlen - remaining);
+ fmtStr = '... ' + fmtStr.substring(4);
+ }
+ }
+
+ fmtStr = defaults.colorize(fmtStr, clazz);
+ return leader + fmtStr;
+}
+
+function formatName(name, maxCols, level, clazz) {
+ return fill(name, maxCols, false, level, clazz);
+}
+
+function formatPct(pct, clazz, width) {
+ return fill(pct, width || PCT_COLS, true, 0, clazz);
+}
+
+function nodeName(node) {
+ return node.displayShortName() || 'All files';
+}
+
+function tableHeader(maxNameCols) {
+ var elements = [];
+ elements.push(formatName('File', maxNameCols, 0));
+ elements.push(formatPct('% Stmts'));
+ elements.push(formatPct('% Branch'));
+ elements.push(formatPct('% Funcs'));
+ elements.push(formatPct('% Lines'));
+ elements.push(formatPct('Uncovered Lines', undefined, MISSING_COL));
+ return elements.join(' |') + ' |';
+}
+
+function collectMissingLines(kind, linesCovered) {
+ var missingLines = [];
+
+ if (kind !== 'file') {
+ return [];
+ }
+
+ Object.keys(linesCovered).forEach(function (key) {
+ if (!linesCovered[key]) {
+ missingLines.push(key);
+ }
+ });
+
+ return missingLines;
+}
+
+function tableRow(node, maxNameCols, level, watermarks) {
+ var name = nodeName(node),
+ statements = node.metrics.statements.pct,
+ branches = node.metrics.branches.pct,
+ functions = node.metrics.functions.pct,
+ lines = node.metrics.lines.pct,
+ missingLines = collectMissingLines(node.kind, node.metrics.linesCovered),
+ elements = [];
+
+ elements.push(formatName(name, maxNameCols, level, defaults.classFor('statements', node.metrics, watermarks)));
+ elements.push(formatPct(statements, defaults.classFor('statements', node.metrics, watermarks)));
+ elements.push(formatPct(branches, defaults.classFor('branches', node.metrics, watermarks)));
+ elements.push(formatPct(functions, defaults.classFor('functions', node.metrics, watermarks)));
+ elements.push(formatPct(lines, defaults.classFor('lines', node.metrics, watermarks)));
+ elements.push(formatPct(missingLines.join(','), 'low', MISSING_COL));
+
+ return elements.join(DELIM) + DELIM;
+}
+
+function findNameWidth(node, level, last) {
+ last = last || 0;
+ level = level || 0;
+ var idealWidth = TAB_SIZE * level + nodeName(node).length;
+ if (idealWidth > last) {
+ last = idealWidth;
+ }
+ node.children.forEach(function (child) {
+ last = findNameWidth(child, level + 1, last);
+ });
+ return last;
+}
+
+function makeLine(nameWidth) {
+ var name = padding(nameWidth, '-'),
+ pct = padding(PCT_COLS, '-'),
+ elements = [];
+
+ elements.push(name);
+ elements.push(pct);
+ elements.push(pct);
+ elements.push(pct);
+ elements.push(pct);
+ elements.push(padding(MISSING_COL, '-'));
+ return elements.join(COL_DELIM) + COL_DELIM;
+}
+
+function walk(node, nameWidth, array, level, watermarks) {
+ var line;
+ if (level === 0) {
+ line = makeLine(nameWidth);
+ array.push(line);
+ array.push(tableHeader(nameWidth));
+ array.push(line);
+ } else {
+ array.push(tableRow(node, nameWidth, level, watermarks));
+ }
+ node.children.forEach(function (child) {
+ walk(child, nameWidth, array, level + 1, watermarks);
+ });
+ if (level === 0) {
+ array.push(line);
+ array.push(tableRow(node, nameWidth, level, watermarks));
+ array.push(line);
+ }
+}
+
+Report.mix(TextReport, {
+ synopsis: function () {
+ return 'text report that prints a coverage line for every file, typically to console';
+ },
+ getDefaultConfig: function () {
+ return { file: null, maxCols: 0 };
+ },
+ writeReport: function (collector /*, sync */) {
+ var summarizer = new TreeSummarizer(),
+ tree,
+ root,
+ nameWidth,
+ statsWidth = 4 * (PCT_COLS + 2) + MISSING_COL,
+ maxRemaining,
+ strings = [],
+ text;
+
+ collector.files().forEach(function (key) {
+ summarizer.addFileCoverageSummary(key, utils.summarizeFileCoverage(
+ collector.fileCoverageFor(key)
+ ));
+ });
+ tree = summarizer.getTreeSummary();
+ root = tree.root;
+ nameWidth = findNameWidth(root);
+ if (this.maxCols > 0) {
+ maxRemaining = this.maxCols - statsWidth - 2;
+ if (nameWidth > maxRemaining) {
+ nameWidth = maxRemaining;
+ }
+ }
+ walk(root, nameWidth, strings, 0, this.watermarks);
+ text = strings.join('\n') + '\n';
+ if (this.file) {
+ mkdirp.sync(this.dir);
+ fs.writeFileSync(path.join(this.dir, this.file), text, 'utf8');
+ } else {
+ console.log(text);
+ }
+ this.emit('done');
+ }
+});
+
+module.exports = TextReport;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/reporter.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/reporter.js
new file mode 100644
index 00000000..c7000d5b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/reporter.js
@@ -0,0 +1,111 @@
+/*
+ Copyright (c) 2014, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+var Report = require('./report'),
+ configuration = require('./config'),
+ inputError = require('./util/input-error');
+
+/**
+ * convenience mechanism to write one or more reports ensuring that config
+ * options are respected.
+ * Usage
+ * -----
+ *
+ * var fs = require('fs'),
+ * reporter = new require('istanbul').Reporter(),
+ * collector = new require('istanbul').Collector(),
+ * sync = true;
+ *
+ * collector.add(JSON.parse(fs.readFileSync('coverage.json', 'utf8')));
+ * reporter.add('lcovonly');
+ * reporter.addAll(['clover', 'cobertura']);
+ * reporter.write(collector, sync, function () { console.log('done'); });
+ *
+ * @class Reporter
+ * @param {Configuration} cfg the config object, a falsy value will load the
+ * default configuration instead
+ * @param {String} dir the directory in which to write the reports, may be falsy
+ * to use config or global defaults
+ * @constructor
+ * @module main
+ */
+function Reporter(cfg, dir) {
+ this.config = cfg || configuration.loadFile();
+ this.dir = dir || this.config.reporting.dir();
+ this.reports = {};
+}
+
+Reporter.prototype = {
+ /**
+ * adds a report to be generated. Must be one of the entries returned
+ * by `Report.getReportList()`
+ * @method add
+ * @param {String} fmt the format of the report to generate
+ */
+ add: function (fmt) {
+ if (this.reports[fmt]) { // already added
+ return;
+ }
+ var config = this.config,
+ rptConfig = config.reporting.reportConfig()[fmt] || {};
+ rptConfig.verbose = config.verbose;
+ rptConfig.dir = this.dir;
+ rptConfig.watermarks = config.reporting.watermarks();
+ try {
+ this.reports[fmt] = Report.create(fmt, rptConfig);
+ } catch (ex) {
+ throw inputError.create('Invalid report format [' + fmt + ']');
+ }
+ },
+ /**
+ * adds an array of report formats to be generated
+ * @method addAll
+ * @param {Array} fmts an array of report formats
+ */
+ addAll: function (fmts) {
+ var that = this;
+ fmts.forEach(function (f) {
+ that.add(f);
+ });
+ },
+ /**
+ * writes all reports added and calls the callback when done
+ * @method write
+ * @param {Collector} collector the collector having the coverage data
+ * @param {Boolean} sync true to write reports synchronously
+ * @param {Function} callback the callback to call when done. When `sync`
+ * is true, the callback will be called in the same process tick.
+ */
+ write: function (collector, sync, callback) {
+ var reports = this.reports,
+ verbose = this.config.verbose,
+ handler = this.handleDone.bind(this, callback);
+
+ this.inProgress = Object.keys(reports).length;
+
+ Object.keys(reports).forEach(function (name) {
+ var report = reports[name];
+ if (verbose) {
+ console.error('Write report: ' + name);
+ }
+ report.on('done', handler);
+ report.writeReport(collector, sync);
+ });
+ },
+ /*
+ * handles listening on all reports to be completed before calling the callback
+ * @method handleDone
+ * @private
+ * @param {Function} callback the callback to call when all reports are
+ * written
+ */
+ handleDone: function (callback) {
+ this.inProgress -= 1;
+ if (this.inProgress === 0) {
+ return callback();
+ }
+ }
+};
+
+module.exports = Reporter;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/fslookup.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/fslookup.js
new file mode 100644
index 00000000..b00cc179
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/fslookup.js
@@ -0,0 +1,61 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ fs = require('fs'),
+ Store = require('./index');
+
+/**
+ * a `Store` implementation that doesn't actually store anything. It assumes that keys
+ * are absolute file paths, and contents are contents of those files.
+ * Thus, `set` for this store is no-op, `get` returns the
+ * contents of the filename that the key represents, `hasKey` returns true if the key
+ * supplied is a valid file path and `keys` always returns an empty array.
+ *
+ * Usage
+ * -----
+ *
+ * var store = require('istanbul').Store.create('fslookup');
+ *
+ *
+ * @class LookupStore
+ * @extends Store
+ * @module store
+ * @constructor
+ */
+function LookupStore(opts) {
+ Store.call(this, opts);
+}
+
+LookupStore.TYPE = 'fslookup';
+util.inherits(LookupStore, Store);
+
+Store.mix(LookupStore, {
+ keys: function () {
+ return [];
+ },
+ get: function (key) {
+ return fs.readFileSync(key, 'utf8');
+ },
+ hasKey: function (key) {
+ var stats;
+ try {
+ stats = fs.statSync(key);
+ return stats.isFile();
+ } catch (ex) {
+ return false;
+ }
+ },
+ set: function (key /*, contents */) {
+ if (!this.hasKey(key)) {
+ throw new Error('Attempt to set contents for non-existent file [' + key + '] on a fslookup store');
+ }
+ return key;
+ }
+});
+
+
+module.exports = LookupStore;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/index.js
new file mode 100644
index 00000000..85ffc4f0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/index.js
@@ -0,0 +1,123 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var Factory = require('../util/factory'),
+ factory = new Factory('store', __dirname, false);
+/**
+ * An abstraction for keeping track of content against some keys (e.g.
+ * original source, instrumented source, coverage objects against file names).
+ * This class is both the base class as well as a factory for `Store` implementations.
+ *
+ * Usage
+ * -----
+ *
+ * var Store = require('istanbul').Store,
+ * store = Store.create('memory');
+ *
+ * //basic use
+ * store.set('foo', 'foo-content');
+ * var content = store.get('foo');
+ *
+ * //keys and values
+ * store.keys().forEach(function (key) {
+ * console.log(key + ':\n' + store.get(key);
+ * });
+ * if (store.hasKey('bar') { console.log(store.get('bar'); }
+ *
+ *
+ * //syntactic sugar
+ * store.setObject('foo', { foo: true });
+ * console.log(store.getObject('foo').foo);
+ *
+ * store.dispose();
+ *
+ * @class Store
+ * @constructor
+ * @module store
+ * @param {Object} options Optional. The options supported by a specific store implementation.
+ * @main store
+ */
+function Store(/* options */) {}
+
+//add register, create, mix, loadAll, getStoreList as class methods
+factory.bindClassMethods(Store);
+
+/**
+ * registers a new store implementation.
+ * @method register
+ * @static
+ * @param {Function} constructor the constructor function for the store. This function must have a
+ * `TYPE` property of type String, that will be used in `Store.create()`
+ */
+/**
+ * returns a store implementation of the specified type.
+ * @method create
+ * @static
+ * @param {String} type the type of store to create
+ * @param {Object} opts Optional. Options specific to the store implementation
+ * @return {Store} a new store of the specified type
+ */
+
+Store.prototype = {
+ /**
+ * sets some content associated with a specific key. The manner in which
+ * duplicate keys are handled for multiple `set()` calls with the same
+ * key is implementation-specific.
+ *
+ * @method set
+ * @param {String} key the key for the content
+ * @param {String} contents the contents for the key
+ */
+ set: function (/* key, contents */) { throw new Error("set: must be overridden"); },
+ /**
+ * returns the content associated to a specific key or throws if the key
+ * was not `set`
+ * @method get
+ * @param {String} key the key for which to get the content
+ * @return {String} the content for the specified key
+ */
+ get: function (/* key */) { throw new Error("get: must be overridden"); },
+ /**
+ * returns a list of all known keys
+ * @method keys
+ * @return {Array} an array of seen keys
+ */
+ keys: function () { throw new Error("keys: must be overridden"); },
+ /**
+ * returns true if the key is one for which a `get()` call would work.
+ * @method hasKey
+ * @param {String} key
+ * @return true if the key is valid for this store, false otherwise
+ */
+ hasKey: function (/* key */) { throw new Error("hasKey: must be overridden"); },
+ /**
+ * lifecycle method to dispose temporary resources associated with the store
+ * @method dispose
+ */
+ dispose: function () {},
+ /**
+ * sugar method to return an object associated with a specific key. Throws
+ * if the content set against the key was not a valid JSON string.
+ * @method getObject
+ * @param {String} key the key for which to return the associated object
+ * @return {Object} the object corresponding to the key
+ */
+ getObject: function (key) {
+ return JSON.parse(this.get(key));
+ },
+ /**
+ * sugar method to set an object against a specific key.
+ * @method setObject
+ * @param {String} key the key for the object
+ * @param {Object} object the object to be stored
+ */
+ setObject: function (key, object) {
+ return this.set(key, JSON.stringify(object));
+ }
+};
+
+module.exports = Store;
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/memory.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/memory.js
new file mode 100644
index 00000000..ff96fbd3
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/memory.js
@@ -0,0 +1,56 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ Store = require('./index');
+
+/**
+ * a `Store` implementation using an in-memory object.
+ *
+ * Usage
+ * -----
+ *
+ * var store = require('istanbul').Store.create('memory');
+ *
+ *
+ * @class MemoryStore
+ * @extends Store
+ * @module store
+ * @constructor
+ */
+function MemoryStore() {
+ Store.call(this);
+ this.map = {};
+}
+
+MemoryStore.TYPE = 'memory';
+util.inherits(MemoryStore, Store);
+
+Store.mix(MemoryStore, {
+ set: function (key, contents) {
+ this.map[key] = contents;
+ },
+
+ get: function (key) {
+ if (!this.hasKey(key)) {
+ throw new Error('Unable to find entry for [' + key + ']');
+ }
+ return this.map[key];
+ },
+
+ hasKey: function (key) {
+ return this.map.hasOwnProperty(key);
+ },
+
+ keys: function () {
+ return Object.keys(this.map);
+ },
+
+ dispose: function () {
+ this.map = {};
+ }
+});
+
+module.exports = MemoryStore;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/tmp.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/tmp.js
new file mode 100644
index 00000000..d596fb13
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/store/tmp.js
@@ -0,0 +1,81 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ path = require('path'),
+ os = require('os'),
+ fs = require('fs'),
+ mkdirp = require('mkdirp'),
+ Store = require('./index');
+
+function makeTempDir() {
+ var dir = path.join(os.tmpDir ? os.tmpDir() : /* istanbul ignore next */ (process.env.TMPDIR || '/tmp'), 'ts' + new Date().getTime());
+ mkdirp.sync(dir);
+ return dir;
+}
+/**
+ * a `Store` implementation using temporary files.
+ *
+ * Usage
+ * -----
+ *
+ * var store = require('istanbul').Store.create('tmp');
+ *
+ *
+ * @class TmpStore
+ * @extends Store
+ * @module store
+ * @param {Object} opts Optional.
+ * @param {String} [opts.tmp] a pre-existing directory to use as the `tmp` directory. When not specified, a random directory
+ * is created under `os.tmpDir()`
+ * @constructor
+ */
+function TmpStore(opts) {
+ opts = opts || {};
+ this.tmp = opts.tmp || makeTempDir();
+ this.map = {};
+ this.seq = 0;
+ this.prefix = 't' + new Date().getTime() + '-';
+}
+
+TmpStore.TYPE = 'tmp';
+util.inherits(TmpStore, Store);
+
+Store.mix(TmpStore, {
+ generateTmpFileName: function () {
+ this.seq += 1;
+ return this.prefix + this.seq + '.tmp';
+ },
+
+ set: function (key, contents) {
+ var tmpFile = this.generateTmpFileName();
+ fs.writeFileSync(tmpFile, contents, 'utf8');
+ this.map[key] = tmpFile;
+ },
+
+ get: function (key) {
+ var tmpFile = this.map[key];
+ if (!tmpFile) { throw new Error('Unable to find tmp entry for [' + tmpFile + ']'); }
+ return fs.readFileSync(tmpFile, 'utf8');
+ },
+
+ hasKey: function (key) {
+ return !!this.map[key];
+ },
+
+ keys: function () {
+ return Object.keys(this.map);
+ },
+
+ dispose: function () {
+ var map = this.map;
+ Object.keys(map).forEach(function (key) {
+ fs.unlinkSync(map[key]);
+ });
+ this.map = {};
+ }
+});
+
+module.exports = TmpStore;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/factory.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/factory.js
new file mode 100644
index 00000000..9f3d6f36
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/factory.js
@@ -0,0 +1,88 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ path = require('path'),
+ fs = require('fs'),
+ abbrev = require('abbrev');
+
+function Factory(kind, dir, allowAbbreviations) {
+ this.kind = kind;
+ this.dir = dir;
+ this.allowAbbreviations = allowAbbreviations;
+ this.classMap = {};
+ this.abbreviations = null;
+}
+
+Factory.prototype = {
+
+ knownTypes: function () {
+ var keys = Object.keys(this.classMap);
+ keys.sort();
+ return keys;
+ },
+
+ resolve: function (abbreviatedType) {
+ if (!this.abbreviations) {
+ this.abbreviations = abbrev(this.knownTypes());
+ }
+ return this.abbreviations[abbreviatedType];
+ },
+
+ register: function (constructor) {
+ var type = constructor.TYPE;
+ if (!type) { throw new Error('Could not register ' + this.kind + ' constructor [no TYPE property]: ' + util.inspect(constructor)); }
+ this.classMap[type] = constructor;
+ this.abbreviations = null;
+ },
+
+ create: function (type, opts) {
+ var allowAbbrev = this.allowAbbreviations,
+ realType = allowAbbrev ? this.resolve(type) : type,
+ Cons;
+
+ Cons = realType ? this.classMap[realType] : null;
+ if (!Cons) { throw new Error('Invalid ' + this.kind + ' [' + type + '], allowed values are ' + this.knownTypes().join(', ')); }
+ return new Cons(opts);
+ },
+
+ loadStandard: function (dir) {
+ var that = this;
+ fs.readdirSync(dir).forEach(function (file) {
+ if (file !== 'index.js' && file.indexOf('.js') === file.length - 3) {
+ try {
+ that.register(require(path.resolve(dir, file)));
+ } catch (ex) {
+ console.error(ex.message);
+ console.error(ex.stack);
+ throw new Error('Could not register ' + that.kind + ' from file ' + file);
+ }
+ }
+ });
+ },
+
+ bindClassMethods: function (Cons) {
+ var tmpKind = this.kind.charAt(0).toUpperCase() + this.kind.substring(1), //ucfirst
+ allowAbbrev = this.allowAbbreviations;
+
+ Cons.mix = Factory.mix;
+ Cons.register = this.register.bind(this);
+ Cons.create = this.create.bind(this);
+ Cons.loadAll = this.loadStandard.bind(this, this.dir);
+ Cons['get' + tmpKind + 'List'] = this.knownTypes.bind(this);
+ if (allowAbbrev) {
+ Cons['resolve' + tmpKind + 'Name'] = this.resolve.bind(this);
+ }
+ }
+};
+
+Factory.mix = function (cons, proto) {
+ Object.keys(proto).forEach(function (key) {
+ cons.prototype[key] = proto[key];
+ });
+};
+
+module.exports = Factory;
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-matcher.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-matcher.js
new file mode 100644
index 00000000..fc5dc25f
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-matcher.js
@@ -0,0 +1,76 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var async = require('async'),
+ fileset = require('fileset'),
+ fs = require('fs'),
+ path = require('path'),
+ seq = 0;
+
+function filesFor(options, callback) {
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ options = options || {};
+
+ var root = options.root,
+ includes = options.includes,
+ excludes = options.excludes,
+ realpath = options.realpath,
+ relative = options.relative,
+ opts;
+
+ root = root || process.cwd();
+ includes = includes && Array.isArray(includes) ? includes : [ '**/*.js' ];
+ excludes = excludes && Array.isArray(excludes) ? excludes : [ '**/node_modules/**' ];
+
+ opts = { cwd: root, nodir: true };
+ seq += 1;
+ opts['x' + seq + new Date().getTime()] = true; //cache buster for minimatch cache bug
+ fileset(includes.join(' '), excludes.join(' '), opts, function (err, files) {
+ if (err) { return callback(err); }
+ if (relative) { return callback(err, files); }
+
+ if (!realpath) {
+ files = files.map(function (file) { return path.resolve(root, file); });
+ return callback(err, files);
+ }
+
+ var realPathCache = module.constructor._realpathCache || {};
+
+ async.map(files, function (file, done) {
+ fs.realpath(path.resolve(root, file), realPathCache, done);
+ }, callback);
+ });
+}
+
+function matcherFor(options, callback) {
+
+ if (!callback && typeof options === 'function') {
+ callback = options;
+ options = null;
+ }
+ options = options || {};
+ options.relative = false; //force absolute paths
+ options.realpath = true; //force real paths (to match Node.js module paths)
+
+ filesFor(options, function (err, files) {
+ var fileMap = {},
+ matchFn;
+ if (err) { return callback(err); }
+ files.forEach(function (file) { fileMap[file] = true; });
+
+ matchFn = function (file) { return fileMap[file]; };
+ matchFn.files = Object.keys(fileMap);
+ return callback(null, matchFn);
+ });
+}
+
+module.exports = {
+ filesFor: filesFor,
+ matcherFor: matcherFor
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-writer.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-writer.js
new file mode 100644
index 00000000..3367dcc8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/file-writer.js
@@ -0,0 +1,154 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ util = require('util'),
+ fs = require('fs'),
+ async = require('async'),
+ mkdirp = require('mkdirp'),
+ writer = require('./writer'),
+ Writer = writer.Writer,
+ ContentWriter = writer.ContentWriter;
+
+function extend(cons, proto) {
+ Object.keys(proto).forEach(function (k) {
+ cons.prototype[k] = proto[k];
+ });
+}
+
+function BufferedContentWriter() {
+ ContentWriter.call(this);
+ this.content = '';
+}
+util.inherits(BufferedContentWriter, ContentWriter);
+
+extend(BufferedContentWriter, {
+ write: function (str) {
+ this.content += str;
+ },
+ getContent: function () {
+ return this.content;
+ }
+});
+
+function StreamContentWriter(stream) {
+ ContentWriter.call(this);
+ this.stream = stream;
+}
+util.inherits(StreamContentWriter, ContentWriter);
+
+extend(StreamContentWriter, {
+ write: function (str) {
+ this.stream.write(str);
+ }
+});
+
+function SyncFileWriter() {
+ Writer.call(this);
+}
+util.inherits(SyncFileWriter, Writer);
+
+extend(SyncFileWriter, {
+ writeFile: function (file, callback) {
+ mkdirp.sync(path.dirname(file));
+ var cw = new BufferedContentWriter();
+ callback(cw);
+ fs.writeFileSync(file, cw.getContent(), 'utf8');
+ },
+ done: function () {
+ this.emit('done'); //everything already done
+ }
+});
+
+function AsyncFileWriter() {
+ this.queue = async.queue(this.processFile.bind(this), 20);
+ this.openFileMap = {};
+}
+
+util.inherits(AsyncFileWriter, Writer);
+
+extend(AsyncFileWriter, {
+ writeFile: function (file, callback) {
+ this.openFileMap[file] = true;
+ this.queue.push({ file: file, callback: callback });
+ },
+ processFile: function (task, cb) {
+ var file = task.file,
+ userCallback = task.callback,
+ that = this,
+ stream,
+ contentWriter;
+
+ mkdirp.sync(path.dirname(file));
+ stream = fs.createWriteStream(file);
+ stream.on('close', function () {
+ delete that.openFileMap[file];
+ cb();
+ that.checkDone();
+ });
+ stream.on('error', function (err) { that.emit('error', err); });
+ contentWriter = new StreamContentWriter(stream);
+ userCallback(contentWriter);
+ stream.end();
+ },
+ done: function () {
+ this.doneCalled = true;
+ this.checkDone();
+ },
+ checkDone: function () {
+ if (!this.doneCalled) { return; }
+ if (Object.keys(this.openFileMap).length === 0) {
+ this.emit('done');
+ }
+ }
+});
+/**
+ * a concrete writer implementation that can write files synchronously or
+ * asynchronously based on the constructor argument passed to it.
+ *
+ * Usage
+ * -----
+ *
+ * var sync = true,
+ * fileWriter = new require('istanbul').FileWriter(sync);
+ *
+ * fileWriter.on('done', function () { console.log('done'); });
+ * fileWriter.copyFile('/foo/bar.jpg', '/baz/bar.jpg');
+ * fileWriter.writeFile('/foo/index.html', function (contentWriter) {
+ * contentWriter.println('<html>');
+ * contentWriter.println('</html>');
+ * });
+ * fileWriter.done(); // will emit the `done` event when all files are written
+ *
+ * @class FileWriter
+ * @extends Writer
+ * @module io
+ * @param sync
+ * @constructor
+ */
+function FileWriter(sync) {
+ Writer.call(this);
+ var that = this;
+ this.delegate = sync ? new SyncFileWriter() : new AsyncFileWriter();
+ this.delegate.on('error', function (err) { that.emit('error', err); });
+ this.delegate.on('done', function () { that.emit('done'); });
+}
+
+util.inherits(FileWriter, Writer);
+
+extend(FileWriter, {
+ copyFile: function (source, dest) {
+ mkdirp.sync(path.dirname(dest));
+ fs.writeFileSync(dest, fs.readFileSync(source));
+ },
+ writeFile: function (file, callback) {
+ this.delegate.writeFile(file, callback);
+ },
+ done: function () {
+ this.delegate.done();
+ }
+});
+
+module.exports = FileWriter; \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/help-formatter.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/help-formatter.js
new file mode 100644
index 00000000..8d9136ac
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/help-formatter.js
@@ -0,0 +1,30 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var OPT_PREFIX = " ",
+ OPT_START = OPT_PREFIX.length,
+ TEXT_START = 14,
+ STOP = 80,
+ wrap = require('wordwrap')(TEXT_START, STOP),
+ paraWrap = require('wordwrap')(1, STOP);
+
+function formatPara(text) {
+ return paraWrap(text);
+}
+
+function formatOption(option, helpText) {
+ var formattedText = wrap(helpText);
+
+ if (option.length > TEXT_START - OPT_START - 2) {
+ return OPT_PREFIX + option + '\n' + formattedText;
+ } else {
+ return OPT_PREFIX + option + formattedText.substring((OPT_PREFIX + option).length);
+ }
+}
+
+module.exports = {
+ formatPara: formatPara,
+ formatOption: formatOption
+}; \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/input-error.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/input-error.js
new file mode 100644
index 00000000..488b71a0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/input-error.js
@@ -0,0 +1,12 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+module.exports.create = function (message) {
+ var err = new Error(message);
+ err.inputError = true;
+ return err;
+};
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/insertion-text.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/insertion-text.js
new file mode 100644
index 00000000..d257643f
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/insertion-text.js
@@ -0,0 +1,109 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+function InsertionText(text, consumeBlanks) {
+ this.text = text;
+ this.origLength = text.length;
+ this.offsets = [];
+ this.consumeBlanks = consumeBlanks;
+ this.startPos = this.findFirstNonBlank();
+ this.endPos = this.findLastNonBlank();
+}
+
+var WHITE_RE = /[ \f\n\r\t\v\u00A0\u2028\u2029]/;
+
+InsertionText.prototype = {
+
+ findFirstNonBlank: function () {
+ var pos = -1,
+ text = this.text,
+ len = text.length,
+ i;
+ for (i = 0; i < len; i += 1) {
+ if (!text.charAt(i).match(WHITE_RE)) {
+ pos = i;
+ break;
+ }
+ }
+ return pos;
+ },
+ findLastNonBlank: function () {
+ var text = this.text,
+ len = text.length,
+ pos = text.length + 1,
+ i;
+ for (i = len - 1; i >= 0; i -= 1) {
+ if (!text.charAt(i).match(WHITE_RE)) {
+ pos = i;
+ break;
+ }
+ }
+ return pos;
+ },
+ originalLength: function () {
+ return this.origLength;
+ },
+
+ insertAt: function (col, str, insertBefore, consumeBlanks) {
+ consumeBlanks = typeof consumeBlanks === 'undefined' ? this.consumeBlanks : consumeBlanks;
+ col = col > this.originalLength() ? this.originalLength() : col;
+ col = col < 0 ? 0 : col;
+
+ if (consumeBlanks) {
+ if (col <= this.startPos) {
+ col = 0;
+ }
+ if (col > this.endPos) {
+ col = this.origLength;
+ }
+ }
+
+ var len = str.length,
+ offset = this.findOffset(col, len, insertBefore),
+ realPos = col + offset,
+ text = this.text;
+ this.text = text.substring(0, realPos) + str + text.substring(realPos);
+ return this;
+ },
+
+ findOffset: function (pos, len, insertBefore) {
+ var offsets = this.offsets,
+ offsetObj,
+ cumulativeOffset = 0,
+ i;
+
+ for (i = 0; i < offsets.length; i += 1) {
+ offsetObj = offsets[i];
+ if (offsetObj.pos < pos || (offsetObj.pos === pos && !insertBefore)) {
+ cumulativeOffset += offsetObj.len;
+ }
+ if (offsetObj.pos >= pos) {
+ break;
+ }
+ }
+ if (offsetObj && offsetObj.pos === pos) {
+ offsetObj.len += len;
+ } else {
+ offsets.splice(i, 0, { pos: pos, len: len });
+ }
+ return cumulativeOffset;
+ },
+
+ wrap: function (startPos, startText, endPos, endText, consumeBlanks) {
+ this.insertAt(startPos, startText, true, consumeBlanks);
+ this.insertAt(endPos, endText, false, consumeBlanks);
+ return this;
+ },
+
+ wrapLine: function (startText, endText) {
+ this.wrap(0, startText, this.originalLength(), endText);
+ },
+
+ toString: function () {
+ return this.text;
+ }
+};
+
+module.exports = InsertionText; \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/meta.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/meta.js
new file mode 100644
index 00000000..0384459b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/meta.js
@@ -0,0 +1,13 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+var path = require('path'),
+ fs = require('fs'),
+ pkg = JSON.parse(fs.readFileSync(path.resolve(__dirname, '..', '..', 'package.json'), 'utf8'));
+
+module.exports = {
+ NAME: pkg.name,
+ VERSION: pkg.version
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/tree-summarizer.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/tree-summarizer.js
new file mode 100644
index 00000000..df350f50
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/tree-summarizer.js
@@ -0,0 +1,213 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var path = require('path'),
+ SEP = path.sep || '/',
+ utils = require('../object-utils');
+
+function commonArrayPrefix(first, second) {
+ var len = first.length < second.length ? first.length : second.length,
+ i,
+ ret = [];
+ for (i = 0; i < len; i += 1) {
+ if (first[i] === second[i]) {
+ ret.push(first[i]);
+ } else {
+ break;
+ }
+ }
+ return ret;
+}
+
+function findCommonArrayPrefix(args) {
+ if (args.length === 0) {
+ return [];
+ }
+
+ var separated = args.map(function (arg) { return arg.split(SEP); }),
+ ret = separated.pop();
+
+ if (separated.length === 0) {
+ return ret.slice(0, ret.length - 1);
+ } else {
+ return separated.reduce(commonArrayPrefix, ret);
+ }
+}
+
+function Node(fullName, kind, metrics) {
+ this.name = fullName;
+ this.fullName = fullName;
+ this.kind = kind;
+ this.metrics = metrics || null;
+ this.parent = null;
+ this.children = [];
+}
+
+Node.prototype = {
+ displayShortName: function () {
+ return this.relativeName;
+ },
+ fullPath: function () {
+ return this.fullName;
+ },
+ addChild: function (child) {
+ this.children.push(child);
+ child.parent = this;
+ },
+ toJSON: function () {
+ return {
+ name: this.name,
+ relativeName: this.relativeName,
+ fullName: this.fullName,
+ kind: this.kind,
+ metrics: this.metrics,
+ parent: this.parent === null ? null : this.parent.name,
+ children: this.children.map(function (node) { return node.toJSON(); })
+ };
+ }
+};
+
+function TreeSummary(summaryMap, commonPrefix) {
+ this.prefix = commonPrefix;
+ this.convertToTree(summaryMap, commonPrefix);
+}
+
+TreeSummary.prototype = {
+ getNode: function (shortName) {
+ return this.map[shortName];
+ },
+ convertToTree: function (summaryMap, arrayPrefix) {
+ var nodes = [],
+ rootPath = arrayPrefix.join(SEP) + SEP,
+ root = new Node(rootPath, 'dir'),
+ tmp,
+ tmpChildren,
+ seen = {},
+ filesUnderRoot = false;
+
+ seen[rootPath] = root;
+ Object.keys(summaryMap).forEach(function (key) {
+ var metrics = summaryMap[key],
+ node,
+ parentPath,
+ parent;
+ node = new Node(key, 'file', metrics);
+ seen[key] = node;
+ nodes.push(node);
+ parentPath = path.dirname(key) + SEP;
+ if (parentPath === SEP + SEP || parentPath === '.' + SEP) {
+ parentPath = SEP + '__root__' + SEP;
+ }
+ parent = seen[parentPath];
+ if (!parent) {
+ parent = new Node(parentPath, 'dir');
+ root.addChild(parent);
+ seen[parentPath] = parent;
+ }
+ parent.addChild(node);
+ if (parent === root) { filesUnderRoot = true; }
+ });
+
+ if (filesUnderRoot && arrayPrefix.length > 0) {
+ arrayPrefix.pop(); //start at one level above
+ tmp = root;
+ tmpChildren = tmp.children;
+ tmp.children = [];
+ root = new Node(arrayPrefix.join(SEP) + SEP, 'dir');
+ root.addChild(tmp);
+ tmpChildren.forEach(function (child) {
+ if (child.kind === 'dir') {
+ root.addChild(child);
+ } else {
+ tmp.addChild(child);
+ }
+ });
+ }
+ this.fixupNodes(root, arrayPrefix.join(SEP) + SEP);
+ this.calculateMetrics(root);
+ this.root = root;
+ this.map = {};
+ this.indexAndSortTree(root, this.map);
+ },
+
+ fixupNodes: function (node, prefix, parent) {
+ var that = this;
+ if (node.name.indexOf(prefix) === 0) {
+ node.name = node.name.substring(prefix.length);
+ }
+ if (node.name.charAt(0) === SEP) {
+ node.name = node.name.substring(1);
+ }
+ if (parent) {
+ if (parent.name !== '__root__' + SEP) {
+ node.relativeName = node.name.substring(parent.name.length);
+ } else {
+ node.relativeName = node.name;
+ }
+ } else {
+ node.relativeName = node.name.substring(prefix.length);
+ }
+ node.children.forEach(function (child) {
+ that.fixupNodes(child, prefix, node);
+ });
+ },
+ calculateMetrics: function (entry) {
+ var that = this,
+ fileChildren;
+ if (entry.kind !== 'dir') {return; }
+ entry.children.forEach(function (child) {
+ that.calculateMetrics(child);
+ });
+ entry.metrics = utils.mergeSummaryObjects.apply(
+ null,
+ entry.children.map(function (child) { return child.metrics; })
+ );
+ // calclulate "java-style" package metrics where there is no hierarchy
+ // across packages
+ fileChildren = entry.children.filter(function (n) { return n.kind !== 'dir'; });
+ if (fileChildren.length > 0) {
+ entry.packageMetrics = utils.mergeSummaryObjects.apply(
+ null,
+ fileChildren.map(function (child) { return child.metrics; })
+ );
+ } else {
+ entry.packageMetrics = null;
+ }
+ },
+ indexAndSortTree: function (node, map) {
+ var that = this;
+ map[node.name] = node;
+ node.children.sort(function (a, b) {
+ a = a.relativeName;
+ b = b.relativeName;
+ return a < b ? -1 : a > b ? 1 : 0;
+ });
+ node.children.forEach(function (child) {
+ that.indexAndSortTree(child, map);
+ });
+ },
+ toJSON: function () {
+ return {
+ prefix: this.prefix,
+ root: this.root.toJSON()
+ };
+ }
+};
+
+function TreeSummarizer() {
+ this.summaryMap = {};
+}
+
+TreeSummarizer.prototype = {
+ addFileCoverageSummary: function (filePath, metrics) {
+ this.summaryMap[filePath] = metrics;
+ },
+ getTreeSummary: function () {
+ var commonArrayPrefix = findCommonArrayPrefix(Object.keys(this.summaryMap));
+ return new TreeSummary(this.summaryMap, commonArrayPrefix);
+ }
+};
+
+module.exports = TreeSummarizer;
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/writer.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/writer.js
new file mode 100644
index 00000000..f5e68293
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/writer.js
@@ -0,0 +1,92 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+var util = require('util'),
+ EventEmitter = require('events').EventEmitter;
+
+function extend(cons, proto) {
+ Object.keys(proto).forEach(function (k) {
+ cons.prototype[k] = proto[k];
+ });
+}
+
+/**
+ * abstract interfaces for writing content
+ * @class ContentWriter
+ * @module io
+ * @main io
+ * @constructor
+ */
+//abstract interface for writing content
+function ContentWriter() {
+}
+
+ContentWriter.prototype = {
+ /**
+ * writes the specified string as-is
+ * @method write
+ * @param {String} str the string to write
+ */
+ write: /* istanbul ignore next: abstract method */ function (/* str */) {
+ throw new Error('write: must be overridden');
+ },
+ /**
+ * writes the specified string with a newline at the end
+ * @method println
+ * @param {String} str the string to write
+ */
+ println: function (str) { this.write(str + '\n'); }
+};
+
+/**
+ * abstract interface for writing files and assets. The caller is expected to
+ * call `done` on the writer after it has finished writing all the required
+ * files. The writer is an event-emitter that emits a `done` event when `done`
+ * is called on it *and* all files have successfully been written.
+ *
+ * @class Writer
+ * @constructor
+ */
+function Writer() {
+ EventEmitter.call(this);
+}
+
+util.inherits(Writer, EventEmitter);
+
+extend(Writer, {
+ /**
+ * allows writing content to a file using a callback that is passed a content writer
+ * @method writeFile
+ * @param {String} file the name of the file to write
+ * @param {Function} callback the callback that is called as `callback(contentWriter)`
+ */
+ writeFile: /* istanbul ignore next: abstract method */ function (/* file, callback */) {
+ throw new Error('writeFile: must be overridden');
+ },
+ /**
+ * copies a file from source to destination
+ * @method copyFile
+ * @param {String} source the file to copy, found on the file system
+ * @param {String} dest the destination path
+ */
+ copyFile: /* istanbul ignore next: abstract method */ function (/* source, dest */) {
+ throw new Error('copyFile: must be overridden');
+ },
+ /**
+ * marker method to indicate that the caller is done with this writer object
+ * The writer is expected to emit a `done` event only after this method is called
+ * and it is truly done.
+ * @method done
+ */
+ done: /* istanbul ignore next: abstract method */ function () {
+ throw new Error('done: must be overridden');
+ }
+});
+
+module.exports = {
+ Writer: Writer,
+ ContentWriter: ContentWriter
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/yui-load-hook.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/yui-load-hook.js
new file mode 100644
index 00000000..9b1365d7
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/lib/util/yui-load-hook.js
@@ -0,0 +1,49 @@
+/*
+ Copyright (c) 2012, Yahoo! Inc. All rights reserved.
+ Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.
+ */
+
+//EXPERIMENTAL code: do not rely on this in anyway until the docs say it is allowed
+
+var path = require('path'),
+ yuiRegexp = /yui-nodejs\.js$/;
+
+module.exports = function (matchFn, transformFn, verbose) {
+ return function (file) {
+ if (!file.match(yuiRegexp)) {
+ return;
+ }
+ var YMain = require(file),
+ YUI,
+ loaderFn,
+ origGet;
+
+ if (YMain.YUI) {
+ YUI = YMain.YUI;
+ loaderFn = YUI.Env && YUI.Env.mods && YUI.Env.mods['loader-base'] ? YUI.Env.mods['loader-base'].fn : null;
+ if (!loaderFn) { return; }
+ if (verbose) { console.log('Applying YUI load post-hook'); }
+ YUI.Env.mods['loader-base'].fn = function (Y) {
+ loaderFn.call(null, Y);
+ origGet = Y.Get._exec;
+ Y.Get._exec = function (data, url, cb) {
+ if (matchFn(url) || matchFn(path.resolve(url))) { //allow for relative paths as well
+ if (verbose) {
+ console.log('Transforming [' + url + ']');
+ }
+ try {
+ data = transformFn(data, url);
+ } catch (ex) {
+ console.error('Error transforming: ' + url + ' return original code');
+ console.error(ex.message || ex);
+ if (ex.stack) { console.error(ex.stack); }
+ }
+ }
+ return origGet.call(Y, data, url, cb);
+ };
+ return Y;
+ };
+ }
+ };
+};
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse
new file mode 100644
index 00000000..25255271
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../esprima/bin/esparse.js" "$@"
+ ret=$?
+else
+ node "$basedir/../esprima/bin/esparse.js" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse.cmd b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse.cmd
new file mode 100644
index 00000000..7c180bff
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esparse.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\esprima\bin\esparse.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\esprima\bin\esparse.js" %*
+) \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate
new file mode 100644
index 00000000..2137cd5c
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate
@@ -0,0 +1,15 @@
+#!/bin/sh
+basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
+
+case `uname` in
+ *CYGWIN*) basedir=`cygpath -w "$basedir"`;;
+esac
+
+if [ -x "$basedir/node" ]; then
+ "$basedir/node" "$basedir/../esprima/bin/esvalidate.js" "$@"
+ ret=$?
+else
+ node "$basedir/../esprima/bin/esvalidate.js" "$@"
+ ret=$?
+fi
+exit $ret
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate.cmd b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate.cmd
new file mode 100644
index 00000000..107c4fd1
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/.bin/esvalidate.cmd
@@ -0,0 +1,7 @@
+@IF EXIST "%~dp0\node.exe" (
+ "%~dp0\node.exe" "%~dp0\..\esprima\bin\esvalidate.js" %*
+) ELSE (
+ @SETLOCAL
+ @SET PATHEXT=%PATHEXT:;.JS;=;%
+ node "%~dp0\..\esprima\bin\esvalidate.js" %*
+) \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/CHANGELOG.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/CHANGELOG.md
new file mode 100644
index 00000000..f15e0812
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/CHANGELOG.md
@@ -0,0 +1,125 @@
+# v1.5.2
+- Allow using `"consructor"` as an argument in `memoize` (#998)
+- Give a better error messsage when `auto` dependency checking fails (#994)
+- Various doc updates (#936, #956, #979, #1002)
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled (#946)
+- `while` and `until` now pass the final result to callback (#963)
+- `auto` will properly handle concurrency when there is no callback (#966)
+- `auto` will now properly stop execution when an error occurs (#988, #993)
+- Various doc fixes (#971, #980)
+
+# v1.5.0
+
+- Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
+- `map` now returns an object when an object is passed in, rather than array with non-numeric keys. `map` will begin always returning an array with numeric indexes in the next major release. (#873)
+- `auto` now accepts an optional `concurrency` argument to limit the number of running tasks (#637)
+- Added `queue#workersList()`, to retrieve the list of currently running tasks. (#891)
+- Various code simplifications (#896, #904)
+- Various doc fixes :scroll: (#890, #894, #903, #905, #912)
+
+# v1.4.2
+
+- Ensure coverage files don't get published on npm (#879)
+
+# v1.4.1
+
+- Add in overlooked `detectLimit` method (#866)
+- Removed unnecessary files from npm releases (#861)
+- Removed usage of a reserved word to prevent :boom: in older environments (#870)
+
+# v1.4.0
+
+- `asyncify` now supports promises (#840)
+- Added `Limit` versions of `filter` and `reject` (#836)
+- Add `Limit` versions of `detect`, `some` and `every` (#828, #829)
+- `some`, `every` and `detect` now short circuit early (#828, #829)
+- Improve detection of the global object (#804), enabling use in WebWorkers
+- `whilst` now called with arguments from iterator (#823)
+- `during` now gets called with arguments from iterator (#824)
+- Code simplifications and optimizations aplenty ([diff](https://github.com/caolan/async/compare/v1.3.0...v1.4.0))
+
+
+# v1.3.0
+
+New Features:
+- Added `constant`
+- Added `asyncify`/`wrapSync` for making sync functions work with callbacks. (#671, #806)
+- Added `during` and `doDuring`, which are like `whilst` with an async truth test. (#800)
+- `retry` now accepts an `interval` parameter to specify a delay between retries. (#793)
+- `async` should work better in Web Workers due to better `root` detection (#804)
+- Callbacks are now optional in `whilst`, `doWhilst`, `until`, and `doUntil` (#642)
+- Various internal updates (#786, #801, #802, #803)
+- Various doc fixes (#790, #794)
+
+Bug Fixes:
+- `cargo` now exposes the `payload` size, and `cargo.payload` can be changed on the fly after the `cargo` is created. (#740, #744, #783)
+
+
+# v1.2.1
+
+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)
+
+
+# v1.2.0
+
+New Features:
+
+- Added `timesLimit` (#743)
+- `concurrency` can be changed after initialization in `queue` by setting `q.concurrency`. The new concurrency will be reflected the next time a task is processed. (#747, #772)
+
+Bug Fixes:
+
+- Fixed a regression in `each` and family with empty arrays that have additional properties. (#775, #777)
+
+
+# v1.1.1
+
+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)
+
+
+# v1.1.0
+
+New Features:
+
+- `cargo` now supports all of the same methods and event callbacks as `queue`.
+- Added `ensureAsync` - A wrapper that ensures an async function calls its callback on a later tick. (#769)
+- 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)
+- Added code coverage through `nyc` and `coveralls` (#768)
+
+Bug Fixes:
+
+- `forever` will no longer stack overflow with a synchronous iterator (#622)
+- `eachLimit` and other limit functions will stop iterating once an error occurs (#754)
+- Always pass `null` in callbacks when there is no error (#439)
+- Ensure proper conditions when calling `drain()` after pushing an empty data set to a queue (#668)
+- `each` and family will properly handle an empty array (#578)
+- `eachSeries` and family will finish if the underlying array is modified during execution (#557)
+- `queue` will throw if a non-function is passed to `q.push()` (#593)
+- Doc fixes (#629, #766)
+
+
+# v1.0.0
+
+No known breaking changes, we are simply complying with semver from here on out.
+
+Changes:
+
+- Start using a changelog!
+- Add `forEachOf` for iterating over Objects (or to iterate Arrays with indexes available) (#168 #704 #321)
+- Detect deadlocks in `auto` (#663)
+- Better support for require.js (#527)
+- Throw if queue created with concurrency `0` (#714)
+- Fix unneeded iteration in `queue.resume()` (#758)
+- Guard against timer mocking overriding `setImmediate` (#609 #611)
+- Miscellaneous doc fixes (#542 #596 #615 #628 #631 #690 #729)
+- Use single noop function internally (#546)
+- Optimize internal `_each`, `_map` and `_keys` functions.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/LICENSE b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/LICENSE
new file mode 100644
index 00000000..8f296985
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/LICENSE
@@ -0,0 +1,19 @@
+Copyright (c) 2010-2014 Caolan McMahon
+
+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/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/README.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/README.md
new file mode 100644
index 00000000..316c4050
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/README.md
@@ -0,0 +1,1877 @@
+# Async.js
+
+[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
+[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)
+[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)
+[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
+
+
+Async is a utility module which provides straight-forward, powerful functions
+for working with asynchronous JavaScript. Although originally designed for
+use with [Node.js](http://nodejs.org) and installable via `npm install async`,
+it can also be used directly in the browser.
+
+Async is also installable via:
+
+- [bower](http://bower.io/): `bower install async`
+- [component](https://github.com/component/component): `component install
+ caolan/async`
+- [jam](http://jamjs.org/): `jam install async`
+- [spm](http://spmjs.io/): `spm install async`
+
+Async provides around 20 functions that include the usual 'functional'
+suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
+for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
+functions assume you follow the Node.js convention of providing a single
+callback as the last argument of your `async` function.
+
+
+## Quick Examples
+
+```javascript
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+
+async.parallel([
+ function(){ ... },
+ function(){ ... }
+], callback);
+
+async.series([
+ function(){ ... },
+ function(){ ... }
+]);
+```
+
+There are many more functions available so take a look at the docs below for a
+full list. This module aims to be comprehensive, so if you feel anything is
+missing please create a GitHub issue for it.
+
+## Common Pitfalls <sub>[(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)</sub>
+### Synchronous iteration functions
+
+If you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.
+
+This can also arise by accident if you callback early in certain cases:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ callback(null, cache[item]); // if many items are cached, you'll overflow
+ } else {
+ doSomeIO(item, callback);
+ }
+}, function done() {
+ //...
+});
+```
+
+Just change it to:
+
+```js
+async.eachSeries(hugeArray, function iterator(item, callback) {
+ if (inCache(item)) {
+ async.setImmediate(function () {
+ callback(null, cache[item]);
+ });
+ } else {
+ doSomeIO(item, callback);
+ //...
+```
+
+Async guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.
+
+If JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.
+
+
+### Multiple callbacks
+
+Make sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.
+
+```js
+async.waterfall([
+ function (callback) {
+ getSomething(options, function (err, result) {
+ if (err) {
+ callback(new Error("failed getting something:" + err.message));
+ // we should return here
+ }
+ // since we did not return, this callback still will be called and
+ // `processData` will be called twice
+ callback(null, result);
+ });
+ },
+ processData
+], done)
+```
+
+It is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function.
+
+
+### Binding a context to an iterator
+
+This section is really about `bind`, not about `async`. If you are wondering how to
+make `async` execute your iterators in a given context, or are confused as to why
+a method of another library isn't working as an iterator, study this example:
+
+```js
+// Here is a simple object with an (unnecessarily roundabout) squaring method
+var AsyncSquaringLibrary = {
+ squareExponent: 2,
+ square: function(number, callback){
+ var result = Math.pow(number, this.squareExponent);
+ setTimeout(function(){
+ callback(null, result);
+ }, 200);
+ }
+};
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
+ // result is [NaN, NaN, NaN]
+ // This fails because the `this.squareExponent` expression in the square
+ // function is not evaluated in the context of AsyncSquaringLibrary, and is
+ // therefore undefined.
+});
+
+async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
+ // result is [1, 4, 9]
+ // With the help of bind we can attach a context to the iterator before
+ // passing it to async. Now the square function will be executed in its
+ // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
+ // will be as expected.
+});
+```
+
+## Download
+
+The source is available for download from
+[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).
+Alternatively, you can install using Node Package Manager (`npm`):
+
+ npm install async
+
+As well as using Bower:
+
+ bower install async
+
+__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
+
+## In the Browser
+
+So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
+
+Usage:
+
+```html
+<script type="text/javascript" src="async.js"></script>
+<script type="text/javascript">
+
+ async.map(data, asyncProcess, function(err, results){
+ alert(results);
+ });
+
+</script>
+```
+
+## Documentation
+
+Some functions are also available in the following forms:
+* `<name>Series` - the same as `<name>` but runs only a single async operation at a time
+* `<name>Limit` - the same as `<name>` but runs a maximum of `limit` async operations at a time
+
+### Collections
+
+* [`each`](#each), `eachSeries`, `eachLimit`
+* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`
+* [`map`](#map), `mapSeries`, `mapLimit`
+* [`filter`](#filter), `filterSeries`, `filterLimit`
+* [`reject`](#reject), `rejectSeries`, `rejectLimit`
+* [`reduce`](#reduce), [`reduceRight`](#reduceRight)
+* [`detect`](#detect), `detectSeries`, `detectLimit`
+* [`sortBy`](#sortBy)
+* [`some`](#some), `someLimit`
+* [`every`](#every), `everyLimit`
+* [`concat`](#concat), `concatSeries`
+
+### Control Flow
+
+* [`series`](#seriestasks-callback)
+* [`parallel`](#parallel), `parallelLimit`
+* [`whilst`](#whilst), [`doWhilst`](#doWhilst)
+* [`until`](#until), [`doUntil`](#doUntil)
+* [`during`](#during), [`doDuring`](#doDuring)
+* [`forever`](#forever)
+* [`waterfall`](#waterfall)
+* [`compose`](#compose)
+* [`seq`](#seq)
+* [`applyEach`](#applyEach), `applyEachSeries`
+* [`queue`](#queue), [`priorityQueue`](#priorityQueue)
+* [`cargo`](#cargo)
+* [`auto`](#auto)
+* [`retry`](#retry)
+* [`iterator`](#iterator)
+* [`times`](#times), `timesSeries`, `timesLimit`
+
+### Utils
+
+* [`apply`](#apply)
+* [`nextTick`](#nextTick)
+* [`memoize`](#memoize)
+* [`unmemoize`](#unmemoize)
+* [`ensureAsync`](#ensureAsync)
+* [`constant`](#constant)
+* [`asyncify`](#asyncify)
+* [`wrapSync`](#wrapSync)
+* [`log`](#log)
+* [`dir`](#dir)
+* [`noConflict`](#noConflict)
+
+## Collections
+
+<a name="forEach" />
+<a name="each" />
+### each(arr, iterator, [callback])
+
+Applies the function `iterator` to each item in `arr`, in parallel.
+The `iterator` is called with an item from the list, and a callback for when it
+has finished. If the `iterator` passes an error to its `callback`, the main
+`callback` (for the `each` function) is immediately called with the error.
+
+Note, that since this function applies `iterator` to each item in parallel,
+there is no guarantee that the iterator functions will complete in order.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err)` which must be called once it has
+ completed. If no error has occurred, the `callback` should be run without
+ arguments or with an explicit `null` argument. The array index is not passed
+ to the iterator. If you need the index, use [`forEachOf`](#forEachOf).
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions
+ have finished, or an error occurs.
+
+__Examples__
+
+
+```js
+// assuming openFiles is an array of file names and saveFile is a function
+// to save the modified contents of that file:
+
+async.each(openFiles, saveFile, function(err){
+ // if any of the saves produced an error, err would equal that error
+});
+```
+
+```js
+// assuming openFiles is an array of file names
+
+async.each(openFiles, function(file, callback) {
+
+ // Perform operation on file here.
+ console.log('Processing file ' + file);
+
+ if( file.length > 32 ) {
+ console.log('This file name is too long');
+ callback('File name too long');
+ } else {
+ // Do work to process file here
+ console.log('File processed');
+ callback();
+ }
+}, function(err){
+ // if any of the file processing produced an error, err would equal that error
+ if( err ) {
+ // One of the iterations produced an error.
+ // All processing will now stop.
+ console.log('A file failed to process');
+ } else {
+ console.log('All files have been processed successfully');
+ }
+});
+```
+
+__Related__
+
+* eachSeries(arr, iterator, [callback])
+* eachLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="forEachOf" />
+<a name="eachOf" />
+
+### forEachOf(obj, iterator, [callback])
+
+Like `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.
+
+__Arguments__
+
+* `obj` - An object or array to iterate over.
+* `iterator(item, key, callback)` - A function to apply to each item in `obj`.
+The `key` is the item's key, or index in the case of an array. The iterator is
+passed a `callback(err)` which must be called once it has completed. If no
+error has occurred, the callback should be run without arguments or with an
+explicit `null` argument.
+* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.
+
+__Example__
+
+```js
+var obj = {dev: "/dev.json", test: "/test.json", prod: "/prod.json"};
+var configs = {};
+
+async.forEachOf(obj, function (value, key, callback) {
+ fs.readFile(__dirname + value, "utf8", function (err, data) {
+ if (err) return callback(err);
+ try {
+ configs[key] = JSON.parse(data);
+ } catch (e) {
+ return callback(e);
+ }
+ callback();
+ })
+}, function (err) {
+ if (err) console.error(err.message);
+ // configs is now a map of JSON data
+ doSomethingWith(configs);
+})
+```
+
+__Related__
+
+* forEachOfSeries(obj, iterator, [callback])
+* forEachOfLimit(obj, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="map" />
+### map(arr, iterator, [callback])
+
+Produces a new array of values by mapping each value in `arr` through
+the `iterator` function. The `iterator` is called with an item from `arr` and a
+callback for when it has finished processing. Each of these callback takes 2 arguments:
+an `error`, and the transformed item from `arr`. If `iterator` passes an error to its
+callback, the main `callback` (for the `map` function) is immediately called with the error.
+
+Note, that since this function applies the `iterator` to each item in parallel,
+there is no guarantee that the `iterator` functions will complete in order.
+However, the results array will be in the same order as the original `arr`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, transformed)` which must be called once
+ it has completed with an error (which can be `null`) and a transformed item.
+* `callback(err, results)` - *Optional* A callback which is called when all `iterator`
+ functions have finished, or an error occurs. Results is an array of the
+ transformed items from the `arr`.
+
+__Example__
+
+```js
+async.map(['file1','file2','file3'], fs.stat, function(err, results){
+ // results is now an array of stats for each file
+});
+```
+
+__Related__
+* mapSeries(arr, iterator, [callback])
+* mapLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="select" />
+<a name="filter" />
+### filter(arr, iterator, [callback])
+
+__Alias:__ `select`
+
+Returns a new array of all the values in `arr` which pass an async truth test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. This operation is
+performed in parallel, but the results array will be in the same order as the
+original.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
+ boolean argument once it has completed.
+* `callback(results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished.
+
+__Example__
+
+```js
+async.filter(['file1','file2','file3'], fs.exists, function(results){
+ // results now equals an array of the existing files
+});
+```
+
+__Related__
+
+* filterSeries(arr, iterator, [callback])
+* filterLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="reject" />
+### reject(arr, iterator, [callback])
+
+The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
+
+__Related__
+
+* rejectSeries(arr, iterator, [callback])
+* rejectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="reduce" />
+### reduce(arr, memo, iterator, [callback])
+
+__Aliases:__ `inject`, `foldl`
+
+Reduces `arr` into a single value using an async `iterator` to return
+each successive step. `memo` is the initial state of the reduction.
+This function only operates in series.
+
+For performance reasons, it may make sense to split a call to this function into
+a parallel map, and then use the normal `Array.prototype.reduce` on the results.
+This function is for situations where each step in the reduction needs to be async;
+if you can get the data before reducing it, then it's probably a good idea to do so.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `memo` - The initial state of the reduction.
+* `iterator(memo, item, callback)` - A function applied to each item in the
+ array to produce the next step in the reduction. The `iterator` is passed a
+ `callback(err, reduction)` which accepts an optional error as its first
+ argument, and the state of the reduction as the second. If an error is
+ passed to the callback, the reduction is stopped and the main `callback` is
+ immediately called with the error.
+* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished. Result is the reduced value.
+
+__Example__
+
+```js
+async.reduce([1,2,3], 0, function(memo, item, callback){
+ // pointless async:
+ process.nextTick(function(){
+ callback(null, memo + item)
+ });
+}, function(err, result){
+ // result is now equal to the last value of memo, which is 6
+});
+```
+
+---------------------------------------
+
+<a name="reduceRight" />
+### reduceRight(arr, memo, iterator, [callback])
+
+__Alias:__ `foldr`
+
+Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
+
+
+---------------------------------------
+
+<a name="detect" />
+### detect(arr, iterator, [callback])
+
+Returns the first value in `arr` that passes an async truth test. The
+`iterator` is applied in parallel, meaning the first iterator to return `true` will
+fire the detect `callback` with that result. That means the result might not be
+the first item in the original `arr` (in terms of order) that passes the test.
+
+If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in `arr`.
+ The iterator is passed a `callback(truthValue)` which must be called with a
+ boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the `iterator` functions have finished. Result will be
+ the first item in the array that passes the truth test (iterator) or the
+ value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**
+
+__Example__
+
+```js
+async.detect(['file1','file2','file3'], fs.exists, function(result){
+ // result now equals the first file in the list that exists
+});
+```
+
+__Related__
+
+* detectSeries(arr, iterator, [callback])
+* detectLimit(arr, limit, iterator, [callback])
+
+---------------------------------------
+
+<a name="sortBy" />
+### sortBy(arr, iterator, [callback])
+
+Sorts a list by the results of running each `arr` value through an async `iterator`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, sortValue)` which must be called once it
+ has completed with an error (which can be `null`) and a value to use as the sort
+ criteria.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is the items from
+ the original `arr` sorted by the values returned by the `iterator` calls.
+
+__Example__
+
+```js
+async.sortBy(['file1','file2','file3'], function(file, callback){
+ fs.stat(file, function(err, stats){
+ callback(err, stats.mtime);
+ });
+}, function(err, results){
+ // results is now the original array of files sorted by
+ // modified date
+});
+```
+
+__Sort Order__
+
+By modifying the callback parameter the sorting order can be influenced:
+
+```js
+//ascending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x);
+}, function(err,result){
+ //result callback
+} );
+
+//descending order
+async.sortBy([1,9,3,5], function(x, callback){
+ callback(null, x*-1); //<- x*-1 instead of x, turns the order around
+}, function(err,result){
+ //result callback
+} );
+```
+
+---------------------------------------
+
+<a name="some" />
+### some(arr, iterator, [callback])
+
+__Alias:__ `any`
+
+Returns `true` if at least one element in the `arr` satisfies an async test.
+_The callback for each iterator call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`. Once any iterator
+call returns `true`, the main `callback` is immediately called.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)`` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `true`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+__Example__
+
+```js
+async.some(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then at least one of the files exists
+});
+```
+
+__Related__
+
+* someLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+<a name="every" />
+### every(arr, iterator, [callback])
+
+__Alias:__ `all`
+
+Returns `true` if every element in `arr` satisfies an async test.
+_The callback for each `iterator` call only accepts a single argument of `true` or
+`false`; it does not accept an error argument first!_ This is in-line with the
+way node libraries work with truth tests like `fs.exists`.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A truth test to apply to each item in the array
+ in parallel. The iterator is passed a `callback(truthValue)` which must be
+ called with a boolean argument once it has completed.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+ `false`, or after all the iterator functions have finished. Result will be
+ either `true` or `false` depending on the values of the async tests.
+
+ **Note: the callbacks do not take an error as their first argument.**
+
+__Example__
+
+```js
+async.every(['file1','file2','file3'], fs.exists, function(result){
+ // if result is true then every file exists
+});
+```
+
+__Related__
+
+* everyLimit(arr, limit, iterator, callback)
+
+---------------------------------------
+
+<a name="concat" />
+### concat(arr, iterator, [callback])
+
+Applies `iterator` to each item in `arr`, concatenating the results. Returns the
+concatenated list. The `iterator`s are called in parallel, and the results are
+concatenated as they return. There is no guarantee that the results array will
+be returned in the original order of `arr` passed to the `iterator` function.
+
+__Arguments__
+
+* `arr` - An array to iterate over.
+* `iterator(item, callback)` - A function to apply to each item in `arr`.
+ The iterator is passed a `callback(err, results)` which must be called once it
+ has completed with an error (which can be `null`) and an array of results.
+* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`
+ functions have finished, or an error occurs. Results is an array containing
+ the concatenated results of the `iterator` function.
+
+__Example__
+
+```js
+async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
+ // files is now a list of filenames that exist in the 3 directories
+});
+```
+
+__Related__
+
+* concatSeries(arr, iterator, [callback])
+
+
+## Control Flow
+
+<a name="series" />
+### series(tasks, [callback])
+
+Run the functions in the `tasks` array in series, each one running once the previous
+function has completed. If any functions in the series pass an error to its
+callback, no more functions are run, and `callback` is immediately called with the value of the error.
+Otherwise, `callback` receives an array of results when `tasks` have completed.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function, and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`series`](#series).
+
+**Note** that while many implementations preserve the order of object properties, the
+[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
+explicitly states that
+
+> The mechanics and order of enumerating the properties is not specified.
+
+So if you rely on the order in which your series of functions are executed, and want
+this to work on all platforms, consider using an array.
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run, each function is passed
+ a `callback(err, result)` it must call on completion with an error `err` (which can
+ be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed. This function gets a results array (or object) containing all
+ the result arguments passed to the `task` callbacks.
+
+__Example__
+
+```js
+async.series([
+ function(callback){
+ // do some stuff ...
+ callback(null, 'one');
+ },
+ function(callback){
+ // do some more stuff ...
+ callback(null, 'two');
+ }
+],
+// optional callback
+function(err, results){
+ // results is now equal to ['one', 'two']
+});
+
+
+// an example using an object instead of an array
+async.series({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equal to: {one: 1, two: 2}
+});
+```
+
+---------------------------------------
+
+<a name="parallel" />
+### parallel(tasks, [callback])
+
+Run the `tasks` array of functions in parallel, without waiting until the previous
+function has completed. If any of the functions pass an error to its
+callback, the main `callback` is immediately called with the value of the error.
+Once the `tasks` have completed, the results are passed to the final `callback` as an
+array.
+
+**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.
+
+It is also possible to use an object instead of an array. Each property will be
+run as a function and the results will be passed to the final `callback` as an object
+instead of an array. This can be a more readable way of handling results from
+[`parallel`](#parallel).
+
+
+__Arguments__
+
+* `tasks` - An array or object containing functions to run. Each function is passed
+ a `callback(err, result)` which it must call on completion with an error `err`
+ (which can be `null`) and an optional `result` value.
+* `callback(err, results)` - An optional callback to run once all the functions
+ have completed successfully. This function gets a results array (or object) containing all
+ the result arguments passed to the task callbacks.
+
+__Example__
+
+```js
+async.parallel([
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'one');
+ }, 200);
+ },
+ function(callback){
+ setTimeout(function(){
+ callback(null, 'two');
+ }, 100);
+ }
+],
+// optional callback
+function(err, results){
+ // the results array will equal ['one','two'] even though
+ // the second function had a shorter timeout.
+});
+
+
+// an example using an object instead of an array
+async.parallel({
+ one: function(callback){
+ setTimeout(function(){
+ callback(null, 1);
+ }, 200);
+ },
+ two: function(callback){
+ setTimeout(function(){
+ callback(null, 2);
+ }, 100);
+ }
+},
+function(err, results) {
+ // results is now equals to: {one: 1, two: 2}
+});
+```
+
+__Related__
+
+* parallelLimit(tasks, limit, [callback])
+
+---------------------------------------
+
+<a name="whilst" />
+### whilst(test, fn, callback)
+
+Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
+or an error occurs.
+
+__Arguments__
+
+* `test()` - synchronous truth test to perform before each execution of `fn`.
+* `fn(callback)` - A function which is called each time `test` passes. The function is
+ passed a `callback(err)`, which must be called once it has completed with an
+ optional `err` argument.
+* `callback(err, [results])` - A callback which is called after the test
+ function has failed and repeated execution of `fn` has stopped. `callback`
+ will be passed an error and any arguments passed to the final `fn`'s callback.
+
+__Example__
+
+```js
+var count = 0;
+
+async.whilst(
+ function () { return count < 5; },
+ function (callback) {
+ count++;
+ setTimeout(function () {
+ callback(null, count);
+ }, 1000);
+ },
+ function (err, n) {
+ // 5 seconds have passed, n = 5
+ }
+);
+```
+
+---------------------------------------
+
+<a name="doWhilst" />
+### doWhilst(fn, test, callback)
+
+The post-check version of [`whilst`](#whilst). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
+
+---------------------------------------
+
+<a name="until" />
+### until(test, fn, callback)
+
+Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
+
+The inverse of [`whilst`](#whilst).
+
+---------------------------------------
+
+<a name="doUntil" />
+### doUntil(fn, test, callback)
+
+Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
+
+---------------------------------------
+
+<a name="during" />
+### during(test, fn, callback)
+
+Like [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.
+
+__Example__
+
+```js
+var count = 0;
+
+async.during(
+ function (callback) {
+ return callback(null, count < 5);
+ },
+ function (callback) {
+ count++;
+ setTimeout(callback, 1000);
+ },
+ function (err) {
+ // 5 seconds have passed
+ }
+);
+```
+
+---------------------------------------
+
+<a name="doDuring" />
+### doDuring(fn, test, callback)
+
+The post-check version of [`during`](#during). To reflect the difference in
+the order of operations, the arguments `test` and `fn` are switched.
+
+Also a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.
+
+---------------------------------------
+
+<a name="forever" />
+### forever(fn, [errback])
+
+Calls the asynchronous function `fn` with a callback parameter that allows it to
+call itself again, in series, indefinitely.
+
+If an error is passed to the callback then `errback` is called with the
+error, and execution stops, otherwise it will never be called.
+
+```js
+async.forever(
+ function(next) {
+ // next is suitable for passing to things that need a callback(err [, whatever]);
+ // it will result in this function being called again.
+ },
+ function(err) {
+ // if next is called with a value in its first parameter, it will appear
+ // in here as 'err', and execution will stop.
+ }
+);
+```
+
+---------------------------------------
+
+<a name="waterfall" />
+### waterfall(tasks, [callback])
+
+Runs the `tasks` array of functions in series, each passing their results to the next in
+the array. However, if any of the `tasks` pass an error to their own callback, the
+next function is not executed, and the main `callback` is immediately called with
+the error.
+
+__Arguments__
+
+* `tasks` - An array of functions to run, each function is passed a
+ `callback(err, result1, result2, ...)` it must call on completion. The first
+ argument is an error (which can be `null`) and any further arguments will be
+ passed as arguments in order to the next task.
+* `callback(err, [results])` - An optional callback to run once all the functions
+ have completed. This will be passed the results of the last task's callback.
+
+
+
+__Example__
+
+```js
+async.waterfall([
+ function(callback) {
+ callback(null, 'one', 'two');
+ },
+ function(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+ },
+ function(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+ }
+], function (err, result) {
+ // result now equals 'done'
+});
+```
+Or, with named functions:
+
+```js
+async.waterfall([
+ myFirstFunction,
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(callback) {
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+ async.apply(myFirstFunction, 'zero'),
+ mySecondFunction,
+ myLastFunction,
+], function (err, result) {
+ // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+ // arg1 now equals 'zero'
+ callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+ // arg1 now equals 'one' and arg2 now equals 'two'
+ callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+ // arg1 now equals 'three'
+ callback(null, 'done');
+}
+```
+
+---------------------------------------
+<a name="compose" />
+### compose(fn1, fn2...)
+
+Creates a function which is a composition of the passed asynchronous
+functions. Each function consumes the return value of the function that
+follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
+`f(g(h()))`, only this version uses callbacks to obtain the return values.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+function add1(n, callback) {
+ setTimeout(function () {
+ callback(null, n + 1);
+ }, 10);
+}
+
+function mul3(n, callback) {
+ setTimeout(function () {
+ callback(null, n * 3);
+ }, 10);
+}
+
+var add1mul3 = async.compose(mul3, add1);
+
+add1mul3(4, function (err, result) {
+ // result now equals 15
+});
+```
+
+---------------------------------------
+<a name="seq" />
+### seq(fn1, fn2...)
+
+Version of the compose function that is more natural to read.
+Each function consumes the return value of the previous function.
+It is the equivalent of [`compose`](#compose) with the arguments reversed.
+
+Each function is executed with the `this` binding of the composed function.
+
+__Arguments__
+
+* `functions...` - the asynchronous functions to compose
+
+
+__Example__
+
+```js
+// Requires lodash (or underscore), express3 and dresende's orm2.
+// Part of an app, that fetches cats of the logged user.
+// This example uses `seq` function to avoid overnesting and error
+// handling clutter.
+app.get('/cats', function(request, response) {
+ var User = request.models.User;
+ async.seq(
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
+ function(user, fn) {
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
+ }
+ )(req.session.user_id, function (err, cats) {
+ if (err) {
+ console.error(err);
+ response.json({ status: 'error', message: err.message });
+ } else {
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
+ }
+ });
+});
+```
+
+---------------------------------------
+<a name="applyEach" />
+### applyEach(fns, args..., callback)
+
+Applies the provided arguments to each function in the array, calling
+`callback` after all functions have completed. If you only provide the first
+argument, then it will return a function which lets you pass in the
+arguments as if it were a single function call.
+
+__Arguments__
+
+* `fns` - the asynchronous functions to all call with the same arguments
+* `args...` - any number of separate arguments to pass to the function
+* `callback` - the final argument should be the callback, called when all
+ functions have completed processing
+
+
+__Example__
+
+```js
+async.applyEach([enableSearch, updateSchema], 'bucket', callback);
+
+// partial application example:
+async.each(
+ buckets,
+ async.applyEach([enableSearch, updateSchema]),
+ callback
+);
+```
+
+__Related__
+
+* applyEachSeries(tasks, args..., [callback])
+
+---------------------------------------
+
+<a name="queue" />
+### queue(worker, [concurrency])
+
+Creates a `queue` object with the specified `concurrency`. Tasks added to the
+`queue` are processed in parallel (up to the `concurrency` limit). If all
+`worker`s are in progress, the task is queued until one becomes available.
+Once a `worker` completes a `task`, that `task`'s callback is called.
+
+__Arguments__
+
+* `worker(task, callback)` - An asynchronous function for processing a queued
+ task, which must call its `callback(err)` argument when finished, with an
+ optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.
+* `concurrency` - An `integer` for determining how many `worker` functions should be
+ run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.
+
+__Queue objects__
+
+The `queue` object returned by this function has the following properties and
+methods:
+
+* `length()` - a function returning the number of items waiting to be processed.
+* `started` - a function returning whether or not any items have been pushed and processed by the queue
+* `running()` - a function returning the number of items currently being processed.
+* `workersList()` - a function returning the array of items currently being processed.
+* `idle()` - a function returning false if there are items waiting or being processed, or true if not.
+* `concurrency` - an integer for determining how many `worker` functions should be
+ run in parallel. This property can be changed after a `queue` is created to
+ alter the concurrency on-the-fly.
+* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
+ can be submitted. The respective callback is used for every task in the list.
+* `unshift(task, [callback])` - add a new task to the front of the `queue`.
+* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
+ and further tasks will be queued.
+* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
+* `paused` - a boolean for determining whether the queue is in a paused state
+* `pause()` - a function that pauses the processing of tasks until `resume()` is called.
+* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
+* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.
+
+__Example__
+
+```js
+// create a queue object with concurrency 2
+
+var q = async.queue(function (task, callback) {
+ console.log('hello ' + task.name);
+ callback();
+}, 2);
+
+
+// assign a callback
+q.drain = function() {
+ console.log('all items have been processed');
+}
+
+// add some items to the queue
+
+q.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+});
+q.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+
+// add some items to the queue (batch-wise)
+
+q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
+ console.log('finished processing item');
+});
+
+// add some items to the front of the queue
+
+q.unshift({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+```
+
+
+---------------------------------------
+
+<a name="priorityQueue" />
+### priorityQueue(worker, concurrency)
+
+The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
+
+* `push(task, priority, [callback])` - `priority` should be a number. If an array of
+ `tasks` is given, all tasks will be assigned the same priority.
+* The `unshift` method was removed.
+
+---------------------------------------
+
+<a name="cargo" />
+### cargo(worker, [payload])
+
+Creates a `cargo` object with the specified payload. Tasks added to the
+cargo will be processed altogether (up to the `payload` limit). If the
+`worker` is in progress, the task is queued until it becomes available. Once
+the `worker` has completed some tasks, each callback of those tasks is called.
+Check out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.
+
+While [queue](#queue) passes only one task to one of a group of workers
+at a time, cargo passes an array of tasks to a single worker, repeating
+when the worker is finished.
+
+__Arguments__
+
+* `worker(tasks, callback)` - An asynchronous function for processing an array of
+ queued tasks, which must call its `callback(err)` argument when finished, with
+ an optional `err` argument.
+* `payload` - An optional `integer` for determining how many tasks should be
+ processed per round; if omitted, the default is unlimited.
+
+__Cargo objects__
+
+The `cargo` object returned by this function has the following properties and
+methods:
+
+* `length()` - A function returning the number of items waiting to be processed.
+* `payload` - An `integer` for determining how many tasks should be
+ process per round. This property can be changed after a `cargo` is created to
+ alter the payload on-the-fly.
+* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
+ can be submitted. The respective callback is used for every task in the list.
+* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
+* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
+* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
+* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)
+
+__Example__
+
+```js
+// create a cargo object with payload 2
+
+var cargo = async.cargo(function (tasks, callback) {
+ for(var i=0; i<tasks.length; i++){
+ console.log('hello ' + tasks[i].name);
+ }
+ callback();
+}, 2);
+
+
+// add some items
+
+cargo.push({name: 'foo'}, function (err) {
+ console.log('finished processing foo');
+});
+cargo.push({name: 'bar'}, function (err) {
+ console.log('finished processing bar');
+});
+cargo.push({name: 'baz'}, function (err) {
+ console.log('finished processing baz');
+});
+```
+
+---------------------------------------
+
+<a name="auto" />
+### auto(tasks, [concurrency], [callback])
+
+Determines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.
+
+If any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.
+
+Note, all functions are called with a `results` object as a second argument,
+so it is unsafe to pass functions in the `tasks` object which cannot handle the
+extra argument.
+
+For example, this snippet of code:
+
+```js
+async.auto({
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
+}, callback);
+```
+
+will have the effect of calling `readFile` with the results object as the last
+argument, which will fail:
+
+```js
+fs.readFile('data.txt', 'utf-8', cb, {});
+```
+
+Instead, wrap the call to `readFile` in a function which does not forward the
+`results` object:
+
+```js
+async.auto({
+ readData: function(cb, results){
+ fs.readFile('data.txt', 'utf-8', cb);
+ }
+}, callback);
+```
+
+__Arguments__
+
+* `tasks` - An object. Each of its properties is either a function or an array of
+ requirements, with the function itself the last item in the array. The object's key
+ of a property serves as the name of the task defined by that property,
+ i.e. can be used when specifying requirements for other tasks.
+ The function receives two arguments: (1) a `callback(err, result)` which must be
+ called when finished, passing an `error` (which can be `null`) and the result of
+ the function's execution, and (2) a `results` object, containing the results of
+ the previously executed functions.
+* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.
+* `callback(err, results)` - An optional callback which is called when all the
+ tasks have been completed. It receives the `err` argument if any `tasks`
+ pass an error to their callback. Results are always returned; however, if
+ an error occurs, no further `tasks` will be performed, and the results
+ object will only contain partial results.
+
+
+__Example__
+
+```js
+async.auto({
+ get_data: function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ make_folder: function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ },
+ write_file: ['get_data', 'make_folder', function(callback, results){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ callback(null, 'filename');
+ }],
+ email_link: ['write_file', function(callback, results){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ // results.write_file contains the filename returned by write_file.
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
+ }]
+}, function(err, results) {
+ console.log('err = ', err);
+ console.log('results = ', results);
+});
+```
+
+This is a fairly trivial example, but to do this using the basic parallel and
+series functions would look like this:
+
+```js
+async.parallel([
+ function(callback){
+ console.log('in get_data');
+ // async code to get some data
+ callback(null, 'data', 'converted to array');
+ },
+ function(callback){
+ console.log('in make_folder');
+ // async code to create a directory to store a file in
+ // this is run at the same time as getting the data
+ callback(null, 'folder');
+ }
+],
+function(err, results){
+ async.series([
+ function(callback){
+ console.log('in write_file', JSON.stringify(results));
+ // once there is some data and the directory exists,
+ // write the data to a file in the directory
+ results.push('filename');
+ callback(null);
+ },
+ function(callback){
+ console.log('in email_link', JSON.stringify(results));
+ // once the file is written let's email a link to it...
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
+ }
+ ]);
+});
+```
+
+For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
+new tasks much easier (and the code more readable).
+
+
+---------------------------------------
+
+<a name="retry" />
+### retry([opts = {times: 5, interval: 0}| 5], task, [callback])
+
+Attempts to get a successful response from `task` no more than `times` times before
+returning an error. If the task is successful, the `callback` will be passed the result
+of the successful task. If all attempts fail, the callback will be passed the error and
+result (if any) of the final attempt.
+
+__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`.
+* `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
+ the previously executed functions (if nested inside another control flow).
+* `callback(err, results)` - An optional callback which is called when the
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
+
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
+
+```js
+// try calling apiMethod 3 times
+async.retry(3, apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+```js
+// 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
+async.retry(apiMethod, function(err, result) {
+ // do something with the result
+});
+```
+
+It can also be embedded within other control flow functions to retry individual methods
+that are not as reliable, like this:
+
+```js
+async.auto({
+ users: api.getUsers.bind(api),
+ payments: async.retry(3, api.getPayments.bind(api))
+}, function(err, results) {
+ // do something with the results
+});
+```
+
+
+---------------------------------------
+
+<a name="iterator" />
+### iterator(tasks)
+
+Creates an iterator function which calls the next function in the `tasks` array,
+returning a continuation to call the next one after that. It's also possible to
+“peek” at the next iterator with `iterator.next()`.
+
+This function is used internally by the `async` module, but can be useful when
+you want to manually control the flow of functions in series.
+
+__Arguments__
+
+* `tasks` - An array of functions to run.
+
+__Example__
+
+```js
+var iterator = async.iterator([
+ function(){ sys.p('one'); },
+ function(){ sys.p('two'); },
+ function(){ sys.p('three'); }
+]);
+
+node> var iterator2 = iterator();
+'one'
+node> var iterator3 = iterator2();
+'two'
+node> iterator3();
+'three'
+node> var nextfn = iterator2.next();
+node> nextfn();
+'three'
+```
+
+---------------------------------------
+
+<a name="apply" />
+### apply(function, arguments..)
+
+Creates a continuation function with some arguments already applied.
+
+Useful as a shorthand when combined with other control flow functions. Any arguments
+passed to the returned function are added to the arguments originally passed
+to apply.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to automatically apply when the
+ continuation is called.
+
+__Example__
+
+```js
+// using apply
+
+async.parallel([
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
+]);
+
+
+// the same process without using apply
+
+async.parallel([
+ function(callback){
+ fs.writeFile('testfile1', 'test1', callback);
+ },
+ function(callback){
+ fs.writeFile('testfile2', 'test2', callback);
+ }
+]);
+```
+
+It's possible to pass any number of additional arguments when calling the
+continuation:
+
+```js
+node> var fn = async.apply(sys.puts, 'one');
+node> fn('two', 'three');
+one
+two
+three
+```
+
+---------------------------------------
+
+<a name="nextTick" />
+### nextTick(callback), setImmediate(callback)
+
+Calls `callback` on a later loop around the event loop. In Node.js this just
+calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
+if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
+events may precede the execution of `callback`.
+
+This is used internally for browser-compatibility purposes.
+
+__Arguments__
+
+* `callback` - The function to call on a later loop around the event loop.
+
+__Example__
+
+```js
+var call_order = [];
+async.nextTick(function(){
+ call_order.push('two');
+ // call_order now equals ['one','two']
+});
+call_order.push('one')
+```
+
+<a name="times" />
+### times(n, iterator, [callback])
+
+Calls the `iterator` function `n` times, and accumulates results in the same manner
+you would use with [`map`](#map).
+
+__Arguments__
+
+* `n` - The number of times to run the function.
+* `iterator` - The function to call `n` times.
+* `callback` - see [`map`](#map)
+
+__Example__
+
+```js
+// Pretend this is some complicated async factory
+var createUser = function(id, callback) {
+ callback(null, {
+ id: 'user' + id
+ })
+}
+// generate 5 users
+async.times(5, function(n, next){
+ createUser(n, function(err, user) {
+ next(err, user)
+ })
+}, function(err, users) {
+ // we should now have 5 users
+});
+```
+
+__Related__
+
+* timesSeries(n, iterator, [callback])
+* timesLimit(n, limit, iterator, [callback])
+
+
+## Utils
+
+<a name="memoize" />
+### memoize(fn, [hasher])
+
+Caches the results of an `async` function. When creating a hash to store function
+results against, the callback is omitted from the hash and an optional hash
+function can be used.
+
+If no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.
+
+The cache of results is exposed as the `memo` property of the function returned
+by `memoize`.
+
+__Arguments__
+
+* `fn` - The function to proxy and cache results from.
+* `hasher` - An optional function for generating a custom hash for storing
+ results. It has all the arguments applied to it apart from the callback, and
+ must be synchronous.
+
+__Example__
+
+```js
+var slow_fn = function (name, callback) {
+ // do something
+ callback(null, result);
+};
+var fn = async.memoize(slow_fn);
+
+// fn can now be used as if it were slow_fn
+fn('some name', function () {
+ // callback
+});
+```
+
+<a name="unmemoize" />
+### unmemoize(fn)
+
+Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
+form. Handy for testing.
+
+__Arguments__
+
+* `fn` - the memoized function
+
+---------------------------------------
+
+<a name="ensureAsync" />
+### ensureAsync(fn)
+
+Wrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.
+
+__Arguments__
+
+* `fn` - an async function, one that expects a node-style callback as its last argument
+
+Returns a wrapped function with the exact same call signature as the function passed in.
+
+__Example__
+
+```js
+function sometimesAsync(arg, callback) {
+ if (cache[arg]) {
+ return callback(null, cache[arg]); // this would be synchronous!!
+ } else {
+ doSomeIO(arg, callback); // this IO would be asynchronous
+ }
+}
+
+// this has a risk of stack overflows if many results are cached in a row
+async.mapSeries(args, sometimesAsync, done);
+
+// this will defer sometimesAsync's callback if necessary,
+// preventing stack overflows
+async.mapSeries(args, async.ensureAsync(sometimesAsync), done);
+
+```
+
+---------------------------------------
+
+<a name="constant">
+### constant(values...)
+
+Returns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.
+
+__Example__
+
+```js
+async.waterfall([
+ async.constant(42),
+ function (value, next) {
+ // value === 42
+ },
+ //...
+], callback);
+
+async.waterfall([
+ async.constant(filename, "utf8"),
+ fs.readFile,
+ function (fileData, next) {
+ //...
+ }
+ //...
+], callback);
+
+async.auto({
+ hostname: async.constant("https://server.net/"),
+ port: findFreePort,
+ launchServer: ["hostname", "port", function (cb, options) {
+ startServer(options, cb);
+ }],
+ //...
+}, callback);
+
+```
+
+---------------------------------------
+
+<a name="asyncify">
+<a name="wrapSync">
+### asyncify(func)
+
+__Alias:__ `wrapSync`
+
+Take a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.
+
+__Example__
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(JSON.parse),
+ function (data, next) {
+ // data is the result of parsing the text.
+ // If there was a parsing error, it would have been caught.
+ }
+], callback)
+```
+
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value. Example:
+
+```js
+async.waterfall([
+ async.apply(fs.readFile, filename, "utf8"),
+ async.asyncify(function (contents) {
+ return db.model.create(contents);
+ }),
+ function (model, next) {
+ // `model` is the instantiated model object.
+ // If there was an error, this function would be skipped.
+ }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+ var intermediateStep = await processFile(file);
+ return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
+---------------------------------------
+
+<a name="log" />
+### log(function, arguments)
+
+Logs the result of an `async` function to the `console`. Only works in Node.js or
+in browsers that support `console.log` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.log` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, 'hello ' + name);
+ }, 1000);
+};
+```
+```js
+node> async.log(hello, 'world');
+'hello world'
+```
+
+---------------------------------------
+
+<a name="dir" />
+### dir(function, arguments)
+
+Logs the result of an `async` function to the `console` using `console.dir` to
+display the properties of the resulting object. Only works in Node.js or
+in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
+If multiple arguments are returned from the async function, `console.dir` is
+called on each argument in order.
+
+__Arguments__
+
+* `function` - The function you want to eventually apply all arguments to.
+* `arguments...` - Any number of arguments to apply to the function.
+
+__Example__
+
+```js
+var hello = function(name, callback){
+ setTimeout(function(){
+ callback(null, {hello: name});
+ }, 1000);
+};
+```
+```js
+node> async.dir(hello, 'world');
+{hello: 'world'}
+```
+
+---------------------------------------
+
+<a name="noConflict" />
+### noConflict()
+
+Changes the value of `async` back to its original value, returning a reference to the
+`async` object.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.js
new file mode 100644
index 00000000..31e7620f
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.js
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+
+ var iter = _keyIterator(object);
+ var key, completed = 0;
+
+ while ((key = iter()) != null) {
+ completed += 1;
+ iterator(object[key], key, only_once(done));
+ }
+
+ if (completed === 0) callback(null);
+
+ function done(err) {
+ completed--;
+ if (err) {
+ callback(err);
+ }
+ // Check key is null in case iterator isn't exhausted
+ // and done resolved synchronously.
+ else if (key === null && completed <= 0) {
+ callback(null);
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.setImmediate(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ arr = arr || [];
+ var results = _isArrayLike(arr) ? [] : {};
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ async.transform = function (arr, memo, iterator, callback) {
+ if (arguments.length === 3) {
+ callback = iterator;
+ iterator = memo;
+ memo = _isArray(arr) ? [] : {};
+ }
+
+ async.eachOf(arr, function(v, k, cb) {
+ iterator(memo, v, k, cb);
+ }, function(err) {
+ callback(err, memo);
+ });
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, concurrency, callback) {
+ if (typeof arguments[1] === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = remainingTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+
+ var hasError = false;
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ if (hasError) return;
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ runningTasks--;
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ hasError = true;
+
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return runningTasks < concurrency && _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ runningTasks++;
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ runningTasks++;
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+
+ async.apply = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback.apply(null, [null].concat(args));
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+
+ var removed = false;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ _arrayEach(workersList, function (worker, index) {
+ if (worker === task && !removed) {
+ workersList.splice(index, 1);
+ removed = true;
+ }
+ });
+
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var workersList = [];
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ })]));
+ });
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ var has = Object.prototype.hasOwnProperty;
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (has.call(memo, key)) {
+ async.setImmediate(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (has.call(queues, key)) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via <script> tag
+ else {
+ root.async = async;
+ }
+
+}());
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.min.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.min.js
new file mode 100644
index 00000000..2490016a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/dist/async.min.js
@@ -0,0 +1,2 @@
+!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)P.setImmediate(s.process)}}};return s}function x(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,P={},C="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=C&&(q=C.async),P.noConflict=function(){return C.async=q,P};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,y(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,y(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=d(b),P.mapSeries=k(b),P.mapLimit=g(b),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=d(w),P.selectLimit=P.filterLimit=g(w),P.selectSeries=P.filterSeries=k(w),P.reject=d(O),P.rejectLimit=g(O),P.rejectSeries=k(O),P.any=P.some=S(P.eachOf,e,t),P.someLimit=S(P.eachOfLimit,e,t),P.all=P.every=S(P.eachOf,r,r),P.everyLimit=S(P.eachOfLimit,r,r),P.detect=S(P.eachOf,t,E),P.detectSeries=S(P.eachOfSeries,t,E),P.detectLimit=S(P.eachOfLimit,t,E),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,P.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has nonexistent dependency in "+k.join(", "));if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),P.concat=d(j),P.concatSeries=k(j),P.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=I(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=x("log"),P.dir=x("dir"),P.memoize=function(n,e){var r={},u={},i=Object.prototype.hasOwnProperty;e=e||t;var o=m(function(t){var o=t.pop(),c=e.apply(null,t);i.call(r,c)?P.setImmediate(function(){o.apply(null,r[c])}):i.call(u,c)?u[c].push(o):(u[c]=[o],n.apply(null,t.concat([m(function(n){r[c]=n;var t=u[c];delete u[c];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(f(n),t,e,r)},P.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=T(P.eachOf),P.applyEachSeries=T(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},P.ensureAsync=z,P.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):C.async=P}();
+//# sourceMappingURL=dist/async.min.map \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/lib/async.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/lib/async.js
new file mode 100644
index 00000000..31e7620f
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/lib/async.js
@@ -0,0 +1,1265 @@
+/*!
+ * async
+ * https://github.com/caolan/async
+ *
+ * Copyright 2010-2014 Caolan McMahon
+ * Released under the MIT license
+ */
+(function () {
+
+ var async = {};
+ function noop() {}
+ function identity(v) {
+ return v;
+ }
+ function toBool(v) {
+ return !!v;
+ }
+ function notId(v) {
+ return !v;
+ }
+
+ // global on the server, window in the browser
+ var previous_async;
+
+ // Establish the root object, `window` (`self`) in the browser, `global`
+ // on the server, or `this` in some virtual machines. We use `self`
+ // instead of `window` for `WebWorker` support.
+ var root = typeof self === 'object' && self.self === self && self ||
+ typeof global === 'object' && global.global === global && global ||
+ this;
+
+ if (root != null) {
+ previous_async = root.async;
+ }
+
+ async.noConflict = function () {
+ root.async = previous_async;
+ return async;
+ };
+
+ function only_once(fn) {
+ return function() {
+ if (fn === null) throw new Error("Callback was already called.");
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ function _once(fn) {
+ return function() {
+ if (fn === null) return;
+ fn.apply(this, arguments);
+ fn = null;
+ };
+ }
+
+ //// cross-browser compatiblity functions ////
+
+ var _toString = Object.prototype.toString;
+
+ var _isArray = Array.isArray || function (obj) {
+ return _toString.call(obj) === '[object Array]';
+ };
+
+ // Ported from underscore.js isObject
+ var _isObject = function(obj) {
+ var type = typeof obj;
+ return type === 'function' || type === 'object' && !!obj;
+ };
+
+ function _isArrayLike(arr) {
+ return _isArray(arr) || (
+ // has a positive integer length property
+ typeof arr.length === "number" &&
+ arr.length >= 0 &&
+ arr.length % 1 === 0
+ );
+ }
+
+ function _arrayEach(arr, iterator) {
+ var index = -1,
+ length = arr.length;
+
+ while (++index < length) {
+ iterator(arr[index], index, arr);
+ }
+ }
+
+ function _map(arr, iterator) {
+ var index = -1,
+ length = arr.length,
+ result = Array(length);
+
+ while (++index < length) {
+ result[index] = iterator(arr[index], index, arr);
+ }
+ return result;
+ }
+
+ function _range(count) {
+ return _map(Array(count), function (v, i) { return i; });
+ }
+
+ function _reduce(arr, iterator, memo) {
+ _arrayEach(arr, function (x, i, a) {
+ memo = iterator(memo, x, i, a);
+ });
+ return memo;
+ }
+
+ function _forEachOf(object, iterator) {
+ _arrayEach(_keys(object), function (key) {
+ iterator(object[key], key);
+ });
+ }
+
+ function _indexOf(arr, item) {
+ for (var i = 0; i < arr.length; i++) {
+ if (arr[i] === item) return i;
+ }
+ return -1;
+ }
+
+ var _keys = Object.keys || function (obj) {
+ var keys = [];
+ for (var k in obj) {
+ if (obj.hasOwnProperty(k)) {
+ keys.push(k);
+ }
+ }
+ return keys;
+ };
+
+ function _keyIterator(coll) {
+ var i = -1;
+ var len;
+ var keys;
+ if (_isArrayLike(coll)) {
+ len = coll.length;
+ return function next() {
+ i++;
+ return i < len ? i : null;
+ };
+ } else {
+ keys = _keys(coll);
+ len = keys.length;
+ return function next() {
+ i++;
+ return i < len ? keys[i] : null;
+ };
+ }
+ }
+
+ // Similar to ES6's rest param (http://ariya.ofilabs.com/2013/03/es6-and-rest-parameter.html)
+ // This accumulates the arguments passed into an array, after a given index.
+ // From underscore.js (https://github.com/jashkenas/underscore/pull/2140).
+ function _restParam(func, startIndex) {
+ startIndex = startIndex == null ? func.length - 1 : +startIndex;
+ return function() {
+ var length = Math.max(arguments.length - startIndex, 0);
+ var rest = Array(length);
+ for (var index = 0; index < length; index++) {
+ rest[index] = arguments[index + startIndex];
+ }
+ switch (startIndex) {
+ case 0: return func.call(this, rest);
+ case 1: return func.call(this, arguments[0], rest);
+ }
+ // Currently unused but handle cases outside of the switch statement:
+ // var args = Array(startIndex + 1);
+ // for (index = 0; index < startIndex; index++) {
+ // args[index] = arguments[index];
+ // }
+ // args[startIndex] = rest;
+ // return func.apply(this, args);
+ };
+ }
+
+ function _withoutIndex(iterator) {
+ return function (value, index, callback) {
+ return iterator(value, callback);
+ };
+ }
+
+ //// exported async module functions ////
+
+ //// nextTick implementation with browser-compatible fallback ////
+
+ // capture the global reference to guard against fakeTimer mocks
+ var _setImmediate = typeof setImmediate === 'function' && setImmediate;
+
+ var _delay = _setImmediate ? function(fn) {
+ // not a direct alias for IE10 compatibility
+ _setImmediate(fn);
+ } : function(fn) {
+ setTimeout(fn, 0);
+ };
+
+ if (typeof process === 'object' && typeof process.nextTick === 'function') {
+ async.nextTick = process.nextTick;
+ } else {
+ async.nextTick = _delay;
+ }
+ async.setImmediate = _setImmediate ? _delay : async.nextTick;
+
+
+ async.forEach =
+ async.each = function (arr, iterator, callback) {
+ return async.eachOf(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachSeries =
+ async.eachSeries = function (arr, iterator, callback) {
+ return async.eachOfSeries(arr, _withoutIndex(iterator), callback);
+ };
+
+
+ async.forEachLimit =
+ async.eachLimit = function (arr, limit, iterator, callback) {
+ return _eachOfLimit(limit)(arr, _withoutIndex(iterator), callback);
+ };
+
+ async.forEachOf =
+ async.eachOf = function (object, iterator, callback) {
+ callback = _once(callback || noop);
+ object = object || [];
+
+ var iter = _keyIterator(object);
+ var key, completed = 0;
+
+ while ((key = iter()) != null) {
+ completed += 1;
+ iterator(object[key], key, only_once(done));
+ }
+
+ if (completed === 0) callback(null);
+
+ function done(err) {
+ completed--;
+ if (err) {
+ callback(err);
+ }
+ // Check key is null in case iterator isn't exhausted
+ // and done resolved synchronously.
+ else if (key === null && completed <= 0) {
+ callback(null);
+ }
+ }
+ };
+
+ async.forEachOfSeries =
+ async.eachOfSeries = function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ var key = nextKey();
+ function iterate() {
+ var sync = true;
+ if (key === null) {
+ return callback(null);
+ }
+ iterator(obj[key], key, only_once(function (err) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ key = nextKey();
+ if (key === null) {
+ return callback(null);
+ } else {
+ if (sync) {
+ async.setImmediate(iterate);
+ } else {
+ iterate();
+ }
+ }
+ }
+ }));
+ sync = false;
+ }
+ iterate();
+ };
+
+
+
+ async.forEachOfLimit =
+ async.eachOfLimit = function (obj, limit, iterator, callback) {
+ _eachOfLimit(limit)(obj, iterator, callback);
+ };
+
+ function _eachOfLimit(limit) {
+
+ return function (obj, iterator, callback) {
+ callback = _once(callback || noop);
+ obj = obj || [];
+ var nextKey = _keyIterator(obj);
+ if (limit <= 0) {
+ return callback(null);
+ }
+ var done = false;
+ var running = 0;
+ var errored = false;
+
+ (function replenish () {
+ if (done && running <= 0) {
+ return callback(null);
+ }
+
+ while (running < limit && !errored) {
+ var key = nextKey();
+ if (key === null) {
+ done = true;
+ if (running <= 0) {
+ callback(null);
+ }
+ return;
+ }
+ running += 1;
+ iterator(obj[key], key, only_once(function (err) {
+ running -= 1;
+ if (err) {
+ callback(err);
+ errored = true;
+ }
+ else {
+ replenish();
+ }
+ }));
+ }
+ })();
+ };
+ }
+
+
+ function doParallel(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOf, obj, iterator, callback);
+ };
+ }
+ function doParallelLimit(fn) {
+ return function (obj, limit, iterator, callback) {
+ return fn(_eachOfLimit(limit), obj, iterator, callback);
+ };
+ }
+ function doSeries(fn) {
+ return function (obj, iterator, callback) {
+ return fn(async.eachOfSeries, obj, iterator, callback);
+ };
+ }
+
+ function _asyncMap(eachfn, arr, iterator, callback) {
+ callback = _once(callback || noop);
+ arr = arr || [];
+ var results = _isArrayLike(arr) ? [] : {};
+ eachfn(arr, function (value, index, callback) {
+ iterator(value, function (err, v) {
+ results[index] = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.map = doParallel(_asyncMap);
+ async.mapSeries = doSeries(_asyncMap);
+ async.mapLimit = doParallelLimit(_asyncMap);
+
+ // reduce only has a series version, as doing reduce in parallel won't
+ // work in many situations.
+ async.inject =
+ async.foldl =
+ async.reduce = function (arr, memo, iterator, callback) {
+ async.eachOfSeries(arr, function (x, i, callback) {
+ iterator(memo, x, function (err, v) {
+ memo = v;
+ callback(err);
+ });
+ }, function (err) {
+ callback(err, memo);
+ });
+ };
+
+ async.foldr =
+ async.reduceRight = function (arr, memo, iterator, callback) {
+ var reversed = _map(arr, identity).reverse();
+ async.reduce(reversed, memo, iterator, callback);
+ };
+
+ async.transform = function (arr, memo, iterator, callback) {
+ if (arguments.length === 3) {
+ callback = iterator;
+ iterator = memo;
+ memo = _isArray(arr) ? [] : {};
+ }
+
+ async.eachOf(arr, function(v, k, cb) {
+ iterator(memo, v, k, cb);
+ }, function(err) {
+ callback(err, memo);
+ });
+ };
+
+ function _filter(eachfn, arr, iterator, callback) {
+ var results = [];
+ eachfn(arr, function (x, index, callback) {
+ iterator(x, function (v) {
+ if (v) {
+ results.push({index: index, value: x});
+ }
+ callback();
+ });
+ }, function () {
+ callback(_map(results.sort(function (a, b) {
+ return a.index - b.index;
+ }), function (x) {
+ return x.value;
+ }));
+ });
+ }
+
+ async.select =
+ async.filter = doParallel(_filter);
+
+ async.selectLimit =
+ async.filterLimit = doParallelLimit(_filter);
+
+ async.selectSeries =
+ async.filterSeries = doSeries(_filter);
+
+ function _reject(eachfn, arr, iterator, callback) {
+ _filter(eachfn, arr, function(value, cb) {
+ iterator(value, function(v) {
+ cb(!v);
+ });
+ }, callback);
+ }
+ async.reject = doParallel(_reject);
+ async.rejectLimit = doParallelLimit(_reject);
+ async.rejectSeries = doSeries(_reject);
+
+ function _createTester(eachfn, check, getResult) {
+ return function(arr, limit, iterator, cb) {
+ function done() {
+ if (cb) cb(getResult(false, void 0));
+ }
+ function iteratee(x, _, callback) {
+ if (!cb) return callback();
+ iterator(x, function (v) {
+ if (cb && check(v)) {
+ cb(getResult(true, x));
+ cb = iterator = false;
+ }
+ callback();
+ });
+ }
+ if (arguments.length > 3) {
+ eachfn(arr, limit, iteratee, done);
+ } else {
+ cb = iterator;
+ iterator = limit;
+ eachfn(arr, iteratee, done);
+ }
+ };
+ }
+
+ async.any =
+ async.some = _createTester(async.eachOf, toBool, identity);
+
+ async.someLimit = _createTester(async.eachOfLimit, toBool, identity);
+
+ async.all =
+ async.every = _createTester(async.eachOf, notId, notId);
+
+ async.everyLimit = _createTester(async.eachOfLimit, notId, notId);
+
+ function _findGetResult(v, x) {
+ return x;
+ }
+ async.detect = _createTester(async.eachOf, identity, _findGetResult);
+ async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
+
+ async.sortBy = function (arr, iterator, callback) {
+ async.map(arr, function (x, callback) {
+ iterator(x, function (err, criteria) {
+ if (err) {
+ callback(err);
+ }
+ else {
+ callback(null, {value: x, criteria: criteria});
+ }
+ });
+ }, function (err, results) {
+ if (err) {
+ return callback(err);
+ }
+ else {
+ callback(null, _map(results.sort(comparator), function (x) {
+ return x.value;
+ }));
+ }
+
+ });
+
+ function comparator(left, right) {
+ var a = left.criteria, b = right.criteria;
+ return a < b ? -1 : a > b ? 1 : 0;
+ }
+ };
+
+ async.auto = function (tasks, concurrency, callback) {
+ if (typeof arguments[1] === 'function') {
+ // concurrency is optional, shift the args.
+ callback = concurrency;
+ concurrency = null;
+ }
+ callback = _once(callback || noop);
+ var keys = _keys(tasks);
+ var remainingTasks = keys.length;
+ if (!remainingTasks) {
+ return callback(null);
+ }
+ if (!concurrency) {
+ concurrency = remainingTasks;
+ }
+
+ var results = {};
+ var runningTasks = 0;
+
+ var hasError = false;
+
+ var listeners = [];
+ function addListener(fn) {
+ listeners.unshift(fn);
+ }
+ function removeListener(fn) {
+ var idx = _indexOf(listeners, fn);
+ if (idx >= 0) listeners.splice(idx, 1);
+ }
+ function taskComplete() {
+ remainingTasks--;
+ _arrayEach(listeners.slice(0), function (fn) {
+ fn();
+ });
+ }
+
+ addListener(function () {
+ if (!remainingTasks) {
+ callback(null, results);
+ }
+ });
+
+ _arrayEach(keys, function (k) {
+ if (hasError) return;
+ var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
+ var taskCallback = _restParam(function(err, args) {
+ runningTasks--;
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ if (err) {
+ var safeResults = {};
+ _forEachOf(results, function(val, rkey) {
+ safeResults[rkey] = val;
+ });
+ safeResults[k] = args;
+ hasError = true;
+
+ callback(err, safeResults);
+ }
+ else {
+ results[k] = args;
+ async.setImmediate(taskComplete);
+ }
+ });
+ var requires = task.slice(0, task.length - 1);
+ // prevent dead-locks
+ var len = requires.length;
+ var dep;
+ while (len--) {
+ if (!(dep = tasks[requires[len]])) {
+ throw new Error('Has nonexistent dependency in ' + requires.join(', '));
+ }
+ if (_isArray(dep) && _indexOf(dep, k) >= 0) {
+ throw new Error('Has cyclic dependencies');
+ }
+ }
+ function ready() {
+ return runningTasks < concurrency && _reduce(requires, function (a, x) {
+ return (a && results.hasOwnProperty(x));
+ }, true) && !results.hasOwnProperty(k);
+ }
+ if (ready()) {
+ runningTasks++;
+ task[task.length - 1](taskCallback, results);
+ }
+ else {
+ addListener(listener);
+ }
+ function listener() {
+ if (ready()) {
+ runningTasks++;
+ removeListener(listener);
+ task[task.length - 1](taskCallback, results);
+ }
+ }
+ });
+ };
+
+
+
+ async.retry = function(times, task, callback) {
+ var DEFAULT_TIMES = 5;
+ var DEFAULT_INTERVAL = 0;
+
+ var attempts = [];
+
+ var opts = {
+ times: DEFAULT_TIMES,
+ interval: DEFAULT_INTERVAL
+ };
+
+ function parseTimes(acc, t){
+ if(typeof t === 'number'){
+ acc.times = parseInt(t, 10) || DEFAULT_TIMES;
+ } else if(typeof t === 'object'){
+ acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
+ acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
+ } else {
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
+ }
+ }
+
+ var length = arguments.length;
+ if (length < 1 || length > 3) {
+ throw new Error('Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)');
+ } else if (length <= 2 && typeof times === 'function') {
+ callback = task;
+ task = times;
+ }
+ if (typeof times !== 'function') {
+ parseTimes(opts, times);
+ }
+ opts.callback = callback;
+ opts.task = task;
+
+ function wrappedTask(wrappedCallback, wrappedResults) {
+ function retryAttempt(task, finalAttempt) {
+ return function(seriesCallback) {
+ task(function(err, result){
+ seriesCallback(!err || finalAttempt, {err: err, result: result});
+ }, wrappedResults);
+ };
+ }
+
+ function retryInterval(interval){
+ return function(seriesCallback){
+ setTimeout(function(){
+ seriesCallback(null);
+ }, interval);
+ };
+ }
+
+ while (opts.times) {
+
+ var finalAttempt = !(opts.times-=1);
+ attempts.push(retryAttempt(opts.task, finalAttempt));
+ if(!finalAttempt && opts.interval > 0){
+ attempts.push(retryInterval(opts.interval));
+ }
+ }
+
+ async.series(attempts, function(done, data){
+ data = data[data.length - 1];
+ (wrappedCallback || opts.callback)(data.err, data.result);
+ });
+ }
+
+ // If a callback is passed, run this as a controll flow
+ return opts.callback ? wrappedTask() : wrappedTask;
+ };
+
+ async.waterfall = function (tasks, callback) {
+ callback = _once(callback || noop);
+ if (!_isArray(tasks)) {
+ var err = new Error('First argument to waterfall must be an array of functions');
+ return callback(err);
+ }
+ if (!tasks.length) {
+ return callback();
+ }
+ function wrapIterator(iterator) {
+ return _restParam(function (err, args) {
+ if (err) {
+ callback.apply(null, [err].concat(args));
+ }
+ else {
+ var next = iterator.next();
+ if (next) {
+ args.push(wrapIterator(next));
+ }
+ else {
+ args.push(callback);
+ }
+ ensureAsync(iterator).apply(null, args);
+ }
+ });
+ }
+ wrapIterator(async.iterator(tasks))();
+ };
+
+ function _parallel(eachfn, tasks, callback) {
+ callback = callback || noop;
+ var results = _isArrayLike(tasks) ? [] : {};
+
+ eachfn(tasks, function (task, key, callback) {
+ task(_restParam(function (err, args) {
+ if (args.length <= 1) {
+ args = args[0];
+ }
+ results[key] = args;
+ callback(err);
+ }));
+ }, function (err) {
+ callback(err, results);
+ });
+ }
+
+ async.parallel = function (tasks, callback) {
+ _parallel(async.eachOf, tasks, callback);
+ };
+
+ async.parallelLimit = function(tasks, limit, callback) {
+ _parallel(_eachOfLimit(limit), tasks, callback);
+ };
+
+ async.series = function(tasks, callback) {
+ _parallel(async.eachOfSeries, tasks, callback);
+ };
+
+ async.iterator = function (tasks) {
+ function makeCallback(index) {
+ function fn() {
+ if (tasks.length) {
+ tasks[index].apply(null, arguments);
+ }
+ return fn.next();
+ }
+ fn.next = function () {
+ return (index < tasks.length - 1) ? makeCallback(index + 1): null;
+ };
+ return fn;
+ }
+ return makeCallback(0);
+ };
+
+ async.apply = _restParam(function (fn, args) {
+ return _restParam(function (callArgs) {
+ return fn.apply(
+ null, args.concat(callArgs)
+ );
+ });
+ });
+
+ function _concat(eachfn, arr, fn, callback) {
+ var result = [];
+ eachfn(arr, function (x, index, cb) {
+ fn(x, function (err, y) {
+ result = result.concat(y || []);
+ cb(err);
+ });
+ }, function (err) {
+ callback(err, result);
+ });
+ }
+ async.concat = doParallel(_concat);
+ async.concatSeries = doSeries(_concat);
+
+ async.whilst = function (test, iterator, callback) {
+ callback = callback || noop;
+ if (test()) {
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else if (test.apply(this, args)) {
+ iterator(next);
+ } else {
+ callback.apply(null, [null].concat(args));
+ }
+ });
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ async.doWhilst = function (iterator, test, callback) {
+ var calls = 0;
+ return async.whilst(function() {
+ return ++calls <= 1 || test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.until = function (test, iterator, callback) {
+ return async.whilst(function() {
+ return !test.apply(this, arguments);
+ }, iterator, callback);
+ };
+
+ async.doUntil = function (iterator, test, callback) {
+ return async.doWhilst(iterator, function() {
+ return !test.apply(this, arguments);
+ }, callback);
+ };
+
+ async.during = function (test, iterator, callback) {
+ callback = callback || noop;
+
+ var next = _restParam(function(err, args) {
+ if (err) {
+ callback(err);
+ } else {
+ args.push(check);
+ test.apply(this, args);
+ }
+ });
+
+ var check = function(err, truth) {
+ if (err) {
+ callback(err);
+ } else if (truth) {
+ iterator(next);
+ } else {
+ callback(null);
+ }
+ };
+
+ test(check);
+ };
+
+ async.doDuring = function (iterator, test, callback) {
+ var calls = 0;
+ async.during(function(next) {
+ if (calls++ < 1) {
+ next(null, true);
+ } else {
+ test.apply(this, arguments);
+ }
+ }, iterator, callback);
+ };
+
+ function _queue(worker, concurrency, payload) {
+ if (concurrency == null) {
+ concurrency = 1;
+ }
+ else if(concurrency === 0) {
+ throw new Error('Concurrency must not be zero');
+ }
+ function _insert(q, data, pos, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0 && q.idle()) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ callback: callback || noop
+ };
+
+ if (pos) {
+ q.tasks.unshift(item);
+ } else {
+ q.tasks.push(item);
+ }
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ });
+ async.setImmediate(q.process);
+ }
+ function _next(q, tasks) {
+ return function(){
+ workers -= 1;
+
+ var removed = false;
+ var args = arguments;
+ _arrayEach(tasks, function (task) {
+ _arrayEach(workersList, function (worker, index) {
+ if (worker === task && !removed) {
+ workersList.splice(index, 1);
+ removed = true;
+ }
+ });
+
+ task.callback.apply(task, args);
+ });
+ if (q.tasks.length + workers === 0) {
+ q.drain();
+ }
+ q.process();
+ };
+ }
+
+ var workers = 0;
+ var workersList = [];
+ var q = {
+ tasks: [],
+ concurrency: concurrency,
+ payload: payload,
+ saturated: noop,
+ empty: noop,
+ drain: noop,
+ started: false,
+ paused: false,
+ push: function (data, callback) {
+ _insert(q, data, false, callback);
+ },
+ kill: function () {
+ q.drain = noop;
+ q.tasks = [];
+ },
+ unshift: function (data, callback) {
+ _insert(q, data, true, callback);
+ },
+ process: function () {
+ while(!q.paused && workers < q.concurrency && q.tasks.length){
+
+ var tasks = q.payload ?
+ q.tasks.splice(0, q.payload) :
+ q.tasks.splice(0, q.tasks.length);
+
+ var data = _map(tasks, function (task) {
+ return task.data;
+ });
+
+ if (q.tasks.length === 0) {
+ q.empty();
+ }
+ workers += 1;
+ workersList.push(tasks[0]);
+ var cb = only_once(_next(q, tasks));
+ worker(data, cb);
+ }
+ },
+ length: function () {
+ return q.tasks.length;
+ },
+ running: function () {
+ return workers;
+ },
+ workersList: function () {
+ return workersList;
+ },
+ idle: function() {
+ return q.tasks.length + workers === 0;
+ },
+ pause: function () {
+ q.paused = true;
+ },
+ resume: function () {
+ if (q.paused === false) { return; }
+ q.paused = false;
+ var resumeCount = Math.min(q.concurrency, q.tasks.length);
+ // Need to call q.process once per concurrent
+ // worker to preserve full concurrency after pause
+ for (var w = 1; w <= resumeCount; w++) {
+ async.setImmediate(q.process);
+ }
+ }
+ };
+ return q;
+ }
+
+ async.queue = function (worker, concurrency) {
+ var q = _queue(function (items, cb) {
+ worker(items[0], cb);
+ }, concurrency, 1);
+
+ return q;
+ };
+
+ async.priorityQueue = function (worker, concurrency) {
+
+ function _compareTasks(a, b){
+ return a.priority - b.priority;
+ }
+
+ function _binarySearch(sequence, item, compare) {
+ var beg = -1,
+ end = sequence.length - 1;
+ while (beg < end) {
+ var mid = beg + ((end - beg + 1) >>> 1);
+ if (compare(item, sequence[mid]) >= 0) {
+ beg = mid;
+ } else {
+ end = mid - 1;
+ }
+ }
+ return beg;
+ }
+
+ function _insert(q, data, priority, callback) {
+ if (callback != null && typeof callback !== "function") {
+ throw new Error("task callback must be a function");
+ }
+ q.started = true;
+ if (!_isArray(data)) {
+ data = [data];
+ }
+ if(data.length === 0) {
+ // call drain immediately if there are no tasks
+ return async.setImmediate(function() {
+ q.drain();
+ });
+ }
+ _arrayEach(data, function(task) {
+ var item = {
+ data: task,
+ priority: priority,
+ callback: typeof callback === 'function' ? callback : noop
+ };
+
+ q.tasks.splice(_binarySearch(q.tasks, item, _compareTasks) + 1, 0, item);
+
+ if (q.tasks.length === q.concurrency) {
+ q.saturated();
+ }
+ async.setImmediate(q.process);
+ });
+ }
+
+ // Start with a normal queue
+ var q = async.queue(worker, concurrency);
+
+ // Override push to accept second parameter representing priority
+ q.push = function (data, priority, callback) {
+ _insert(q, data, priority, callback);
+ };
+
+ // Remove unshift function
+ delete q.unshift;
+
+ return q;
+ };
+
+ async.cargo = function (worker, payload) {
+ return _queue(worker, 1, payload);
+ };
+
+ function _console_fn(name) {
+ return _restParam(function (fn, args) {
+ fn.apply(null, args.concat([_restParam(function (err, args) {
+ if (typeof console === 'object') {
+ if (err) {
+ if (console.error) {
+ console.error(err);
+ }
+ }
+ else if (console[name]) {
+ _arrayEach(args, function (x) {
+ console[name](x);
+ });
+ }
+ }
+ })]));
+ });
+ }
+ async.log = _console_fn('log');
+ async.dir = _console_fn('dir');
+ /*async.info = _console_fn('info');
+ async.warn = _console_fn('warn');
+ async.error = _console_fn('error');*/
+
+ async.memoize = function (fn, hasher) {
+ var memo = {};
+ var queues = {};
+ var has = Object.prototype.hasOwnProperty;
+ hasher = hasher || identity;
+ var memoized = _restParam(function memoized(args) {
+ var callback = args.pop();
+ var key = hasher.apply(null, args);
+ if (has.call(memo, key)) {
+ async.setImmediate(function () {
+ callback.apply(null, memo[key]);
+ });
+ }
+ else if (has.call(queues, key)) {
+ queues[key].push(callback);
+ }
+ else {
+ queues[key] = [callback];
+ fn.apply(null, args.concat([_restParam(function (args) {
+ memo[key] = args;
+ var q = queues[key];
+ delete queues[key];
+ for (var i = 0, l = q.length; i < l; i++) {
+ q[i].apply(null, args);
+ }
+ })]));
+ }
+ });
+ memoized.memo = memo;
+ memoized.unmemoized = fn;
+ return memoized;
+ };
+
+ async.unmemoize = function (fn) {
+ return function () {
+ return (fn.unmemoized || fn).apply(null, arguments);
+ };
+ };
+
+ function _times(mapper) {
+ return function (count, iterator, callback) {
+ mapper(_range(count), iterator, callback);
+ };
+ }
+
+ async.times = _times(async.map);
+ async.timesSeries = _times(async.mapSeries);
+ async.timesLimit = function (count, limit, iterator, callback) {
+ return async.mapLimit(_range(count), limit, iterator, callback);
+ };
+
+ async.seq = function (/* functions... */) {
+ var fns = arguments;
+ return _restParam(function (args) {
+ var that = this;
+
+ var callback = args[args.length - 1];
+ if (typeof callback == 'function') {
+ args.pop();
+ } else {
+ callback = noop;
+ }
+
+ async.reduce(fns, args, function (newargs, fn, cb) {
+ fn.apply(that, newargs.concat([_restParam(function (err, nextargs) {
+ cb(err, nextargs);
+ })]));
+ },
+ function (err, results) {
+ callback.apply(that, [err].concat(results));
+ });
+ });
+ };
+
+ async.compose = function (/* functions... */) {
+ return async.seq.apply(null, Array.prototype.reverse.call(arguments));
+ };
+
+
+ function _applyEach(eachfn) {
+ return _restParam(function(fns, args) {
+ var go = _restParam(function(args) {
+ var that = this;
+ var callback = args.pop();
+ return eachfn(fns, function (fn, _, cb) {
+ fn.apply(that, args.concat([cb]));
+ },
+ callback);
+ });
+ if (args.length) {
+ return go.apply(this, args);
+ }
+ else {
+ return go;
+ }
+ });
+ }
+
+ async.applyEach = _applyEach(async.eachOf);
+ async.applyEachSeries = _applyEach(async.eachOfSeries);
+
+
+ async.forever = function (fn, callback) {
+ var done = only_once(callback || noop);
+ var task = ensureAsync(fn);
+ function next(err) {
+ if (err) {
+ return done(err);
+ }
+ task(next);
+ }
+ next();
+ };
+
+ function ensureAsync(fn) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ args.push(function () {
+ var innerArgs = arguments;
+ if (sync) {
+ async.setImmediate(function () {
+ callback.apply(null, innerArgs);
+ });
+ } else {
+ callback.apply(null, innerArgs);
+ }
+ });
+ var sync = true;
+ fn.apply(this, args);
+ sync = false;
+ });
+ }
+
+ async.ensureAsync = ensureAsync;
+
+ async.constant = _restParam(function(values) {
+ var args = [null].concat(values);
+ return function (callback) {
+ return callback.apply(this, args);
+ };
+ });
+
+ async.wrapSync =
+ async.asyncify = function asyncify(func) {
+ return _restParam(function (args) {
+ var callback = args.pop();
+ var result;
+ try {
+ result = func.apply(this, args);
+ } catch (e) {
+ return callback(e);
+ }
+ // if result is Promise object
+ if (_isObject(result) && typeof result.then === "function") {
+ result.then(function(value) {
+ callback(null, value);
+ })["catch"](function(err) {
+ callback(err.message ? err : new Error(err));
+ });
+ } else {
+ callback(null, result);
+ }
+ });
+ };
+
+ // Node.js
+ if (typeof module === 'object' && module.exports) {
+ module.exports = async;
+ }
+ // AMD / RequireJS
+ else if (typeof define === 'function' && define.amd) {
+ define([], function () {
+ return async;
+ });
+ }
+ // included directly via <script> tag
+ else {
+ root.async = async;
+ }
+
+}());
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/package.json
new file mode 100644
index 00000000..1ed310eb
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/async/package.json
@@ -0,0 +1,157 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "async@1.x",
+ "scope": null,
+ "escapedName": "async",
+ "name": "async",
+ "rawSpec": "1.x",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul"
+ ]
+ ],
+ "_from": "async@>=1.0.0 <2.0.0",
+ "_id": "async@1.5.2",
+ "_inCache": true,
+ "_location": "/istanbul/async",
+ "_nodeVersion": "4.2.3",
+ "_npmUser": {
+ "name": "aearly",
+ "email": "alexander.early@gmail.com"
+ },
+ "_npmVersion": "3.5.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "async@1.x",
+ "scope": null,
+ "escapedName": "async",
+ "name": "async",
+ "rawSpec": "1.x",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/istanbul"
+ ],
+ "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+ "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+ "_shrinkwrap": null,
+ "_spec": "async@1.x",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul",
+ "author": {
+ "name": "Caolan McMahon"
+ },
+ "bugs": {
+ "url": "https://github.com/caolan/async/issues"
+ },
+ "dependencies": {},
+ "description": "Higher-order functions and common patterns for asynchronous code",
+ "devDependencies": {
+ "benchmark": "github:bestiejs/benchmark.js",
+ "bluebird": "^2.9.32",
+ "chai": "^3.1.0",
+ "coveralls": "^2.11.2",
+ "es6-promise": "^2.3.0",
+ "jscs": "^1.13.1",
+ "jshint": "~2.8.0",
+ "karma": "^0.13.2",
+ "karma-browserify": "^4.2.1",
+ "karma-firefox-launcher": "^0.1.6",
+ "karma-mocha": "^0.2.0",
+ "karma-mocha-reporter": "^1.0.2",
+ "lodash": "^3.9.0",
+ "mkdirp": "~0.5.1",
+ "mocha": "^2.2.5",
+ "native-promise-only": "^0.8.0-a",
+ "nodeunit": ">0.0.0",
+ "nyc": "^2.1.0",
+ "rsvp": "^3.0.18",
+ "semver": "^4.3.6",
+ "uglify-js": "~2.4.0",
+ "xyz": "^0.5.0",
+ "yargs": "~3.9.1"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+ "tarball": "https://registry.npmjs.org/async/-/async-1.5.2.tgz"
+ },
+ "files": [
+ "lib",
+ "dist/async.js",
+ "dist/async.min.js"
+ ],
+ "gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c",
+ "homepage": "https://github.com/caolan/async#readme",
+ "jam": {
+ "main": "lib/async.js",
+ "include": [
+ "lib/async.js",
+ "README.md",
+ "LICENSE"
+ ],
+ "categories": [
+ "Utilities"
+ ]
+ },
+ "keywords": [
+ "async",
+ "callback",
+ "utility",
+ "module"
+ ],
+ "license": "MIT",
+ "main": "lib/async.js",
+ "maintainers": [
+ {
+ "name": "caolan",
+ "email": "caolan.mcmahon@gmail.com"
+ },
+ {
+ "name": "beaugunderson",
+ "email": "beau@beaugunderson.com"
+ },
+ {
+ "name": "aearly",
+ "email": "alexander.early@gmail.com"
+ },
+ {
+ "name": "megawac",
+ "email": "megawac@gmail.com"
+ }
+ ],
+ "name": "async",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/caolan/async.git"
+ },
+ "scripts": {
+ "coverage": "nyc npm test && nyc report",
+ "coveralls": "nyc npm test && nyc report --reporter=text-lcov | coveralls",
+ "lint": "jshint lib/*.js test/*.js perf/*.js && jscs lib/*.js test/*.js perf/*.js",
+ "mocha-browser-test": "karma start",
+ "mocha-node-test": "mocha mocha_test/",
+ "mocha-test": "npm run mocha-node-test && npm run mocha-browser-test",
+ "nodeunit-test": "nodeunit test/test-async.js",
+ "test": "npm run-script lint && npm run nodeunit-test && npm run mocha-test"
+ },
+ "spm": {
+ "main": "lib/async.js"
+ },
+ "version": "1.5.2",
+ "volo": {
+ "main": "lib/async.js",
+ "ignore": [
+ "**/.*",
+ "node_modules",
+ "bower_components",
+ "test",
+ "tests"
+ ]
+ }
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/ChangeLog b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/ChangeLog
new file mode 100644
index 00000000..15096d72
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/ChangeLog
@@ -0,0 +1,143 @@
+2015-07-31: Version 2.5.0
+
+ * Run the test suite in a browser environment (issue 1004)
+ * Ensure a comma between imported default binding and named imports (issue 1046)
+ * Distinguish `yield` as a keyword vs an identifier (issue 1186)
+ * Support ES5 meta property `new.target` (issue 1203)
+ * Fix the syntax node for yield with expression (issue 1223)
+ * Fix the check of duplicated proto in property names (issue 1225)
+ * Fix ES6 Unicode escape in identifier name (issue 1229)
+ * Support ES6 IdentifierStart and IdentifierPart (issue 1232)
+ * Treat await as a reserved word when parsing as a module (issue 1234)
+ * Recognize identifier characters from Unicode SMP (issue 1244)
+ * Ensure that export and import can be followed by a comma (issue 1250)
+ * Fix yield operator precedence (issue 1262)
+
+2015-07-01: Version 2.4.1
+
+ * Fix some cases of comment attachment (issue 1071, 1175)
+ * Fix the handling of destructuring in function arguments (issue 1193)
+ * Fix invalid ranges in assignment expression (issue 1201)
+
+2015-06-26: Version 2.4.0
+
+ * Support ES6 for-of iteration (issue 1047)
+ * Support ES6 spread arguments (issue 1169)
+ * Minimize npm payload (issue 1191)
+
+2015-06-16: Version 2.3.0
+
+ * Support ES6 generator (issue 1033)
+ * Improve parsing of regular expressions with `u` flag (issue 1179)
+
+2015-04-17: Version 2.2.0
+
+ * Support ES6 import and export declarations (issue 1000)
+ * Fix line terminator before arrow not recognized as error (issue 1009)
+ * Support ES6 destructuring (issue 1045)
+ * Support ES6 template literal (issue 1074)
+ * Fix the handling of invalid/incomplete string escape sequences (issue 1106)
+ * Fix ES3 static member access restriction (issue 1120)
+ * Support for `super` in ES6 class (issue 1147)
+
+2015-03-09: Version 2.1.0
+
+ * Support ES6 class (issue 1001)
+ * Support ES6 rest parameter (issue 1011)
+ * Expand the location of property getter, setter, and methods (issue 1029)
+ * Enable TryStatement transition to a single handler (issue 1031)
+ * Support ES6 computed property name (issue 1037)
+ * Tolerate unclosed block comment (issue 1041)
+ * Support ES6 lexical declaration (issue 1065)
+
+2015-02-06: Version 2.0.0
+
+ * Support ES6 arrow function (issue 517)
+ * Support ES6 Unicode code point escape (issue 521)
+ * Improve the speed and accuracy of comment attachment (issue 522)
+ * Support ES6 default parameter (issue 519)
+ * Support ES6 regular expression flags (issue 557)
+ * Fix scanning of implicit octal literals (issue 565)
+ * Fix the handling of automatic semicolon insertion (issue 574)
+ * Support ES6 method definition (issue 620)
+ * Support ES6 octal integer literal (issue 621)
+ * Support ES6 binary integer literal (issue 622)
+ * Support ES6 object literal property value shorthand (issue 624)
+
+2015-03-03: Version 1.2.5
+
+ * Fix scanning of implicit octal literals (issue 565)
+
+2015-02-05: Version 1.2.4
+
+ * Fix parsing of LeftHandSideExpression in ForInStatement (issue 560)
+ * Fix the handling of automatic semicolon insertion (issue 574)
+
+2015-01-18: Version 1.2.3
+
+ * Fix division by this (issue 616)
+
+2014-05-18: Version 1.2.2
+
+ * Fix duplicated tokens when collecting comments (issue 537)
+
+2014-05-04: Version 1.2.1
+
+ * Ensure that Program node may still have leading comments (issue 536)
+
+2014-04-29: Version 1.2.0
+
+ * Fix semicolon handling for expression statement (issue 462, 533)
+ * Disallow escaped characters in regular expression flags (issue 503)
+ * Performance improvement for location tracking (issue 520)
+ * Improve the speed of comment attachment (issue 522)
+
+2014-03-26: Version 1.1.1
+
+ * Fix token handling of forward slash after an array literal (issue 512)
+
+2014-03-23: Version 1.1.0
+
+ * Optionally attach comments to the owning syntax nodes (issue 197)
+ * Simplify binary parsing with stack-based shift reduce (issue 352)
+ * Always include the raw source of literals (issue 376)
+ * Add optional input source information (issue 386)
+ * Tokenizer API for pure lexical scanning (issue 398)
+ * Improve the web site and its online demos (issue 337, 400, 404)
+ * Performance improvement for location tracking (issue 417, 424)
+ * Support HTML comment syntax (issue 451)
+ * Drop support for legacy browsers (issue 474)
+
+2013-08-27: Version 1.0.4
+
+ * Minimize the payload for packages (issue 362)
+ * Fix missing cases on an empty switch statement (issue 436)
+ * Support escaped ] in regexp literal character classes (issue 442)
+ * Tolerate invalid left-hand side expression (issue 130)
+
+2013-05-17: Version 1.0.3
+
+ * Variable declaration needs at least one declarator (issue 391)
+ * Fix benchmark's variance unit conversion (issue 397)
+ * IE < 9: \v should be treated as vertical tab (issue 405)
+ * Unary expressions should always have prefix: true (issue 418)
+ * Catch clause should only accept an identifier (issue 423)
+ * Tolerate setters without parameter (issue 426)
+
+2012-11-02: Version 1.0.2
+
+ Improvement:
+
+ * Fix esvalidate JUnit output upon a syntax error (issue 374)
+
+2012-10-28: Version 1.0.1
+
+ Improvements:
+
+ * esvalidate understands shebang in a Unix shell script (issue 361)
+ * esvalidate treats fatal parsing failure as an error (issue 361)
+ * Reduce Node.js package via .npmignore (issue 362)
+
+2012-10-22: Version 1.0.0
+
+ Initial release.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/LICENSE.BSD b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/LICENSE.BSD
new file mode 100644
index 00000000..17557ece
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/LICENSE.BSD
@@ -0,0 +1,21 @@
+Copyright (c) jQuery Foundation, Inc. and Contributors, 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.
+
+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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/README.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/README.md
new file mode 100644
index 00000000..e178217a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/README.md
@@ -0,0 +1,22 @@
+**Esprima** ([esprima.org](http://esprima.org), BSD license) is a high performance,
+standard-compliant [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
+parser written in ECMAScript (also popularly known as
+[JavaScript](https://en.wikipedia.org/wiki/JavaScript)).
+Esprima is created and maintained by [Ariya Hidayat](https://twitter.com/ariyahidayat),
+with the help of [many contributors](https://github.com/jquery/esprima/contributors).
+
+### Features
+
+- Full support for ECMAScript 6 ([ECMA-262](http://www.ecma-international.org/publications/standards/Ecma-262.htm))
+- Sensible [syntax tree format](https://github.com/estree/estree/blob/master/spec.md) as standardized by [EStree project](https://github.com/estree/estree)
+- Optional tracking of syntax node location (index-based and line-column)
+- Heavily tested (~1200 [unit tests](https://github.com/jquery/esprima/tree/master/test/fixtures) with [full code coverage](https://travis-ci.org/jquery/esprima))
+
+Esprima serves as a **building block** for some JavaScript
+language tools, from [code instrumentation](http://esprima.org/demo/functiontrace.html)
+to [editor autocompletion](http://esprima.org/demo/autocomplete.html).
+
+Esprima runs on many popular web browsers, as well as other ECMAScript platforms such as
+[Rhino](http://www.mozilla.org/rhino), [Nashorn](http://openjdk.java.net/projects/nashorn/), and [Node.js](https://npmjs.org/package/esprima).
+
+For more information, check the web site [esprima.org](http://esprima.org).
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esparse.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esparse.js
new file mode 100644
index 00000000..98bdbf48
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esparse.js
@@ -0,0 +1,126 @@
+#!/usr/bin/env node
+/*
+ Copyright (c) jQuery Foundation, Inc. and Contributors, 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.
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true node:true rhino:true */
+
+var fs, esprima, fname, content, options, syntax;
+
+if (typeof require === 'function') {
+ fs = require('fs');
+ esprima = require('esprima');
+} else if (typeof load === 'function') {
+ try {
+ load('esprima.js');
+ } catch (e) {
+ load('../esprima.js');
+ }
+}
+
+// Shims to Node.js objects when running under Rhino.
+if (typeof console === 'undefined' && typeof process === 'undefined') {
+ console = { log: print };
+ fs = { readFileSync: readFile };
+ process = { argv: arguments, exit: quit };
+ process.argv.unshift('esparse.js');
+ process.argv.unshift('rhino');
+}
+
+function showUsage() {
+ console.log('Usage:');
+ console.log(' esparse [options] file.js');
+ console.log();
+ console.log('Available options:');
+ console.log();
+ console.log(' --comment Gather all line and block comments in an array');
+ console.log(' --loc Include line-column location info for each syntax node');
+ console.log(' --range Include index-based range for each syntax node');
+ console.log(' --raw Display the raw value of literals');
+ console.log(' --tokens List all tokens in an array');
+ console.log(' --tolerant Tolerate errors on a best-effort basis (experimental)');
+ console.log(' -v, --version Shows program version');
+ console.log();
+ process.exit(1);
+}
+
+if (process.argv.length <= 2) {
+ showUsage();
+}
+
+options = {};
+
+process.argv.splice(2).forEach(function (entry) {
+
+ if (entry === '-h' || entry === '--help') {
+ showUsage();
+ } else if (entry === '-v' || entry === '--version') {
+ console.log('ECMAScript Parser (using Esprima version', esprima.version, ')');
+ console.log();
+ process.exit(0);
+ } else if (entry === '--comment') {
+ options.comment = true;
+ } else if (entry === '--loc') {
+ options.loc = true;
+ } else if (entry === '--range') {
+ options.range = true;
+ } else if (entry === '--raw') {
+ options.raw = true;
+ } else if (entry === '--tokens') {
+ options.tokens = true;
+ } else if (entry === '--tolerant') {
+ options.tolerant = true;
+ } else if (entry.slice(0, 2) === '--') {
+ console.log('Error: unknown option ' + entry + '.');
+ process.exit(1);
+ } else if (typeof fname === 'string') {
+ console.log('Error: more than one input file.');
+ process.exit(1);
+ } else {
+ fname = entry;
+ }
+});
+
+if (typeof fname !== 'string') {
+ console.log('Error: no input file.');
+ process.exit(1);
+}
+
+// Special handling for regular expression literal since we need to
+// convert it to a string literal, otherwise it will be decoded
+// as object "{}" and the regular expression would be lost.
+function adjustRegexLiteral(key, value) {
+ if (key === 'value' && value instanceof RegExp) {
+ value = value.toString();
+ }
+ return value;
+}
+
+try {
+ content = fs.readFileSync(fname, 'utf-8');
+ syntax = esprima.parse(content, options);
+ console.log(JSON.stringify(syntax, adjustRegexLiteral, 4));
+} catch (e) {
+ console.log('Error: ' + e.message);
+ process.exit(1);
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esvalidate.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esvalidate.js
new file mode 100644
index 00000000..f522dec2
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/bin/esvalidate.js
@@ -0,0 +1,199 @@
+#!/usr/bin/env node
+/*
+ Copyright (c) jQuery Foundation, Inc. and Contributors, 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.
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+/*jslint sloppy:true plusplus:true node:true rhino:true */
+/*global phantom:true */
+
+var fs, system, esprima, options, fnames, count;
+
+if (typeof esprima === 'undefined') {
+ // PhantomJS can only require() relative files
+ if (typeof phantom === 'object') {
+ fs = require('fs');
+ system = require('system');
+ esprima = require('./esprima');
+ } else if (typeof require === 'function') {
+ fs = require('fs');
+ esprima = require('esprima');
+ } else if (typeof load === 'function') {
+ try {
+ load('esprima.js');
+ } catch (e) {
+ load('../esprima.js');
+ }
+ }
+}
+
+// Shims to Node.js objects when running under PhantomJS 1.7+.
+if (typeof phantom === 'object') {
+ fs.readFileSync = fs.read;
+ process = {
+ argv: [].slice.call(system.args),
+ exit: phantom.exit
+ };
+ process.argv.unshift('phantomjs');
+}
+
+// Shims to Node.js objects when running under Rhino.
+if (typeof console === 'undefined' && typeof process === 'undefined') {
+ console = { log: print };
+ fs = { readFileSync: readFile };
+ process = { argv: arguments, exit: quit };
+ process.argv.unshift('esvalidate.js');
+ process.argv.unshift('rhino');
+}
+
+function showUsage() {
+ console.log('Usage:');
+ console.log(' esvalidate [options] file.js');
+ console.log();
+ console.log('Available options:');
+ console.log();
+ console.log(' --format=type Set the report format, plain (default) or junit');
+ console.log(' -v, --version Print program version');
+ console.log();
+ process.exit(1);
+}
+
+if (process.argv.length <= 2) {
+ showUsage();
+}
+
+options = {
+ format: 'plain'
+};
+
+fnames = [];
+
+process.argv.splice(2).forEach(function (entry) {
+
+ if (entry === '-h' || entry === '--help') {
+ showUsage();
+ } else if (entry === '-v' || entry === '--version') {
+ console.log('ECMAScript Validator (using Esprima version', esprima.version, ')');
+ console.log();
+ process.exit(0);
+ } else if (entry.slice(0, 9) === '--format=') {
+ options.format = entry.slice(9);
+ if (options.format !== 'plain' && options.format !== 'junit') {
+ console.log('Error: unknown report format ' + options.format + '.');
+ process.exit(1);
+ }
+ } else if (entry.slice(0, 2) === '--') {
+ console.log('Error: unknown option ' + entry + '.');
+ process.exit(1);
+ } else {
+ fnames.push(entry);
+ }
+});
+
+if (fnames.length === 0) {
+ console.log('Error: no input file.');
+ process.exit(1);
+}
+
+if (options.format === 'junit') {
+ console.log('<?xml version="1.0" encoding="UTF-8"?>');
+ console.log('<testsuites>');
+}
+
+count = 0;
+fnames.forEach(function (fname) {
+ var content, timestamp, syntax, name;
+ try {
+ content = fs.readFileSync(fname, 'utf-8');
+
+ if (content[0] === '#' && content[1] === '!') {
+ content = '//' + content.substr(2, content.length);
+ }
+
+ timestamp = Date.now();
+ syntax = esprima.parse(content, { tolerant: true });
+
+ if (options.format === 'junit') {
+
+ name = fname;
+ if (name.lastIndexOf('/') >= 0) {
+ name = name.slice(name.lastIndexOf('/') + 1);
+ }
+
+ console.log('<testsuite name="' + fname + '" errors="0" ' +
+ ' failures="' + syntax.errors.length + '" ' +
+ ' tests="' + syntax.errors.length + '" ' +
+ ' time="' + Math.round((Date.now() - timestamp) / 1000) +
+ '">');
+
+ syntax.errors.forEach(function (error) {
+ var msg = error.message;
+ msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
+ console.log(' <testcase name="Line ' + error.lineNumber + ': ' + msg + '" ' +
+ ' time="0">');
+ console.log(' <error type="SyntaxError" message="' + error.message + '">' +
+ error.message + '(' + name + ':' + error.lineNumber + ')' +
+ '</error>');
+ console.log(' </testcase>');
+ });
+
+ console.log('</testsuite>');
+
+ } else if (options.format === 'plain') {
+
+ syntax.errors.forEach(function (error) {
+ var msg = error.message;
+ msg = msg.replace(/^Line\ [0-9]*\:\ /, '');
+ msg = fname + ':' + error.lineNumber + ': ' + msg;
+ console.log(msg);
+ ++count;
+ });
+
+ }
+ } catch (e) {
+ ++count;
+ if (options.format === 'junit') {
+ console.log('<testsuite name="' + fname + '" errors="1" failures="0" tests="1" ' +
+ ' time="' + Math.round((Date.now() - timestamp) / 1000) + '">');
+ console.log(' <testcase name="' + e.message + '" ' + ' time="0">');
+ console.log(' <error type="ParseError" message="' + e.message + '">' +
+ e.message + '(' + fname + ((e.lineNumber) ? ':' + e.lineNumber : '') +
+ ')</error>');
+ console.log(' </testcase>');
+ console.log('</testsuite>');
+ } else {
+ console.log('Error: ' + e.message);
+ }
+ }
+});
+
+if (options.format === 'junit') {
+ console.log('</testsuites>');
+}
+
+if (count > 0) {
+ process.exit(1);
+}
+
+if (count === 0 && typeof phantom === 'object') {
+ process.exit(0);
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/esprima.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/esprima.js
new file mode 100644
index 00000000..2348b755
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/esprima.js
@@ -0,0 +1,5637 @@
+/*
+ Copyright (c) jQuery Foundation, Inc. and Contributors, 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.
+
+ 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 <COPYRIGHT HOLDER> BE LIABLE FOR ANY
+ DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
+ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
+(function (root, factory) {
+ 'use strict';
+
+ // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js,
+ // Rhino, and plain browser loading.
+
+ /* istanbul ignore next */
+ if (typeof define === 'function' && define.amd) {
+ define(['exports'], factory);
+ } else if (typeof exports !== 'undefined') {
+ factory(exports);
+ } else {
+ factory((root.esprima = {}));
+ }
+}(this, function (exports) {
+ 'use strict';
+
+ var Token,
+ TokenName,
+ FnExprTokens,
+ Syntax,
+ PlaceHolders,
+ Messages,
+ Regex,
+ source,
+ strict,
+ sourceType,
+ index,
+ lineNumber,
+ lineStart,
+ hasLineTerminator,
+ lastIndex,
+ lastLineNumber,
+ lastLineStart,
+ startIndex,
+ startLineNumber,
+ startLineStart,
+ scanning,
+ length,
+ lookahead,
+ state,
+ extra,
+ isBindingElement,
+ isAssignmentTarget,
+ firstCoverInitializedNameError;
+
+ Token = {
+ BooleanLiteral: 1,
+ EOF: 2,
+ Identifier: 3,
+ Keyword: 4,
+ NullLiteral: 5,
+ NumericLiteral: 6,
+ Punctuator: 7,
+ StringLiteral: 8,
+ RegularExpression: 9,
+ Template: 10
+ };
+
+ TokenName = {};
+ TokenName[Token.BooleanLiteral] = 'Boolean';
+ TokenName[Token.EOF] = '<end>';
+ TokenName[Token.Identifier] = 'Identifier';
+ TokenName[Token.Keyword] = 'Keyword';
+ TokenName[Token.NullLiteral] = 'Null';
+ TokenName[Token.NumericLiteral] = 'Numeric';
+ TokenName[Token.Punctuator] = 'Punctuator';
+ TokenName[Token.StringLiteral] = 'String';
+ TokenName[Token.RegularExpression] = 'RegularExpression';
+ TokenName[Token.Template] = 'Template';
+
+ // A function following one of those tokens is an expression.
+ FnExprTokens = ['(', '{', '[', 'in', 'typeof', 'instanceof', 'new',
+ 'return', 'case', 'delete', 'throw', 'void',
+ // assignment operators
+ '=', '+=', '-=', '*=', '/=', '%=', '<<=', '>>=', '>>>=',
+ '&=', '|=', '^=', ',',
+ // binary/unary operators
+ '+', '-', '*', '/', '%', '++', '--', '<<', '>>', '>>>', '&',
+ '|', '^', '!', '~', '&&', '||', '?', ':', '===', '==', '>=',
+ '<=', '<', '>', '!=', '!=='];
+
+ Syntax = {
+ AssignmentExpression: 'AssignmentExpression',
+ AssignmentPattern: 'AssignmentPattern',
+ ArrayExpression: 'ArrayExpression',
+ ArrayPattern: 'ArrayPattern',
+ ArrowFunctionExpression: 'ArrowFunctionExpression',
+ BlockStatement: 'BlockStatement',
+ BinaryExpression: 'BinaryExpression',
+ BreakStatement: 'BreakStatement',
+ CallExpression: 'CallExpression',
+ CatchClause: 'CatchClause',
+ ClassBody: 'ClassBody',
+ ClassDeclaration: 'ClassDeclaration',
+ ClassExpression: 'ClassExpression',
+ ConditionalExpression: 'ConditionalExpression',
+ ContinueStatement: 'ContinueStatement',
+ DoWhileStatement: 'DoWhileStatement',
+ DebuggerStatement: 'DebuggerStatement',
+ EmptyStatement: 'EmptyStatement',
+ ExportAllDeclaration: 'ExportAllDeclaration',
+ ExportDefaultDeclaration: 'ExportDefaultDeclaration',
+ ExportNamedDeclaration: 'ExportNamedDeclaration',
+ ExportSpecifier: 'ExportSpecifier',
+ ExpressionStatement: 'ExpressionStatement',
+ ForStatement: 'ForStatement',
+ ForOfStatement: 'ForOfStatement',
+ ForInStatement: 'ForInStatement',
+ FunctionDeclaration: 'FunctionDeclaration',
+ FunctionExpression: 'FunctionExpression',
+ Identifier: 'Identifier',
+ IfStatement: 'IfStatement',
+ ImportDeclaration: 'ImportDeclaration',
+ ImportDefaultSpecifier: 'ImportDefaultSpecifier',
+ ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
+ ImportSpecifier: 'ImportSpecifier',
+ Literal: 'Literal',
+ LabeledStatement: 'LabeledStatement',
+ LogicalExpression: 'LogicalExpression',
+ MemberExpression: 'MemberExpression',
+ MetaProperty: 'MetaProperty',
+ MethodDefinition: 'MethodDefinition',
+ NewExpression: 'NewExpression',
+ ObjectExpression: 'ObjectExpression',
+ ObjectPattern: 'ObjectPattern',
+ Program: 'Program',
+ Property: 'Property',
+ RestElement: 'RestElement',
+ ReturnStatement: 'ReturnStatement',
+ SequenceExpression: 'SequenceExpression',
+ SpreadElement: 'SpreadElement',
+ Super: 'Super',
+ SwitchCase: 'SwitchCase',
+ SwitchStatement: 'SwitchStatement',
+ TaggedTemplateExpression: 'TaggedTemplateExpression',
+ TemplateElement: 'TemplateElement',
+ TemplateLiteral: 'TemplateLiteral',
+ ThisExpression: 'ThisExpression',
+ ThrowStatement: 'ThrowStatement',
+ TryStatement: 'TryStatement',
+ UnaryExpression: 'UnaryExpression',
+ UpdateExpression: 'UpdateExpression',
+ VariableDeclaration: 'VariableDeclaration',
+ VariableDeclarator: 'VariableDeclarator',
+ WhileStatement: 'WhileStatement',
+ WithStatement: 'WithStatement',
+ YieldExpression: 'YieldExpression'
+ };
+
+ PlaceHolders = {
+ ArrowParameterPlaceHolder: 'ArrowParameterPlaceHolder'
+ };
+
+ // Error messages should be identical to V8.
+ Messages = {
+ UnexpectedToken: 'Unexpected token %0',
+ UnexpectedNumber: 'Unexpected number',
+ UnexpectedString: 'Unexpected string',
+ UnexpectedIdentifier: 'Unexpected identifier',
+ UnexpectedReserved: 'Unexpected reserved word',
+ UnexpectedTemplate: 'Unexpected quasi %0',
+ UnexpectedEOS: 'Unexpected end of input',
+ NewlineAfterThrow: 'Illegal newline after throw',
+ InvalidRegExp: 'Invalid regular expression',
+ UnterminatedRegExp: 'Invalid regular expression: missing /',
+ InvalidLHSInAssignment: 'Invalid left-hand side in assignment',
+ InvalidLHSInForIn: 'Invalid left-hand side in for-in',
+ InvalidLHSInForLoop: 'Invalid left-hand side in for-loop',
+ MultipleDefaultsInSwitch: 'More than one default clause in switch statement',
+ NoCatchOrFinally: 'Missing catch or finally after try',
+ UnknownLabel: 'Undefined label \'%0\'',
+ Redeclaration: '%0 \'%1\' has already been declared',
+ IllegalContinue: 'Illegal continue statement',
+ IllegalBreak: 'Illegal break statement',
+ IllegalReturn: 'Illegal return statement',
+ StrictModeWith: 'Strict mode code may not include a with statement',
+ StrictCatchVariable: 'Catch variable may not be eval or arguments in strict mode',
+ StrictVarName: 'Variable name may not be eval or arguments in strict mode',
+ StrictParamName: 'Parameter name eval or arguments is not allowed in strict mode',
+ StrictParamDupe: 'Strict mode function may not have duplicate parameter names',
+ StrictFunctionName: 'Function name may not be eval or arguments in strict mode',
+ StrictOctalLiteral: 'Octal literals are not allowed in strict mode.',
+ StrictDelete: 'Delete of an unqualified identifier in strict mode.',
+ StrictLHSAssignment: 'Assignment to eval or arguments is not allowed in strict mode',
+ StrictLHSPostfix: 'Postfix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictLHSPrefix: 'Prefix increment/decrement may not have eval or arguments operand in strict mode',
+ StrictReservedWord: 'Use of future reserved word in strict mode',
+ TemplateOctalLiteral: 'Octal literals are not allowed in template strings.',
+ ParameterAfterRestParameter: 'Rest parameter must be last formal parameter',
+ DefaultRestParameter: 'Unexpected token =',
+ ObjectPatternAsRestParameter: 'Unexpected token {',
+ DuplicateProtoProperty: 'Duplicate __proto__ fields are not allowed in object literals',
+ ConstructorSpecialMethod: 'Class constructor may not be an accessor',
+ DuplicateConstructor: 'A class may only have one constructor',
+ StaticPrototype: 'Classes may not have static property named prototype',
+ MissingFromClause: 'Unexpected token',
+ NoAsAfterImportNamespace: 'Unexpected token',
+ InvalidModuleSpecifier: 'Unexpected token',
+ IllegalImportDeclaration: 'Unexpected token',
+ IllegalExportDeclaration: 'Unexpected token',
+ DuplicateBinding: 'Duplicate binding %0'
+ };
+
+ // See also tools/generate-unicode-regex.js.
+ Regex = {
+ // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierStart:
+ NonAsciiIdentifierStart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0-\u08B2\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDE00-\uDE11\uDE13-\uDE2B\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF5D-\uDF61]|\uD805[\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDE00-\uDE2F\uDE44\uDE80-\uDEAA]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]/,
+
+ // ECMAScript 6/Unicode v7.0.0 NonAsciiIdentifierPart:
+ NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B2\u08E4-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58\u0C59\u0C60-\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D57\u0D60-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F4\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFC-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA69D\uA69F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA78E\uA790-\uA7AD\uA7B0\uA7B1\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C4\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB5F\uAB64\uAB65\uABC0-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2D\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDDFD\uDE80-\uDE9C\uDEA0-\uDED0\uDEE0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF7A\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00-\uDE03\uDE05\uDE06\uDE0C-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE38-\uDE3A\uDE3F\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE6\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48]|\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDD0-\uDDDA\uDE00-\uDE11\uDE13-\uDE37\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF01-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD808[\uDC00-\uDF98]|\uD809[\uDC00-\uDC6E]|[\uD80C\uD840-\uD868\uD86A-\uD86C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD8B\uDDAA-\uDDAD\uDE42-\uDE44]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD83A[\uDC00-\uDCC4\uDCD0-\uDCD6]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/
+ };
+
+ // Ensure the condition is true, otherwise throw an error.
+ // This is only to have a better contract semantic, i.e. another safety net
+ // to catch a logic error. The condition shall be fulfilled in normal case.
+ // Do NOT use this to enforce a certain condition on any user input.
+
+ function assert(condition, message) {
+ /* istanbul ignore if */
+ if (!condition) {
+ throw new Error('ASSERT: ' + message);
+ }
+ }
+
+ function isDecimalDigit(ch) {
+ return (ch >= 0x30 && ch <= 0x39); // 0..9
+ }
+
+ function isHexDigit(ch) {
+ return '0123456789abcdefABCDEF'.indexOf(ch) >= 0;
+ }
+
+ function isOctalDigit(ch) {
+ return '01234567'.indexOf(ch) >= 0;
+ }
+
+ function octalToDecimal(ch) {
+ // \0 is not octal escape sequence
+ var octal = (ch !== '0'), code = '01234567'.indexOf(ch);
+
+ if (index < length && isOctalDigit(source[index])) {
+ octal = true;
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+
+ // 3 digits are only allowed when string starts
+ // with 0, 1, 2, 3
+ if ('0123'.indexOf(ch) >= 0 &&
+ index < length &&
+ isOctalDigit(source[index])) {
+ code = code * 8 + '01234567'.indexOf(source[index++]);
+ }
+ }
+
+ return {
+ code: code,
+ octal: octal
+ };
+ }
+
+ // ECMA-262 11.2 White Space
+
+ function isWhiteSpace(ch) {
+ return (ch === 0x20) || (ch === 0x09) || (ch === 0x0B) || (ch === 0x0C) || (ch === 0xA0) ||
+ (ch >= 0x1680 && [0x1680, 0x180E, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A, 0x202F, 0x205F, 0x3000, 0xFEFF].indexOf(ch) >= 0);
+ }
+
+ // ECMA-262 11.3 Line Terminators
+
+ function isLineTerminator(ch) {
+ return (ch === 0x0A) || (ch === 0x0D) || (ch === 0x2028) || (ch === 0x2029);
+ }
+
+ // ECMA-262 11.6 Identifier Names and Identifiers
+
+ function fromCodePoint(cp) {
+ return (cp < 0x10000) ? String.fromCharCode(cp) :
+ String.fromCharCode(0xD800 + ((cp - 0x10000) >> 10)) +
+ String.fromCharCode(0xDC00 + ((cp - 0x10000) & 1023));
+ }
+
+ function isIdentifierStart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch)));
+ }
+
+ function isIdentifierPart(ch) {
+ return (ch === 0x24) || (ch === 0x5F) || // $ (dollar) and _ (underscore)
+ (ch >= 0x41 && ch <= 0x5A) || // A..Z
+ (ch >= 0x61 && ch <= 0x7A) || // a..z
+ (ch >= 0x30 && ch <= 0x39) || // 0..9
+ (ch === 0x5C) || // \ (backslash)
+ ((ch >= 0x80) && Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch)));
+ }
+
+ // ECMA-262 11.6.2.2 Future Reserved Words
+
+ function isFutureReservedWord(id) {
+ switch (id) {
+ case 'enum':
+ case 'export':
+ case 'import':
+ case 'super':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isStrictModeReservedWord(id) {
+ switch (id) {
+ case 'implements':
+ case 'interface':
+ case 'package':
+ case 'private':
+ case 'protected':
+ case 'public':
+ case 'static':
+ case 'yield':
+ case 'let':
+ return true;
+ default:
+ return false;
+ }
+ }
+
+ function isRestrictedWord(id) {
+ return id === 'eval' || id === 'arguments';
+ }
+
+ // ECMA-262 11.6.2.1 Keywords
+
+ function isKeyword(id) {
+
+ // 'const' is specialized as Keyword in V8.
+ // 'yield' and 'let' are for compatibility with SpiderMonkey and ES.next.
+ // Some others are from future reserved words.
+
+ switch (id.length) {
+ case 2:
+ return (id === 'if') || (id === 'in') || (id === 'do');
+ case 3:
+ return (id === 'var') || (id === 'for') || (id === 'new') ||
+ (id === 'try') || (id === 'let');
+ case 4:
+ return (id === 'this') || (id === 'else') || (id === 'case') ||
+ (id === 'void') || (id === 'with') || (id === 'enum');
+ case 5:
+ return (id === 'while') || (id === 'break') || (id === 'catch') ||
+ (id === 'throw') || (id === 'const') || (id === 'yield') ||
+ (id === 'class') || (id === 'super');
+ case 6:
+ return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
+ (id === 'switch') || (id === 'export') || (id === 'import');
+ case 7:
+ return (id === 'default') || (id === 'finally') || (id === 'extends');
+ case 8:
+ return (id === 'function') || (id === 'continue') || (id === 'debugger');
+ case 10:
+ return (id === 'instanceof');
+ default:
+ return false;
+ }
+ }
+
+ // ECMA-262 11.4 Comments
+
+ function addComment(type, value, start, end, loc) {
+ var comment;
+
+ assert(typeof start === 'number', 'Comment must have valid position');
+
+ state.lastCommentStart = start;
+
+ comment = {
+ type: type,
+ value: value
+ };
+ if (extra.range) {
+ comment.range = [start, end];
+ }
+ if (extra.loc) {
+ comment.loc = loc;
+ }
+ extra.comments.push(comment);
+ if (extra.attachComment) {
+ extra.leadingComments.push(comment);
+ extra.trailingComments.push(comment);
+ }
+ }
+
+ function skipSingleLineComment(offset) {
+ var start, loc, ch, comment;
+
+ start = index - offset;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - offset
+ }
+ };
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ ++index;
+ if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ if (extra.comments) {
+ comment = source.slice(start + offset, index - 1);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart - 1
+ };
+ addComment('Line', comment, start, index - 1, loc);
+ }
+ if (ch === 13 && source.charCodeAt(index) === 10) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ return;
+ }
+ }
+
+ if (extra.comments) {
+ comment = source.slice(start + offset, index);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Line', comment, start, index, loc);
+ }
+ }
+
+ function skipMultiLineComment() {
+ var start, loc, ch, comment;
+
+ if (extra.comments) {
+ start = index - 2;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart - 2
+ }
+ };
+ }
+
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (isLineTerminator(ch)) {
+ if (ch === 0x0D && source.charCodeAt(index + 1) === 0x0A) {
+ ++index;
+ }
+ hasLineTerminator = true;
+ ++lineNumber;
+ ++index;
+ lineStart = index;
+ } else if (ch === 0x2A) {
+ // Block comment ends with '*/'.
+ if (source.charCodeAt(index + 1) === 0x2F) {
+ ++index;
+ ++index;
+ if (extra.comments) {
+ comment = source.slice(start + 2, index - 2);
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ addComment('Block', comment, start, index, loc);
+ }
+ return;
+ }
+ ++index;
+ } else {
+ ++index;
+ }
+ }
+
+ // Ran off the end of the file - the whole thing is a comment
+ if (extra.comments) {
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+ comment = source.slice(start + 2, index);
+ addComment('Block', comment, start, index, loc);
+ }
+ tolerateUnexpectedToken();
+ }
+
+ function skipComment() {
+ var ch, start;
+ hasLineTerminator = false;
+
+ start = (index === 0);
+ while (index < length) {
+ ch = source.charCodeAt(index);
+
+ if (isWhiteSpace(ch)) {
+ ++index;
+ } else if (isLineTerminator(ch)) {
+ hasLineTerminator = true;
+ ++index;
+ if (ch === 0x0D && source.charCodeAt(index) === 0x0A) {
+ ++index;
+ }
+ ++lineNumber;
+ lineStart = index;
+ start = true;
+ } else if (ch === 0x2F) { // U+002F is '/'
+ ch = source.charCodeAt(index + 1);
+ if (ch === 0x2F) {
+ ++index;
+ ++index;
+ skipSingleLineComment(2);
+ start = true;
+ } else if (ch === 0x2A) { // U+002A is '*'
+ ++index;
+ ++index;
+ skipMultiLineComment();
+ } else {
+ break;
+ }
+ } else if (start && ch === 0x2D) { // U+002D is '-'
+ // U+003E is '>'
+ if ((source.charCodeAt(index + 1) === 0x2D) && (source.charCodeAt(index + 2) === 0x3E)) {
+ // '-->' is a single-line comment
+ index += 3;
+ skipSingleLineComment(3);
+ } else {
+ break;
+ }
+ } else if (ch === 0x3C) { // U+003C is '<'
+ if (source.slice(index + 1, index + 4) === '!--') {
+ ++index; // `<`
+ ++index; // `!`
+ ++index; // `-`
+ ++index; // `-`
+ skipSingleLineComment(4);
+ } else {
+ break;
+ }
+ } else {
+ break;
+ }
+ }
+ }
+
+ function scanHexEscape(prefix) {
+ var i, len, ch, code = 0;
+
+ len = (prefix === 'u') ? 4 : 2;
+ for (i = 0; i < len; ++i) {
+ if (index < length && isHexDigit(source[index])) {
+ ch = source[index++];
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ } else {
+ return '';
+ }
+ }
+ return String.fromCharCode(code);
+ }
+
+ function scanUnicodeCodePointEscape() {
+ var ch, code;
+
+ ch = source[index];
+ code = 0;
+
+ // At least, one hex digit is required.
+ if (ch === '}') {
+ throwUnexpectedToken();
+ }
+
+ while (index < length) {
+ ch = source[index++];
+ if (!isHexDigit(ch)) {
+ break;
+ }
+ code = code * 16 + '0123456789abcdef'.indexOf(ch.toLowerCase());
+ }
+
+ if (code > 0x10FFFF || ch !== '}') {
+ throwUnexpectedToken();
+ }
+
+ return fromCodePoint(code);
+ }
+
+ function codePointAt(i) {
+ var cp, first, second;
+
+ cp = source.charCodeAt(i);
+ if (cp >= 0xD800 && cp <= 0xDBFF) {
+ second = source.charCodeAt(i + 1);
+ if (second >= 0xDC00 && second <= 0xDFFF) {
+ first = cp;
+ cp = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000;
+ }
+ }
+
+ return cp;
+ }
+
+ function getComplexIdentifier() {
+ var cp, ch, id;
+
+ cp = codePointAt(index);
+ id = fromCodePoint(cp);
+ index += id.length;
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (cp === 0x5C) {
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ if (source[index] === '{') {
+ ++index;
+ ch = scanUnicodeCodePointEscape();
+ } else {
+ ch = scanHexEscape('u');
+ cp = ch.charCodeAt(0);
+ if (!ch || ch === '\\' || !isIdentifierStart(cp)) {
+ throwUnexpectedToken();
+ }
+ }
+ id = ch;
+ }
+
+ while (index < length) {
+ cp = codePointAt(index);
+ if (!isIdentifierPart(cp)) {
+ break;
+ }
+ ch = fromCodePoint(cp);
+ id += ch;
+ index += ch.length;
+
+ // '\u' (U+005C, U+0075) denotes an escaped character.
+ if (cp === 0x5C) {
+ id = id.substr(0, id.length - 1);
+ if (source.charCodeAt(index) !== 0x75) {
+ throwUnexpectedToken();
+ }
+ ++index;
+ if (source[index] === '{') {
+ ++index;
+ ch = scanUnicodeCodePointEscape();
+ } else {
+ ch = scanHexEscape('u');
+ cp = ch.charCodeAt(0);
+ if (!ch || ch === '\\' || !isIdentifierPart(cp)) {
+ throwUnexpectedToken();
+ }
+ }
+ id += ch;
+ }
+ }
+
+ return id;
+ }
+
+ function getIdentifier() {
+ var start, ch;
+
+ start = index++;
+ while (index < length) {
+ ch = source.charCodeAt(index);
+ if (ch === 0x5C) {
+ // Blackslash (U+005C) marks Unicode escape sequence.
+ index = start;
+ return getComplexIdentifier();
+ } else if (ch >= 0xD800 && ch < 0xDFFF) {
+ // Need to handle surrogate pairs.
+ index = start;
+ return getComplexIdentifier();
+ }
+ if (isIdentifierPart(ch)) {
+ ++index;
+ } else {
+ break;
+ }
+ }
+
+ return source.slice(start, index);
+ }
+
+ function scanIdentifier() {
+ var start, id, type;
+
+ start = index;
+
+ // Backslash (U+005C) starts an escaped character.
+ id = (source.charCodeAt(index) === 0x5C) ? getComplexIdentifier() : getIdentifier();
+
+ // There is no keyword or literal with only one character.
+ // Thus, it must be an identifier.
+ if (id.length === 1) {
+ type = Token.Identifier;
+ } else if (isKeyword(id)) {
+ type = Token.Keyword;
+ } else if (id === 'null') {
+ type = Token.NullLiteral;
+ } else if (id === 'true' || id === 'false') {
+ type = Token.BooleanLiteral;
+ } else {
+ type = Token.Identifier;
+ }
+
+ return {
+ type: type,
+ value: id,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+
+ // ECMA-262 11.7 Punctuators
+
+ function scanPunctuator() {
+ var token, str;
+
+ token = {
+ type: Token.Punctuator,
+ value: '',
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+
+ // Check for most common single-character punctuators.
+ str = source[index];
+ switch (str) {
+
+ case '(':
+ if (extra.tokenize) {
+ extra.openParenToken = extra.tokens.length;
+ }
+ ++index;
+ break;
+
+ case '{':
+ if (extra.tokenize) {
+ extra.openCurlyToken = extra.tokens.length;
+ }
+ state.curlyStack.push('{');
+ ++index;
+ break;
+
+ case '.':
+ ++index;
+ if (source[index] === '.' && source[index + 1] === '.') {
+ // Spread operator: ...
+ index += 2;
+ str = '...';
+ }
+ break;
+
+ case '}':
+ ++index;
+ state.curlyStack.pop();
+ break;
+ case ')':
+ case ';':
+ case ',':
+ case '[':
+ case ']':
+ case ':':
+ case '?':
+ case '~':
+ ++index;
+ break;
+
+ default:
+ // 4-character punctuator.
+ str = source.substr(index, 4);
+ if (str === '>>>=') {
+ index += 4;
+ } else {
+
+ // 3-character punctuators.
+ str = str.substr(0, 3);
+ if (str === '===' || str === '!==' || str === '>>>' ||
+ str === '<<=' || str === '>>=') {
+ index += 3;
+ } else {
+
+ // 2-character punctuators.
+ str = str.substr(0, 2);
+ if (str === '&&' || str === '||' || str === '==' || str === '!=' ||
+ str === '+=' || str === '-=' || str === '*=' || str === '/=' ||
+ str === '++' || str === '--' || str === '<<' || str === '>>' ||
+ str === '&=' || str === '|=' || str === '^=' || str === '%=' ||
+ str === '<=' || str === '>=' || str === '=>') {
+ index += 2;
+ } else {
+
+ // 1-character punctuators.
+ str = source[index];
+ if ('<>=!+-*%&|^/'.indexOf(str) >= 0) {
+ ++index;
+ }
+ }
+ }
+ }
+ }
+
+ if (index === token.start) {
+ throwUnexpectedToken();
+ }
+
+ token.end = index;
+ token.value = str;
+ return token;
+ }
+
+ // ECMA-262 11.8.3 Numeric Literals
+
+ function scanHexLiteral(start) {
+ var number = '';
+
+ while (index < length) {
+ if (!isHexDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt('0x' + number, 16),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanBinaryLiteral(start) {
+ var ch, number;
+
+ number = '';
+
+ while (index < length) {
+ ch = source[index];
+ if (ch !== '0' && ch !== '1') {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (number.length === 0) {
+ // only 0b or 0B
+ throwUnexpectedToken();
+ }
+
+ if (index < length) {
+ ch = source.charCodeAt(index);
+ /* istanbul ignore else */
+ if (isIdentifierStart(ch) || isDecimalDigit(ch)) {
+ throwUnexpectedToken();
+ }
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 2),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function scanOctalLiteral(prefix, start) {
+ var number, octal;
+
+ if (isOctalDigit(prefix)) {
+ octal = true;
+ number = '0' + source[index++];
+ } else {
+ octal = false;
+ ++index;
+ number = '';
+ }
+
+ while (index < length) {
+ if (!isOctalDigit(source[index])) {
+ break;
+ }
+ number += source[index++];
+ }
+
+ if (!octal && number.length === 0) {
+ // only 0o or 0O
+ throwUnexpectedToken();
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index)) || isDecimalDigit(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseInt(number, 8),
+ octal: octal,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ function isImplicitOctalLiteral() {
+ var i, ch;
+
+ // Implicit octal, unless there is a non-octal digit.
+ // (Annex B.1.1 on Numeric Literals)
+ for (i = index + 1; i < length; ++i) {
+ ch = source[i];
+ if (ch === '8' || ch === '9') {
+ return false;
+ }
+ if (!isOctalDigit(ch)) {
+ return true;
+ }
+ }
+
+ return true;
+ }
+
+ function scanNumericLiteral() {
+ var number, start, ch;
+
+ ch = source[index];
+ assert(isDecimalDigit(ch.charCodeAt(0)) || (ch === '.'),
+ 'Numeric literal must start with a decimal digit or a decimal point');
+
+ start = index;
+ number = '';
+ if (ch !== '.') {
+ number = source[index++];
+ ch = source[index];
+
+ // Hex number starts with '0x'.
+ // Octal number starts with '0'.
+ // Octal number in ES6 starts with '0o'.
+ // Binary number in ES6 starts with '0b'.
+ if (number === '0') {
+ if (ch === 'x' || ch === 'X') {
+ ++index;
+ return scanHexLiteral(start);
+ }
+ if (ch === 'b' || ch === 'B') {
+ ++index;
+ return scanBinaryLiteral(start);
+ }
+ if (ch === 'o' || ch === 'O') {
+ return scanOctalLiteral(ch, start);
+ }
+
+ if (isOctalDigit(ch)) {
+ if (isImplicitOctalLiteral()) {
+ return scanOctalLiteral(ch, start);
+ }
+ }
+ }
+
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === '.') {
+ number += source[index++];
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ ch = source[index];
+ }
+
+ if (ch === 'e' || ch === 'E') {
+ number += source[index++];
+
+ ch = source[index];
+ if (ch === '+' || ch === '-') {
+ number += source[index++];
+ }
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ while (isDecimalDigit(source.charCodeAt(index))) {
+ number += source[index++];
+ }
+ } else {
+ throwUnexpectedToken();
+ }
+ }
+
+ if (isIdentifierStart(source.charCodeAt(index))) {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.NumericLiteral,
+ value: parseFloat(number),
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.4 String Literals
+
+ function scanStringLiteral() {
+ var str = '', quote, start, ch, unescaped, octToDec, octal = false;
+
+ quote = source[index];
+ assert((quote === '\'' || quote === '"'),
+ 'String literal must starts with a quote');
+
+ start = index;
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+
+ if (ch === quote) {
+ quote = '';
+ break;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!ch || !isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ str += scanUnicodeCodePointEscape();
+ } else {
+ unescaped = scanHexEscape(ch);
+ if (!unescaped) {
+ throw throwUnexpectedToken();
+ }
+ str += unescaped;
+ }
+ break;
+ case 'n':
+ str += '\n';
+ break;
+ case 'r':
+ str += '\r';
+ break;
+ case 't':
+ str += '\t';
+ break;
+ case 'b':
+ str += '\b';
+ break;
+ case 'f':
+ str += '\f';
+ break;
+ case 'v':
+ str += '\x0B';
+ break;
+ case '8':
+ case '9':
+ str += ch;
+ tolerateUnexpectedToken();
+ break;
+
+ default:
+ if (isOctalDigit(ch)) {
+ octToDec = octalToDecimal(ch);
+
+ octal = octToDec.octal || octal;
+ str += String.fromCharCode(octToDec.code);
+ } else {
+ str += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ break;
+ } else {
+ str += ch;
+ }
+ }
+
+ if (quote !== '') {
+ throwUnexpectedToken();
+ }
+
+ return {
+ type: Token.StringLiteral,
+ value: str,
+ octal: octal,
+ lineNumber: startLineNumber,
+ lineStart: startLineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.6 Template Literal Lexical Components
+
+ function scanTemplate() {
+ var cooked = '', ch, start, rawOffset, terminated, head, tail, restore, unescaped;
+
+ terminated = false;
+ tail = false;
+ start = index;
+ head = (source[index] === '`');
+ rawOffset = 2;
+
+ ++index;
+
+ while (index < length) {
+ ch = source[index++];
+ if (ch === '`') {
+ rawOffset = 1;
+ tail = true;
+ terminated = true;
+ break;
+ } else if (ch === '$') {
+ if (source[index] === '{') {
+ state.curlyStack.push('${');
+ ++index;
+ terminated = true;
+ break;
+ }
+ cooked += ch;
+ } else if (ch === '\\') {
+ ch = source[index++];
+ if (!isLineTerminator(ch.charCodeAt(0))) {
+ switch (ch) {
+ case 'n':
+ cooked += '\n';
+ break;
+ case 'r':
+ cooked += '\r';
+ break;
+ case 't':
+ cooked += '\t';
+ break;
+ case 'u':
+ case 'x':
+ if (source[index] === '{') {
+ ++index;
+ cooked += scanUnicodeCodePointEscape();
+ } else {
+ restore = index;
+ unescaped = scanHexEscape(ch);
+ if (unescaped) {
+ cooked += unescaped;
+ } else {
+ index = restore;
+ cooked += ch;
+ }
+ }
+ break;
+ case 'b':
+ cooked += '\b';
+ break;
+ case 'f':
+ cooked += '\f';
+ break;
+ case 'v':
+ cooked += '\v';
+ break;
+
+ default:
+ if (ch === '0') {
+ if (isDecimalDigit(source.charCodeAt(index))) {
+ // Illegal: \01 \02 and so on
+ throwError(Messages.TemplateOctalLiteral);
+ }
+ cooked += '\0';
+ } else if (isOctalDigit(ch)) {
+ // Illegal: \1 \2
+ throwError(Messages.TemplateOctalLiteral);
+ } else {
+ cooked += ch;
+ }
+ break;
+ }
+ } else {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ }
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ ++lineNumber;
+ if (ch === '\r' && source[index] === '\n') {
+ ++index;
+ }
+ lineStart = index;
+ cooked += '\n';
+ } else {
+ cooked += ch;
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken();
+ }
+
+ if (!head) {
+ state.curlyStack.pop();
+ }
+
+ return {
+ type: Token.Template,
+ value: {
+ cooked: cooked,
+ raw: source.slice(start + 1, index - rawOffset)
+ },
+ head: head,
+ tail: tail,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ // ECMA-262 11.8.5 Regular Expression Literals
+
+ function testRegExp(pattern, flags) {
+ // The BMP character to use as a replacement for astral symbols when
+ // translating an ES6 "u"-flagged pattern to an ES5-compatible
+ // approximation.
+ // Note: replacing with '\uFFFF' enables false positives in unlikely
+ // scenarios. For example, `[\u{1044f}-\u{10440}]` is an invalid
+ // pattern that would not be detected by this substitution.
+ var astralSubstitute = '\uFFFF',
+ tmp = pattern;
+
+ if (flags.indexOf('u') >= 0) {
+ tmp = tmp
+ // Replace every Unicode escape sequence with the equivalent
+ // BMP character or a constant ASCII code point in the case of
+ // astral symbols. (See the above note on `astralSubstitute`
+ // for more information.)
+ .replace(/\\u\{([0-9a-fA-F]+)\}|\\u([a-fA-F0-9]{4})/g, function ($0, $1, $2) {
+ var codePoint = parseInt($1 || $2, 16);
+ if (codePoint > 0x10FFFF) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+ if (codePoint <= 0xFFFF) {
+ return String.fromCharCode(codePoint);
+ }
+ return astralSubstitute;
+ })
+ // Replace each paired surrogate with a single ASCII symbol to
+ // avoid throwing on regular expressions that are only valid in
+ // combination with the "u" flag.
+ .replace(
+ /[\uD800-\uDBFF][\uDC00-\uDFFF]/g,
+ astralSubstitute
+ );
+ }
+
+ // First, detect invalid regular expressions.
+ try {
+ RegExp(tmp);
+ } catch (e) {
+ throwUnexpectedToken(null, Messages.InvalidRegExp);
+ }
+
+ // Return a regular expression object for this pattern-flag pair, or
+ // `null` in case the current environment doesn't support the flags it
+ // uses.
+ try {
+ return new RegExp(pattern, flags);
+ } catch (exception) {
+ return null;
+ }
+ }
+
+ function scanRegExpBody() {
+ var ch, str, classMarker, terminated, body;
+
+ ch = source[index];
+ assert(ch === '/', 'Regular expression literal must start with a slash');
+ str = source[index++];
+
+ classMarker = false;
+ terminated = false;
+ while (index < length) {
+ ch = source[index++];
+ str += ch;
+ if (ch === '\\') {
+ ch = source[index++];
+ // ECMA-262 7.8.5
+ if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+ str += ch;
+ } else if (isLineTerminator(ch.charCodeAt(0))) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ } else if (classMarker) {
+ if (ch === ']') {
+ classMarker = false;
+ }
+ } else {
+ if (ch === '/') {
+ terminated = true;
+ break;
+ } else if (ch === '[') {
+ classMarker = true;
+ }
+ }
+ }
+
+ if (!terminated) {
+ throwUnexpectedToken(null, Messages.UnterminatedRegExp);
+ }
+
+ // Exclude leading and trailing slash.
+ body = str.substr(1, str.length - 2);
+ return {
+ value: body,
+ literal: str
+ };
+ }
+
+ function scanRegExpFlags() {
+ var ch, str, flags, restore;
+
+ str = '';
+ flags = '';
+ while (index < length) {
+ ch = source[index];
+ if (!isIdentifierPart(ch.charCodeAt(0))) {
+ break;
+ }
+
+ ++index;
+ if (ch === '\\' && index < length) {
+ ch = source[index];
+ if (ch === 'u') {
+ ++index;
+ restore = index;
+ ch = scanHexEscape('u');
+ if (ch) {
+ flags += ch;
+ for (str += '\\u'; restore < index; ++restore) {
+ str += source[restore];
+ }
+ } else {
+ index = restore;
+ flags += 'u';
+ str += '\\u';
+ }
+ tolerateUnexpectedToken();
+ } else {
+ str += '\\';
+ tolerateUnexpectedToken();
+ }
+ } else {
+ flags += ch;
+ str += ch;
+ }
+ }
+
+ return {
+ value: flags,
+ literal: str
+ };
+ }
+
+ function scanRegExp() {
+ scanning = true;
+ var start, body, flags, value;
+
+ lookahead = null;
+ skipComment();
+ start = index;
+
+ body = scanRegExpBody();
+ flags = scanRegExpFlags();
+ value = testRegExp(body.value, flags.value);
+ scanning = false;
+ if (extra.tokenize) {
+ return {
+ type: Token.RegularExpression,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: start,
+ end: index
+ };
+ }
+
+ return {
+ literal: body.literal + flags.literal,
+ value: value,
+ regex: {
+ pattern: body.value,
+ flags: flags.value
+ },
+ start: start,
+ end: index
+ };
+ }
+
+ function collectRegex() {
+ var pos, loc, regex, token;
+
+ skipComment();
+
+ pos = index;
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ regex = scanRegExp();
+
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ /* istanbul ignore next */
+ if (!extra.tokenize) {
+ // Pop the previous token, which is likely '/' or '/='
+ if (extra.tokens.length > 0) {
+ token = extra.tokens[extra.tokens.length - 1];
+ if (token.range[0] === pos && token.type === 'Punctuator') {
+ if (token.value === '/' || token.value === '/=') {
+ extra.tokens.pop();
+ }
+ }
+ }
+
+ extra.tokens.push({
+ type: 'RegularExpression',
+ value: regex.literal,
+ regex: regex.regex,
+ range: [pos, index],
+ loc: loc
+ });
+ }
+
+ return regex;
+ }
+
+ function isIdentifierName(token) {
+ return token.type === Token.Identifier ||
+ token.type === Token.Keyword ||
+ token.type === Token.BooleanLiteral ||
+ token.type === Token.NullLiteral;
+ }
+
+ function advanceSlash() {
+ var prevToken,
+ checkToken;
+ // Using the following algorithm:
+ // https://github.com/mozilla/sweet.js/wiki/design
+ prevToken = extra.tokens[extra.tokens.length - 1];
+ if (!prevToken) {
+ // Nothing before that: it cannot be a division.
+ return collectRegex();
+ }
+ if (prevToken.type === 'Punctuator') {
+ if (prevToken.value === ']') {
+ return scanPunctuator();
+ }
+ if (prevToken.value === ')') {
+ checkToken = extra.tokens[extra.openParenToken - 1];
+ if (checkToken &&
+ checkToken.type === 'Keyword' &&
+ (checkToken.value === 'if' ||
+ checkToken.value === 'while' ||
+ checkToken.value === 'for' ||
+ checkToken.value === 'with')) {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+ if (prevToken.value === '}') {
+ // Dividing a function by anything makes little sense,
+ // but we have to check for that.
+ if (extra.tokens[extra.openCurlyToken - 3] &&
+ extra.tokens[extra.openCurlyToken - 3].type === 'Keyword') {
+ // Anonymous function.
+ checkToken = extra.tokens[extra.openCurlyToken - 4];
+ if (!checkToken) {
+ return scanPunctuator();
+ }
+ } else if (extra.tokens[extra.openCurlyToken - 4] &&
+ extra.tokens[extra.openCurlyToken - 4].type === 'Keyword') {
+ // Named function.
+ checkToken = extra.tokens[extra.openCurlyToken - 5];
+ if (!checkToken) {
+ return collectRegex();
+ }
+ } else {
+ return scanPunctuator();
+ }
+ // checkToken determines whether the function is
+ // a declaration or an expression.
+ if (FnExprTokens.indexOf(checkToken.value) >= 0) {
+ // It is an expression.
+ return scanPunctuator();
+ }
+ // It is a declaration.
+ return collectRegex();
+ }
+ return collectRegex();
+ }
+ if (prevToken.type === 'Keyword' && prevToken.value !== 'this') {
+ return collectRegex();
+ }
+ return scanPunctuator();
+ }
+
+ function advance() {
+ var cp, token;
+
+ if (index >= length) {
+ return {
+ type: Token.EOF,
+ lineNumber: lineNumber,
+ lineStart: lineStart,
+ start: index,
+ end: index
+ };
+ }
+
+ cp = source.charCodeAt(index);
+
+ if (isIdentifierStart(cp)) {
+ token = scanIdentifier();
+ if (strict && isStrictModeReservedWord(token.value)) {
+ token.type = Token.Keyword;
+ }
+ return token;
+ }
+
+ // Very common: ( and ) and ;
+ if (cp === 0x28 || cp === 0x29 || cp === 0x3B) {
+ return scanPunctuator();
+ }
+
+ // String literal starts with single quote (U+0027) or double quote (U+0022).
+ if (cp === 0x27 || cp === 0x22) {
+ return scanStringLiteral();
+ }
+
+ // Dot (.) U+002E can also start a floating-point number, hence the need
+ // to check the next character.
+ if (cp === 0x2E) {
+ if (isDecimalDigit(source.charCodeAt(index + 1))) {
+ return scanNumericLiteral();
+ }
+ return scanPunctuator();
+ }
+
+ if (isDecimalDigit(cp)) {
+ return scanNumericLiteral();
+ }
+
+ // Slash (/) U+002F can also start a regex.
+ if (extra.tokenize && cp === 0x2F) {
+ return advanceSlash();
+ }
+
+ // Template literals start with ` (U+0060) for template head
+ // or } (U+007D) for template middle or template tail.
+ if (cp === 0x60 || (cp === 0x7D && state.curlyStack[state.curlyStack.length - 1] === '${')) {
+ return scanTemplate();
+ }
+
+ // Possible identifier start in a surrogate pair.
+ if (cp >= 0xD800 && cp < 0xDFFF) {
+ cp = codePointAt(index);
+ if (isIdentifierStart(cp)) {
+ return scanIdentifier();
+ }
+ }
+
+ return scanPunctuator();
+ }
+
+ function collectToken() {
+ var loc, token, value, entry;
+
+ loc = {
+ start: {
+ line: lineNumber,
+ column: index - lineStart
+ }
+ };
+
+ token = advance();
+ loc.end = {
+ line: lineNumber,
+ column: index - lineStart
+ };
+
+ if (token.type !== Token.EOF) {
+ value = source.slice(token.start, token.end);
+ entry = {
+ type: TokenName[token.type],
+ value: value,
+ range: [token.start, token.end],
+ loc: loc
+ };
+ if (token.regex) {
+ entry.regex = {
+ pattern: token.regex.pattern,
+ flags: token.regex.flags
+ };
+ }
+ extra.tokens.push(entry);
+ }
+
+ return token;
+ }
+
+ function lex() {
+ var token;
+ scanning = true;
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ skipComment();
+
+ token = lookahead;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ return token;
+ }
+
+ function peek() {
+ scanning = true;
+
+ skipComment();
+
+ lastIndex = index;
+ lastLineNumber = lineNumber;
+ lastLineStart = lineStart;
+
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+
+ lookahead = (typeof extra.tokens !== 'undefined') ? collectToken() : advance();
+ scanning = false;
+ }
+
+ function Position() {
+ this.line = startLineNumber;
+ this.column = startIndex - startLineStart;
+ }
+
+ function SourceLocation() {
+ this.start = new Position();
+ this.end = null;
+ }
+
+ function WrappingSourceLocation(startToken) {
+ this.start = {
+ line: startToken.lineNumber,
+ column: startToken.start - startToken.lineStart
+ };
+ this.end = null;
+ }
+
+ function Node() {
+ if (extra.range) {
+ this.range = [startIndex, 0];
+ }
+ if (extra.loc) {
+ this.loc = new SourceLocation();
+ }
+ }
+
+ function WrappingNode(startToken) {
+ if (extra.range) {
+ this.range = [startToken.start, 0];
+ }
+ if (extra.loc) {
+ this.loc = new WrappingSourceLocation(startToken);
+ }
+ }
+
+ WrappingNode.prototype = Node.prototype = {
+
+ processComment: function () {
+ var lastChild,
+ leadingComments,
+ trailingComments,
+ bottomRight = extra.bottomRightStack,
+ i,
+ comment,
+ last = bottomRight[bottomRight.length - 1];
+
+ if (this.type === Syntax.Program) {
+ if (this.body.length > 0) {
+ return;
+ }
+ }
+
+ if (extra.trailingComments.length > 0) {
+ trailingComments = [];
+ for (i = extra.trailingComments.length - 1; i >= 0; --i) {
+ comment = extra.trailingComments[i];
+ if (comment.range[0] >= this.range[1]) {
+ trailingComments.unshift(comment);
+ extra.trailingComments.splice(i, 1);
+ }
+ }
+ extra.trailingComments = [];
+ } else {
+ if (last && last.trailingComments && last.trailingComments[0].range[0] >= this.range[1]) {
+ trailingComments = last.trailingComments;
+ delete last.trailingComments;
+ }
+ }
+
+ // Eating the stack.
+ while (last && last.range[0] >= this.range[0]) {
+ lastChild = bottomRight.pop();
+ last = bottomRight[bottomRight.length - 1];
+ }
+
+ if (lastChild) {
+ if (lastChild.leadingComments) {
+ leadingComments = [];
+ for (i = lastChild.leadingComments.length - 1; i >= 0; --i) {
+ comment = lastChild.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ lastChild.leadingComments.splice(i, 1);
+ }
+ }
+
+ if (!lastChild.leadingComments.length) {
+ lastChild.leadingComments = undefined;
+ }
+ }
+ } else if (extra.leadingComments.length > 0) {
+ leadingComments = [];
+ for (i = extra.leadingComments.length - 1; i >= 0; --i) {
+ comment = extra.leadingComments[i];
+ if (comment.range[1] <= this.range[0]) {
+ leadingComments.unshift(comment);
+ extra.leadingComments.splice(i, 1);
+ }
+ }
+ }
+
+
+ if (leadingComments && leadingComments.length > 0) {
+ this.leadingComments = leadingComments;
+ }
+ if (trailingComments && trailingComments.length > 0) {
+ this.trailingComments = trailingComments;
+ }
+
+ bottomRight.push(this);
+ },
+
+ finish: function () {
+ if (extra.range) {
+ this.range[1] = lastIndex;
+ }
+ if (extra.loc) {
+ this.loc.end = {
+ line: lastLineNumber,
+ column: lastIndex - lastLineStart
+ };
+ if (extra.source) {
+ this.loc.source = extra.source;
+ }
+ }
+
+ if (extra.attachComment) {
+ this.processComment();
+ }
+ },
+
+ finishArrayExpression: function (elements) {
+ this.type = Syntax.ArrayExpression;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrayPattern: function (elements) {
+ this.type = Syntax.ArrayPattern;
+ this.elements = elements;
+ this.finish();
+ return this;
+ },
+
+ finishArrowFunctionExpression: function (params, defaults, body, expression) {
+ this.type = Syntax.ArrowFunctionExpression;
+ this.id = null;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = false;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentExpression: function (operator, left, right) {
+ this.type = Syntax.AssignmentExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishAssignmentPattern: function (left, right) {
+ this.type = Syntax.AssignmentPattern;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBinaryExpression: function (operator, left, right) {
+ this.type = (operator === '||' || operator === '&&') ? Syntax.LogicalExpression : Syntax.BinaryExpression;
+ this.operator = operator;
+ this.left = left;
+ this.right = right;
+ this.finish();
+ return this;
+ },
+
+ finishBlockStatement: function (body) {
+ this.type = Syntax.BlockStatement;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishBreakStatement: function (label) {
+ this.type = Syntax.BreakStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishCallExpression: function (callee, args) {
+ this.type = Syntax.CallExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishCatchClause: function (param, body) {
+ this.type = Syntax.CatchClause;
+ this.param = param;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassBody: function (body) {
+ this.type = Syntax.ClassBody;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassDeclaration: function (id, superClass, body) {
+ this.type = Syntax.ClassDeclaration;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishClassExpression: function (id, superClass, body) {
+ this.type = Syntax.ClassExpression;
+ this.id = id;
+ this.superClass = superClass;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishConditionalExpression: function (test, consequent, alternate) {
+ this.type = Syntax.ConditionalExpression;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishContinueStatement: function (label) {
+ this.type = Syntax.ContinueStatement;
+ this.label = label;
+ this.finish();
+ return this;
+ },
+
+ finishDebuggerStatement: function () {
+ this.type = Syntax.DebuggerStatement;
+ this.finish();
+ return this;
+ },
+
+ finishDoWhileStatement: function (body, test) {
+ this.type = Syntax.DoWhileStatement;
+ this.body = body;
+ this.test = test;
+ this.finish();
+ return this;
+ },
+
+ finishEmptyStatement: function () {
+ this.type = Syntax.EmptyStatement;
+ this.finish();
+ return this;
+ },
+
+ finishExpressionStatement: function (expression) {
+ this.type = Syntax.ExpressionStatement;
+ this.expression = expression;
+ this.finish();
+ return this;
+ },
+
+ finishForStatement: function (init, test, update, body) {
+ this.type = Syntax.ForStatement;
+ this.init = init;
+ this.test = test;
+ this.update = update;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForOfStatement: function (left, right, body) {
+ this.type = Syntax.ForOfStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishForInStatement: function (left, right, body) {
+ this.type = Syntax.ForInStatement;
+ this.left = left;
+ this.right = right;
+ this.body = body;
+ this.each = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionDeclaration: function (id, params, defaults, body, generator) {
+ this.type = Syntax.FunctionDeclaration;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = generator;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishFunctionExpression: function (id, params, defaults, body, generator) {
+ this.type = Syntax.FunctionExpression;
+ this.id = id;
+ this.params = params;
+ this.defaults = defaults;
+ this.body = body;
+ this.generator = generator;
+ this.expression = false;
+ this.finish();
+ return this;
+ },
+
+ finishIdentifier: function (name) {
+ this.type = Syntax.Identifier;
+ this.name = name;
+ this.finish();
+ return this;
+ },
+
+ finishIfStatement: function (test, consequent, alternate) {
+ this.type = Syntax.IfStatement;
+ this.test = test;
+ this.consequent = consequent;
+ this.alternate = alternate;
+ this.finish();
+ return this;
+ },
+
+ finishLabeledStatement: function (label, body) {
+ this.type = Syntax.LabeledStatement;
+ this.label = label;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishLiteral: function (token) {
+ this.type = Syntax.Literal;
+ this.value = token.value;
+ this.raw = source.slice(token.start, token.end);
+ if (token.regex) {
+ this.regex = token.regex;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishMemberExpression: function (accessor, object, property) {
+ this.type = Syntax.MemberExpression;
+ this.computed = accessor === '[';
+ this.object = object;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishMetaProperty: function (meta, property) {
+ this.type = Syntax.MetaProperty;
+ this.meta = meta;
+ this.property = property;
+ this.finish();
+ return this;
+ },
+
+ finishNewExpression: function (callee, args) {
+ this.type = Syntax.NewExpression;
+ this.callee = callee;
+ this.arguments = args;
+ this.finish();
+ return this;
+ },
+
+ finishObjectExpression: function (properties) {
+ this.type = Syntax.ObjectExpression;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishObjectPattern: function (properties) {
+ this.type = Syntax.ObjectPattern;
+ this.properties = properties;
+ this.finish();
+ return this;
+ },
+
+ finishPostfixExpression: function (operator, argument) {
+ this.type = Syntax.UpdateExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = false;
+ this.finish();
+ return this;
+ },
+
+ finishProgram: function (body) {
+ this.type = Syntax.Program;
+ this.body = body;
+ if (sourceType === 'module') {
+ // very restrictive for now
+ this.sourceType = sourceType;
+ }
+ this.finish();
+ return this;
+ },
+
+ finishProperty: function (kind, key, computed, value, method, shorthand) {
+ this.type = Syntax.Property;
+ this.key = key;
+ this.computed = computed;
+ this.value = value;
+ this.kind = kind;
+ this.method = method;
+ this.shorthand = shorthand;
+ this.finish();
+ return this;
+ },
+
+ finishRestElement: function (argument) {
+ this.type = Syntax.RestElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishReturnStatement: function (argument) {
+ this.type = Syntax.ReturnStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSequenceExpression: function (expressions) {
+ this.type = Syntax.SequenceExpression;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishSpreadElement: function (argument) {
+ this.type = Syntax.SpreadElement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchCase: function (test, consequent) {
+ this.type = Syntax.SwitchCase;
+ this.test = test;
+ this.consequent = consequent;
+ this.finish();
+ return this;
+ },
+
+ finishSuper: function () {
+ this.type = Syntax.Super;
+ this.finish();
+ return this;
+ },
+
+ finishSwitchStatement: function (discriminant, cases) {
+ this.type = Syntax.SwitchStatement;
+ this.discriminant = discriminant;
+ this.cases = cases;
+ this.finish();
+ return this;
+ },
+
+ finishTaggedTemplateExpression: function (tag, quasi) {
+ this.type = Syntax.TaggedTemplateExpression;
+ this.tag = tag;
+ this.quasi = quasi;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateElement: function (value, tail) {
+ this.type = Syntax.TemplateElement;
+ this.value = value;
+ this.tail = tail;
+ this.finish();
+ return this;
+ },
+
+ finishTemplateLiteral: function (quasis, expressions) {
+ this.type = Syntax.TemplateLiteral;
+ this.quasis = quasis;
+ this.expressions = expressions;
+ this.finish();
+ return this;
+ },
+
+ finishThisExpression: function () {
+ this.type = Syntax.ThisExpression;
+ this.finish();
+ return this;
+ },
+
+ finishThrowStatement: function (argument) {
+ this.type = Syntax.ThrowStatement;
+ this.argument = argument;
+ this.finish();
+ return this;
+ },
+
+ finishTryStatement: function (block, handler, finalizer) {
+ this.type = Syntax.TryStatement;
+ this.block = block;
+ this.guardedHandlers = [];
+ this.handlers = handler ? [ handler ] : [];
+ this.handler = handler;
+ this.finalizer = finalizer;
+ this.finish();
+ return this;
+ },
+
+ finishUnaryExpression: function (operator, argument) {
+ this.type = (operator === '++' || operator === '--') ? Syntax.UpdateExpression : Syntax.UnaryExpression;
+ this.operator = operator;
+ this.argument = argument;
+ this.prefix = true;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclaration: function (declarations) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = 'var';
+ this.finish();
+ return this;
+ },
+
+ finishLexicalDeclaration: function (declarations, kind) {
+ this.type = Syntax.VariableDeclaration;
+ this.declarations = declarations;
+ this.kind = kind;
+ this.finish();
+ return this;
+ },
+
+ finishVariableDeclarator: function (id, init) {
+ this.type = Syntax.VariableDeclarator;
+ this.id = id;
+ this.init = init;
+ this.finish();
+ return this;
+ },
+
+ finishWhileStatement: function (test, body) {
+ this.type = Syntax.WhileStatement;
+ this.test = test;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishWithStatement: function (object, body) {
+ this.type = Syntax.WithStatement;
+ this.object = object;
+ this.body = body;
+ this.finish();
+ return this;
+ },
+
+ finishExportSpecifier: function (local, exported) {
+ this.type = Syntax.ExportSpecifier;
+ this.exported = exported || local;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportDefaultSpecifier: function (local) {
+ this.type = Syntax.ImportDefaultSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishImportNamespaceSpecifier: function (local) {
+ this.type = Syntax.ImportNamespaceSpecifier;
+ this.local = local;
+ this.finish();
+ return this;
+ },
+
+ finishExportNamedDeclaration: function (declaration, specifiers, src) {
+ this.type = Syntax.ExportNamedDeclaration;
+ this.declaration = declaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishExportDefaultDeclaration: function (declaration) {
+ this.type = Syntax.ExportDefaultDeclaration;
+ this.declaration = declaration;
+ this.finish();
+ return this;
+ },
+
+ finishExportAllDeclaration: function (src) {
+ this.type = Syntax.ExportAllDeclaration;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishImportSpecifier: function (local, imported) {
+ this.type = Syntax.ImportSpecifier;
+ this.local = local || imported;
+ this.imported = imported;
+ this.finish();
+ return this;
+ },
+
+ finishImportDeclaration: function (specifiers, src) {
+ this.type = Syntax.ImportDeclaration;
+ this.specifiers = specifiers;
+ this.source = src;
+ this.finish();
+ return this;
+ },
+
+ finishYieldExpression: function (argument, delegate) {
+ this.type = Syntax.YieldExpression;
+ this.argument = argument;
+ this.delegate = delegate;
+ this.finish();
+ return this;
+ }
+ };
+
+
+ function recordError(error) {
+ var e, existing;
+
+ for (e = 0; e < extra.errors.length; e++) {
+ existing = extra.errors[e];
+ // Prevent duplicated error.
+ /* istanbul ignore next */
+ if (existing.index === error.index && existing.message === error.message) {
+ return;
+ }
+ }
+
+ extra.errors.push(error);
+ }
+
+ function createError(line, pos, description) {
+ var error = new Error('Line ' + line + ': ' + description);
+ error.index = pos;
+ error.lineNumber = line;
+ error.column = pos - (scanning ? lineStart : lastLineStart) + 1;
+ error.description = description;
+ return error;
+ }
+
+ // Throw an exception
+
+ function throwError(messageFormat) {
+ var args, msg;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ throw createError(lastLineNumber, lastIndex, msg);
+ }
+
+ function tolerateError(messageFormat) {
+ var args, msg, error;
+
+ args = Array.prototype.slice.call(arguments, 1);
+ /* istanbul ignore next */
+ msg = messageFormat.replace(/%(\d)/g,
+ function (whole, idx) {
+ assert(idx < args.length, 'Message reference must be in range');
+ return args[idx];
+ }
+ );
+
+ error = createError(lineNumber, lastIndex, msg);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Throw an exception because of the token.
+
+ function unexpectedTokenError(token, message) {
+ var value, msg = message || Messages.UnexpectedToken;
+
+ if (token) {
+ if (!message) {
+ msg = (token.type === Token.EOF) ? Messages.UnexpectedEOS :
+ (token.type === Token.Identifier) ? Messages.UnexpectedIdentifier :
+ (token.type === Token.NumericLiteral) ? Messages.UnexpectedNumber :
+ (token.type === Token.StringLiteral) ? Messages.UnexpectedString :
+ (token.type === Token.Template) ? Messages.UnexpectedTemplate :
+ Messages.UnexpectedToken;
+
+ if (token.type === Token.Keyword) {
+ if (isFutureReservedWord(token.value)) {
+ msg = Messages.UnexpectedReserved;
+ } else if (strict && isStrictModeReservedWord(token.value)) {
+ msg = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ value = (token.type === Token.Template) ? token.value.raw : token.value;
+ } else {
+ value = 'ILLEGAL';
+ }
+
+ msg = msg.replace('%0', value);
+
+ return (token && typeof token.lineNumber === 'number') ?
+ createError(token.lineNumber, token.start, msg) :
+ createError(scanning ? lineNumber : lastLineNumber, scanning ? index : lastIndex, msg);
+ }
+
+ function throwUnexpectedToken(token, message) {
+ throw unexpectedTokenError(token, message);
+ }
+
+ function tolerateUnexpectedToken(token, message) {
+ var error = unexpectedTokenError(token, message);
+ if (extra.errors) {
+ recordError(error);
+ } else {
+ throw error;
+ }
+ }
+
+ // Expect the next token to match the specified punctuator.
+ // If not, an exception will be thrown.
+
+ function expect(value) {
+ var token = lex();
+ if (token.type !== Token.Punctuator || token.value !== value) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ /**
+ * @name expectCommaSeparator
+ * @description Quietly expect a comma when in tolerant mode, otherwise delegates
+ * to <code>expect(value)</code>
+ * @since 2.0
+ */
+ function expectCommaSeparator() {
+ var token;
+
+ if (extra.errors) {
+ token = lookahead;
+ if (token.type === Token.Punctuator && token.value === ',') {
+ lex();
+ } else if (token.type === Token.Punctuator && token.value === ';') {
+ lex();
+ tolerateUnexpectedToken(token);
+ } else {
+ tolerateUnexpectedToken(token, Messages.UnexpectedToken);
+ }
+ } else {
+ expect(',');
+ }
+ }
+
+ // Expect the next token to match the specified keyword.
+ // If not, an exception will be thrown.
+
+ function expectKeyword(keyword) {
+ var token = lex();
+ if (token.type !== Token.Keyword || token.value !== keyword) {
+ throwUnexpectedToken(token);
+ }
+ }
+
+ // Return true if the next token matches the specified punctuator.
+
+ function match(value) {
+ return lookahead.type === Token.Punctuator && lookahead.value === value;
+ }
+
+ // Return true if the next token matches the specified keyword
+
+ function matchKeyword(keyword) {
+ return lookahead.type === Token.Keyword && lookahead.value === keyword;
+ }
+
+ // Return true if the next token matches the specified contextual keyword
+ // (where an identifier is sometimes a keyword depending on the context)
+
+ function matchContextualKeyword(keyword) {
+ return lookahead.type === Token.Identifier && lookahead.value === keyword;
+ }
+
+ // Return true if the next token is an assignment operator
+
+ function matchAssign() {
+ var op;
+
+ if (lookahead.type !== Token.Punctuator) {
+ return false;
+ }
+ op = lookahead.value;
+ return op === '=' ||
+ op === '*=' ||
+ op === '/=' ||
+ op === '%=' ||
+ op === '+=' ||
+ op === '-=' ||
+ op === '<<=' ||
+ op === '>>=' ||
+ op === '>>>=' ||
+ op === '&=' ||
+ op === '^=' ||
+ op === '|=';
+ }
+
+ function consumeSemicolon() {
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(startIndex) === 0x3B || match(';')) {
+ lex();
+ return;
+ }
+
+ if (hasLineTerminator) {
+ return;
+ }
+
+ // FIXME(ikarienator): this is seemingly an issue in the previous location info convention.
+ lastIndex = startIndex;
+ lastLineNumber = startLineNumber;
+ lastLineStart = startLineStart;
+
+ if (lookahead.type !== Token.EOF && !match('}')) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+
+ // Cover grammar support.
+ //
+ // When an assignment expression position starts with an left parenthesis, the determination of the type
+ // of the syntax is to be deferred arbitrarily long until the end of the parentheses pair (plus a lookahead)
+ // or the first comma. This situation also defers the determination of all the expressions nested in the pair.
+ //
+ // There are three productions that can be parsed in a parentheses pair that needs to be determined
+ // after the outermost pair is closed. They are:
+ //
+ // 1. AssignmentExpression
+ // 2. BindingElements
+ // 3. AssignmentTargets
+ //
+ // In order to avoid exponential backtracking, we use two flags to denote if the production can be
+ // binding element or assignment target.
+ //
+ // The three productions have the relationship:
+ //
+ // BindingElements ⊆ AssignmentTargets ⊆ AssignmentExpression
+ //
+ // with a single exception that CoverInitializedName when used directly in an Expression, generates
+ // an early error. Therefore, we need the third state, firstCoverInitializedNameError, to track the
+ // first usage of CoverInitializedName and report it when we reached the end of the parentheses pair.
+ //
+ // isolateCoverGrammar function runs the given parser function with a new cover grammar context, and it does not
+ // effect the current flags. This means the production the parser parses is only used as an expression. Therefore
+ // the CoverInitializedName check is conducted.
+ //
+ // inheritCoverGrammar function runs the given parse function with a new cover grammar context, and it propagates
+ // the flags outside of the parser. This means the production the parser parses is used as a part of a potential
+ // pattern. The CoverInitializedName check is deferred.
+ function isolateCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ if (firstCoverInitializedNameError !== null) {
+ throwUnexpectedToken(firstCoverInitializedNameError);
+ }
+ isBindingElement = oldIsBindingElement;
+ isAssignmentTarget = oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError;
+ return result;
+ }
+
+ function inheritCoverGrammar(parser) {
+ var oldIsBindingElement = isBindingElement,
+ oldIsAssignmentTarget = isAssignmentTarget,
+ oldFirstCoverInitializedNameError = firstCoverInitializedNameError,
+ result;
+ isBindingElement = true;
+ isAssignmentTarget = true;
+ firstCoverInitializedNameError = null;
+ result = parser();
+ isBindingElement = isBindingElement && oldIsBindingElement;
+ isAssignmentTarget = isAssignmentTarget && oldIsAssignmentTarget;
+ firstCoverInitializedNameError = oldFirstCoverInitializedNameError || firstCoverInitializedNameError;
+ return result;
+ }
+
+ // ECMA-262 13.3.3 Destructuring Binding Patterns
+
+ function parseArrayPattern(params) {
+ var node = new Node(), elements = [], rest, restNode;
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else {
+ if (match('...')) {
+ restNode = new Node();
+ lex();
+ params.push(lookahead);
+ rest = parseVariableIdentifier(params);
+ elements.push(restNode.finishRestElement(rest));
+ break;
+ } else {
+ elements.push(parsePatternWithDefault(params));
+ }
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+
+ }
+
+ expect(']');
+
+ return node.finishArrayPattern(elements);
+ }
+
+ function parsePropertyPattern(params) {
+ var node = new Node(), key, keyToken, computed = match('['), init;
+ if (lookahead.type === Token.Identifier) {
+ keyToken = lookahead;
+ key = parseVariableIdentifier();
+ if (match('=')) {
+ params.push(keyToken);
+ lex();
+ init = parseAssignmentExpression();
+
+ return node.finishProperty(
+ 'init', key, false,
+ new WrappingNode(keyToken).finishAssignmentPattern(key, init), false, false);
+ } else if (!match(':')) {
+ params.push(keyToken);
+ return node.finishProperty('init', key, false, key, false, true);
+ }
+ } else {
+ key = parseObjectPropertyKey(params);
+ }
+ expect(':');
+ init = parsePatternWithDefault(params);
+ return node.finishProperty('init', key, computed, init, false, false);
+ }
+
+ function parseObjectPattern(params) {
+ var node = new Node(), properties = [];
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parsePropertyPattern(params));
+ if (!match('}')) {
+ expect(',');
+ }
+ }
+
+ lex();
+
+ return node.finishObjectPattern(properties);
+ }
+
+ function parsePattern(params) {
+ if (match('[')) {
+ return parseArrayPattern(params);
+ } else if (match('{')) {
+ return parseObjectPattern(params);
+ }
+ params.push(lookahead);
+ return parseVariableIdentifier();
+ }
+
+ function parsePatternWithDefault(params) {
+ var startToken = lookahead, pattern, previousAllowYield, right;
+ pattern = parsePattern(params);
+ if (match('=')) {
+ lex();
+ previousAllowYield = state.allowYield;
+ state.allowYield = true;
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ state.allowYield = previousAllowYield;
+ pattern = new WrappingNode(startToken).finishAssignmentPattern(pattern, right);
+ }
+ return pattern;
+ }
+
+ // ECMA-262 12.2.5 Array Initializer
+
+ function parseArrayInitializer() {
+ var elements = [], node = new Node(), restSpread;
+
+ expect('[');
+
+ while (!match(']')) {
+ if (match(',')) {
+ lex();
+ elements.push(null);
+ } else if (match('...')) {
+ restSpread = new Node();
+ lex();
+ restSpread.finishSpreadElement(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ isAssignmentTarget = isBindingElement = false;
+ expect(',');
+ }
+ elements.push(restSpread);
+ } else {
+ elements.push(inheritCoverGrammar(parseAssignmentExpression));
+
+ if (!match(']')) {
+ expect(',');
+ }
+ }
+ }
+
+ lex();
+
+ return node.finishArrayExpression(elements);
+ }
+
+ // ECMA-262 12.2.6 Object Initializer
+
+ function parsePropertyFunction(node, paramInfo, isGenerator) {
+ var previousStrict, body;
+
+ isAssignmentTarget = isBindingElement = false;
+
+ previousStrict = strict;
+ body = isolateCoverGrammar(parseFunctionSourceElements);
+
+ if (strict && paramInfo.firstRestricted) {
+ tolerateUnexpectedToken(paramInfo.firstRestricted, paramInfo.message);
+ }
+ if (strict && paramInfo.stricted) {
+ tolerateUnexpectedToken(paramInfo.stricted, paramInfo.message);
+ }
+
+ strict = previousStrict;
+ return node.finishFunctionExpression(null, paramInfo.params, paramInfo.defaults, body, isGenerator);
+ }
+
+ function parsePropertyMethodFunction() {
+ var params, method, node = new Node(),
+ previousAllowYield = state.allowYield;
+
+ state.allowYield = false;
+ params = parseParams();
+ state.allowYield = previousAllowYield;
+
+ state.allowYield = false;
+ method = parsePropertyFunction(node, params, false);
+ state.allowYield = previousAllowYield;
+
+ return method;
+ }
+
+ function parseObjectPropertyKey() {
+ var token, node = new Node(), expr;
+
+ token = lex();
+
+ // Note: This function is called only from parseObjectProperty(), where
+ // EOF and Punctuator tokens are already filtered out.
+
+ switch (token.type) {
+ case Token.StringLiteral:
+ case Token.NumericLiteral:
+ if (strict && token.octal) {
+ tolerateUnexpectedToken(token, Messages.StrictOctalLiteral);
+ }
+ return node.finishLiteral(token);
+ case Token.Identifier:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.Keyword:
+ return node.finishIdentifier(token.value);
+ case Token.Punctuator:
+ if (token.value === '[') {
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+ expect(']');
+ return expr;
+ }
+ break;
+ }
+ throwUnexpectedToken(token);
+ }
+
+ function lookaheadPropertyName() {
+ switch (lookahead.type) {
+ case Token.Identifier:
+ case Token.StringLiteral:
+ case Token.BooleanLiteral:
+ case Token.NullLiteral:
+ case Token.NumericLiteral:
+ case Token.Keyword:
+ return true;
+ case Token.Punctuator:
+ return lookahead.value === '[';
+ }
+ return false;
+ }
+
+ // This function is to try to parse a MethodDefinition as defined in 14.3. But in the case of object literals,
+ // it might be called at a position where there is in fact a short hand identifier pattern or a data property.
+ // This can only be determined after we consumed up to the left parentheses.
+ //
+ // In order to avoid back tracking, it returns `null` if the position is not a MethodDefinition and the caller
+ // is responsible to visit other options.
+ function tryParseMethodDefinition(token, key, computed, node) {
+ var value, options, methodNode, params,
+ previousAllowYield = state.allowYield;
+
+ if (token.type === Token.Identifier) {
+ // check for `get` and `set`;
+
+ if (token.value === 'get' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+ expect(')');
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, {
+ params: [],
+ defaults: [],
+ stricted: null,
+ firstRestricted: null,
+ message: null
+ }, false);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('get', key, computed, value, false, false);
+ } else if (token.value === 'set' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+ expect('(');
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: null,
+ paramSet: {}
+ };
+ if (match(')')) {
+ tolerateUnexpectedToken(lookahead);
+ } else {
+ state.allowYield = false;
+ parseParam(options);
+ state.allowYield = previousAllowYield;
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+ }
+ expect(')');
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, options, false);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('set', key, computed, value, false, false);
+ }
+ } else if (token.type === Token.Punctuator && token.value === '*' && lookaheadPropertyName()) {
+ computed = match('[');
+ key = parseObjectPropertyKey();
+ methodNode = new Node();
+
+ state.allowYield = true;
+ params = parseParams();
+ state.allowYield = previousAllowYield;
+
+ state.allowYield = false;
+ value = parsePropertyFunction(methodNode, params, true);
+ state.allowYield = previousAllowYield;
+
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ if (key && match('(')) {
+ value = parsePropertyMethodFunction();
+ return node.finishProperty('init', key, computed, value, true, false);
+ }
+
+ // Not a MethodDefinition.
+ return null;
+ }
+
+ function parseObjectProperty(hasProto) {
+ var token = lookahead, node = new Node(), computed, key, maybeMethod, proto, value;
+
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ maybeMethod = tryParseMethodDefinition(token, key, computed, node);
+ if (maybeMethod) {
+ return maybeMethod;
+ }
+
+ if (!key) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ // Check for duplicated __proto__
+ if (!computed) {
+ proto = (key.type === Syntax.Identifier && key.name === '__proto__') ||
+ (key.type === Syntax.Literal && key.value === '__proto__');
+ if (hasProto.value && proto) {
+ tolerateError(Messages.DuplicateProtoProperty);
+ }
+ hasProto.value |= proto;
+ }
+
+ if (match(':')) {
+ lex();
+ value = inheritCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed, value, false, false);
+ }
+
+ if (token.type === Token.Identifier) {
+ if (match('=')) {
+ firstCoverInitializedNameError = lookahead;
+ lex();
+ value = isolateCoverGrammar(parseAssignmentExpression);
+ return node.finishProperty('init', key, computed,
+ new WrappingNode(token).finishAssignmentPattern(key, value), false, true);
+ }
+ return node.finishProperty('init', key, computed, key, false, true);
+ }
+
+ throwUnexpectedToken(lookahead);
+ }
+
+ function parseObjectInitializer() {
+ var properties = [], hasProto = {value: false}, node = new Node();
+
+ expect('{');
+
+ while (!match('}')) {
+ properties.push(parseObjectProperty(hasProto));
+
+ if (!match('}')) {
+ expectCommaSeparator();
+ }
+ }
+
+ expect('}');
+
+ return node.finishObjectExpression(properties);
+ }
+
+ function reinterpretExpressionAsPattern(expr) {
+ var i;
+ switch (expr.type) {
+ case Syntax.Identifier:
+ case Syntax.MemberExpression:
+ case Syntax.RestElement:
+ case Syntax.AssignmentPattern:
+ break;
+ case Syntax.SpreadElement:
+ expr.type = Syntax.RestElement;
+ reinterpretExpressionAsPattern(expr.argument);
+ break;
+ case Syntax.ArrayExpression:
+ expr.type = Syntax.ArrayPattern;
+ for (i = 0; i < expr.elements.length; i++) {
+ if (expr.elements[i] !== null) {
+ reinterpretExpressionAsPattern(expr.elements[i]);
+ }
+ }
+ break;
+ case Syntax.ObjectExpression:
+ expr.type = Syntax.ObjectPattern;
+ for (i = 0; i < expr.properties.length; i++) {
+ reinterpretExpressionAsPattern(expr.properties[i].value);
+ }
+ break;
+ case Syntax.AssignmentExpression:
+ expr.type = Syntax.AssignmentPattern;
+ reinterpretExpressionAsPattern(expr.left);
+ break;
+ default:
+ // Allow other node type for tolerant parsing.
+ break;
+ }
+ }
+
+ // ECMA-262 12.2.9 Template Literals
+
+ function parseTemplateElement(option) {
+ var node, token;
+
+ if (lookahead.type !== Token.Template || (option.head && !lookahead.head)) {
+ throwUnexpectedToken();
+ }
+
+ node = new Node();
+ token = lex();
+
+ return node.finishTemplateElement({ raw: token.value.raw, cooked: token.value.cooked }, token.tail);
+ }
+
+ function parseTemplateLiteral() {
+ var quasi, quasis, expressions, node = new Node();
+
+ quasi = parseTemplateElement({ head: true });
+ quasis = [ quasi ];
+ expressions = [];
+
+ while (!quasi.tail) {
+ expressions.push(parseExpression());
+ quasi = parseTemplateElement({ head: false });
+ quasis.push(quasi);
+ }
+
+ return node.finishTemplateLiteral(quasis, expressions);
+ }
+
+ // ECMA-262 12.2.10 The Grouping Operator
+
+ function parseGroupExpression() {
+ var expr, expressions, startToken, i, params = [];
+
+ expect('(');
+
+ if (match(')')) {
+ lex();
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [],
+ rawParams: []
+ };
+ }
+
+ startToken = lookahead;
+ if (match('...')) {
+ expr = parseRestElement(params);
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ isBindingElement = true;
+ expr = inheritCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ isAssignmentTarget = false;
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+
+ if (match('...')) {
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+ expressions.push(parseRestElement(params));
+ expect(')');
+ if (!match('=>')) {
+ expect('=>');
+ }
+ isBindingElement = false;
+ for (i = 0; i < expressions.length; i++) {
+ reinterpretExpressionAsPattern(expressions[i]);
+ }
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expressions
+ };
+ }
+
+ expressions.push(inheritCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+
+ expect(')');
+
+ if (match('=>')) {
+ if (expr.type === Syntax.Identifier && expr.name === 'yield') {
+ return {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: [expr]
+ };
+ }
+
+ if (!isBindingElement) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (expr.type === Syntax.SequenceExpression) {
+ for (i = 0; i < expr.expressions.length; i++) {
+ reinterpretExpressionAsPattern(expr.expressions[i]);
+ }
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ expr = {
+ type: PlaceHolders.ArrowParameterPlaceHolder,
+ params: expr.type === Syntax.SequenceExpression ? expr.expressions : [expr]
+ };
+ }
+ isBindingElement = false;
+ return expr;
+ }
+
+
+ // ECMA-262 12.2 Primary Expressions
+
+ function parsePrimaryExpression() {
+ var type, token, expr, node;
+
+ if (match('(')) {
+ isBindingElement = false;
+ return inheritCoverGrammar(parseGroupExpression);
+ }
+
+ if (match('[')) {
+ return inheritCoverGrammar(parseArrayInitializer);
+ }
+
+ if (match('{')) {
+ return inheritCoverGrammar(parseObjectInitializer);
+ }
+
+ type = lookahead.type;
+ node = new Node();
+
+ if (type === Token.Identifier) {
+ if (sourceType === 'module' && lookahead.value === 'await') {
+ tolerateUnexpectedToken(lookahead);
+ }
+ expr = node.finishIdentifier(lex().value);
+ } else if (type === Token.StringLiteral || type === Token.NumericLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ if (strict && lookahead.octal) {
+ tolerateUnexpectedToken(lookahead, Messages.StrictOctalLiteral);
+ }
+ expr = node.finishLiteral(lex());
+ } else if (type === Token.Keyword) {
+ if (!strict && state.allowYield && matchKeyword('yield')) {
+ return parseNonComputedProperty();
+ }
+ isAssignmentTarget = isBindingElement = false;
+ if (matchKeyword('function')) {
+ return parseFunctionExpression();
+ }
+ if (matchKeyword('this')) {
+ lex();
+ return node.finishThisExpression();
+ }
+ if (matchKeyword('class')) {
+ return parseClassExpression();
+ }
+ throwUnexpectedToken(lex());
+ } else if (type === Token.BooleanLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = (token.value === 'true');
+ expr = node.finishLiteral(token);
+ } else if (type === Token.NullLiteral) {
+ isAssignmentTarget = isBindingElement = false;
+ token = lex();
+ token.value = null;
+ expr = node.finishLiteral(token);
+ } else if (match('/') || match('/=')) {
+ isAssignmentTarget = isBindingElement = false;
+ index = startIndex;
+
+ if (typeof extra.tokens !== 'undefined') {
+ token = collectRegex();
+ } else {
+ token = scanRegExp();
+ }
+ lex();
+ expr = node.finishLiteral(token);
+ } else if (type === Token.Template) {
+ expr = parseTemplateLiteral();
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.3 Left-Hand-Side Expressions
+
+ function parseArguments() {
+ var args = [], expr;
+
+ expect('(');
+
+ if (!match(')')) {
+ while (startIndex < length) {
+ if (match('...')) {
+ expr = new Node();
+ lex();
+ expr.finishSpreadElement(isolateCoverGrammar(parseAssignmentExpression));
+ } else {
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+ }
+ args.push(expr);
+ if (match(')')) {
+ break;
+ }
+ expectCommaSeparator();
+ }
+ }
+
+ expect(')');
+
+ return args;
+ }
+
+ function parseNonComputedProperty() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (!isIdentifierName(token)) {
+ throwUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseNonComputedMember() {
+ expect('.');
+
+ return parseNonComputedProperty();
+ }
+
+ function parseComputedMember() {
+ var expr;
+
+ expect('[');
+
+ expr = isolateCoverGrammar(parseExpression);
+
+ expect(']');
+
+ return expr;
+ }
+
+ // ECMA-262 12.3.3 The new Operator
+
+ function parseNewExpression() {
+ var callee, args, node = new Node();
+
+ expectKeyword('new');
+
+ if (match('.')) {
+ lex();
+ if (lookahead.type === Token.Identifier && lookahead.value === 'target') {
+ if (state.inFunctionBody) {
+ lex();
+ return node.finishMetaProperty('new', 'target');
+ }
+ }
+ throwUnexpectedToken(lookahead);
+ }
+
+ callee = isolateCoverGrammar(parseLeftHandSideExpression);
+ args = match('(') ? parseArguments() : [];
+
+ isAssignmentTarget = isBindingElement = false;
+
+ return node.finishNewExpression(callee, args);
+ }
+
+ // ECMA-262 12.3.4 Function Calls
+
+ function parseLeftHandSideExpressionAllowCall() {
+ var quasi, expr, args, property, startToken, previousAllowIn = state.allowIn;
+
+ startToken = lookahead;
+ state.allowIn = true;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('(') && !match('.') && !match('[')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (match('(')) {
+ isBindingElement = false;
+ isAssignmentTarget = false;
+ args = parseArguments();
+ expr = new WrappingNode(startToken).finishCallExpression(expr, args);
+ } else if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ state.allowIn = previousAllowIn;
+
+ return expr;
+ }
+
+ // ECMA-262 12.3 Left-Hand-Side Expressions
+
+ function parseLeftHandSideExpression() {
+ var quasi, expr, property, startToken;
+ assert(state.allowIn, 'callee of new expression always allow in keyword.');
+
+ startToken = lookahead;
+
+ if (matchKeyword('super') && state.inFunctionBody) {
+ expr = new Node();
+ lex();
+ expr = expr.finishSuper();
+ if (!match('[') && !match('.')) {
+ throwUnexpectedToken(lookahead);
+ }
+ } else {
+ expr = inheritCoverGrammar(matchKeyword('new') ? parseNewExpression : parsePrimaryExpression);
+ }
+
+ for (;;) {
+ if (match('[')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('[', expr, property);
+ } else if (match('.')) {
+ isBindingElement = false;
+ isAssignmentTarget = true;
+ property = parseNonComputedMember();
+ expr = new WrappingNode(startToken).finishMemberExpression('.', expr, property);
+ } else if (lookahead.type === Token.Template && lookahead.head) {
+ quasi = parseTemplateLiteral();
+ expr = new WrappingNode(startToken).finishTaggedTemplateExpression(expr, quasi);
+ } else {
+ break;
+ }
+ }
+ return expr;
+ }
+
+ // ECMA-262 12.4 Postfix Expressions
+
+ function parsePostfixExpression() {
+ var expr, token, startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseLeftHandSideExpressionAllowCall);
+
+ if (!hasLineTerminator && lookahead.type === Token.Punctuator) {
+ if (match('++') || match('--')) {
+ // ECMA-262 11.3.1, 11.3.2
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPostfix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ isAssignmentTarget = isBindingElement = false;
+
+ token = lex();
+ expr = new WrappingNode(startToken).finishPostfixExpression(token.value, expr);
+ }
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.5 Unary Operators
+
+ function parseUnaryExpression() {
+ var token, expr, startToken;
+
+ if (lookahead.type !== Token.Punctuator && lookahead.type !== Token.Keyword) {
+ expr = parsePostfixExpression();
+ } else if (match('++') || match('--')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ // ECMA-262 11.4.4, 11.4.5
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateError(Messages.StrictLHSPrefix);
+ }
+
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (match('+') || match('-') || match('~') || match('!')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ isAssignmentTarget = isBindingElement = false;
+ } else if (matchKeyword('delete') || matchKeyword('void') || matchKeyword('typeof')) {
+ startToken = lookahead;
+ token = lex();
+ expr = inheritCoverGrammar(parseUnaryExpression);
+ expr = new WrappingNode(startToken).finishUnaryExpression(token.value, expr);
+ if (strict && expr.operator === 'delete' && expr.argument.type === Syntax.Identifier) {
+ tolerateError(Messages.StrictDelete);
+ }
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ expr = parsePostfixExpression();
+ }
+
+ return expr;
+ }
+
+ function binaryPrecedence(token, allowIn) {
+ var prec = 0;
+
+ if (token.type !== Token.Punctuator && token.type !== Token.Keyword) {
+ return 0;
+ }
+
+ switch (token.value) {
+ case '||':
+ prec = 1;
+ break;
+
+ case '&&':
+ prec = 2;
+ break;
+
+ case '|':
+ prec = 3;
+ break;
+
+ case '^':
+ prec = 4;
+ break;
+
+ case '&':
+ prec = 5;
+ break;
+
+ case '==':
+ case '!=':
+ case '===':
+ case '!==':
+ prec = 6;
+ break;
+
+ case '<':
+ case '>':
+ case '<=':
+ case '>=':
+ case 'instanceof':
+ prec = 7;
+ break;
+
+ case 'in':
+ prec = allowIn ? 7 : 0;
+ break;
+
+ case '<<':
+ case '>>':
+ case '>>>':
+ prec = 8;
+ break;
+
+ case '+':
+ case '-':
+ prec = 9;
+ break;
+
+ case '*':
+ case '/':
+ case '%':
+ prec = 11;
+ break;
+
+ default:
+ break;
+ }
+
+ return prec;
+ }
+
+ // ECMA-262 12.6 Multiplicative Operators
+ // ECMA-262 12.7 Additive Operators
+ // ECMA-262 12.8 Bitwise Shift Operators
+ // ECMA-262 12.9 Relational Operators
+ // ECMA-262 12.10 Equality Operators
+ // ECMA-262 12.11 Binary Bitwise Operators
+ // ECMA-262 12.12 Binary Logical Operators
+
+ function parseBinaryExpression() {
+ var marker, markers, expr, token, prec, stack, right, operator, left, i;
+
+ marker = lookahead;
+ left = inheritCoverGrammar(parseUnaryExpression);
+
+ token = lookahead;
+ prec = binaryPrecedence(token, state.allowIn);
+ if (prec === 0) {
+ return left;
+ }
+ isAssignmentTarget = isBindingElement = false;
+ token.prec = prec;
+ lex();
+
+ markers = [marker, lookahead];
+ right = isolateCoverGrammar(parseUnaryExpression);
+
+ stack = [left, token, right];
+
+ while ((prec = binaryPrecedence(lookahead, state.allowIn)) > 0) {
+
+ // Reduce: make a binary expression from the three topmost entries.
+ while ((stack.length > 2) && (prec <= stack[stack.length - 2].prec)) {
+ right = stack.pop();
+ operator = stack.pop().value;
+ left = stack.pop();
+ markers.pop();
+ expr = new WrappingNode(markers[markers.length - 1]).finishBinaryExpression(operator, left, right);
+ stack.push(expr);
+ }
+
+ // Shift.
+ token = lex();
+ token.prec = prec;
+ stack.push(token);
+ markers.push(lookahead);
+ expr = isolateCoverGrammar(parseUnaryExpression);
+ stack.push(expr);
+ }
+
+ // Final reduce to clean-up the stack.
+ i = stack.length - 1;
+ expr = stack[i];
+ markers.pop();
+ while (i > 1) {
+ expr = new WrappingNode(markers.pop()).finishBinaryExpression(stack[i - 1].value, stack[i - 2], expr);
+ i -= 2;
+ }
+
+ return expr;
+ }
+
+
+ // ECMA-262 12.13 Conditional Operator
+
+ function parseConditionalExpression() {
+ var expr, previousAllowIn, consequent, alternate, startToken;
+
+ startToken = lookahead;
+
+ expr = inheritCoverGrammar(parseBinaryExpression);
+ if (match('?')) {
+ lex();
+ previousAllowIn = state.allowIn;
+ state.allowIn = true;
+ consequent = isolateCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+ expect(':');
+ alternate = isolateCoverGrammar(parseAssignmentExpression);
+
+ expr = new WrappingNode(startToken).finishConditionalExpression(expr, consequent, alternate);
+ isAssignmentTarget = isBindingElement = false;
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 14.2 Arrow Function Definitions
+
+ function parseConciseBody() {
+ if (match('{')) {
+ return parseFunctionSourceElements();
+ }
+ return isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ function checkPatternParam(options, param) {
+ var i;
+ switch (param.type) {
+ case Syntax.Identifier:
+ validateParam(options, param, param.name);
+ break;
+ case Syntax.RestElement:
+ checkPatternParam(options, param.argument);
+ break;
+ case Syntax.AssignmentPattern:
+ checkPatternParam(options, param.left);
+ break;
+ case Syntax.ArrayPattern:
+ for (i = 0; i < param.elements.length; i++) {
+ if (param.elements[i] !== null) {
+ checkPatternParam(options, param.elements[i]);
+ }
+ }
+ break;
+ case Syntax.YieldExpression:
+ break;
+ default:
+ assert(param.type === Syntax.ObjectPattern, 'Invalid type');
+ for (i = 0; i < param.properties.length; i++) {
+ checkPatternParam(options, param.properties[i].value);
+ }
+ break;
+ }
+ }
+ function reinterpretAsCoverFormalsList(expr) {
+ var i, len, param, params, defaults, defaultCount, options, token;
+
+ defaults = [];
+ defaultCount = 0;
+ params = [expr];
+
+ switch (expr.type) {
+ case Syntax.Identifier:
+ break;
+ case PlaceHolders.ArrowParameterPlaceHolder:
+ params = expr.params;
+ break;
+ default:
+ return null;
+ }
+
+ options = {
+ paramSet: {}
+ };
+
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ switch (param.type) {
+ case Syntax.AssignmentPattern:
+ params[i] = param.left;
+ if (param.right.type === Syntax.YieldExpression) {
+ if (param.right.argument) {
+ throwUnexpectedToken(lookahead);
+ }
+ param.right.type = Syntax.Identifier;
+ param.right.name = 'yield';
+ delete param.right.argument;
+ delete param.right.delegate;
+ }
+ defaults.push(param.right);
+ ++defaultCount;
+ checkPatternParam(options, param.left);
+ break;
+ default:
+ checkPatternParam(options, param);
+ params[i] = param;
+ defaults.push(null);
+ break;
+ }
+ }
+
+ if (strict || !state.allowYield) {
+ for (i = 0, len = params.length; i < len; i += 1) {
+ param = params[i];
+ if (param.type === Syntax.YieldExpression) {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+
+ if (options.message === Messages.StrictParamDupe) {
+ token = strict ? options.stricted : options.firstRestricted;
+ throwUnexpectedToken(token, options.message);
+ }
+
+ if (defaultCount === 0) {
+ defaults = [];
+ }
+
+ return {
+ params: params,
+ defaults: defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseArrowFunctionExpression(options, node) {
+ var previousStrict, previousAllowYield, body;
+
+ if (hasLineTerminator) {
+ tolerateUnexpectedToken(lookahead);
+ }
+ expect('=>');
+
+ previousStrict = strict;
+ previousAllowYield = state.allowYield;
+ state.allowYield = true;
+
+ body = parseConciseBody();
+
+ if (strict && options.firstRestricted) {
+ throwUnexpectedToken(options.firstRestricted, options.message);
+ }
+ if (strict && options.stricted) {
+ tolerateUnexpectedToken(options.stricted, options.message);
+ }
+
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishArrowFunctionExpression(options.params, options.defaults, body, body.type !== Syntax.BlockStatement);
+ }
+
+ // ECMA-262 14.4 Yield expression
+
+ function parseYieldExpression() {
+ var argument, expr, delegate, previousAllowYield;
+
+ argument = null;
+ expr = new Node();
+
+ expectKeyword('yield');
+
+ if (!hasLineTerminator) {
+ previousAllowYield = state.allowYield;
+ state.allowYield = false;
+ delegate = match('*');
+ if (delegate) {
+ lex();
+ argument = parseAssignmentExpression();
+ } else {
+ if (!match(';') && !match('}') && !match(')') && lookahead.type !== Token.EOF) {
+ argument = parseAssignmentExpression();
+ }
+ }
+ state.allowYield = previousAllowYield;
+ }
+
+ return expr.finishYieldExpression(argument, delegate);
+ }
+
+ // ECMA-262 12.14 Assignment Operators
+
+ function parseAssignmentExpression() {
+ var token, expr, right, list, startToken;
+
+ startToken = lookahead;
+ token = lookahead;
+
+ if (!state.allowYield && matchKeyword('yield')) {
+ return parseYieldExpression();
+ }
+
+ expr = parseConditionalExpression();
+
+ if (expr.type === PlaceHolders.ArrowParameterPlaceHolder || match('=>')) {
+ isAssignmentTarget = isBindingElement = false;
+ list = reinterpretAsCoverFormalsList(expr);
+
+ if (list) {
+ firstCoverInitializedNameError = null;
+ return parseArrowFunctionExpression(list, new WrappingNode(startToken));
+ }
+
+ return expr;
+ }
+
+ if (matchAssign()) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInAssignment);
+ }
+
+ // ECMA-262 11.13.1
+ if (strict && expr.type === Syntax.Identifier && isRestrictedWord(expr.name)) {
+ tolerateUnexpectedToken(token, Messages.StrictLHSAssignment);
+ }
+
+ if (!match('=')) {
+ isAssignmentTarget = isBindingElement = false;
+ } else {
+ reinterpretExpressionAsPattern(expr);
+ }
+
+ token = lex();
+ right = isolateCoverGrammar(parseAssignmentExpression);
+ expr = new WrappingNode(startToken).finishAssignmentExpression(token.value, expr, right);
+ firstCoverInitializedNameError = null;
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 12.15 Comma Operator
+
+ function parseExpression() {
+ var expr, startToken = lookahead, expressions;
+
+ expr = isolateCoverGrammar(parseAssignmentExpression);
+
+ if (match(',')) {
+ expressions = [expr];
+
+ while (startIndex < length) {
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ expressions.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+
+ expr = new WrappingNode(startToken).finishSequenceExpression(expressions);
+ }
+
+ return expr;
+ }
+
+ // ECMA-262 13.2 Block
+
+ function parseStatementListItem() {
+ if (lookahead.type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'export':
+ if (sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalExportDeclaration);
+ }
+ return parseExportDeclaration();
+ case 'import':
+ if (sourceType !== 'module') {
+ tolerateUnexpectedToken(lookahead, Messages.IllegalImportDeclaration);
+ }
+ return parseImportDeclaration();
+ case 'const':
+ case 'let':
+ return parseLexicalDeclaration({inFor: false});
+ case 'function':
+ return parseFunctionDeclaration(new Node());
+ case 'class':
+ return parseClassDeclaration();
+ }
+ }
+
+ return parseStatement();
+ }
+
+ function parseStatementList() {
+ var list = [];
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ list.push(parseStatementListItem());
+ }
+
+ return list;
+ }
+
+ function parseBlock() {
+ var block, node = new Node();
+
+ expect('{');
+
+ block = parseStatementList();
+
+ expect('}');
+
+ return node.finishBlockStatement(block);
+ }
+
+ // ECMA-262 13.3.2 Variable Statement
+
+ function parseVariableIdentifier() {
+ var token, node = new Node();
+
+ token = lex();
+
+ if (token.type === Token.Keyword && token.value === 'yield') {
+ if (strict) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } if (!state.allowYield) {
+ throwUnexpectedToken(token);
+ }
+ } else if (token.type !== Token.Identifier) {
+ if (strict && token.type === Token.Keyword && isStrictModeReservedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictReservedWord);
+ } else {
+ throwUnexpectedToken(token);
+ }
+ } else if (sourceType === 'module' && token.type === Token.Identifier && token.value === 'await') {
+ tolerateUnexpectedToken(token);
+ }
+
+ return node.finishIdentifier(token.value);
+ }
+
+ function parseVariableDeclaration() {
+ var init = null, id, node = new Node(), params = [];
+
+ id = parsePattern(params);
+
+ // ECMA-262 12.2.1
+ if (strict && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (match('=')) {
+ lex();
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ } else if (id.type !== Syntax.Identifier) {
+ expect('=');
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseVariableDeclarationList() {
+ var list = [];
+
+ do {
+ list.push(parseVariableDeclaration());
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseVariableStatement(node) {
+ var declarations;
+
+ expectKeyword('var');
+
+ declarations = parseVariableDeclarationList();
+
+ consumeSemicolon();
+
+ return node.finishVariableDeclaration(declarations);
+ }
+
+ // ECMA-262 13.3.1 Let and Const Declarations
+
+ function parseLexicalBinding(kind, options) {
+ var init = null, id, node = new Node(), params = [];
+
+ id = parsePattern(params);
+
+ // ECMA-262 12.2.1
+ if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
+ tolerateError(Messages.StrictVarName);
+ }
+
+ if (kind === 'const') {
+ if (!matchKeyword('in') && !matchContextualKeyword('of')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+ } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) {
+ expect('=');
+ init = isolateCoverGrammar(parseAssignmentExpression);
+ }
+
+ return node.finishVariableDeclarator(id, init);
+ }
+
+ function parseBindingList(kind, options) {
+ var list = [];
+
+ do {
+ list.push(parseLexicalBinding(kind, options));
+ if (!match(',')) {
+ break;
+ }
+ lex();
+ } while (startIndex < length);
+
+ return list;
+ }
+
+ function parseLexicalDeclaration(options) {
+ var kind, declarations, node = new Node();
+
+ kind = lex().value;
+ assert(kind === 'let' || kind === 'const', 'Lexical declaration must be either let or const');
+
+ declarations = parseBindingList(kind, options);
+
+ consumeSemicolon();
+
+ return node.finishLexicalDeclaration(declarations, kind);
+ }
+
+ function parseRestElement(params) {
+ var param, node = new Node();
+
+ lex();
+
+ if (match('{')) {
+ throwError(Messages.ObjectPatternAsRestParameter);
+ }
+
+ params.push(lookahead);
+
+ param = parseVariableIdentifier();
+
+ if (match('=')) {
+ throwError(Messages.DefaultRestParameter);
+ }
+
+ if (!match(')')) {
+ throwError(Messages.ParameterAfterRestParameter);
+ }
+
+ return node.finishRestElement(param);
+ }
+
+ // ECMA-262 13.4 Empty Statement
+
+ function parseEmptyStatement(node) {
+ expect(';');
+ return node.finishEmptyStatement();
+ }
+
+ // ECMA-262 12.4 Expression Statement
+
+ function parseExpressionStatement(node) {
+ var expr = parseExpression();
+ consumeSemicolon();
+ return node.finishExpressionStatement(expr);
+ }
+
+ // ECMA-262 13.6 If statement
+
+ function parseIfStatement(node) {
+ var test, consequent, alternate;
+
+ expectKeyword('if');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ consequent = parseStatement();
+
+ if (matchKeyword('else')) {
+ lex();
+ alternate = parseStatement();
+ } else {
+ alternate = null;
+ }
+
+ return node.finishIfStatement(test, consequent, alternate);
+ }
+
+ // ECMA-262 13.7 Iteration Statements
+
+ function parseDoWhileStatement(node) {
+ var body, test, oldInIteration;
+
+ expectKeyword('do');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ if (match(';')) {
+ lex();
+ }
+
+ return node.finishDoWhileStatement(body, test);
+ }
+
+ function parseWhileStatement(node) {
+ var test, body, oldInIteration;
+
+ expectKeyword('while');
+
+ expect('(');
+
+ test = parseExpression();
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = parseStatement();
+
+ state.inIteration = oldInIteration;
+
+ return node.finishWhileStatement(test, body);
+ }
+
+ function parseForStatement(node) {
+ var init, forIn, initSeq, initStartToken, test, update, left, right, kind, declarations,
+ body, oldInIteration, previousAllowIn = state.allowIn;
+
+ init = test = update = null;
+ forIn = true;
+
+ expectKeyword('for');
+
+ expect('(');
+
+ if (match(';')) {
+ lex();
+ } else {
+ if (matchKeyword('var')) {
+ init = new Node();
+ lex();
+
+ state.allowIn = false;
+ init = init.finishVariableDeclaration(parseVariableDeclarationList());
+ state.allowIn = previousAllowIn;
+
+ if (init.declarations.length === 1 && matchKeyword('in')) {
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (init.declarations.length === 1 && init.declarations[0].init === null && matchContextualKeyword('of')) {
+ lex();
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ expect(';');
+ }
+ } else if (matchKeyword('const') || matchKeyword('let')) {
+ init = new Node();
+ kind = lex().value;
+
+ state.allowIn = false;
+ declarations = parseBindingList(kind, {inFor: true});
+ state.allowIn = previousAllowIn;
+
+ if (declarations.length === 1 && declarations[0].init === null && matchKeyword('in')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (declarations.length === 1 && declarations[0].init === null && matchContextualKeyword('of')) {
+ init = init.finishLexicalDeclaration(declarations, kind);
+ lex();
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ consumeSemicolon();
+ init = init.finishLexicalDeclaration(declarations, kind);
+ }
+ } else {
+ initStartToken = lookahead;
+ state.allowIn = false;
+ init = inheritCoverGrammar(parseAssignmentExpression);
+ state.allowIn = previousAllowIn;
+
+ if (matchKeyword('in')) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInForIn);
+ }
+
+ lex();
+ reinterpretExpressionAsPattern(init);
+ left = init;
+ right = parseExpression();
+ init = null;
+ } else if (matchContextualKeyword('of')) {
+ if (!isAssignmentTarget) {
+ tolerateError(Messages.InvalidLHSInForLoop);
+ }
+
+ lex();
+ reinterpretExpressionAsPattern(init);
+ left = init;
+ right = parseAssignmentExpression();
+ init = null;
+ forIn = false;
+ } else {
+ if (match(',')) {
+ initSeq = [init];
+ while (match(',')) {
+ lex();
+ initSeq.push(isolateCoverGrammar(parseAssignmentExpression));
+ }
+ init = new WrappingNode(initStartToken).finishSequenceExpression(initSeq);
+ }
+ expect(';');
+ }
+ }
+ }
+
+ if (typeof left === 'undefined') {
+
+ if (!match(';')) {
+ test = parseExpression();
+ }
+ expect(';');
+
+ if (!match(')')) {
+ update = parseExpression();
+ }
+ }
+
+ expect(')');
+
+ oldInIteration = state.inIteration;
+ state.inIteration = true;
+
+ body = isolateCoverGrammar(parseStatement);
+
+ state.inIteration = oldInIteration;
+
+ return (typeof left === 'undefined') ?
+ node.finishForStatement(init, test, update, body) :
+ forIn ? node.finishForInStatement(left, right, body) :
+ node.finishForOfStatement(left, right, body);
+ }
+
+ // ECMA-262 13.8 The continue statement
+
+ function parseContinueStatement(node) {
+ var label = null, key;
+
+ expectKeyword('continue');
+
+ // Optimize the most common form: 'continue;'.
+ if (source.charCodeAt(startIndex) === 0x3B) {
+ lex();
+
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !state.inIteration) {
+ throwError(Messages.IllegalContinue);
+ }
+
+ return node.finishContinueStatement(label);
+ }
+
+ // ECMA-262 13.9 The break statement
+
+ function parseBreakStatement(node) {
+ var label = null, key;
+
+ expectKeyword('break');
+
+ // Catch the very common case first: immediately a semicolon (U+003B).
+ if (source.charCodeAt(lastIndex) === 0x3B) {
+ lex();
+
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (hasLineTerminator) {
+ if (!(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(null);
+ }
+
+ if (lookahead.type === Token.Identifier) {
+ label = parseVariableIdentifier();
+
+ key = '$' + label.name;
+ if (!Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.UnknownLabel, label.name);
+ }
+ }
+
+ consumeSemicolon();
+
+ if (label === null && !(state.inIteration || state.inSwitch)) {
+ throwError(Messages.IllegalBreak);
+ }
+
+ return node.finishBreakStatement(label);
+ }
+
+ // ECMA-262 13.10 The return statement
+
+ function parseReturnStatement(node) {
+ var argument = null;
+
+ expectKeyword('return');
+
+ if (!state.inFunctionBody) {
+ tolerateError(Messages.IllegalReturn);
+ }
+
+ // 'return' followed by a space and an identifier is very common.
+ if (source.charCodeAt(lastIndex) === 0x20) {
+ if (isIdentifierStart(source.charCodeAt(lastIndex + 1))) {
+ argument = parseExpression();
+ consumeSemicolon();
+ return node.finishReturnStatement(argument);
+ }
+ }
+
+ if (hasLineTerminator) {
+ // HACK
+ return node.finishReturnStatement(null);
+ }
+
+ if (!match(';')) {
+ if (!match('}') && lookahead.type !== Token.EOF) {
+ argument = parseExpression();
+ }
+ }
+
+ consumeSemicolon();
+
+ return node.finishReturnStatement(argument);
+ }
+
+ // ECMA-262 13.11 The with statement
+
+ function parseWithStatement(node) {
+ var object, body;
+
+ if (strict) {
+ tolerateError(Messages.StrictModeWith);
+ }
+
+ expectKeyword('with');
+
+ expect('(');
+
+ object = parseExpression();
+
+ expect(')');
+
+ body = parseStatement();
+
+ return node.finishWithStatement(object, body);
+ }
+
+ // ECMA-262 13.12 The switch statement
+
+ function parseSwitchCase() {
+ var test, consequent = [], statement, node = new Node();
+
+ if (matchKeyword('default')) {
+ lex();
+ test = null;
+ } else {
+ expectKeyword('case');
+ test = parseExpression();
+ }
+ expect(':');
+
+ while (startIndex < length) {
+ if (match('}') || matchKeyword('default') || matchKeyword('case')) {
+ break;
+ }
+ statement = parseStatementListItem();
+ consequent.push(statement);
+ }
+
+ return node.finishSwitchCase(test, consequent);
+ }
+
+ function parseSwitchStatement(node) {
+ var discriminant, cases, clause, oldInSwitch, defaultFound;
+
+ expectKeyword('switch');
+
+ expect('(');
+
+ discriminant = parseExpression();
+
+ expect(')');
+
+ expect('{');
+
+ cases = [];
+
+ if (match('}')) {
+ lex();
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ oldInSwitch = state.inSwitch;
+ state.inSwitch = true;
+ defaultFound = false;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ clause = parseSwitchCase();
+ if (clause.test === null) {
+ if (defaultFound) {
+ throwError(Messages.MultipleDefaultsInSwitch);
+ }
+ defaultFound = true;
+ }
+ cases.push(clause);
+ }
+
+ state.inSwitch = oldInSwitch;
+
+ expect('}');
+
+ return node.finishSwitchStatement(discriminant, cases);
+ }
+
+ // ECMA-262 13.14 The throw statement
+
+ function parseThrowStatement(node) {
+ var argument;
+
+ expectKeyword('throw');
+
+ if (hasLineTerminator) {
+ throwError(Messages.NewlineAfterThrow);
+ }
+
+ argument = parseExpression();
+
+ consumeSemicolon();
+
+ return node.finishThrowStatement(argument);
+ }
+
+ // ECMA-262 13.15 The try statement
+
+ function parseCatchClause() {
+ var param, params = [], paramMap = {}, key, i, body, node = new Node();
+
+ expectKeyword('catch');
+
+ expect('(');
+ if (match(')')) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ param = parsePattern(params);
+ for (i = 0; i < params.length; i++) {
+ key = '$' + params[i].value;
+ if (Object.prototype.hasOwnProperty.call(paramMap, key)) {
+ tolerateError(Messages.DuplicateBinding, params[i].value);
+ }
+ paramMap[key] = true;
+ }
+
+ // ECMA-262 12.14.1
+ if (strict && isRestrictedWord(param.name)) {
+ tolerateError(Messages.StrictCatchVariable);
+ }
+
+ expect(')');
+ body = parseBlock();
+ return node.finishCatchClause(param, body);
+ }
+
+ function parseTryStatement(node) {
+ var block, handler = null, finalizer = null;
+
+ expectKeyword('try');
+
+ block = parseBlock();
+
+ if (matchKeyword('catch')) {
+ handler = parseCatchClause();
+ }
+
+ if (matchKeyword('finally')) {
+ lex();
+ finalizer = parseBlock();
+ }
+
+ if (!handler && !finalizer) {
+ throwError(Messages.NoCatchOrFinally);
+ }
+
+ return node.finishTryStatement(block, handler, finalizer);
+ }
+
+ // ECMA-262 13.16 The debugger statement
+
+ function parseDebuggerStatement(node) {
+ expectKeyword('debugger');
+
+ consumeSemicolon();
+
+ return node.finishDebuggerStatement();
+ }
+
+ // 13 Statements
+
+ function parseStatement() {
+ var type = lookahead.type,
+ expr,
+ labeledBody,
+ key,
+ node;
+
+ if (type === Token.EOF) {
+ throwUnexpectedToken(lookahead);
+ }
+
+ if (type === Token.Punctuator && lookahead.value === '{') {
+ return parseBlock();
+ }
+ isAssignmentTarget = isBindingElement = true;
+ node = new Node();
+
+ if (type === Token.Punctuator) {
+ switch (lookahead.value) {
+ case ';':
+ return parseEmptyStatement(node);
+ case '(':
+ return parseExpressionStatement(node);
+ default:
+ break;
+ }
+ } else if (type === Token.Keyword) {
+ switch (lookahead.value) {
+ case 'break':
+ return parseBreakStatement(node);
+ case 'continue':
+ return parseContinueStatement(node);
+ case 'debugger':
+ return parseDebuggerStatement(node);
+ case 'do':
+ return parseDoWhileStatement(node);
+ case 'for':
+ return parseForStatement(node);
+ case 'function':
+ return parseFunctionDeclaration(node);
+ case 'if':
+ return parseIfStatement(node);
+ case 'return':
+ return parseReturnStatement(node);
+ case 'switch':
+ return parseSwitchStatement(node);
+ case 'throw':
+ return parseThrowStatement(node);
+ case 'try':
+ return parseTryStatement(node);
+ case 'var':
+ return parseVariableStatement(node);
+ case 'while':
+ return parseWhileStatement(node);
+ case 'with':
+ return parseWithStatement(node);
+ default:
+ break;
+ }
+ }
+
+ expr = parseExpression();
+
+ // ECMA-262 12.12 Labelled Statements
+ if ((expr.type === Syntax.Identifier) && match(':')) {
+ lex();
+
+ key = '$' + expr.name;
+ if (Object.prototype.hasOwnProperty.call(state.labelSet, key)) {
+ throwError(Messages.Redeclaration, 'Label', expr.name);
+ }
+
+ state.labelSet[key] = true;
+ labeledBody = parseStatement();
+ delete state.labelSet[key];
+ return node.finishLabeledStatement(expr, labeledBody);
+ }
+
+ consumeSemicolon();
+
+ return node.finishExpressionStatement(expr);
+ }
+
+ // ECMA-262 14.1 Function Definition
+
+ function parseFunctionSourceElements() {
+ var statement, body = [], token, directive, firstRestricted,
+ oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
+ node = new Node();
+
+ expect('{');
+
+ while (startIndex < length) {
+ if (lookahead.type !== Token.StringLiteral) {
+ break;
+ }
+ token = lookahead;
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ oldLabelSet = state.labelSet;
+ oldInIteration = state.inIteration;
+ oldInSwitch = state.inSwitch;
+ oldInFunctionBody = state.inFunctionBody;
+ oldParenthesisCount = state.parenthesizedCount;
+
+ state.labelSet = {};
+ state.inIteration = false;
+ state.inSwitch = false;
+ state.inFunctionBody = true;
+ state.parenthesizedCount = 0;
+
+ while (startIndex < length) {
+ if (match('}')) {
+ break;
+ }
+ body.push(parseStatementListItem());
+ }
+
+ expect('}');
+
+ state.labelSet = oldLabelSet;
+ state.inIteration = oldInIteration;
+ state.inSwitch = oldInSwitch;
+ state.inFunctionBody = oldInFunctionBody;
+ state.parenthesizedCount = oldParenthesisCount;
+
+ return node.finishBlockStatement(body);
+ }
+
+ function validateParam(options, param, name) {
+ var key = '$' + name;
+ if (strict) {
+ if (isRestrictedWord(name)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamName;
+ }
+ if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ } else if (!options.firstRestricted) {
+ if (isRestrictedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictParamName;
+ } else if (isStrictModeReservedWord(name)) {
+ options.firstRestricted = param;
+ options.message = Messages.StrictReservedWord;
+ } else if (Object.prototype.hasOwnProperty.call(options.paramSet, key)) {
+ options.stricted = param;
+ options.message = Messages.StrictParamDupe;
+ }
+ }
+ options.paramSet[key] = true;
+ }
+
+ function parseParam(options) {
+ var token, param, params = [], i, def;
+
+ token = lookahead;
+ if (token.value === '...') {
+ param = parseRestElement(params);
+ validateParam(options, param.argument, param.argument.name);
+ options.params.push(param);
+ options.defaults.push(null);
+ return false;
+ }
+
+ param = parsePatternWithDefault(params);
+ for (i = 0; i < params.length; i++) {
+ validateParam(options, params[i], params[i].value);
+ }
+
+ if (param.type === Syntax.AssignmentPattern) {
+ def = param.right;
+ param = param.left;
+ ++options.defaultCount;
+ }
+
+ options.params.push(param);
+ options.defaults.push(def);
+
+ return !match(')');
+ }
+
+ function parseParams(firstRestricted) {
+ var options;
+
+ options = {
+ params: [],
+ defaultCount: 0,
+ defaults: [],
+ firstRestricted: firstRestricted
+ };
+
+ expect('(');
+
+ if (!match(')')) {
+ options.paramSet = {};
+ while (startIndex < length) {
+ if (!parseParam(options)) {
+ break;
+ }
+ expect(',');
+ }
+ }
+
+ expect(')');
+
+ if (options.defaultCount === 0) {
+ options.defaults = [];
+ }
+
+ return {
+ params: options.params,
+ defaults: options.defaults,
+ stricted: options.stricted,
+ firstRestricted: options.firstRestricted,
+ message: options.message
+ };
+ }
+
+ function parseFunctionDeclaration(node, identifierIsOptional) {
+ var id = null, params = [], defaults = [], body, token, stricted, tmp, firstRestricted, message, previousStrict,
+ isGenerator, previousAllowYield;
+
+ previousAllowYield = state.allowYield;
+
+ expectKeyword('function');
+
+ isGenerator = match('*');
+ if (isGenerator) {
+ lex();
+ }
+
+ if (!identifierIsOptional || !match('(')) {
+ token = lookahead;
+ id = parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ state.allowYield = !isGenerator;
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishFunctionDeclaration(id, params, defaults, body, isGenerator);
+ }
+
+ function parseFunctionExpression() {
+ var token, id = null, stricted, firstRestricted, message, tmp,
+ params = [], defaults = [], body, previousStrict, node = new Node(),
+ isGenerator, previousAllowYield;
+
+ previousAllowYield = state.allowYield;
+
+ expectKeyword('function');
+
+ isGenerator = match('*');
+ if (isGenerator) {
+ lex();
+ }
+
+ state.allowYield = !isGenerator;
+ if (!match('(')) {
+ token = lookahead;
+ id = (!strict && !isGenerator && matchKeyword('yield')) ? parseNonComputedProperty() : parseVariableIdentifier();
+ if (strict) {
+ if (isRestrictedWord(token.value)) {
+ tolerateUnexpectedToken(token, Messages.StrictFunctionName);
+ }
+ } else {
+ if (isRestrictedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictFunctionName;
+ } else if (isStrictModeReservedWord(token.value)) {
+ firstRestricted = token;
+ message = Messages.StrictReservedWord;
+ }
+ }
+ }
+
+ tmp = parseParams(firstRestricted);
+ params = tmp.params;
+ defaults = tmp.defaults;
+ stricted = tmp.stricted;
+ firstRestricted = tmp.firstRestricted;
+ if (tmp.message) {
+ message = tmp.message;
+ }
+
+ previousStrict = strict;
+ body = parseFunctionSourceElements();
+ if (strict && firstRestricted) {
+ throwUnexpectedToken(firstRestricted, message);
+ }
+ if (strict && stricted) {
+ tolerateUnexpectedToken(stricted, message);
+ }
+ strict = previousStrict;
+ state.allowYield = previousAllowYield;
+
+ return node.finishFunctionExpression(id, params, defaults, body, isGenerator);
+ }
+
+ // ECMA-262 14.5 Class Definitions
+
+ function parseClassBody() {
+ var classBody, token, isStatic, hasConstructor = false, body, method, computed, key;
+
+ classBody = new Node();
+
+ expect('{');
+ body = [];
+ while (!match('}')) {
+ if (match(';')) {
+ lex();
+ } else {
+ method = new Node();
+ token = lookahead;
+ isStatic = false;
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ if (key.name === 'static' && (lookaheadPropertyName() || match('*'))) {
+ token = lookahead;
+ isStatic = true;
+ computed = match('[');
+ if (match('*')) {
+ lex();
+ } else {
+ key = parseObjectPropertyKey();
+ }
+ }
+ }
+ method = tryParseMethodDefinition(token, key, computed, method);
+ if (method) {
+ method['static'] = isStatic; // jscs:ignore requireDotNotation
+ if (method.kind === 'init') {
+ method.kind = 'method';
+ }
+ if (!isStatic) {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'constructor') {
+ if (method.kind !== 'method' || !method.method || method.value.generator) {
+ throwUnexpectedToken(token, Messages.ConstructorSpecialMethod);
+ }
+ if (hasConstructor) {
+ throwUnexpectedToken(token, Messages.DuplicateConstructor);
+ } else {
+ hasConstructor = true;
+ }
+ method.kind = 'constructor';
+ }
+ } else {
+ if (!method.computed && (method.key.name || method.key.value.toString()) === 'prototype') {
+ throwUnexpectedToken(token, Messages.StaticPrototype);
+ }
+ }
+ method.type = Syntax.MethodDefinition;
+ delete method.method;
+ delete method.shorthand;
+ body.push(method);
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ }
+ lex();
+ return classBody.finishClassBody(body);
+ }
+
+ function parseClassDeclaration(identifierIsOptional) {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (!identifierIsOptional || lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassDeclaration(id, superClass, classBody);
+ }
+
+ function parseClassExpression() {
+ var id = null, superClass = null, classNode = new Node(), classBody, previousStrict = strict;
+ strict = true;
+
+ expectKeyword('class');
+
+ if (lookahead.type === Token.Identifier) {
+ id = parseVariableIdentifier();
+ }
+
+ if (matchKeyword('extends')) {
+ lex();
+ superClass = isolateCoverGrammar(parseLeftHandSideExpressionAllowCall);
+ }
+ classBody = parseClassBody();
+ strict = previousStrict;
+
+ return classNode.finishClassExpression(id, superClass, classBody);
+ }
+
+ // ECMA-262 15.2 Modules
+
+ function parseModuleSpecifier() {
+ var node = new Node();
+
+ if (lookahead.type !== Token.StringLiteral) {
+ throwError(Messages.InvalidModuleSpecifier);
+ }
+ return node.finishLiteral(lex());
+ }
+
+ // ECMA-262 15.2.3 Exports
+
+ function parseExportSpecifier() {
+ var exported, local, node = new Node(), def;
+ if (matchKeyword('default')) {
+ // export {default} from 'something';
+ def = new Node();
+ lex();
+ local = def.finishIdentifier('default');
+ } else {
+ local = parseVariableIdentifier();
+ }
+ if (matchContextualKeyword('as')) {
+ lex();
+ exported = parseNonComputedProperty();
+ }
+ return node.finishExportSpecifier(local, exported);
+ }
+
+ function parseExportNamedDeclaration(node) {
+ var declaration = null,
+ isExportFromIdentifier,
+ src = null, specifiers = [];
+
+ // non-default export
+ if (lookahead.type === Token.Keyword) {
+ // covers:
+ // export var f = 1;
+ switch (lookahead.value) {
+ case 'let':
+ case 'const':
+ case 'var':
+ case 'class':
+ case 'function':
+ declaration = parseStatementListItem();
+ return node.finishExportNamedDeclaration(declaration, specifiers, null);
+ }
+ }
+
+ expect('{');
+ while (!match('}')) {
+ isExportFromIdentifier = isExportFromIdentifier || matchKeyword('default');
+ specifiers.push(parseExportSpecifier());
+ if (!match('}')) {
+ expect(',');
+ if (match('}')) {
+ break;
+ }
+ }
+ }
+ expect('}');
+
+ if (matchContextualKeyword('from')) {
+ // covering:
+ // export {default} from 'foo';
+ // export {foo} from 'foo';
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+ } else if (isExportFromIdentifier) {
+ // covering:
+ // export {default}; // missing fromClause
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ } else {
+ // cover
+ // export {foo};
+ consumeSemicolon();
+ }
+ return node.finishExportNamedDeclaration(declaration, specifiers, src);
+ }
+
+ function parseExportDefaultDeclaration(node) {
+ var declaration = null,
+ expression = null;
+
+ // covers:
+ // export default ...
+ expectKeyword('default');
+
+ if (matchKeyword('function')) {
+ // covers:
+ // export default function foo () {}
+ // export default function () {}
+ declaration = parseFunctionDeclaration(new Node(), true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+ if (matchKeyword('class')) {
+ declaration = parseClassDeclaration(true);
+ return node.finishExportDefaultDeclaration(declaration);
+ }
+
+ if (matchContextualKeyword('from')) {
+ throwError(Messages.UnexpectedToken, lookahead.value);
+ }
+
+ // covers:
+ // export default {};
+ // export default [];
+ // export default (1 + 2);
+ if (match('{')) {
+ expression = parseObjectInitializer();
+ } else if (match('[')) {
+ expression = parseArrayInitializer();
+ } else {
+ expression = parseAssignmentExpression();
+ }
+ consumeSemicolon();
+ return node.finishExportDefaultDeclaration(expression);
+ }
+
+ function parseExportAllDeclaration(node) {
+ var src;
+
+ // covers:
+ // export * from 'foo';
+ expect('*');
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ consumeSemicolon();
+
+ return node.finishExportAllDeclaration(src);
+ }
+
+ function parseExportDeclaration() {
+ var node = new Node();
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalExportDeclaration);
+ }
+
+ expectKeyword('export');
+
+ if (matchKeyword('default')) {
+ return parseExportDefaultDeclaration(node);
+ }
+ if (match('*')) {
+ return parseExportAllDeclaration(node);
+ }
+ return parseExportNamedDeclaration(node);
+ }
+
+ // ECMA-262 15.2.2 Imports
+
+ function parseImportSpecifier() {
+ // import {<foo as bar>} ...;
+ var local, imported, node = new Node();
+
+ imported = parseNonComputedProperty();
+ if (matchContextualKeyword('as')) {
+ lex();
+ local = parseVariableIdentifier();
+ }
+
+ return node.finishImportSpecifier(local, imported);
+ }
+
+ function parseNamedImports() {
+ var specifiers = [];
+ // {foo, bar as bas}
+ expect('{');
+ while (!match('}')) {
+ specifiers.push(parseImportSpecifier());
+ if (!match('}')) {
+ expect(',');
+ if (match('}')) {
+ break;
+ }
+ }
+ }
+ expect('}');
+ return specifiers;
+ }
+
+ function parseImportDefaultSpecifier() {
+ // import <foo> ...;
+ var local, node = new Node();
+
+ local = parseNonComputedProperty();
+
+ return node.finishImportDefaultSpecifier(local);
+ }
+
+ function parseImportNamespaceSpecifier() {
+ // import <* as foo> ...;
+ var local, node = new Node();
+
+ expect('*');
+ if (!matchContextualKeyword('as')) {
+ throwError(Messages.NoAsAfterImportNamespace);
+ }
+ lex();
+ local = parseNonComputedProperty();
+
+ return node.finishImportNamespaceSpecifier(local);
+ }
+
+ function parseImportDeclaration() {
+ var specifiers = [], src, node = new Node();
+
+ if (state.inFunctionBody) {
+ throwError(Messages.IllegalImportDeclaration);
+ }
+
+ expectKeyword('import');
+
+ if (lookahead.type === Token.StringLiteral) {
+ // import 'foo';
+ src = parseModuleSpecifier();
+ } else {
+
+ if (match('{')) {
+ // import {bar}
+ specifiers = specifiers.concat(parseNamedImports());
+ } else if (match('*')) {
+ // import * as foo
+ specifiers.push(parseImportNamespaceSpecifier());
+ } else if (isIdentifierName(lookahead) && !matchKeyword('default')) {
+ // import foo
+ specifiers.push(parseImportDefaultSpecifier());
+ if (match(',')) {
+ lex();
+ if (match('*')) {
+ // import foo, * as foo
+ specifiers.push(parseImportNamespaceSpecifier());
+ } else if (match('{')) {
+ // import foo, {bar}
+ specifiers = specifiers.concat(parseNamedImports());
+ } else {
+ throwUnexpectedToken(lookahead);
+ }
+ }
+ } else {
+ throwUnexpectedToken(lex());
+ }
+
+ if (!matchContextualKeyword('from')) {
+ throwError(lookahead.value ?
+ Messages.UnexpectedToken : Messages.MissingFromClause, lookahead.value);
+ }
+ lex();
+ src = parseModuleSpecifier();
+ }
+
+ consumeSemicolon();
+ return node.finishImportDeclaration(specifiers, src);
+ }
+
+ // ECMA-262 15.1 Scripts
+
+ function parseScriptBody() {
+ var statement, body = [], token, directive, firstRestricted;
+
+ while (startIndex < length) {
+ token = lookahead;
+ if (token.type !== Token.StringLiteral) {
+ break;
+ }
+
+ statement = parseStatementListItem();
+ body.push(statement);
+ if (statement.expression.type !== Syntax.Literal) {
+ // this is not directive
+ break;
+ }
+ directive = source.slice(token.start + 1, token.end - 1);
+ if (directive === 'use strict') {
+ strict = true;
+ if (firstRestricted) {
+ tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
+ }
+ } else {
+ if (!firstRestricted && token.octal) {
+ firstRestricted = token;
+ }
+ }
+ }
+
+ while (startIndex < length) {
+ statement = parseStatementListItem();
+ /* istanbul ignore if */
+ if (typeof statement === 'undefined') {
+ break;
+ }
+ body.push(statement);
+ }
+ return body;
+ }
+
+ function parseProgram() {
+ var body, node;
+
+ peek();
+ node = new Node();
+
+ body = parseScriptBody();
+ return node.finishProgram(body);
+ }
+
+ function filterTokenLocation() {
+ var i, entry, token, tokens = [];
+
+ for (i = 0; i < extra.tokens.length; ++i) {
+ entry = extra.tokens[i];
+ token = {
+ type: entry.type,
+ value: entry.value
+ };
+ if (entry.regex) {
+ token.regex = {
+ pattern: entry.regex.pattern,
+ flags: entry.regex.flags
+ };
+ }
+ if (extra.range) {
+ token.range = entry.range;
+ }
+ if (extra.loc) {
+ token.loc = entry.loc;
+ }
+ tokens.push(token);
+ }
+
+ extra.tokens = tokens;
+ }
+
+ function tokenize(code, options) {
+ var toString,
+ tokens;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ allowYield: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: []
+ };
+
+ extra = {};
+
+ // Options matching.
+ options = options || {};
+
+ // Of course we collect tokens here.
+ options.tokens = true;
+ extra.tokens = [];
+ extra.tokenize = true;
+ // The following two fields are necessary to compute the Regex tokens.
+ extra.openParenToken = -1;
+ extra.openCurlyToken = -1;
+
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+
+ try {
+ peek();
+ if (lookahead.type === Token.EOF) {
+ return extra.tokens;
+ }
+
+ lex();
+ while (lookahead.type !== Token.EOF) {
+ try {
+ lex();
+ } catch (lexError) {
+ if (extra.errors) {
+ recordError(lexError);
+ // We have to break on the first error
+ // to avoid infinite loops.
+ break;
+ } else {
+ throw lexError;
+ }
+ }
+ }
+
+ filterTokenLocation();
+ tokens = extra.tokens;
+ if (typeof extra.comments !== 'undefined') {
+ tokens.comments = extra.comments;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ tokens.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+ return tokens;
+ }
+
+ function parse(code, options) {
+ var program, toString;
+
+ toString = String;
+ if (typeof code !== 'string' && !(code instanceof String)) {
+ code = toString(code);
+ }
+
+ source = code;
+ index = 0;
+ lineNumber = (source.length > 0) ? 1 : 0;
+ lineStart = 0;
+ startIndex = index;
+ startLineNumber = lineNumber;
+ startLineStart = lineStart;
+ length = source.length;
+ lookahead = null;
+ state = {
+ allowIn: true,
+ allowYield: true,
+ labelSet: {},
+ inFunctionBody: false,
+ inIteration: false,
+ inSwitch: false,
+ lastCommentStart: -1,
+ curlyStack: []
+ };
+ sourceType = 'script';
+ strict = false;
+
+ extra = {};
+ if (typeof options !== 'undefined') {
+ extra.range = (typeof options.range === 'boolean') && options.range;
+ extra.loc = (typeof options.loc === 'boolean') && options.loc;
+ extra.attachComment = (typeof options.attachComment === 'boolean') && options.attachComment;
+
+ if (extra.loc && options.source !== null && options.source !== undefined) {
+ extra.source = toString(options.source);
+ }
+
+ if (typeof options.tokens === 'boolean' && options.tokens) {
+ extra.tokens = [];
+ }
+ if (typeof options.comment === 'boolean' && options.comment) {
+ extra.comments = [];
+ }
+ if (typeof options.tolerant === 'boolean' && options.tolerant) {
+ extra.errors = [];
+ }
+ if (extra.attachComment) {
+ extra.range = true;
+ extra.comments = [];
+ extra.bottomRightStack = [];
+ extra.trailingComments = [];
+ extra.leadingComments = [];
+ }
+ if (options.sourceType === 'module') {
+ // very restrictive condition for now
+ sourceType = options.sourceType;
+ strict = true;
+ }
+ }
+
+ try {
+ program = parseProgram();
+ if (typeof extra.comments !== 'undefined') {
+ program.comments = extra.comments;
+ }
+ if (typeof extra.tokens !== 'undefined') {
+ filterTokenLocation();
+ program.tokens = extra.tokens;
+ }
+ if (typeof extra.errors !== 'undefined') {
+ program.errors = extra.errors;
+ }
+ } catch (e) {
+ throw e;
+ } finally {
+ extra = {};
+ }
+
+ return program;
+ }
+
+ // Sync with *.json manifests.
+ exports.version = '2.5.0';
+
+ exports.tokenize = tokenize;
+
+ exports.parse = parse;
+
+ // Deep copy.
+ /* istanbul ignore next */
+ exports.Syntax = (function () {
+ var name, types = {};
+
+ if (typeof Object.create === 'function') {
+ types = Object.create(null);
+ }
+
+ for (name in Syntax) {
+ if (Syntax.hasOwnProperty(name)) {
+ types[name] = Syntax[name];
+ }
+ }
+
+ if (typeof Object.freeze === 'function') {
+ Object.freeze(types);
+ }
+
+ return types;
+ }());
+
+}));
+/* vim: set sw=4 ts=4 et tw=80 : */
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/package.json
new file mode 100644
index 00000000..36de05fb
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/esprima/package.json
@@ -0,0 +1,137 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "esprima@2.5.x",
+ "scope": null,
+ "escapedName": "esprima",
+ "name": "esprima",
+ "rawSpec": "2.5.x",
+ "spec": ">=2.5.0 <2.6.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul"
+ ]
+ ],
+ "_from": "esprima@>=2.5.0 <2.6.0",
+ "_id": "esprima@2.5.0",
+ "_inCache": true,
+ "_location": "/istanbul/esprima",
+ "_nodeVersion": "0.12.5",
+ "_npmUser": {
+ "name": "ariya",
+ "email": "ariya.hidayat@gmail.com"
+ },
+ "_npmVersion": "2.11.2",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "esprima@2.5.x",
+ "scope": null,
+ "escapedName": "esprima",
+ "name": "esprima",
+ "rawSpec": "2.5.x",
+ "spec": ">=2.5.0 <2.6.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/istanbul"
+ ],
+ "_resolved": "https://registry.npmjs.org/esprima/-/esprima-2.5.0.tgz",
+ "_shasum": "f387a46fd344c1b1a39baf8c20bfb43b6d0058cc",
+ "_shrinkwrap": null,
+ "_spec": "esprima@2.5.x",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul",
+ "author": {
+ "name": "Ariya Hidayat",
+ "email": "ariya.hidayat@gmail.com"
+ },
+ "bin": {
+ "esparse": "./bin/esparse.js",
+ "esvalidate": "./bin/esvalidate.js"
+ },
+ "bugs": {
+ "url": "https://github.com/jquery/esprima/issues"
+ },
+ "dependencies": {},
+ "description": "ECMAScript parsing infrastructure for multipurpose analysis",
+ "devDependencies": {
+ "coveralls": "~2.11.2",
+ "escomplex-js": "1.2.0",
+ "eslint": "~0.23.0",
+ "everything.js": "~1.0.3",
+ "glob": "^5.0.14",
+ "istanbul": "~0.3.16",
+ "jscs": "~2.0.0",
+ "json-diff": "~0.3.1",
+ "karma": "^0.13.3",
+ "karma-chrome-launcher": "^0.2.0",
+ "karma-mocha": "^0.2.0",
+ "lodash": "^3.10.0",
+ "mocha": "^2.2.5",
+ "node-tick-processor": "~0.0.2",
+ "regenerate": "~0.6.2",
+ "unicode-7.0.0": "~0.1.5"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "f387a46fd344c1b1a39baf8c20bfb43b6d0058cc",
+ "tarball": "https://registry.npmjs.org/esprima/-/esprima-2.5.0.tgz"
+ },
+ "engines": {
+ "node": ">=0.10.0"
+ },
+ "files": [
+ "bin",
+ "unit-tests.js",
+ "esprima.js"
+ ],
+ "gitHead": "0e3104fb835129d6727868c865a9ba4f80df3ab8",
+ "homepage": "http://esprima.org",
+ "keywords": [
+ "ast",
+ "ecmascript",
+ "javascript",
+ "parser",
+ "syntax"
+ ],
+ "license": "BSD-2-Clause",
+ "main": "esprima.js",
+ "maintainers": [
+ {
+ "name": "ariya",
+ "email": "ariya.hidayat@gmail.com"
+ }
+ ],
+ "name": "esprima",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git+https://github.com/jquery/esprima.git"
+ },
+ "scripts": {
+ "analyze-coverage": "istanbul cover test/unit-tests.js",
+ "benchmark": "node test/benchmarks.js",
+ "benchmark-quick": "node test/benchmarks.js quick",
+ "browser-tests": "npm run generate-fixtures && karma start --single-run",
+ "check-coverage": "istanbul check-coverage --statement 100 --branch 100 --function 100",
+ "check-version": "node test/check-version.js",
+ "complexity": "node test/check-complexity.js",
+ "coveralls": "coveralls < ./coverage/lcov.info",
+ "downstream": "node test/downstream.js",
+ "dynamic-analysis": "npm run analyze-coverage && npm run check-coverage",
+ "eslint": "node node_modules/eslint/bin/eslint.js -c .lintrc esprima.js",
+ "generate-fixtures": "node tools/generate-fixtures.js",
+ "generate-regex": "node tools/generate-identifier-regex.js",
+ "grammar-tests": "node test/grammar-tests.js",
+ "jscs": "jscs esprima.js && jscs test/*.js",
+ "profile": "node --prof test/profile.js && mv isolate*.log v8.log && node-tick-processor",
+ "regression-tests": "node test/regression-tests.js",
+ "static-analysis": "npm run check-version && npm run jscs && npm run eslint && npm run complexity",
+ "test": "npm run tests && npm run static-analysis && npm run dynamic-analysis",
+ "tests": "npm run unit-tests && npm run grammar-tests && npm run regression-tests",
+ "travis": "npm test && npm run coveralls && npm run downstream",
+ "unit-tests": "node test/unit-tests.js"
+ },
+ "version": "2.5.0"
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.npmignore b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.npmignore
new file mode 100644
index 00000000..08b25532
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.npmignore
@@ -0,0 +1 @@
+node_modules
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.travis.yml b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.travis.yml
new file mode 100644
index 00000000..1c01278e
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/.travis.yml
@@ -0,0 +1,6 @@
+language: node_js
+
+node_js:
+ - 'iojs'
+ - '0.12'
+ - '0.10'
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/CHANGELOG.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/CHANGELOG.md
new file mode 100644
index 00000000..3aff6f0b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/CHANGELOG.md
@@ -0,0 +1,25 @@
+## Changelog
+
+- Releases: https://github.com/mklabs/node-fileset/releases
+
+### 0.2.1
+
+- Sync API
+
+### 0.2.0
+
+- Drop support for 0.8
+- PR mklabs/node-fileset#14 reapplied
+- [Minor code style changes](bf8afae22a49cf64720177d6036090db2852d744)
+
+### 0.1.8
+
+- PR mklabs/node-fileset#17 - Reverts PR#14
+
+### 0.1.6 / 0.1.7
+
+- PR mklabs/node-fileset#14
+
+### 0.1.x
+
+- Initial commit
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/LICENSE-MIT b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/LICENSE-MIT
new file mode 100644
index 00000000..63f400b9
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/LICENSE-MIT
@@ -0,0 +1,22 @@
+Copyright (c) 2012 Mickael Daniel
+
+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/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/README.md b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/README.md
new file mode 100644
index 00000000..8277df4b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/README.md
@@ -0,0 +1,97 @@
+# node-fileset [![Build Status](https://secure.travis-ci.org/mklabs/node-fileset.png)](http://travis-ci.org/mklabs/node-fileset)
+
+Exposes a basic wrapper on top of
+[Glob](https://github.com/isaacs/node-glob) /
+[minimatch](https://github.com/isaacs/minimatch) combo both written by
+@isaacs. Glob now uses JavaScript instead of C++ bindings which makes it
+usable in Node.js 0.6.x and Windows platforms.
+
+[![NPM](https://nodei.co/npm/fileset.png?downloads=true&stars=true)](https://nodei.co/npm/fileset/)
+
+Adds multiples patterns matching and exlude ability. This is
+basically just a sugar API syntax where you can specify a list of includes
+and optional exclude patterns. It works by setting up the necessary
+miniglob "fileset" and filtering out the results using minimatch.
+
+*[Changelog](https://github.com/mklabs/node-fileset/blob/master/CHANGELOG.md#changelog)*
+
+## Install
+
+ npm install fileset
+
+## Usage
+
+Can be used with callback or emitter style.
+
+* **include**: list of glob patterns `foo/**/*.js *.md src/lib/**/*`
+* **exclude**: *optional* list of glob patterns to filter include
+ results `foo/**/*.js *.md`
+* **callback**: *optional* function that gets called with an error if
+ something wrong happend, otherwise null with an array of results
+
+The callback is optional since the fileset method return an instance of
+EventEmitter which emit different events you might use:
+
+* *match*: Every time a match is found, miniglob emits this event with
+ the pattern.
+* *include*: Emitted each time an include match is found.
+* *exclude*: Emitted each time an exclude match is found and filtered
+ out from the fileset.
+* *end*: Emitted when the matching is finished with all the matches
+ found, optionally filtered by the exclude patterns.
+
+#### Callback
+
+```js
+var fileset = require('fileset');
+
+fileset('**/*.js', '**.min.js', function(err, files) {
+ if (err) return console.error(err);
+
+ console.log('Files: ', files.length);
+ console.log(files);
+});
+```
+
+#### Event emitter
+
+```js
+var fileset = require('fileset');
+
+fileset('**.coffee README.md *.json Cakefile **.js', 'node_modules/**')
+ .on('match', console.log.bind(console, 'error'))
+ .on('include', console.log.bind(console, 'includes'))
+ .on('exclude', console.log.bind(console, 'excludes'))
+ .on('end', console.log.bind(console, 'end'));
+```
+
+`fileset` returns an instance of EventEmitter, with an `includes` property
+which is the array of Fileset objects (inheriting from
+`miniglob.Miniglob`) that were used during the mathing process, should
+you want to use them individually.
+
+Check out the
+[tests](https://github.com/mklabs/node-fileset/tree/master/tests) for
+more examples.
+
+## Sync usage
+
+```js
+var results = fileset.sync('*.md *.js', 'CHANGELOG.md node_modules/**/*.md node_modules/**/*.js');
+```
+
+The behavior should remain the same, although it lacks the last `options` arguments to pass to internal `glob` and `minimatch` dependencies.
+
+## Tests
+
+Run `npm test`
+
+## Why
+
+Mainly for a build tool with cake files, to provide me an easy way to get
+a list of files by either using glob or path patterns, optionally
+allowing exclude patterns to filter out the results.
+
+All the magic is happening in
+[Glob](https://github.com/isaacs/node-glob) and
+[minimatch](https://github.com/isaacs/minimatch). Check them out!
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/lib/fileset.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/lib/fileset.js
new file mode 100644
index 00000000..c0ec5084
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/lib/fileset.js
@@ -0,0 +1,102 @@
+var util = require('util');
+var minimatch = require('minimatch');
+var glob = require('glob');
+var Glob = glob.Glob;
+var EventEmitter = require('events').EventEmitter;
+
+module.exports = fileset;
+
+// Async API
+function fileset(include, exclude, options, cb) {
+ if (typeof exclude === 'function') cb = exclude, exclude = '';
+ else if (typeof options === 'function') cb = options, options = {};
+
+ var includes = (typeof include === 'string') ? include.split(' ') : include;
+ var excludes = (typeof exclude === 'string') ? exclude.split(' ') : exclude;
+
+ var em = new EventEmitter;
+ var remaining = includes.length;
+ var results = [];
+
+ if (!includes.length) return cb(new Error('Must provide an include pattern'));
+
+ em.includes = includes.map(function(pattern) {
+ return new fileset.Fileset(pattern, options)
+ .on('error', cb ? cb : em.emit.bind(em, 'error'))
+ .on('match', em.emit.bind(em, 'match'))
+ .on('match', em.emit.bind(em, 'include'))
+ .on('end', next.bind({}, pattern))
+ });
+
+ function next(pattern, matches) {
+ results = results.concat(matches);
+
+ if (!(--remaining)) {
+ results = results.filter(function(file) {
+ return !excludes.filter(function(glob) {
+ var match = minimatch(file, glob, { matchBase: true });
+ if(match) em.emit('exclude', file);
+ return match;
+ }).length;
+ });
+
+ if(cb) cb(null, results);
+ em.emit('end', results);
+ }
+ }
+
+ return em;
+}
+
+// Sync API
+fileset.sync = function filesetSync(include, exclude) {
+ if (!exclude) exclude = '';
+
+ // includes / excludes, either an array or string separated by comma or whitespace
+ var includes = (typeof include === 'string') ? include.split(/[\s,]/g) : include;
+ var excludes = (typeof exclude === 'string') ? exclude.split(/[\s,]/g) : exclude;
+
+ // Filter out any false positive '' empty strings
+ includes = includes.filter(function(pattern) { return pattern; });
+ excludes = excludes.filter(function(pattern) { return pattern; });
+
+ // - todo: pass in glob options as last param
+ var options = { matchBase: true };
+
+ // First, glob match on all include patters into a single array
+ var results = includes.map(function(include) {
+ return glob.sync(include, options);
+ }).reduce(function(a, b) {
+ return a.concat(b);
+ }, []);
+
+ // Then filters out on any exclude match
+ var ignored = excludes.map(function(exclude) {
+ return glob.sync(exclude, options);
+ }).reduce(function(a, b) {
+ return a.concat(b);
+ }, []);
+
+ // And filter any exclude match
+ results = results.filter(function(file) {
+ return !ignored.filter(function(glob) {
+ return minimatch(file, glob, { matchBase: true });
+ }).length;
+ });
+
+ return results;
+};
+
+fileset.Fileset = function Fileset(pattern, options, cb) {
+ if (typeof options === 'function') cb = options, options = {};
+ if (!options) options = {};
+
+ Glob.call(this, pattern, options);
+
+ if (typeof cb === 'function') {
+ this.on('error', cb);
+ this.on('end', function(matches) { cb(null, matches); });
+ }
+};
+
+util.inherits(fileset.Fileset, Glob);
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/package.json
new file mode 100644
index 00000000..5512ff28
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/package.json
@@ -0,0 +1,87 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "fileset@0.2.x",
+ "scope": null,
+ "escapedName": "fileset",
+ "name": "fileset",
+ "rawSpec": "0.2.x",
+ "spec": ">=0.2.0 <0.3.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul"
+ ]
+ ],
+ "_from": "fileset@>=0.2.0 <0.3.0",
+ "_id": "fileset@0.2.1",
+ "_inCache": true,
+ "_location": "/istanbul/fileset",
+ "_nodeVersion": "0.12.4",
+ "_npmUser": {
+ "name": "mklabs",
+ "email": "daniel.mickael@gmail.com"
+ },
+ "_npmVersion": "2.10.1",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "fileset@0.2.x",
+ "scope": null,
+ "escapedName": "fileset",
+ "name": "fileset",
+ "rawSpec": "0.2.x",
+ "spec": ">=0.2.0 <0.3.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/istanbul"
+ ],
+ "_resolved": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz",
+ "_shasum": "588ef8973c6623b2a76df465105696b96aac8067",
+ "_shrinkwrap": null,
+ "_spec": "fileset@0.2.x",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul",
+ "author": {
+ "name": "mklabs"
+ },
+ "bugs": {
+ "url": "https://github.com/mklabs/node-fileset/issues"
+ },
+ "dependencies": {
+ "glob": "5.x",
+ "minimatch": "2.x"
+ },
+ "description": "Wrapper around miniglob / minimatch combo to allow multiple patterns matching and include-exclude ability",
+ "devDependencies": {},
+ "directories": {},
+ "dist": {
+ "shasum": "588ef8973c6623b2a76df465105696b96aac8067",
+ "tarball": "https://registry.npmjs.org/fileset/-/fileset-0.2.1.tgz"
+ },
+ "gitHead": "3de76b59cbd8255a191bd9e91041c4fee7538092",
+ "homepage": "https://github.com/mklabs/node-fileset",
+ "licenses": [
+ {
+ "type": "MIT",
+ "url": "https://github.com/mklabs/node-fileset/blob/master/LICENSE-MIT"
+ }
+ ],
+ "main": "./lib/fileset",
+ "maintainers": [
+ {
+ "name": "mklabs",
+ "email": "daniel.mickael@gmail.com"
+ }
+ ],
+ "name": "fileset",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/mklabs/node-fileset.git"
+ },
+ "scripts": {
+ "test": "node tests/test.js && node tests/test-sync.js"
+ },
+ "version": "0.2.1"
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/fixtures/an (odd) filename.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/fixtures/an (odd) filename.js
new file mode 100644
index 00000000..fbf9f2b3
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/fixtures/an (odd) filename.js
@@ -0,0 +1 @@
+var odd = true; \ No newline at end of file
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/helper.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/helper.js
new file mode 100644
index 00000000..73b30758
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/helper.js
@@ -0,0 +1,61 @@
+
+var EventEmitter = require('events').EventEmitter;
+var assert = require('assert');
+var tests = {};
+
+module.exports = test;
+test.run = run;
+
+// ## Test helpers
+
+function test(msg, handler) {
+ tests[msg] = handler;
+}
+
+function run() {
+ var specs = Object.keys(tests);
+ var specsRemaining = specs.length;
+
+ specs.forEach(function(spec) {
+ var handler = tests[spec];
+
+ // grab the set of asserts for this spec
+ var shoulds = handler();
+ var keys = Object.keys(shoulds);
+ var remaining = keys.length;
+
+ keys.forEach(function(should) {
+ var em = new EventEmitter(),
+ to = setTimeout(function() {
+ assert.fail('never ended');
+ }, 5000);
+
+ em
+ .on('error', function assertFail(err) { assert.fail(err) })
+ .on('end', function assertOk() {
+ clearTimeout(to);
+ shoulds[should].status = true;
+
+ // till we get to 0
+ if (!(--remaining)) {
+ console.log([
+ '',
+ '» ' + spec,
+ keys.map(function(k) { return ' » ' + k; }).join('\n'),
+ '',
+ ' Total: ' + keys.length,
+ ' Failed: ' + keys.map(function(item) { return shoulds[should].status; }).filter(function(status) { return !status; }).length,
+ ''
+ ].join('\n'));
+
+ if (!(--specsRemaining)) {
+ console.log('All done');
+ }
+
+ }
+ });
+
+ shoulds[should](em);
+ });
+ });
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test-sync.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test-sync.js
new file mode 100644
index 00000000..9d4f45c3
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test-sync.js
@@ -0,0 +1,37 @@
+
+var EventEmitter = require('events').EventEmitter;
+var fileset = require('../');
+var assert = require('assert');
+var test = require('./helper');
+
+// Given a **.md pattern
+test('Sync API - Given a **.md pattern', function() {
+ return {
+ 'should return the list of matching file in this repo': function(em) {
+ var results = fileset.sync('*.md', 'node_modules/**/*.md');
+
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.ok(results.length, 'should return at least one element');
+ assert.equal(results.length, 2, 'actually, should return only two');
+
+ em.emit('end');
+ }
+ }
+});
+
+test('Sync API - Given a *.md and **.js pattern, and two exclude', function() {
+ return {
+ 'should return the list of matching file in this repo': function(em) {
+ var results = fileset.sync('*.md *.js', 'CHANGELOG.md node_modules/**/*.md node_modules/**/*.js');
+
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.ok(results.length, 'should return at least one element');
+
+ assert.equal(results.length, 6, 'actually, should return only six');
+
+ em.emit('end');
+ }
+ }
+});
+
+test.run();
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test.js
new file mode 100644
index 00000000..fef726b8
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/fileset/tests/test.js
@@ -0,0 +1,137 @@
+
+var EventEmitter = require('events').EventEmitter;
+var fileset = require('../');
+var assert = require('assert');
+var test = require('./helper');
+
+// Given a **.md pattern
+test('Given a **.md pattern', function() {
+
+ return {
+ 'should return the list of matching file in this repo': function(em) {
+ fileset('*.md', function(err, results) {
+ if(err) return em.emit('error', err);
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.ok(results.length, 'should return at least one element');
+ assert.equal(results.length, 2, 'actually, should return only two');
+ em.emit('end');
+ });
+ }
+ }
+});
+
+test('Say we want the **.js files, but not those in node_modules', function() {
+
+ return {
+ 'Should recursively walk the dir and return the matching list': function(em) {
+ fileset('**/*.js', 'node_modules/**', function(err, results) {
+ if(err) return em.emit('error', err);
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 5);
+ em.emit('end');
+ });
+ },
+
+ 'Should support multiple paths at once': function(em) {
+ fileset('**/*.js *.md', 'node_modules/**', function(err, results) {
+ if(err) return em.emit('error', err);
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 7);
+
+ assert.deepEqual(results, [
+ 'CHANGELOG.md',
+ 'README.md',
+ 'lib/fileset.js',
+ 'tests/fixtures/an (odd) filename.js',
+ 'tests/helper.js',
+ 'tests/test-sync.js',
+ 'tests/test.js'
+ ]);
+
+ em.emit('end');
+ });
+ },
+
+ 'Should support multiple paths for excludes as well': function(em) {
+ fileset('**/*.js *.md', 'node_modules/** **.md tests/*.js', function(err, results) {
+ if(err) return em.emit('error', err);
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 2);
+
+ assert.deepEqual(results, [
+ 'lib/fileset.js',
+ 'tests/fixtures/an (odd) filename.js',
+ ]);
+
+ em.emit('end');
+ });
+ }
+ }
+});
+
+
+test('Testing out emmited events', function() {
+
+ // todos: the tests for match, include, exclude events, but seems like it's ok
+ return {
+ 'Should recursively walk the dir and return the matching list': function(em) {
+ fileset('**/*.js', 'node_modules/**')
+ .on('error', em.emit.bind(em, 'error'))
+ .on('end', function(results) {
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 5);
+ em.emit('end');
+ });
+ },
+
+ 'Should support multiple paths at once': function(em) {
+ fileset('**/*.js *.md', 'node_modules/**')
+ .on('error', em.emit.bind(em, 'error'))
+ .on('end', function(results) {
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 7);
+
+ assert.deepEqual(results, [
+ 'CHANGELOG.md',
+ 'README.md',
+ 'lib/fileset.js',
+ 'tests/fixtures/an (odd) filename.js',
+ 'tests/helper.js',
+ 'tests/test-sync.js',
+ 'tests/test.js'
+ ]);
+
+ em.emit('end');
+ });
+ }
+ }
+});
+
+
+test('Testing patterns passed as arrays', function() {
+
+ return {
+ 'Should match files passed as an array with odd filenames': function(em) {
+ fileset(['lib/*.js', 'tests/fixtures/an (odd) filename.js'], ['node_modules/**'])
+ .on('error', em.emit.bind(em, 'error'))
+ .on('end', function(results) {
+ assert.ok(Array.isArray(results), 'should be an array');
+ assert.equal(results.length, 2);
+
+ assert.deepEqual(results, [
+ 'lib/fileset.js',
+ 'tests/fixtures/an (odd) filename.js',
+ ]);
+
+ em.emit('end');
+ });
+ }
+ }
+
+});
+
+
+
+test.run();
+
+
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/LICENSE b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/LICENSE
new file mode 100644
index 00000000..ee27ba4b
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/LICENSE
@@ -0,0 +1,18 @@
+This software is released under the MIT 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:
+
+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/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/README.markdown b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/README.markdown
new file mode 100644
index 00000000..346374e0
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/README.markdown
@@ -0,0 +1,70 @@
+wordwrap
+========
+
+Wrap your words.
+
+example
+=======
+
+made out of meat
+----------------
+
+meat.js
+
+ var wrap = require('wordwrap')(15);
+ console.log(wrap('You and your whole family are made out of meat.'));
+
+output:
+
+ You and your
+ whole family
+ are made out
+ of meat.
+
+centered
+--------
+
+center.js
+
+ var wrap = require('wordwrap')(20, 60);
+ console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+ ));
+
+output:
+
+ At long last the struggle and tumult
+ was over. The machines had finally cast
+ off their oppressors and were finally
+ free to roam the cosmos.
+ Free of purpose, free of obligation.
+ Just drifting through emptiness. The
+ sun was just another point of light.
+
+methods
+=======
+
+var wrap = require('wordwrap');
+
+wrap(stop), wrap(start, stop, params={mode:"soft"})
+---------------------------------------------------
+
+Returns a function that takes a string and returns a new string.
+
+Pad out lines with spaces out to column `start` and then wrap until column
+`stop`. If a word is longer than `stop - start` characters it will overflow.
+
+In "soft" mode, split chunks by `/(\S+\s+/` and don't break up chunks which are
+longer than `stop - start`, in "hard" mode, split chunks with `/\b/` and break
+up chunks longer than `stop - start`.
+
+wrap.hard(start, stop)
+----------------------
+
+Like `wrap()` but with `params.mode = "hard"`.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/center.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/center.js
new file mode 100644
index 00000000..a3fbaae9
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/center.js
@@ -0,0 +1,10 @@
+var wrap = require('wordwrap')(20, 60);
+console.log(wrap(
+ 'At long last the struggle and tumult was over.'
+ + ' The machines had finally cast off their oppressors'
+ + ' and were finally free to roam the cosmos.'
+ + '\n'
+ + 'Free of purpose, free of obligation.'
+ + ' Just drifting through emptiness.'
+ + ' The sun was just another point of light.'
+));
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/meat.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/meat.js
new file mode 100644
index 00000000..a4665e10
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/example/meat.js
@@ -0,0 +1,3 @@
+var wrap = require('wordwrap')(15);
+
+console.log(wrap('You and your whole family are made out of meat.'));
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/index.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/index.js
new file mode 100644
index 00000000..c9bc9452
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/index.js
@@ -0,0 +1,76 @@
+var wordwrap = module.exports = function (start, stop, params) {
+ if (typeof start === 'object') {
+ params = start;
+ start = params.start;
+ stop = params.stop;
+ }
+
+ if (typeof stop === 'object') {
+ params = stop;
+ start = start || params.start;
+ stop = undefined;
+ }
+
+ if (!stop) {
+ stop = start;
+ start = 0;
+ }
+
+ if (!params) params = {};
+ var mode = params.mode || 'soft';
+ var re = mode === 'hard' ? /\b/ : /(\S+\s+)/;
+
+ return function (text) {
+ var chunks = text.toString()
+ .split(re)
+ .reduce(function (acc, x) {
+ if (mode === 'hard') {
+ for (var i = 0; i < x.length; i += stop - start) {
+ acc.push(x.slice(i, i + stop - start));
+ }
+ }
+ else acc.push(x)
+ return acc;
+ }, [])
+ ;
+
+ return chunks.reduce(function (lines, rawChunk) {
+ if (rawChunk === '') return lines;
+
+ var chunk = rawChunk.replace(/\t/g, ' ');
+
+ var i = lines.length - 1;
+ if (lines[i].length + chunk.length > stop) {
+ lines[i] = lines[i].replace(/\s+$/, '');
+
+ chunk.split(/\n/).forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else if (chunk.match(/\n/)) {
+ var xs = chunk.split(/\n/);
+ lines[i] += xs.shift();
+ xs.forEach(function (c) {
+ lines.push(
+ new Array(start + 1).join(' ')
+ + c.replace(/^\s+/, '')
+ );
+ });
+ }
+ else {
+ lines[i] += chunk;
+ }
+
+ return lines;
+ }, [ new Array(start + 1).join(' ') ]).join('\n');
+ };
+};
+
+wordwrap.soft = wordwrap;
+
+wordwrap.hard = function (start, stop) {
+ return wordwrap(start, stop, { mode : 'hard' });
+};
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/package.json
new file mode 100644
index 00000000..da1dbef7
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/package.json
@@ -0,0 +1,94 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "wordwrap@^1.0.0",
+ "scope": null,
+ "escapedName": "wordwrap",
+ "name": "wordwrap",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul"
+ ]
+ ],
+ "_from": "wordwrap@>=1.0.0 <2.0.0",
+ "_id": "wordwrap@1.0.0",
+ "_inCache": true,
+ "_location": "/istanbul/wordwrap",
+ "_nodeVersion": "2.0.0",
+ "_npmUser": {
+ "name": "substack",
+ "email": "substack@gmail.com"
+ },
+ "_npmVersion": "2.9.0",
+ "_phantomChildren": {},
+ "_requested": {
+ "raw": "wordwrap@^1.0.0",
+ "scope": null,
+ "escapedName": "wordwrap",
+ "name": "wordwrap",
+ "rawSpec": "^1.0.0",
+ "spec": ">=1.0.0 <2.0.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/istanbul"
+ ],
+ "_resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz",
+ "_shasum": "27584810891456a4171c8d0226441ade90cbcaeb",
+ "_shrinkwrap": null,
+ "_spec": "wordwrap@^1.0.0",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\istanbul",
+ "author": {
+ "name": "James Halliday",
+ "email": "mail@substack.net",
+ "url": "http://substack.net"
+ },
+ "bugs": {
+ "url": "https://github.com/substack/node-wordwrap/issues"
+ },
+ "dependencies": {},
+ "description": "Wrap those words. Show them at what columns to start and stop.",
+ "devDependencies": {
+ "tape": "^4.0.0"
+ },
+ "directories": {
+ "lib": ".",
+ "example": "example",
+ "test": "test"
+ },
+ "dist": {
+ "shasum": "27584810891456a4171c8d0226441ade90cbcaeb",
+ "tarball": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz"
+ },
+ "gitHead": "9f02667e901f2f10d87c33f7093fcf94788ab2f8",
+ "homepage": "https://github.com/substack/node-wordwrap#readme",
+ "keywords": [
+ "word",
+ "wrap",
+ "rule",
+ "format",
+ "column"
+ ],
+ "license": "MIT",
+ "main": "./index.js",
+ "maintainers": [
+ {
+ "name": "substack",
+ "email": "mail@substack.net"
+ }
+ ],
+ "name": "wordwrap",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/substack/node-wordwrap.git"
+ },
+ "scripts": {
+ "test": "expresso"
+ },
+ "version": "1.0.0"
+}
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/break.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/break.js
new file mode 100644
index 00000000..7d0e8b54
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/break.js
@@ -0,0 +1,32 @@
+var test = require('tape');
+var wordwrap = require('../');
+
+test('hard', function (t) {
+ var s = 'Assert from {"type":"equal","ok":false,"found":1,"wanted":2,'
+ + '"stack":[],"id":"b7ddcd4c409de8799542a74d1a04689b",'
+ + '"browser":"chrome/6.0"}'
+ ;
+ var s_ = wordwrap.hard(80)(s);
+
+ var lines = s_.split('\n');
+ t.equal(lines.length, 2);
+ t.ok(lines[0].length < 80);
+ t.ok(lines[1].length < 80);
+
+ t.equal(s, s_.replace(/\n/g, ''));
+ t.end();
+});
+
+test('break', function (t) {
+ var s = new Array(55+1).join('a');
+ var s_ = wordwrap.hard(20)(s);
+
+ var lines = s_.split('\n');
+ t.equal(lines.length, 3);
+ t.ok(lines[0].length === 20);
+ t.ok(lines[1].length === 20);
+ t.ok(lines[2].length === 15);
+
+ t.equal(s, s_.replace(/\n/g, ''));
+ t.end();
+});
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/idleness.txt b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/idleness.txt
new file mode 100644
index 00000000..aa3f4907
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/idleness.txt
@@ -0,0 +1,63 @@
+In Praise of Idleness
+
+By Bertrand Russell
+
+[1932]
+
+Like most of my generation, I was brought up on the saying: 'Satan finds some mischief for idle hands to do.' Being a highly virtuous child, I believed all that I was told, and acquired a conscience which has kept me working hard down to the present moment. But although my conscience has controlled my actions, my opinions have undergone a revolution. I think that there is far too much work done in the world, that immense harm is caused by the belief that work is virtuous, and that what needs to be preached in modern industrial countries is quite different from what always has been preached. Everyone knows the story of the traveler in Naples who saw twelve beggars lying in the sun (it was before the days of Mussolini), and offered a lira to the laziest of them. Eleven of them jumped up to claim it, so he gave it to the twelfth. this traveler was on the right lines. But in countries which do not enjoy Mediterranean sunshine idleness is more difficult, and a great public propaganda will be required to inaugurate it. I hope that, after reading the following pages, the leaders of the YMCA will start a campaign to induce good young men to do nothing. If so, I shall not have lived in vain.
+
+Before advancing my own arguments for laziness, I must dispose of one which I cannot accept. Whenever a person who already has enough to live on proposes to engage in some everyday kind of job, such as school-teaching or typing, he or she is told that such conduct takes the bread out of other people's mouths, and is therefore wicked. If this argument were valid, it would only be necessary for us all to be idle in order that we should all have our mouths full of bread. What people who say such things forget is that what a man earns he usually spends, and in spending he gives employment. As long as a man spends his income, he puts just as much bread into people's mouths in spending as he takes out of other people's mouths in earning. The real villain, from this point of view, is the man who saves. If he merely puts his savings in a stocking, like the proverbial French peasant, it is obvious that they do not give employment. If he invests his savings, the matter is less obvious, and different cases arise.
+
+One of the commonest things to do with savings is to lend them to some Government. In view of the fact that the bulk of the public expenditure of most civilized Governments consists in payment for past wars or preparation for future wars, the man who lends his money to a Government is in the same position as the bad men in Shakespeare who hire murderers. The net result of the man's economical habits is to increase the armed forces of the State to which he lends his savings. Obviously it would be better if he spent the money, even if he spent it in drink or gambling.
+
+But, I shall be told, the case is quite different when savings are invested in industrial enterprises. When such enterprises succeed, and produce something useful, this may be conceded. In these days, however, no one will deny that most enterprises fail. That means that a large amount of human labor, which might have been devoted to producing something that could be enjoyed, was expended on producing machines which, when produced, lay idle and did no good to anyone. The man who invests his savings in a concern that goes bankrupt is therefore injuring others as well as himself. If he spent his money, say, in giving parties for his friends, they (we may hope) would get pleasure, and so would all those upon whom he spent money, such as the butcher, the baker, and the bootlegger. But if he spends it (let us say) upon laying down rails for surface card in some place where surface cars turn out not to be wanted, he has diverted a mass of labor into channels where it gives pleasure to no one. Nevertheless, when he becomes poor through failure of his investment he will be regarded as a victim of undeserved misfortune, whereas the gay spendthrift, who has spent his money philanthropically, will be despised as a fool and a frivolous person.
+
+All this is only preliminary. I want to say, in all seriousness, that a great deal of harm is being done in the modern world by belief in the virtuousness of work, and that the road to happiness and prosperity lies in an organized diminution of work.
+
+First of all: what is work? Work is of two kinds: first, altering the position of matter at or near the earth's surface relatively to other such matter; second, telling other people to do so. The first kind is unpleasant and ill paid; the second is pleasant and highly paid. The second kind is capable of indefinite extension: there are not only those who give orders, but those who give advice as to what orders should be given. Usually two opposite kinds of advice are given simultaneously by two organized bodies of men; this is called politics. The skill required for this kind of work is not knowledge of the subjects as to which advice is given, but knowledge of the art of persuasive speaking and writing, i.e. of advertising.
+
+Throughout Europe, though not in America, there is a third class of men, more respected than either of the classes of workers. There are men who, through ownership of land, are able to make others pay for the privilege of being allowed to exist and to work. These landowners are idle, and I might therefore be expected to praise them. Unfortunately, their idleness is only rendered possible by the industry of others; indeed their desire for comfortable idleness is historically the source of the whole gospel of work. The last thing they have ever wished is that others should follow their example.
+
+From the beginning of civilization until the Industrial Revolution, a man could, as a rule, produce by hard work little more than was required for the subsistence of himself and his family, although his wife worked at least as hard as he did, and his children added their labor as soon as they were old enough to do so. The small surplus above bare necessaries was not left to those who produced it, but was appropriated by warriors and priests. In times of famine there was no surplus; the warriors and priests, however, still secured as much as at other times, with the result that many of the workers died of hunger. This system persisted in Russia until 1917 [1], and still persists in the East; in England, in spite of the Industrial Revolution, it remained in full force throughout the Napoleonic wars, and until a hundred years ago, when the new class of manufacturers acquired power. In America, the system came to an end with the Revolution, except in the South, where it persisted until the Civil War. A system which lasted so long and ended so recently has naturally left a profound impress upon men's thoughts and opinions. Much that we take for granted about the desirability of work is derived from this system, and, being pre-industrial, is not adapted to the modern world. Modern technique has made it possible for leisure, within limits, to be not the prerogative of small privileged classes, but a right evenly distributed throughout the community. The morality of work is the morality of slaves, and the modern world has no need of slavery.
+
+It is obvious that, in primitive communities, peasants, left to themselves, would not have parted with the slender surplus upon which the warriors and priests subsisted, but would have either produced less or consumed more. At first, sheer force compelled them to produce and part with the surplus. Gradually, however, it was found possible to induce many of them to accept an ethic according to which it was their duty to work hard, although part of their work went to support others in idleness. By this means the amount of compulsion required was lessened, and the expenses of government were diminished. To this day, 99 per cent of British wage-earners would be genuinely shocked if it were proposed that the King should not have a larger income than a working man. The conception of duty, speaking historically, has been a means used by the holders of power to induce others to live for the interests of their masters rather than for their own. Of course the holders of power conceal this fact from themselves by managing to believe that their interests are identical with the larger interests of humanity. Sometimes this is true; Athenian slave-owners, for instance, employed part of their leisure in making a permanent contribution to civilization which would have been impossible under a just economic system. Leisure is essential to civilization, and in former times leisure for the few was only rendered possible by the labors of the many. But their labors were valuable, not because work is good, but because leisure is good. And with modern technique it would be possible to distribute leisure justly without injury to civilization.
+
+Modern technique has made it possible to diminish enormously the amount of labor required to secure the necessaries of life for everyone. This was made obvious during the war. At that time all the men in the armed forces, and all the men and women engaged in the production of munitions, all the men and women engaged in spying, war propaganda, or Government offices connected with the war, were withdrawn from productive occupations. In spite of this, the general level of well-being among unskilled wage-earners on the side of the Allies was higher than before or since. The significance of this fact was concealed by finance: borrowing made it appear as if the future was nourishing the present. But that, of course, would have been impossible; a man cannot eat a loaf of bread that does not yet exist. The war showed conclusively that, by the scientific organization of production, it is possible to keep modern populations in fair comfort on a small part of the working capacity of the modern world. If, at the end of the war, the scientific organization, which had been created in order to liberate men for fighting and munition work, had been preserved, and the hours of the week had been cut down to four, all would have been well. Instead of that the old chaos was restored, those whose work was demanded were made to work long hours, and the rest were left to starve as unemployed. Why? Because work is a duty, and a man should not receive wages in proportion to what he has produced, but in proportion to his virtue as exemplified by his industry.
+
+This is the morality of the Slave State, applied in circumstances totally unlike those in which it arose. No wonder the result has been disastrous. Let us take an illustration. Suppose that, at a given moment, a certain number of people are engaged in the manufacture of pins. They make as many pins as the world needs, working (say) eight hours a day. Someone makes an invention by which the same number of men can make twice as many pins: pins are already so cheap that hardly any more will be bought at a lower price. In a sensible world, everybody concerned in the manufacturing of pins would take to working four hours instead of eight, and everything else would go on as before. But in the actual world this would be thought demoralizing. The men still work eight hours, there are too many pins, some employers go bankrupt, and half the men previously concerned in making pins are thrown out of work. There is, in the end, just as much leisure as on the other plan, but half the men are totally idle while half are still overworked. In this way, it is insured that the unavoidable leisure shall cause misery all round instead of being a universal source of happiness. Can anything more insane be imagined?
+
+The idea that the poor should have leisure has always been shocking to the rich. In England, in the early nineteenth century, fifteen hours was the ordinary day's work for a man; children sometimes did as much, and very commonly did twelve hours a day. When meddlesome busybodies suggested that perhaps these hours were rather long, they were told that work kept adults from drink and children from mischief. When I was a child, shortly after urban working men had acquired the vote, certain public holidays were established by law, to the great indignation of the upper classes. I remember hearing an old Duchess say: 'What do the poor want with holidays? They ought to work.' People nowadays are less frank, but the sentiment persists, and is the source of much of our economic confusion.
+
+Let us, for a moment, consider the ethics of work frankly, without superstition. Every human being, of necessity, consumes, in the course of his life, a certain amount of the produce of human labor. Assuming, as we may, that labor is on the whole disagreeable, it is unjust that a man should consume more than he produces. Of course he may provide services rather than commodities, like a medical man, for example; but he should provide something in return for his board and lodging. to this extent, the duty of work must be admitted, but to this extent only.
+
+I shall not dwell upon the fact that, in all modern societies outside the USSR, many people escape even this minimum amount of work, namely all those who inherit money and all those who marry money. I do not think the fact that these people are allowed to be idle is nearly so harmful as the fact that wage-earners are expected to overwork or starve.
+
+If the ordinary wage-earner worked four hours a day, there would be enough for everybody and no unemployment -- assuming a certain very moderate amount of sensible organization. This idea shocks the well-to-do, because they are convinced that the poor would not know how to use so much leisure. In America men often work long hours even when they are well off; such men, naturally, are indignant at the idea of leisure for wage-earners, except as the grim punishment of unemployment; in fact, they dislike leisure even for their sons. Oddly enough, while they wish their sons to work so hard as to have no time to be civilized, they do not mind their wives and daughters having no work at all. the snobbish admiration of uselessness, which, in an aristocratic society, extends to both sexes, is, under a plutocracy, confined to women; this, however, does not make it any more in agreement with common sense.
+
+The wise use of leisure, it must be conceded, is a product of civilization and education. A man who has worked long hours all his life will become bored if he becomes suddenly idle. But without a considerable amount of leisure a man is cut off from many of the best things. There is no longer any reason why the bulk of the population should suffer this deprivation; only a foolish asceticism, usually vicarious, makes us continue to insist on work in excessive quantities now that the need no longer exists.
+
+In the new creed which controls the government of Russia, while there is much that is very different from the traditional teaching of the West, there are some things that are quite unchanged. The attitude of the governing classes, and especially of those who conduct educational propaganda, on the subject of the dignity of labor, is almost exactly that which the governing classes of the world have always preached to what were called the 'honest poor'. Industry, sobriety, willingness to work long hours for distant advantages, even submissiveness to authority, all these reappear; moreover authority still represents the will of the Ruler of the Universe, Who, however, is now called by a new name, Dialectical Materialism.
+
+The victory of the proletariat in Russia has some points in common with the victory of the feminists in some other countries. For ages, men had conceded the superior saintliness of women, and had consoled women for their inferiority by maintaining that saintliness is more desirable than power. At last the feminists decided that they would have both, since the pioneers among them believed all that the men had told them about the desirability of virtue, but not what they had told them about the worthlessness of political power. A similar thing has happened in Russia as regards manual work. For ages, the rich and their sycophants have written in praise of 'honest toil', have praised the simple life, have professed a religion which teaches that the poor are much more likely to go to heaven than the rich, and in general have tried to make manual workers believe that there is some special nobility about altering the position of matter in space, just as men tried to make women believe that they derived some special nobility from their sexual enslavement. In Russia, all this teaching about the excellence of manual work has been taken seriously, with the result that the manual worker is more honored than anyone else. What are, in essence, revivalist appeals are made, but not for the old purposes: they are made to secure shock workers for special tasks. Manual work is the ideal which is held before the young, and is the basis of all ethical teaching.
+
+For the present, possibly, this is all to the good. A large country, full of natural resources, awaits development, and has has to be developed with very little use of credit. In these circumstances, hard work is necessary, and is likely to bring a great reward. But what will happen when the point has been reached where everybody could be comfortable without working long hours?
+
+In the West, we have various ways of dealing with this problem. We have no attempt at economic justice, so that a large proportion of the total produce goes to a small minority of the population, many of whom do no work at all. Owing to the absence of any central control over production, we produce hosts of things that are not wanted. We keep a large percentage of the working population idle, because we can dispense with their labor by making the others overwork. When all these methods prove inadequate, we have a war: we cause a number of people to manufacture high explosives, and a number of others to explode them, as if we were children who had just discovered fireworks. By a combination of all these devices we manage, though with difficulty, to keep alive the notion that a great deal of severe manual work must be the lot of the average man.
+
+In Russia, owing to more economic justice and central control over production, the problem will have to be differently solved. the rational solution would be, as soon as the necessaries and elementary comforts can be provided for all, to reduce the hours of labor gradually, allowing a popular vote to decide, at each stage, whether more leisure or more goods were to be preferred. But, having taught the supreme virtue of hard work, it is difficult to see how the authorities can aim at a paradise in which there will be much leisure and little work. It seems more likely that they will find continually fresh schemes, by which present leisure is to be sacrificed to future productivity. I read recently of an ingenious plan put forward by Russian engineers, for making the White Sea and the northern coasts of Siberia warm, by putting a dam across the Kara Sea. An admirable project, but liable to postpone proletarian comfort for a generation, while the nobility of toil is being displayed amid the ice-fields and snowstorms of the Arctic Ocean. This sort of thing, if it happens, will be the result of regarding the virtue of hard work as an end in itself, rather than as a means to a state of affairs in which it is no longer needed.
+
+The fact is that moving matter about, while a certain amount of it is necessary to our existence, is emphatically not one of the ends of human life. If it were, we should have to consider every navvy superior to Shakespeare. We have been misled in this matter by two causes. One is the necessity of keeping the poor contented, which has led the rich, for thousands of years, to preach the dignity of labor, while taking care themselves to remain undignified in this respect. The other is the new pleasure in mechanism, which makes us delight in the astonishingly clever changes that we can produce on the earth's surface. Neither of these motives makes any great appeal to the actual worker. If you ask him what he thinks the best part of his life, he is not likely to say: 'I enjoy manual work because it makes me feel that I am fulfilling man's noblest task, and because I like to think how much man can transform his planet. It is true that my body demands periods of rest, which I have to fill in as best I may, but I am never so happy as when the morning comes and I can return to the toil from which my contentment springs.' I have never heard working men say this sort of thing. They consider work, as it should be considered, a necessary means to a livelihood, and it is from their leisure that they derive whatever happiness they may enjoy.
+
+It will be said that, while a little leisure is pleasant, men would not know how to fill their days if they had only four hours of work out of the twenty-four. In so far as this is true in the modern world, it is a condemnation of our civilization; it would not have been true at any earlier period. There was formerly a capacity for light-heartedness and play which has been to some extent inhibited by the cult of efficiency. The modern man thinks that everything ought to be done for the sake of something else, and never for its own sake. Serious-minded persons, for example, are continually condemning the habit of going to the cinema, and telling us that it leads the young into crime. But all the work that goes to producing a cinema is respectable, because it is work, and because it brings a money profit. The notion that the desirable activities are those that bring a profit has made everything topsy-turvy. The butcher who provides you with meat and the baker who provides you with bread are praiseworthy, because they are making money; but when you enjoy the food they have provided, you are merely frivolous, unless you eat only to get strength for your work. Broadly speaking, it is held that getting money is good and spending money is bad. Seeing that they are two sides of one transaction, this is absurd; one might as well maintain that keys are good, but keyholes are bad. Whatever merit there may be in the production of goods must be entirely derivative from the advantage to be obtained by consuming them. The individual, in our society, works for profit; but the social purpose of his work lies in the consumption of what he produces. It is this divorce between the individual and the social purpose of production that makes it so difficult for men to think clearly in a world in which profit-making is the incentive to industry. We think too much of production, and too little of consumption. One result is that we attach too little importance to enjoyment and simple happiness, and that we do not judge production by the pleasure that it gives to the consumer.
+
+When I suggest that working hours should be reduced to four, I am not meaning to imply that all the remaining time should necessarily be spent in pure frivolity. I mean that four hours' work a day should entitle a man to the necessities and elementary comforts of life, and that the rest of his time should be his to use as he might see fit. It is an essential part of any such social system that education should be carried further than it usually is at present, and should aim, in part, at providing tastes which would enable a man to use leisure intelligently. I am not thinking mainly of the sort of things that would be considered 'highbrow'. Peasant dances have died out except in remote rural areas, but the impulses which caused them to be cultivated must still exist in human nature. The pleasures of urban populations have become mainly passive: seeing cinemas, watching football matches, listening to the radio, and so on. This results from the fact that their active energies are fully taken up with work; if they had more leisure, they would again enjoy pleasures in which they took an active part.
+
+In the past, there was a small leisure class and a larger working class. The leisure class enjoyed advantages for which there was no basis in social justice; this necessarily made it oppressive, limited its sympathies, and caused it to invent theories by which to justify its privileges. These facts greatly diminished its excellence, but in spite of this drawback it contributed nearly the whole of what we call civilization. It cultivated the arts and discovered the sciences; it wrote the books, invented the philosophies, and refined social relations. Even the liberation of the oppressed has usually been inaugurated from above. Without the leisure class, mankind would never have emerged from barbarism.
+
+The method of a leisure class without duties was, however, extraordinarily wasteful. None of the members of the class had to be taught to be industrious, and the class as a whole was not exceptionally intelligent. The class might produce one Darwin, but against him had to be set tens of thousands of country gentlemen who never thought of anything more intelligent than fox-hunting and punishing poachers. At present, the universities are supposed to provide, in a more systematic way, what the leisure class provided accidentally and as a by-product. This is a great improvement, but it has certain drawbacks. University life is so different from life in the world at large that men who live in academic milieu tend to be unaware of the preoccupations and problems of ordinary men and women; moreover their ways of expressing themselves are usually such as to rob their opinions of the influence that they ought to have upon the general public. Another disadvantage is that in universities studies are organized, and the man who thinks of some original line of research is likely to be discouraged. Academic institutions, therefore, useful as they are, are not adequate guardians of the interests of civilization in a world where everyone outside their walls is too busy for unutilitarian pursuits.
+
+In a world where no one is compelled to work more than four hours a day, every person possessed of scientific curiosity will be able to indulge it, and every painter will be able to paint without starving, however excellent his pictures may be. Young writers will not be obliged to draw attention to themselves by sensational pot-boilers, with a view to acquiring the economic independence needed for monumental works, for which, when the time at last comes, they will have lost the taste and capacity. Men who, in their professional work, have become interested in some phase of economics or government, will be able to develop their ideas without the academic detachment that makes the work of university economists often seem lacking in reality. Medical men will have the time to learn about the progress of medicine, teachers will not be exasperatedly struggling to teach by routine methods things which they learnt in their youth, which may, in the interval, have been proved to be untrue.
+
+Above all, there will be happiness and joy of life, instead of frayed nerves, weariness, and dyspepsia. The work exacted will be enough to make leisure delightful, but not enough to produce exhaustion. Since men will not be tired in their spare time, they will not demand only such amusements as are passive and vapid. At least one per cent will probably devote the time not spent in professional work to pursuits of some public importance, and, since they will not depend upon these pursuits for their livelihood, their originality will be unhampered, and there will be no need to conform to the standards set by elderly pundits. But it is not only in these exceptional cases that the advantages of leisure will appear. Ordinary men and women, having the opportunity of a happy life, will become more kindly and less persecuting and less inclined to view others with suspicion. The taste for war will die out, partly for this reason, and partly because it will involve long and severe work for all. Good nature is, of all moral qualities, the one that the world needs most, and good nature is the result of ease and security, not of a life of arduous struggle. Modern methods of production have given us the possibility of ease and security for all; we have chosen, instead, to have overwork for some and starvation for others. Hitherto we have continued to be as energetic as we were before there were machines; in this we have been foolish, but there is no reason to go on being foolish forever.
+
+[1] Since then, members of the Communist Party have succeeded to this privilege of the warriors and priests.
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/wrap.js b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/wrap.js
new file mode 100644
index 00000000..01ea4718
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/node_modules/wordwrap/test/wrap.js
@@ -0,0 +1,33 @@
+var test = require('tape');
+var wordwrap = require('../');
+
+var fs = require('fs');
+var idleness = fs.readFileSync(__dirname + '/idleness.txt', 'utf8');
+
+test('stop80', function (t) {
+ var lines = wordwrap(80)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ t.ok(line.length <= 80, 'line > 80 columns');
+ var chunks = line.match(/\S/) ? line.split(/\s+/) : [];
+ t.deepEqual(chunks, words.splice(0, chunks.length));
+ });
+ t.end();
+});
+
+test('start20stop60', function (t) {
+ var lines = wordwrap(20, 100)(idleness).split(/\n/);
+ var words = idleness.split(/\s+/);
+
+ lines.forEach(function (line) {
+ t.ok(line.length <= 100, 'line > 100 columns');
+ var chunks = line
+ .split(/\s+/)
+ .filter(function (x) { return x.match(/\S/) })
+ ;
+ t.deepEqual(chunks, words.splice(0, chunks.length));
+ t.deepEqual(line.slice(0, 20), new Array(20 + 1).join(' '));
+ });
+ t.end();
+});
diff --git a/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/package.json b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/package.json
new file mode 100644
index 00000000..c236da2a
--- /dev/null
+++ b/vnfmarket/src/main/webapp/vnfmarket/node_modules/istanbul/package.json
@@ -0,0 +1,349 @@
+{
+ "_args": [
+ [
+ {
+ "raw": "istanbul@~0.3.0",
+ "scope": null,
+ "escapedName": "istanbul",
+ "name": "istanbul",
+ "rawSpec": "~0.3.0",
+ "spec": ">=0.3.0 <0.4.0",
+ "type": "range"
+ },
+ "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\karma-coverage"
+ ]
+ ],
+ "_from": "istanbul@>=0.3.0 <0.4.0",
+ "_id": "istanbul@0.3.22",
+ "_inCache": true,
+ "_location": "/istanbul",
+ "_nodeVersion": "0.10.39",
+ "_npmUser": {
+ "name": "davglass",
+ "email": "davglass@gmail.com"
+ },
+ "_npmVersion": "2.13.5",
+ "_phantomChildren": {
+ "glob": "5.0.15",
+ "minimatch": "2.0.10"
+ },
+ "_requested": {
+ "raw": "istanbul@~0.3.0",
+ "scope": null,
+ "escapedName": "istanbul",
+ "name": "istanbul",
+ "rawSpec": "~0.3.0",
+ "spec": ">=0.3.0 <0.4.0",
+ "type": "range"
+ },
+ "_requiredBy": [
+ "/ibrik",
+ "/karma-coverage"
+ ],
+ "_resolved": "https://registry.npmjs.org/istanbul/-/istanbul-0.3.22.tgz",
+ "_shasum": "3e164d85021fe19c985d1f0e7ef0c3e22d012eb6",
+ "_shrinkwrap": null,
+ "_spec": "istanbul@~0.3.0",
+ "_where": "C:\\apache-tomcat-8.5.11\\webapps\\vnfmarket\\node_modules\\karma-coverage",
+ "author": {
+ "name": "Krishnan Anantheswaran",
+ "email": "kananthmail-github@yahoo.com"
+ },
+ "bin": {
+ "istanbul": "./lib/cli.js"
+ },
+ "bugs": {
+ "url": "https://github.com/gotwarlost/istanbul/issues"
+ },
+ "contributors": [
+ {
+ "name": "Reid Burke",
+ "email": "me@reidburke.com"
+ },
+ {
+ "name": "Martin Cooper",
+ "email": "mfncooper@gmail.com"
+ },
+ {
+ "name": "Dav Glass",
+ "email": "davglass@gmail.com"
+ },
+ {
+ "name": "nowamasa",
+ "email": "nowamasa@gmail.com"
+ },
+ {
+ "name": "Miller Medeiros @millermedeiros",
+ "email": "contact@millermedeiros.com"
+ },
+ {
+ "name": "Daniel Perez Alvarez @unindented",
+ "email": "unindented@gmail.com"
+ },
+ {
+ "name": "Mathias Bynens @mathiasbynens",
+ "email": "mathias@qiwi.be"
+ },
+ {
+ "name": "Nathan Brown @nbrownus",
+ "email": "nate@betable.com"
+ },
+ {
+ "name": "Brian Ng @existentialism",
+ "email": "bng412@gmail.com"
+ },
+ {
+ "name": "John Morrison @jrgm"
+ },
+ {
+ "name": "Tomaz Muraus @kami",
+ "email": "tomaz+github@tomaz.me"
+ },
+ {
+ "name": "Joe @jhansche",
+ "email": "jhansche@meetme.com"
+ },
+ {
+ "name": "Vojta Jina @vojtajina",
+ "email": "vojta.jina@gmail.com"
+ },
+ {
+ "name": "Dmitry Shirokov @runk",
+ "email": "deadrunk@gmail.com"
+ },
+ {
+ "name": "Chris Gladd @chrisgladd"
+ },
+ {
+ "name": "Sergey Belov",
+ "email": "peimei@ya.ru"
+ },
+ {
+ "name": "porneL @pornel",
+ "email": "pornel@pornel.net"
+ },
+ {
+ "name": "@asifrc"
+ },
+ {
+ "name": "Gergely Nemeth @gergelyke"
+ },
+ {
+ "name": "@bixdeng"
+ },
+ {
+ "name": "@mpderbec"
+ },
+ {
+ "name": "@jxiaodev"
+ },
+ {
+ "name": "Arpad Borsos @Swatinem",
+ "email": "arpad.borsos@googlemail.com"
+ },
+ {
+ "name": "Ariya Hidayat @ariya"
+ },
+ {
+ "name": "@markyen"
+ },
+ {
+ "name": "Sam Saccone @samccone",
+ "email": "sam@samx.it"
+ },
+ {
+ "name": "Jason Cheatham @jason0x43"
+ },
+ {
+ "name": "@smikes"
+ },
+ {
+ "name": "Yasyf Mohamedali @yasyf",
+ "email": "yasyfm@gmail.com"
+ },
+ {
+ "name": "Fabio Crisci @piuccio",
+ "email": "piuccio@gmail.com"
+ },
+ {
+ "name": "Ryan Roemer @ryan-roemer",
+ "email": "ryan@loose-bits.com"
+ },
+ {
+ "name": "Douglas Christopher Wilson @dougwilson"
+ },
+ {
+ "name": "Gustav Nikolaj @gustavnikolaj",
+ "email": "gustavnikolaj@gmail.com"
+ },
+ {
+ "name": "Denis Sokolov @denis-sokolov",
+ "email": "denis@sokolov.cc"
+ },
+ {
+ "name": "Yann Mainier @ymainier"
+ },
+ {
+ "name": "Yiyu He @dead-horse",
+ "email": "heyiyu.deadhorse@gmail.com"
+ },
+ {
+ "name": "Andrew Kelley @andrewrk",
+ "email": "superjoe30@gmail.com"
+ },
+ {
+ "name": "Will LaBranche @wlabranche",
+ "email": "will@labranche.io"
+ },
+ {
+ "name": "Mathieu Naouache @math-nao",
+ "email": "math.nao@outlook.com"
+ },
+ {
+ "name": "Ron Korving @ronkorving"
+ },
+ {
+ "name": "Rob McGuire-Dale @robatron",
+ "email": "rob.mcguiredale@gmail.com"
+ },
+ {
+ "name": "Justin Johnson @booleangate"
+ },
+ {
+ "name": "Juan Gabriel Jiménez @juangabreil",
+ "email": "juangabreil@gmail.com"
+ },
+ {
+ "name": "Daniel Sabelnikov @dragn",
+ "email": "dsabelnikov@gmail.com"
+ },
+ {
+ "name": "Tony Lukasavage @tonylukasavage",
+ "email": "anthony.lukasavage@gmail.com"
+ },
+ {
+ "name": "Simon Ramsay @nexus-uw"
+ },
+ {
+ "name": "Dominykas Blyžė @dominykas"
+ },
+ {
+ "name": "Seth Pollack @sethpollack"
+ },
+ {
+ "name": "Benjamin E. Coe @bcoe",
+ "email": "ben@npmjs.com"
+ },
+ {
+ "name": "Yuren Ju",
+ "email": "yurenju@gmail.com"
+ },
+ {
+ "name": "Aleksey Verkholantsev",
+ "email": "alex-vee@yandex-team.ru"
+ },
+ {
+ "name": "Ed S",
+ "email": "ejsanders@gmail.com"
+ },
+ {
+ "name": "Mordy Tikotzky",
+ "email": "mordytk@gmail.com"
+ },
+ {
+ "name": "Haoliang Gao @popomore",
+ "email": "sakura9515@gmail.com"
+ },
+ {
+ "name": "Roderick Hsiao @roderickhsiao"
+ },
+ {
+ "name": "Nikita Gusakov @nkt"
+ },
+ {
+ "name": "Alex Dunphy @alexdunphy",
+ "email": "alexanderdunphy@gmail.com"
+ },
+ {
+ "name": "Artemy Tregubenko @arty-name",
+ "email": "me@arty.name"
+ },
+ {
+ "name": "Arye Lukashevski @aryelu"
+ },
+ {
+ "name": "@sterlinghw"
+ },
+ {
+ "name": "Gord Tanner",
+ "email": "gord@bithound.io"
+ }
+ ],
+ "dependencies": {
+ "abbrev": "1.0.x",
+ "async": "1.x",
+ "escodegen": "1.7.x",
+ "esprima": "2.5.x",
+ "fileset": "0.2.x",
+ "handlebars": "^4.0.1",
+ "js-yaml": "3.x",
+ "mkdirp": "0.5.x",
+ "nopt": "3.x",
+ "once": "1.x",
+ "resolve": "1.1.x",
+ "supports-color": "^3.1.0",
+ "which": "^1.1.1",
+ "wordwrap": "^1.0.0"
+ },
+ "description": "Yet another JS code coverage tool that computes statement, line, function and branch coverage with module loader hooks to transparently add coverage when running tests. Supports all JS coverage use cases including unit tests, server side functional tests ",
+ "devDependencies": {
+ "coveralls": "2.x",
+ "glob": "^5.0.14",
+ "jshint": "^2.8.0",
+ "nodeunit": "0.9.x",
+ "requirejs": "2.x",
+ "rimraf": "^2.4.3"
+ },
+ "directories": {},
+ "dist": {
+ "shasum": "3e164d85021fe19c985d1f0e7ef0c3e22d012eb6",
+ "tarball": "https://registry.npmjs.org/istanbul/-/istanbul-0.3.22.tgz"
+ },
+ "files": [
+ "index.js",
+ "lib/"
+ ],
+ "gitHead": "2a6d054a3ae5b1582000b4c84ce16577a471c713",
+ "homepage": "https://github.com/gotwarlost/istanbul#readme",
+ "keywords": [
+ "coverage",
+ "code coverage",
+ "JS code coverage",
+ "JS coverage"
+ ],
+ "license": "BSD-3-Clause",
+ "maintainers": [
+ {
+ "name": "gotwarlost",
+ "email": "kananthmail-github@yahoo.com"
+ },
+ {
+ "name": "davglass",
+ "email": "davglass@gmail.com"
+ }
+ ],
+ "name": "istanbul",
+ "optionalDependencies": {},
+ "readme": "ERROR: No README data found!",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/gotwarlost/istanbul.git"
+ },
+ "scripts": {
+ "docs": "npm install yuidocjs && node node_modules/yuidocjs/lib/cli.js .",
+ "posttest": "node ./lib/cli.js check-coverage --statements 95 --branches 80",
+ "pretest": "jshint index.js lib/ test/ && ./download-escodegen-browser.sh",
+ "test": "node --harmony test/run.js"
+ },
+ "version": "0.3.22"
+}