diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index bfb841d..0000000 --- a/.editorconfig +++ /dev/null @@ -1,13 +0,0 @@ -# http://editorconfig.org -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -charset = utf-8 -trim_trailing_whitespace = true -insert_final_newline = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a48cf0d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +public diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..891377e --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "themes/gokarna"] + path = themes/gokarna + url = https://github.com/526avijitgupta/gokarna diff --git a/src/node_modules/acorn/dist/.keep b/.hugo_build.lock similarity index 100% rename from src/node_modules/acorn/dist/.keep rename to .hugo_build.lock diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index d368dec..0000000 --- a/.jshintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "node": true, - "esnext": true, - "bitwise": true, - "camelcase": true, - "curly": true, - "eqeqeq": true, - "immed": true, - "indent": 2, - "latedef": true, - "newcap": true, - "noarg": true, - "quotmark": "single", - "undef": true, - "unused": true, - "strict": true -} diff --git a/README.md b/README.md index 72a51ae..e6730c9 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ # Vertinext -Source of my Personal Website. Currently this uses React and React-Router. +Source of my Personal Website. Now using Hugo with the Gokarna theme. diff --git a/Sitemap b/Sitemap deleted file mode 100644 index e5212e3..0000000 --- a/Sitemap +++ /dev/null @@ -1 +0,0 @@ -http://www.vertinext.com/index.html diff --git a/archetypes/default.md b/archetypes/default.md new file mode 100644 index 0000000..c6f3fce --- /dev/null +++ b/archetypes/default.md @@ -0,0 +1,5 @@ ++++ +title = '{{ replace .File.ContentBaseName "-" " " | title }}' +date = {{ .Date }} +draft = true ++++ diff --git a/content/pages/_index.md b/content/pages/_index.md new file mode 100644 index 0000000..f471f67 --- /dev/null +++ b/content/pages/_index.md @@ -0,0 +1,17 @@ ++++ +date = 2024-02-26T01:11:55-05:00 +type = 'page' +image = 'Test' ++++ + +# Projects +A list of projects I've worked on that I like to showcase. + +## [PyMoe](https://github.com/ccubed/PyMoe) +PyMoe started out as a library I used in my AngelBot project to interact with the APIs available at various websites focusing on Anime, Manga, Light Novels, Web Novels, and Visual Novels. It has now become it's own independent project supporting the latest versions of Python 3 and recently updated to include several new services. It has over eighty stars and is currently used in over six hundred projects on Github. + +## [Earl](https://github.com/ccubed/Earl) +Earl also started out as a library to be used in Angelbot, however it later grew into a more general use project. Earl is a C++ extension for Python built against CPython to allow native packing and unpacking of the External Term Format used by Erlang. At the time, this was created to make parsing the ETF data received by Discord faster. Bots made in other languages had a slight speed advantage at parsing ETF. This extension leveled the playing field by utilizing C++ to very quickly serialize ETF into and out of Python objects. + +## [Downloop](https://github.com/ccubed/Downloop) +Downloop was a hobby project to create a Python image host with a built in web interface and API that would allow anyone to programmatically create and distribute a link to a hosted image. Downloop was focused on privacy and kept no data on who uploaded what. Images were not stored by name making them completely anonymous and all images were returned as binary data. It was able to shard itself automatically to distribute load, direct requests to the correct shard, and separated all stored image data into different root database tables based on shard. This meant that no one shard had a copy of all the images and that shards didn't know what existed between them. It also meant that we had no way to recover an image link if someone lost their initial link given upon image upload. \ No newline at end of file diff --git a/hugo.toml b/hugo.toml new file mode 100644 index 0000000..169baf4 --- /dev/null +++ b/hugo.toml @@ -0,0 +1,53 @@ +baseURL = 'https://www.vertinext.com' +defaultContentLanguage = 'en-us' +languageCode = 'en-us' +title = 'Charles Click' +theme = 'gokarna' +enableRobotsTXT = true + +[menu] + [[menu.main]] + identifier = 'home' + url = '/' + pre = '' + post = '' + name = 'Home' + weight = 1 + [[menu.main]] + identifier = 'projects' + url = '/pages/' + pre = '' + post = '' + name = 'Projects' + weight = 2 + [[menu.main]] + identifier = 'github' + url = 'https://www.github.com/ccubed' + weight = 3 + pre = '' + name = 'Github' + [[menu.main]] + identifier = 'keybase' + url = 'https://keybase.io/cclick' + weight = 4 + pre = '' + name = 'Keybase' + [[menu.main]] + identifier = 'resume' + url = 'https://drive.google.com/file/d/1xIWfZk8b3xa9ygUxurgAyUwHblPE_CrB/view?usp=sharing' + weight = 5 + pre = '' + name = 'Resume' + +[params] + avatarURL = '/images/Avatar.jpg' + avatarSize = 'size-m' + description = 'Sometimes I ask the computer to do things' + footer = 'Charles Click @ vertinext.com' + socialIcons = [ + {name = 'linkedin', url = 'https://www.linkedin.com/in/charles-click-b078a959/'}, + {name = 'mastodon', url = 'https://mastodon.social/@RoryEjinn'}, + {name = 'twitch', url = 'https://www.twitch.tv/teshiko'}, + {name = 'email', url = 'ccubed.techno@gmail.com'} + ] + metaKeywords = ['vertinext', 'charles click', 'portfolio', 'cooper'] \ No newline at end of file diff --git a/src/App/Components/BlogPost.js b/src/App/Components/BlogPost.js deleted file mode 100644 index a10c1df..0000000 --- a/src/App/Components/BlogPost.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import Spinner from 'react-spinkit'; - -class BlogPost extends React.Component { - - render(){ - - return(

Specific Post

); - - } - -} - -module.exports = BlogPost; diff --git a/src/App/Components/GitItem.js b/src/App/Components/GitItem.js deleted file mode 100644 index 408bac0..0000000 --- a/src/App/Components/GitItem.js +++ /dev/null @@ -1,36 +0,0 @@ -import React from 'react'; -import Spinner from 'react-spinkit'; - -class Gititem extends React.Component { - - constructor(props){ - - super(); - - } - - render() { - - var repoNodes = []; - - if( this.props.data.length > 0 ){ - - this.props.data.forEach(function(repo){ - - repoNodes.push(
  • - {repo.owner.login} - {repo.name} -

    {repo.description ? repo.description : "No description given."}

    - -
  • ); - - }); - - } - - return repoNodes.length > 0 ? () : (); - - } -} - -module.exports = Gititem; diff --git a/src/App/Components/GitListing.js b/src/App/Components/GitListing.js deleted file mode 100644 index 705ffeb..0000000 --- a/src/App/Components/GitListing.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import GitItem from './GitItem'; - -class GitListing extends React.Component { - - constructor(props){ - - super(props); - this.state = {data: []}; - - } - - loadGitRepos(){ - - $.ajax({ - url: "https://api.github.com/users/ccubed/repos", - dataType: 'json', - success: (data) =>{ - this.setState({data: data}); - }, - error: (xhr, status, err) => { - console.error("api.github.com", status, err.toString()); - } - }); - - } - - componentDidMount(){ - - this.loadGitRepos(); - - } - - render(){ - - return (
    ) - - } - -} - -module.exports = GitListing; diff --git a/src/App/Components/HostLists.js b/src/App/Components/HostLists.js deleted file mode 100644 index 88f6273..0000000 --- a/src/App/Components/HostLists.js +++ /dev/null @@ -1,49 +0,0 @@ -import React from 'react'; - -class HostLists extends React.Component { - -render(){ - - return( - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    URLDescription
    www.vertinext.comThis Website
    kingsmouth.vertinext.comWebsite built for a now defunct text game. Acted as an admin interface.
    safehaven.vertinext.comWiki for a text game
    welltrackr.vertinext.comMock health tracking website made for family that never got used
    git.vertinext.comPersonal gitlab server
    radialblur.vertinext.comDjango website for a text based game
    - ) - -} - -} - -module.exports = HostLists; diff --git a/src/App/Components/Menu.js b/src/App/Components/Menu.js deleted file mode 100644 index abf35e2..0000000 --- a/src/App/Components/Menu.js +++ /dev/null @@ -1,21 +0,0 @@ -import React from 'react'; -import MenuItem from './MenuItem'; - -class Menu extends React.Component { - render() { - return ( - - ); - } -} - -module.exports = Menu; diff --git a/src/App/Components/MenuItem.js b/src/App/Components/MenuItem.js deleted file mode 100644 index 883e950..0000000 --- a/src/App/Components/MenuItem.js +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react'; -import {Link} from 'react-router'; - -class MenuItem extends React.Component { - render() { - return ( -
  • - - {this.props.text} - -
  • - ); - } -} - -module.exports = MenuItem; diff --git a/src/App/Components/RecentPosts.js b/src/App/Components/RecentPosts.js deleted file mode 100644 index f4719ca..0000000 --- a/src/App/Components/RecentPosts.js +++ /dev/null @@ -1,14 +0,0 @@ -import React from 'react'; -import Spinner from 'react-spinkit'; - -class RecentPosts extends React.Component { - - render(){ - - return(

    Recent Posts

    ); - - } - -} - -module.exports = RecentPosts; diff --git a/src/App/Core/App.js b/src/App/Core/App.js deleted file mode 100644 index 8ea46b3..0000000 --- a/src/App/Core/App.js +++ /dev/null @@ -1,5 +0,0 @@ -import React from 'react'; -import Router from 'react-router'; -import routes from './Routes'; - -Router.run(routes, (Handler) => React.render( , document.body)); diff --git a/src/App/Core/Layout.js b/src/App/Core/Layout.js deleted file mode 100644 index 4a4bb83..0000000 --- a/src/App/Core/Layout.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import Router from 'react-router'; -var {RouteHandler} = Router; - -import Menu from '../Components/Menu'; - -class App extends React.Component { - render() { - return ( -
    - - -
    - ); - } -} - -module.exports = App; diff --git a/src/App/Core/Routes.js b/src/App/Core/Routes.js deleted file mode 100644 index 9c94ad9..0000000 --- a/src/App/Core/Routes.js +++ /dev/null @@ -1,20 +0,0 @@ -import React from 'react'; -import Router from 'react-router'; -var {DefaultRoute, Route} = Router; - -import Layout from './Layout'; -import Home from '../Views/Home'; -import Gitrepos from '../Views/Gitrepos'; -import Hosts from '../Views/Hosts'; -import Blog from '../Views/Blog'; - -var routes = ( - - - - - - -); - -module.exports = routes; diff --git a/src/App/Views/Blog.js b/src/App/Views/Blog.js deleted file mode 100644 index 6289198..0000000 --- a/src/App/Views/Blog.js +++ /dev/null @@ -1,13 +0,0 @@ -import React from 'react'; -import BlogPost from '../Components/BlogPost'; -import RecentPosts from '../Components/RecentPosts'; - -class Blog extends React.Component { - render() { - return ( - - ); - } -} - -module.exports = Blog; diff --git a/src/App/Views/Gitrepos.js b/src/App/Views/Gitrepos.js deleted file mode 100644 index 264afe6..0000000 --- a/src/App/Views/Gitrepos.js +++ /dev/null @@ -1,12 +0,0 @@ -import React from 'react'; -import GitListing from '../Components/GitListing'; - -class Gitrepos extends React.Component { - render() { - return ( - - ); - } -} - -module.exports = Gitrepos; diff --git a/src/App/Views/Home.js b/src/App/Views/Home.js deleted file mode 100644 index a0318df..0000000 --- a/src/App/Views/Home.js +++ /dev/null @@ -1,30 +0,0 @@ -import React from 'react'; - -class Home extends React.Component { - render() { - return ( -
    -
    -
    -
    -
    - Charles C Click
    - Email: CharlesClick@vertinext.com
    - Skillset: Web Development
    - This Website: React and Materialize
    -
    - I am a coder and web developer in Knoxville, TN, who also hosts websites, games and other services through a personal server. There is a list of my Github repositories and currently hosted games and services available on other pages. -
    -
    - -
    -
    -
    -
    - ); - } -} - -module.exports = Home; diff --git a/src/App/Views/Hosts.js b/src/App/Views/Hosts.js deleted file mode 100644 index 56423c8..0000000 --- a/src/App/Views/Hosts.js +++ /dev/null @@ -1,18 +0,0 @@ -import React from 'react'; -import HostLists from '../Components/HostLists'; - -class Hosts extends React.Component { - render() { - return ( -
    -
    -
    - -
    -
    -
    - ); - } -} - -module.exports = Hosts; diff --git a/src/App/app.js b/src/App/app.js deleted file mode 100644 index 38226c9..0000000 --- a/src/App/app.js +++ /dev/null @@ -1 +0,0 @@ -import './Core/App'; diff --git a/src/App/index.html b/src/App/index.html deleted file mode 100644 index dba13d3..0000000 --- a/src/App/index.html +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - Charles Click - - - - - - - - - diff --git a/src/build/app.js b/src/build/app.js deleted file mode 100644 index 8942ef1..0000000 --- a/src/build/app.js +++ /dev/null @@ -1,24120 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 0) { - - this.props.data.forEach(function (repo) { - - repoNodes.push(_react2['default'].createElement( - 'li', - { className: 'collection-item avatar' }, - _react2['default'].createElement('img', { className: 'circle', src: repo.owner.avatar_url, alt: repo.owner.login }), - _react2['default'].createElement( - 'span', - { className: 'title' }, - _react2['default'].createElement( - 'a', - { href: repo.html_url }, - repo.name - ) - ), - _react2['default'].createElement( - 'p', - null, - repo.description ? repo.description : "No description given." - ), - _react2['default'].createElement( - 'a', - { href: repo.forks_url, className: 'secondary-content' }, - _react2['default'].createElement('i', { className: 'fa fa-code-fork fa-2x' }) - ) - )); - }); - } - - return repoNodes.length > 0 ? _react2['default'].createElement( - 'ul', - { className: 'collection' }, - repoNodes - ) : _react2['default'].createElement(_reactSpinkit2['default'], { spinnerName: 'three-bounce' }); - } - }]); - - return Gititem; -})(_react2['default'].Component); - -module.exports = Gititem; - -},{"react":227,"react-spinkit":72}],3:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _GitItem = require('./GitItem'); - -var _GitItem2 = _interopRequireDefault(_GitItem); - -var GitListing = (function (_React$Component) { - _inherits(GitListing, _React$Component); - - function GitListing(props) { - _classCallCheck(this, GitListing); - - _get(Object.getPrototypeOf(GitListing.prototype), 'constructor', this).call(this, props); - this.state = { data: [] }; - } - - _createClass(GitListing, [{ - key: 'loadGitRepos', - value: function loadGitRepos() { - var _this = this; - - $.ajax({ - url: "https://api.github.com/users/ccubed/repos", - dataType: 'json', - success: function success(data) { - _this.setState({ data: data }); - }, - error: function error(xhr, status, err) { - console.error("api.github.com", status, err.toString()); - } - }); - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - - this.loadGitRepos(); - } - }, { - key: 'render', - value: function render() { - - return _react2['default'].createElement( - 'div', - { className: 'container' }, - _react2['default'].createElement( - 'div', - { className: 'row' }, - _react2['default'].createElement( - 'div', - { className: 'col s6 m12' }, - _react2['default'].createElement(_GitItem2['default'], { data: this.state.data }) - ) - ) - ); - } - }]); - - return GitListing; -})(_react2['default'].Component); - -module.exports = GitListing; - -},{"./GitItem":2,"react":227}],4:[function(require,module,exports){ -"use strict"; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var HostLists = (function (_React$Component) { - _inherits(HostLists, _React$Component); - - function HostLists() { - _classCallCheck(this, HostLists); - - _get(Object.getPrototypeOf(HostLists.prototype), "constructor", this).apply(this, arguments); - } - - _createClass(HostLists, [{ - key: "render", - value: function render() { - - return _react2["default"].createElement( - "table", - { className: "highlight centered" }, - _react2["default"].createElement( - "thead", - null, - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "th", - { "data-field": "url" }, - "URL" - ), - _react2["default"].createElement( - "th", - { "data-field": "desc" }, - "Description" - ) - ) - ), - _react2["default"].createElement( - "tbody", - null, - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "https://www.vertinext.com" }, - "www.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "This Website" - ) - ), - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "https://kingsmouth.vertinext.com" }, - "kingsmouth.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "Website built for a now defunct text game. Acted as an admin interface." - ) - ), - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "https://safehaven.vertinext.com" }, - "safehaven.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "Wiki for a text game" - ) - ), - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "https://welltrackr.vertinext.com" }, - "welltrackr.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "Mock health tracking website made for family that never got used" - ) - ), - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "http://git.vertinext.com" }, - "git.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "Personal gitlab server" - ) - ), - _react2["default"].createElement( - "tr", - null, - _react2["default"].createElement( - "td", - null, - _react2["default"].createElement( - "a", - { href: "http://radialblur.vertinext.com" }, - "radialblur.vertinext.com" - ) - ), - _react2["default"].createElement( - "td", - null, - "Django website for a text based game" - ) - ) - ) - ); - } - }]); - - return HostLists; -})(_react2["default"].Component); - -module.exports = HostLists; - -},{"react":227}],5:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _MenuItem = require('./MenuItem'); - -var _MenuItem2 = _interopRequireDefault(_MenuItem); - -var Menu = (function (_React$Component) { - _inherits(Menu, _React$Component); - - function Menu() { - _classCallCheck(this, Menu); - - _get(Object.getPrototypeOf(Menu.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(Menu, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement( - 'nav', - null, - _react2['default'].createElement( - 'div', - { 'class': 'nav-wrapper' }, - _react2['default'].createElement( - 'ul', - { 'class': 'left' }, - _react2['default'].createElement(_MenuItem2['default'], { route: 'app', text: 'Home' }), - _react2['default'].createElement(_MenuItem2['default'], { route: 'gitrepos', text: 'Github Repos' }), - _react2['default'].createElement(_MenuItem2['default'], { route: 'hosting', text: 'Hosting' }), - _react2['default'].createElement(_MenuItem2['default'], { route: 'blog', text: 'Blog' }) - ) - ) - ); - } - }]); - - return Menu; -})(_react2['default'].Component); - -module.exports = Menu; - -},{"./MenuItem":6,"react":227}],6:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouter = require('react-router'); - -var MenuItem = (function (_React$Component) { - _inherits(MenuItem, _React$Component); - - function MenuItem() { - _classCallCheck(this, MenuItem); - - _get(Object.getPrototypeOf(MenuItem.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(MenuItem, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement( - 'li', - null, - _react2['default'].createElement( - _reactRouter.Link, - { to: this.props.route }, - this.props.text - ) - ); - } - }]); - - return MenuItem; -})(_react2['default'].Component); - -module.exports = MenuItem; - -},{"react":227,"react-router":45}],7:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactSpinkit = require('react-spinkit'); - -var _reactSpinkit2 = _interopRequireDefault(_reactSpinkit); - -var RecentPosts = (function (_React$Component) { - _inherits(RecentPosts, _React$Component); - - function RecentPosts() { - _classCallCheck(this, RecentPosts); - - _get(Object.getPrototypeOf(RecentPosts.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(RecentPosts, [{ - key: 'render', - value: function render() { - - return _react2['default'].createElement( - 'h3', - null, - 'Recent Posts' - ); - } - }]); - - return RecentPosts; -})(_react2['default'].Component); - -module.exports = RecentPosts; - -},{"react":227,"react-spinkit":72}],8:[function(require,module,exports){ -'use strict'; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouter = require('react-router'); - -var _reactRouter2 = _interopRequireDefault(_reactRouter); - -var _Routes = require('./Routes'); - -var _Routes2 = _interopRequireDefault(_Routes); - -_reactRouter2['default'].run(_Routes2['default'], function (Handler) { - return _react2['default'].render(_react2['default'].createElement(Handler, null), document.body); -}); - -},{"./Routes":10,"react":227,"react-router":45}],9:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouter = require('react-router'); - -var _reactRouter2 = _interopRequireDefault(_reactRouter); - -var _ComponentsMenu = require('../Components/Menu'); - -var _ComponentsMenu2 = _interopRequireDefault(_ComponentsMenu); - -var RouteHandler = _reactRouter2['default'].RouteHandler; - -var App = (function (_React$Component) { - _inherits(App, _React$Component); - - function App() { - _classCallCheck(this, App); - - _get(Object.getPrototypeOf(App.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(App, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement( - 'div', - null, - _react2['default'].createElement(_ComponentsMenu2['default'], null), - _react2['default'].createElement(RouteHandler, null) - ); - } - }]); - - return App; -})(_react2['default'].Component); - -module.exports = App; - -},{"../Components/Menu":5,"react":227,"react-router":45}],10:[function(require,module,exports){ -'use strict'; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _reactRouter = require('react-router'); - -var _reactRouter2 = _interopRequireDefault(_reactRouter); - -var _Layout = require('./Layout'); - -var _Layout2 = _interopRequireDefault(_Layout); - -var _ViewsHome = require('../Views/Home'); - -var _ViewsHome2 = _interopRequireDefault(_ViewsHome); - -var _ViewsGitrepos = require('../Views/Gitrepos'); - -var _ViewsGitrepos2 = _interopRequireDefault(_ViewsGitrepos); - -var _ViewsHosts = require('../Views/Hosts'); - -var _ViewsHosts2 = _interopRequireDefault(_ViewsHosts); - -var _ViewsBlog = require('../Views/Blog'); - -var _ViewsBlog2 = _interopRequireDefault(_ViewsBlog); - -var DefaultRoute = _reactRouter2['default'].DefaultRoute; -var Route = _reactRouter2['default'].Route; - -var routes = _react2['default'].createElement( - Route, - { name: 'app', path: '/', handler: _Layout2['default'] }, - _react2['default'].createElement(Route, { name: 'gitrepos', path: 'gitrepos', handler: _ViewsGitrepos2['default'] }), - _react2['default'].createElement(Route, { name: 'hosting', path: 'hosting', handler: _ViewsHosts2['default'] }), - _react2['default'].createElement(Route, { name: 'blog', path: 'blog', handler: _ViewsBlog2['default'] }), - _react2['default'].createElement(DefaultRoute, { handler: _ViewsHome2['default'] }) -); - -module.exports = routes; - -},{"../Views/Blog":11,"../Views/Gitrepos":12,"../Views/Home":13,"../Views/Hosts":14,"./Layout":9,"react":227,"react-router":45}],11:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _ComponentsBlogPost = require('../Components/BlogPost'); - -var _ComponentsBlogPost2 = _interopRequireDefault(_ComponentsBlogPost); - -var _ComponentsRecentPosts = require('../Components/RecentPosts'); - -var _ComponentsRecentPosts2 = _interopRequireDefault(_ComponentsRecentPosts); - -var Blog = (function (_React$Component) { - _inherits(Blog, _React$Component); - - function Blog() { - _classCallCheck(this, Blog); - - _get(Object.getPrototypeOf(Blog.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(Blog, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement(_ComponentsRecentPosts2['default'], null); - } - }]); - - return Blog; -})(_react2['default'].Component); - -module.exports = Blog; - -},{"../Components/BlogPost":1,"../Components/RecentPosts":7,"react":227}],12:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _ComponentsGitListing = require('../Components/GitListing'); - -var _ComponentsGitListing2 = _interopRequireDefault(_ComponentsGitListing); - -var Gitrepos = (function (_React$Component) { - _inherits(Gitrepos, _React$Component); - - function Gitrepos() { - _classCallCheck(this, Gitrepos); - - _get(Object.getPrototypeOf(Gitrepos.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(Gitrepos, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement(_ComponentsGitListing2['default'], null); - } - }]); - - return Gitrepos; -})(_react2['default'].Component); - -module.exports = Gitrepos; - -},{"../Components/GitListing":3,"react":227}],13:[function(require,module,exports){ -"use strict"; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ("value" in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var Home = (function (_React$Component) { - _inherits(Home, _React$Component); - - function Home() { - _classCallCheck(this, Home); - - _get(Object.getPrototypeOf(Home.prototype), "constructor", this).apply(this, arguments); - } - - _createClass(Home, [{ - key: "render", - value: function render() { - return _react2["default"].createElement( - "div", - { className: "container" }, - _react2["default"].createElement( - "div", - { className: "row" }, - _react2["default"].createElement( - "div", - { className: "col s12" }, - _react2["default"].createElement( - "div", - { className: "card hoverable" }, - _react2["default"].createElement( - "div", - { className: "card-content red-text" }, - _react2["default"].createElement( - "span", - { className: "card-title red-text" }, - "Charles C Click" - ), - _react2["default"].createElement("br", null), - "Email: ", - _react2["default"].createElement( - "a", - { href: "mailto:CharlesClick@vertinext.com" }, - "CharlesClick@vertinext.com" - ), - _react2["default"].createElement("br", null), - "Skillset: Web Development", - _react2["default"].createElement("br", null), - "This Website: ", - _react2["default"].createElement( - "a", - { href: "https://facebook.github.io/react/" }, - "React" - ), - " and ", - _react2["default"].createElement( - "a", - { href: "http://materializecss.com/" }, - "Materialize" - ), - _react2["default"].createElement("br", null), - _react2["default"].createElement( - "blockquote", - null, - "I am a coder and web developer in Knoxville, TN, who also hosts websites, games and other services through a personal server. There is a list of my Github repositories and currently hosted games and services available on other pages." - ) - ), - _react2["default"].createElement( - "div", - { className: "card-action red-text" }, - _react2["default"].createElement( - "a", - { href: "https://docs.google.com/document/d/1ykS2_34-GQd0SbrjpG9NbBvq40L62qWxGJc43KAjOD8/edit?usp=sharing" }, - "View Resume" - ) - ) - ) - ) - ) - ); - } - }]); - - return Home; -})(_react2["default"].Component); - -module.exports = Home; - -},{"react":227}],14:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { 'default': obj }; } - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _react = require('react'); - -var _react2 = _interopRequireDefault(_react); - -var _ComponentsHostLists = require('../Components/HostLists'); - -var _ComponentsHostLists2 = _interopRequireDefault(_ComponentsHostLists); - -var Hosts = (function (_React$Component) { - _inherits(Hosts, _React$Component); - - function Hosts() { - _classCallCheck(this, Hosts); - - _get(Object.getPrototypeOf(Hosts.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(Hosts, [{ - key: 'render', - value: function render() { - return _react2['default'].createElement( - 'div', - { className: 'container' }, - _react2['default'].createElement( - 'div', - { className: 'row' }, - _react2['default'].createElement( - 'div', - { className: 'col s12' }, - _react2['default'].createElement(_ComponentsHostLists2['default'], null) - ) - ) - ); - } - }]); - - return Hosts; -})(_react2['default'].Component); - -module.exports = Hosts; - -},{"../Components/HostLists":4,"react":227}],15:[function(require,module,exports){ -'use strict'; - -require('./Core/App'); - -},{"./Core/App":8}],16:[function(require,module,exports){ -var canUseDOM = !!( - typeof window !== 'undefined' && - window.document && - window.document.createElement -); - -module.exports = canUseDOM; -},{}],17:[function(require,module,exports){ -/*! - Copyright (c) 2015 Jed Watson. - Licensed under the MIT License (MIT), see - http://jedwatson.github.io/classnames -*/ - -function classNames() { - var classes = ''; - var arg; - - for (var i = 0; i < arguments.length; i++) { - arg = arguments[i]; - if (!arg) { - continue; - } - - if ('string' === typeof arg || 'number' === typeof arg) { - classes += ' ' + arg; - } else if (Object.prototype.toString.call(arg) === '[object Array]') { - classes += ' ' + classNames.apply(null, arg); - } else if ('object' === typeof arg) { - for (var key in arg) { - if (!arg.hasOwnProperty(key) || !arg[key]) { - continue; - } - classes += ' ' + key; - } - } - } - return classes.substr(1); -} - -// safely export classNames for node / browserify -if (typeof module !== 'undefined' && module.exports) { - module.exports = classNames; -} - -// safely export classNames for RequireJS -if (typeof define !== 'undefined' && define.amd) { - define('classnames', [], function() { - return classNames; - }); -} - -},{}],18:[function(require,module,exports){ -'use strict' - -function injectStyleTag (document, fileName, cb) { - var style = document.getElementById(fileName) - - if (style) { - cb(style) - } else { - var head = document.getElementsByTagName('head')[0] - - style = document.createElement('style') - if (fileName != null) style.id = fileName - cb(style) - head.appendChild(style) - } - - return style -} - -module.exports = function (css, customDocument, fileName) { - var doc = customDocument || document - /* istanbul ignore if: not supported by Electron */ - if (doc.createStyleSheet) { - var sheet = doc.createStyleSheet() - sheet.cssText = css - return sheet.ownerNode - } else { - return injectStyleTag(doc, fileName, function (style) { - /* istanbul ignore if: not supported by Electron */ - if (style.styleSheet) { - style.styleSheet.cssText = css - } else { - style.innerHTML = css - } - }) - } -} - -module.exports.byUrl = function (url) { - /* istanbul ignore if: not supported by Electron */ - if (document.createStyleSheet) { - return document.createStyleSheet(url).ownerNode - } else { - var head = document.getElementsByTagName('head')[0] - var link = document.createElement('link') - - link.rel = 'stylesheet' - link.href = url - - head.appendChild(link) - return link - } -} - -},{}],19:[function(require,module,exports){ -(function (process){ -/** - * Copyright 2013-2015, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * LICENSE file in the root directory of this source tree. An additional grant - * of patent rights can be found in the PATENTS file in the same directory. - */ - -'use strict'; - -/** - * Use invariant() to assert state which your program assumes to be true. - * - * Provide sprintf-style format (only %s is supported) and arguments - * to provide information about what broke and what you were - * expecting. - * - * The invariant message will be stripped in production, but the invariant - * will remain to ensure logic does not differ in production. - */ - -var invariant = function(condition, format, a, b, c, d, e, f) { - if (process.env.NODE_ENV !== 'production') { - if (format === undefined) { - throw new Error('invariant requires an error message argument'); - } - } - - if (!condition) { - var error; - if (format === undefined) { - error = new Error( - 'Minified exception occurred; use the non-minified dev environment ' + - 'for the full error message and additional helpful warnings.' - ); - } else { - var args = [a, b, c, d, e, f]; - var argIndex = 0; - error = new Error( - format.replace(/%s/g, function() { return args[argIndex++]; }) - ); - error.name = 'Invariant Violation'; - } - - error.framesToPop = 1; // we don't care about invariant's own frame - throw error; - } -}; - -module.exports = invariant; - -}).call(this,require('_process')) -},{"_process":20}],20:[function(require,module,exports){ -// shim for using process in browser - -var process = module.exports = {}; -var queue = []; -var draining = false; -var currentQueue; -var queueIndex = -1; - -function cleanUpNextTick() { - draining = false; - if (currentQueue.length) { - queue = currentQueue.concat(queue); - } else { - queueIndex = -1; - } - if (queue.length) { - drainQueue(); - } -} - -function drainQueue() { - if (draining) { - return; - } - var timeout = setTimeout(cleanUpNextTick); - draining = true; - - var len = queue.length; - while(len) { - currentQueue = queue; - queue = []; - while (++queueIndex < len) { - if (currentQueue) { - currentQueue[queueIndex].run(); - } - } - queueIndex = -1; - len = queue.length; - } - currentQueue = null; - draining = false; - clearTimeout(timeout); -} - -process.nextTick = function (fun) { - var args = new Array(arguments.length - 1); - if (arguments.length > 1) { - for (var i = 1; i < arguments.length; i++) { - args[i - 1] = arguments[i]; - } - } - queue.push(new Item(fun, args)); - if (queue.length === 1 && !draining) { - setTimeout(drainQueue, 0); - } -}; - -// v8 likes predictible objects -function Item(fun, array) { - this.fun = fun; - this.array = array; -} -Item.prototype.run = function () { - this.fun.apply(null, this.array); -}; -process.title = 'browser'; -process.browser = true; -process.env = {}; -process.argv = []; -process.version = ''; // empty string to avoid regexp issues -process.versions = {}; - -function noop() {} - -process.on = noop; -process.addListener = noop; -process.once = noop; -process.off = noop; -process.removeListener = noop; -process.removeAllListeners = noop; -process.emit = noop; - -process.binding = function (name) { - throw new Error('process.binding is not supported'); -}; - -process.cwd = function () { return '/' }; -process.chdir = function (dir) { - throw new Error('process.chdir is not supported'); -}; -process.umask = function() { return 0; }; - -},{}],21:[function(require,module,exports){ -/** - * Represents a cancellation caused by navigating away - * before the previous transition has fully resolved. - */ -"use strict"; - -function Cancellation() {} - -module.exports = Cancellation; -},{}],22:[function(require,module,exports){ -'use strict'; - -var invariant = require('invariant'); -var canUseDOM = require('can-use-dom'); - -var History = { - - /** - * The current number of entries in the history. - * - * Note: This property is read-only. - */ - length: 1, - - /** - * Sends the browser back one entry in the history. - */ - back: function back() { - invariant(canUseDOM, 'Cannot use History.back without a DOM'); - - // Do this first so that History.length will - // be accurate in location change listeners. - History.length -= 1; - - window.history.back(); - } - -}; - -module.exports = History; -},{"can-use-dom":16,"invariant":19}],23:[function(require,module,exports){ -/* jshint -W084 */ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var PathUtils = require('./PathUtils'); - -function deepSearch(route, pathname, query) { - // Check the subtree first to find the most deeply-nested match. - var childRoutes = route.childRoutes; - if (childRoutes) { - var match, childRoute; - for (var i = 0, len = childRoutes.length; i < len; ++i) { - childRoute = childRoutes[i]; - - if (childRoute.isDefault || childRoute.isNotFound) continue; // Check these in order later. - - if (match = deepSearch(childRoute, pathname, query)) { - // A route in the subtree matched! Add this route and we're done. - match.routes.unshift(route); - return match; - } - } - } - - // No child routes matched; try the default route. - var defaultRoute = route.defaultRoute; - if (defaultRoute && (params = PathUtils.extractParams(defaultRoute.path, pathname))) return new Match(pathname, params, query, [route, defaultRoute]); - - // Does the "not found" route match? - var notFoundRoute = route.notFoundRoute; - if (notFoundRoute && (params = PathUtils.extractParams(notFoundRoute.path, pathname))) return new Match(pathname, params, query, [route, notFoundRoute]); - - // Last attempt: check this route. - var params = PathUtils.extractParams(route.path, pathname); - if (params) return new Match(pathname, params, query, [route]); - - return null; -} - -var Match = (function () { - _createClass(Match, null, [{ - key: 'findMatch', - - /** - * Attempts to match depth-first a route in the given route's - * subtree against the given path and returns the match if it - * succeeds, null if no match can be made. - */ - value: function findMatch(routes, path) { - var pathname = PathUtils.withoutQuery(path); - var query = PathUtils.extractQuery(path); - var match = null; - - for (var i = 0, len = routes.length; match == null && i < len; ++i) match = deepSearch(routes[i], pathname, query); - - return match; - } - }]); - - function Match(pathname, params, query, routes) { - _classCallCheck(this, Match); - - this.pathname = pathname; - this.params = params; - this.query = query; - this.routes = routes; - } - - return Match; -})(); - -module.exports = Match; -},{"./PathUtils":25}],24:[function(require,module,exports){ -'use strict'; - -var PropTypes = require('./PropTypes'); - -/** - * A mixin for components that modify the URL. - * - * Example: - * - * var MyLink = React.createClass({ - * mixins: [ Router.Navigation ], - * handleClick(event) { - * event.preventDefault(); - * this.transitionTo('aRoute', { the: 'params' }, { the: 'query' }); - * }, - * render() { - * return ( - * Click me! - * ); - * } - * }); - */ -var Navigation = { - - contextTypes: { - router: PropTypes.router.isRequired - }, - - /** - * Returns an absolute URL path created from the given route - * name, URL parameters, and query values. - */ - makePath: function makePath(to, params, query) { - return this.context.router.makePath(to, params, query); - }, - - /** - * Returns a string that may safely be used as the href of a - * link to the route with the given name. - */ - makeHref: function makeHref(to, params, query) { - return this.context.router.makeHref(to, params, query); - }, - - /** - * Transitions to the URL specified in the arguments by pushing - * a new URL onto the history stack. - */ - transitionTo: function transitionTo(to, params, query) { - this.context.router.transitionTo(to, params, query); - }, - - /** - * Transitions to the URL specified in the arguments by replacing - * the current URL in the history stack. - */ - replaceWith: function replaceWith(to, params, query) { - this.context.router.replaceWith(to, params, query); - }, - - /** - * Transitions to the previous URL. - */ - goBack: function goBack() { - return this.context.router.goBack(); - } - -}; - -module.exports = Navigation; -},{"./PropTypes":26}],25:[function(require,module,exports){ -'use strict'; - -var invariant = require('invariant'); -var assign = require('object-assign'); -var qs = require('qs'); - -var paramCompileMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$]*)|[*.()\[\]\\+|{}^$]/g; -var paramInjectMatcher = /:([a-zA-Z_$][a-zA-Z0-9_$?]*[?]?)|[*]/g; -var paramInjectTrailingSlashMatcher = /\/\/\?|\/\?\/|\/\?(?![^\/=]+=.*$)/g; -var queryMatcher = /\?(.*)$/; - -var _compiledPatterns = {}; - -function compilePattern(pattern) { - if (!(pattern in _compiledPatterns)) { - var paramNames = []; - var source = pattern.replace(paramCompileMatcher, function (match, paramName) { - if (paramName) { - paramNames.push(paramName); - return '([^/?#]+)'; - } else if (match === '*') { - paramNames.push('splat'); - return '(.*?)'; - } else { - return '\\' + match; - } - }); - - _compiledPatterns[pattern] = { - matcher: new RegExp('^' + source + '$', 'i'), - paramNames: paramNames - }; - } - - return _compiledPatterns[pattern]; -} - -var PathUtils = { - - /** - * Returns true if the given path is absolute. - */ - isAbsolute: function isAbsolute(path) { - return path.charAt(0) === '/'; - }, - - /** - * Joins two URL paths together. - */ - join: function join(a, b) { - return a.replace(/\/*$/, '/') + b; - }, - - /** - * Returns an array of the names of all parameters in the given pattern. - */ - extractParamNames: function extractParamNames(pattern) { - return compilePattern(pattern).paramNames; - }, - - /** - * Extracts the portions of the given URL path that match the given pattern - * and returns an object of param name => value pairs. Returns null if the - * pattern does not match the given path. - */ - extractParams: function extractParams(pattern, path) { - var _compilePattern = compilePattern(pattern); - - var matcher = _compilePattern.matcher; - var paramNames = _compilePattern.paramNames; - - var match = path.match(matcher); - - if (!match) return null; - - var params = {}; - - paramNames.forEach(function (paramName, index) { - params[paramName] = match[index + 1]; - }); - - return params; - }, - - /** - * Returns a version of the given route path with params interpolated. Throws - * if there is a dynamic segment of the route path for which there is no param. - */ - injectParams: function injectParams(pattern, params) { - params = params || {}; - - var splatIndex = 0; - - return pattern.replace(paramInjectMatcher, function (match, paramName) { - paramName = paramName || 'splat'; - - // If param is optional don't check for existence - if (paramName.slice(-1) === '?') { - paramName = paramName.slice(0, -1); - - if (params[paramName] == null) return ''; - } else { - invariant(params[paramName] != null, 'Missing "%s" parameter for path "%s"', paramName, pattern); - } - - var segment; - if (paramName === 'splat' && Array.isArray(params[paramName])) { - segment = params[paramName][splatIndex++]; - - invariant(segment != null, 'Missing splat # %s for path "%s"', splatIndex, pattern); - } else { - segment = params[paramName]; - } - - return segment; - }).replace(paramInjectTrailingSlashMatcher, '/'); - }, - - /** - * Returns an object that is the result of parsing any query string contained - * in the given path, null if the path contains no query string. - */ - extractQuery: function extractQuery(path) { - var match = path.match(queryMatcher); - return match && qs.parse(match[1]); - }, - - /** - * Returns a version of the given path without the query string. - */ - withoutQuery: function withoutQuery(path) { - return path.replace(queryMatcher, ''); - }, - - /** - * Returns a version of the given path with the parameters in the given - * query merged into the query string. - */ - withQuery: function withQuery(path, query) { - var existingQuery = PathUtils.extractQuery(path); - - if (existingQuery) query = query ? assign(existingQuery, query) : existingQuery; - - var queryString = qs.stringify(query, { arrayFormat: 'brackets' }); - - if (queryString) return PathUtils.withoutQuery(path) + '?' + queryString; - - return PathUtils.withoutQuery(path); - } - -}; - -module.exports = PathUtils; -},{"invariant":19,"object-assign":55,"qs":56}],26:[function(require,module,exports){ -'use strict'; - -var assign = require('react/lib/Object.assign'); -var ReactPropTypes = require('react').PropTypes; -var Route = require('./Route'); - -var PropTypes = assign({}, ReactPropTypes, { - - /** - * Indicates that a prop should be falsy. - */ - falsy: function falsy(props, propName, componentName) { - if (props[propName]) return new Error('<' + componentName + '> should not have a "' + propName + '" prop'); - }, - - /** - * Indicates that a prop should be a Route object. - */ - route: ReactPropTypes.instanceOf(Route), - - /** - * Indicates that a prop should be a Router object. - */ - //router: ReactPropTypes.instanceOf(Router) // TODO - router: ReactPropTypes.func - -}); - -module.exports = PropTypes; -},{"./Route":28,"react":227,"react/lib/Object.assign":98}],27:[function(require,module,exports){ -/** - * Encapsulates a redirect to the given route. - */ -"use strict"; - -function Redirect(to, params, query) { - this.to = to; - this.params = params; - this.query = query; -} - -module.exports = Redirect; -},{}],28:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -var assign = require('react/lib/Object.assign'); -var invariant = require('invariant'); -var warning = require('./warning'); -var PathUtils = require('./PathUtils'); - -var _currentRoute; - -var Route = (function () { - _createClass(Route, null, [{ - key: 'createRoute', - - /** - * Creates and returns a new route. Options may be a URL pathname string - * with placeholders for named params or an object with any of the following - * properties: - * - * - name The name of the route. This is used to lookup a - * route relative to its parent route and should be - * unique among all child routes of the same parent - * - path A URL pathname string with optional placeholders - * that specify the names of params to extract from - * the URL when the path matches. Defaults to `/${name}` - * when there is a name given, or the path of the parent - * route, or / - * - ignoreScrollBehavior True to make this route (and all descendants) ignore - * the scroll behavior of the router - * - isDefault True to make this route the default route among all - * its siblings - * - isNotFound True to make this route the "not found" route among - * all its siblings - * - onEnter A transition hook that will be called when the - * router is going to enter this route - * - onLeave A transition hook that will be called when the - * router is going to leave this route - * - handler A React component that will be rendered when - * this route is active - * - parentRoute The parent route to use for this route. This option - * is automatically supplied when creating routes inside - * the callback to another invocation of createRoute. You - * only ever need to use this when declaring routes - * independently of one another to manually piece together - * the route hierarchy - * - * The callback may be used to structure your route hierarchy. Any call to - * createRoute, createDefaultRoute, createNotFoundRoute, or createRedirect - * inside the callback automatically uses this route as its parent. - */ - value: function createRoute(options, callback) { - options = options || {}; - - if (typeof options === 'string') options = { path: options }; - - var parentRoute = _currentRoute; - - if (parentRoute) { - warning(options.parentRoute == null || options.parentRoute === parentRoute, 'You should not use parentRoute with createRoute inside another route\'s child callback; it is ignored'); - } else { - parentRoute = options.parentRoute; - } - - var name = options.name; - var path = options.path || name; - - if (path && !(options.isDefault || options.isNotFound)) { - if (PathUtils.isAbsolute(path)) { - if (parentRoute) { - invariant(path === parentRoute.path || parentRoute.paramNames.length === 0, 'You cannot nest path "%s" inside "%s"; the parent requires URL parameters', path, parentRoute.path); - } - } else if (parentRoute) { - // Relative paths extend their parent. - path = PathUtils.join(parentRoute.path, path); - } else { - path = '/' + path; - } - } else { - path = parentRoute ? parentRoute.path : '/'; - } - - if (options.isNotFound && !/\*$/.test(path)) path += '*'; // Auto-append * to the path of not found routes. - - var route = new Route(name, path, options.ignoreScrollBehavior, options.isDefault, options.isNotFound, options.onEnter, options.onLeave, options.handler); - - if (parentRoute) { - if (route.isDefault) { - invariant(parentRoute.defaultRoute == null, '%s may not have more than one default route', parentRoute); - - parentRoute.defaultRoute = route; - } else if (route.isNotFound) { - invariant(parentRoute.notFoundRoute == null, '%s may not have more than one not found route', parentRoute); - - parentRoute.notFoundRoute = route; - } - - parentRoute.appendChild(route); - } - - // Any routes created in the callback - // use this route as their parent. - if (typeof callback === 'function') { - var currentRoute = _currentRoute; - _currentRoute = route; - callback.call(route, route); - _currentRoute = currentRoute; - } - - return route; - } - - /** - * Creates and returns a route that is rendered when its parent matches - * the current URL. - */ - }, { - key: 'createDefaultRoute', - value: function createDefaultRoute(options) { - return Route.createRoute(assign({}, options, { isDefault: true })); - } - - /** - * Creates and returns a route that is rendered when its parent matches - * the current URL but none of its siblings do. - */ - }, { - key: 'createNotFoundRoute', - value: function createNotFoundRoute(options) { - return Route.createRoute(assign({}, options, { isNotFound: true })); - } - - /** - * Creates and returns a route that automatically redirects the transition - * to another route. In addition to the normal options to createRoute, this - * function accepts the following options: - * - * - from An alias for the `path` option. Defaults to * - * - to The path/route/route name to redirect to - * - params The params to use in the redirect URL. Defaults - * to using the current params - * - query The query to use in the redirect URL. Defaults - * to using the current query - */ - }, { - key: 'createRedirect', - value: function createRedirect(options) { - return Route.createRoute(assign({}, options, { - path: options.path || options.from || '*', - onEnter: function onEnter(transition, params, query) { - transition.redirect(options.to, options.params || params, options.query || query); - } - })); - } - }]); - - function Route(name, path, ignoreScrollBehavior, isDefault, isNotFound, onEnter, onLeave, handler) { - _classCallCheck(this, Route); - - this.name = name; - this.path = path; - this.paramNames = PathUtils.extractParamNames(this.path); - this.ignoreScrollBehavior = !!ignoreScrollBehavior; - this.isDefault = !!isDefault; - this.isNotFound = !!isNotFound; - this.onEnter = onEnter; - this.onLeave = onLeave; - this.handler = handler; - } - - /** - * Appends the given route to this route's child routes. - */ - - _createClass(Route, [{ - key: 'appendChild', - value: function appendChild(route) { - invariant(route instanceof Route, 'route.appendChild must use a valid Route'); - - if (!this.childRoutes) this.childRoutes = []; - - this.childRoutes.push(route); - } - }, { - key: 'toString', - value: function toString() { - var string = ''; - - return string; - } - }]); - - return Route; -})(); - -module.exports = Route; -},{"./PathUtils":25,"./warning":54,"invariant":19,"react/lib/Object.assign":98}],29:[function(require,module,exports){ -'use strict'; - -var invariant = require('invariant'); -var canUseDOM = require('can-use-dom'); -var getWindowScrollPosition = require('./getWindowScrollPosition'); - -function shouldUpdateScroll(state, prevState) { - if (!prevState) return true; - - // Don't update scroll position when only the query has changed. - if (state.pathname === prevState.pathname) return false; - - var routes = state.routes; - var prevRoutes = prevState.routes; - - var sharedAncestorRoutes = routes.filter(function (route) { - return prevRoutes.indexOf(route) !== -1; - }); - - return !sharedAncestorRoutes.some(function (route) { - return route.ignoreScrollBehavior; - }); -} - -/** - * Provides the router with the ability to manage window scroll position - * according to its scroll behavior. - */ -var ScrollHistory = { - - statics: { - - /** - * Records curent scroll position as the last known position for the given URL path. - */ - recordScrollPosition: function recordScrollPosition(path) { - if (!this.scrollHistory) this.scrollHistory = {}; - - this.scrollHistory[path] = getWindowScrollPosition(); - }, - - /** - * Returns the last known scroll position for the given URL path. - */ - getScrollPosition: function getScrollPosition(path) { - if (!this.scrollHistory) this.scrollHistory = {}; - - return this.scrollHistory[path] || null; - } - - }, - - componentWillMount: function componentWillMount() { - invariant(this.constructor.getScrollBehavior() == null || canUseDOM, 'Cannot use scroll behavior without a DOM'); - }, - - componentDidMount: function componentDidMount() { - this._updateScroll(); - }, - - componentDidUpdate: function componentDidUpdate(prevProps, prevState) { - this._updateScroll(prevState); - }, - - _updateScroll: function _updateScroll(prevState) { - if (!shouldUpdateScroll(this.state, prevState)) return; - - var scrollBehavior = this.constructor.getScrollBehavior(); - - if (scrollBehavior) scrollBehavior.updateScrollPosition(this.constructor.getScrollPosition(this.state.path), this.state.action); - } - -}; - -module.exports = ScrollHistory; -},{"./getWindowScrollPosition":44,"can-use-dom":16,"invariant":19}],30:[function(require,module,exports){ -'use strict'; - -var PropTypes = require('./PropTypes'); - -/** - * A mixin for components that need to know the path, routes, URL - * params and query that are currently active. - * - * Example: - * - * var AboutLink = React.createClass({ - * mixins: [ Router.State ], - * render() { - * var className = this.props.className; - * - * if (this.isActive('about')) - * className += ' is-active'; - * - * return React.DOM.a({ className: className }, this.props.children); - * } - * }); - */ -var State = { - - contextTypes: { - router: PropTypes.router.isRequired - }, - - /** - * Returns the current URL path. - */ - getPath: function getPath() { - return this.context.router.getCurrentPath(); - }, - - /** - * Returns the current URL path without the query string. - */ - getPathname: function getPathname() { - return this.context.router.getCurrentPathname(); - }, - - /** - * Returns an object of the URL params that are currently active. - */ - getParams: function getParams() { - return this.context.router.getCurrentParams(); - }, - - /** - * Returns an object of the query params that are currently active. - */ - getQuery: function getQuery() { - return this.context.router.getCurrentQuery(); - }, - - /** - * Returns an array of the routes that are currently active. - */ - getRoutes: function getRoutes() { - return this.context.router.getCurrentRoutes(); - }, - - /** - * A helper method to determine if a given route, params, and query - * are active. - */ - isActive: function isActive(to, params, query) { - return this.context.router.isActive(to, params, query); - } - -}; - -module.exports = State; -},{"./PropTypes":26}],31:[function(require,module,exports){ -/* jshint -W058 */ - -'use strict'; - -var Cancellation = require('./Cancellation'); -var Redirect = require('./Redirect'); - -/** - * Encapsulates a transition to a given path. - * - * The willTransitionTo and willTransitionFrom handlers receive - * an instance of this class as their first argument. - */ -function Transition(path, retry) { - this.path = path; - this.abortReason = null; - // TODO: Change this to router.retryTransition(transition) - this.retry = retry.bind(this); -} - -Transition.prototype.abort = function (reason) { - if (this.abortReason == null) this.abortReason = reason || 'ABORT'; -}; - -Transition.prototype.redirect = function (to, params, query) { - this.abort(new Redirect(to, params, query)); -}; - -Transition.prototype.cancel = function () { - this.abort(new Cancellation()); -}; - -Transition.from = function (transition, routes, components, callback) { - routes.reduce(function (callback, route, index) { - return function (error) { - if (error || transition.abortReason) { - callback(error); - } else if (route.onLeave) { - try { - route.onLeave(transition, components[index], callback); - - // If there is no callback in the argument list, call it automatically. - if (route.onLeave.length < 3) callback(); - } catch (e) { - callback(e); - } - } else { - callback(); - } - }; - }, callback)(); -}; - -Transition.to = function (transition, routes, params, query, callback) { - routes.reduceRight(function (callback, route) { - return function (error) { - if (error || transition.abortReason) { - callback(error); - } else if (route.onEnter) { - try { - route.onEnter(transition, params, query, callback); - - // If there is no callback in the argument list, call it automatically. - if (route.onEnter.length < 4) callback(); - } catch (e) { - callback(e); - } - } else { - callback(); - } - }; - }, callback)(); -}; - -module.exports = Transition; -},{"./Cancellation":21,"./Redirect":27}],32:[function(require,module,exports){ -/** - * Actions that modify the URL. - */ -'use strict'; - -var LocationActions = { - - /** - * Indicates a new location is being pushed to the history stack. - */ - PUSH: 'push', - - /** - * Indicates the current location should be replaced. - */ - REPLACE: 'replace', - - /** - * Indicates the most recent entry should be removed from the history stack. - */ - POP: 'pop' - -}; - -module.exports = LocationActions; -},{}],33:[function(require,module,exports){ -'use strict'; - -var LocationActions = require('../actions/LocationActions'); - -/** - * A scroll behavior that attempts to imitate the default behavior - * of modern browsers. - */ -var ImitateBrowserBehavior = { - - updateScrollPosition: function updateScrollPosition(position, actionType) { - switch (actionType) { - case LocationActions.PUSH: - case LocationActions.REPLACE: - window.scrollTo(0, 0); - break; - case LocationActions.POP: - if (position) { - window.scrollTo(position.x, position.y); - } else { - window.scrollTo(0, 0); - } - break; - } - } - -}; - -module.exports = ImitateBrowserBehavior; -},{"../actions/LocationActions":32}],34:[function(require,module,exports){ -/** - * A scroll behavior that always scrolls to the top of the page - * after a transition. - */ -"use strict"; - -var ScrollToTopBehavior = { - - updateScrollPosition: function updateScrollPosition() { - window.scrollTo(0, 0); - } - -}; - -module.exports = ScrollToTopBehavior; -},{}],35:[function(require,module,exports){ -/** - * This component is necessary to get around a context warning - * present in React 0.13.0. It sovles this by providing a separation - * between the "owner" and "parent" contexts. - */ - -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var React = require('react'); - -var ContextWrapper = (function (_React$Component) { - _inherits(ContextWrapper, _React$Component); - - function ContextWrapper() { - _classCallCheck(this, ContextWrapper); - - _get(Object.getPrototypeOf(ContextWrapper.prototype), 'constructor', this).apply(this, arguments); - } - - _createClass(ContextWrapper, [{ - key: 'render', - value: function render() { - return this.props.children; - } - }]); - - return ContextWrapper; -})(React.Component); - -module.exports = ContextWrapper; -},{"react":227}],36:[function(require,module,exports){ -'use strict'; - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PropTypes = require('../PropTypes'); -var RouteHandler = require('./RouteHandler'); -var Route = require('./Route'); - -/** - * A component is a special kind of that - * renders when its parent matches but none of its siblings do. - * Only one such route may be used at any given level in the - * route hierarchy. - */ - -var DefaultRoute = (function (_Route) { - _inherits(DefaultRoute, _Route); - - function DefaultRoute() { - _classCallCheck(this, DefaultRoute); - - _get(Object.getPrototypeOf(DefaultRoute.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - return DefaultRoute; -})(Route); - -DefaultRoute.propTypes = { - name: PropTypes.string, - path: PropTypes.falsy, - children: PropTypes.falsy, - handler: PropTypes.func.isRequired -}; - -DefaultRoute.defaultProps = { - handler: RouteHandler -}; - -module.exports = DefaultRoute; -},{"../PropTypes":26,"./Route":40,"./RouteHandler":41}],37:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var React = require('react'); -var assign = require('react/lib/Object.assign'); -var PropTypes = require('../PropTypes'); - -function isLeftClickEvent(event) { - return event.button === 0; -} - -function isModifiedEvent(event) { - return !!(event.metaKey || event.altKey || event.ctrlKey || event.shiftKey); -} - -/** - * components are used to create an element that links to a route. - * When that route is active, the link gets an "active" class name (or the - * value of its `activeClassName` prop). - * - * For example, assuming you have the following route: - * - * - * - * You could use the following component to link to that route: - * - * - * - * In addition to params, links may pass along query string parameters - * using the `query` prop. - * - * - */ - -var Link = (function (_React$Component) { - _inherits(Link, _React$Component); - - function Link() { - _classCallCheck(this, Link); - - _get(Object.getPrototypeOf(Link.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - _createClass(Link, [{ - key: 'handleClick', - value: function handleClick(event) { - var allowTransition = true; - var clickResult; - - if (this.props.onClick) clickResult = this.props.onClick(event); - - if (isModifiedEvent(event) || !isLeftClickEvent(event)) return; - - if (clickResult === false || event.defaultPrevented === true) allowTransition = false; - - event.preventDefault(); - - if (allowTransition) this.context.router.transitionTo(this.props.to, this.props.params, this.props.query); - } - - /** - * Returns the value of the "href" attribute to use on the DOM element. - */ - }, { - key: 'getHref', - value: function getHref() { - return this.context.router.makeHref(this.props.to, this.props.params, this.props.query); - } - - /** - * Returns the value of the "class" attribute to use on the DOM element, which contains - * the value of the activeClassName property when this is active. - */ - }, { - key: 'getClassName', - value: function getClassName() { - var className = this.props.className; - - if (this.getActiveState()) className += ' ' + this.props.activeClassName; - - return className; - } - }, { - key: 'getActiveState', - value: function getActiveState() { - return this.context.router.isActive(this.props.to, this.props.params, this.props.query); - } - }, { - key: 'render', - value: function render() { - var props = assign({}, this.props, { - href: this.getHref(), - className: this.getClassName(), - onClick: this.handleClick.bind(this) - }); - - if (props.activeStyle && this.getActiveState()) props.style = props.activeStyle; - - return React.DOM.a(props, this.props.children); - } - }]); - - return Link; -})(React.Component); - -Link.contextTypes = { - router: PropTypes.router.isRequired -}; - -Link.propTypes = { - activeClassName: PropTypes.string.isRequired, - to: PropTypes.oneOfType([PropTypes.string, PropTypes.route]).isRequired, - params: PropTypes.object, - query: PropTypes.object, - activeStyle: PropTypes.object, - onClick: PropTypes.func -}; - -Link.defaultProps = { - activeClassName: 'active', - className: '' -}; - -module.exports = Link; -},{"../PropTypes":26,"react":227,"react/lib/Object.assign":98}],38:[function(require,module,exports){ -'use strict'; - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PropTypes = require('../PropTypes'); -var RouteHandler = require('./RouteHandler'); -var Route = require('./Route'); - -/** - * A is a special kind of that - * renders when the beginning of its parent's path matches - * but none of its siblings do, including any . - * Only one such route may be used at any given level in the - * route hierarchy. - */ - -var NotFoundRoute = (function (_Route) { - _inherits(NotFoundRoute, _Route); - - function NotFoundRoute() { - _classCallCheck(this, NotFoundRoute); - - _get(Object.getPrototypeOf(NotFoundRoute.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - return NotFoundRoute; -})(Route); - -NotFoundRoute.propTypes = { - name: PropTypes.string, - path: PropTypes.falsy, - children: PropTypes.falsy, - handler: PropTypes.func.isRequired -}; - -NotFoundRoute.defaultProps = { - handler: RouteHandler -}; - -module.exports = NotFoundRoute; -},{"../PropTypes":26,"./Route":40,"./RouteHandler":41}],39:[function(require,module,exports){ -'use strict'; - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var PropTypes = require('../PropTypes'); -var Route = require('./Route'); - -/** - * A component is a special kind of that always - * redirects to another route when it matches. - */ - -var Redirect = (function (_Route) { - _inherits(Redirect, _Route); - - function Redirect() { - _classCallCheck(this, Redirect); - - _get(Object.getPrototypeOf(Redirect.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - return Redirect; -})(Route); - -Redirect.propTypes = { - path: PropTypes.string, - from: PropTypes.string, // Alias for path. - to: PropTypes.string, - handler: PropTypes.falsy -}; - -// Redirects should not have a default handler -Redirect.defaultProps = {}; - -module.exports = Redirect; -},{"../PropTypes":26,"./Route":40}],40:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var React = require('react'); -var invariant = require('invariant'); -var PropTypes = require('../PropTypes'); -var RouteHandler = require('./RouteHandler'); - -/** - * components specify components that are rendered to the page when the - * URL matches a given pattern. - * - * Routes are arranged in a nested tree structure. When a new URL is requested, - * the tree is searched depth-first to find a route whose path matches the URL. - * When one is found, all routes in the tree that lead to it are considered - * "active" and their components are rendered into the DOM, nested in the same - * order as they are in the tree. - * - * The preferred way to configure a router is using JSX. The XML-like syntax is - * a great way to visualize how routes are laid out in an application. - * - * var routes = [ - * - * - * - * - * - * ]; - * - * Router.run(routes, function (Handler) { - * React.render(, document.body); - * }); - * - * Handlers for Route components that contain children can render their active - * child route using a element. - * - * var App = React.createClass({ - * render: function () { - * return ( - *
    - * - *
    - * ); - * } - * }); - * - * If no handler is provided for the route, it will render a matched child route. - */ - -var Route = (function (_React$Component) { - _inherits(Route, _React$Component); - - function Route() { - _classCallCheck(this, Route); - - _get(Object.getPrototypeOf(Route.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - _createClass(Route, [{ - key: 'render', - value: function render() { - invariant(false, '%s elements are for router configuration only and should not be rendered', this.constructor.name); - } - }]); - - return Route; -})(React.Component); - -Route.propTypes = { - name: PropTypes.string, - path: PropTypes.string, - handler: PropTypes.func, - ignoreScrollBehavior: PropTypes.bool -}; - -Route.defaultProps = { - handler: RouteHandler -}; - -module.exports = Route; -},{"../PropTypes":26,"./RouteHandler":41,"invariant":19,"react":227}],41:[function(require,module,exports){ -'use strict'; - -var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })(); - -var _get = function get(_x, _x2, _x3) { var _again = true; _function: while (_again) { var object = _x, property = _x2, receiver = _x3; _again = false; if (object === null) object = Function.prototype; var desc = Object.getOwnPropertyDescriptor(object, property); if (desc === undefined) { var parent = Object.getPrototypeOf(object); if (parent === null) { return undefined; } else { _x = parent; _x2 = property; _x3 = receiver; _again = true; desc = parent = undefined; continue _function; } } else if ('value' in desc) { return desc.value; } else { var getter = desc.get; if (getter === undefined) { return undefined; } return getter.call(receiver); } } }; - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } } - -function _inherits(subClass, superClass) { if (typeof superClass !== 'function' && superClass !== null) { throw new TypeError('Super expression must either be null or a function, not ' + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var React = require('react'); -var ContextWrapper = require('./ContextWrapper'); -var assign = require('react/lib/Object.assign'); -var PropTypes = require('../PropTypes'); - -var REF_NAME = '__routeHandler__'; - -/** - * A component renders the active child route handler - * when routes are nested. - */ - -var RouteHandler = (function (_React$Component) { - _inherits(RouteHandler, _React$Component); - - function RouteHandler() { - _classCallCheck(this, RouteHandler); - - _get(Object.getPrototypeOf(RouteHandler.prototype), 'constructor', this).apply(this, arguments); - } - - // TODO: Include these in the above class definition - // once we can use ES7 property initializers. - // https://github.com/babel/babel/issues/619 - - _createClass(RouteHandler, [{ - key: 'getChildContext', - value: function getChildContext() { - return { - routeDepth: this.context.routeDepth + 1 - }; - } - }, { - key: 'componentDidMount', - value: function componentDidMount() { - this._updateRouteComponent(this.refs[REF_NAME]); - } - }, { - key: 'componentDidUpdate', - value: function componentDidUpdate() { - this._updateRouteComponent(this.refs[REF_NAME]); - } - }, { - key: 'componentWillUnmount', - value: function componentWillUnmount() { - this._updateRouteComponent(null); - } - }, { - key: '_updateRouteComponent', - value: function _updateRouteComponent(component) { - this.context.router.setRouteComponentAtDepth(this.getRouteDepth(), component); - } - }, { - key: 'getRouteDepth', - value: function getRouteDepth() { - return this.context.routeDepth; - } - }, { - key: 'createChildRouteHandler', - value: function createChildRouteHandler(props) { - var route = this.context.router.getRouteAtDepth(this.getRouteDepth()); - - if (route == null) return null; - - var childProps = assign({}, props || this.props, { - ref: REF_NAME, - params: this.context.router.getCurrentParams(), - query: this.context.router.getCurrentQuery() - }); - - return React.createElement(route.handler, childProps); - } - }, { - key: 'render', - value: function render() { - var handler = this.createChildRouteHandler(); - // - - - - - diff --git a/src/gulpfile.js b/src/gulpfile.js deleted file mode 100644 index cefe64c..0000000 --- a/src/gulpfile.js +++ /dev/null @@ -1,43 +0,0 @@ -var browserify = require('browserify'); -var gulp = require('gulp'); -var source = require('vinyl-source-stream'); -var browserSync = require('browser-sync'); -var rename = require('gulp-rename'); -var babelify = require("babelify"); - -var opts = { - mainJsInput: './App/app.js', - mainJsOutput: 'app.js', - buildFolder: './build/', - indexHtml: './App/index.html', - watchedFiles: [ - './App/**/*' - ] -}; - -gulp.task('index', function() { - gulp.src(opts.indexHtml) - .pipe(gulp.dest(opts.buildFolder)); -}); - -gulp.task('compile', function() { - var b = browserify(); - b.transform(babelify); - b.add(opts.mainJsInput); - return b.bundle() - .pipe(source(opts.mainJsInput)) - .pipe(rename(opts.mainJsOutput)) - .pipe(gulp.dest(opts.buildFolder)); -}); - -gulp.task('browser-sync', function() { - browserSync({ - server: { - baseDir: opts.buildFolder - } - }); -}); - -gulp.task('default', ['browser-sync', 'compile', 'index'], function() { - gulp.watch(opts.watchedFiles, ['compile', 'index', browserSync.reload]); -}); diff --git a/src/node_modules/.bin/JSONStream b/src/node_modules/.bin/JSONStream deleted file mode 120000 index 4490737..0000000 --- a/src/node_modules/.bin/JSONStream +++ /dev/null @@ -1 +0,0 @@ -../JSONStream/index.js \ No newline at end of file diff --git a/src/node_modules/.bin/acorn b/src/node_modules/.bin/acorn deleted file mode 120000 index cf76760..0000000 --- a/src/node_modules/.bin/acorn +++ /dev/null @@ -1 +0,0 @@ -../acorn/bin/acorn \ No newline at end of file diff --git a/src/node_modules/.bin/browser-pack b/src/node_modules/.bin/browser-pack deleted file mode 120000 index 1d047b9..0000000 --- a/src/node_modules/.bin/browser-pack +++ /dev/null @@ -1 +0,0 @@ -../browser-pack/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/browser-sync b/src/node_modules/.bin/browser-sync deleted file mode 120000 index c83515b..0000000 --- a/src/node_modules/.bin/browser-sync +++ /dev/null @@ -1 +0,0 @@ -../browser-sync/bin/browser-sync.js \ No newline at end of file diff --git a/src/node_modules/.bin/browserify b/src/node_modules/.bin/browserify deleted file mode 120000 index ab156b3..0000000 --- a/src/node_modules/.bin/browserify +++ /dev/null @@ -1 +0,0 @@ -../browserify/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/commonize b/src/node_modules/.bin/commonize deleted file mode 120000 index 7d3faf1..0000000 --- a/src/node_modules/.bin/commonize +++ /dev/null @@ -1 +0,0 @@ -../commoner/bin/commonize \ No newline at end of file diff --git a/src/node_modules/.bin/cssesc b/src/node_modules/.bin/cssesc deleted file mode 120000 index 487b689..0000000 --- a/src/node_modules/.bin/cssesc +++ /dev/null @@ -1 +0,0 @@ -../cssesc/bin/cssesc \ No newline at end of file diff --git a/src/node_modules/.bin/dateformat b/src/node_modules/.bin/dateformat deleted file mode 120000 index bb9cf7b..0000000 --- a/src/node_modules/.bin/dateformat +++ /dev/null @@ -1 +0,0 @@ -../dateformat/bin/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/defs b/src/node_modules/.bin/defs deleted file mode 120000 index b218749..0000000 --- a/src/node_modules/.bin/defs +++ /dev/null @@ -1 +0,0 @@ -../defs/build/es5/defs \ No newline at end of file diff --git a/src/node_modules/.bin/deps-sort b/src/node_modules/.bin/deps-sort deleted file mode 120000 index b2dda9e..0000000 --- a/src/node_modules/.bin/deps-sort +++ /dev/null @@ -1 +0,0 @@ -../deps-sort/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/detect-indent b/src/node_modules/.bin/detect-indent deleted file mode 120000 index 637cd30..0000000 --- a/src/node_modules/.bin/detect-indent +++ /dev/null @@ -1 +0,0 @@ -../detect-indent/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/dev-ip b/src/node_modules/.bin/dev-ip deleted file mode 120000 index 138e5ac..0000000 --- a/src/node_modules/.bin/dev-ip +++ /dev/null @@ -1 +0,0 @@ -../dev-ip/lib/dev-ip.js \ No newline at end of file diff --git a/src/node_modules/.bin/envify b/src/node_modules/.bin/envify deleted file mode 120000 index ee9099e..0000000 --- a/src/node_modules/.bin/envify +++ /dev/null @@ -1 +0,0 @@ -../envify/bin/envify \ No newline at end of file diff --git a/src/node_modules/.bin/esparse b/src/node_modules/.bin/esparse deleted file mode 120000 index 936ac78..0000000 --- a/src/node_modules/.bin/esparse +++ /dev/null @@ -1 +0,0 @@ -../esprima-fb/bin/esparse.js \ No newline at end of file diff --git a/src/node_modules/.bin/esvalidate b/src/node_modules/.bin/esvalidate deleted file mode 120000 index 8548715..0000000 --- a/src/node_modules/.bin/esvalidate +++ /dev/null @@ -1 +0,0 @@ -../esprima-fb/bin/esvalidate.js \ No newline at end of file diff --git a/src/node_modules/.bin/express b/src/node_modules/.bin/express deleted file mode 120000 index b741d99..0000000 --- a/src/node_modules/.bin/express +++ /dev/null @@ -1 +0,0 @@ -../express/bin/express \ No newline at end of file diff --git a/src/node_modules/.bin/foxy b/src/node_modules/.bin/foxy deleted file mode 120000 index d71761f..0000000 --- a/src/node_modules/.bin/foxy +++ /dev/null @@ -1 +0,0 @@ -../foxy/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/gulp b/src/node_modules/.bin/gulp deleted file mode 120000 index 5de7332..0000000 --- a/src/node_modules/.bin/gulp +++ /dev/null @@ -1 +0,0 @@ -../gulp/bin/gulp.js \ No newline at end of file diff --git a/src/node_modules/.bin/har-validator b/src/node_modules/.bin/har-validator deleted file mode 120000 index c6ec163..0000000 --- a/src/node_modules/.bin/har-validator +++ /dev/null @@ -1 +0,0 @@ -../har-validator/bin/har-validator \ No newline at end of file diff --git a/src/node_modules/.bin/indent-string b/src/node_modules/.bin/indent-string deleted file mode 120000 index 6767b06..0000000 --- a/src/node_modules/.bin/indent-string +++ /dev/null @@ -1 +0,0 @@ -../indent-string/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/insert-module-globals b/src/node_modules/.bin/insert-module-globals deleted file mode 120000 index 68af3a9..0000000 --- a/src/node_modules/.bin/insert-module-globals +++ /dev/null @@ -1 +0,0 @@ -../insert-module-globals/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/jsesc b/src/node_modules/.bin/jsesc deleted file mode 120000 index 7237604..0000000 --- a/src/node_modules/.bin/jsesc +++ /dev/null @@ -1 +0,0 @@ -../jsesc/bin/jsesc \ No newline at end of file diff --git a/src/node_modules/.bin/json5 b/src/node_modules/.bin/json5 deleted file mode 120000 index 217f379..0000000 --- a/src/node_modules/.bin/json5 +++ /dev/null @@ -1 +0,0 @@ -../json5/lib/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/leven b/src/node_modules/.bin/leven deleted file mode 120000 index e04a75b..0000000 --- a/src/node_modules/.bin/leven +++ /dev/null @@ -1 +0,0 @@ -../leven/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/lt b/src/node_modules/.bin/lt deleted file mode 120000 index f79fff9..0000000 --- a/src/node_modules/.bin/lt +++ /dev/null @@ -1 +0,0 @@ -../localtunnel/bin/client \ No newline at end of file diff --git a/src/node_modules/.bin/miller-rabin b/src/node_modules/.bin/miller-rabin deleted file mode 120000 index c175fe9..0000000 --- a/src/node_modules/.bin/miller-rabin +++ /dev/null @@ -1 +0,0 @@ -../miller-rabin/bin/miller-rabin \ No newline at end of file diff --git a/src/node_modules/.bin/mkdirp b/src/node_modules/.bin/mkdirp deleted file mode 120000 index 017896c..0000000 --- a/src/node_modules/.bin/mkdirp +++ /dev/null @@ -1 +0,0 @@ -../mkdirp/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/module-deps b/src/node_modules/.bin/module-deps deleted file mode 120000 index 66a1f24..0000000 --- a/src/node_modules/.bin/module-deps +++ /dev/null @@ -1 +0,0 @@ -../module-deps/bin/cmd.js \ No newline at end of file diff --git a/src/node_modules/.bin/nopt b/src/node_modules/.bin/nopt deleted file mode 120000 index 6b6566e..0000000 --- a/src/node_modules/.bin/nopt +++ /dev/null @@ -1 +0,0 @@ -../nopt/bin/nopt.js \ No newline at end of file diff --git a/src/node_modules/.bin/regenerator b/src/node_modules/.bin/regenerator deleted file mode 120000 index bcfc9b2..0000000 --- a/src/node_modules/.bin/regenerator +++ /dev/null @@ -1 +0,0 @@ -../regenerator/bin/regenerator \ No newline at end of file diff --git a/src/node_modules/.bin/regexpu b/src/node_modules/.bin/regexpu deleted file mode 120000 index 4d267f5..0000000 --- a/src/node_modules/.bin/regexpu +++ /dev/null @@ -1 +0,0 @@ -../regexpu/bin/regexpu \ No newline at end of file diff --git a/src/node_modules/.bin/regjsparser b/src/node_modules/.bin/regjsparser deleted file mode 120000 index 91cec77..0000000 --- a/src/node_modules/.bin/regjsparser +++ /dev/null @@ -1 +0,0 @@ -../regjsparser/bin/parser \ No newline at end of file diff --git a/src/node_modules/.bin/repeating b/src/node_modules/.bin/repeating deleted file mode 120000 index cdedec3..0000000 --- a/src/node_modules/.bin/repeating +++ /dev/null @@ -1 +0,0 @@ -../repeating/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/rimraf b/src/node_modules/.bin/rimraf deleted file mode 120000 index 4cd49a4..0000000 --- a/src/node_modules/.bin/rimraf +++ /dev/null @@ -1 +0,0 @@ -../rimraf/bin.js \ No newline at end of file diff --git a/src/node_modules/.bin/semver b/src/node_modules/.bin/semver deleted file mode 120000 index 317eb29..0000000 --- a/src/node_modules/.bin/semver +++ /dev/null @@ -1 +0,0 @@ -../semver/bin/semver \ No newline at end of file diff --git a/src/node_modules/.bin/sha.js b/src/node_modules/.bin/sha.js deleted file mode 120000 index 3c76105..0000000 --- a/src/node_modules/.bin/sha.js +++ /dev/null @@ -1 +0,0 @@ -../sha.js/bin.js \ No newline at end of file diff --git a/src/node_modules/.bin/strip-bom b/src/node_modules/.bin/strip-bom deleted file mode 120000 index ba65fdf..0000000 --- a/src/node_modules/.bin/strip-bom +++ /dev/null @@ -1 +0,0 @@ -../strip-bom/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/throttleproxy b/src/node_modules/.bin/throttleproxy deleted file mode 120000 index 2ec6e30..0000000 --- a/src/node_modules/.bin/throttleproxy +++ /dev/null @@ -1 +0,0 @@ -../stream-throttle/bin/throttleproxy.js \ No newline at end of file diff --git a/src/node_modules/.bin/umd b/src/node_modules/.bin/umd deleted file mode 120000 index 69767ed..0000000 --- a/src/node_modules/.bin/umd +++ /dev/null @@ -1 +0,0 @@ -../umd/bin/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/user-home b/src/node_modules/.bin/user-home deleted file mode 120000 index d72d76b..0000000 --- a/src/node_modules/.bin/user-home +++ /dev/null @@ -1 +0,0 @@ -../user-home/cli.js \ No newline at end of file diff --git a/src/node_modules/.bin/uuid b/src/node_modules/.bin/uuid deleted file mode 120000 index 80eb14a..0000000 --- a/src/node_modules/.bin/uuid +++ /dev/null @@ -1 +0,0 @@ -../node-uuid/bin/uuid \ No newline at end of file diff --git a/src/node_modules/.bin/weinre b/src/node_modules/.bin/weinre deleted file mode 120000 index 53c7151..0000000 --- a/src/node_modules/.bin/weinre +++ /dev/null @@ -1 +0,0 @@ -../weinre/weinre \ No newline at end of file diff --git a/src/node_modules/.bin/window-size b/src/node_modules/.bin/window-size deleted file mode 120000 index e84c8ec..0000000 --- a/src/node_modules/.bin/window-size +++ /dev/null @@ -1 +0,0 @@ -../window-size/cli.js \ No newline at end of file diff --git a/src/node_modules/Base64/.npmignore b/src/node_modules/Base64/.npmignore deleted file mode 100644 index cba87a3..0000000 --- a/src/node_modules/Base64/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -/coverage/ -/node_modules/ diff --git a/src/node_modules/Base64/.travis.yml b/src/node_modules/Base64/.travis.yml deleted file mode 100644 index fbde051..0000000 --- a/src/node_modules/Base64/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.11" -install: make setup -script: make test diff --git a/src/node_modules/Base64/LICENSE b/src/node_modules/Base64/LICENSE deleted file mode 100644 index 4832767..0000000 --- a/src/node_modules/Base64/LICENSE +++ /dev/null @@ -1,14 +0,0 @@ - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - Version 2, December 2004 - - Copyright (c) 2011..2012 David Chambers - - Everyone is permitted to copy and distribute verbatim or modified - copies of this license document, and changing it is allowed as long - as the name is changed. - - DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/src/node_modules/Base64/Makefile b/src/node_modules/Base64/Makefile deleted file mode 100644 index 5c475df..0000000 --- a/src/node_modules/Base64/Makefile +++ /dev/null @@ -1,42 +0,0 @@ -ISTANBUL = node_modules/.bin/istanbul -UGLIFYJS = node_modules/.bin/uglifyjs -XYZ = node_modules/.bin/xyz --message X.Y.Z --tag X.Y.Z - -SRC = base64.js -MIN = $(patsubst %.js,%.min.js,$(SRC)) - - -.PHONY: all -all: $(MIN) - -%.min.js: %.js - $(UGLIFYJS) $< --compress --mangle > $@ - - -.PHONY: bytes -bytes: base64.min.js - gzip --best --stdout $< | wc -c | tr -d ' ' - - -.PHONY: clean -clean: - rm -f -- $(MIN) - - -.PHONY: release-major release-minor release-patch -release-major: - $(XYZ) --increment major -release-minor: - $(XYZ) --increment minor -release-patch: - $(XYZ) --increment patch - - -.PHONY: setup -setup: - npm install - - -.PHONY: test -test: - $(ISTANBUL) cover node_modules/.bin/_mocha -- --compilers coffee:coffee-script/register diff --git a/src/node_modules/Base64/README.md b/src/node_modules/Base64/README.md deleted file mode 100644 index e5dafed..0000000 --- a/src/node_modules/Base64/README.md +++ /dev/null @@ -1,34 +0,0 @@ -# Base64.js - -≈ 500 byte* polyfill for browsers which don't provide [`window.btoa`][1] and -[`window.atob`][2]. - -Although the script does no harm in browsers which do provide these functions, -a conditional script loader such as [yepnope][3] can prevent unnecessary HTTP -requests. - -```javascript -yepnope({ - test: window.btoa && window.atob, - nope: 'base64.js', - callback: function () { - // `btoa` and `atob` are now safe to use - } -}) -``` - -Base64.js stems from a [gist][4] by [yahiko][5]. - -### Running the test suite - - make setup - make test - -\* Minified and gzipped. Run `make bytes` to verify. - - -[1]: https://developer.mozilla.org/en/DOM/window.btoa -[2]: https://developer.mozilla.org/en/DOM/window.atob -[3]: http://yepnopejs.com/ -[4]: https://gist.github.com/229984 -[5]: https://github.com/yahiko diff --git a/src/node_modules/Base64/base64.js b/src/node_modules/Base64/base64.js deleted file mode 100644 index 15d3a8a..0000000 --- a/src/node_modules/Base64/base64.js +++ /dev/null @@ -1,60 +0,0 @@ -;(function () { - - var object = typeof exports != 'undefined' ? exports : this; // #8: web workers - var chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='; - - function InvalidCharacterError(message) { - this.message = message; - } - InvalidCharacterError.prototype = new Error; - InvalidCharacterError.prototype.name = 'InvalidCharacterError'; - - // encoder - // [https://gist.github.com/999166] by [https://github.com/nignag] - object.btoa || ( - object.btoa = function (input) { - for ( - // initialize result and counter - var block, charCode, idx = 0, map = chars, output = ''; - // if the next input index does not exist: - // change the mapping table to "=" - // check if d has no fractional digits - input.charAt(idx | 0) || (map = '=', idx % 1); - // "8 - idx % 1 * 8" generates the sequence 2, 4, 6, 8 - output += map.charAt(63 & block >> 8 - idx % 1 * 8) - ) { - charCode = input.charCodeAt(idx += 3/4); - if (charCode > 0xFF) { - throw new InvalidCharacterError("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range."); - } - block = block << 8 | charCode; - } - return output; - }); - - // decoder - // [https://gist.github.com/1020396] by [https://github.com/atk] - object.atob || ( - object.atob = function (input) { - input = input.replace(/=+$/, ''); - if (input.length % 4 == 1) { - throw new InvalidCharacterError("'atob' failed: The string to be decoded is not correctly encoded."); - } - for ( - // initialize result and counters - var bc = 0, bs, buffer, idx = 0, output = ''; - // get next character - buffer = input.charAt(idx++); - // character found in table? initialize bit storage and add its ascii value; - ~buffer && (bs = bc % 4 ? bs * 64 + buffer : buffer, - // and if not first of each 4 characters, - // convert the first 8 bits to one ascii character - bc++ % 4) ? output += String.fromCharCode(255 & bs >> (-2 * bc & 6)) : 0 - ) { - // try to find character in table (0-63, not found => -1) - buffer = chars.indexOf(buffer); - } - return output; - }); - -}()); diff --git a/src/node_modules/Base64/base64.min.js b/src/node_modules/Base64/base64.min.js deleted file mode 100644 index 33c7aa4..0000000 --- a/src/node_modules/Base64/base64.min.js +++ /dev/null @@ -1 +0,0 @@ -!function(){function t(t){this.message=t}var e="undefined"!=typeof exports?exports:this,r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";t.prototype=new Error,t.prototype.name="InvalidCharacterError",e.btoa||(e.btoa=function(e){for(var o,n,a=0,i=r,c="";e.charAt(0|a)||(i="=",a%1);c+=i.charAt(63&o>>8-a%1*8)){if(n=e.charCodeAt(a+=.75),n>255)throw new t("'btoa' failed: The string to be encoded contains characters outside of the Latin1 range.");o=o<<8|n}return c}),e.atob||(e.atob=function(e){if(e=e.replace(/=+$/,""),e.length%4==1)throw new t("'atob' failed: The string to be decoded is not correctly encoded.");for(var o,n,a=0,i=0,c="";n=e.charAt(i++);~n&&(o=a%4?64*o+n:n,a++%4)?c+=String.fromCharCode(255&o>>(-2*a&6)):0)n=r.indexOf(n);return c})}(); \ No newline at end of file diff --git a/src/node_modules/Base64/package.json b/src/node_modules/Base64/package.json deleted file mode 100644 index 8362d28..0000000 --- a/src/node_modules/Base64/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_args": [ - [ - "Base64@~0.2.0", - "/media/Github/Vertinext2/src/node_modules/http-browserify" - ] - ], - "_from": "Base64@>=0.2.0 <0.3.0", - "_id": "Base64@0.2.1", - "_inCache": true, - "_installable": true, - "_location": "/Base64", - "_npmUser": { - "email": "npm@michael.ficarra.me", - "name": "michaelficarra" - }, - "_npmVersion": "1.4.3", - "_phantomChildren": {}, - "_requested": { - "name": "Base64", - "raw": "Base64@~0.2.0", - "rawSpec": "~0.2.0", - "scope": null, - "spec": ">=0.2.0 <0.3.0", - "type": "range" - }, - "_requiredBy": [ - "/http-browserify" - ], - "_resolved": "https://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz", - "_shasum": "ba3a4230708e186705065e66babdd4c35cf60028", - "_shrinkwrap": null, - "_spec": "Base64@~0.2.0", - "_where": "/media/Github/Vertinext2/src/node_modules/http-browserify", - "author": { - "email": "dc@davidchambers.me", - "name": "David Chambers" - }, - "bugs": { - "url": "https://github.com/davidchambers/Base64.js/issues" - }, - "dependencies": {}, - "description": "Base64 encoding and decoding", - "devDependencies": { - "coffee-script": "1.7.x", - "istanbul": "0.2.x", - "mocha": "1.18.x", - "uglify-js": "2.4.x", - "xyz": "0.1.x" - }, - "directories": {}, - "dist": { - "shasum": "ba3a4230708e186705065e66babdd4c35cf60028", - "tarball": "http://registry.npmjs.org/Base64/-/Base64-0.2.1.tgz" - }, - "homepage": "https://github.com/davidchambers/Base64.js", - "licenses": [ - { - "type": "WTFPL", - "url": "https://raw.github.com/davidchambers/Base64.js/master/LICENSE" - } - ], - "main": "./base64.js", - "maintainers": [ - { - "email": "dc@hashify.me", - "name": "davidchambers" - }, - { - "email": "npm@michael.ficarra.me", - "name": "michaelficarra" - } - ], - "name": "Base64", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/davidchambers/Base64.js.git" - }, - "version": "0.2.1" -} diff --git a/src/node_modules/Base64/test/base64.coffee b/src/node_modules/Base64/test/base64.coffee deleted file mode 100644 index e25cf5c..0000000 --- a/src/node_modules/Base64/test/base64.coffee +++ /dev/null @@ -1,52 +0,0 @@ -assert = require 'assert' - -{btoa, atob} = require '..' - - -describe 'Base64.js', -> - - it 'can encode ASCII input', -> - assert.strictEqual btoa(''), '' - assert.strictEqual btoa('f'), 'Zg==' - assert.strictEqual btoa('fo'), 'Zm8=' - assert.strictEqual btoa('foo'), 'Zm9v' - assert.strictEqual btoa('quux'), 'cXV1eA==' - assert.strictEqual btoa('!"#$%'), 'ISIjJCU=' - assert.strictEqual btoa("&'()*+"), 'JicoKSor' - assert.strictEqual btoa(',-./012'), 'LC0uLzAxMg==' - assert.strictEqual btoa('3456789:'), 'MzQ1Njc4OTo=' - assert.strictEqual btoa(';<=>?@ABC'), 'Ozw9Pj9AQUJD' - assert.strictEqual btoa('DEFGHIJKLM'), 'REVGR0hJSktMTQ==' - assert.strictEqual btoa('NOPQRSTUVWX'), 'Tk9QUVJTVFVWV1g=' - assert.strictEqual btoa('YZ[\\]^_`abc'), 'WVpbXF1eX2BhYmM=' - assert.strictEqual btoa('defghijklmnop'), 'ZGVmZ2hpamtsbW5vcA==' - assert.strictEqual btoa('qrstuvwxyz{|}~'), 'cXJzdHV2d3h5ent8fX4=' - - it 'cannot encode non-ASCII input', -> - assert.throws (-> btoa '✈'), (err) -> - err instanceof Error and - err.name is 'InvalidCharacterError' and - err.message is "'btoa' failed: The string to be encoded contains characters outside of the Latin1 range." - - it 'can decode Base64-encoded input', -> - assert.strictEqual atob(''), '' - assert.strictEqual atob('Zg=='), 'f' - assert.strictEqual atob('Zm8='), 'fo' - assert.strictEqual atob('Zm9v'), 'foo' - assert.strictEqual atob('cXV1eA=='), 'quux' - assert.strictEqual atob('ISIjJCU='), '!"#$%' - assert.strictEqual atob('JicoKSor'), "&'()*+" - assert.strictEqual atob('LC0uLzAxMg=='), ',-./012' - assert.strictEqual atob('MzQ1Njc4OTo='), '3456789:' - assert.strictEqual atob('Ozw9Pj9AQUJD'), ';<=>?@ABC' - assert.strictEqual atob('REVGR0hJSktMTQ=='), 'DEFGHIJKLM' - assert.strictEqual atob('Tk9QUVJTVFVWV1g='), 'NOPQRSTUVWX' - assert.strictEqual atob('WVpbXF1eX2BhYmM='), 'YZ[\\]^_`abc' - assert.strictEqual atob('ZGVmZ2hpamtsbW5vcA=='), 'defghijklmnop' - assert.strictEqual atob('cXJzdHV2d3h5ent8fX4='), 'qrstuvwxyz{|}~' - - it 'cannot decode invalid input', -> - assert.throws (-> atob 'a'), (err) -> - err instanceof Error and - err.name is 'InvalidCharacterError' and - err.message is "'atob' failed: The string to be decoded is not correctly encoded." diff --git a/src/node_modules/JSONStream/.npmignore b/src/node_modules/JSONStream/.npmignore deleted file mode 100644 index a9a9d58..0000000 --- a/src/node_modules/JSONStream/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/* -node_modules diff --git a/src/node_modules/JSONStream/.travis.yml b/src/node_modules/JSONStream/.travis.yml deleted file mode 100644 index 6e5919d..0000000 --- a/src/node_modules/JSONStream/.travis.yml +++ /dev/null @@ -1,3 +0,0 @@ -language: node_js -node_js: - - "0.10" diff --git a/src/node_modules/JSONStream/LICENSE.APACHE2 b/src/node_modules/JSONStream/LICENSE.APACHE2 deleted file mode 100644 index 6366c04..0000000 --- a/src/node_modules/JSONStream/LICENSE.APACHE2 +++ /dev/null @@ -1,15 +0,0 @@ -Apache License, Version 2.0 - -Copyright (c) 2011 Dominic Tarr - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/src/node_modules/JSONStream/LICENSE.MIT b/src/node_modules/JSONStream/LICENSE.MIT deleted file mode 100644 index 6eafbd7..0000000 --- a/src/node_modules/JSONStream/LICENSE.MIT +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License - -Copyright (c) 2011 Dominic Tarr - -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/src/node_modules/JSONStream/examples/all_docs.js b/src/node_modules/JSONStream/examples/all_docs.js deleted file mode 100644 index fa87fe5..0000000 --- a/src/node_modules/JSONStream/examples/all_docs.js +++ /dev/null @@ -1,13 +0,0 @@ -var request = require('request') - , JSONStream = require('JSONStream') - , es = require('event-stream') - -var parser = JSONStream.parse(['rows', true]) //emit parts that match this path (any element of the rows array) - , req = request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) - , logger = es.mapSync(function (data) { //create a stream that logs to stderr, - console.error(data) - return data - }) - -req.pipe(parser) -parser.pipe(logger) diff --git a/src/node_modules/JSONStream/index.js b/src/node_modules/JSONStream/index.js deleted file mode 100755 index a9de1b3..0000000 --- a/src/node_modules/JSONStream/index.js +++ /dev/null @@ -1,203 +0,0 @@ -#! /usr/bin/env node - -'use strict' - -var Parser = require('jsonparse') - , through = require('through') - -/* - - the value of this.stack that creationix's jsonparse has is weird. - - it makes this code ugly, but his problem is way harder that mine, - so i'll forgive him. - -*/ - -exports.parse = function (path, map) { - - var parser = new Parser() - var stream = through(function (chunk) { - if('string' === typeof chunk) - chunk = new Buffer(chunk) - parser.write(chunk) - }, - function (data) { - if(data) - stream.write(data) - stream.queue(null) - }) - - if('string' === typeof path) - path = path.split('.').map(function (e) { - if (e === '*') - return true - else if (e === '') // '..'.split('.') returns an empty string - return {recurse: true} - else - return e - }) - - - var count = 0, _key - if(!path || !path.length) - path = null - - parser.onValue = function (value) { - if (!this.root) - stream.root = value - - if(! path) return - - var i = 0 // iterates on path - var j = 0 // iterates on stack - while (i < path.length) { - var key = path[i] - var c - j++ - - if (key && !key.recurse) { - c = (j === this.stack.length) ? this : this.stack[j] - if (!c) return - if (! check(key, c.key)) return - i++ - } else { - i++ - var nextKey = path[i] - if (! nextKey) return - while (true) { - c = (j === this.stack.length) ? this : this.stack[j] - if (!c) return - if (check(nextKey, c.key)) { - i++; - this.stack[j].value = null - break - } - j++ - } - } - - } - if (j !== this.stack.length) return - - count ++ - var actualPath = this.stack.slice(1).map(function(element) { return element.key }).concat([this.key]) - var data = this.value[this.key] - if(null != data) - if(null != (data = map ? map(data, actualPath) : data)) - stream.queue(data) - delete this.value[this.key] - for(var k in this.stack) - this.stack[k].value = null - } - parser._onToken = parser.onToken; - - parser.onToken = function (token, value) { - parser._onToken(token, value); - if (this.stack.length === 0) { - if (stream.root) { - if(!path) - stream.queue(stream.root) - count = 0; - stream.root = null; - } - } - } - - parser.onError = function (err) { - if(err.message.indexOf("at position") > -1) - err.message = "Invalid JSON (" + err.message + ")"; - stream.emit('error', err) - } - - - return stream -} - -function check (x, y) { - if ('string' === typeof x) - return y == x - else if (x && 'function' === typeof x.exec) - return x.exec(y) - else if ('boolean' === typeof x) - return x - else if ('function' === typeof x) - return x(y) - return false -} - -exports.stringify = function (op, sep, cl, indent) { - indent = indent || 0 - if (op === false){ - op = '' - sep = '\n' - cl = '' - } else if (op == null) { - - op = '[\n' - sep = '\n,\n' - cl = '\n]\n' - - } - - //else, what ever you like - - var stream - , first = true - , anyData = false - stream = through(function (data) { - anyData = true - var json = JSON.stringify(data, null, indent) - if(first) { first = false ; stream.queue(op + json)} - else stream.queue(sep + json) - }, - function (data) { - if(!anyData) - stream.queue(op) - stream.queue(cl) - stream.queue(null) - }) - - return stream -} - -exports.stringifyObject = function (op, sep, cl, indent) { - indent = indent || 0 - if (op === false){ - op = '' - sep = '\n' - cl = '' - } else if (op == null) { - - op = '{\n' - sep = '\n,\n' - cl = '\n}\n' - - } - - //else, what ever you like - - var first = true - var anyData = false - var stream = through(function (data) { - anyData = true - var json = JSON.stringify(data[0]) + ':' + JSON.stringify(data[1], null, indent) - if(first) { first = false ; this.queue(op + json)} - else this.queue(sep + json) - }, - function (data) { - if(!anyData) this.queue(op) - this.queue(cl) - - this.queue(null) - }) - - return stream -} - -if(!module.parent && process.title !== 'browser') { - process.stdin - .pipe(exports.parse(process.argv[2])) - .pipe(exports.stringify('[', ',\n', ']\n', 2)) - .pipe(process.stdout) -} diff --git a/src/node_modules/JSONStream/package.json b/src/node_modules/JSONStream/package.json deleted file mode 100644 index 3239a3b..0000000 --- a/src/node_modules/JSONStream/package.json +++ /dev/null @@ -1,100 +0,0 @@ -{ - "_args": [ - [ - "JSONStream@^1.0.3", - "/media/Github/Vertinext2/src/node_modules/browserify" - ] - ], - "_from": "JSONStream@>=1.0.3 <2.0.0", - "_id": "JSONStream@1.0.7", - "_inCache": true, - "_installable": true, - "_location": "/JSONStream", - "_nodeVersion": "4.2.1", - "_npmUser": { - "email": "dominic.tarr@gmail.com", - "name": "dominictarr" - }, - "_npmVersion": "2.14.8", - "_phantomChildren": {}, - "_requested": { - "name": "JSONStream", - "raw": "JSONStream@^1.0.3", - "rawSpec": "^1.0.3", - "scope": null, - "spec": ">=1.0.3 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/browser-pack", - "/browserify", - "/deps-sort", - "/insert-module-globals", - "/module-deps" - ], - "_resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.0.7.tgz", - "_shasum": "700c8e4711fef1ce421f650bead55235bb21d7de", - "_shrinkwrap": null, - "_spec": "JSONStream@^1.0.3", - "_where": "/media/Github/Vertinext2/src/node_modules/browserify", - "author": { - "email": "dominic.tarr@gmail.com", - "name": "Dominic Tarr", - "url": "http://bit.ly/dominictarr" - }, - "bin": { - "JSONStream": "./index.js" - }, - "bugs": { - "url": "https://github.com/dominictarr/JSONStream/issues" - }, - "dependencies": { - "jsonparse": "^1.1.0", - "through": ">=2.2.7 <3" - }, - "description": "rawStream.pipe(JSONStream.parse()).pipe(streamOfObjects)", - "devDependencies": { - "assertions": "~2.2.2", - "event-stream": "~0.7.0", - "it-is": "~1", - "render": "~0.1.1", - "tape": "~2.12.3", - "trees": "~0.0.3" - }, - "directories": {}, - "dist": { - "shasum": "700c8e4711fef1ce421f650bead55235bb21d7de", - "tarball": "http://registry.npmjs.org/JSONStream/-/JSONStream-1.0.7.tgz" - }, - "engines": { - "node": "*" - }, - "gitHead": "d02b9d588241f05271190b174c23f0c3846edf9c", - "homepage": "http://github.com/dominictarr/JSONStream", - "keywords": [ - "json", - "stream", - "streaming", - "parser", - "async", - "parsing" - ], - "license": "(MIT OR Apache-2.0)", - "maintainers": [ - { - "email": "dominic.tarr@gmail.com", - "name": "dominictarr" - } - ], - "name": "JSONStream", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/dominictarr/JSONStream.git" - }, - "scripts": { - "test": "set -e; for t in test/*.js; do echo '***' $t '***'; node $t; done" - }, - "version": "1.0.7" -} diff --git a/src/node_modules/JSONStream/readme.markdown b/src/node_modules/JSONStream/readme.markdown deleted file mode 100644 index 4a6531a..0000000 --- a/src/node_modules/JSONStream/readme.markdown +++ /dev/null @@ -1,172 +0,0 @@ -# JSONStream - -streaming JSON.parse and stringify - -![](https://secure.travis-ci.org/dominictarr/JSONStream.png?branch=master) - -## example - -``` js - -var request = require('request') - , JSONStream = require('JSONStream') - , es = require('event-stream') - -request({url: 'http://isaacs.couchone.com/registry/_all_docs'}) - .pipe(JSONStream.parse('rows.*')) - .pipe(es.mapSync(function (data) { - console.error(data) - return data - })) -``` - -## JSONStream.parse(path) - -parse stream of values that match a path - -``` js - JSONStream.parse('rows.*.doc') -``` - -The `..` operator is the recursive descent operator from [JSONPath](http://goessner.net/articles/JsonPath/), which will match a child at any depth (see examples below). - -If your keys have keys that include `.` or `*` etc, use an array instead. -`['row', true, /^doc/]`. - -If you use an array, `RegExp`s, booleans, and/or functions. The `..` operator is also available in array representation, using `{recurse: true}`. -any object that matches the path will be emitted as 'data' (and `pipe`d down stream) - -If `path` is empty or null, no 'data' events are emitted. - -### Examples - -query a couchdb view: - -``` bash -curl -sS localhost:5984/tests/_all_docs&include_docs=true -``` -you will get something like this: - -``` js -{"total_rows":129,"offset":0,"rows":[ - { "id":"change1_0.6995461115147918" - , "key":"change1_0.6995461115147918" - , "value":{"rev":"1-e240bae28c7bb3667f02760f6398d508"} - , "doc":{ - "_id": "change1_0.6995461115147918" - , "_rev": "1-e240bae28c7bb3667f02760f6398d508","hello":1} - }, - { "id":"change2_0.6995461115147918" - , "key":"change2_0.6995461115147918" - , "value":{"rev":"1-13677d36b98c0c075145bb8975105153"} - , "doc":{ - "_id":"change2_0.6995461115147918" - , "_rev":"1-13677d36b98c0c075145bb8975105153" - , "hello":2 - } - }, -]} - -``` - -we are probably most interested in the `rows.*.doc` - -create a `Stream` that parses the documents from the feed like this: - -``` js -var stream = JSONStream.parse(['rows', true, 'doc']) //rows, ANYTHING, doc - -stream.on('data', function(data) { - console.log('received:', data); -}); -``` -awesome! - -### recursive patterns (..) - -`JSONStream.parse('docs..value')` -(or `JSONStream.parse(['docs', {recurse: true}, 'value'])` using an array) -will emit every `value` object that is a child, grand-child, etc. of the -`docs` object. In this example, it will match exactly 5 times at various depth -levels, emitting 0, 1, 2, 3 and 4 as results. - -```js -{ - "total": 5, - "docs": [ - { - "key": { - "value": 0, - "some": "property" - } - }, - {"value": 1}, - {"value": 2}, - {"blbl": [{}, {"a":0, "b":1, "value":3}, 10]}, - {"value": 4} - ] -} -``` - -## JSONStream.parse(pattern, map) - -provide a function that can be used to map or filter -the json output. `map` is passed the value at that node of the pattern, -if `map` return non-nullish (anything but `null` or `undefined`) -that value will be emitted in the stream. If it returns a nullish value, -nothing will be emitted. - -## JSONStream.stringify(open, sep, close) - -Create a writable stream. - -you may pass in custom `open`, `close`, and `seperator` strings. -But, by default, `JSONStream.stringify()` will create an array, -(with default options `open='[\n', sep='\n,\n', close='\n]\n'`) - -If you call `JSONStream.stringify(false)` -the elements will only be seperated by a newline. - -If you only write one item this will be valid JSON. - -If you write many items, -you can use a `RegExp` to split it into valid chunks. - -## JSONStream.stringifyObject(open, sep, close) - -Very much like `JSONStream.stringify`, -but creates a writable stream for objects instead of arrays. - -Accordingly, `open='{\n', sep='\n,\n', close='\n}\n'`. - -When you `.write()` to the stream you must supply an array with `[ key, data ]` -as the first argument. - -## unix tool - -query npm to see all the modules that browserify has ever depended on. - -``` bash -curl https://registry.npmjs.org/browserify | JSONStream 'versions.*.dependencies' -``` - -## numbers - -There are occasional problems parsing and unparsing very precise numbers. - -I have opened an issue here: - -https://github.com/creationix/jsonparse/issues/2 - -+1 - -## Acknowlegements - -this module depends on https://github.com/creationix/jsonparse -by Tim Caswell -and also thanks to Florent Jaby for teaching me about parsing with: -https://github.com/Floby/node-json-streams - -## license - -Dual-licensed under the MIT License or the Apache License, version 2.0 diff --git a/src/node_modules/JSONStream/test/bool.js b/src/node_modules/JSONStream/test/bool.js deleted file mode 100644 index 6c386d6..0000000 --- a/src/node_modules/JSONStream/test/bool.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], -// stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - JSONStream.parse([true]), - es.writeArray(function (err, lines) { - - it(lines).has(expected) - console.error('PASSED') - }) - ) diff --git a/src/node_modules/JSONStream/test/browser.js b/src/node_modules/JSONStream/test/browser.js deleted file mode 100644 index 3c28d49..0000000 --- a/src/node_modules/JSONStream/test/browser.js +++ /dev/null @@ -1,18 +0,0 @@ -var test = require('tape') -var JSONStream = require('../') -var testData = '{"rows":[{"hello":"world"}, {"foo": "bar"}]}' - -test('basic parsing', function (t) { - t.plan(2) - var parsed = JSONStream.parse("rows.*") - var parsedKeys = {} - parsed.on('data', function(match) { - parsedKeys[Object.keys(match)[0]] = true - }) - parsed.on('end', function() { - t.equal(!!parsedKeys['hello'], true) - t.equal(!!parsedKeys['foo'], true) - }) - parsed.write(testData) - parsed.end() -}) \ No newline at end of file diff --git a/src/node_modules/JSONStream/test/destroy_missing.js b/src/node_modules/JSONStream/test/destroy_missing.js deleted file mode 100644 index 315fdc8..0000000 --- a/src/node_modules/JSONStream/test/destroy_missing.js +++ /dev/null @@ -1,27 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var JSONStream = require('../'); - - -var server = net.createServer(function(client) { - var parser = JSONStream.parse([]); - parser.on('end', function() { - console.log('close') - console.error('PASSED'); - server.close(); - }); - client.pipe(parser); - var n = 4 - client.on('data', function () { - if(--n) return - client.end(); - }) -}); -server.listen(9999); - - -var client = net.connect({ port : 9999 }, function() { - fs.createReadStream(file).pipe(client).on('data', console.log) //.resume(); -}); diff --git a/src/node_modules/JSONStream/test/disabled/doubledot1.js b/src/node_modules/JSONStream/test/disabled/doubledot1.js deleted file mode 100644 index 78149b9..0000000 --- a/src/node_modules/JSONStream/test/disabled/doubledot1.js +++ /dev/null @@ -1,29 +0,0 @@ -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse('rows..rev') - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - for (var i = 0 ; i < expected.rows.length ; i++) - it(parsed[i]).deepEqual(expected.rows[i].value.rev) - console.error('PASSED') -}) diff --git a/src/node_modules/JSONStream/test/disabled/doubledot2.js b/src/node_modules/JSONStream/test/disabled/doubledot2.js deleted file mode 100644 index f99d881..0000000 --- a/src/node_modules/JSONStream/test/disabled/doubledot2.js +++ /dev/null @@ -1,29 +0,0 @@ - var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','depth.json') - , JSONStream = require('../') - , it = require('it-is') - - var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['docs', {recurse: true}, 'value']) - , called = 0 - , ended = false - , parsed = [] - - fs.createReadStream(file).pipe(parser) - - parser.on('data', function (data) { - called ++ - parsed.push(data) - }) - - parser.on('end', function () { - ended = true - }) - - process.on('exit', function () { - it(called).equal(5) - for (var i = 0 ; i < 5 ; i++) - it(parsed[i]).deepEqual(i) - console.error('PASSED') - }) diff --git a/src/node_modules/JSONStream/test/empty.js b/src/node_modules/JSONStream/test/empty.js deleted file mode 100644 index 19e888c..0000000 --- a/src/node_modules/JSONStream/test/empty.js +++ /dev/null @@ -1,44 +0,0 @@ -var JSONStream = require('../') - , stream = require('stream') - , it = require('it-is') - -var output = [ [], [] ] - -var parser1 = JSONStream.parse(['docs', /./]) -parser1.on('data', function(data) { - output[0].push(data) -}) - -var parser2 = JSONStream.parse(['docs', /./]) -parser2.on('data', function(data) { - output[1].push(data) -}) - -var pending = 2 -function onend () { - if (--pending > 0) return - it(output).deepEqual([ - [], [{hello: 'world'}] - ]) - console.error('PASSED') -} -parser1.on('end', onend) -parser2.on('end', onend) - -function makeReadableStream() { - var readStream = new stream.Stream() - readStream.readable = true - readStream.write = function (data) { this.emit('data', data) } - readStream.end = function (data) { this.emit('end') } - return readStream -} - -var emptyArray = makeReadableStream() -emptyArray.pipe(parser1) -emptyArray.write('{"docs":[]}') -emptyArray.end() - -var objectArray = makeReadableStream() -objectArray.pipe(parser2) -objectArray.write('{"docs":[{"hello":"world"}]}') -objectArray.end() diff --git a/src/node_modules/JSONStream/test/fixtures/all_npm.json b/src/node_modules/JSONStream/test/fixtures/all_npm.json deleted file mode 100644 index 6303ea2..0000000 --- a/src/node_modules/JSONStream/test/fixtures/all_npm.json +++ /dev/null @@ -1,4030 +0,0 @@ -{"total_rows":4028,"offset":0,"rows":[ -{"id":"","key":"","value":{"rev":"1-2f11e026763c10730d8b19ba5dce7565"}}, -{"id":"3scale","key":"3scale","value":{"rev":"3-db3d574bf0ecdfdf627afeaa21b4bdaa"}}, -{"id":"7digital-api","key":"7digital-api","value":{"rev":"20-21d11832780e2368aabc946598a41dd5"}}, -{"id":"AMD","key":"AMD","value":{"rev":"7-3b4305a9c786ab4c5ce611e7f0de0aca"}}, -{"id":"AriesNode","key":"AriesNode","value":{"rev":"3-9d88392bca6582c5c54784927dbfdee6"}}, -{"id":"Array.prototype.forEachAsync","key":"Array.prototype.forEachAsync","value":{"rev":"3-85696441ba6bef77cc1e7de7b073110e"}}, -{"id":"Babel","key":"Babel","value":{"rev":"5-9d8370c6ac6fd9cd3d530f26a9379814"}}, -{"id":"Blaggie-System","key":"Blaggie-System","value":{"rev":"3-47782b1e5cbfa425170192799510e148"}}, -{"id":"Blob","key":"Blob","value":{"rev":"3-cf5fb5d69da4dd00bc4f2be8870ca698"}}, -{"id":"BlobBuilder","key":"BlobBuilder","value":{"rev":"3-eb977ff1713a915384fac994f9d8fa7c"}}, -{"id":"Buffer","key":"Buffer","value":{"rev":"3-549594b58e83d6d07bb219e73de558e5"}}, -{"id":"CLI-UI","key":"CLI-UI","value":{"rev":"5-5912625f27b4bdfb4d3eed16726c48a8"}}, -{"id":"CLoader","key":"CLoader","value":{"rev":"1-ad3c317ddf3497e73ab41cb1ddbc6ba8"}}, -{"id":"CM1","key":"CM1","value":{"rev":"15-a325a2dc28bc6967a1a14beed86f3b80"}}, -{"id":"CONFIGURATOR","key":"CONFIGURATOR","value":{"rev":"3-c76bf9282a75cc4d3fb349e831ccb8a5"}}, -{"id":"Cashew","key":"Cashew","value":{"rev":"7-6a74dc51dbecc47d2c15bfb7d056a20f"}}, -{"id":"Class","key":"Class","value":{"rev":"5-958c6365f76a60a8b3dafbbd9730ac7e"}}, -{"id":"ClassLoader","key":"ClassLoader","value":{"rev":"3-27fe8faa8a1d60d639f87af52826ed47"}}, -{"id":"ClearSilver","key":"ClearSilver","value":{"rev":"3-f3e54eb9ce64fc6a090186e61f15ed0b"}}, -{"id":"Couch-cleaner","key":"Couch-cleaner","value":{"rev":"3-fc77270917d967a4e2e8637cfa9f0fe0"}}, -{"id":"CouchCover","key":"CouchCover","value":{"rev":"15-3b2d87d314f57272a5c27c42bbb3eaf9"}}, -{"id":"DOM-js","key":"DOM-js","value":{"rev":"8-748cdc96566a7b65bbd0b12be2eeb386"}}, -{"id":"DOMBuilder","key":"DOMBuilder","value":{"rev":"19-41a518f2ce16fabc0241535ccd967300"}}, -{"id":"DateZ","key":"DateZ","value":{"rev":"15-69d8115a9bd521e614eaad3cf2611264"}}, -{"id":"Dateselect","key":"Dateselect","value":{"rev":"3-6511567a876d8fe15724bbc7f247214c"}}, -{"id":"Deferred","key":"Deferred","value":{"rev":"3-c61dfc4a0d1bd3e9f35c7182f161f1f2"}}, -{"id":"DeskSet","key":"DeskSet","value":{"rev":"5-359bf760718898ff3591eb366e336cf9"}}, -{"id":"Estro","key":"Estro","value":{"rev":"11-97192e2d0327469bb30f814963db6dff"}}, -{"id":"EventProxy.js","key":"EventProxy.js","value":{"rev":"5-106696b56c6959cec4bfd37f406ee60a"}}, -{"id":"EventServer","key":"EventServer","value":{"rev":"3-59d174119435e99e2affe0c4ba7caae0"}}, -{"id":"Expressive","key":"Expressive","value":{"rev":"3-7eae0ea010eb9014b28108e814918eac"}}, -{"id":"F","key":"F","value":{"rev":"12-91a3db69527b46cf43e36b7ec64a4336"}}, -{"id":"Faker","key":"Faker","value":{"rev":"9-77951c352cb6f9a0b824be620a8fa40d"}}, -{"id":"FastLegS","key":"FastLegS","value":{"rev":"27-4399791981235021a36c94bb9e9b52b5"}}, -{"id":"Fayer","key":"Fayer","value":{"rev":"7-7e4974ff2716329375f9711bcabef701"}}, -{"id":"File","key":"File","value":{"rev":"3-45e353a984038bc48248dfc32b18f9a8"}}, -{"id":"FileError","key":"FileError","value":{"rev":"3-bb4b03a2548e3c229e2c7e92242946c3"}}, -{"id":"FileList","key":"FileList","value":{"rev":"3-ec4a3fc91794ef7fdd3fe88b19cec7b0"}}, -{"id":"FileReader","key":"FileReader","value":{"rev":"7-e81b58a2d8a765ae4781b41bbfadb4cb"}}, -{"id":"FileSaver","key":"FileSaver","value":{"rev":"3-476dcb3f63f4d10feee08d41a8128cb8"}}, -{"id":"FileWriter","key":"FileWriter","value":{"rev":"3-f2fcdbc4938de480cce2e8e8416a93dd"}}, -{"id":"FileWriterSync","key":"FileWriterSync","value":{"rev":"3-9494c3fe7a1230238f37a724ec10895b"}}, -{"id":"FormData","key":"FormData","value":{"rev":"3-8872d717575f7090107a96d81583f6fe"}}, -{"id":"Frenchpress","key":"Frenchpress","value":{"rev":"3-6d916fc15b9e77535771578f96c47c52"}}, -{"id":"FreshDocs","key":"FreshDocs","value":{"rev":"5-f1f3e76c85267faf21d06d911cc6c203"}}, -{"id":"Google_Plus_API","key":"Google_Plus_API","value":{"rev":"3-3302bc9846726d996a45daee3dc5922c"}}, -{"id":"Gord","key":"Gord","value":{"rev":"11-32fddef1453773ac7270ba0e7c83f727"}}, -{"id":"Graph","key":"Graph","value":{"rev":"7-c346edea4f90e3e18d50a62473868cf4"}}, -{"id":"GridFS","key":"GridFS","value":{"rev":"27-4fc649aaa007fddec4947bdb7111560f"}}, -{"id":"Haraka","key":"Haraka","value":{"rev":"39-ee8f890521c1579b3cc779c8ebe03480"}}, -{"id":"Index","key":"Index","value":{"rev":"29-d8f4881c1544bf51dea1927e87ebb3f3"}}, -{"id":"JS-Entities","key":"JS-Entities","value":{"rev":"7-905636d8b46f273210233b60063d079b"}}, -{"id":"JSLint-commonJS","key":"JSLint-commonJS","value":{"rev":"3-759a81f82af7055e85ee89c9707c9609"}}, -{"id":"JSON","key":"JSON","value":{"rev":"3-7966a79067c34fb5de2e62c796f67341"}}, -{"id":"JSONPath","key":"JSONPath","value":{"rev":"7-58789d57ae366a5b0ae4b36837f15d59"}}, -{"id":"JSONSelect","key":"JSONSelect","value":{"rev":"9-5b0730da91eeb52e8f54da516367dc0f"}}, -{"id":"JSONloops","key":"JSONloops","value":{"rev":"3-3d4a1f8bfcfd778ab7def54155324331"}}, -{"id":"JSPP","key":"JSPP","value":{"rev":"7-af09a2bb193b3ff44775e8fbb7d4f522"}}, -{"id":"JSV","key":"JSV","value":{"rev":"3-41a7af86909046111be8ee9b56b077c8"}}, -{"id":"Jody","key":"Jody","value":{"rev":"43-70c1cf40e93cd8ce53249e5295d6b159"}}, -{"id":"Journaling-Hash","key":"Journaling-Hash","value":{"rev":"3-ac676eecb40a4dff301c671fa4bb6be9"}}, -{"id":"Kahana","key":"Kahana","value":{"rev":"33-1cb7e291ae02cee4e8105509571223f5"}}, -{"id":"LazyBoy","key":"LazyBoy","value":{"rev":"13-20a8894e3a957f184f5ae2a3e709551c"}}, -{"id":"Lingo","key":"Lingo","value":{"rev":"9-1af9a6df616e601f09c8cec07ccad1ae"}}, -{"id":"Loggy","key":"Loggy","value":{"rev":"33-e115c25163ab468314eedbe497d1c51e"}}, -{"id":"MeCab","key":"MeCab","value":{"rev":"4-2687176c7b878930e812a534976a6988"}}, -{"id":"Mercury","key":"Mercury","value":{"rev":"3-09a6bff1332ed829bd2c37bfec244a41"}}, -{"id":"Mu","key":"Mu","value":{"rev":"7-28e6ab82c402c3a75fe0f79dea846b97"}}, -{"id":"N","key":"N","value":{"rev":"7-e265046b5bdd299b2cad1584083ce2d5"}}, -{"id":"NORRIS","key":"NORRIS","value":{"rev":"3-4b5b23b09118582c44414f8d480619e6"}}, -{"id":"NetOS","key":"NetOS","value":{"rev":"3-3f943f87a24c11e6dd8c265469914e80"}}, -{"id":"NewBase60","key":"NewBase60","value":{"rev":"3-fd84758db79870e82917d358c6673f32"}}, -{"id":"NoCR","key":"NoCR","value":{"rev":"3-8f6cddd528f2d6045e3dda6006fb6948"}}, -{"id":"NodObjC","key":"NodObjC","value":{"rev":"15-ea6ab2df532c90fcefe5a428950bfdbb"}}, -{"id":"Node-JavaScript-Preprocessor","key":"Node-JavaScript-Preprocessor","value":{"rev":"13-4662b5ad742caaa467ec5d6c8e77b1e5"}}, -{"id":"NodeInterval","key":"NodeInterval","value":{"rev":"3-dc3446db2e0cd5be29a3c07942dba66d"}}, -{"id":"NodeSSH","key":"NodeSSH","value":{"rev":"3-45530fae5a69c44a6dd92357910f4212"}}, -{"id":"Nonsense","key":"Nonsense","value":{"rev":"3-9d86191475bc76dc3dd496d4dfe5d94e"}}, -{"id":"NormAndVal","key":"NormAndVal","value":{"rev":"9-d3b3d6ffd046292f4733aa5f3eb7be61"}}, -{"id":"Olive","key":"Olive","value":{"rev":"5-67f3057f09cae5104f09472db1d215aa"}}, -{"id":"OnCollect","key":"OnCollect","value":{"rev":"16-6dbe3afd04f123dda87bb1e21cdfd776"}}, -{"id":"PJsonCouch","key":"PJsonCouch","value":{"rev":"3-be9588f49d85094c36288eb63f8236b3"}}, -{"id":"PMInject","key":"PMInject","value":{"rev":"5-da518047d8273dbf3b3c05ea25e77836"}}, -{"id":"PanPG","key":"PanPG","value":{"rev":"13-beb54225a6b1be4c157434c28adca016"}}, -{"id":"PerfDriver","key":"PerfDriver","value":{"rev":"2-b448fb2f407f341b8df7032f29e4920f"}}, -{"id":"PostgresClient","key":"PostgresClient","value":{"rev":"8-2baec6847f8ad7dcf24b7d61a4034163"}}, -{"id":"QuickWeb","key":"QuickWeb","value":{"rev":"13-d388df9c484021ecd75bc9650d659a67"}}, -{"id":"R.js","key":"R.js","value":{"rev":"3-3f154b95ec6fc744f95a29750f16667e"}}, -{"id":"R2","key":"R2","value":{"rev":"11-f5ccff6f108f6b928caafb62b80d1056"}}, -{"id":"Reston","key":"Reston","value":{"rev":"5-9d234010f32f593edafc04620f3cf2bd"}}, -{"id":"Sardines","key":"Sardines","value":{"rev":"5-d7d3d2269420e21c2c62b86ff5a0021e"}}, -{"id":"SessionWebSocket","key":"SessionWebSocket","value":{"rev":"8-d9fc9beaf90057aefeb701addd7fc845"}}, -{"id":"Sheet","key":"Sheet","value":{"rev":"8-c827c713564e4ae5a17988ffea520d0d"}}, -{"id":"Spec_My_Node","key":"Spec_My_Node","value":{"rev":"8-fa58408e9d9736d9c6fa8daf5d632106"}}, -{"id":"Spot","key":"Spot","value":{"rev":"3-6b6c2131451fed28fb57c924c4fa44cc"}}, -{"id":"Sslac","key":"Sslac","value":{"rev":"3-70a2215cc7505729254aa6fa1d9a25d9"}}, -{"id":"StaticServer","key":"StaticServer","value":{"rev":"3-6f5433177ef4d76a52f01c093117a532"}}, -{"id":"StringScanner","key":"StringScanner","value":{"rev":"3-e85d0646c25ec477c1c45538712d3a38"}}, -{"id":"Structr","key":"Structr","value":{"rev":"3-449720001801cff5831c2cc0e0f1fcf8"}}, -{"id":"Templ8","key":"Templ8","value":{"rev":"11-4e6edb250bc250df20b2d557ca7f6589"}}, -{"id":"Template","key":"Template","value":{"rev":"6-1f055c73524d2b7e82eb6c225bd4b8e0"}}, -{"id":"Thimble","key":"Thimble","value":{"rev":"3-8499b261206f2f2e9acf92d8a4e54afb"}}, -{"id":"Toji","key":"Toji","value":{"rev":"96-511e171ad9f32a9264c2cdf01accacfb"}}, -{"id":"TwigJS","key":"TwigJS","value":{"rev":"3-1aaefc6d6895d7d4824174d410a747b9"}}, -{"id":"UkGeoTool","key":"UkGeoTool","value":{"rev":"5-e84291128e12f66cebb972a60c1d710f"}}, -{"id":"Vector","key":"Vector","value":{"rev":"3-bf5dc97abe7cf1057260b70638175a96"}}, -{"id":"_design/app","key":"_design/app","value":{"rev":"421-b1661d854599a58d0904d68aa44d8b63"}}, -{"id":"_design/ui","key":"_design/ui","value":{"rev":"78-db00aeb91a59a326e38e2bef7f1126cf"}}, -{"id":"aaronblohowiak-plugify-js","key":"aaronblohowiak-plugify-js","value":{"rev":"3-0272c269eacd0c86bfc1711566922577"}}, -{"id":"aaronblohowiak-uglify-js","key":"aaronblohowiak-uglify-js","value":{"rev":"3-77844a6def6ec428d75caa0846c95502"}}, -{"id":"aasm-js","key":"aasm-js","value":{"rev":"3-01a48108d55909575440d9e0ef114f37"}}, -{"id":"abbrev","key":"abbrev","value":{"rev":"16-e17a2b6c7360955b950edf2cb2ef1602"}}, -{"id":"abhispeak","key":"abhispeak","value":{"rev":"5-9889431f68ec10212db3be91796608e2"}}, -{"id":"ace","key":"ace","value":{"rev":"3-e8d267de6c17ebaa82c2869aff983c74"}}, -{"id":"acl","key":"acl","value":{"rev":"13-87c131a1801dc50840a177be73ce1c37"}}, -{"id":"active-client","key":"active-client","value":{"rev":"5-0ca16ae2e48a3ba9de2f6830a8c2d3a0"}}, -{"id":"activenode-monitor","key":"activenode-monitor","value":{"rev":"9-2634fa446379c39475d0ce4183fb92f2"}}, -{"id":"activeobject","key":"activeobject","value":{"rev":"43-6d73e28412612aaee37771e3ab292c3d"}}, -{"id":"actor","key":"actor","value":{"rev":"3-f6b84acd7d2e689b860e3142a18cd460"}}, -{"id":"actors","key":"actors","value":{"rev":"3-6df913bbe5b99968a2e71ae4ef07b2d2"}}, -{"id":"addTimeout","key":"addTimeout","value":{"rev":"15-e5170f0597fe8cf5ed0b54b7e6f2cde1"}}, -{"id":"addressable","key":"addressable","value":{"rev":"27-0c74fde458d92e4b93a29317da15bb3c"}}, -{"id":"aejs","key":"aejs","value":{"rev":"7-4928e2ce6151067cd6c585c0ba3e0bc3"}}, -{"id":"aenoa-supervisor","key":"aenoa-supervisor","value":{"rev":"7-6d399675981e76cfdfb9144bc2f7fb6d"}}, -{"id":"after","key":"after","value":{"rev":"9-baee7683ff54182cf7544cc05b0a4ad7"}}, -{"id":"ahr","key":"ahr","value":{"rev":"27-4ed272c516f3f2f9310e4f0ef28254e9"}}, -{"id":"ahr.browser","key":"ahr.browser","value":{"rev":"3-f7226aab4a1a3ab5f77379f92aae87f9"}}, -{"id":"ahr.browser.jsonp","key":"ahr.browser.jsonp","value":{"rev":"3-abed17143cf5e3c451c3d7da457e6f5b"}}, -{"id":"ahr.browser.request","key":"ahr.browser.request","value":{"rev":"7-fafd7b079d0415f388b64a20509a270b"}}, -{"id":"ahr.node","key":"ahr.node","value":{"rev":"17-f487a4a9896bd3876a11f9dfa1c639a7"}}, -{"id":"ahr.options","key":"ahr.options","value":{"rev":"13-904a4cea763a4455f7b2ae0abba18b8d"}}, -{"id":"ahr.utils","key":"ahr.utils","value":{"rev":"3-5f7b4104ea280d1fd36370c8f3356ead"}}, -{"id":"ahr2","key":"ahr2","value":{"rev":"87-ddf57f3ee158dcd23b2df330e2883a1d"}}, -{"id":"ain","key":"ain","value":{"rev":"7-d840736668fb36e9be3c26a68c5cd411"}}, -{"id":"ain-tcp","key":"ain-tcp","value":{"rev":"11-d18a1780bced8981d1d9dbd262ac4045"}}, -{"id":"ain2","key":"ain2","value":{"rev":"5-0b67879174f5f0a06448c7c737d98b5e"}}, -{"id":"airbrake","key":"airbrake","value":{"rev":"33-4bb9f822162e0c930c31b7f961938dc9"}}, -{"id":"ajaxrunner","key":"ajaxrunner","value":{"rev":"2-17e6a5de4f0339f4e6ce0b7681d0ba0c"}}, -{"id":"ajs","key":"ajs","value":{"rev":"13-063a29dec829fdaf4ca63d622137d1c6"}}, -{"id":"ajs-xgettext","key":"ajs-xgettext","value":{"rev":"3-cd4bbcc1c9d87fa7119d3bbbca99b793"}}, -{"id":"akismet","key":"akismet","value":{"rev":"13-a144e15dd6c2b13177572e80a526edd1"}}, -{"id":"alfred","key":"alfred","value":{"rev":"45-9a69041b18d2587c016b1b1deccdb2ce"}}, -{"id":"alfred-bcrypt","key":"alfred-bcrypt","value":{"rev":"11-7ed10ef318e5515d1ef7c040818ddb22"}}, -{"id":"algorithm","key":"algorithm","value":{"rev":"3-9ec0b38298cc15b0f295152de8763358"}}, -{"id":"algorithm-js","key":"algorithm-js","value":{"rev":"9-dd7496b7ec2e3b23cc7bb182ae3aac6d"}}, -{"id":"alists","key":"alists","value":{"rev":"5-22cc13c86d84081a826ac79a0ae5cda3"}}, -{"id":"altshift","key":"altshift","value":{"rev":"53-1c51d8657f271f390503a6fe988d09db"}}, -{"id":"amazon-ses","key":"amazon-ses","value":{"rev":"5-c175d60de2232a5664666a80832269e5"}}, -{"id":"ambrosia","key":"ambrosia","value":{"rev":"3-8c648ec7393cf842838c20e2c5d9bce4"}}, -{"id":"amd","key":"amd","value":{"rev":"3-d78c4df97a577af598a7def2a38379fa"}}, -{"id":"amionline","key":"amionline","value":{"rev":"3-a62887a632523700402b0f4ebb896812"}}, -{"id":"amo-version-reduce","key":"amo-version-reduce","value":{"rev":"3-05f6956269e5e921ca3486d3d6ea74b0"}}, -{"id":"amqp","key":"amqp","value":{"rev":"17-ee62d2b8248f8eb13f3369422d66df26"}}, -{"id":"amqpsnoop","key":"amqpsnoop","value":{"rev":"3-36a1c45647bcfb2f56cf68dbc24b0426"}}, -{"id":"ams","key":"ams","value":{"rev":"40-1c0cc53ad942d2fd23c89618263befc8"}}, -{"id":"amulet","key":"amulet","value":{"rev":"7-d1ed71811e45652799982e4f2e9ffb36"}}, -{"id":"anachronism","key":"anachronism","value":{"rev":"11-468bdb40f9a5aa146bae3c1c6253d0e1"}}, -{"id":"analytics","key":"analytics","value":{"rev":"3-a143ccdd863b5f7dbee4d2f7732390b3"}}, -{"id":"ann","key":"ann","value":{"rev":"9-41f00594d6216c439f05f7116a697cac"}}, -{"id":"ansi-color","key":"ansi-color","value":{"rev":"6-d6f02b32525c1909d5134afa20f470de"}}, -{"id":"ansi-font","key":"ansi-font","value":{"rev":"3-b039661ad9b6aa7baf34741b449c4420"}}, -{"id":"ant","key":"ant","value":{"rev":"3-35a64e0b7f6eb63a90c32971694b0d93"}}, -{"id":"anvil.js","key":"anvil.js","value":{"rev":"19-290c82075f0a9ad764cdf6dc5c558e0f"}}, -{"id":"aop","key":"aop","value":{"rev":"7-5963506c9e7912aa56fda065c56fd472"}}, -{"id":"ap","key":"ap","value":{"rev":"3-f525b5b490a1ada4452f46307bf92d08"}}, -{"id":"apac","key":"apac","value":{"rev":"12-945d0313a84797b4c3df19da4bec14d4"}}, -{"id":"aparser","key":"aparser","value":{"rev":"5-cb35cfc9184ace6642413dad97e49dca"}}, -{"id":"api-easy","key":"api-easy","value":{"rev":"15-2ab5eefef1377ff217cb020e80343d65"}}, -{"id":"api.js","key":"api.js","value":{"rev":"5-a14b8112fbda17022c80356a010de59a"}}, -{"id":"api_request","key":"api_request","value":{"rev":"3-8531e71f5cf2f3f811684269132d72d4"}}, -{"id":"apimaker","key":"apimaker","value":{"rev":"3-bdbd4a2ebf5b67276d89ea73eaa20025"}}, -{"id":"apn","key":"apn","value":{"rev":"30-0513d27341f587b39db54300c380921f"}}, -{"id":"app","key":"app","value":{"rev":"3-d349ddb47167f60c03d259649569e002"}}, -{"id":"app.js","key":"app.js","value":{"rev":"3-bff3646634daccfd964b4bbe510acb25"}}, -{"id":"append","key":"append","value":{"rev":"7-53e2f4ab2a69dc0c5e92f10a154998b6"}}, -{"id":"applescript","key":"applescript","value":{"rev":"10-ef5ab30ccd660dc71fb89e173f30994a"}}, -{"id":"appzone","key":"appzone","value":{"rev":"21-fb27e24d460677fe9c7eda0d9fb1fead"}}, -{"id":"apricot","key":"apricot","value":{"rev":"14-b55361574a0715f78afc76ddf6125845"}}, -{"id":"arcane","key":"arcane","value":{"rev":"3-f846c96e890ed6150d4271c93cc05a24"}}, -{"id":"archetype","key":"archetype","value":{"rev":"3-441336def3b7aade89c8c1c19a84f56d"}}, -{"id":"ardrone","key":"ardrone","value":{"rev":"8-540e95b796da734366a89bb06dc430c5"}}, -{"id":"ardrone-web","key":"ardrone-web","value":{"rev":"3-8a53cc85a95be20cd44921347e82bbe4"}}, -{"id":"arduino","key":"arduino","value":{"rev":"3-22f6359c47412d086d50dc7f1a994139"}}, -{"id":"argon","key":"argon","value":{"rev":"3-ba12426ce67fac01273310cb3909b855"}}, -{"id":"argparse","key":"argparse","value":{"rev":"8-5e841e38cca6cfc3fe1d1f507a7f47ee"}}, -{"id":"argparser","key":"argparser","value":{"rev":"19-b8793bfc005dd84e1213ee53ae56206d"}}, -{"id":"argsparser","key":"argsparser","value":{"rev":"26-d31eca2f41546172763af629fc50631f"}}, -{"id":"argtype","key":"argtype","value":{"rev":"10-96a7d23e571d56cf598472115bcac571"}}, -{"id":"arguments","key":"arguments","value":{"rev":"7-767de2797f41702690bef5928ec7c6e9"}}, -{"id":"armory","key":"armory","value":{"rev":"41-ea0f7bd0868c11fc9986fa708e11e071"}}, -{"id":"armrest","key":"armrest","value":{"rev":"3-bbe40b6320b6328211be33425bed20c8"}}, -{"id":"arnold","key":"arnold","value":{"rev":"3-4896fc8d02b8623f47a024f0dbfa44bf"}}, -{"id":"arouter","key":"arouter","value":{"rev":"7-55cab1f7128df54f27be94039a8d8dc5"}}, -{"id":"array-promise","key":"array-promise","value":{"rev":"3-e2184561ee65de64c2dfeb57955c758f"}}, -{"id":"arrayemitter","key":"arrayemitter","value":{"rev":"3-d64c917ac1095bfcbf173dac88d3d148"}}, -{"id":"asEvented","key":"asEvented","value":{"rev":"3-2ad3693b49d4d9dc9a11c669033a356e"}}, -{"id":"asciimo","key":"asciimo","value":{"rev":"12-50130f5ac2ef4d95df190be2c8ede893"}}, -{"id":"asereje","key":"asereje","value":{"rev":"15-84853499f89a87109ddf47ba692323ba"}}, -{"id":"ash","key":"ash","value":{"rev":"6-3697a3aee708bece8a08c7e0d1010476"}}, -{"id":"ask","key":"ask","value":{"rev":"3-321bbc3837d749b5d97bff251693a825"}}, -{"id":"asn1","key":"asn1","value":{"rev":"13-e681a814a4a1439a22b19e141b45006f"}}, -{"id":"aspsms","key":"aspsms","value":{"rev":"9-7b82d722bdac29a4da8c88b642ad64f2"}}, -{"id":"assert","key":"assert","value":{"rev":"3-85480762f5cb0be2cb85f80918257189"}}, -{"id":"assertions","key":"assertions","value":{"rev":"9-d797d4c09aa994556c7d5fdb4e86fe1b"}}, -{"id":"assertn","key":"assertn","value":{"rev":"6-080a4fb5d2700a6850d56b58c6f6ee9e"}}, -{"id":"assertvanish","key":"assertvanish","value":{"rev":"13-3b0b555ff77c1bfc2fe2642d50879648"}}, -{"id":"asset","key":"asset","value":{"rev":"33-cb70b68e0e05e9c9a18b3d89f1bb43fc"}}, -{"id":"assetgraph","key":"assetgraph","value":{"rev":"82-7853d644e64741b46fdd29a997ec4852"}}, -{"id":"assetgraph-builder","key":"assetgraph-builder","value":{"rev":"61-1ed98d95f3589050037851edde760a01"}}, -{"id":"assetgraph-sprite","key":"assetgraph-sprite","value":{"rev":"15-351b5fd9e50a3dda8580d014383423e0"}}, -{"id":"assets-expander","key":"assets-expander","value":{"rev":"11-f9e1197b773d0031dd015f1d871b87c6"}}, -{"id":"assets-packager","key":"assets-packager","value":{"rev":"13-51f7d2d57ed35be6aff2cc2aa2fa74db"}}, -{"id":"assoc","key":"assoc","value":{"rev":"9-07098388f501da16bf6afe6c9babefd5"}}, -{"id":"ast-inlining","key":"ast-inlining","value":{"rev":"5-02e7e2c3a06ed81ddc61980f778ac413"}}, -{"id":"ast-transformer","key":"ast-transformer","value":{"rev":"5-b4020bb763b8839afa8d3ac0d54a6f26"}}, -{"id":"astar","key":"astar","value":{"rev":"3-3df8c56c64c3863ef0650c0c74e2801b"}}, -{"id":"aster","key":"aster","value":{"rev":"7-b187c1270d3924f5ee04044e579d2df9"}}, -{"id":"asterisk-manager","key":"asterisk-manager","value":{"rev":"3-7fbf4294dafee04cc17cca4692c09c33"}}, -{"id":"astrolin","key":"astrolin","value":{"rev":"3-30ac515a2388e7dc22b25c15346f6d7e"}}, -{"id":"asyn","key":"asyn","value":{"rev":"3-51996b0197c21e85858559045c1481b7"}}, -{"id":"async","key":"async","value":{"rev":"26-73aea795f46345a7e65d89ec75dff2f1"}}, -{"id":"async-array","key":"async-array","value":{"rev":"17-3ef5faff03333aa5b2a733ef36118066"}}, -{"id":"async-chain","key":"async-chain","value":{"rev":"9-10ec3e50b01567390d55973494e36d43"}}, -{"id":"async-ejs","key":"async-ejs","value":{"rev":"19-6f0e6e0eeb3cdb4c816ea427d8288d7d"}}, -{"id":"async-fs","key":"async-fs","value":{"rev":"3-b96906283d345604f784dfcdbeb21a63"}}, -{"id":"async-it","key":"async-it","value":{"rev":"7-6aed4439df25989cfa040fa4b5dd4ff2"}}, -{"id":"async-json","key":"async-json","value":{"rev":"5-589d5b6665d00c5bffb99bb142cac5d0"}}, -{"id":"async-memoizer","key":"async-memoizer","value":{"rev":"9-01d56f4dff95e61a39dab5ebee49d5dc"}}, -{"id":"async-object","key":"async-object","value":{"rev":"21-1bf28b0f8a7d875b54126437f3539f9b"}}, -{"id":"asyncEJS","key":"asyncEJS","value":{"rev":"3-28b1c94255381f23a4d4f52366255937"}}, -{"id":"async_testing","key":"async_testing","value":{"rev":"14-0275d8b608d8644dfe8d68a81fa07e98"}}, -{"id":"asyncevents","key":"asyncevents","value":{"rev":"3-de104847994365dcab5042db2b46fb84"}}, -{"id":"asyncify","key":"asyncify","value":{"rev":"3-3f6deb82ee1c6cb25e83a48fe6379b75"}}, -{"id":"asyncjs","key":"asyncjs","value":{"rev":"27-15903d7351f80ed37cb069aedbfc26cc"}}, -{"id":"asynct","key":"asynct","value":{"rev":"5-6be002b3e005d2d53b80fff32ccbd2ac"}}, -{"id":"at_scheduler","key":"at_scheduler","value":{"rev":"3-5587061c90218d2e99b6e22d5b488b0b"}}, -{"id":"atbar","key":"atbar","value":{"rev":"19-e9e906d4874afd4d8bf2d8349ed46dff"}}, -{"id":"atob","key":"atob","value":{"rev":"3-bc907d10dd2cfc940de586dc090451da"}}, -{"id":"audiolib","key":"audiolib","value":{"rev":"17-cb2f55ff50061081b440f0605cf0450c"}}, -{"id":"audit_couchdb","key":"audit_couchdb","value":{"rev":"24-6e620895b454b345b2aed13db847c237"}}, -{"id":"auditor","key":"auditor","value":{"rev":"11-c4df509d40650c015943dd90315a12c0"}}, -{"id":"authnet_cim","key":"authnet_cim","value":{"rev":"7-f02bbd206ac2b8c05255bcd8171ac1eb"}}, -{"id":"autocomplete","key":"autocomplete","value":{"rev":"3-f2773bca040d5abcd0536dbebe5847bf"}}, -{"id":"autodafe","key":"autodafe","value":{"rev":"7-a75262b53a9dd1a25693adecde7206d7"}}, -{"id":"autolint","key":"autolint","value":{"rev":"7-07f885902d72b52678fcc57aa4b9c592"}}, -{"id":"autoload","key":"autoload","value":{"rev":"5-9247704d9a992a175e3ae49f4af757d0"}}, -{"id":"autoloader","key":"autoloader","value":{"rev":"11-293c20c34d0c81fac5c06b699576b1fe"}}, -{"id":"auton","key":"auton","value":{"rev":"25-4fcb7a62b607b7929b62a9b792afef55"}}, -{"id":"autoreleasepool","key":"autoreleasepool","value":{"rev":"5-5d2798bf74bbec583cc6f19127e3c89e"}}, -{"id":"autorequire","key":"autorequire","value":{"rev":"9-564a46b355532fcec24db0afc99daed5"}}, -{"id":"autotest","key":"autotest","value":{"rev":"7-e319995dd0e1fbd935c14c46b1234f77"}}, -{"id":"awesome","key":"awesome","value":{"rev":"15-4458b746e4722214bd26ea15e453288e"}}, -{"id":"aws","key":"aws","value":{"rev":"14-9a8f0989be29034d3fa5c66c594b649b"}}, -{"id":"aws-js","key":"aws-js","value":{"rev":"6-c61d87b8ad948cd065d2ca222808c209"}}, -{"id":"aws-lib","key":"aws-lib","value":{"rev":"36-9733e215c03d185a860574600a8feb14"}}, -{"id":"aws2js","key":"aws2js","value":{"rev":"35-42498f44a5ae7d4f3c84096b435d0e0b"}}, -{"id":"azure","key":"azure","value":{"rev":"5-2c4e05bd842d3dcfa419f4d2b67121e2"}}, -{"id":"b64","key":"b64","value":{"rev":"3-e5e727a46df4c8aad38acd117d717140"}}, -{"id":"b64url","key":"b64url","value":{"rev":"9-ab3b017f00a53b0078261254704c30ba"}}, -{"id":"ba","key":"ba","value":{"rev":"11-3cec7ec9a566fe95fbeb34271538d60a"}}, -{"id":"babelweb","key":"babelweb","value":{"rev":"11-8e6a2fe00822cec15573cdda48b6d0a0"}}, -{"id":"backbone","key":"backbone","value":{"rev":"37-79b95355f8af59bf9131e14d52b68edc"}}, -{"id":"backbone-browserify","key":"backbone-browserify","value":{"rev":"3-f25dac0b05a7f7aa5dbc0f4a1ad97969"}}, -{"id":"backbone-celtra","key":"backbone-celtra","value":{"rev":"3-775a5ebb25c1cd84723add52774ece84"}}, -{"id":"backbone-couch","key":"backbone-couch","value":{"rev":"8-548327b3cd7ee7a4144c9070377be5f6"}}, -{"id":"backbone-cradle","key":"backbone-cradle","value":{"rev":"3-b9bc220ec48b05eed1d4d77a746b10db"}}, -{"id":"backbone-dirty","key":"backbone-dirty","value":{"rev":"21-fa0f688cc95a85c0fc440733f09243b5"}}, -{"id":"backbone-dnode","key":"backbone-dnode","value":{"rev":"65-3212d3aa3284efb3bc0732bac71b5a2e"}}, -{"id":"backbone-proxy","key":"backbone-proxy","value":{"rev":"3-3602cb984bdd266516a3145663f9a5c6"}}, -{"id":"backbone-redis","key":"backbone-redis","value":{"rev":"9-2e3f6a9e095b00ccec9aa19b3fbc65eb"}}, -{"id":"backbone-rel","key":"backbone-rel","value":{"rev":"5-f9773dc85f1c502e61c163a22d2f74aa"}}, -{"id":"backbone-simpledb","key":"backbone-simpledb","value":{"rev":"5-a815128e1e3593696f666f8b3da36d78"}}, -{"id":"backbone-stash","key":"backbone-stash","value":{"rev":"19-8d3cc5f9ed28f9a56856154e2b4e7f78"}}, -{"id":"backplane","key":"backplane","value":{"rev":"7-f69188dac21e007b09efe1b5b3575087"}}, -{"id":"backport-0.4","key":"backport-0.4","value":{"rev":"11-25e15f01f1ef9e626433a82284bc00d6"}}, -{"id":"backuptweets","key":"backuptweets","value":{"rev":"3-68712682aada41082d3ae36c03c8f899"}}, -{"id":"bake","key":"bake","value":{"rev":"113-ce13508ba2b4f15aa4df06d796aa4573"}}, -{"id":"bal-util","key":"bal-util","value":{"rev":"31-b818725a5af131c89ec66b9fdebf2122"}}, -{"id":"balancer","key":"balancer","value":{"rev":"7-63dcb4327081a8ec4d6c51a21253cb4b"}}, -{"id":"bancroft","key":"bancroft","value":{"rev":"11-8fa3370a4615a0ed4ba411b05c0285f4"}}, -{"id":"bandcamp","key":"bandcamp","value":{"rev":"41-f2fee472d63257fdba9e5fa8ad570ee8"}}, -{"id":"banner","key":"banner","value":{"rev":"19-89a447e2136b2fabddbad84abcd63a27"}}, -{"id":"banzai-docstore-couchdb","key":"banzai-docstore-couchdb","value":{"rev":"5-950c115737d634e2f48ee1c772788321"}}, -{"id":"banzai-redis","key":"banzai-redis","value":{"rev":"3-446f29e0819fd79c810fdfa8ce05bdcf"}}, -{"id":"banzai-statestore-couchdb","key":"banzai-statestore-couchdb","value":{"rev":"5-c965442821741ce6f20e266fe43aea4a"}}, -{"id":"banzai-statestore-mem","key":"banzai-statestore-mem","value":{"rev":"3-a0891a1a2344922d91781c332ed26528"}}, -{"id":"bar","key":"bar","value":{"rev":"7-fbb44a76cb023e6a8941f15576cf190b"}}, -{"id":"barc","key":"barc","value":{"rev":"7-dfe352b410782543d6b1aea292f123eb"}}, -{"id":"barista","key":"barista","value":{"rev":"9-d3f3c776453ba69a81947f34d7cc3cbf"}}, -{"id":"bark","key":"bark","value":{"rev":"20-fc1a94f80cfa199c16aa075e940e06dc"}}, -{"id":"barricane-db","key":"barricane-db","value":{"rev":"3-450947b9a05047fe195f76a69a3144e8"}}, -{"id":"base-converter","key":"base-converter","value":{"rev":"7-1b49b01df111176b89343ad56ac68d5c"}}, -{"id":"base32","key":"base32","value":{"rev":"11-d686c54c9de557681356e74b83d916e8"}}, -{"id":"base64","key":"base64","value":{"rev":"24-bd713c3d7e96fad180263ed7563c595e"}}, -{"id":"bash","key":"bash","value":{"rev":"3-86a1c61babfa47da0ebc14c2f4e59a6a"}}, -{"id":"basic-auth","key":"basic-auth","value":{"rev":"3-472a87af27264ae81bd4394d70792e55"}}, -{"id":"basicFFmpeg","key":"basicFFmpeg","value":{"rev":"15-3e87a41c543bde1e6f7c49d021fda62f"}}, -{"id":"basicauth","key":"basicauth","value":{"rev":"3-15d95a05b6f5e7b6d7261f87c4eb73de"}}, -{"id":"basil-cookie","key":"basil-cookie","value":{"rev":"11-fff96b263f31b9d017e3cf59bf6fb23f"}}, -{"id":"batik","key":"batik","value":{"rev":"7-a19ce28cbbf54649fa225ed5474eff02"}}, -{"id":"batman","key":"batman","value":{"rev":"15-6af5469bf143790cbb4af196824c9e95"}}, -{"id":"batteries","key":"batteries","value":{"rev":"13-656c68fe887f4af3ef1e720e64275f4e"}}, -{"id":"bbcode","key":"bbcode","value":{"rev":"5-e79a8b62125f8a3a1751bf7bd8875f33"}}, -{"id":"bcrypt","key":"bcrypt","value":{"rev":"31-db8496d1239362a97a26f1e5eeb8a733"}}, -{"id":"beaconpush","key":"beaconpush","value":{"rev":"3-956fcd87a6d3f9d5b9775d47e36aa3e5"}}, -{"id":"bean","key":"bean","value":{"rev":"56-151c1558e15016205e65bd515eab9ee0"}}, -{"id":"bean.database.mongo","key":"bean.database.mongo","value":{"rev":"3-ede73166710137cbf570385b7e8f17fe"}}, -{"id":"beandocs","key":"beandocs","value":{"rev":"3-9f7492984c95b69ca1ad30d40223f117"}}, -{"id":"beanpole","key":"beanpole","value":{"rev":"53-565a78a2304405cdc9f4a6b6101160fa"}}, -{"id":"beanprep","key":"beanprep","value":{"rev":"3-bd387f0072514b8e44131671f9aad1b0"}}, -{"id":"beans","key":"beans","value":{"rev":"54-7f6d40a2a5bf228fe3547cce43edaa63"}}, -{"id":"beanstalk_client","key":"beanstalk_client","value":{"rev":"6-13c8c80aa6469b5dcf20d65909289383"}}, -{"id":"beanstalk_worker","key":"beanstalk_worker","value":{"rev":"6-45500991db97ed5a18ea96f3621bf99f"}}, -{"id":"beantest","key":"beantest","value":{"rev":"7-52d8160a0c0420c7d659b2ee10f26644"}}, -{"id":"beatit","key":"beatit","value":{"rev":"7-c0ba5f95b0601dcb628e4820555cc252"}}, -{"id":"beatport","key":"beatport","value":{"rev":"5-3b186b633ceea7f047e1df91e7b683a5"}}, -{"id":"beautifyjs","key":"beautifyjs","value":{"rev":"3-89ce050152aca0727c099060229ddc73"}}, -{"id":"beaver","key":"beaver","value":{"rev":"17-3b56116e8e40205e8efcedefee0319e3"}}, -{"id":"beeline","key":"beeline","value":{"rev":"11-92a4bd9524cc7aec3106efcacff6faed"}}, -{"id":"beet","key":"beet","value":{"rev":"95-3c9d9de63c363319b2201ac83bc0ee7d"}}, -{"id":"begin","key":"begin","value":{"rev":"3-b32a5eb1b9475353b37f90813ed89dce"}}, -{"id":"begin.js","key":"begin.js","value":{"rev":"7-9156869392a448595bf3e5723fcb7b57"}}, -{"id":"bejesus-api","key":"bejesus-api","value":{"rev":"11-6b42f8ffc370c494d01481b64536e91e"}}, -{"id":"bejesus-cli","key":"bejesus-cli","value":{"rev":"31-5fbbfe5ec1f6a0a7a3fafdf69230434a"}}, -{"id":"bem","key":"bem","value":{"rev":"22-c0e0f8d9e92b355246fd15058199b73c"}}, -{"id":"ben","key":"ben","value":{"rev":"3-debe52552a86f1e71895dd5d32add585"}}, -{"id":"bench","key":"bench","value":{"rev":"14-20987e1becf3acd1bd1833b04712c87c"}}, -{"id":"bencher","key":"bencher","value":{"rev":"3-08866a8fdcf180582b43690bbbf21087"}}, -{"id":"benchmark","key":"benchmark","value":{"rev":"219-0669bc24f3f2918d93369bb0d801abf3"}}, -{"id":"bencode","key":"bencode","value":{"rev":"8-7b9eff4c1658fb3a054ebc6f50e6edcd"}}, -{"id":"beseda","key":"beseda","value":{"rev":"49-5cc8c4e9bb3e836de7db58c3adf9a5bb"}}, -{"id":"bf","key":"bf","value":{"rev":"14-d81312e1bf4f7202b801b4343199aa55"}}, -{"id":"biggie-router","key":"biggie-router","value":{"rev":"42-56a546a78d5abd4402183b3d300d563e"}}, -{"id":"bigint","key":"bigint","value":{"rev":"58-02f368567849596219d6a0e87d9bc6b9"}}, -{"id":"bignumber","key":"bignumber","value":{"rev":"3-6e372428992a767e0a991ec3f39b8343"}}, -{"id":"binary","key":"binary","value":{"rev":"47-947aa2f5238a68e34b164ef7e50ece28"}}, -{"id":"binarySearch","key":"binarySearch","value":{"rev":"15-93a3d2f9c2690457023b5ae5f3d00446"}}, -{"id":"bind","key":"bind","value":{"rev":"9-b74d0af83e90a2655e564ab64bf1d27d"}}, -{"id":"binpack","key":"binpack","value":{"rev":"7-3dc67a64e0ef01f3aa59441c5150e04f"}}, -{"id":"bintrees","key":"bintrees","value":{"rev":"12-507fcd92f447f81842cba08cacb425cf"}}, -{"id":"bisection","key":"bisection","value":{"rev":"5-f785ea3bbd8fcc7cd9381d20417b87bb"}}, -{"id":"bison","key":"bison","value":{"rev":"12-e663b2ef96650b3b5a0cc36524e1b94a"}}, -{"id":"bitcoder","key":"bitcoder","value":{"rev":"8-19c957d6b845f4d7ad531951c971e03d"}}, -{"id":"bitcoin","key":"bitcoin","value":{"rev":"13-af88a28c02ab146622743c4c1c32e87b"}}, -{"id":"bitcoin-impl","key":"bitcoin-impl","value":{"rev":"8-99068f1d259e3c75209a6bd08e3e06a2"}}, -{"id":"bitcoin-p2p","key":"bitcoin-p2p","value":{"rev":"25-6df0283eb6e419bc3a1571f17721b100"}}, -{"id":"bitcoinjs-mongoose","key":"bitcoinjs-mongoose","value":{"rev":"3-57e239b31e218693f8cf3cf1cf098437"}}, -{"id":"bitly","key":"bitly","value":{"rev":"8-d6bfac8338e223fe62538954d2e9246a"}}, -{"id":"bitly.node","key":"bitly.node","value":{"rev":"3-15329b7a77633e0dae2c720e592420fb"}}, -{"id":"biwascheme","key":"biwascheme","value":{"rev":"3-37a85eed1bd2d4ee85ef1e100e7ebe8f"}}, -{"id":"black","key":"black","value":{"rev":"3-e07ae2273357da5894f4b7cdf1b20560"}}, -{"id":"black_coffee","key":"black_coffee","value":{"rev":"3-c5c764cf550ad3c831a085509f64cdfb"}}, -{"id":"bleach","key":"bleach","value":{"rev":"5-ef3ab7e761a6903eb70da1550a07e53d"}}, -{"id":"blend","key":"blend","value":{"rev":"16-c5dd075b3ede45f91056b4b768b2bfe8"}}, -{"id":"bless","key":"bless","value":{"rev":"29-1b9bc6f17acd144f51a297e4bdccfe0e"}}, -{"id":"blitz","key":"blitz","value":{"rev":"5-8bf6786f6fd7dbc0570ba21f803f35e6"}}, -{"id":"blo","key":"blo","value":{"rev":"5-9e752ea37438ea026e88a7aa7e7a91ba"}}, -{"id":"blog","key":"blog","value":{"rev":"13-80fc7b11d73e23ca7e518d271d1836ee"}}, -{"id":"blogmate","key":"blogmate","value":{"rev":"11-e503081be9290647c841aa8c04eb6e70"}}, -{"id":"bloodmoney","key":"bloodmoney","value":{"rev":"3-859b0235de3a29bf241323a31f9aa730"}}, -{"id":"bloom","key":"bloom","value":{"rev":"15-c609882b29d61a771d7dbf17f43016ad"}}, -{"id":"blue","key":"blue","value":{"rev":"6-e84221f7286dffbfda6f8abc6306064c"}}, -{"id":"bluemold","key":"bluemold","value":{"rev":"11-f48528b642b5d38d7c02b03622117fa7"}}, -{"id":"bn-lang","key":"bn-lang","value":{"rev":"3-266f186334f69448a940081589e82b04"}}, -{"id":"bn-lang-util","key":"bn-lang-util","value":{"rev":"3-0bc44f1d7d3746120dd835bfb685e229"}}, -{"id":"bn-log","key":"bn-log","value":{"rev":"5-db81a8a978071efd24b45e350e8b8954"}}, -{"id":"bn-template","key":"bn-template","value":{"rev":"3-604e77465ab1dc7e17f3b325089651ec"}}, -{"id":"bn-time","key":"bn-time","value":{"rev":"3-9c33587e783a98e1ccea409cacd5bbfb"}}, -{"id":"bn-unit","key":"bn-unit","value":{"rev":"3-5f35e3fd446241f682231bedcf846c0a"}}, -{"id":"bncode","key":"bncode","value":{"rev":"7-915a1759135a9837954c0ead58bf8e5a"}}, -{"id":"bnf","key":"bnf","value":{"rev":"5-4fe80fcafcc7a263f28b8dc62093bd8d"}}, -{"id":"bob","key":"bob","value":{"rev":"9-9ceeb581263c04793a2231b3726ab22b"}}, -{"id":"bogart","key":"bogart","value":{"rev":"30-70aed6f0827d2bd09963afddcad7a34a"}}, -{"id":"boil","key":"boil","value":{"rev":"3-7ab0fc3b831c591fd15711c27a6f5de0"}}, -{"id":"bolt","key":"bolt","value":{"rev":"3-138dfbdea2ab53ca714ca51494d32610"}}, -{"id":"bones","key":"bones","value":{"rev":"70-c74f0845c167cd755250fc7b4b9b40c2"}}, -{"id":"bones-admin","key":"bones-admin","value":{"rev":"11-2cdfe738d66aacff8569712a279c041d"}}, -{"id":"bones-auth","key":"bones-auth","value":{"rev":"35-2224f95bf3521809ce805ff215d2856c"}}, -{"id":"bones-document","key":"bones-document","value":{"rev":"13-95971fed1f47005c282e0fa60498e31c"}}, -{"id":"bonsai","key":"bonsai","value":{"rev":"3-67eb8935492d4ae9182a7ec74c1f36a6"}}, -{"id":"bonzo","key":"bonzo","value":{"rev":"142-7c5680b0f841c2263f06e96eb5237825"}}, -{"id":"bookbu","key":"bookbu","value":{"rev":"3-d9a104bccc67eae8a5dc6f0f4c3ba5fc"}}, -{"id":"bootstrap","key":"bootstrap","value":{"rev":"17-7a62dbe5e3323beb47165f13265f1a96"}}, -{"id":"borschik","key":"borschik","value":{"rev":"7-2570b5d6555a031394a55ff054797cb9"}}, -{"id":"bots","key":"bots","value":{"rev":"9-df43539c13d2996d9e32dff848615e8a"}}, -{"id":"bounce","key":"bounce","value":{"rev":"8-a3e424b2be1379743e9628c726facaa8"}}, -{"id":"bowser","key":"bowser","value":{"rev":"11-23ecc98edf5fde63fda626bb03da597f"}}, -{"id":"box2d","key":"box2d","value":{"rev":"6-5c920e9829764cbf904b9a59474c1672"}}, -{"id":"box2dnode","key":"box2dnode","value":{"rev":"3-12ffe24dcc1478ea0008c60c4ef7118f"}}, -{"id":"boxcar","key":"boxcar","value":{"rev":"5-a9ba953c547585285559d0e05c16e29e"}}, -{"id":"boxer","key":"boxer","value":{"rev":"8-60c49ff8574d5a47616796ad991463ad"}}, -{"id":"bracket-matcher","key":"bracket-matcher","value":{"rev":"27-a01c946c69665629e212a0f702be1b38"}}, -{"id":"brain","key":"brain","value":{"rev":"24-3aba33914e0f823505c69ef01361681b"}}, -{"id":"brainfuck","key":"brainfuck","value":{"rev":"7-adf33477ffe8640c9fdd6a0f8b349953"}}, -{"id":"brains","key":"brains","value":{"rev":"3-d7e7a95ea742f9b42fefb594c67c726a"}}, -{"id":"braintree","key":"braintree","value":{"rev":"14-eabe1c3e4e7cfd1f521f4bfd337611f7"}}, -{"id":"brazilnut","key":"brazilnut","value":{"rev":"3-4163b5a5598a8905c1283db9d260e5cc"}}, -{"id":"brazln","key":"brazln","value":{"rev":"29-15895bb5b193552826c196efe084caf2"}}, -{"id":"bread","key":"bread","value":{"rev":"9-093c9dd71fffb9a5b1c9eb8ac3e2a9b0"}}, -{"id":"breakfast","key":"breakfast","value":{"rev":"3-231e3046ede5e35e272dfab4a379015d"}}, -{"id":"brequire","key":"brequire","value":{"rev":"18-58b386e08541b222238aa12a13119fd9"}}, -{"id":"bricks","key":"bricks","value":{"rev":"15-f72e6c858c5bceb00cc34a16d52a7b59"}}, -{"id":"bricks-analytics","key":"bricks-analytics","value":{"rev":"3-dc2b6d2157c5039a4c36ceda46761b37"}}, -{"id":"bricks-compress","key":"bricks-compress","value":{"rev":"5-580eeecaa30c210502f42c5e184344a3"}}, -{"id":"bricks-rewrite","key":"bricks-rewrite","value":{"rev":"5-7a141aacaa3fd706b97847c6e8f9830a"}}, -{"id":"brokenbin","key":"brokenbin","value":{"rev":"5-bbc7a1c9628ed9f49b6d23e80c242852"}}, -{"id":"broker","key":"broker","value":{"rev":"9-756a097b948756e4bd7609b6f83a0847"}}, -{"id":"browscap","key":"browscap","value":{"rev":"12-c6fed16796d1ad84913f2617c66f0c7b"}}, -{"id":"browser-require","key":"browser-require","value":{"rev":"27-99f61fb3036ebc643282625649cc674f"}}, -{"id":"browserify","key":"browserify","value":{"rev":"163-c307ee153caf2160e5c32abd58898139"}}, -{"id":"browserjet","key":"browserjet","value":{"rev":"3-a386ab8911c410362eb8fceab5a998fe"}}, -{"id":"brt","key":"brt","value":{"rev":"3-b8452659a92039571ff1f877c8f874c7"}}, -{"id":"brunch","key":"brunch","value":{"rev":"113-64ae44857425c5d860d36f38ab3cf797"}}, -{"id":"brushes.js","key":"brushes.js","value":{"rev":"3-e28bd6597b949d84965a788928738f53"}}, -{"id":"bson","key":"bson","value":{"rev":"50-9d9db515dd9d2a4d873d186f324767a5"}}, -{"id":"btc-ex-api","key":"btc-ex-api","value":{"rev":"3-cabbf284cb01af79ee183d8023106762"}}, -{"id":"btoa","key":"btoa","value":{"rev":"3-b4a124b3650a746b8da9c9f93f386bac"}}, -{"id":"btoa-atob","key":"btoa-atob","value":{"rev":"3-baac60a3f04487333cc0364301220a53"}}, -{"id":"bucket","key":"bucket","value":{"rev":"3-5c2da8f67e29de1c29adbf51ad7d7299"}}, -{"id":"buffalo","key":"buffalo","value":{"rev":"9-6c763d939d775a255c65ba8dcf0d5372"}}, -{"id":"bufferjs","key":"bufferjs","value":{"rev":"13-b6e09e35ec822714d3ec485ac2010272"}}, -{"id":"bufferlib","key":"bufferlib","value":{"rev":"16-d48d96815fc7709d6b7d0a8bfc67f053"}}, -{"id":"bufferlist","key":"bufferlist","value":{"rev":"18-6fcedc10ffbca1afdc866e208d2f906a"}}, -{"id":"buffers","key":"buffers","value":{"rev":"11-3a70ec2da112befdc65b8c02772b8c44"}}, -{"id":"bufferstream","key":"bufferstream","value":{"rev":"82-6f82c5affb3906ebbaa0b116baf73c54"}}, -{"id":"buffertools","key":"buffertools","value":{"rev":"20-68f90e224f81fab81295f9079dc3c0fc"}}, -{"id":"buffoon","key":"buffoon","value":{"rev":"9-1cdc1cbced94691e836d4266eed7c143"}}, -{"id":"builder","key":"builder","value":{"rev":"25-b9679e2aaffec1ac6d59fdd259d9590c"}}, -{"id":"buildr","key":"buildr","value":{"rev":"69-cb3a756903a6322c6f9f4dd1c384a607"}}, -{"id":"bumper","key":"bumper","value":{"rev":"3-1e8d17aa3b29815e4069294cc9ce572c"}}, -{"id":"bundle","key":"bundle","value":{"rev":"39-46fde9cd841bce1fbdd92f6a1235c308"}}, -{"id":"bunker","key":"bunker","value":{"rev":"7-ed993a296fa0b8d3c3a7cd759d6f371e"}}, -{"id":"burari","key":"burari","value":{"rev":"11-08b61073d6ad0ef0c7449a574dc8f54b"}}, -{"id":"burrito","key":"burrito","value":{"rev":"38-3f3b109972720647f5412f3a2478859b"}}, -{"id":"busbuddy","key":"busbuddy","value":{"rev":"5-298ec29f6307351cf7a19bceebe957c7"}}, -{"id":"buster","key":"buster","value":{"rev":"9-870a6e9638806adde2f40105900cd4b3"}}, -{"id":"buster-args","key":"buster-args","value":{"rev":"7-9b189c602e437a505625dbf7fef5dead"}}, -{"id":"buster-assertions","key":"buster-assertions","value":{"rev":"5-fa34a8a5e7cf4dd08c2d02c39de3b563"}}, -{"id":"buster-cli","key":"buster-cli","value":{"rev":"5-b1a85006e41dbf74313253c571e63874"}}, -{"id":"buster-client","key":"buster-client","value":{"rev":"5-340637ec63b54bb01c1313a78db01945"}}, -{"id":"buster-configuration","key":"buster-configuration","value":{"rev":"3-a12e7ff172562b513534fc26be00aaed"}}, -{"id":"buster-core","key":"buster-core","value":{"rev":"5-871df160645e6684111a8fd02ff0eee9"}}, -{"id":"buster-evented-logger","key":"buster-evented-logger","value":{"rev":"5-c46681e6275a76723e3bc834555dbe32"}}, -{"id":"buster-format","key":"buster-format","value":{"rev":"5-e193e90436c7f941739b82adad86bdd8"}}, -{"id":"buster-module-loader","key":"buster-module-loader","value":{"rev":"5-4148b61f8b718e6181aa6054664a7c44"}}, -{"id":"buster-multicast","key":"buster-multicast","value":{"rev":"3-79480b5be761d243b274cb1e77375afc"}}, -{"id":"buster-promise","key":"buster-promise","value":{"rev":"5-b50030957fbd70e65576faa9c541b739"}}, -{"id":"buster-script-loader","key":"buster-script-loader","value":{"rev":"3-85af28b5bc4e647f27514fede19a144e"}}, -{"id":"buster-server","key":"buster-server","value":{"rev":"7-57b8b43047504818322018d2bbfee1f1"}}, -{"id":"buster-static","key":"buster-static","value":{"rev":"3-018c89d1524f7823934087f18dab9047"}}, -{"id":"buster-terminal","key":"buster-terminal","value":{"rev":"5-2c54c30ffa4a2d4b061e4c38e6b9b0e7"}}, -{"id":"buster-test","key":"buster-test","value":{"rev":"5-f7ee9c9f3b379e0ad5aa03d07581ad6f"}}, -{"id":"buster-test-cli","key":"buster-test-cli","value":{"rev":"9-c207974d20e95029cad5fa4c9435d152"}}, -{"id":"buster-user-agent-parser","key":"buster-user-agent-parser","value":{"rev":"5-7883085a203b3047b28ad08361219d1d"}}, -{"id":"buster-util","key":"buster-util","value":{"rev":"3-81977275a9c467ad79bb7e3f2b1caaa8"}}, -{"id":"butler","key":"butler","value":{"rev":"7-c964c4d213da6b0de2492ee57514d0f8"}}, -{"id":"byline","key":"byline","value":{"rev":"9-0b236ed5986c20136c0d581a244d52ac"}}, -{"id":"bz","key":"bz","value":{"rev":"7-d2a463b259c4e09dc9a79ddee9575ca0"}}, -{"id":"c2dm","key":"c2dm","value":{"rev":"11-a1e6a6643506bed3e1443155706aa5fe"}}, -{"id":"cabin","key":"cabin","value":{"rev":"7-df81ef56f0bb085d381c36600496dc57"}}, -{"id":"caboose","key":"caboose","value":{"rev":"49-7226441f91b63fb5c3ac240bd99d142a"}}, -{"id":"caboose-authentication","key":"caboose-authentication","value":{"rev":"3-9c71a9d7315fdea7d5f52fe52ecef118"}}, -{"id":"caboose-model","key":"caboose-model","value":{"rev":"3-967426d5acb8bb70e133f0052075dc1b"}}, -{"id":"cache2file","key":"cache2file","value":{"rev":"17-ac9caec611a38e1752d91f8cc80cfb04"}}, -{"id":"caching","key":"caching","value":{"rev":"11-06041aaaa46b63ed36843685cac63245"}}, -{"id":"calais","key":"calais","value":{"rev":"11-f8ac2064ca45dd5b7db7ea099cd61dfb"}}, -{"id":"calc","key":"calc","value":{"rev":"3-bead9c5b0bee34e44e7c04aa2bf9cd68"}}, -{"id":"calipso","key":"calipso","value":{"rev":"87-b562676045a66a3ec702591c67a9635e"}}, -{"id":"caman","key":"caman","value":{"rev":"15-4b97c73f0ac101c68335de2937483893"}}, -{"id":"camanjs","key":"camanjs","value":{"rev":"3-2856bbdf7a1d454929b4a80b119e3da0"}}, -{"id":"camelot","key":"camelot","value":{"rev":"7-8e257c5213861ecbd229ee737a3a8bb4"}}, -{"id":"campusbooks","key":"campusbooks","value":{"rev":"18-489be33c6ac2d6cbcf93355f2b129389"}}, -{"id":"canvas","key":"canvas","value":{"rev":"78-27dbf5b6e0a25ba5886d485fd897d701"}}, -{"id":"canvasutil","key":"canvasutil","value":{"rev":"7-0b87a370d673886efb7763aaf500b744"}}, -{"id":"capoo","key":"capoo","value":{"rev":"9-136a3ddf489228d5f4b504b1da619447"}}, -{"id":"capsule","key":"capsule","value":{"rev":"19-ad3c9ba0af71a84228e6dd360017f379"}}, -{"id":"capt","key":"capt","value":{"rev":"13-0805d789000fb2e361103a5e62379196"}}, -{"id":"carena","key":"carena","value":{"rev":"10-d38e8c336a0dbb8091514f638b22b96b"}}, -{"id":"carrier","key":"carrier","value":{"rev":"20-b2b4a0560d40eeac617000e9e22a9e9d"}}, -{"id":"cart","key":"cart","value":{"rev":"12-493e79c6fa0b099626e90da79a69f1e5"}}, -{"id":"carto","key":"carto","value":{"rev":"45-8eab07e2fac57396dd62af5805062387"}}, -{"id":"caruso","key":"caruso","value":{"rev":"5-d58e22212b0bcebbab4b42adc68799aa"}}, -{"id":"cas","key":"cas","value":{"rev":"3-82a93160eb9add99bde1599e55d18fd8"}}, -{"id":"cas-auth","key":"cas-auth","value":{"rev":"3-b02f77c198050b99f1df18f637e77c10"}}, -{"id":"cas-client","key":"cas-client","value":{"rev":"3-ca69e32a3053bc680d1dddc57271483b"}}, -{"id":"cashew","key":"cashew","value":{"rev":"7-9e81cde34263adad6949875c4b33ee99"}}, -{"id":"cassandra","key":"cassandra","value":{"rev":"3-8617ef73fdc73d02ecec74d31f98e463"}}, -{"id":"cassandra-client","key":"cassandra-client","value":{"rev":"19-aa1aef5d203be5b0eac678284f1a979f"}}, -{"id":"casset","key":"casset","value":{"rev":"3-2052c7feb5b89c77aaa279c8b50126ce"}}, -{"id":"castaneum","key":"castaneum","value":{"rev":"26-4dc55ba2482cca4230b4bc77ecb5b70d"}}, -{"id":"cat","key":"cat","value":{"rev":"3-75f20119b363b85c1a8433e26b86c943"}}, -{"id":"catchjs","key":"catchjs","value":{"rev":"3-ffda7eff7613de37f629dc7a831ffda1"}}, -{"id":"caterpillar","key":"caterpillar","value":{"rev":"5-bc003e3af33240e67b4c3042f308b7da"}}, -{"id":"causeeffect","key":"causeeffect","value":{"rev":"9-7e4e25bff656170c97cb0cce1b2ab6ca"}}, -{"id":"cayenne","key":"cayenne","value":{"rev":"5-2797f561467b41cc45804e5498917800"}}, -{"id":"ccn4bnode","key":"ccn4bnode","value":{"rev":"17-96f55189e5c98f0fa8200e403a04eb39"}}, -{"id":"ccnq3_config","key":"ccnq3_config","value":{"rev":"21-40345771769a9cadff4af9113b8124c2"}}, -{"id":"ccnq3_logger","key":"ccnq3_logger","value":{"rev":"5-4aa168dc24425938a29cf9ac456158d7"}}, -{"id":"ccnq3_portal","key":"ccnq3_portal","value":{"rev":"17-84e629ec1eaba1722327ccb9dddb05cf"}}, -{"id":"ccnq3_roles","key":"ccnq3_roles","value":{"rev":"43-97de74b08b1af103da8905533a84b749"}}, -{"id":"ccss","key":"ccss","value":{"rev":"11-b9beb506410ea81581ba4c7dfe9b2a7d"}}, -{"id":"cdb","key":"cdb","value":{"rev":"13-d7b6f609f069dc738912b405aac558ab"}}, -{"id":"cdb_changes","key":"cdb_changes","value":{"rev":"13-1dc99b096cb91c276332b651396789e8"}}, -{"id":"celeri","key":"celeri","value":{"rev":"17-b19294619ef6c2056f3bf6641e8945c2"}}, -{"id":"celery","key":"celery","value":{"rev":"5-bdfccd483cf30c4c10c5ec0963de1248"}}, -{"id":"cempl8","key":"cempl8","value":{"rev":"21-bb9547b78a1548fe11dc1d5b816b6da1"}}, -{"id":"cfg","key":"cfg","value":{"rev":"3-85c7651bb8f16b057e60a46946eb95af"}}, -{"id":"cgi","key":"cgi","value":{"rev":"17-7ceac458c7f141d4fbbf05d267a72aa8"}}, -{"id":"chain","key":"chain","value":{"rev":"9-b0f175c5ad0173bcb7e11e58b02a7394"}}, -{"id":"chain-gang","key":"chain-gang","value":{"rev":"22-b0e6841a344b65530ea2a83a038e5aa6"}}, -{"id":"chainer","key":"chainer","value":{"rev":"15-8c6a565035225a1dcca0177e92ccf42d"}}, -{"id":"chainify","key":"chainify","value":{"rev":"3-0926790f18a0016a9943cfb4830e0187"}}, -{"id":"chains","key":"chains","value":{"rev":"5-d9e1ac38056e2638e38d9a7c415929c6"}}, -{"id":"chainsaw","key":"chainsaw","value":{"rev":"24-82e078efbbc59f798d29a0259481012e"}}, -{"id":"changelog","key":"changelog","value":{"rev":"27-317e473de0bf596b273a9dadecea126d"}}, -{"id":"channel-server","key":"channel-server","value":{"rev":"3-3c882f7e61686e8a124b5198c638a18e"}}, -{"id":"channels","key":"channels","value":{"rev":"5-0b532f054886d9094cb98493ee0a7a16"}}, -{"id":"chaos","key":"chaos","value":{"rev":"40-7caa4459d398f5ec30fea91d087f0d71"}}, -{"id":"chard","key":"chard","value":{"rev":"3-f2de35f7a390ea86ac0eb78bf720d0de"}}, -{"id":"charenc","key":"charenc","value":{"rev":"3-092036302311a8f5779b800c98170b5b"}}, -{"id":"chargify","key":"chargify","value":{"rev":"5-e3f29f2816b04c26ca047d345928e2c1"}}, -{"id":"charm","key":"charm","value":{"rev":"13-3e7e7b5babc1efc472e3ce62eec2c0c7"}}, -{"id":"chat-server","key":"chat-server","value":{"rev":"7-c73b785372474e083fb8f3e9690761da"}}, -{"id":"chatroom","key":"chatroom","value":{"rev":"3-f4fa8330b7eb277d11407f968bffb6a2"}}, -{"id":"chatspire","key":"chatspire","value":{"rev":"3-081e167e3f7c1982ab1b7fc3679cb87c"}}, -{"id":"checkip","key":"checkip","value":{"rev":"3-b31d58a160a4a3fe2f14cfbf2217949e"}}, -{"id":"cheddar-getter","key":"cheddar-getter","value":{"rev":"3-d675ec138ea704df127fabab6a52a8dc"}}, -{"id":"chess","key":"chess","value":{"rev":"3-8b15268c8b0fb500dcbc83b259e7fb88"}}, -{"id":"chessathome-worker","key":"chessathome-worker","value":{"rev":"7-cdfd411554c35ba7a52e54f7744bed35"}}, -{"id":"chirkut.js","key":"chirkut.js","value":{"rev":"3-c0e515eee0f719c5261a43e692a3585c"}}, -{"id":"chiron","key":"chiron","value":{"rev":"6-ccb575e432c1c1981fc34b4e27329c85"}}, -{"id":"chopper","key":"chopper","value":{"rev":"5-168681c58c2a50796676dea73dc5398b"}}, -{"id":"choreographer","key":"choreographer","value":{"rev":"14-b0159823becdf0b4552967293968b2a8"}}, -{"id":"chromic","key":"chromic","value":{"rev":"3-c4ca0bb1f951db96c727241092afa9cd"}}, -{"id":"chrono","key":"chrono","value":{"rev":"9-6399d715df1a2f4696f89f2ab5d4d83a"}}, -{"id":"chuck","key":"chuck","value":{"rev":"3-71f2ee071d4b6fb2af3b8b828c51d8ab"}}, -{"id":"chunkedstream","key":"chunkedstream","value":{"rev":"3-b145ed7d1abd94ac44343413e4f823e7"}}, -{"id":"cider","key":"cider","value":{"rev":"10-dc20cd3eac9470e96911dcf75ac6492b"}}, -{"id":"cinch","key":"cinch","value":{"rev":"5-086af7f72caefb57284e4101cbe3c905"}}, -{"id":"cipherpipe","key":"cipherpipe","value":{"rev":"5-0b5590f808415a7297de6d45947d911f"}}, -{"id":"cjson","key":"cjson","value":{"rev":"25-02e3d327b48e77dc0f9e070ce9454ac2"}}, -{"id":"ck","key":"ck","value":{"rev":"3-f482385f5392a49353d8ba5eb9c7afef"}}, -{"id":"ckup","key":"ckup","value":{"rev":"26-90a76ec0cdf951dc2ea6058098407ee2"}}, -{"id":"class","key":"class","value":{"rev":"6-e2805f7d87586a66fb5fd170cf74b3b0"}}, -{"id":"class-42","key":"class-42","value":{"rev":"3-14c988567a2c78a857f15c9661bd6430"}}, -{"id":"class-js","key":"class-js","value":{"rev":"5-792fd04288a651dad87bc47eb91c2042"}}, -{"id":"classify","key":"classify","value":{"rev":"23-35eb336c350446f5ed49069df151dbb7"}}, -{"id":"clean-css","key":"clean-css","value":{"rev":"13-e30ea1007f6c5bb49e07276228b8a960"}}, -{"id":"clearInterval","key":"clearInterval","value":{"rev":"3-a49fa235d3dc14d28a3d15f8db291986"}}, -{"id":"clearTimeout","key":"clearTimeout","value":{"rev":"3-e838bd25adc825112922913c1a35b934"}}, -{"id":"cli","key":"cli","value":{"rev":"65-9e79c37c12d21b9b9114093de0773c54"}}, -{"id":"cli-color","key":"cli-color","value":{"rev":"9-0a8e775e713b1351f6a6648748dd16ec"}}, -{"id":"cli-table","key":"cli-table","value":{"rev":"3-9e447a8bb392fb7d9c534445a650e328"}}, -{"id":"clickatell","key":"clickatell","value":{"rev":"3-31f1a66d08a789976919df0c9280de88"}}, -{"id":"clicktime","key":"clicktime","value":{"rev":"9-697a99f5f704bfebbb454df47c9c472a"}}, -{"id":"clientexpress","key":"clientexpress","value":{"rev":"3-9b07041cd7b0c3967c4625ac74c9b50c"}}, -{"id":"cliff","key":"cliff","value":{"rev":"15-ef9ef25dbad08c0e346388522d94c5c3"}}, -{"id":"clip","key":"clip","value":{"rev":"21-c3936e566feebfe0beddb0bbb686c00d"}}, -{"id":"clock","key":"clock","value":{"rev":"5-19bc51841d41408b4446c0862487dc5e"}}, -{"id":"clog","key":"clog","value":{"rev":"5-1610fe2c0f435d2694a1707ee15cd11e"}}, -{"id":"clone","key":"clone","value":{"rev":"11-099d07f38381b54902c4cf5b93671ed4"}}, -{"id":"closure","key":"closure","value":{"rev":"7-9c2ac6b6ec9f14d12d10bfbfad58ec14"}}, -{"id":"closure-compiler","key":"closure-compiler","value":{"rev":"8-b3d2f9e3287dd33094a35d797d6beaf2"}}, -{"id":"cloud","key":"cloud","value":{"rev":"27-407c7aa77d3d4a6cc903d18b383de8b8"}}, -{"id":"cloud9","key":"cloud9","value":{"rev":"71-4af631e3fa2eb28058cb0d18ef3a6a3e"}}, -{"id":"cloudcontrol","key":"cloudcontrol","value":{"rev":"15-2df57385aa9bd92f7ed81e6892e23696"}}, -{"id":"cloudfiles","key":"cloudfiles","value":{"rev":"30-01f84ebda1d8f151b3e467590329960c"}}, -{"id":"cloudfoundry","key":"cloudfoundry","value":{"rev":"3-66fafd3d6b1353b1699d35e634686ab6"}}, -{"id":"cloudmailin","key":"cloudmailin","value":{"rev":"3-a4e3e4d457f5a18261bb8df145cfb418"}}, -{"id":"cloudnode-cli","key":"cloudnode-cli","value":{"rev":"17-3a80f7855ce618f7aee68bd693ed485b"}}, -{"id":"cloudservers","key":"cloudservers","value":{"rev":"42-6bc34f7e34f84a24078b43a609e96c59"}}, -{"id":"clucene","key":"clucene","value":{"rev":"37-3d613f12a857b8fe22fbf420bcca0dc3"}}, -{"id":"cluster","key":"cluster","value":{"rev":"83-63fb7a468d95502f94ea45208ba0a890"}}, -{"id":"cluster-isolatable","key":"cluster-isolatable","value":{"rev":"5-6af883cea9ab1c90bb126d8b3be2d156"}}, -{"id":"cluster-live","key":"cluster-live","value":{"rev":"7-549d19e9727f460c7de48f93b92e9bb3"}}, -{"id":"cluster-log","key":"cluster-log","value":{"rev":"7-9c47854df8ec911e679743185668a5f7"}}, -{"id":"cluster-loggly","key":"cluster-loggly","value":{"rev":"3-e1f7e331282d7b8317ce55e0fce7f934"}}, -{"id":"cluster-mail","key":"cluster-mail","value":{"rev":"9-dc18c5c1b2b265f3d531b92467b6cc35"}}, -{"id":"cluster-responsetimes","key":"cluster-responsetimes","value":{"rev":"3-c9e16daee15eb84910493264e973275c"}}, -{"id":"cluster-socket.io","key":"cluster-socket.io","value":{"rev":"7-29032f0b42575e9fe183a0af92191132"}}, -{"id":"cluster.exception","key":"cluster.exception","value":{"rev":"3-10856526e2f61e3000d62b12abd750e3"}}, -{"id":"clutch","key":"clutch","value":{"rev":"8-50283f7263c430cdd1d293c033571012"}}, -{"id":"cm1-route","key":"cm1-route","value":{"rev":"13-40e72b5a4277b500c98c966bcd2a8a86"}}, -{"id":"cmd","key":"cmd","value":{"rev":"9-9168fcd96fb1ba9449050162023f3570"}}, -{"id":"cmdopt","key":"cmdopt","value":{"rev":"3-85677533e299bf195e78942929cf9839"}}, -{"id":"cmp","key":"cmp","value":{"rev":"5-b10f873b78eb64e406fe55bd001ae0fa"}}, -{"id":"cmudict","key":"cmudict","value":{"rev":"3-cd028380bba917d5ed2be7a8d3b3b0b7"}}, -{"id":"cnlogger","key":"cnlogger","value":{"rev":"9-dbe7e0e50d25ca5ae939fe999c3c562b"}}, -{"id":"coa","key":"coa","value":{"rev":"11-ff4e634fbebd3f80b9461ebe58b3f64e"}}, -{"id":"cobra","key":"cobra","value":{"rev":"5-a3e0963830d350f4a7e91b438caf9117"}}, -{"id":"cockpit","key":"cockpit","value":{"rev":"3-1757b37245ee990999e4456b9a6b963e"}}, -{"id":"coco","key":"coco","value":{"rev":"104-eabc4d7096295c2156144a7581d89b35"}}, -{"id":"cocos2d","key":"cocos2d","value":{"rev":"19-88a5c75ceb6e7667665c056d174f5f1a"}}, -{"id":"codem-transcode","key":"codem-transcode","value":{"rev":"9-1faa2657d53271ccc44cce27de723e99"}}, -{"id":"codepad","key":"codepad","value":{"rev":"5-094ddce74dc057dc0a4d423d6d2fbc3a"}}, -{"id":"codetube","key":"codetube","value":{"rev":"3-819794145f199330e724864db70da53b"}}, -{"id":"coerce","key":"coerce","value":{"rev":"3-e7d392d497c0b8491b89fcbbd1a5a89f"}}, -{"id":"coffee-conf","key":"coffee-conf","value":{"rev":"3-883bc4767d70810ece2fdf1ccae883de"}}, -{"id":"coffee-css","key":"coffee-css","value":{"rev":"11-66ca197173751389b24945f020f198f9"}}, -{"id":"coffee-echonest","key":"coffee-echonest","value":{"rev":"3-3cd0e2b77103e334eccf6cf4168f39b2"}}, -{"id":"coffee-machine","key":"coffee-machine","value":{"rev":"9-02deb4d27fd5d56002ead122e9bb213e"}}, -{"id":"coffee-new","key":"coffee-new","value":{"rev":"67-0664b0f289030c38d113070fd26f4f71"}}, -{"id":"coffee-resque","key":"coffee-resque","value":{"rev":"22-5b022809317d3a873be900f1a697c5eb"}}, -{"id":"coffee-resque-retry","key":"coffee-resque-retry","value":{"rev":"29-1fb64819a4a21ebb4d774d9d4108e419"}}, -{"id":"coffee-revup","key":"coffee-revup","value":{"rev":"3-23aafa258bcdcf2bb68d143d61383551"}}, -{"id":"coffee-script","key":"coffee-script","value":{"rev":"60-a6c3739655f43953bd86283776586b95"}}, -{"id":"coffee-son","key":"coffee-son","value":{"rev":"3-84a81e7e24c8cb23293940fc1b87adfe"}}, -{"id":"coffee-toaster","key":"coffee-toaster","value":{"rev":"17-d43d7276c08b526c229c78b7d5acd6cc"}}, -{"id":"coffee-watcher","key":"coffee-watcher","value":{"rev":"3-3d861a748f0928c789cbdb8ff62b6091"}}, -{"id":"coffee-world","key":"coffee-world","value":{"rev":"15-46dc320f94fa64c39e183224ec59f47a"}}, -{"id":"coffee4clients","key":"coffee4clients","value":{"rev":"15-58fba7dd10bced0411cfe546b9336145"}}, -{"id":"coffeeapp","key":"coffeeapp","value":{"rev":"48-bece0a26b78afc18cd37d577f90369d9"}}, -{"id":"coffeebot","key":"coffeebot","value":{"rev":"3-a9007053f25a4c13b324f0ac7066803e"}}, -{"id":"coffeedoc","key":"coffeedoc","value":{"rev":"21-a955faafafd10375baf3101ad2c142d0"}}, -{"id":"coffeegrinder","key":"coffeegrinder","value":{"rev":"9-6e725aad7fd39cd38f41c743ef8a7563"}}, -{"id":"coffeekup","key":"coffeekup","value":{"rev":"35-9b1eecdb7b13d3e75cdc7b1045cf910a"}}, -{"id":"coffeemaker","key":"coffeemaker","value":{"rev":"9-4c5e665aa2a5b4efa2b7d077d0a4f9c1"}}, -{"id":"coffeemate","key":"coffeemate","value":{"rev":"71-03d0221fb495f2dc6732009884027b47"}}, -{"id":"coffeepack","key":"coffeepack","value":{"rev":"3-bbf0e27cb4865392164e7ab33f131d58"}}, -{"id":"coffeeq","key":"coffeeq","value":{"rev":"9-4e38e9742a0b9d7b308565729fbfd123"}}, -{"id":"coffeescript-growl","key":"coffeescript-growl","value":{"rev":"7-2bc1f93c4aad5fa8fb4bcfd1b3ecc279"}}, -{"id":"coffeescript-notify","key":"coffeescript-notify","value":{"rev":"3-8aeb31f8e892d3fefa421ff28a1b3de9"}}, -{"id":"collectd","key":"collectd","value":{"rev":"5-3d4c84b0363aa9c078157d82695557a1"}}, -{"id":"collection","key":"collection","value":{"rev":"3-a47e1fe91b9eebb3e75954e350ec2ca3"}}, -{"id":"collection_functions","key":"collection_functions","value":{"rev":"3-7366c721008062373ec924a409415189"}}, -{"id":"collections","key":"collections","value":{"rev":"3-0237a40d08a0da36c2dd01ce73a89bb2"}}, -{"id":"color","key":"color","value":{"rev":"15-4898b2cd9744feb3249ba10828c186f8"}}, -{"id":"color-convert","key":"color-convert","value":{"rev":"7-2ccb47c7f07a47286d9a2f39383d28f0"}}, -{"id":"color-string","key":"color-string","value":{"rev":"5-9a6336f420e001e301a15b88b0103696"}}, -{"id":"colorize","key":"colorize","value":{"rev":"3-ff380385edacc0c46e4c7b5c05302576"}}, -{"id":"colors","key":"colors","value":{"rev":"8-7c7fb9c5af038c978f0868c7706fe145"}}, -{"id":"colour-extractor","key":"colour-extractor","value":{"rev":"3-62e96a84c6adf23f438b5aac76c7b257"}}, -{"id":"coloured","key":"coloured","value":{"rev":"8-c5295f2d5a8fc08e93d180a4e64f8d38"}}, -{"id":"coloured-log","key":"coloured-log","value":{"rev":"14-8627a3625959443acad71e2c23dfc582"}}, -{"id":"comb","key":"comb","value":{"rev":"5-7f201b621ae9a890c7f5a31867eba3e9"}}, -{"id":"combine","key":"combine","value":{"rev":"14-bed33cd4389a2e4bb826a0516c6ae307"}}, -{"id":"combined-stream","key":"combined-stream","value":{"rev":"13-678f560200ac2835b9026e9e2b955cb0"}}, -{"id":"combiner","key":"combiner","value":{"rev":"3-5e7f133c8c14958eaf9e92bd79ae8ee1"}}, -{"id":"combohandler","key":"combohandler","value":{"rev":"7-d7e1a402f0066caa6756a8866de81dd9"}}, -{"id":"combyne","key":"combyne","value":{"rev":"23-05ebee9666a769e32600bc5548d10ce9"}}, -{"id":"comfy","key":"comfy","value":{"rev":"5-8bfe55bc16611dfe51a184b8f3eb31c1"}}, -{"id":"command-parser","key":"command-parser","value":{"rev":"5-8a5c3ed6dfa0fa55cc71b32cf52332fc"}}, -{"id":"commander","key":"commander","value":{"rev":"11-9dd16c00844d464bf66c101a57075401"}}, -{"id":"commando","key":"commando","value":{"rev":"3-e159f1890f3771dfd6e04f4d984f26f3"}}, -{"id":"common","key":"common","value":{"rev":"16-94eafcf104c0c7d1090e668ddcc12a5f"}}, -{"id":"common-exception","key":"common-exception","value":{"rev":"7-bd46358014299da814691c835548ef21"}}, -{"id":"common-node","key":"common-node","value":{"rev":"5-b2c4bef0e7022d5d453661a9c43497a8"}}, -{"id":"common-pool","key":"common-pool","value":{"rev":"5-c495fa945361ba4fdfb2ee8733d791b4"}}, -{"id":"common-utils","key":"common-utils","value":{"rev":"3-e5a047f118fc304281d2bc5e9ab18e62"}}, -{"id":"commondir","key":"commondir","value":{"rev":"3-ea49874d12eeb9adf28ca28989dfb5a9"}}, -{"id":"commonjs","key":"commonjs","value":{"rev":"6-39fcd0de1ec265890cf063effd0672e3"}}, -{"id":"commonjs-utils","key":"commonjs-utils","value":{"rev":"6-c0266a91dbd0a43effb7d30da5d9f35c"}}, -{"id":"commonkv","key":"commonkv","value":{"rev":"3-90b2fe4c79e263b044303706c4d5485a"}}, -{"id":"commons","key":"commons","value":{"rev":"6-0ecb654aa2bd17cf9519f86d354f8a50"}}, -{"id":"complete","key":"complete","value":{"rev":"7-acde8cba7677747d09c3d53ff165754e"}}, -{"id":"complex-search","key":"complex-search","value":{"rev":"5-c80b2c7f049f333bde89435f3de497ca"}}, -{"id":"compose","key":"compose","value":{"rev":"1-cf8a97d6ead3bef056d85daec5d36c70"}}, -{"id":"composer","key":"composer","value":{"rev":"6-1deb43725051f845efd4a7c8e68aa6d6"}}, -{"id":"compress","key":"compress","value":{"rev":"17-f0aacce1356f807b51e083490fb353bd"}}, -{"id":"compress-buffer","key":"compress-buffer","value":{"rev":"12-2886014c7f2541f4ddff9f0f55f4c171"}}, -{"id":"compress-ds","key":"compress-ds","value":{"rev":"5-9e4c6931edf104443353594ef50aa127"}}, -{"id":"compressor","key":"compressor","value":{"rev":"3-ee8ad155a98e1483d899ebcf82d5fb63"}}, -{"id":"concrete","key":"concrete","value":{"rev":"5-bc70bbffb7c6fe9e8c399db578fb3bae"}}, -{"id":"condo","key":"condo","value":{"rev":"9-5f03d58ee7dc29465defa3758f3b138a"}}, -{"id":"conductor","key":"conductor","value":{"rev":"8-1878afadcda7398063de6286c2d2c5c1"}}, -{"id":"conf","key":"conf","value":{"rev":"11-dcf0f6a93827d1b143cb1d0858f2be4a"}}, -{"id":"config","key":"config","value":{"rev":"37-2b741a1e6951a74b7f1de0d0547418a0"}}, -{"id":"config-loader","key":"config-loader","value":{"rev":"3-708cc96d1206de46fb450eb57ca07b0d"}}, -{"id":"configurator","key":"configurator","value":{"rev":"5-b31ad9731741d19f28241f6af5b41fee"}}, -{"id":"confu","key":"confu","value":{"rev":"7-c46f82c4aa9a17db6530b00669461eaf"}}, -{"id":"confy","key":"confy","value":{"rev":"3-893b33743830a0318dc99b1788aa92ee"}}, -{"id":"connect","key":"connect","value":{"rev":"151-8b5617fc6ece6c125b5f628936159bd6"}}, -{"id":"connect-access-control","key":"connect-access-control","value":{"rev":"3-ccf5fb09533d41eb0b564eb1caecf910"}}, -{"id":"connect-airbrake","key":"connect-airbrake","value":{"rev":"5-19db5e5828977540814d09f9eb7f028f"}}, -{"id":"connect-analytics","key":"connect-analytics","value":{"rev":"3-6f71c8b08ed9f5762c1a4425c196fb2a"}}, -{"id":"connect-app-cache","key":"connect-app-cache","value":{"rev":"27-3e69452dfe51cc907f8b188aede1bda8"}}, -{"id":"connect-assetmanager","key":"connect-assetmanager","value":{"rev":"46-f2a8834d2749e0c069cee06244e7501c"}}, -{"id":"connect-assetmanager-handlers","key":"connect-assetmanager-handlers","value":{"rev":"38-8b93821fcf46f20bbad4319fb39302c1"}}, -{"id":"connect-assets","key":"connect-assets","value":{"rev":"33-7ec2940217e29a9514d20cfd49af10f5"}}, -{"id":"connect-auth","key":"connect-auth","value":{"rev":"36-5640e82f3e2773e44ce47b0687436305"}}, -{"id":"connect-cache","key":"connect-cache","value":{"rev":"11-efe1f0ab00c181b1a4dece446ef13a90"}}, -{"id":"connect-coffee","key":"connect-coffee","value":{"rev":"3-3d4ebcfe083c9e5a5d587090f1bb4d65"}}, -{"id":"connect-conneg","key":"connect-conneg","value":{"rev":"3-bc3e04e65cf1f5233a38cc846e9a4a75"}}, -{"id":"connect-cookie-session","key":"connect-cookie-session","value":{"rev":"3-f48ca73aa1ce1111a2c962d219b59c1a"}}, -{"id":"connect-cors","key":"connect-cors","value":{"rev":"10-5bc9e3759671a0157fdc307872d38844"}}, -{"id":"connect-couchdb","key":"connect-couchdb","value":{"rev":"9-9adb6d24c7fb6de58bafe6d06fb4a230"}}, -{"id":"connect-cradle","key":"connect-cradle","value":{"rev":"5-0e5e32e00a9b98eff1ab010173d26ffb"}}, -{"id":"connect-docco","key":"connect-docco","value":{"rev":"9-c8e379f9a89db53f8921895ac4e87ed6"}}, -{"id":"connect-dojo","key":"connect-dojo","value":{"rev":"17-f323c634536b9b948ad9607f4ca0847f"}}, -{"id":"connect-esi","key":"connect-esi","value":{"rev":"45-01de7506d405856586ea77cb14022192"}}, -{"id":"connect-facebook","key":"connect-facebook","value":{"rev":"3-bf77eb01c0476e607b25bc9d93416b7e"}}, -{"id":"connect-force-domain","key":"connect-force-domain","value":{"rev":"5-a65755f93aaea8a21c7ce7dd4734dca0"}}, -{"id":"connect-form","key":"connect-form","value":{"rev":"16-fa786af79f062a05ecdf3e7cf48317e2"}}, -{"id":"connect-geoip","key":"connect-geoip","value":{"rev":"3-d87f93bcac58aa7904886a8fb6c45899"}}, -{"id":"connect-googleapps","key":"connect-googleapps","value":{"rev":"13-49c5c6c6724b21eea9a8eaae2165978d"}}, -{"id":"connect-gzip","key":"connect-gzip","value":{"rev":"7-2e1d4bb887c1ddda278fc8465ee5645b"}}, -{"id":"connect-heroku-redis","key":"connect-heroku-redis","value":{"rev":"13-92da2be67451e5f55f6fbe3672c86dc4"}}, -{"id":"connect-i18n","key":"connect-i18n","value":{"rev":"8-09d47d7c220770fc80d1b6fd87ffcd07"}}, -{"id":"connect-identity","key":"connect-identity","value":{"rev":"8-8eb9e21bbf80045e0243720955d6070f"}}, -{"id":"connect-image-resizer","key":"connect-image-resizer","value":{"rev":"7-5f82563f87145f3cc06086afe3a14a62"}}, -{"id":"connect-index","key":"connect-index","value":{"rev":"3-8b8373334079eb26c8735b39483889a0"}}, -{"id":"connect-jsonp","key":"connect-jsonp","value":{"rev":"16-9e80af455e490710f06039d3c0025840"}}, -{"id":"connect-jsonrpc","key":"connect-jsonrpc","value":{"rev":"6-6556800f0bef6ae5eb10496d751048e7"}}, -{"id":"connect-kyoto","key":"connect-kyoto","value":{"rev":"5-8f6a9e9b24d1a71c786645402f509645"}}, -{"id":"connect-less","key":"connect-less","value":{"rev":"3-461ed9a80b462b978a81d5bcee6f3665"}}, -{"id":"connect-load-balance","key":"connect-load-balance","value":{"rev":"3-e74bff5fb47d1490c05a9cc4339af347"}}, -{"id":"connect-memcached","key":"connect-memcached","value":{"rev":"3-5fc92b7f9fb5bcfb364a27e6f052bcc7"}}, -{"id":"connect-mongo","key":"connect-mongo","value":{"rev":"13-c3869bc7337b2f1ee6b9b3364993f321"}}, -{"id":"connect-mongodb","key":"connect-mongodb","value":{"rev":"30-30cb932839ce16e4e496f5a33fdd720a"}}, -{"id":"connect-mongoose","key":"connect-mongoose","value":{"rev":"3-48a5b329e4cfa885442d43bbd1d0db46"}}, -{"id":"connect-mongoose-session","key":"connect-mongoose-session","value":{"rev":"3-6692b8e1225d5cd6a2daabd61cecb1cd"}}, -{"id":"connect-mysql-session","key":"connect-mysql-session","value":{"rev":"9-930abd0279ef7f447e75c95b3e71be12"}}, -{"id":"connect-no-www","key":"connect-no-www","value":{"rev":"3-33bed7417bc8a5e8efc74ce132c33158"}}, -{"id":"connect-notifo","key":"connect-notifo","value":{"rev":"3-4681f8c5a7dfd35aee9634e809c41804"}}, -{"id":"connect-parameter-router","key":"connect-parameter-router","value":{"rev":"3-f435f06d556c208d43ef05c64bcddceb"}}, -{"id":"connect-pg","key":"connect-pg","value":{"rev":"11-d84c53d8f1c24adfc266e7a031dddf0d"}}, -{"id":"connect-proxy","key":"connect-proxy","value":{"rev":"7-a691ff57a9affeab47c54d17dbe613cb"}}, -{"id":"connect-queryparser","key":"connect-queryparser","value":{"rev":"3-bb35a7f3f75297a63bf942a63b842698"}}, -{"id":"connect-redis","key":"connect-redis","value":{"rev":"40-4faa12962b14da49380de2bb183176f9"}}, -{"id":"connect-restreamer","key":"connect-restreamer","value":{"rev":"3-08e637ca685cc63b2b4f9722c763c105"}}, -{"id":"connect-riak","key":"connect-riak","value":{"rev":"5-3268c29a54e430a3f8adb33570afafdb"}}, -{"id":"connect-rpx","key":"connect-rpx","value":{"rev":"28-acc7bb4200c1d30f359151f0a715162c"}}, -{"id":"connect-security","key":"connect-security","value":{"rev":"16-fecd20f486a8ea4d557119af5b5a2960"}}, -{"id":"connect-select","key":"connect-select","value":{"rev":"5-5ca28ec800419e4cb3e97395a6b96153"}}, -{"id":"connect-session-mongo","key":"connect-session-mongo","value":{"rev":"9-9e6a26dfbb9c13a9d6f4060a1895730a"}}, -{"id":"connect-session-redis-store","key":"connect-session-redis-store","value":{"rev":"8-fecfed6e17476eaada5cfe7740d43893"}}, -{"id":"connect-sessionvoc","key":"connect-sessionvoc","value":{"rev":"13-57b6e6ea2158e3b7136054839662ea3d"}}, -{"id":"connect-spdy","key":"connect-spdy","value":{"rev":"11-f9eefd7303295d77d317cba78d299130"}}, -{"id":"connect-sts","key":"connect-sts","value":{"rev":"9-8e3fd563c04ce14b824fc4da42efb70e"}}, -{"id":"connect-timeout","key":"connect-timeout","value":{"rev":"4-6f5f8d97480c16c7acb05fe82400bbc7"}}, -{"id":"connect-unstable","key":"connect-unstable","value":{"rev":"3-1d3a4edc52f005d8cb4d557485095314"}}, -{"id":"connect-wormhole","key":"connect-wormhole","value":{"rev":"3-f33b15acc686bd9ad0c6df716529009f"}}, -{"id":"connect-xcors","key":"connect-xcors","value":{"rev":"7-f8e1cd6805a8779bbd6bb2c1000649fb"}}, -{"id":"connect_facebook","key":"connect_facebook","value":{"rev":"3-b3001d71f619836a009c53c816ce36ed"}}, -{"id":"connect_json","key":"connect_json","value":{"rev":"3-dd0df74291f80f45b4314d56192c19c5"}}, -{"id":"connectables","key":"connectables","value":{"rev":"3-f6e9f8f13883a523b4ea6035281f541b"}}, -{"id":"conseq","key":"conseq","value":{"rev":"3-890d340704322630e7a724333f394c70"}}, -{"id":"consistent-hashing","key":"consistent-hashing","value":{"rev":"3-fcef5d4479d926560cf1bc900f746f2a"}}, -{"id":"console","key":"console","value":{"rev":"3-1e0449b07c840eeac6b536e2552844f4"}}, -{"id":"console.log","key":"console.log","value":{"rev":"9-d608afe50e732ca453365befcb87bad5"}}, -{"id":"consolemark","key":"consolemark","value":{"rev":"13-320f003fc2c3cec909ab3e9c3bce9743"}}, -{"id":"construct","key":"construct","value":{"rev":"3-75bdc809ee0572172e6acff537af7d9b"}}, -{"id":"context","key":"context","value":{"rev":"3-86b1a6a0f77ef86d4d9ccfff47ceaf6a"}}, -{"id":"contextify","key":"contextify","value":{"rev":"9-547b8019ef66e0d1c84fe00be832e750"}}, -{"id":"contract","key":"contract","value":{"rev":"3-d09e775c2c1e297b6cbbfcd5efbae3c7"}}, -{"id":"contracts","key":"contracts","value":{"rev":"13-3fd75c77e688937734f51cf97f10dd7d"}}, -{"id":"control","key":"control","value":{"rev":"31-7abf0cb81d19761f3ff59917e56ecedf"}}, -{"id":"controljs","key":"controljs","value":{"rev":"3-a8e80f93e389ca07509fa7addd6cb805"}}, -{"id":"convert","key":"convert","value":{"rev":"3-6c962b92274bcbe82b82a30806559d47"}}, -{"id":"conway","key":"conway","value":{"rev":"5-93ce24976e7dd5ba02fe4addb2b44267"}}, -{"id":"cookie","key":"cookie","value":{"rev":"14-946d98bf46e940d13ca485148b1bd609"}}, -{"id":"cookie-sessions","key":"cookie-sessions","value":{"rev":"8-4b399ac8cc4baea15f6c5e7ac94399f0"}}, -{"id":"cookiejar","key":"cookiejar","value":{"rev":"20-220b41a4c2a8f2b7b14aafece7dcc1b5"}}, -{"id":"cookies","key":"cookies","value":{"rev":"15-b3b35c32a99ed79accc724685d131d18"}}, -{"id":"cool","key":"cool","value":{"rev":"3-007d1123eb2dc52cf845d625f7ccf198"}}, -{"id":"coolmonitor","key":"coolmonitor","value":{"rev":"3-69c3779c596527f63e49c5e507dff1e1"}}, -{"id":"coop","key":"coop","value":{"rev":"9-39dee3260858cf8c079f31bdf02cea1d"}}, -{"id":"coordinator","key":"coordinator","value":{"rev":"32-9d92f2033a041d5c40f8e1018d512755"}}, -{"id":"core-utils","key":"core-utils","value":{"rev":"9-98f2412938a67d83e53e76a26b5601e0"}}, -{"id":"cornify","key":"cornify","value":{"rev":"6-6913172d09c52f9e8dc0ea19ec49972c"}}, -{"id":"corpus","key":"corpus","value":{"rev":"3-a357e7779f8d4ec020b755c71dd1e57b"}}, -{"id":"corrector","key":"corrector","value":{"rev":"3-ef3cf99fc59a581aee3590bdb8615269"}}, -{"id":"cosmos","key":"cosmos","value":{"rev":"3-3eb292c59758fb5215f22739fa9531ce"}}, -{"id":"couch-ar","key":"couch-ar","value":{"rev":"25-f106d2965ab74b25b18328ca44ca4a02"}}, -{"id":"couch-cleaner","key":"couch-cleaner","value":{"rev":"15-74e61ef98a770d76be4c7e7571d18381"}}, -{"id":"couch-client","key":"couch-client","value":{"rev":"10-94945ebd3e17f509fcc71fb6c6ef5d35"}}, -{"id":"couch-session","key":"couch-session","value":{"rev":"4-c73dea41ceed26a2a0bde9a9c8ffffc4"}}, -{"id":"couch-sqlite","key":"couch-sqlite","value":{"rev":"3-3e420fe6623542475595aa7e55a4e4bd"}}, -{"id":"couch-stream","key":"couch-stream","value":{"rev":"5-911704fc984bc49acce1e10adefff7ff"}}, -{"id":"couchapp","key":"couchapp","value":{"rev":"16-ded0f4742bb3f5fd42ec8f9c6b21ae8e"}}, -{"id":"couchcmd","key":"couchcmd","value":{"rev":"3-651ea2b435e031481b5d3d968bd3d1eb"}}, -{"id":"couchdb","key":"couchdb","value":{"rev":"12-8abcfd649751226c10edf7cf0508a09f"}}, -{"id":"couchdb-api","key":"couchdb-api","value":{"rev":"23-f2c82f08f52f266df7ac2aa709615244"}}, -{"id":"couchdb-tmp","key":"couchdb-tmp","value":{"rev":"3-9a695fb4ba352f3be2d57c5995718520"}}, -{"id":"couchdev","key":"couchdev","value":{"rev":"3-50a0ca3ed0395dd72de62a1b96619e66"}}, -{"id":"couchlegs","key":"couchlegs","value":{"rev":"5-be78e7922ad4ff86dbe5c17a87fdf4f1"}}, -{"id":"couchtato","key":"couchtato","value":{"rev":"11-15a1ce8de9a8cf1e81d96de6afbb4f45"}}, -{"id":"couchy","key":"couchy","value":{"rev":"13-0a52b2712fb8447f213866612e3ccbf7"}}, -{"id":"courier","key":"courier","value":{"rev":"17-eb94fe01aeaad43805f4bce21d23bcba"}}, -{"id":"coverage","key":"coverage","value":{"rev":"10-a333448996d0b0d420168d1b5748db32"}}, -{"id":"coverage_testing","key":"coverage_testing","value":{"rev":"3-62834678206fae7911401aa86ec1a85e"}}, -{"id":"cqs","key":"cqs","value":{"rev":"6-0dad8b969c70abccc27a146a99399533"}}, -{"id":"crab","key":"crab","value":{"rev":"9-599fc7757f0c9efbe3889f30981ebe93"}}, -{"id":"cradle","key":"cradle","value":{"rev":"60-8fb414b66cb07b4bae59c0316d5c45b4"}}, -{"id":"cradle-fixed","key":"cradle-fixed","value":{"rev":"4-589afffa26fca22244ad2038abb77dc5"}}, -{"id":"cradle-init","key":"cradle-init","value":{"rev":"13-499d63592141f1e200616952bbdea015"}}, -{"id":"crawler","key":"crawler","value":{"rev":"5-ec4a8d77f90d86d17d6d14d631360188"}}, -{"id":"crc","key":"crc","value":{"rev":"3-25ab83f8b1333e6d4e4e5fb286682422"}}, -{"id":"creatary","key":"creatary","value":{"rev":"3-770ad84ecb2e2a3994637d419384740d"}}, -{"id":"createsend","key":"createsend","value":{"rev":"7-19885346e4d7a01ac2e9ad70ea0e822a"}}, -{"id":"creationix","key":"creationix","value":{"rev":"61-7ede1759afbd41e8b4dedc348b72202e"}}, -{"id":"creek","key":"creek","value":{"rev":"33-4f511aa4dd379e04bba7ac333744325e"}}, -{"id":"cron","key":"cron","value":{"rev":"12-8d794edb5f9b7cb6322acaef1c848043"}}, -{"id":"cron2","key":"cron2","value":{"rev":"13-bae2f1b02ffcbb0e77bde6c33b566f80"}}, -{"id":"crontab","key":"crontab","value":{"rev":"36-14d26bf316289fb4841940eee2932f37"}}, -{"id":"crossroads","key":"crossroads","value":{"rev":"7-d73d51cde30f24caad91e6a3c5b420f2"}}, -{"id":"crowdflower","key":"crowdflower","value":{"rev":"3-16c2dfc9fd505f75068f75bd19e3d227"}}, -{"id":"cruvee","key":"cruvee","value":{"rev":"3-979ccf0286b1701e9e7483a10451d975"}}, -{"id":"crypt","key":"crypt","value":{"rev":"3-031b338129bebc3749b42fb3d442fc4b"}}, -{"id":"crypto","key":"crypto","value":{"rev":"3-66a444b64481c85987dd3f22c32e0630"}}, -{"id":"csj","key":"csj","value":{"rev":"3-bc3133c7a0a8827e89aa03897b81d177"}}, -{"id":"cson","key":"cson","value":{"rev":"7-3ac3e1e10572e74e58874cfe3200eb87"}}, -{"id":"csrf-express","key":"csrf-express","value":{"rev":"3-4cc36d88e8ad10b9c2cc8a7318f0abd3"}}, -{"id":"css-crawler","key":"css-crawler","value":{"rev":"13-4739c7bf1decc72d7682b53303f93ec6"}}, -{"id":"css-smasher","key":"css-smasher","value":{"rev":"3-631128f966135c97d648efa3eadf7bfb"}}, -{"id":"css-sourcery","key":"css-sourcery","value":{"rev":"3-571343da3a09af7de473d29ed7dd788b"}}, -{"id":"css2json","key":"css2json","value":{"rev":"5-fb6d84c1da4a9391fa05d782860fe7c4"}}, -{"id":"csskeeper","key":"csskeeper","value":{"rev":"5-ea667a572832ea515b044d4b87ea7d98"}}, -{"id":"csslike","key":"csslike","value":{"rev":"3-6e957cce81f6e790f8562526d907ad94"}}, -{"id":"csslint","key":"csslint","value":{"rev":"19-b1e973274a0a6b8eb81b4d715a249612"}}, -{"id":"cssmin","key":"cssmin","value":{"rev":"10-4bb4280ec56f110c43abe01189f95818"}}, -{"id":"csso","key":"csso","value":{"rev":"17-ccfe2a72d377919b07973bbb1d19b8f2"}}, -{"id":"cssom","key":"cssom","value":{"rev":"3-f96b884b63b4c04bac18b8d9c0a4c4cb"}}, -{"id":"cssp","key":"cssp","value":{"rev":"5-abf69f9ff99b7d0bf2731a5b5da0897c"}}, -{"id":"cssunminifier","key":"cssunminifier","value":{"rev":"3-7bb0c27006af682af92d1969fcb4fa73"}}, -{"id":"cssutils","key":"cssutils","value":{"rev":"3-4759f9db3b8eac0964e36f5229260526"}}, -{"id":"csv","key":"csv","value":{"rev":"21-0420554e9c08e001063cfb0a69a48255"}}, -{"id":"csv2mongo","key":"csv2mongo","value":{"rev":"9-373f11c05e5d1744c3187d9aaeaae0ab"}}, -{"id":"csvutils","key":"csvutils","value":{"rev":"15-84aa82e56b49cd425a059c8f0735a23c"}}, -{"id":"ctrlflow","key":"ctrlflow","value":{"rev":"33-0b817baf6c744dc17b83d5d8ab1ba74e"}}, -{"id":"ctrlflow_tests","key":"ctrlflow_tests","value":{"rev":"3-d9ed35503d27b0736c59669eecb4c4fe"}}, -{"id":"ctype","key":"ctype","value":{"rev":"9-c5cc231475f23a01682d0b1a3b6e49c2"}}, -{"id":"cube","key":"cube","value":{"rev":"5-40320a20d260e082f5c4ca508659b4d1"}}, -{"id":"cucumber","key":"cucumber","value":{"rev":"11-8489af0361b6981cf9001a0403815936"}}, -{"id":"cucumis","key":"cucumis","value":{"rev":"33-6dc38f1161fae3efa2a89c8288b6e040"}}, -{"id":"cucumis-rm","key":"cucumis-rm","value":{"rev":"3-6179249ad15166f8d77eb136b3fa87ca"}}, -{"id":"cupcake","key":"cupcake","value":{"rev":"15-1dd13a85415a366942e7f0a3de06aa2a"}}, -{"id":"curator","key":"curator","value":{"rev":"19-d798ab7fbca11ba0e9c6c40c0a2f9440"}}, -{"id":"curl","key":"curl","value":{"rev":"11-ac7143ac07c64ea169ba7d4e58be232a"}}, -{"id":"curly","key":"curly","value":{"rev":"30-0248a5563b6e96457315ad0cc2fe22c1"}}, -{"id":"curry","key":"curry","value":{"rev":"11-ce13fa80e84eb25d9cf76cf4162a634e"}}, -{"id":"cursory","key":"cursory","value":{"rev":"3-ea2f4b1b47caf38460402d1a565c18b8"}}, -{"id":"d-utils","key":"d-utils","value":{"rev":"37-699ad471caa28183d75c06f0f2aab41c"}}, -{"id":"d3","key":"d3","value":{"rev":"5-4d867844bd7dce21b34cd7283bb9cad4"}}, -{"id":"d3bench","key":"d3bench","value":{"rev":"3-617cc625bfd91c175d037bfcace9c4e9"}}, -{"id":"daemon","key":"daemon","value":{"rev":"11-8654f90bc609ca2c3ec260c7d6b7793e"}}, -{"id":"daemon-tools","key":"daemon-tools","value":{"rev":"18-8197fce2054de67925e6f2c3fa3cd90a"}}, -{"id":"daimyo","key":"daimyo","value":{"rev":"25-531b0b0afdc5ae3d41b4131da40af6cf"}}, -{"id":"daleth","key":"daleth","value":{"rev":"7-4824619205289ba237ef2a4dc1fba1ec"}}, -{"id":"dali","key":"dali","value":{"rev":"9-037c4c76f739ecb537a064c07d3c63e3"}}, -{"id":"damncomma","key":"damncomma","value":{"rev":"3-b1472eada01efb8a12d521e5a248834b"}}, -{"id":"dana","key":"dana","value":{"rev":"3-2a3c0ff58a6d13fedd17e1d192080e59"}}, -{"id":"dandy","key":"dandy","value":{"rev":"9-f4ae43659dd812a010b0333bf8e5a282"}}, -{"id":"dash","key":"dash","value":{"rev":"5-698513f86165f429a5f55320d5a700f0"}}, -{"id":"dash-fu","key":"dash-fu","value":{"rev":"3-848e99a544f9f78f311c7ebfc5a172c4"}}, -{"id":"dashboard","key":"dashboard","value":{"rev":"3-71844d1fc1140b7533f9e57740d2b666"}}, -{"id":"data","key":"data","value":{"rev":"23-b594e2bd1ffef1cda8b7e94dbf15ad5b"}}, -{"id":"data-layer","key":"data-layer","value":{"rev":"9-9205d35cc6eaf1067ee0cec1b421d749"}}, -{"id":"data-page","key":"data-page","value":{"rev":"3-d7a3346a788a0c07132e50585db11c99"}}, -{"id":"data-section","key":"data-section","value":{"rev":"9-d3fff313977667c53cbadb134d993412"}}, -{"id":"data-uuid","key":"data-uuid","value":{"rev":"8-24001fe9f37c4cc7ac01079ee4767363"}}, -{"id":"data-visitor","key":"data-visitor","value":{"rev":"6-7fe5da9d118fab27157dba97050c6487"}}, -{"id":"database-cleaner","key":"database-cleaner","value":{"rev":"19-4bdfc8b324e95e6da9f72e7b7b708b98"}}, -{"id":"datapool","key":"datapool","value":{"rev":"3-f99c93ca812d2f4725bbaea99122832c"}}, -{"id":"datasift","key":"datasift","value":{"rev":"3-6de3ae25c9a99f651101e191595bcf64"}}, -{"id":"date","key":"date","value":{"rev":"9-b334fc6450d093de40a664a4a835cfc4"}}, -{"id":"date-utils","key":"date-utils","value":{"rev":"31-7be8fcf1919564a8fb7223a86a5954ac"}}, -{"id":"dateformat","key":"dateformat","value":{"rev":"11-5b924e1d29056a0ef9b89b9d7984d5c4"}}, -{"id":"dateformatjs","key":"dateformatjs","value":{"rev":"3-4c50a38ecc493535ee2570a838673937"}}, -{"id":"datejs","key":"datejs","value":{"rev":"5-f47e3e6532817f822aa910b59a45717c"}}, -{"id":"dateselect","key":"dateselect","value":{"rev":"3-ce58def02fd8c8feda8c6f2004726f97"}}, -{"id":"datetime","key":"datetime","value":{"rev":"7-14227b0677eb93b8eb519db47f46bf36"}}, -{"id":"db","key":"db","value":{"rev":"3-636e9ea922a85c92bc11aa9691a2e67f"}}, -{"id":"db-drizzle","key":"db-drizzle","value":{"rev":"157-955f74f49ac4236df317e227c08afaa3"}}, -{"id":"db-mysql","key":"db-mysql","value":{"rev":"224-e596a18d9af33ff1fbcf085a9f4f56fd"}}, -{"id":"db-oracle","key":"db-oracle","value":{"rev":"13-a1e2924d87b4badfddeccf6581525b08"}}, -{"id":"dcrypt","key":"dcrypt","value":{"rev":"29-a144a609bef5004781df901440d67b2d"}}, -{"id":"decafscript","key":"decafscript","value":{"rev":"3-f3a239dc7d503c900fc9854603d716e6"}}, -{"id":"decimal","key":"decimal","value":{"rev":"3-614ed56d4d6c5eb7883d8fd215705a12"}}, -{"id":"decimaljson","key":"decimaljson","value":{"rev":"9-7cb23f4b2b1168b1a213f1eefc85fa51"}}, -{"id":"deck","key":"deck","value":{"rev":"7-da422df97f13c7d84e8f3690c1e1ca32"}}, -{"id":"deckard","key":"deckard","value":{"rev":"3-85e0cd76cdd88ff60a617239060d6f46"}}, -{"id":"deckem","key":"deckem","value":{"rev":"9-03ca75ea35960ccd5779b4cfa8cfb9f9"}}, -{"id":"defensio","key":"defensio","value":{"rev":"5-0ad0ae70b4e184626d914cc4005ee34c"}}, -{"id":"defer","key":"defer","value":{"rev":"3-8d003c96f4263a26b7955e251cddbd95"}}, -{"id":"deferrable","key":"deferrable","value":{"rev":"8-3ae57ce4391105962d09ad619d4c4670"}}, -{"id":"deferred","key":"deferred","value":{"rev":"17-9cee7948dbdf7b6dcc00bbdc60041dd0"}}, -{"id":"define","key":"define","value":{"rev":"45-9d422f2ac5ab693f881df85898d68e3a"}}, -{"id":"deflate","key":"deflate","value":{"rev":"10-3ebe2b87e09f4ae51857cae02e1af788"}}, -{"id":"degrees","key":"degrees","value":{"rev":"5-707c57cfa3e589e8059fe9860cc0c10b"}}, -{"id":"deimos","key":"deimos","value":{"rev":"11-6481696be774d14254fe7c427107dc2a"}}, -{"id":"deja","key":"deja","value":{"rev":"47-bde4457402db895aad46198433842668"}}, -{"id":"delayed-stream","key":"delayed-stream","value":{"rev":"13-f6ca393b08582350f78c5c66f183489b"}}, -{"id":"delegator","key":"delegator","value":{"rev":"3-650651749c1df44ef544c919fae74f82"}}, -{"id":"dep-graph","key":"dep-graph","value":{"rev":"3-e404af87822756da52754e2cc5c576b1"}}, -{"id":"dependency-promise","key":"dependency-promise","value":{"rev":"11-1cc2be8465d736ec8f3cc8940ab22823"}}, -{"id":"depends","key":"depends","value":{"rev":"30-adc9604bbd8117592f82eee923d8703e"}}, -{"id":"deploy","key":"deploy","value":{"rev":"3-82020957528bd0bdd675bed9ac4e4cc5"}}, -{"id":"deployjs","key":"deployjs","value":{"rev":"5-a3e99a5ed81d4b1ad44b6477e6a5a985"}}, -{"id":"deputy-client","key":"deputy-client","value":{"rev":"3-31fd224b301ec0f073df7afa790050ec"}}, -{"id":"deputy-server","key":"deputy-server","value":{"rev":"3-0d790cce82aadfd2b8f39a6b056f2792"}}, -{"id":"derby","key":"derby","value":{"rev":"40-b642048a1a639d77ab139160a4da0fd2"}}, -{"id":"des","key":"des","value":{"rev":"24-fcbdc086e657aef356b75433b3e65ab6"}}, -{"id":"descent","key":"descent","value":{"rev":"7-9cc259b25fc688597fc7efaa516d03c6"}}, -{"id":"describe","key":"describe","value":{"rev":"6-788c7f2feaf2e88f4b1179976b273744"}}, -{"id":"deserver","key":"deserver","value":{"rev":"5-da8083694e89b8434123fe7482a3cc7e"}}, -{"id":"detect","key":"detect","value":{"rev":"3-c27f258d39d7905c2b92383809bb5988"}}, -{"id":"detective","key":"detective","value":{"rev":"9-d6cfa0c6389783cdc9c9ffa9e4082c64"}}, -{"id":"dev","key":"dev","value":{"rev":"23-5c2ce4a4f6a4f24d3cff3b7db997d8bc"}}, -{"id":"dev-warnings","key":"dev-warnings","value":{"rev":"5-5a7d7f36d09893df96441be8b09e41d6"}}, -{"id":"dhcpjs","key":"dhcpjs","value":{"rev":"3-1bc01bd612f3ab1fce178c979aa34e43"}}, -{"id":"dht","key":"dht","value":{"rev":"3-40c0b909b6c0e2305e19d10cea1881b0"}}, -{"id":"dht-bencode","key":"dht-bencode","value":{"rev":"5-88a1da8de312a54097507d72a049f0f3"}}, -{"id":"dialect","key":"dialect","value":{"rev":"18-db7928ce4756eea35db1732d4f2ebc88"}}, -{"id":"dialect-http","key":"dialect-http","value":{"rev":"19-23a927d28cb43733dbd05294134a5b8c"}}, -{"id":"dicks","key":"dicks","value":{"rev":"11-ba64897899e336d366ffd4b68cac99f5"}}, -{"id":"diff","key":"diff","value":{"rev":"13-1a88acb0369ab8ae096a2323d65a2811"}}, -{"id":"diff_match_patch","key":"diff_match_patch","value":{"rev":"8-2f6f467e483b23b217a2047e4aded850"}}, -{"id":"diffbot","key":"diffbot","value":{"rev":"3-8cb8e34af89cb477a5da52e3fd9a13f7"}}, -{"id":"digest","key":"digest","value":{"rev":"7-bc6fb9e68c83197381b0d9ac7db16c1c"}}, -{"id":"dir","key":"dir","value":{"rev":"7-574462bb241a39eeffe6c5184d40c57a"}}, -{"id":"dir-watcher","key":"dir-watcher","value":{"rev":"31-1a3ca4d6aa8aa32c619efad5fbfce494"}}, -{"id":"dir2html","key":"dir2html","value":{"rev":"5-b4bfb2916c2d94c85aa75ffa29ad1af4"}}, -{"id":"directive","key":"directive","value":{"rev":"3-3373f02b8762cb1505c8f8cbcc50d3d4"}}, -{"id":"dirsum","key":"dirsum","value":{"rev":"5-8545445faaa41d2225ec7ff226a10750"}}, -{"id":"dirty","key":"dirty","value":{"rev":"13-d636ea0d1ed35560c0bc7272965c1a6f"}}, -{"id":"dirty-uuid","key":"dirty-uuid","value":{"rev":"5-65acdfda886afca65ae52f0ac21ce1b2"}}, -{"id":"discogs","key":"discogs","value":{"rev":"21-839410e6bf3bee1435ff837daaeaf9f8"}}, -{"id":"discount","key":"discount","value":{"rev":"13-a8fb2a8f668ac0a55fffada1ea94a4b7"}}, -{"id":"discovery","key":"discovery","value":{"rev":"3-46f4496224d132e56cbc702df403219d"}}, -{"id":"diskcache","key":"diskcache","value":{"rev":"23-7b14ad41fc199184fb939828e9122099"}}, -{"id":"dispatch","key":"dispatch","value":{"rev":"6-e72cc7b2bcc97faf897ae4e4fa3ec681"}}, -{"id":"distribute.it","key":"distribute.it","value":{"rev":"12-0978757eb25d22117af675806cf6eef2"}}, -{"id":"dive","key":"dive","value":{"rev":"21-9cbd1281c5a3c2dae0cc0407863f3336"}}, -{"id":"diveSync","key":"diveSync","value":{"rev":"3-015ec4803903106bf24cb4f17cedee68"}}, -{"id":"dk-assets","key":"dk-assets","value":{"rev":"3-25d9b6ac727caf1e227e6436af835d03"}}, -{"id":"dk-core","key":"dk-core","value":{"rev":"3-0b6a2f4dfc0484a3908159a897920bae"}}, -{"id":"dk-couchdb","key":"dk-couchdb","value":{"rev":"3-cc9ef511f9ed46be9d7099f10b1ee776"}}, -{"id":"dk-model","key":"dk-model","value":{"rev":"3-3a61006be57d304724c049e4dcf2fc9b"}}, -{"id":"dk-model-couchdb","key":"dk-model-couchdb","value":{"rev":"3-5163def21660db8428e623909bbfcb4d"}}, -{"id":"dk-routes","key":"dk-routes","value":{"rev":"3-4563357f850248d7d0fb37f9bdcb893b"}}, -{"id":"dk-server","key":"dk-server","value":{"rev":"3-9aef13fc5814785c9805b26828e8d114"}}, -{"id":"dk-template","key":"dk-template","value":{"rev":"3-809c94776252441129705fbe1d93e752"}}, -{"id":"dk-transport","key":"dk-transport","value":{"rev":"3-9271da6f86079027535179b743d0d4c3"}}, -{"id":"dk-websockets","key":"dk-websockets","value":{"rev":"3-426b44c04180d6caf7cf765f03fc52c2"}}, -{"id":"dnet-index-proxy","key":"dnet-index-proxy","value":{"rev":"51-1f3cf4f534c154369d5e774a8f599106"}}, -{"id":"dnode","key":"dnode","value":{"rev":"129-68db10c25c23d635dc828aa698d1279e"}}, -{"id":"dnode-ez","key":"dnode-ez","value":{"rev":"17-75877eab5cf3976b8876c49afd2f7e38"}}, -{"id":"dnode-protocol","key":"dnode-protocol","value":{"rev":"23-fb28f8e1180e6aa44fa564e0d55b3d1e"}}, -{"id":"dnode-smoothiecharts","key":"dnode-smoothiecharts","value":{"rev":"3-d1483028e5768527c2786b9ed5d76463"}}, -{"id":"dnode-stack","key":"dnode-stack","value":{"rev":"9-c1ad8ce01282ce4fa72b5993c580e58e"}}, -{"id":"dnode-worker","key":"dnode-worker","value":{"rev":"3-4c73c0d7ed225197fd8fb0555eaf1152"}}, -{"id":"dns-server","key":"dns-server","value":{"rev":"3-4858a1773da514fea68eac6d9d39f69e"}}, -{"id":"dns-srv","key":"dns-srv","value":{"rev":"12-867c769437fa0ad8a83306aa9e2a158e"}}, -{"id":"doc","key":"doc","value":{"rev":"5-2c077b3fd3b6efa4e927b66f1390e4ea"}}, -{"id":"doc.md","key":"doc.md","value":{"rev":"7-8e8e51be4956550388699222b2e039e7"}}, -{"id":"docco","key":"docco","value":{"rev":"18-891bde1584809c3b1f40fef9961b4f28"}}, -{"id":"docdown","key":"docdown","value":{"rev":"5-fcf5be2ab6ceaed76c1980b462359057"}}, -{"id":"docket","key":"docket","value":{"rev":"13-a4969e0fb17af8dba7df178e364161c2"}}, -{"id":"docpad","key":"docpad","value":{"rev":"77-a478ac8c7ac86e304f9213380ea4b550"}}, -{"id":"docs","key":"docs","value":{"rev":"3-6b1fae9738a3327a3a3be826c0981c3a"}}, -{"id":"dojo-node","key":"dojo-node","value":{"rev":"13-e0dc12e9ce8ab3f40b228c2af8c41064"}}, -{"id":"dom","key":"dom","value":{"rev":"3-cecd9285d0d5b1cab0f18350aac1b2b0"}}, -{"id":"dom-js","key":"dom-js","value":{"rev":"8-dd20e8b23028f4541668501650b52a71"}}, -{"id":"dom-js-ns","key":"dom-js-ns","value":{"rev":"3-787567fc1d6f4ca7e853215a4307b593"}}, -{"id":"domjs","key":"domjs","value":{"rev":"3-d2d05a20dccb57fb6db7da08916c6c0f"}}, -{"id":"doml","key":"doml","value":{"rev":"11-c3b49c50906d9875b546413e4acd1b38"}}, -{"id":"domo","key":"domo","value":{"rev":"3-a4321e6c0c688f773068365b44b08b6b"}}, -{"id":"domready","key":"domready","value":{"rev":"46-21c6b137bbed79ddbff31fdf0ef7d61f"}}, -{"id":"donkey","key":"donkey","value":{"rev":"3-1454aa878654886e8495ebb060aa10f7"}}, -{"id":"dot","key":"dot","value":{"rev":"19-b6d2d53cb9ae1a608a0956aeb8092578"}}, -{"id":"dotaccess","key":"dotaccess","value":{"rev":"13-63ddef6740e84f4517f7dd1bb0d68c56"}}, -{"id":"douche","key":"douche","value":{"rev":"3-6a200f908ccfc9ae549e80209e117cbf"}}, -{"id":"dox","key":"dox","value":{"rev":"10-856cc6bf3dc7c44e028173fea8323c24"}}, -{"id":"drag","key":"drag","value":{"rev":"9-00f27e241269c3df1d71e45b698e9b3b"}}, -{"id":"drain","key":"drain","value":{"rev":"3-8827a0ee7ed74b948bf56d5a33455fc8"}}, -{"id":"drawback","key":"drawback","value":{"rev":"74-dd356b3e55175525317e53c24979a431"}}, -{"id":"drev","key":"drev","value":{"rev":"9-43529419a69529dd7af9a83985aab1f2"}}, -{"id":"drews-mixins","key":"drews-mixins","value":{"rev":"17-63373bae6525859bddfc8d6ad19bdb06"}}, -{"id":"drnu","key":"drnu","value":{"rev":"3-b9b14b2241ded1e52a92fc4225b4ddc5"}}, -{"id":"dropbox","key":"dropbox","value":{"rev":"19-2cb7a40d253621fdfa96f23b96e42ecb"}}, -{"id":"drtoms-nodehelpers","key":"drtoms-nodehelpers","value":{"rev":"3-be0a75cdd7c2d49b1ec4ad1d2c3bc911"}}, -{"id":"drty","key":"drty","value":{"rev":"3-56eabd39b9badfa0af601c5cc64cee2c"}}, -{"id":"drty-facebook","key":"drty-facebook","value":{"rev":"3-fd07af7fb87d7f1d35e13f458a02c127"}}, -{"id":"drumkit","key":"drumkit","value":{"rev":"3-f3cdacef51453d3ac630759aff2a8b58"}}, -{"id":"drupal","key":"drupal","value":{"rev":"13-13835b1e1c8a0e8f0b0e8479640a8d7e"}}, -{"id":"dryice","key":"dryice","value":{"rev":"15-9990fdbde5475a8dbdcc055cb08d654d"}}, -{"id":"dryml","key":"dryml","value":{"rev":"33-483ff8cc3ab1431790cc2587c0bce989"}}, -{"id":"ds","key":"ds","value":{"rev":"9-743274a1d0143927851af07ff0f86d8d"}}, -{"id":"dt","key":"dt","value":{"rev":"3-ab59016f28e182c763b78ba49a59191c"}}, -{"id":"dtl","key":"dtl","value":{"rev":"11-415b4aeec93f096523569615e80f1be1"}}, -{"id":"dtrace-provider","key":"dtrace-provider","value":{"rev":"12-7f01510bd2b1d543f11e3dc02d98ab69"}}, -{"id":"dtrejo","key":"dtrejo","value":{"rev":"3-85f5bb2b9faec499e6aa77fe22e6e3ec"}}, -{"id":"dude","key":"dude","value":{"rev":"3-006528c1efd98312991273ba6ee45f7b"}}, -{"id":"dunce","key":"dunce","value":{"rev":"3-fa4fa5cafdfd1d86c650746f60b7bc0e"}}, -{"id":"duostack","key":"duostack","value":{"rev":"15-47824bdf6e32f49f64014e75421dc42e"}}, -{"id":"duplex-stream","key":"duplex-stream","value":{"rev":"3-2d0e12876e7ad4e5d3ea5520dcbad861"}}, -{"id":"durilka","key":"durilka","value":{"rev":"15-54400496515c8625e8bedf19f8a41cad"}}, -{"id":"dust","key":"dust","value":{"rev":"18-9bc9cae2e48c54f4389e9fce5dfc021e"}}, -{"id":"dustfs","key":"dustfs","value":{"rev":"5-944770c24f06989f3fc62427f2ddebc4"}}, -{"id":"dx","key":"dx","value":{"rev":"3-6000afd60be07d9ff91e7231a388f22f"}}, -{"id":"dynamic","key":"dynamic","value":{"rev":"3-33b83464ed56eb33c052a13dfb709c9c"}}, -{"id":"dynobj","key":"dynobj","value":{"rev":"5-3eb168dae1f9c20369fa1d5ae45f9021"}}, -{"id":"each","key":"each","value":{"rev":"3-5063799b0afcbb61378b1d605660a864"}}, -{"id":"ears","key":"ears","value":{"rev":"11-e77cd2b865409be7ba2e072e98b1c8a1"}}, -{"id":"easey","key":"easey","value":{"rev":"3-a380d8d945e03f55732ae8769cd6dbbf"}}, -{"id":"easy","key":"easy","value":{"rev":"3-73b836a34beafa31cdd8129fe158bf6e"}}, -{"id":"easy-oauth","key":"easy-oauth","value":{"rev":"5-2c1db698e61d77f99633042113099528"}}, -{"id":"easyfs","key":"easyfs","value":{"rev":"3-b807671a77c2a8cc27a9f1aa20ff74c0"}}, -{"id":"easyhash","key":"easyhash","value":{"rev":"3-2eeb24098bc4d201766dcc92dc7325f7"}}, -{"id":"easyrss","key":"easyrss","value":{"rev":"9-1687a54348670ef9ca387ea7ec87f0be"}}, -{"id":"ebnf-diagram","key":"ebnf-diagram","value":{"rev":"3-704e4605bf933b281a6821259a531055"}}, -{"id":"ec2","key":"ec2","value":{"rev":"22-25e562ae8898807c7b4c696c809cf387"}}, -{"id":"echo","key":"echo","value":{"rev":"19-75c2421f623ecc9fe2771f3658589ce8"}}, -{"id":"eco","key":"eco","value":{"rev":"14-b4db836928c91cbf22628cc65ca94f56"}}, -{"id":"ed","key":"ed","value":{"rev":"3-bed9b8225e83a02241d48254077a7df4"}}, -{"id":"edate","key":"edate","value":{"rev":"3-5ec1441ffe3b56d5d01561003b9844f2"}}, -{"id":"eden","key":"eden","value":{"rev":"35-9aa2ff880c2d4f45e3da881b15e58d0a"}}, -{"id":"eio","key":"eio","value":{"rev":"5-e6dd895635596d826ccdf4439761d5fa"}}, -{"id":"ejs","key":"ejs","value":{"rev":"30-c7b020b6cb8ee2626f47db21fc5fedb4"}}, -{"id":"ejs-ext","key":"ejs-ext","value":{"rev":"15-820393685191bbed37938acb7af5885e"}}, -{"id":"elastical","key":"elastical","value":{"rev":"3-c652af043bc4256a29a87e3de9b78093"}}, -{"id":"elasticsearchclient","key":"elasticsearchclient","value":{"rev":"33-bcb59deb7d9d56737a6946c56830ae6b"}}, -{"id":"elastiseahclient","key":"elastiseahclient","value":{"rev":"3-c4e525605859e249f04fb07d31739002"}}, -{"id":"elementtree","key":"elementtree","value":{"rev":"3-ef2017fe67ae425253de911c2f219d31"}}, -{"id":"elf-logger","key":"elf-logger","value":{"rev":"6-98d61588cfc171611568cf86004aa2e1"}}, -{"id":"elk","key":"elk","value":{"rev":"25-8b92241d0218c6593a7dc8a8cc69b7ce"}}, -{"id":"elucidata-build-tools","key":"elucidata-build-tools","value":{"rev":"7-0ad3de708aaac2eebfcfce273bfe6edf"}}, -{"id":"email","key":"email","value":{"rev":"16-110ae6a99ab3e37f4edd9357c03d78c2"}}, -{"id":"email-verificationtoken","key":"email-verificationtoken","value":{"rev":"7-ef37672bc6e9ee806ecc22fd5257ae03"}}, -{"id":"emailjs","key":"emailjs","value":{"rev":"31-0dd24f9aba8d96e9493e55e8345f3d21"}}, -{"id":"embedly","key":"embedly","value":{"rev":"21-47838d8015e9b927c56a7bd52c52e4fc"}}, -{"id":"emile","key":"emile","value":{"rev":"11-05d4715964b5bf2e1fd98096cb7ccc83"}}, -{"id":"emit.io","key":"emit.io","value":{"rev":"3-faacb1c30bb92c06a55a44bb027a9475"}}, -{"id":"emre","key":"emre","value":{"rev":"3-5686f4782f1f5171fff83b662ce68802"}}, -{"id":"encrypt","key":"encrypt","value":{"rev":"3-77e2e2007b452f7fcdfa9e8696a188f5"}}, -{"id":"ender","key":"ender","value":{"rev":"95-89b8c6ccfcaf3eb56f5dbe48bf3c2e24"}}, -{"id":"ender-dragdealer","key":"ender-dragdealer","value":{"rev":"9-e12bb3492614f20fe5781f20e3bb17dc"}}, -{"id":"ender-fermata","key":"ender-fermata","value":{"rev":"3-e52d772042852408ae070b361c247068"}}, -{"id":"ender-fittext","key":"ender-fittext","value":{"rev":"5-e46f5a384d790ea6f65a5f8b9e43bac6"}}, -{"id":"ender-flowplayer","key":"ender-flowplayer","value":{"rev":"3-87267072fb566112315254fdf6547500"}}, -{"id":"ender-js","key":"ender-js","value":{"rev":"80-aa18576f782e3aa14c2ba7ba05658a30"}}, -{"id":"ender-json","key":"ender-json","value":{"rev":"3-5606608389aef832e4d4ecaa6c088a94"}}, -{"id":"ender-lettering","key":"ender-lettering","value":{"rev":"3-6fc6ad3869fad6374a1de69ba4e9301d"}}, -{"id":"ender-modules","key":"ender-modules","value":{"rev":"5-2bbb354d6219b5e13e6c897c562b8c83"}}, -{"id":"ender-poke","key":"ender-poke","value":{"rev":"5-3afa2fd690ebc4f2d75125b2c57e2a43"}}, -{"id":"ender-test","key":"ender-test","value":{"rev":"5-f8e90a951e5ad58199e53645067fad0c"}}, -{"id":"ender-tipsy","key":"ender-tipsy","value":{"rev":"5-cefd04c5d89707dfe31023702328d417"}}, -{"id":"ender-tween","key":"ender-tween","value":{"rev":"13-035312bb47bb3d29e7157932d4d29dcb"}}, -{"id":"ender-vows","key":"ender-vows","value":{"rev":"5-d48e088816d71779a80a74c43cd61b80"}}, -{"id":"ender-wallet","key":"ender-wallet","value":{"rev":"21-93723cd24fbf14d0f58f2ee41df9910d"}}, -{"id":"endtable","key":"endtable","value":{"rev":"36-8febf1be0120d867f9ff90e5c5058ef9"}}, -{"id":"enhance-css","key":"enhance-css","value":{"rev":"7-ae1cf6dee7d3116103781edaa7d47ba4"}}, -{"id":"ensure","key":"ensure","value":{"rev":"27-47e0874d1823188965a02a41abb61739"}}, -{"id":"ent","key":"ent","value":{"rev":"9-51924cd76fabcc4a244db66d65d48eff"}}, -{"id":"entropy","key":"entropy","value":{"rev":"17-84bfbbc0689b3b55e4fa3881888f0c12"}}, -{"id":"enumerable","key":"enumerable","value":{"rev":"3-d31bfcaca3b53eacc9ce09983efffe35"}}, -{"id":"envious","key":"envious","value":{"rev":"3-08d1e6d9c25c4e2350a0dd6759a27426"}}, -{"id":"environ","key":"environ","value":{"rev":"5-6f78def4743dfbeb77c1cb62d41eb671"}}, -{"id":"epub","key":"epub","value":{"rev":"3-5c3604eab851bce0a6ac66db6a6ce77a"}}, -{"id":"erlang","key":"erlang","value":{"rev":"3-3bd8e8e8ed416a32567475d984028b65"}}, -{"id":"err","key":"err","value":{"rev":"11-61d11f26b47d29ef819136214830f24c"}}, -{"id":"errbacker","key":"errbacker","value":{"rev":"5-0ad6d62207abb9822118ae69d0b9181d"}}, -{"id":"es5","key":"es5","value":{"rev":"3-5497cb0c821f3e17234c09ab0e67e1de"}}, -{"id":"es5-basic","key":"es5-basic","value":{"rev":"9-2ff708ae54ae223923cb810f799bfb2d"}}, -{"id":"es5-ext","key":"es5-ext","value":{"rev":"21-04537d704412a631596beeba4d534b33"}}, -{"id":"es5-shim","key":"es5-shim","value":{"rev":"34-3c4c40a6dab9ff137d1a7d4349d72c5b"}}, -{"id":"es5-shimify","key":"es5-shimify","value":{"rev":"3-f85700407e9c129d22b45c15700c82f1"}}, -{"id":"esc","key":"esc","value":{"rev":"5-42911775f391330f361105b8a0cefe47"}}, -{"id":"escaperoute","key":"escaperoute","value":{"rev":"18-e1372f35e6dcdb353b8c11e3c7e2f3b4"}}, -{"id":"escort","key":"escort","value":{"rev":"27-bf43341e15d565c9f67dd3300dc57734"}}, -{"id":"escrito","key":"escrito","value":{"rev":"5-c39d5b373486327b2e13670f921a2c7b"}}, -{"id":"esl","key":"esl","value":{"rev":"9-562ff6239a3b9910989bdf04746fa9d1"}}, -{"id":"espresso","key":"espresso","value":{"rev":"75-4c3692f1e92ea841e2d04338f4f2432e"}}, -{"id":"esproxy","key":"esproxy","value":{"rev":"7-be629dc6e1428f0fdb22fdbe7ab2ee99"}}, -{"id":"etch-a-sketch","key":"etch-a-sketch","value":{"rev":"3-a4e23b8e9f298d4844d6bff0a9688e53"}}, -{"id":"etherpad-lite-client","key":"etherpad-lite-client","value":{"rev":"55-58ca439a697db64ee66652da2d327fcb"}}, -{"id":"etsy","key":"etsy","value":{"rev":"5-1b795b360c28261f11c07d849637047c"}}, -{"id":"eve","key":"eve","value":{"rev":"3-16e72b336a1f354f4dfc8fa783fa2e72"}}, -{"id":"event-emitter","key":"event-emitter","value":{"rev":"5-15fe3e2e19b206929b815909737b15ac"}}, -{"id":"event-queue","key":"event-queue","value":{"rev":"12-200cd3bcd8e0b35bc4b15c1d8b6161e2"}}, -{"id":"event-stream","key":"event-stream","value":{"rev":"15-811a6329b5820d998731a604accf83db"}}, -{"id":"eventable","key":"eventable","value":{"rev":"3-08e9cd94a9aae280f406d043039e545e"}}, -{"id":"eventbrite","key":"eventbrite","value":{"rev":"13-cac3c9bda2da1c7b115de04264bb440f"}}, -{"id":"evented","key":"evented","value":{"rev":"6-ade6271c40a19aab6c4e3bb18b0987b6"}}, -{"id":"evented-twitter","key":"evented-twitter","value":{"rev":"6-3ebb7327022d6d6a8c49d684febb236b"}}, -{"id":"eventedsocket","key":"eventedsocket","value":{"rev":"59-cd2158c47b676a58ca3064a42c5274f7"}}, -{"id":"eventemitter","key":"eventemitter","value":{"rev":"5-7766fd7ebc44d52efbd0e7088e2321ec"}}, -{"id":"eventemitter2","key":"eventemitter2","value":{"rev":"41-927ce7996d4056a21f543e1f928f9699"}}, -{"id":"eventful","key":"eventful","value":{"rev":"7-9505f3c621f50addf02a457cfcc8ae78"}}, -{"id":"eventhub","key":"eventhub","value":{"rev":"15-5390d210a4d3ba079dd6e26bda652caa"}}, -{"id":"eventpipe","key":"eventpipe","value":{"rev":"7-41f0f93a9dcea477f08782af28e5b0f1"}}, -{"id":"events","key":"events","value":{"rev":"12-e3ead8eac62799cb299c139687135289"}}, -{"id":"events.io","key":"events.io","value":{"rev":"3-56c6955024cbb1765a1f9f37d8a739a4"}}, -{"id":"events.node","key":"events.node","value":{"rev":"3-e072f9c457fd8a3882ccd41ce52c5d00"}}, -{"id":"eventstream","key":"eventstream","value":{"rev":"5-a578a3a2a62d50631b3fb4d44a058bd1"}}, -{"id":"eventvat","key":"eventvat","value":{"rev":"3-e26d7fe8a226c7bc7f9e55abf1630e9c"}}, -{"id":"everyauth","key":"everyauth","value":{"rev":"107-a621f3028a230f9f3ade6a4e729a9a38"}}, -{"id":"ewdDOM","key":"ewdDOM","value":{"rev":"7-28188ec27fe011bf7fcb330a5fc90b55"}}, -{"id":"ewdGateway","key":"ewdGateway","value":{"rev":"7-81fe5ec1a3e920894b560fbf96160258"}}, -{"id":"exceptional","key":"exceptional","value":{"rev":"5-5842d306b2cf084c4e7c2ecb1d715280"}}, -{"id":"exceptional-node","key":"exceptional-node","value":{"rev":"5-3385b42af0a6ea8a943cb686d5789b0c"}}, -{"id":"executor","key":"executor","value":{"rev":"3-aee4f949a4d140a439965e137200c4fb"}}, -{"id":"exif","key":"exif","value":{"rev":"3-da6fd2bd837633f673b325231c164a0f"}}, -{"id":"expanda","key":"expanda","value":{"rev":"3-dcbc59c5db0017d25748ec8094aeeb0a"}}, -{"id":"express","key":"express","value":{"rev":"157-24ef0cdd4ba6c6697c66f3e78bc777bb"}}, -{"id":"express-aid","key":"express-aid","value":{"rev":"21-6d3831e93b823f800e6a22eb08aa41d6"}}, -{"id":"express-app-bootstrap","key":"express-app-bootstrap","value":{"rev":"3-4b5a256bef5ca3bd41b0958f594907b9"}}, -{"id":"express-asset","key":"express-asset","value":{"rev":"3-7d5e23bc753851c576e429e7901301d9"}}, -{"id":"express-blocks","key":"express-blocks","value":{"rev":"7-305b6e046355c8e7a4bb0f1f225092ef"}}, -{"id":"express-cache","key":"express-cache","value":{"rev":"5-eebbea6c0e5db5fd4c12847933c853e1"}}, -{"id":"express-chromeframe","key":"express-chromeframe","value":{"rev":"5-1bb72d30b7a1f00d3eaf248285942d5e"}}, -{"id":"express-coffee","key":"express-coffee","value":{"rev":"39-14eff195c9352c6c3898befb3d613807"}}, -{"id":"express-config","key":"express-config","value":{"rev":"3-27ea0d27e20afa9ece375878aab846ed"}}, -{"id":"express-configure","key":"express-configure","value":{"rev":"7-46bd636c0b56dfcfa4f1ee46b43d6ca0"}}, -{"id":"express-contrib","key":"express-contrib","value":{"rev":"20-472c93fefe0a9a6440a76b2c843b2e0e"}}, -{"id":"express-controllers","key":"express-controllers","value":{"rev":"3-296d54f3b5bf26bfa057cd8c5f0a11ea"}}, -{"id":"express-controllers-new","key":"express-controllers-new","value":{"rev":"15-11f73e4a8ab935987a3b8f132d80afa5"}}, -{"id":"express-cross-site","key":"express-cross-site","value":{"rev":"11-b76814fdd58a616b3cafe6e97f3c7c98"}}, -{"id":"express-csrf","key":"express-csrf","value":{"rev":"20-2a79f0fdc65ed91120e7417a5cf8ce6c"}}, -{"id":"express-custom-errors","key":"express-custom-errors","value":{"rev":"6-bd131169ccac73fa3766195147e34404"}}, -{"id":"express-dialect","key":"express-dialect","value":{"rev":"34-1fbc5baf7ea464abbadcfaf3c1971660"}}, -{"id":"express-dust","key":"express-dust","value":{"rev":"5-33a1d8dd9c113d6fb8f1818c8a749c1b"}}, -{"id":"express-expose","key":"express-expose","value":{"rev":"7-f8757d8bf8d3fac8395ee8ce5117a895"}}, -{"id":"express-extras","key":"express-extras","value":{"rev":"6-53c7bfc68a41043eb5e11321673a2c48"}}, -{"id":"express-form","key":"express-form","value":{"rev":"27-533598a1bd5a0e9b8d694f5b38228c6c"}}, -{"id":"express-helpers","key":"express-helpers","value":{"rev":"3-7b9123b0ea6b840bb5a6e4da9c28308c"}}, -{"id":"express-livejade","key":"express-livejade","value":{"rev":"9-1320996d4ed3db352a2c853226880a17"}}, -{"id":"express-logger","key":"express-logger","value":{"rev":"5-c485b1020742310a313cac87abdde67b"}}, -{"id":"express-messages","key":"express-messages","value":{"rev":"5-f6225b906d0ac33ba1bfc5409b227edb"}}, -{"id":"express-messages-bootstrap","key":"express-messages-bootstrap","value":{"rev":"5-fb8fc70c1cbd6df0e07b2e0148bdf8bf"}}, -{"id":"express-mongoose","key":"express-mongoose","value":{"rev":"29-2d6907a23c8c3bbfdf9b6f9b6b3c00e3"}}, -{"id":"express-mvc-bootstrap","key":"express-mvc-bootstrap","value":{"rev":"15-c53ecb696af1d34ff94efe5ab5d89287"}}, -{"id":"express-namespace","key":"express-namespace","value":{"rev":"7-d209feb707821b06426aed233295df75"}}, -{"id":"express-on-railway","key":"express-on-railway","value":{"rev":"7-784b533cbf29930d04039bafb2c03cc0"}}, -{"id":"express-params","key":"express-params","value":{"rev":"3-13f0ed9c17d10fd01d1ff869e625c91f"}}, -{"id":"express-resource","key":"express-resource","value":{"rev":"13-cca556327152588a87112c6bf2613bc9"}}, -{"id":"express-rewrite","key":"express-rewrite","value":{"rev":"7-c76ca2616eb6e70209ace6499f5b961a"}}, -{"id":"express-route-util","key":"express-route-util","value":{"rev":"9-4b7bad7e8ab3bf71daf85362b47ec8be"}}, -{"id":"express-rpx","key":"express-rpx","value":{"rev":"9-54d48f5e24174500c73f07d97a7d3f9f"}}, -{"id":"express-session-mongo","key":"express-session-mongo","value":{"rev":"3-850cf5b42f65a6f27af6edf1ad1aa966"}}, -{"id":"express-session-mongo-russp","key":"express-session-mongo-russp","value":{"rev":"7-441e8afcd466a4cbb5e65a1949190f97"}}, -{"id":"express-session-redis","key":"express-session-redis","value":{"rev":"6-5f4f16092a0706d2daef89470d6971e6"}}, -{"id":"express-share","key":"express-share","value":{"rev":"5-f5327a97738e9c8e6e05a51cb7153f82"}}, -{"id":"express-spdy","key":"express-spdy","value":{"rev":"11-2634f388338c45b2d6f020d2a6739ba1"}}, -{"id":"express-template-override","key":"express-template-override","value":{"rev":"5-758cf2eb0c9cbc32f205c4ba2ece24f9"}}, -{"id":"express-trace","key":"express-trace","value":{"rev":"5-ba59571f8881e02e2b297ed9ffb4e48c"}}, -{"id":"express-unstable","key":"express-unstable","value":{"rev":"3-06467336e1610ba9915401df26c936c1"}}, -{"id":"express-validate","key":"express-validate","value":{"rev":"15-b63bd9b18fadfc2345d0a10a7a2fb2e7"}}, -{"id":"express-view-helpers","key":"express-view-helpers","value":{"rev":"7-4d07ba11f81788783c6f9fd48fdf8834"}}, -{"id":"express-with-ease","key":"express-with-ease","value":{"rev":"3-604d9176a4a03f9f7c74679604c7bbf9"}}, -{"id":"express-wormhole","key":"express-wormhole","value":{"rev":"3-7e06cf63b070e0f54b2aa71b48db9a40"}}, -{"id":"expresso","key":"expresso","value":{"rev":"79-a27b6ef2f9e7bb9f85da34f728d124a8"}}, -{"id":"expressobdd","key":"expressobdd","value":{"rev":"5-e8cae7a17a9e8c1779c08abedc674e03"}}, -{"id":"ext","key":"ext","value":{"rev":"6-8790c06324c5f057b1713ba420e8bf27"}}, -{"id":"extend","key":"extend","value":{"rev":"3-934d0de77bbaefb1b52ec18a17f46d7d"}}, -{"id":"extendables","key":"extendables","value":{"rev":"11-e4db9b62a4047e95fb4d7f88e351a14e"}}, -{"id":"extjs-node","key":"extjs-node","value":{"rev":"3-2b2033dbbf0b99d41e876498886b0995"}}, -{"id":"extractcontent","key":"extractcontent","value":{"rev":"6-ad70764c834ecd3414cbc15dbda317c3"}}, -{"id":"extractor","key":"extractor","value":{"rev":"9-f95bde04bb8db37350c9cc95c5578c03"}}, -{"id":"extx-layout","key":"extx-layout","value":{"rev":"3-f6bbc3a923ebce17f62cbf382b096ac7"}}, -{"id":"extx-reference-slot","key":"extx-reference-slot","value":{"rev":"14-b1b92573492f7239144693ee9e1d1aac"}}, -{"id":"extx-shotenjin","key":"extx-shotenjin","value":{"rev":"5-c641121ba57fb960d8db766511ecf6cd"}}, -{"id":"eyes","key":"eyes","value":{"rev":"16-fab6b201646fb12986e396c33a7cd428"}}, -{"id":"f","key":"f","value":{"rev":"3-23b73ffafbe5b56b6a0736db6a7256a6"}}, -{"id":"f-core","key":"f-core","value":{"rev":"3-9a6898e007acf48d956f0a70ff07a273"}}, -{"id":"f7u12rl","key":"f7u12rl","value":{"rev":"3-7b5e15d106db8b7f8784b27f7d2c9bdc"}}, -{"id":"fab","key":"fab","value":{"rev":"10-149dec0b653ce481af013c63fec125e8"}}, -{"id":"fab.accept","key":"fab.accept","value":{"rev":"6-d6b08e7054d823906c6c64c92b008d3a"}}, -{"id":"fab.static","key":"fab.static","value":{"rev":"6-5bdb6db53223bb5203ba91a5b2b87566"}}, -{"id":"fabric","key":"fabric","value":{"rev":"15-30e99e486c58962c049bea54e00b7cb9"}}, -{"id":"face-detect","key":"face-detect","value":{"rev":"3-d4d3f1a894c807f79ba541d2f2ed630d"}}, -{"id":"facebook","key":"facebook","value":{"rev":"17-e241999000e34aed62ee0f9f358bfd06"}}, -{"id":"facebook-api","key":"facebook-api","value":{"rev":"5-cb9d07b2eba18d8fb960768d69f80326"}}, -{"id":"facebook-client","key":"facebook-client","value":{"rev":"17-84c106420b183ca791b0c80fd8c3fe00"}}, -{"id":"facebook-connect","key":"facebook-connect","value":{"rev":"6-471f28bb12928e32610d02c0b03aa972"}}, -{"id":"facebook-express","key":"facebook-express","value":{"rev":"11-6e6d98b8252907b05c41aac7e0418f4e"}}, -{"id":"facebook-graph","key":"facebook-graph","value":{"rev":"9-c92149825fef42ad76bcffdd232cc9a5"}}, -{"id":"facebook-graph-client","key":"facebook-graph-client","value":{"rev":"10-c3136a2b2e5c5d80b78404a4102af7b5"}}, -{"id":"facebook-js","key":"facebook-js","value":{"rev":"22-dd9d916550ebccb71e451acbd7a4b315"}}, -{"id":"facebook-realtime-graph","key":"facebook-realtime-graph","value":{"rev":"6-c4fe01ac036585394cd59f01c6fc7df1"}}, -{"id":"facebook-sdk","key":"facebook-sdk","value":{"rev":"21-77daf7eba51bb913e54381995718e13d"}}, -{"id":"facebook-session-cookie","key":"facebook-session-cookie","value":{"rev":"9-70e14cac759dacadacb0af17387ab230"}}, -{"id":"facebook-signed-request","key":"facebook-signed-request","value":{"rev":"5-11cb36123a94e37fff6a7efd6f7d88b9"}}, -{"id":"facebook.node","key":"facebook.node","value":{"rev":"3-f6760795e71c1d5734ae34f9288d02be"}}, -{"id":"factory-worker","key":"factory-worker","value":{"rev":"7-1c365b3dd92b12573d00c08b090e01ae"}}, -{"id":"fake","key":"fake","value":{"rev":"25-2d1ae2299168d95edb8d115fb7961c8e"}}, -{"id":"fake-queue","key":"fake-queue","value":{"rev":"7-d6970de6141c1345c6ad3cd1586cfe7b"}}, -{"id":"fakedb","key":"fakedb","value":{"rev":"34-889fb5c9fa328b536f9deb138ff125b1"}}, -{"id":"fakeweb","key":"fakeweb","value":{"rev":"3-7fb1394b4bac70f9ab26e60b1864b41f"}}, -{"id":"fanfeedr","key":"fanfeedr","value":{"rev":"22-de3d485ad60c8642eda260afe5620973"}}, -{"id":"fantomex","key":"fantomex","value":{"rev":"3-79b26bcf9aa365485ed8131c474bf6f8"}}, -{"id":"far","key":"far","value":{"rev":"19-c8d9f1e8bc12a31cb27bef3ed44759ce"}}, -{"id":"farm","key":"farm","value":{"rev":"31-ab77f7f48b24bf6f0388b926d2ac370b"}}, -{"id":"fast-detective","key":"fast-detective","value":{"rev":"5-b0b6c8901458f3f07044d4266db0aa52"}}, -{"id":"fast-msgpack-rpc","key":"fast-msgpack-rpc","value":{"rev":"7-b2dfd3d331459382fe1e8166288ffef6"}}, -{"id":"fast-or-slow","key":"fast-or-slow","value":{"rev":"13-4118190cd6a0185af8ea9b381ee2bc98"}}, -{"id":"fast-stats","key":"fast-stats","value":{"rev":"3-15cdd56d9efa38f08ff20ca731867d4d"}}, -{"id":"fastcgi-stream","key":"fastcgi-stream","value":{"rev":"5-99c0c4dfc7a874e1af71e5ef3ac95ba4"}}, -{"id":"faye","key":"faye","value":{"rev":"30-49b7d05534c35527972a4d5e07ac8895"}}, -{"id":"faye-service","key":"faye-service","value":{"rev":"3-bad8bf6722461627eac7d0141e09b3f7"}}, -{"id":"fe-fu","key":"fe-fu","value":{"rev":"21-f3cb04870621ce40da8ffa009686bdeb"}}, -{"id":"feed-tables","key":"feed-tables","value":{"rev":"9-4410bad138f4df570e7be37bb17209b3"}}, -{"id":"feedBum","key":"feedBum","value":{"rev":"3-b4ff9edffb0c5c33c4ed40f60a12611a"}}, -{"id":"feedparser","key":"feedparser","value":{"rev":"5-eb2c32e00832ed7036eb1b87d2eea33e"}}, -{"id":"feral","key":"feral","value":{"rev":"19-0b512b6301a26ca5502710254bd5a9ba"}}, -{"id":"fermata","key":"fermata","value":{"rev":"25-eeafa3e5b769a38b8a1065c0a66e0653"}}, -{"id":"ferret","key":"ferret","value":{"rev":"9-7ab6b29cb0cad9855d927855c2a27bff"}}, -{"id":"ffmpeg-node","key":"ffmpeg-node","value":{"rev":"3-e55011ecb147f599475a12b10724a583"}}, -{"id":"ffmpeg2theora","key":"ffmpeg2theora","value":{"rev":"13-05d2f83dbbb90e832176ebb7fdc2ae2e"}}, -{"id":"fiberize","key":"fiberize","value":{"rev":"5-dfb978d6b88db702f68a13e363fb21af"}}, -{"id":"fibers","key":"fibers","value":{"rev":"71-4b22dbb449839723ed9b0d533339c764"}}, -{"id":"fibers-promise","key":"fibers-promise","value":{"rev":"9-3a9977528f8df079969d4ae48db7a0a7"}}, -{"id":"fidel","key":"fidel","value":{"rev":"37-370838ed9984cfe6807114b5fef789e6"}}, -{"id":"fig","key":"fig","value":{"rev":"7-24acf90e7d06dc8b83adb02b5776de3c"}}, -{"id":"file","key":"file","value":{"rev":"6-1131008db6855f20969413be7cc2e968"}}, -{"id":"file-api","key":"file-api","value":{"rev":"9-a9cc8f3de14eef5bba86a80f6705651c"}}, -{"id":"fileify","key":"fileify","value":{"rev":"17-50603c037d5e3a0a405ff4af3e71211f"}}, -{"id":"filepad","key":"filepad","value":{"rev":"23-8c4b2c04151723033523369c42144cc9"}}, -{"id":"filerepl","key":"filerepl","value":{"rev":"5-94999cc91621e08f96ded7423ed6d6f0"}}, -{"id":"fileset","key":"fileset","value":{"rev":"3-ea6a9f45aaa5e65279463041ee629dbe"}}, -{"id":"filestore","key":"filestore","value":{"rev":"9-6cce7c9cd2b2b11d12905885933ad25a"}}, -{"id":"filesystem-composer","key":"filesystem-composer","value":{"rev":"34-f1d04d711909f3683c1d00cd4ab7ca47"}}, -{"id":"fileutils","key":"fileutils","value":{"rev":"3-88876b61c9d0a915f95ce0f258e5ce51"}}, -{"id":"filter","key":"filter","value":{"rev":"3-4032087a5cf2de3dd164c95454a2ab05"}}, -{"id":"filter-chain","key":"filter-chain","value":{"rev":"5-c522429dc83ccc7dde4eaf5409070332"}}, -{"id":"fin","key":"fin","value":{"rev":"23-77cf12e84eb62958b40aa08fdcbb259d"}}, -{"id":"fin-id","key":"fin-id","value":{"rev":"3-9f85ee1e426d4bdad5904002a6d9342c"}}, -{"id":"finance","key":"finance","value":{"rev":"3-cf97ddb6af3f6601bfb1e49a600f56af"}}, -{"id":"finder","key":"finder","value":{"rev":"13-65767fe51799a397ddd9b348ead12ed2"}}, -{"id":"findit","key":"findit","value":{"rev":"15-435e4168208548a2853f6efcd4529de3"}}, -{"id":"fingerprint","key":"fingerprint","value":{"rev":"3-c40e2169260010cac472e688c392ea3d"}}, -{"id":"finjector","key":"finjector","value":{"rev":"5-646da199b0b336d20e421ef6ad613e90"}}, -{"id":"firebird","key":"firebird","value":{"rev":"5-7e7ec03bc00e562f5f7afc7cad76da77"}}, -{"id":"firmata","key":"firmata","value":{"rev":"20-f3cbde43ce2677a208bcf3599af5b670"}}, -{"id":"first","key":"first","value":{"rev":"3-c647f6fc1353a1c7b49f5e6cd1905b1e"}}, -{"id":"fishback","key":"fishback","value":{"rev":"19-27a0fdc8c3abe4d61fff9c7a098f3fd9"}}, -{"id":"fitbit-js","key":"fitbit-js","value":{"rev":"3-62fe0869ddefd2949d8c1e568f994c93"}}, -{"id":"fix","key":"fix","value":{"rev":"17-4a79db9924922da010df71e5194bcac6"}}, -{"id":"flagpoll","key":"flagpoll","value":{"rev":"3-0eb7b98e2a0061233aa5228eb7348dff"}}, -{"id":"flags","key":"flags","value":{"rev":"3-594f0ec2e903ac74556d1c1f7c6cca3b"}}, -{"id":"flexcache","key":"flexcache","value":{"rev":"11-e1e4eeaa0793d95056a857bec04282ae"}}, -{"id":"flickr-conduit","key":"flickr-conduit","value":{"rev":"7-d3b2b610171589db68809c3ec3bf2bcb"}}, -{"id":"flickr-js","key":"flickr-js","value":{"rev":"5-66c8e8a00ad0a906f632ff99cf490163"}}, -{"id":"flickr-reflection","key":"flickr-reflection","value":{"rev":"6-3c34c3ac904b6d6f26182807fbb95c5e"}}, -{"id":"flo","key":"flo","value":{"rev":"3-ce440035f0ec9a10575b1c8fab0c77da"}}, -{"id":"flow","key":"flow","value":{"rev":"6-95841a07c96f664d49d1af35373b3dbc"}}, -{"id":"flowcontrol","key":"flowcontrol","value":{"rev":"3-093bbbc7496072d9ecb136a826680366"}}, -{"id":"flowjs","key":"flowjs","value":{"rev":"3-403fc9e107ec70fe06236c27e70451c7"}}, -{"id":"fluent-ffmpeg","key":"fluent-ffmpeg","value":{"rev":"33-5982779d5f55a5915f0f8b0353f1fe2a"}}, -{"id":"flume-rpc","key":"flume-rpc","value":{"rev":"7-4214a2db407a3e64f036facbdd34df91"}}, -{"id":"flux","key":"flux","value":{"rev":"3-1ad83106af7ee83547c797246bd2c8b1"}}, -{"id":"fly","key":"fly","value":{"rev":"9-0a45b1b97f56ba0faf4af4777b473fad"}}, -{"id":"fn","key":"fn","value":{"rev":"5-110bab5d623b3628e413d972e040ed26"}}, -{"id":"fnProxy","key":"fnProxy","value":{"rev":"3-db1c90e5a06992ed290c679ac6dbff6a"}}, -{"id":"follow","key":"follow","value":{"rev":"3-44256c802b4576fcbae1264e9b824e6a"}}, -{"id":"fomatto","key":"fomatto","value":{"rev":"7-31ce5c9eba7f084ccab2dc5994796f2d"}}, -{"id":"foounit","key":"foounit","value":{"rev":"20-caf9cd90d6c94d19be0b3a9c9cb33ee0"}}, -{"id":"forEachAsync","key":"forEachAsync","value":{"rev":"3-d9cd8021ea9d5014583327752a9d01c4"}}, -{"id":"forever","key":"forever","value":{"rev":"99-90060d5d1754b1bf749e5278a2a4516b"}}, -{"id":"forge","key":"forge","value":{"rev":"9-0d9d59fd2d47a804e600aaef538ebbbf"}}, -{"id":"fork","key":"fork","value":{"rev":"13-f355105e07608de5ae2f3e7c0817af52"}}, -{"id":"forker","key":"forker","value":{"rev":"11-9717e2e3fa60b46df08261d936d9e5d7"}}, -{"id":"form-data","key":"form-data","value":{"rev":"3-5750e73f7a0902ec2fafee1db6d2e6f6"}}, -{"id":"form-validator","key":"form-validator","value":{"rev":"25-7d016b35895dc58ffd0bbe54fd9be241"}}, -{"id":"form2json","key":"form2json","value":{"rev":"8-7501dd9b43b9fbb7194b94e647816e5e"}}, -{"id":"formaline","key":"formaline","value":{"rev":"3-2d45fbb3e83b7e77bde0456607e6f1e3"}}, -{"id":"format","key":"format","value":{"rev":"7-5dddc67c10de521ef06a7a07bb3f7e2e"}}, -{"id":"formatdate","key":"formatdate","value":{"rev":"3-6d522e3196fe3b438fcc4aed0f7cf690"}}, -{"id":"formidable","key":"formidable","value":{"rev":"87-d27408b00793fee36f6632a895372590"}}, -{"id":"forms","key":"forms","value":{"rev":"6-253e032f07979b79c2e7dfa01be085dc"}}, -{"id":"forrst","key":"forrst","value":{"rev":"3-ef553ff1b6383bab0f81f062cdebac53"}}, -{"id":"fortumo","key":"fortumo","value":{"rev":"6-def3d146b29b6104019c513ce20bb61f"}}, -{"id":"foss-credits","key":"foss-credits","value":{"rev":"3-c824326e289e093406b2de4efef70cb7"}}, -{"id":"foss-credits-collection","key":"foss-credits-collection","value":{"rev":"17-de4ffca51768a36c8fb1b9c2bc66c80f"}}, -{"id":"foursquareonnode","key":"foursquareonnode","value":{"rev":"5-a4f0a1ed5d3be3056f10f0e9517efa83"}}, -{"id":"fraggle","key":"fraggle","value":{"rev":"7-b9383baf96bcdbd4022b4b887e4a3729"}}, -{"id":"framework","key":"framework","value":{"rev":"3-afb19a9598a0d50320b4f1faab1ae2c6"}}, -{"id":"frameworkjs","key":"frameworkjs","value":{"rev":"7-cd418da3272c1e8349126e442ed15dbd"}}, -{"id":"frank","key":"frank","value":{"rev":"12-98031fb56f1c89dfc7888f5d8ca7f0a9"}}, -{"id":"freakset","key":"freakset","value":{"rev":"21-ba60d0840bfa3da2c8713c3c2e6856a0"}}, -{"id":"freckle","key":"freckle","value":{"rev":"3-8e2e9a07b2650fbbd0a598b948ef993b"}}, -{"id":"freebase","key":"freebase","value":{"rev":"7-a1daf1cc2259b886f574f5c902eebcf4"}}, -{"id":"freecontrol","key":"freecontrol","value":{"rev":"6-7a51776b8764f406573d5192bab36adf"}}, -{"id":"freestyle","key":"freestyle","value":{"rev":"9-100f9e9d3504d6e1c6a2d47651c70f51"}}, -{"id":"frenchpress","key":"frenchpress","value":{"rev":"9-306d6ac21837879b8040d7f9aa69fc20"}}, -{"id":"fs-boot","key":"fs-boot","value":{"rev":"20-72b44b403767aa486bf1dc987c750733"}}, -{"id":"fs-ext","key":"fs-ext","value":{"rev":"10-3360831c3852590a762f8f82525c025e"}}, -{"id":"fsevents","key":"fsevents","value":{"rev":"6-bb994f41842e144cf43249fdf6bf51e1"}}, -{"id":"fsext","key":"fsext","value":{"rev":"9-a1507d84e91ddf26ffaa76016253b4fe"}}, -{"id":"fsh","key":"fsh","value":{"rev":"5-1e3784b2df1c1a28b81f27907945f48b"}}, -{"id":"fsm","key":"fsm","value":{"rev":"5-b113be7b30b2a2c9089edcb6fa4c15d3"}}, -{"id":"fswatch","key":"fswatch","value":{"rev":"11-287eea565c9562161eb8969d765bb191"}}, -{"id":"ftp","key":"ftp","value":{"rev":"5-751e312520c29e76f7d79c648248c56c"}}, -{"id":"ftp-get","key":"ftp-get","value":{"rev":"27-1e908bd075a0743dbb1d30eff06485e2"}}, -{"id":"fugue","key":"fugue","value":{"rev":"81-0c08e67e8deb4b5b677fe19f8362dbd8"}}, -{"id":"fullauto","key":"fullauto","value":{"rev":"9-ef915156026dabded5a4a76c5a751916"}}, -{"id":"fun","key":"fun","value":{"rev":"12-8396e3583e206dbf90bbea4316976f66"}}, -{"id":"functional","key":"functional","value":{"rev":"5-955979028270f5d3749bdf86b4d2c925"}}, -{"id":"functools","key":"functools","value":{"rev":"5-42ba84ce365bf8c0aaf3e5e6c369920b"}}, -{"id":"funk","key":"funk","value":{"rev":"14-67440a9b2118d8f44358bf3b17590243"}}, -{"id":"fusion","key":"fusion","value":{"rev":"19-64983fc6e5496c836be26e5fbc8527d1"}}, -{"id":"fusker","key":"fusker","value":{"rev":"48-58f05561c65ad288a78fa7210f146ba1"}}, -{"id":"future","key":"future","value":{"rev":"3-0ca60d8ae330e40ef6cf8c17a421d668"}}, -{"id":"futures","key":"futures","value":{"rev":"44-8a2aaf0f40cf84c9475824d9cec006ad"}}, -{"id":"fuzzy_file_finder","key":"fuzzy_file_finder","value":{"rev":"8-ee555aae1d433e60166d2af1d72ac6b9"}}, -{"id":"fuzzylogic","key":"fuzzylogic","value":{"rev":"8-596a8f4744d1dabcb8eb6466d9980fca"}}, -{"id":"fxs","key":"fxs","value":{"rev":"3-d3cb81151b0ddd9a4a5934fb63ffff75"}}, -{"id":"g","key":"g","value":{"rev":"3-55742a045425a9b4c9fe0e8925fad048"}}, -{"id":"g.raphael","key":"g.raphael","value":{"rev":"4-190d0235dc08f783dda77b3ecb60b11a"}}, -{"id":"ga","key":"ga","value":{"rev":"3-c47d516ac5e6de8ef7ef9d16fabcf6c7"}}, -{"id":"galletita","key":"galletita","value":{"rev":"3-aa7a01c3362a01794f36e7aa9664b850"}}, -{"id":"game","key":"game","value":{"rev":"3-0f1539e4717a2780205d98ef6ec0886d"}}, -{"id":"gamina","key":"gamina","value":{"rev":"15-871f4970f1e87b7c8ad361456001c76f"}}, -{"id":"gang-bang","key":"gang-bang","value":{"rev":"6-f565cb7027a8ca109481df49a6d41114"}}, -{"id":"gapserver","key":"gapserver","value":{"rev":"9-b25eb0eefc21e407cba596a0946cb3a0"}}, -{"id":"garbage","key":"garbage","value":{"rev":"3-80f4097d5f1f2c75f509430a11c8a15e"}}, -{"id":"gaseous","key":"gaseous","value":{"rev":"3-8021582ab9dde42d235193e6067be72d"}}, -{"id":"gaudium","key":"gaudium","value":{"rev":"11-7d612f1c5d921180ccf1c162fe2c7446"}}, -{"id":"gauss","key":"gauss","value":{"rev":"3-8fd18b2d7a223372f190797e4270a535"}}, -{"id":"gcli","key":"gcli","value":{"rev":"3-210404347cc643e924cec678d0195099"}}, -{"id":"gcw2html","key":"gcw2html","value":{"rev":"3-2aff7bff7981f2f9800c5f65812aa0a6"}}, -{"id":"gd","key":"gd","value":{"rev":"4-ac5a662e709a2993ed1fd1cbf7c4d7b4"}}, -{"id":"gdata","key":"gdata","value":{"rev":"3-c6b3a95064a1e1e0bb74f248ab4e73c4"}}, -{"id":"gdata-js","key":"gdata-js","value":{"rev":"17-0959500a4000d7058d8116af1e01b0d9"}}, -{"id":"gearman","key":"gearman","value":{"rev":"8-ac9fb7af75421ca2988d6098dbfd4c7c"}}, -{"id":"gearnode","key":"gearnode","value":{"rev":"7-8e40ec257984e887e2ff5948a6dde04e"}}, -{"id":"geck","key":"geck","value":{"rev":"161-c8117106ef58a6d7d21920df80159eab"}}, -{"id":"geddy","key":"geddy","value":{"rev":"13-da16f903aca1ec1f47086fa250b58abb"}}, -{"id":"gen","key":"gen","value":{"rev":"3-849005c8b8294c2a811ff4eccdedf436"}}, -{"id":"generic-function","key":"generic-function","value":{"rev":"5-dc046f58f96119225efb17ea5334a60f"}}, -{"id":"generic-pool","key":"generic-pool","value":{"rev":"18-65ff988620293fe7ffbd0891745c3ded"}}, -{"id":"genji","key":"genji","value":{"rev":"49-4c72bcaa57572ad0d43a1b7e9e5a963a"}}, -{"id":"genstatic","key":"genstatic","value":{"rev":"19-4278d0766226af4db924bb0f6b127699"}}, -{"id":"gently","key":"gently","value":{"rev":"24-c9a3ba6b6fd183ee1b5dda569122e978"}}, -{"id":"genx","key":"genx","value":{"rev":"7-f0c0ff65e08e045e8dd1bfcb25ca48d4"}}, -{"id":"geo","key":"geo","value":{"rev":"7-fa2a79f7260b849c277735503a8622e9"}}, -{"id":"geo-distance","key":"geo-distance","value":{"rev":"7-819a30e9b4776e4416fe9510ca79cd93"}}, -{"id":"geocoder","key":"geocoder","value":{"rev":"15-736e627571ad8dba3a9d0da1ae019c35"}}, -{"id":"geohash","key":"geohash","value":{"rev":"6-b9e62c804abe565425a8e6a01354407a"}}, -{"id":"geoip","key":"geoip","value":{"rev":"231-e5aa7acd5fb44833a67f96476b4fac49"}}, -{"id":"geoip-lite","key":"geoip-lite","value":{"rev":"9-efd916135c056406ede1ad0fe15534fa"}}, -{"id":"geojs","key":"geojs","value":{"rev":"35-b0f97b7c72397d6eb714602dc1121183"}}, -{"id":"geolib","key":"geolib","value":{"rev":"3-923a8622d1bd97c22f71ed6537ba5062"}}, -{"id":"geonode","key":"geonode","value":{"rev":"35-c2060653af72123f2f9994fca1c86d70"}}, -{"id":"geoutils","key":"geoutils","value":{"rev":"6-2df101fcbb01849533b2fbc80dc0eb7a"}}, -{"id":"gerbil","key":"gerbil","value":{"rev":"3-b5961044bda490a34085ca826aeb3022"}}, -{"id":"gerenuk","key":"gerenuk","value":{"rev":"13-4e45a640bcbadc3112e105ec5b60b907"}}, -{"id":"get","key":"get","value":{"rev":"18-dd215d673f19bbd8b321a7dd63e004e8"}}, -{"id":"getopt","key":"getopt","value":{"rev":"3-454354e4557d5e7205410acc95c9baae"}}, -{"id":"getrusage","key":"getrusage","value":{"rev":"8-d6ef24793b8e4c46f3cdd14937cbabe1"}}, -{"id":"gettext","key":"gettext","value":{"rev":"3-4c12268a4cab64ec4ef3ac8c9ec7912b"}}, -{"id":"getz","key":"getz","value":{"rev":"9-f3f43934139c9af6ddfb8b91e9a121ba"}}, -{"id":"gevorg.me","key":"gevorg.me","value":{"rev":"33-700502b8ca7041bf8d29368069cac365"}}, -{"id":"gex","key":"gex","value":{"rev":"3-105824d7a3f9c2ac7313f284c3f81d22"}}, -{"id":"gexode","key":"gexode","value":{"rev":"3-4a3552eae4ff3ba4443f9371a1ab4b2e"}}, -{"id":"gfx","key":"gfx","value":{"rev":"8-1f6c90bc3819c3b237e8d1f28ad1b136"}}, -{"id":"gherkin","key":"gherkin","value":{"rev":"77-6e835c8107bb4c7c8ad1fa072ac12c20"}}, -{"id":"ghm","key":"ghm","value":{"rev":"3-c440ae39832a575087ff1920b33c275b"}}, -{"id":"gif","key":"gif","value":{"rev":"14-e65638621d05b99ffe71b18097f29134"}}, -{"id":"gimme","key":"gimme","value":{"rev":"7-caab8354fe257fc307f8597e34ede547"}}, -{"id":"gist","key":"gist","value":{"rev":"11-eea7ea1adf3cde3a0804d2e1b0d6f7d6"}}, -{"id":"gista","key":"gista","value":{"rev":"23-48b8c374cfb8fc4e8310f3469cead6d5"}}, -{"id":"gisty","key":"gisty","value":{"rev":"5-1a898d0816f4129ab9a0d3f03ff9feb4"}}, -{"id":"git","key":"git","value":{"rev":"39-1f77df3ebeec9aae47ae8df56de6757f"}}, -{"id":"git-fs","key":"git-fs","value":{"rev":"14-7d365cddff5029a9d11fa8778a7296d2"}}, -{"id":"gitProvider","key":"gitProvider","value":{"rev":"9-c704ae702ef27bb57c0efd279a464e28"}}, -{"id":"github","key":"github","value":{"rev":"16-9345138ca7507c12be4a817b1abfeef6"}}, -{"id":"github-flavored-markdown","key":"github-flavored-markdown","value":{"rev":"3-f12043eb2969aff51db742b13d329446"}}, -{"id":"gitteh","key":"gitteh","value":{"rev":"39-88b00491fd4ce3294b8cdf61b9708383"}}, -{"id":"gitter","key":"gitter","value":{"rev":"16-88d7ef1ab6a7e751ca2cf6b50894deb4"}}, -{"id":"gittyup","key":"gittyup","value":{"rev":"37-ed6030c1acdd8b989ac34cd10d6dfd1e"}}, -{"id":"gitweb","key":"gitweb","value":{"rev":"9-5331e94c6df9ee7724cde3738a0c6230"}}, -{"id":"gitwiki","key":"gitwiki","value":{"rev":"9-0f167a3a87bce7f3e941136a06e91810"}}, -{"id":"gizmo","key":"gizmo","value":{"rev":"5-1da4da8d66690457c0bf743473b755f6"}}, -{"id":"gleak","key":"gleak","value":{"rev":"17-d44a968b32e4fdc7d27bacb146391422"}}, -{"id":"glob","key":"glob","value":{"rev":"203-4a79e232cf6684a48ccb9134a6ce938c"}}, -{"id":"glob-trie.js","key":"glob-trie.js","value":{"rev":"7-bff534e3aba8f6333fa5ea871b070de2"}}, -{"id":"global","key":"global","value":{"rev":"3-f15b0c9ae0ea9508890bff25c8e0f795"}}, -{"id":"globalize","key":"globalize","value":{"rev":"5-33d10c33fb24af273104f66098e246c4"}}, -{"id":"glossary","key":"glossary","value":{"rev":"3-5e143d09d22a01eb2ee742ceb3e18f6e"}}, -{"id":"glossy","key":"glossy","value":{"rev":"9-f31e00844e8be49e5812fe64a6f1e1cc"}}, -{"id":"gm","key":"gm","value":{"rev":"28-669722d34a3dc29c8c0b27abd73493a1"}}, -{"id":"gnarly","key":"gnarly","value":{"rev":"3-796f5df3483f304cb404cc7ac7702512"}}, -{"id":"gnomenotify","key":"gnomenotify","value":{"rev":"9-bc066c0556ad4a20e7a7ae58cdc4cf91"}}, -{"id":"gofer","key":"gofer","value":{"rev":"15-3fc77ce34e95ffecd12d3854a1bb2da9"}}, -{"id":"goo.gl","key":"goo.gl","value":{"rev":"37-eac7c44d33cc42c618372f0bdd4365c2"}}, -{"id":"goodreads","key":"goodreads","value":{"rev":"5-acd9fe24139aa8b81b26431dce9954aa"}}, -{"id":"goog","key":"goog","value":{"rev":"13-c964ecfcef4d20c8c7d7526323257c04"}}, -{"id":"googl","key":"googl","value":{"rev":"8-2d4d80ef0c5f93400ec2ec8ef80de433"}}, -{"id":"google-openid","key":"google-openid","value":{"rev":"19-380884ba97e3d6fc48c8c7db3dc0e91b"}}, -{"id":"google-spreadsheets","key":"google-spreadsheets","value":{"rev":"3-f640ef136c4b5e90210c2d5d43102b38"}}, -{"id":"google-voice","key":"google-voice","value":{"rev":"37-2e1c3cba3455852f26b0ccaf1fed7125"}}, -{"id":"googleanalytics","key":"googleanalytics","value":{"rev":"8-1d3e470ce4aacadb0418dd125887813d"}}, -{"id":"googleclientlogin","key":"googleclientlogin","value":{"rev":"23-5de8ee62c0ddbc63a001a36a6afe730e"}}, -{"id":"googlediff","key":"googlediff","value":{"rev":"3-438a2f0758e9770a157ae4cce9b6f49e"}}, -{"id":"googlemaps","key":"googlemaps","value":{"rev":"18-bc939560c587711f3d96f3caadd65a7f"}}, -{"id":"googleplus-scraper","key":"googleplus-scraper","value":{"rev":"7-598ea99bd64f4ad69cccb74095abae59"}}, -{"id":"googlereaderauth","key":"googlereaderauth","value":{"rev":"5-cd0eb8ca36ea78620af0fce270339a7b"}}, -{"id":"googlesets","key":"googlesets","value":{"rev":"5-1b2e597e903c080182b3306d63278fd9"}}, -{"id":"googleweather","key":"googleweather","value":{"rev":"3-6bfdaaeedb8a712ee3e89a8ed27508eb"}}, -{"id":"gopostal.node","key":"gopostal.node","value":{"rev":"3-14ff3a655dc3680c9e8e2751ebe294bc"}}, -{"id":"gowallan","key":"gowallan","value":{"rev":"3-23adc9c01a6b309eada47602fdc8ed90"}}, -{"id":"gowiththeflow","key":"gowiththeflow","value":{"rev":"3-52bb6cf6294f67ba5a892db4666d3790"}}, -{"id":"gpg","key":"gpg","value":{"rev":"5-0ca2b5af23e108a4f44f367992a75fed"}}, -{"id":"graceful-fs","key":"graceful-fs","value":{"rev":"3-01e9f7d1c0f6e6a611a60ee84de1f5cc"}}, -{"id":"gracie","key":"gracie","value":{"rev":"3-aa0f7c01a33c7c1e9a49b86886ef5255"}}, -{"id":"graff","key":"graff","value":{"rev":"7-5ab558cb24e30abd67f2a1dbf47cd639"}}, -{"id":"graft","key":"graft","value":{"rev":"3-7419de38b249b891bf7998bcdd2bf557"}}, -{"id":"grain","key":"grain","value":{"rev":"3-e57cbf02121970da230964ddbfd31432"}}, -{"id":"grainstore","key":"grainstore","value":{"rev":"19-5f9c5bb13b2c9ac4e6a05aec33aeb7c5"}}, -{"id":"graph","key":"graph","value":{"rev":"7-909d2fefcc84b5dd1512b60d631ea4e5"}}, -{"id":"graphquire","key":"graphquire","value":{"rev":"27-246e798f80b3310419644302405d68ad"}}, -{"id":"graphviz","key":"graphviz","value":{"rev":"8-3b79341eaf3f67f91bce7c88c08b9f0d"}}, -{"id":"grasshopper","key":"grasshopper","value":{"rev":"45-4002406990476b74dac5108bd19c4274"}}, -{"id":"gravatar","key":"gravatar","value":{"rev":"11-0164b7ac97e8a477b4e8791eae2e7fea"}}, -{"id":"grave","key":"grave","value":{"rev":"3-136f6378b956bc5dd9773250f8813038"}}, -{"id":"gravity","key":"gravity","value":{"rev":"5-dd40fcee1a769ce786337e9536d24244"}}, -{"id":"graylog","key":"graylog","value":{"rev":"5-abcff9cd91ff20e36f8a70a3f2de658b"}}, -{"id":"greg","key":"greg","value":{"rev":"5-ececb0a3bb552b6da4f66b8bf6f75cf0"}}, -{"id":"gridcentric","key":"gridcentric","value":{"rev":"4-4378e1c280e18b5aaabd23038b80d76c"}}, -{"id":"gridly","key":"gridly","value":{"rev":"3-86e878756b493da8f66cbd633a15f821"}}, -{"id":"grinder","key":"grinder","value":{"rev":"9-0aaeecf0c81b1c9c93a924c5eb0bff45"}}, -{"id":"grir.am","key":"grir.am","value":{"rev":"3-3ec153c764af1c26b50fefa437318c5a"}}, -{"id":"groundcrew","key":"groundcrew","value":{"rev":"3-9e9ed9b1c70c00c432f36bb853fa21a0"}}, -{"id":"groupie","key":"groupie","value":{"rev":"6-b5e3f0891a7e8811d6112b24bd5a46b4"}}, -{"id":"groupon","key":"groupon","value":{"rev":"21-8b74723c153695f4ed4917575abcca8f"}}, -{"id":"growing-file","key":"growing-file","value":{"rev":"7-995b233a1add5b9ea80aec7ac3f60dc5"}}, -{"id":"growl","key":"growl","value":{"rev":"10-4be41ae10ec96e1334dccdcdced12fe3"}}, -{"id":"gsl","key":"gsl","value":{"rev":"49-3367acfb521b30d3ddb9b80305009553"}}, -{"id":"gss","key":"gss","value":{"rev":"3-e4cffbbbc4536d952d13d46376d899b7"}}, -{"id":"guards","key":"guards","value":{"rev":"8-d7318d3d9dc842ab41e6ef5b88f9d37f"}}, -{"id":"guardtime","key":"guardtime","value":{"rev":"3-5a2942efabab100ffb3dc0fa3b581b7a"}}, -{"id":"guava","key":"guava","value":{"rev":"11-d9390d298b503f0ffb8e3ba92eeb9759"}}, -{"id":"guid","key":"guid","value":{"rev":"16-d99e725bbbf97a326833858767b7ed08"}}, -{"id":"gumbo","key":"gumbo","value":{"rev":"31-727cf5a3b7d8590fff871f27da114d9d"}}, -{"id":"gunther","key":"gunther","value":{"rev":"9-f95c89128412208d16acd3e615844115"}}, -{"id":"gzbz2","key":"gzbz2","value":{"rev":"3-e1844b1b3a7881a0c8dc0dd4edcc11ca"}}, -{"id":"gzip","key":"gzip","value":{"rev":"17-37afa05944f055d6f43ddc87c1b163c2"}}, -{"id":"gzip-stack","key":"gzip-stack","value":{"rev":"8-cf455d60277832c60ee622d198c0c51a"}}, -{"id":"gzippo","key":"gzippo","value":{"rev":"15-6416c13ecbbe1c5cd3e30adf4112ead7"}}, -{"id":"h5eb","key":"h5eb","value":{"rev":"3-11ed2566fa4b8a01ff63a720c94574cd"}}, -{"id":"hack","key":"hack","value":{"rev":"3-70f536dd46719e8201a6ac5cc96231f6"}}, -{"id":"hack.io","key":"hack.io","value":{"rev":"18-128305614e7fd6b461248bf3bfdd7ab7"}}, -{"id":"hacktor","key":"hacktor","value":{"rev":"3-51b438df35ba8a955d434ab25a4dad67"}}, -{"id":"haibu","key":"haibu","value":{"rev":"99-b29b8c37be42f90985c6d433d53c8679"}}, -{"id":"haibu-carapace","key":"haibu-carapace","value":{"rev":"22-9a89b2f495e533d0f93e4ee34121e48c"}}, -{"id":"haibu-nginx","key":"haibu-nginx","value":{"rev":"7-e176128dc6dbb0d7f5f33369edf1f7ee"}}, -{"id":"halfstreamxml","key":"halfstreamxml","value":{"rev":"7-5c0f3defa6ba921f8edb564584553df4"}}, -{"id":"ham","key":"ham","value":{"rev":"3-1500dc495cade7334f6a051f2758f748"}}, -{"id":"haml","key":"haml","value":{"rev":"15-a93e7762c7d43469a06519472497fd93"}}, -{"id":"haml-edge","key":"haml-edge","value":{"rev":"5-c4e44a73263ac9b7e632375de7e43d7c"}}, -{"id":"hamljs","key":"hamljs","value":{"rev":"10-a01c7214b69992352bde44938418ebf4"}}, -{"id":"hamljs-coffee","key":"hamljs-coffee","value":{"rev":"3-c2733c8ff38f5676075b84cd7f3d8684"}}, -{"id":"handlebars","key":"handlebars","value":{"rev":"4-0e21906b78605f7a1d5ec7cb4c7d35d7"}}, -{"id":"hanging-gardens","key":"hanging-gardens","value":{"rev":"27-3244e37f08bea0e31759e9f38983f59a"}}, -{"id":"hanging_gardens_registry","key":"hanging_gardens_registry","value":{"rev":"17-d87aa3a26f91dc314f02c686672a5ec6"}}, -{"id":"hapi","key":"hapi","value":{"rev":"3-ed721fe9aae4a459fe0945dabd7d680a"}}, -{"id":"harmony","key":"harmony","value":{"rev":"3-d6c9d6acc29d29c97c75c77f7c8e1390"}}, -{"id":"hascan","key":"hascan","value":{"rev":"13-a7ab15c72f464b013cbc55dc426543ca"}}, -{"id":"hash_ring","key":"hash_ring","value":{"rev":"12-0f072b1dd1fd93ae2f2b79f5ea72074d"}}, -{"id":"hashbangify","key":"hashbangify","value":{"rev":"5-738e0cf99649d41c19d3449c0e9a1cbf"}}, -{"id":"hashish","key":"hashish","value":{"rev":"9-62c5e74355458e1ead819d87151b7d38"}}, -{"id":"hashkeys","key":"hashkeys","value":{"rev":"3-490809bdb61f930f0d9f370eaadf36ea"}}, -{"id":"hashlib","key":"hashlib","value":{"rev":"7-1f19c9d6062ff22ed2e963204a1bd405"}}, -{"id":"hashring","key":"hashring","value":{"rev":"11-4c9f2b1ba7931c8bab310f4ecaf91419"}}, -{"id":"hashtable","key":"hashtable","value":{"rev":"7-2aaf2667cbdb74eb8da61e2e138059ca"}}, -{"id":"hat","key":"hat","value":{"rev":"9-6f37874d9703eab62dc875e2373837a8"}}, -{"id":"hbase","key":"hbase","value":{"rev":"20-7ca92712de26ffb18d275a21696aa263"}}, -{"id":"hbase-thrift","key":"hbase-thrift","value":{"rev":"7-39afb33a4e61cc2b3dc94f0c7fd32c65"}}, -{"id":"hbs","key":"hbs","value":{"rev":"29-aa2676e6790c5716f84f128dcd03e797"}}, -{"id":"header-stack","key":"header-stack","value":{"rev":"13-7ad1ccf3c454d77029c000ceb18ce5ab"}}, -{"id":"headers","key":"headers","value":{"rev":"13-04f8f5f25e2dd9890f6b2f120adf297a"}}, -{"id":"healthety","key":"healthety","value":{"rev":"60-07c67c22ee2a13d0ad675739d1814a6d"}}, -{"id":"heatmap","key":"heatmap","value":{"rev":"9-c53f4656d9517f184df7aea9226c1765"}}, -{"id":"heavy-flow","key":"heavy-flow","value":{"rev":"5-0b9188334339e7372b364a7fc730c639"}}, -{"id":"heckle","key":"heckle","value":{"rev":"13-b462abef7b9d1471ed8fb8f23af463e0"}}, -{"id":"helium","key":"helium","value":{"rev":"3-4d6ce9618c1be522268944240873f53e"}}, -{"id":"hello-world","key":"hello-world","value":{"rev":"3-e87f287308a209491c011064a87100b7"}}, -{"id":"hello.io","key":"hello.io","value":{"rev":"3-39b78278fa638495522edc7a84f6a52e"}}, -{"id":"helloworld","key":"helloworld","value":{"rev":"3-8f163aebdcf7d8761709bdbb634c3689"}}, -{"id":"helpers","key":"helpers","value":{"rev":"3-67d75b1c8e5ad2a268dd4ea191d4754b"}}, -{"id":"helpful","key":"helpful","value":{"rev":"41-e11bed25d5a0ca7e7ad116d5a339ec2a"}}, -{"id":"hem","key":"hem","value":{"rev":"27-042fc9d4b96f20112cd943e019e54d20"}}, -{"id":"hempwick","key":"hempwick","value":{"rev":"11-de1f6f0f23937d9f33286e12ee877540"}}, -{"id":"heritable","key":"heritable","value":{"rev":"13-1468ff92063251a037bbe80ee987a9c3"}}, -{"id":"hermes-raw-client","key":"hermes-raw-client","value":{"rev":"11-5d143c371cb8353612badc72be1917ff"}}, -{"id":"heru","key":"heru","value":{"rev":"3-d124a20939e30e2a3c08f7104b2a1a5c"}}, -{"id":"hexdump","key":"hexdump","value":{"rev":"3-c455710ca80662969ccbca3acc081cb8"}}, -{"id":"hexy","key":"hexy","value":{"rev":"16-5142b0461622436daa2e476d252770f2"}}, -{"id":"highlight","key":"highlight","value":{"rev":"9-4b172b7aef6f40d768f022b2ba4e6748"}}, -{"id":"highlight.js","key":"highlight.js","value":{"rev":"5-16c1ebd28d5f2e781e666c6ee013c30c"}}, -{"id":"hiker","key":"hiker","value":{"rev":"9-89d1ce978b349f1f0df262655299d83c"}}, -{"id":"hipchat","key":"hipchat","value":{"rev":"3-73118782367d474af0f6410290df5f7f"}}, -{"id":"hipchat-js","key":"hipchat-js","value":{"rev":"3-253b83875d3e18e9c89333bc377183c3"}}, -{"id":"hiredis","key":"hiredis","value":{"rev":"46-29ceb03860efbd4b3b995247f27f78b9"}}, -{"id":"hive","key":"hive","value":{"rev":"15-40a4c6fcfa3b80007a18ef4ede80075b"}}, -{"id":"hive-cache","key":"hive-cache","value":{"rev":"3-36b10607b68586fccbfeb856412bd6bf"}}, -{"id":"hoard","key":"hoard","value":{"rev":"13-75d4c484095e2e38ac63a65bd9fd7f4b"}}, -{"id":"hook","key":"hook","value":{"rev":"7-2f1e375058e2b1fa61d3651f6d57a6f8"}}, -{"id":"hook.io","key":"hook.io","value":{"rev":"63-9fac4fb8337d1953963d47144f806f72"}}, -{"id":"hook.io-browser","key":"hook.io-browser","value":{"rev":"3-7e04347d80adc03eb5637b7e4b8ca58b"}}, -{"id":"hook.io-couch","key":"hook.io-couch","value":{"rev":"3-ce0eb281d1ba21aa1caca3a52553a07b"}}, -{"id":"hook.io-cron","key":"hook.io-cron","value":{"rev":"15-50deedc2051ce65bca8a42048154139c"}}, -{"id":"hook.io-helloworld","key":"hook.io-helloworld","value":{"rev":"23-ef5cf0cec9045d28d846a7b0872874e4"}}, -{"id":"hook.io-irc","key":"hook.io-irc","value":{"rev":"5-39c7ac5e192aef34b87af791fa77ee04"}}, -{"id":"hook.io-logger","key":"hook.io-logger","value":{"rev":"13-9e3208ea8eacfe5378cd791f2377d06d"}}, -{"id":"hook.io-mailer","key":"hook.io-mailer","value":{"rev":"9-d9415d53dc086102024cf7400fdfb7a2"}}, -{"id":"hook.io-pinger","key":"hook.io-pinger","value":{"rev":"17-860ab3a892284b91999f86c3882e2ff5"}}, -{"id":"hook.io-repl","key":"hook.io-repl","value":{"rev":"13-c0d430ccdfd197e4746c46d2814b6d92"}}, -{"id":"hook.io-request","key":"hook.io-request","value":{"rev":"13-f0e8d167d59917d90266f921e3ef7c64"}}, -{"id":"hook.io-sitemonitor","key":"hook.io-sitemonitor","value":{"rev":"8-725ea7deb9cb1031eabdc4fd798308ff"}}, -{"id":"hook.io-twilio","key":"hook.io-twilio","value":{"rev":"11-6b2e231307f6174861aa5dcddad264b3"}}, -{"id":"hook.io-twitter","key":"hook.io-twitter","value":{"rev":"3-59296395b22e661e7e5c141c4c7be46d"}}, -{"id":"hook.io-webhook","key":"hook.io-webhook","value":{"rev":"15-b27e51b63c8ec70616c66061d949f388"}}, -{"id":"hook.io-webserver","key":"hook.io-webserver","value":{"rev":"29-eb6bff70736648427329eba08b5f55c3"}}, -{"id":"hook.io-ws","key":"hook.io-ws","value":{"rev":"4-a85578068b54560ef663a7ecfea2731f"}}, -{"id":"hooks","key":"hooks","value":{"rev":"33-6640fb0c27903af6b6ae7b7c41d79e01"}}, -{"id":"hoptoad-notifier","key":"hoptoad-notifier","value":{"rev":"16-8249cb753a3626f2bf2664024ae7a5ee"}}, -{"id":"horaa","key":"horaa","value":{"rev":"5-099e5d6486d10944e10b584eb3f6e924"}}, -{"id":"hornet","key":"hornet","value":{"rev":"22-8c40d7ba4ca832b951e6d5db165f3305"}}, -{"id":"horseman","key":"horseman","value":{"rev":"11-7228e0f84c2036669a218710c22f72c0"}}, -{"id":"hostify","key":"hostify","value":{"rev":"11-8c1a2e73f8b9474a6c26121688c28dc7"}}, -{"id":"hostinfo","key":"hostinfo","value":{"rev":"5-c8d638f40ccf94f4083430966d25e787"}}, -{"id":"hostip","key":"hostip","value":{"rev":"3-d4fd628b94e1f913d97ec1746d96f2a0"}}, -{"id":"hostname","key":"hostname","value":{"rev":"7-55fefb3c37990bbcad3d98684d17f38f"}}, -{"id":"hotnode","key":"hotnode","value":{"rev":"16-d7dad5de3ffc2ca6a04f74686aeb0e4b"}}, -{"id":"howmuchtime","key":"howmuchtime","value":{"rev":"3-351ce870ae6e2c21a798169d074e2a3f"}}, -{"id":"hstore","key":"hstore","value":{"rev":"3-55ab4d359c2fc8725829038e3adb7571"}}, -{"id":"hsume2-socket.io","key":"hsume2-socket.io","value":{"rev":"5-4b537247ae9999c285c802cc36457598"}}, -{"id":"htdoc","key":"htdoc","value":{"rev":"3-80ef9e3202b0d96b79435a2bc90bc899"}}, -{"id":"html","key":"html","value":{"rev":"3-92c4af7de329c92ff2e0be5c13020e78"}}, -{"id":"html-minifier","key":"html-minifier","value":{"rev":"7-2441ed004e2a6e7f1c42003ec03277ec"}}, -{"id":"html-sourcery","key":"html-sourcery","value":{"rev":"11-7ce1d4aa2e1d319fa108b02fb294d4ce"}}, -{"id":"html2coffeekup","key":"html2coffeekup","value":{"rev":"13-bae4a70411f6f549c281c69835fe3276"}}, -{"id":"html2coffeekup-bal","key":"html2coffeekup-bal","value":{"rev":"5-0663ac1339d72932004130b668c949f0"}}, -{"id":"html2jade","key":"html2jade","value":{"rev":"11-e50f504c5c847d7ffcde7328c2ade4fb"}}, -{"id":"html5","key":"html5","value":{"rev":"46-ca85ea99accaf1dc9ded4e2e3aa429c6"}}, -{"id":"html5edit","key":"html5edit","value":{"rev":"10-0383296c33ada4d356740f29121eeb9f"}}, -{"id":"htmlKompressor","key":"htmlKompressor","value":{"rev":"13-95a3afe7f7cfe02e089e41588b937fb1"}}, -{"id":"htmlkup","key":"htmlkup","value":{"rev":"27-5b0115636f38886ae0a40e5f52e2bfdd"}}, -{"id":"htmlparser","key":"htmlparser","value":{"rev":"14-52b2196c1456d821d47bb1d2779b2433"}}, -{"id":"htmlparser2","key":"htmlparser2","value":{"rev":"3-9bc0b807acd913999dfc949b3160a3db"}}, -{"id":"htracr","key":"htracr","value":{"rev":"27-384d0522328e625978b97d8eae8d942d"}}, -{"id":"http","key":"http","value":{"rev":"3-f197d1b599cb9da720d3dd58d9813ace"}}, -{"id":"http-agent","key":"http-agent","value":{"rev":"10-1715dd3a7adccf55bd6637d78bd345d1"}}, -{"id":"http-auth","key":"http-auth","value":{"rev":"3-21636d4430be18a5c6c42e5cb622c2e0"}}, -{"id":"http-basic-auth","key":"http-basic-auth","value":{"rev":"6-0a77e99ce8e31558d5917bd684fa2c9a"}}, -{"id":"http-browserify","key":"http-browserify","value":{"rev":"3-4f720b4af628ed8b5fb22839c1f91f4d"}}, -{"id":"http-console","key":"http-console","value":{"rev":"43-a20cbefed77bcae7de461922286a1f04"}}, -{"id":"http-digest","key":"http-digest","value":{"rev":"6-e0164885dcad21ab6150d537af0edd92"}}, -{"id":"http-digest-auth","key":"http-digest-auth","value":{"rev":"7-613ac841b808fd04e272e050fd5a45ac"}}, -{"id":"http-get","key":"http-get","value":{"rev":"39-b7cfeb2b572d4ecf695493e0886869f4"}}, -{"id":"http-load","key":"http-load","value":{"rev":"3-8c64f4972ff59e89fee041adde99b8ba"}}, -{"id":"http-proxy","key":"http-proxy","value":{"rev":"97-5b8af88886c8c047a9862bf62f6b9294"}}, -{"id":"http-proxy-backward","key":"http-proxy-backward","value":{"rev":"2-4433b04a41e8adade3f6b6b2b939df4b"}}, -{"id":"http-proxy-glimpse","key":"http-proxy-glimpse","value":{"rev":"3-a3e9791d4d9bfef5929ca55d874df18b"}}, -{"id":"http-proxy-no-line-184-error","key":"http-proxy-no-line-184-error","value":{"rev":"3-7e20a990820976d8c6d27c312cc5a67c"}}, -{"id":"http-proxy-selective","key":"http-proxy-selective","value":{"rev":"12-6e273fcd008afeceb6737345c46e1024"}}, -{"id":"http-recorder","key":"http-recorder","value":{"rev":"3-26dd0bc4f5c0bf922db1875e995d025f"}}, -{"id":"http-request-provider","key":"http-request-provider","value":{"rev":"6-436b69971dd1735ac3e41571375f2d15"}}, -{"id":"http-server","key":"http-server","value":{"rev":"21-1b80b6558692afd08c36629b0ecdc18c"}}, -{"id":"http-signature","key":"http-signature","value":{"rev":"9-49ca63427b535f2d18182d92427bc5b6"}}, -{"id":"http-stack","key":"http-stack","value":{"rev":"9-51614060741d6c85a7fd4c714ed1a9b2"}}, -{"id":"http-status","key":"http-status","value":{"rev":"5-1ec72fecc62a41d6f180d15c95e81270"}}, -{"id":"http_compat","key":"http_compat","value":{"rev":"3-88244d4b0fd08a3140fa1b2e8b1b152c"}}, -{"id":"http_router","key":"http_router","value":{"rev":"23-ad52b58b6bfc96d6d4e8215e0c31b294"}}, -{"id":"http_trace","key":"http_trace","value":{"rev":"7-d8024b5e41540e4240120ffefae523e4"}}, -{"id":"httpd","key":"httpd","value":{"rev":"3-9e2a19f007a6a487cdb752f4b8249657"}}, -{"id":"httpmock","key":"httpmock","value":{"rev":"3-b6966ba8ee2c31b0e7729fc59bb00ccf"}}, -{"id":"https-proxied","key":"https-proxied","value":{"rev":"5-f63a4c663d372502b0dcd4997e759e66"}}, -{"id":"httpu","key":"httpu","value":{"rev":"5-88a5b2bac8391d91673fc83d4cfd32df"}}, -{"id":"hungarian-magic","key":"hungarian-magic","value":{"rev":"4-9eae750ac6f30b6687d9a031353f5217"}}, -{"id":"huntergatherer","key":"huntergatherer","value":{"rev":"9-5c9d833a134cfaa901d89dce93f5b013"}}, -{"id":"hxp","key":"hxp","value":{"rev":"8-1f52ba766491826bdc6517c6cc508b2c"}}, -{"id":"hyde","key":"hyde","value":{"rev":"3-5763db65cab423404752b1a6354a7a6c"}}, -{"id":"hydra","key":"hydra","value":{"rev":"8-8bb4ed249fe0f9cdb8b11e492b646b88"}}, -{"id":"hyperpublic","key":"hyperpublic","value":{"rev":"11-5738162f3dbf95803dcb3fb28efd8740"}}, -{"id":"i18n","key":"i18n","value":{"rev":"7-f0d6b3c72ecd34dde02d805041eca996"}}, -{"id":"ical","key":"ical","value":{"rev":"13-baf448be48ab83ec9b3fb8bf83fbb9a1"}}, -{"id":"icalendar","key":"icalendar","value":{"rev":"5-78dd8fd8ed2c219ec56ad26a0727cf76"}}, -{"id":"icecap","key":"icecap","value":{"rev":"9-88d6865078a5e6e1ff998e2e73e593f3"}}, -{"id":"icecapdjs","key":"icecapdjs","value":{"rev":"11-d8e3c718a230d49caa3b5f76cfff7ce9"}}, -{"id":"icecast-stack","key":"icecast-stack","value":{"rev":"9-13b8da6ae373152ab0c8560e2f442af0"}}, -{"id":"ichabod","key":"ichabod","value":{"rev":"19-d0f02ffba80661398ceb80a7e0cbbfe6"}}, -{"id":"icing","key":"icing","value":{"rev":"11-84815e78828190fbaa52d6b93c75cb4f"}}, -{"id":"ico","key":"ico","value":{"rev":"3-5727a35c1df453bfdfa6a03e49725adf"}}, -{"id":"iconv","key":"iconv","value":{"rev":"18-5f5b3193268f1fa099e0112b3e033ffc"}}, -{"id":"iconv-jp","key":"iconv-jp","value":{"rev":"3-660b8f2def930263d2931cae2dcc401d"}}, -{"id":"id3","key":"id3","value":{"rev":"8-afe68aede872cae7b404aaa01c0108a5"}}, -{"id":"idea","key":"idea","value":{"rev":"9-a126c0e52206c51dcf972cf53af0bc32"}}, -{"id":"idiomatic-console","key":"idiomatic-console","value":{"rev":"25-67696c16bf79d1cc8caf4df62677c3ec"}}, -{"id":"idiomatic-stdio","key":"idiomatic-stdio","value":{"rev":"15-9d74c9a8872b1f7c41d6c671d7a14b7d"}}, -{"id":"iglob","key":"iglob","value":{"rev":"6-b8a3518cb67cad20c89f37892a2346a5"}}, -{"id":"ignite","key":"ignite","value":{"rev":"19-06daa730a70f69dc3a0d6d4984905c61"}}, -{"id":"iles-forked-irc-js","key":"iles-forked-irc-js","value":{"rev":"7-eb446f4e0db856e00351a5da2fa20616"}}, -{"id":"image","key":"image","value":{"rev":"8-5f7811db33c210eb38e1880f7cc433f2"}}, -{"id":"imageable","key":"imageable","value":{"rev":"61-9f7e03d3d990d34802f1e9c8019dbbfa"}}, -{"id":"imageinfo","key":"imageinfo","value":{"rev":"11-9bde1a1f0801d94539a4b70b61614849"}}, -{"id":"imagemagick","key":"imagemagick","value":{"rev":"10-b1a1ea405940fecf487da94b733e8c29"}}, -{"id":"imagick","key":"imagick","value":{"rev":"3-21d51d8a265a705881dadbc0c9f7c016"}}, -{"id":"imap","key":"imap","value":{"rev":"13-6a59045496c80b474652d2584edd4acb"}}, -{"id":"imbot","key":"imbot","value":{"rev":"11-0d8075eff5e5ec354683f396378fd101"}}, -{"id":"imdb","key":"imdb","value":{"rev":"7-2bba884d0e8804f4a7e0883abd47b0a7"}}, -{"id":"imgur","key":"imgur","value":{"rev":"3-30c0e5fddc1be3398ba5f7eee1a251d7"}}, -{"id":"impact","key":"impact","value":{"rev":"7-d3390690f11c6f9dcca9f240a7bedfef"}}, -{"id":"imsi","key":"imsi","value":{"rev":"3-0aa9a01c9c79b17afae3684b7b920ced"}}, -{"id":"index","key":"index","value":{"rev":"13-ad5d8d7dfad64512a12db4d820229c07"}}, -{"id":"indexer","key":"indexer","value":{"rev":"9-b0173ce9ad9fa1b80037fa8e33a8ce12"}}, -{"id":"inflect","key":"inflect","value":{"rev":"17-9e5ea2826fe08bd950cf7e22d73371bd"}}, -{"id":"inflectjs","key":"inflectjs","value":{"rev":"3-c59db027b72be720899b4a280ac2518f"}}, -{"id":"inflector","key":"inflector","value":{"rev":"3-191ff29d3b5ed8ef6877032a1d01d864"}}, -{"id":"inheritance","key":"inheritance","value":{"rev":"3-450a1e68bd2d8f16abe7001491abb6a8"}}, -{"id":"inherits","key":"inherits","value":{"rev":"3-284f97a7ae4f777bfabe721b66de07fa"}}, -{"id":"ini","key":"ini","value":{"rev":"5-142c8f9125fbace57689e2837deb1883"}}, -{"id":"iniparser","key":"iniparser","value":{"rev":"14-1053c59ef3d50a46356be45576885c49"}}, -{"id":"inireader","key":"inireader","value":{"rev":"15-9cdc485b18bff6397f5fec45befda402"}}, -{"id":"init","key":"init","value":{"rev":"5-b81610ad72864417dab49f7a3f29cc9f"}}, -{"id":"inject","key":"inject","value":{"rev":"5-82bddb6b4f21ddaa0137fedc8913d60e"}}, -{"id":"inliner","key":"inliner","value":{"rev":"45-8a1c3e8f78438f06865b3237d6c5339a"}}, -{"id":"inode","key":"inode","value":{"rev":"7-118ffafc62dcef5bbeb14e4328c68ab3"}}, -{"id":"inotify","key":"inotify","value":{"rev":"18-03d7b1a318bd283e0185b414b48dd602"}}, -{"id":"inotify-plusplus","key":"inotify-plusplus","value":{"rev":"10-0e0ce9065a62e5e21ee5bb53fac61a6d"}}, -{"id":"inspect","key":"inspect","value":{"rev":"5-b5f18717e29caec3399abe5e4ce7a269"}}, -{"id":"instagram","key":"instagram","value":{"rev":"5-decddf3737a1764518b6a7ce600d720d"}}, -{"id":"instagram-node-lib","key":"instagram-node-lib","value":{"rev":"13-8be77f1180b6afd9066834b3f5ee8de5"}}, -{"id":"instant-styleguide","key":"instant-styleguide","value":{"rev":"9-66c02118993621376ad0b7396db435b3"}}, -{"id":"intercept","key":"intercept","value":{"rev":"9-f5622744c576405516a427b4636ee864"}}, -{"id":"interface","key":"interface","value":{"rev":"10-13806252722402bd18d88533056a863b"}}, -{"id":"interleave","key":"interleave","value":{"rev":"25-69bc136937604863748a029fb88e3605"}}, -{"id":"interstate","key":"interstate","value":{"rev":"3-3bb4a6c35ca765f88a10b9fab6307c59"}}, -{"id":"intervals","key":"intervals","value":{"rev":"21-89b71bd55b8d5f6b670d69fc5b9f847f"}}, -{"id":"intestine","key":"intestine","value":{"rev":"3-66a5531e06865ed9c966d95437ba1371"}}, -{"id":"ios7crypt","key":"ios7crypt","value":{"rev":"7-a2d309a2c074e5c1c456e2b56cbcfd17"}}, -{"id":"iostat","key":"iostat","value":{"rev":"11-f0849c0072e76701b435aa769a614e82"}}, -{"id":"ip2cc","key":"ip2cc","value":{"rev":"9-2c282606fd08d469184a272a2108639c"}}, -{"id":"ipaddr.js","key":"ipaddr.js","value":{"rev":"5-1017fd5342840745614701476ed7e6c4"}}, -{"id":"iptables","key":"iptables","value":{"rev":"7-23e56ef5d7bf0ee8f5bd0e38bde8aae3"}}, -{"id":"iptrie","key":"iptrie","value":{"rev":"4-10317b0e073befe9601e9dc308dc361a"}}, -{"id":"ipv6","key":"ipv6","value":{"rev":"6-85e937f3d79e44dbb76264c7aaaa140f"}}, -{"id":"iqengines","key":"iqengines","value":{"rev":"3-8bdbd32e9dc35b77d80a31edae235178"}}, -{"id":"irc","key":"irc","value":{"rev":"8-ed30964f57b99b1b2f2104cc5e269618"}}, -{"id":"irc-colors","key":"irc-colors","value":{"rev":"9-7ddb19db9a553567aae86bd97f1dcdfc"}}, -{"id":"irc-js","key":"irc-js","value":{"rev":"58-1c898cea420aee60283edb4fadceb90e"}}, -{"id":"ircat.js","key":"ircat.js","value":{"rev":"6-f25f20953ce96697c033315d250615d0"}}, -{"id":"ircbot","key":"ircbot","value":{"rev":"9-85a4a6f88836fc031855736676b10dec"}}, -{"id":"irccd","key":"irccd","value":{"rev":"3-bf598ae8b6af63be41852ae8199416f4"}}, -{"id":"ircd","key":"ircd","value":{"rev":"7-3ba7fc2183d32ee1e58e63092d7e82bb"}}, -{"id":"ircdjs","key":"ircdjs","value":{"rev":"15-8fcdff2bf29cf24c3bbc4b461e6cbe9f"}}, -{"id":"irclog","key":"irclog","value":{"rev":"3-79a99bd8048dd98a93c747a1426aabde"}}, -{"id":"ircrpc","key":"ircrpc","value":{"rev":"5-278bec6fc5519fdbd152ea4fa35dc58c"}}, -{"id":"irrklang","key":"irrklang","value":{"rev":"3-65936dfabf7777027069343c2e72b32e"}}, -{"id":"isaacs","key":"isaacs","value":{"rev":"7-c55a41054056f502bc580bc6819d9d1f"}}, -{"id":"isbn","key":"isbn","value":{"rev":"3-51e784ded2e3ec9ef9b382fecd1c26a1"}}, -{"id":"iscroll","key":"iscroll","value":{"rev":"4-4f6635793806507665503605e7c180f0"}}, -{"id":"isodate","key":"isodate","value":{"rev":"7-ea4b1f77e9557b153264f68fd18a9f23"}}, -{"id":"it-is","key":"it-is","value":{"rev":"14-7617f5831c308d1c4ef914bc5dc30fa7"}}, -{"id":"iterator","key":"iterator","value":{"rev":"3-e6f70367a55cabbb89589f2a88be9ab0"}}, -{"id":"itunes","key":"itunes","value":{"rev":"7-47d151c372d70d0bc311141749c84d5a"}}, -{"id":"iws","key":"iws","value":{"rev":"3-dc7b4d18565b79d3e14aa691e5e632f4"}}, -{"id":"jQuery","key":"jQuery","value":{"rev":"29-f913933259b4ec5f4c5ea63466a4bb08"}}, -{"id":"jWorkflow","key":"jWorkflow","value":{"rev":"7-582cd7aa62085ec807117138b6439550"}}, -{"id":"jaCodeMap","key":"jaCodeMap","value":{"rev":"7-28efcbf4146977bdf1e594e0982ec097"}}, -{"id":"jaaulde-cookies","key":"jaaulde-cookies","value":{"rev":"3-d5b5a75f9cabbebb2804f0b4ae93d0c5"}}, -{"id":"jacker","key":"jacker","value":{"rev":"3-888174c7e3e2a5d241f2844257cf1b10"}}, -{"id":"jade","key":"jade","value":{"rev":"144-318a9d9f63906dc3da1ef7c1ee6420b5"}}, -{"id":"jade-browser","key":"jade-browser","value":{"rev":"9-0ae6b9e321cf04e3ca8fbfe0e38f4d9e"}}, -{"id":"jade-client-connect","key":"jade-client-connect","value":{"rev":"5-96dbafafa31187dd7f829af54432de8e"}}, -{"id":"jade-ext","key":"jade-ext","value":{"rev":"9-aac9a58a4e07d82bc496bcc4241d1be0"}}, -{"id":"jade-i18n","key":"jade-i18n","value":{"rev":"23-76a21a41b5376e10c083672dccf7fc62"}}, -{"id":"jade-serial","key":"jade-serial","value":{"rev":"3-5ec712e1d8cd8d5af20ae3e62ee92854"}}, -{"id":"jadedown","key":"jadedown","value":{"rev":"11-0d16ce847d6afac2939eebcb24a7216c"}}, -{"id":"jadeify","key":"jadeify","value":{"rev":"17-4322b68bb5a7e81e839edabbc8c405a4"}}, -{"id":"jadevu","key":"jadevu","value":{"rev":"15-1fd8557a6db3c23f267de76835f9ee65"}}, -{"id":"jah","key":"jah","value":{"rev":"3-f29704037a1cffe2b08abb4283bee4a4"}}, -{"id":"jake","key":"jake","value":{"rev":"36-5cb64b1c5a89ac53eb4d09d66a5b10e1"}}, -{"id":"jammit-express","key":"jammit-express","value":{"rev":"6-e3dfa928114a2721fe9b8882d284f759"}}, -{"id":"janrain","key":"janrain","value":{"rev":"5-9554501be76fb3a472076858d1abbcd5"}}, -{"id":"janrain-api","key":"janrain-api","value":{"rev":"3-f45a65c695f4c72fdd1bf3593d8aa796"}}, -{"id":"jaque","key":"jaque","value":{"rev":"32-7f269a70c67beefc53ba1684bff5a57b"}}, -{"id":"jar","key":"jar","value":{"rev":"3-7fe0ab4aa3a2ccc5d50853f118e7aeb5"}}, -{"id":"jarvis","key":"jarvis","value":{"rev":"3-fb203b29b397a0b12c1ae56240624e3d"}}, -{"id":"jarvis-test","key":"jarvis-test","value":{"rev":"5-9537ddae8291e6dad03bc0e6acc9ac80"}}, -{"id":"jasbin","key":"jasbin","value":{"rev":"25-ae22f276406ac8bb4293d78595ce02ad"}}, -{"id":"jasmine-dom","key":"jasmine-dom","value":{"rev":"17-686de4c573f507c30ff72c6671dc3d93"}}, -{"id":"jasmine-jquery","key":"jasmine-jquery","value":{"rev":"7-86c077497a367bcd9ea96d5ab8137394"}}, -{"id":"jasmine-node","key":"jasmine-node","value":{"rev":"27-4c544c41c69d2b3cb60b9953d1c46d54"}}, -{"id":"jasmine-reporters","key":"jasmine-reporters","value":{"rev":"3-21ba522ae38402848d5a66d3d4d9a2b3"}}, -{"id":"jasmine-runner","key":"jasmine-runner","value":{"rev":"23-7458777b7a6785efc878cfd40ccb99d8"}}, -{"id":"jasminy","key":"jasminy","value":{"rev":"3-ce76023bac40c5f690cba59d430fd083"}}, -{"id":"jason","key":"jason","value":{"rev":"15-394a59963c579ed5db37fada4d082b5c"}}, -{"id":"javiary","key":"javiary","value":{"rev":"5-661be61fd0f47c9609b7d148e298e2fc"}}, -{"id":"jazz","key":"jazz","value":{"rev":"12-d11d602c1240b134b0593425911242fc"}}, -{"id":"jdoc","key":"jdoc","value":{"rev":"3-0c61fdd6b367a9acac710e553927b290"}}, -{"id":"jeesh","key":"jeesh","value":{"rev":"13-23b4e1ecf9ca76685bf7f1bfc6c076f1"}}, -{"id":"jellyfish","key":"jellyfish","value":{"rev":"25-7fef81f9b5ef5d4abbcecb030a433a72"}}, -{"id":"jen","key":"jen","value":{"rev":"3-ab1b07453318b7e0254e1dadbee7868f"}}, -{"id":"jerk","key":"jerk","value":{"rev":"34-e31f26d5e3b700d0a3e5f5a5acf0d381"}}, -{"id":"jessie","key":"jessie","value":{"rev":"19-829b932e57204f3b7833b34f75d6bf2a"}}, -{"id":"jezebel","key":"jezebel","value":{"rev":"15-b67c259e160390064da69a512382e06f"}}, -{"id":"jimi","key":"jimi","value":{"rev":"10-cc4a8325d6b847362a422304a0057231"}}, -{"id":"jinjs","key":"jinjs","value":{"rev":"37-38fcf1989f1b251a35e4ff725118f55e"}}, -{"id":"jinkies","key":"jinkies","value":{"rev":"30-73fec0e854aa31bcbf3ae1ca04462b22"}}, -{"id":"jison","key":"jison","value":{"rev":"52-d03c6f5e2bdd7624d39d93ec5e88c383"}}, -{"id":"jitsu","key":"jitsu","value":{"rev":"164-95083f8275f0bf2834f62027569b4da2"}}, -{"id":"jitter","key":"jitter","value":{"rev":"16-3f7b183aa7922615f4b5b2fb46653477"}}, -{"id":"jj","key":"jj","value":{"rev":"21-1b3f97e9725e1241c96a884c85dc4e30"}}, -{"id":"jjw","key":"jjw","value":{"rev":"13-835c632dfc5df7dd37860bd0b2c1cb38"}}, -{"id":"jkwery","key":"jkwery","value":{"rev":"11-212429c9c9e1872d4e278da055b5ae0a"}}, -{"id":"jmen","key":"jmen","value":{"rev":"3-a0b67d5b84a077061d3fed2ddbf2c6a8"}}, -{"id":"jobmanager","key":"jobmanager","value":{"rev":"15-1a589ede5f10d1ea2f33f1bb91f9b3aa"}}, -{"id":"jobs","key":"jobs","value":{"rev":"12-3072b6164c5dca8fa9d24021719048ff"}}, -{"id":"jobvite","key":"jobvite","value":{"rev":"56-3d69b0e6d91722ef4908b4fe26bb5432"}}, -{"id":"jodoc","key":"jodoc","value":{"rev":"3-7b05c6d7b4c9a9fa85d3348948d2d52d"}}, -{"id":"johnny-mnemonic","key":"johnny-mnemonic","value":{"rev":"3-e8749d4be597f002aae720011b7c9273"}}, -{"id":"join","key":"join","value":{"rev":"5-ab92491dc83b5e8ed5f0cc49e306d5d5"}}, -{"id":"jolokia-client","key":"jolokia-client","value":{"rev":"26-1f93cb53f4a870b94540cdbf7627b1c4"}}, -{"id":"joo","key":"joo","value":{"rev":"11-e0d4a97eceacdd13769bc5f56e059aa7"}}, -{"id":"jools","key":"jools","value":{"rev":"3-9da332d524a117c4d72a58bb45fa34fd"}}, -{"id":"joose","key":"joose","value":{"rev":"22-ef8a1895680ad2f9c1cd73cd1afbb58e"}}, -{"id":"joosex-attribute","key":"joosex-attribute","value":{"rev":"18-119df97dba1ba2631c94d49e3142bbd7"}}, -{"id":"joosex-bridge-ext","key":"joosex-bridge-ext","value":{"rev":"20-5ad2168291aad2cf021df0a3eb103538"}}, -{"id":"joosex-class-simpleconstructor","key":"joosex-class-simpleconstructor","value":{"rev":"6-f71e02e44f611550374ad9f5d0c37fdf"}}, -{"id":"joosex-class-singleton","key":"joosex-class-singleton","value":{"rev":"6-3ba6b8644722b29febe384a368c18aab"}}, -{"id":"joosex-cps","key":"joosex-cps","value":{"rev":"20-493c65faf1ec59416bae475529c51cd4"}}, -{"id":"joosex-meta-lazy","key":"joosex-meta-lazy","value":{"rev":"13-ef8bc4e57006cfcecd72a344d8dc9da6"}}, -{"id":"joosex-namespace-depended","key":"joosex-namespace-depended","value":{"rev":"22-8a38a21f8564470b96082177e81f3db6"}}, -{"id":"joosex-observable","key":"joosex-observable","value":{"rev":"7-52e7018931e5465920bb6feab88aa468"}}, -{"id":"joosex-role-parameterized","key":"joosex-role-parameterized","value":{"rev":"6-65aa4fa4967c4fbe06357ccda5e6f810"}}, -{"id":"joosex-simplerequest","key":"joosex-simplerequest","value":{"rev":"10-12d105b60b8b3ca3a3626ca0ec53892d"}}, -{"id":"josp","key":"josp","value":{"rev":"3-c4fa8445a0d96037e00fe96d007bcf0c"}}, -{"id":"jot","key":"jot","value":{"rev":"3-8fab571ce3ad993f3594f3c2e0fc6915"}}, -{"id":"journey","key":"journey","value":{"rev":"40-efe1fa6c8d735592077c9a24b3b56a03"}}, -{"id":"jpeg","key":"jpeg","value":{"rev":"8-ab437fbaf88f32a7fb625a0b27521292"}}, -{"id":"jq","key":"jq","value":{"rev":"3-9d83287aa9e6aab25590fac9adbab968"}}, -{"id":"jqNode","key":"jqNode","value":{"rev":"3-fcaf2c47aba5637a4a23c64b6fc778cf"}}, -{"id":"jqbuild","key":"jqbuild","value":{"rev":"3-960edcea36784aa9ca135cd922e0cb9b"}}, -{"id":"jqserve","key":"jqserve","value":{"rev":"3-39272c5479aabaafe66ffa26a6eb3bb5"}}, -{"id":"jqtpl","key":"jqtpl","value":{"rev":"54-ce2b62ced4644d5fe24c3a8ebcb4d528"}}, -{"id":"jquajax","key":"jquajax","value":{"rev":"3-a079cb8f3a686faaafe420760e77a330"}}, -{"id":"jquery","key":"jquery","value":{"rev":"27-60fd58bba99d044ffe6e140bafd72595"}}, -{"id":"jquery-browserify","key":"jquery-browserify","value":{"rev":"9-a4e9afd657f3c632229afa356382f6a4"}}, -{"id":"jquery-deferred","key":"jquery-deferred","value":{"rev":"5-0fd0cec51f7424a50f0dba3cbe74fd58"}}, -{"id":"jquery-drive","key":"jquery-drive","value":{"rev":"3-8474f192fed5c5094e56bc91f5e8a0f8"}}, -{"id":"jquery-mousewheel","key":"jquery-mousewheel","value":{"rev":"3-cff81086cf651e52377a8d5052b09d64"}}, -{"id":"jquery-placeholdize","key":"jquery-placeholdize","value":{"rev":"3-7acc3fbda1b8daabce18876d2b4675e3"}}, -{"id":"jquery-tmpl-jst","key":"jquery-tmpl-jst","value":{"rev":"13-575031eb2f2b1e4c5562e195fce0bc93"}}, -{"id":"jquery.effects.blind","key":"jquery.effects.blind","value":{"rev":"3-5f3bec5913edf1bfcee267891f6204e2"}}, -{"id":"jquery.effects.bounce","key":"jquery.effects.bounce","value":{"rev":"3-245b2e7d9a1295dd0f7d568b8087190d"}}, -{"id":"jquery.effects.clip","key":"jquery.effects.clip","value":{"rev":"3-7aa63a590b6d90d5ea20e21c8dda675d"}}, -{"id":"jquery.effects.core","key":"jquery.effects.core","value":{"rev":"3-dd2fa270d8aea21104c2c92d6b06500d"}}, -{"id":"jquery.effects.drop","key":"jquery.effects.drop","value":{"rev":"3-8d0e30016e99460063a9a9000ce7b032"}}, -{"id":"jquery.effects.explode","key":"jquery.effects.explode","value":{"rev":"3-3d5e3bb2fb451f7eeaeb72b6743b6e6c"}}, -{"id":"jquery.effects.fade","key":"jquery.effects.fade","value":{"rev":"3-f362c762053eb278b5db5f92e248c3a5"}}, -{"id":"jquery.effects.fold","key":"jquery.effects.fold","value":{"rev":"3-c7d823c2b25c4f1e6a1801f4b1bc7a2c"}}, -{"id":"jquery.effects.highlight","key":"jquery.effects.highlight","value":{"rev":"3-44ef3c62a6b829382bffa6393cd31ed9"}}, -{"id":"jquery.effects.pulsate","key":"jquery.effects.pulsate","value":{"rev":"3-3cad87635cecc2602d40682cf669d2fe"}}, -{"id":"jquery.effects.scale","key":"jquery.effects.scale","value":{"rev":"3-2c8df02eeed343088e2253d84064a219"}}, -{"id":"jquery.effects.shake","key":"jquery.effects.shake","value":{"rev":"3-d63ab567d484311744d848b520a720c7"}}, -{"id":"jquery.effects.slide","key":"jquery.effects.slide","value":{"rev":"3-9eb5d1075d67045a8fa305e596981934"}}, -{"id":"jquery.effects.transfer","key":"jquery.effects.transfer","value":{"rev":"3-371bc87350ede6da53a40468b63200a9"}}, -{"id":"jquery.tmpl","key":"jquery.tmpl","value":{"rev":"5-75efd6c8c0ce030f2da12b984f9dfe6c"}}, -{"id":"jquery.ui.accordion","key":"jquery.ui.accordion","value":{"rev":"3-964ee7d6c50f31e7db6631da28e2261a"}}, -{"id":"jquery.ui.autocomplete","key":"jquery.ui.autocomplete","value":{"rev":"3-950d240629d142eab5e07c2776e39bcc"}}, -{"id":"jquery.ui.button","key":"jquery.ui.button","value":{"rev":"3-a1c7f3eeb9298ac0c116d75a176a6d17"}}, -{"id":"jquery.ui.core","key":"jquery.ui.core","value":{"rev":"3-b7ba340b7304a304f85c4d13438d1195"}}, -{"id":"jquery.ui.datepicker","key":"jquery.ui.datepicker","value":{"rev":"3-5b76579057f1b870959a06ab833f1972"}}, -{"id":"jquery.ui.dialog","key":"jquery.ui.dialog","value":{"rev":"3-0c314cee86bf67298759efcfd47246f6"}}, -{"id":"jquery.ui.draggable","key":"jquery.ui.draggable","value":{"rev":"3-b7a15d2bdbcdc6f0f3cd6e4522f9f1f3"}}, -{"id":"jquery.ui.droppable","key":"jquery.ui.droppable","value":{"rev":"3-86d8a1558f5e9383b271b4d968ba081d"}}, -{"id":"jquery.ui.mouse","key":"jquery.ui.mouse","value":{"rev":"3-ccb88d773c452c778c694f9f551cb816"}}, -{"id":"jquery.ui.position","key":"jquery.ui.position","value":{"rev":"3-c49c13b38592a363585600b7af54d977"}}, -{"id":"jquery.ui.progressbar","key":"jquery.ui.progressbar","value":{"rev":"3-b28dfadab64f9548b828c42bf870fcc9"}}, -{"id":"jquery.ui.resizable","key":"jquery.ui.resizable","value":{"rev":"3-aa356230544cbe8ab8dc5fab08cc0fa7"}}, -{"id":"jquery.ui.selectable","key":"jquery.ui.selectable","value":{"rev":"3-6b11846c104d580556e40eb5194c45f2"}}, -{"id":"jquery.ui.slider","key":"jquery.ui.slider","value":{"rev":"3-e8550b76bf58a9cbeca9ea91eb763257"}}, -{"id":"jquery.ui.sortable","key":"jquery.ui.sortable","value":{"rev":"3-1ddd981bd720f055fbd5bb1d06df55ad"}}, -{"id":"jquery.ui.tabs","key":"jquery.ui.tabs","value":{"rev":"3-e0514383f4d920b9dc23ef7a7ea4d8af"}}, -{"id":"jquery.ui.widget","key":"jquery.ui.widget","value":{"rev":"3-3a0800fa067c12d013168f74acf21e6d"}}, -{"id":"jqueryify","key":"jqueryify","value":{"rev":"3-2655cf6a45795a8bd138a464e6c18f04"}}, -{"id":"jrep","key":"jrep","value":{"rev":"3-edbcf6931b8a2b3f550727d8b839acc3"}}, -{"id":"js-beautify-node","key":"js-beautify-node","value":{"rev":"3-401cd1c130aaec2c090b578fe8db6290"}}, -{"id":"js-class","key":"js-class","value":{"rev":"5-a63fbb0136dcd602feee72e70674d5db"}}, -{"id":"js-jango","key":"js-jango","value":{"rev":"3-af4e4a7844791617e66a40a1c403bb98"}}, -{"id":"js-loader","key":"js-loader","value":{"rev":"13-8d9729495c1692e47d2cd923e839b4c8"}}, -{"id":"js-manager","key":"js-manager","value":{"rev":"5-6d384a2ce4737f13d417f85689c3c372"}}, -{"id":"js-nts","key":"js-nts","value":{"rev":"3-7d921611b567d2d890bc983c343558ef"}}, -{"id":"js-openstack","key":"js-openstack","value":{"rev":"11-d56996be276fbe6162573575932b1cba"}}, -{"id":"js-select","key":"js-select","value":{"rev":"9-9d20f6d86d9e6f8a84191346288b76ed"}}, -{"id":"js.io","key":"js.io","value":{"rev":"3-c5e16e13372ba592ccf2ac86ee007a1f"}}, -{"id":"js2","key":"js2","value":{"rev":"35-2dc694e48b67252d8787f5e889a07430"}}, -{"id":"js2coffee","key":"js2coffee","value":{"rev":"19-8eeafa894dcc0dc306b02e728543511e"}}, -{"id":"jsDAV","key":"jsDAV","value":{"rev":"11-4ab1935d98372503439b054daef2e78e"}}, -{"id":"jsDump","key":"jsDump","value":{"rev":"5-32d6e4032bd114245356970f0b76a58a"}}, -{"id":"jsSourceCodeParser","key":"jsSourceCodeParser","value":{"rev":"3-78c5e8624ab25fca99a7bb6cd9be402b"}}, -{"id":"jsapp","key":"jsapp","value":{"rev":"3-6758eb2743cc22f723a6612b34c8d943"}}, -{"id":"jscc-node","key":"jscc-node","value":{"rev":"3-5f52dc20dc2a188bc32e7219c9d2f225"}}, -{"id":"jscheckstyle","key":"jscheckstyle","value":{"rev":"5-82021f06a1bd824ac195e0ab8a3b598c"}}, -{"id":"jsclass","key":"jsclass","value":{"rev":"9-2a0656b9497c5a8208a0fefa5aae3350"}}, -{"id":"jsconfig","key":"jsconfig","value":{"rev":"3-b1afef99468f81eff319453623135a56"}}, -{"id":"jscssp","key":"jscssp","value":{"rev":"6-413ad0701e6dbb412e8a01aadb6672c4"}}, -{"id":"jsdata","key":"jsdata","value":{"rev":"5-53f8b26f28291dccfdff8f14e7f4c44c"}}, -{"id":"jsdeferred","key":"jsdeferred","value":{"rev":"8-bc238b921a1fa465503722756a98e9b7"}}, -{"id":"jsdoc","key":"jsdoc","value":{"rev":"3-386eb47a2761a1ad025996232751fba9"}}, -{"id":"jsdog","key":"jsdog","value":{"rev":"11-d4a523898a7c474b5c7b8cb8b24bafe8"}}, -{"id":"jsdom","key":"jsdom","value":{"rev":"63-86bc6b9d8bfdb99b793ac959e126f7ff"}}, -{"id":"jsftp","key":"jsftp","value":{"rev":"35-89cd772521d7ac3cead71c602ddeb819"}}, -{"id":"jsgi","key":"jsgi","value":{"rev":"20-dbef9d8dfb5c9bf1a3b6014159bb305a"}}, -{"id":"jsgi-node","key":"jsgi-node","value":{"rev":"1-8ec0892e521754aaf88684714d306af9"}}, -{"id":"jsgrep","key":"jsgrep","value":{"rev":"7-be19445481acdbbb684fdc2425d88d08"}}, -{"id":"jshelpers","key":"jshelpers","value":{"rev":"11-9509dcdd48bc494de76cae66217ebedb"}}, -{"id":"jshint","key":"jshint","value":{"rev":"34-ed2e7ea0e849126bd9821b86f23b7314"}}, -{"id":"jshint-autofix","key":"jshint-autofix","value":{"rev":"9-abbb3622aa8a47a8890dbbaab0009b6d"}}, -{"id":"jshint-mode","key":"jshint-mode","value":{"rev":"5-06ec066819b93c7ae6782c755a0e2125"}}, -{"id":"jshint-runner","key":"jshint-runner","value":{"rev":"7-6fc8a15e387a4e81e300a54a86a3a240"}}, -{"id":"jshtml","key":"jshtml","value":{"rev":"5-d3e96c31cf1cd2fcf7743defc1631c3a"}}, -{"id":"jsinc","key":"jsinc","value":{"rev":"9-0e4dc3ba04b440085a79d6001232abfc"}}, -{"id":"jslint","key":"jslint","value":{"rev":"10-ab451352333b5f3d29c6cdbab49187dd"}}, -{"id":"jslint-core","key":"jslint-core","value":{"rev":"3-1f874d8cca07b6f007bc80c23ba15e2e"}}, -{"id":"jslint-strict","key":"jslint-strict","value":{"rev":"8-3d694a0f3079691da1866de16f290ea2"}}, -{"id":"jslinux","key":"jslinux","value":{"rev":"13-033cb60c7867aae599863323a97f45c0"}}, -{"id":"jslitmus","key":"jslitmus","value":{"rev":"6-d3f3f82ea1a376acc2b24c69da003409"}}, -{"id":"jsmeter","key":"jsmeter","value":{"rev":"5-7838bb9b970cbaa29a48802c508fd091"}}, -{"id":"jsmin","key":"jsmin","value":{"rev":"6-002ad1b385915e60f895b5e52492fb94"}}, -{"id":"json","key":"json","value":{"rev":"39-1d24fb8c3bdf0ac533bfc52e74420adc"}}, -{"id":"json-browser","key":"json-browser","value":{"rev":"6-883f051c1297cf631adba1c855ff2e13"}}, -{"id":"json-builder","key":"json-builder","value":{"rev":"5-e7a996ff1ef89114ce2ab6de9b653af8"}}, -{"id":"json-command","key":"json-command","value":{"rev":"16-8239cb65563720c42da5562d3a031b09"}}, -{"id":"json-fu","key":"json-fu","value":{"rev":"5-7933c35711cb9d7673d7514fe495c56d"}}, -{"id":"json-line-protocol","key":"json-line-protocol","value":{"rev":"7-98de63467d154b40a029391af8a26042"}}, -{"id":"json-object","key":"json-object","value":{"rev":"7-534cd9680c386c5b9800848755698f2b"}}, -{"id":"json-ref","key":"json-ref","value":{"rev":"3-cd09776d166c3f77013e429737c7e1e9"}}, -{"id":"json-san","key":"json-san","value":{"rev":"7-8683abde23232c1d84266e7a2d5c4527"}}, -{"id":"json-schema","key":"json-schema","value":{"rev":"1-2f323062e7ec80d2ff765da43c7aaa7d"}}, -{"id":"json-sockets","key":"json-sockets","value":{"rev":"26-bfef71c0d9fb4d56010b05f47f142748"}}, -{"id":"json-storage","key":"json-storage","value":{"rev":"3-46139e3a54c0a27e67820df2c7e87dbf"}}, -{"id":"json-storage-model","key":"json-storage-model","value":{"rev":"3-8b77044e192791613cf92b2f3317357f"}}, -{"id":"json-streamify","key":"json-streamify","value":{"rev":"5-d98cd72265fba652481eef6baa980f46"}}, -{"id":"json-streams","key":"json-streams","value":{"rev":"3-e07fc5ca24b33145c8aacf9995d46723"}}, -{"id":"json-tables","key":"json-tables","value":{"rev":"3-37a652b54880487e66ffeee6822b945b"}}, -{"id":"json-template","key":"json-template","value":{"rev":"3-9ee3a101c60ea682fb88759b2df837e4"}}, -{"id":"json2","key":"json2","value":{"rev":"12-bc3d411db772e0947ca58a54c2084073"}}, -{"id":"json2ify","key":"json2ify","value":{"rev":"3-c2d6677cc35e4668c97cf6800a4728d8"}}, -{"id":"json2xml","key":"json2xml","value":{"rev":"3-e955b994479362685e2197b39909dea2"}}, -{"id":"json_req","key":"json_req","value":{"rev":"15-14520bc890cbb0ab4c142b59bf21c9f1"}}, -{"id":"jsonapi","key":"jsonapi","value":{"rev":"11-2b27aaca5643d6a5b3ab38721cf6342f"}}, -{"id":"jsonconfig","key":"jsonconfig","value":{"rev":"5-0072bb54cb0ae5b13eee4f1657ba6a29"}}, -{"id":"jsond","key":"jsond","value":{"rev":"13-7c3622aeb147dae4698608ee32d81b45"}}, -{"id":"jsondate","key":"jsondate","value":{"rev":"3-1da5d30ee1cf7c6d9605a446efd91478"}}, -{"id":"jsonds","key":"jsonds","value":{"rev":"9-af2867869a46787e58c337e700dbf0dd"}}, -{"id":"jsonds2","key":"jsonds2","value":{"rev":"3-e7ed9647cc1ba72e59b625840358c7ca"}}, -{"id":"jsonfiles","key":"jsonfiles","value":{"rev":"3-5e643ba75c401f653f505e7938540d83"}}, -{"id":"jsonify","key":"jsonify","value":{"rev":"3-91207fd1bc11668be7906f74992de6bb"}}, -{"id":"jsonize","key":"jsonize","value":{"rev":"3-4881031480a5326d9f5966189170db25"}}, -{"id":"jsonlint","key":"jsonlint","value":{"rev":"11-88d3c1c395846e7687f410e0dc405469"}}, -{"id":"jsonml","key":"jsonml","value":{"rev":"3-9990d9515fa554b5c7ff8bf8c7bb3308"}}, -{"id":"jsonparse","key":"jsonparse","value":{"rev":"3-569962847a5fd9d65fdf91af9e3e87a5"}}, -{"id":"jsonpointer","key":"jsonpointer","value":{"rev":"5-0310a11e82e9e22a4e5239dee2bc2213"}}, -{"id":"jsonprettify","key":"jsonprettify","value":{"rev":"3-173ae677f2110dfff8cb17dd2b4c68de"}}, -{"id":"jsonreq","key":"jsonreq","value":{"rev":"5-84b47d8c528ea7efa9aae113e5ff53cf"}}, -{"id":"jsonrpc","key":"jsonrpc","value":{"rev":"10-e40ff49715537320cbbbde67378f099e"}}, -{"id":"jsonrpc-ws","key":"jsonrpc-ws","value":{"rev":"7-73c385f3d35dadbdc87927f6a751e3ca"}}, -{"id":"jsonrpc2","key":"jsonrpc2","value":{"rev":"13-71efdea4f551d3a2550fcf5355ea8c8c"}}, -{"id":"jsontool","key":"jsontool","value":{"rev":"14-44bc979d3a8dc9295c825def01e533b4"}}, -{"id":"jsontoxml","key":"jsontoxml","value":{"rev":"8-2640fd26237ab4a45450748d392dd2d2"}}, -{"id":"jsontry","key":"jsontry","value":{"rev":"3-adb3f32f86419ac4b589ce41ab253952"}}, -{"id":"jsorm-i18n","key":"jsorm-i18n","value":{"rev":"3-54347174039512616ed76cc9a37605ea"}}, -{"id":"jsorm-utilities","key":"jsorm-utilities","value":{"rev":"3-187fc9f86ed8d32ebcb6c451fa7cc3c4"}}, -{"id":"jspack","key":"jspack","value":{"rev":"3-84955792d8b57fc301968daf674bace7"}}, -{"id":"jspkg","key":"jspkg","value":{"rev":"5-f5471c37554dad3492021490a70a1190"}}, -{"id":"jspp","key":"jspp","value":{"rev":"8-7607018fa48586f685dda17d77d0999b"}}, -{"id":"jss","key":"jss","value":{"rev":"20-4517b1daeda4f878debddc9f23347f00"}}, -{"id":"jst","key":"jst","value":{"rev":"27-8372bf5c052b6bd6e28f5d2c89b47e49"}}, -{"id":"jstestdriver","key":"jstestdriver","value":{"rev":"3-d26b172af33d6c45fc3dc96b96865714"}}, -{"id":"jstoxml","key":"jstoxml","value":{"rev":"15-c26b77ed5228500238c7b21a3dbdbbb7"}}, -{"id":"jsup","key":"jsup","value":{"rev":"3-54eb8598ae1a49bd1540e482a44a6abc"}}, -{"id":"jthon","key":"jthon","value":{"rev":"5-d578940ac32497839ff48d3f6205e9e2"}}, -{"id":"juggernaut","key":"juggernaut","value":{"rev":"20-15d33218943b9ec64b642e2a4a05e4b8"}}, -{"id":"juggernaut-yoomee","key":"juggernaut-yoomee","value":{"rev":"7-a58d429e46aac76260e236c64d20ff02"}}, -{"id":"jump","key":"jump","value":{"rev":"19-d47e23c31dc623b54e60004b08f6f624"}}, -{"id":"jumprope","key":"jumprope","value":{"rev":"5-98d4e2452f14d3b0996f04882b07d674"}}, -{"id":"junction","key":"junction","value":{"rev":"3-2b73ea17d862b1e95039141e98e53268"}}, -{"id":"jus-config","key":"jus-config","value":{"rev":"5-d2da00317dceb712d82dbfc776122dbe"}}, -{"id":"jus-i18n","key":"jus-i18n","value":{"rev":"3-d146cfc5f3c9aee769390ed921836b6e"}}, -{"id":"jus-task","key":"jus-task","value":{"rev":"13-d127de2a102eef2eb0d1b67810ecd558"}}, -{"id":"justtest","key":"justtest","value":{"rev":"17-467ee4ca606f0447a0c458550552fd0a"}}, -{"id":"jute","key":"jute","value":{"rev":"99-158d262e9126de5026bbfeb3168d9277"}}, -{"id":"jwt","key":"jwt","value":{"rev":"3-4cb8a706d1bc3c300bdadeba781c7bc4"}}, -{"id":"kaffeine","key":"kaffeine","value":{"rev":"47-261825b8d8cdf168387c6a275682dd0b"}}, -{"id":"kafka","key":"kafka","value":{"rev":"9-7465d4092e6322d0b744f017be8ffcea"}}, -{"id":"kahan","key":"kahan","value":{"rev":"5-107bb2dcdb51faaa00aef1e37eff91eb"}}, -{"id":"kahve-ansi","key":"kahve-ansi","value":{"rev":"5-a86d9a3ea56362fa81c8ee9f1ef8f2ef"}}, -{"id":"kahve-cake","key":"kahve-cake","value":{"rev":"3-873b4e553c4ba417c888aadce3b800f6"}}, -{"id":"kahve-classmethod","key":"kahve-classmethod","value":{"rev":"3-08e0a5786edc15539cc6746fe6c65bec"}}, -{"id":"kahve-exception","key":"kahve-exception","value":{"rev":"3-fb9d839cfdc069271cbc10fa27a87f3c"}}, -{"id":"kahve-progress","key":"kahve-progress","value":{"rev":"3-d2fcdd99793a0c3c3a314afb067a3701"}}, -{"id":"kanso","key":"kanso","value":{"rev":"41-2b18ab56cc86313daa840b7b3f63b318"}}, -{"id":"kaph","key":"kaph","value":{"rev":"7-c24622e38cf23bac67459bfe5a0edd63"}}, -{"id":"karait","key":"karait","value":{"rev":"9-a4abc4bc11c747448c4884cb714737c9"}}, -{"id":"kasabi","key":"kasabi","value":{"rev":"3-36cb65aef11d181c532f4549d58944e6"}}, -{"id":"kassit","key":"kassit","value":{"rev":"27-6fafe5122a4dda542a34ba18dddfc9ea"}}, -{"id":"kdtree","key":"kdtree","value":{"rev":"9-177bf5018be1f177d302af1d746b0462"}}, -{"id":"keeper","key":"keeper","value":{"rev":"13-43ce24b6e1fb8ac23c58a78e3e92d137"}}, -{"id":"kestrel","key":"kestrel","value":{"rev":"3-1303ae0617ed1076eed022176c78b0c4"}}, -{"id":"kettle","key":"kettle","value":{"rev":"3-385c10c43df484666148e796840e72c7"}}, -{"id":"keyed_list","key":"keyed_list","value":{"rev":"5-c98d8bc8619300da1a09098bb298bf16"}}, -{"id":"keyframely","key":"keyframely","value":{"rev":"5-586380d2258a099d8fa4748f2688b571"}}, -{"id":"keygrip","key":"keygrip","value":{"rev":"18-4178954fb4f0e26407851104876f1a03"}}, -{"id":"keyjson","key":"keyjson","value":{"rev":"5-96ab1d8b6fa77864883b657360070af4"}}, -{"id":"keymaster","key":"keymaster","value":{"rev":"8-e7eb722489b02991943e9934b8155162"}}, -{"id":"keys","key":"keys","value":{"rev":"12-8b34b8f593667f0c23f1841edb5b6fa3"}}, -{"id":"keysym","key":"keysym","value":{"rev":"13-ec57906511f8f2f896a9e81dc206ea77"}}, -{"id":"keyx","key":"keyx","value":{"rev":"3-80dc49b56e3ba1d280298c36afa2a82c"}}, -{"id":"khronos","key":"khronos","value":{"rev":"3-1a3772db2725c4c3098d5cf4ca2189a4"}}, -{"id":"kindred","key":"kindred","value":{"rev":"5-99c7f4f06e4a47e476f9d75737f719d7"}}, -{"id":"kiokujs","key":"kiokujs","value":{"rev":"8-4b96a9bc1866f58bb263b310e64df403"}}, -{"id":"kiokujs-backend-batch","key":"kiokujs-backend-batch","value":{"rev":"3-4739de0f2e0c01581ce0b02638d3df02"}}, -{"id":"kiokujs-backend-couchdb","key":"kiokujs-backend-couchdb","value":{"rev":"8-53e830e0a7e8ea810883c00ce79bfeef"}}, -{"id":"kiss.js","key":"kiss.js","value":{"rev":"11-7c9b1d7e2faee25ade6f1cad1bb261d9"}}, -{"id":"kissy","key":"kissy","value":{"rev":"8-3f8f7c169a3e84df6a7f68315f13b3ba"}}, -{"id":"kitkat","key":"kitkat","value":{"rev":"41-5f2600e4e1c503f63702c74195ff3361"}}, -{"id":"kitkat-express","key":"kitkat-express","value":{"rev":"3-91ef779ed9acdad1ca6f776e10a70246"}}, -{"id":"kizzy","key":"kizzy","value":{"rev":"5-f281b9e4037eda414f918ec9021e28c9"}}, -{"id":"kjs","key":"kjs","value":{"rev":"3-2ee03262f843e497161f1aef500dd229"}}, -{"id":"kju","key":"kju","value":{"rev":"5-0a7de1cd26864c85a22c7727c660d441"}}, -{"id":"klass","key":"klass","value":{"rev":"39-61491ef3824772d5ef33f7ea04219461"}}, -{"id":"klout-js","key":"klout-js","value":{"rev":"8-8d99f6dad9c21cb5da0d64fefef8c6d6"}}, -{"id":"knid","key":"knid","value":{"rev":"7-2cbfae088155da1044b568584cd296df"}}, -{"id":"knox","key":"knox","value":{"rev":"19-3c42553bd201b23a6bc15fdd073dad17"}}, -{"id":"knox-stream","key":"knox-stream","value":{"rev":"17-e40275f926b6ed645e4ef04caf8e5df4"}}, -{"id":"kns","key":"kns","value":{"rev":"9-5da1a89ad8c08f4b10cd715036200da3"}}, -{"id":"ko","key":"ko","value":{"rev":"9-9df2853d0e9ed9f7740f53291d0035dd"}}, -{"id":"koala","key":"koala","value":{"rev":"8-9e3fea91917f6d8cfb5aae22115e132f"}}, -{"id":"kohai","key":"kohai","value":{"rev":"3-1721a193589459fa077fea809fd7c9a9"}}, -{"id":"koku","key":"koku","value":{"rev":"5-414736980e0e70d90cd7f29b175fb18c"}}, -{"id":"komainu","key":"komainu","value":{"rev":"5-0f1a8f132fe58385e989dd4f93aefa26"}}, -{"id":"komodo-scheme","key":"komodo-scheme","value":{"rev":"3-97d1bd27f069684c491012e079fd82c4"}}, -{"id":"konphyg","key":"konphyg","value":{"rev":"7-e5fc03d6ddf39f2e0723291800bf0d43"}}, -{"id":"kranium","key":"kranium","value":{"rev":"3-4a78d2eb28e949a55b0dbd2ab00cecaf"}}, -{"id":"kue","key":"kue","value":{"rev":"21-053b32204d89a3067c5a90ca62ede08c"}}, -{"id":"kyatchi","key":"kyatchi","value":{"rev":"21-8dfbbe498f3740a2869c82e4ab4522d1"}}, -{"id":"kyoto","key":"kyoto","value":{"rev":"15-b9acdad89d56c71b6f427a443c16f85f"}}, -{"id":"kyoto-client","key":"kyoto-client","value":{"rev":"11-7fb392ee23ce64a48ae5638d713f4fbd"}}, -{"id":"kyoto-tycoon","key":"kyoto-tycoon","value":{"rev":"18-81ece8df26dbd9986efe1d97d935bec2"}}, -{"id":"kyuri","key":"kyuri","value":{"rev":"9-bedd4c087bd7bf612bde5e862d8b91bb"}}, -{"id":"labBuilder","key":"labBuilder","value":{"rev":"11-37f85b5325f1ccf25193c8b737823185"}}, -{"id":"laconic","key":"laconic","value":{"rev":"3-f5b7b9ac113fe7d32cbf4cb0d01c3052"}}, -{"id":"languagedetect","key":"languagedetect","value":{"rev":"3-ac487c034a3470ebd47b54614ea848f9"}}, -{"id":"lastfm","key":"lastfm","value":{"rev":"52-5af213489ca6ecdf2afc851c4642b082"}}, -{"id":"layers","key":"layers","value":{"rev":"7-62cd47d9645faa588c635dab2fbd2ef0"}}, -{"id":"lazy","key":"lazy","value":{"rev":"18-9b5ccdc9c3a970ec4c2b63b6f882da6a"}}, -{"id":"lazy-image","key":"lazy-image","value":{"rev":"5-34a6bc95017c50b3cb69981c7343e5da"}}, -{"id":"lazyBum","key":"lazyBum","value":{"rev":"15-03da6d744ba8cce7efca88ccb7e18c4d"}}, -{"id":"lazyprop","key":"lazyprop","value":{"rev":"14-82b4bcf318094a7950390f03e2fec252"}}, -{"id":"ldapjs","key":"ldapjs","value":{"rev":"11-e2b28e11a0aebe37b758d8f1ed61dd57"}}, -{"id":"ldapjs-riak","key":"ldapjs-riak","value":{"rev":"7-005413a1d4e371663626a3cca200c7e0"}}, -{"id":"ldifgrep","key":"ldifgrep","value":{"rev":"3-e4f06821a3444abbcd3c0c26300dcdda"}}, -{"id":"leaf","key":"leaf","value":{"rev":"8-0ccf5cdd1b59717b53375fe4bf044ec3"}}, -{"id":"lean","key":"lean","value":{"rev":"3-32dbbc771a3f1f6697c21c5d6c516967"}}, -{"id":"leche","key":"leche","value":{"rev":"7-0f5e19052ae1e3cb25ff2aa73271ae4f"}}, -{"id":"leche.spice.io","key":"leche.spice.io","value":{"rev":"3-07db415fdb746873f211e8155ecdf232"}}, -{"id":"less","key":"less","value":{"rev":"37-160fe5ea5dba44f02defdb8ec8c647d5"}}, -{"id":"less-bal","key":"less-bal","value":{"rev":"3-d50532c7c46013a62d06a0e54f8846ce"}}, -{"id":"less4clients","key":"less4clients","value":{"rev":"5-343d2973a166801681c856558d975ddf"}}, -{"id":"lessup","key":"lessup","value":{"rev":"9-a2e7627ef1b493fe82308d019ae481ac"}}, -{"id":"lessweb","key":"lessweb","value":{"rev":"9-e21794e578884c228dbed7c5d6128a41"}}, -{"id":"leveldb","key":"leveldb","value":{"rev":"11-3809e846a7a5ff883d17263288664195"}}, -{"id":"levenshtein","key":"levenshtein","value":{"rev":"6-44d27b6a6bc407772cafc29af485854f"}}, -{"id":"lib","key":"lib","value":{"rev":"5-a95272f11e927888c8b711503fce670b"}}, -{"id":"libdtrace","key":"libdtrace","value":{"rev":"8-4d4f72b2349154da514700f576e34564"}}, -{"id":"liberator","key":"liberator","value":{"rev":"15-b702710ccb3b45e41e9e2f3ebb6375ae"}}, -{"id":"libirc","key":"libirc","value":{"rev":"3-05b125de0c179dd311129aac2e1c8047"}}, -{"id":"liblzg","key":"liblzg","value":{"rev":"5-445ed45dc3cd166a299f85f6149aa098"}}, -{"id":"libnotify","key":"libnotify","value":{"rev":"10-c6723206898865e4828e963f5acc005e"}}, -{"id":"libxml-to-js","key":"libxml-to-js","value":{"rev":"33-64d3152875d33d6feffd618152bc41df"}}, -{"id":"libxmlext","key":"libxmlext","value":{"rev":"3-6a896dacba6f25fbca9b79d4143aaa9a"}}, -{"id":"libxmljs","key":"libxmljs","value":{"rev":"17-4b2949b53d9ecde79a99361774c1144b"}}, -{"id":"libxpm","key":"libxpm","value":{"rev":"3-c03efe75832c4416ceee5d72be12a8ef"}}, -{"id":"libyaml","key":"libyaml","value":{"rev":"5-f279bde715345a4e81d43c1d798ee608"}}, -{"id":"lift","key":"lift","value":{"rev":"21-61dcb771e5e0dc03fa327120d440ccda"}}, -{"id":"light-traits","key":"light-traits","value":{"rev":"26-b35c49550f9380fd462d57c64d51540f"}}, -{"id":"lightnode","key":"lightnode","value":{"rev":"3-ce37ccbf6a6546d4fa500e0eff84e882"}}, -{"id":"limestone","key":"limestone","value":{"rev":"3-d6f76ae98e4189db4ddfa8e15b4cdea9"}}, -{"id":"limited-file","key":"limited-file","value":{"rev":"3-c1d78250965b541836a70d3e867c694f"}}, -{"id":"lin","key":"lin","value":{"rev":"17-0a26ea2a603df0d14a9c40aad96bfb5e"}}, -{"id":"line-parser","key":"line-parser","value":{"rev":"7-84047425699f5a8a8836f4f2e63777bc"}}, -{"id":"line-reader","key":"line-reader","value":{"rev":"9-d2a7cb3a9793149e643490dc16a1eb50"}}, -{"id":"linebuffer","key":"linebuffer","value":{"rev":"12-8e79075aa213ceb49b28e0af7b3f3861"}}, -{"id":"lines","key":"lines","value":{"rev":"9-01a0565f47c3816919ca75bf77539df5"}}, -{"id":"lines-adapter","key":"lines-adapter","value":{"rev":"23-f287561e42a841c00bbf94bc8741bebc"}}, -{"id":"linestream","key":"linestream","value":{"rev":"5-18c2be87653ecf20407ed70eeb601ae7"}}, -{"id":"lingo","key":"lingo","value":{"rev":"10-b3d62b203c4af108feeaf0e32b2a4186"}}, -{"id":"link","key":"link","value":{"rev":"15-7570cea23333dbe3df11fd71171e6226"}}, -{"id":"linkedin-js","key":"linkedin-js","value":{"rev":"22-1bb1f392a9838684076b422840cf98eb"}}, -{"id":"linkscape","key":"linkscape","value":{"rev":"5-7272f50a54b1db015ce6d1e79eeedad7"}}, -{"id":"linkshare","key":"linkshare","value":{"rev":"3-634c4a18a217f77ccd6b89a9a2473d2a"}}, -{"id":"linode-api","key":"linode-api","value":{"rev":"13-2b43281ec86206312a2c387c9fc2c49f"}}, -{"id":"lint","key":"lint","value":{"rev":"49-fb76fddeb3ca609e5cac75fb0b0ec216"}}, -{"id":"linter","key":"linter","value":{"rev":"18-0fc884c96350f860cf2695f615572dba"}}, -{"id":"lintnode","key":"lintnode","value":{"rev":"8-b70bca986d7bde759521d0693dbc28b8"}}, -{"id":"linux-util","key":"linux-util","value":{"rev":"9-d049e8375e9c50b7f2b6268172d79734"}}, -{"id":"liquid","key":"liquid","value":{"rev":"3-353fa3c93ddf1951e3a75d60e6e8757b"}}, -{"id":"liquor","key":"liquor","value":{"rev":"3-4ee78e69a4a400a4de3491b0954947e7"}}, -{"id":"listener","key":"listener","value":{"rev":"5-02b5858d36aa99dcc5fc03c9274c94ee"}}, -{"id":"litmus","key":"litmus","value":{"rev":"9-7e403d052483301d025e9d09b4e7a9dd"}}, -{"id":"littering","key":"littering","value":{"rev":"5-9026438311ffc18d369bfa886c120bcd"}}, -{"id":"live-twitter-map","key":"live-twitter-map","value":{"rev":"3-45a40054bbab23374a4f1743c8bd711d"}}, -{"id":"livereload","key":"livereload","value":{"rev":"5-11ff486b4014ec1998705dbd396e96f2"}}, -{"id":"load","key":"load","value":{"rev":"7-2fff87aeb91d74bc57c134ee2cf0d65b"}}, -{"id":"loadbuilder","key":"loadbuilder","value":{"rev":"9-fa9c5cb13b3af03f9d9fbf5064fa0e0f"}}, -{"id":"loadit","key":"loadit","value":{"rev":"3-51bee062ed0d985757c6ae24929fa74e"}}, -{"id":"local-cdn","key":"local-cdn","value":{"rev":"9-9c2931766a559cf036318583455456e6"}}, -{"id":"localStorage","key":"localStorage","value":{"rev":"3-455fbe195db27131789b5d59db4504b0"}}, -{"id":"locales","key":"locales","value":{"rev":"5-bee452772e2070ec07af0dd86d6dbc41"}}, -{"id":"localhose","key":"localhose","value":{"rev":"9-3a2f63ecbed2e31400ca7515fd020a77"}}, -{"id":"localhost","key":"localhost","value":{"rev":"3-c6c4f6b5688cbe62865010099c9f461f"}}, -{"id":"localhostapp","key":"localhostapp","value":{"rev":"3-17884c4847c549e07e0c881fdf60d01f"}}, -{"id":"localize","key":"localize","value":{"rev":"7-1f83adb6d1eefcf7222a05f489b5db10"}}, -{"id":"location","key":"location","value":{"rev":"3-cc6fbf77b4ade80312bd95fde4e00015"}}, -{"id":"lockfile","key":"lockfile","value":{"rev":"3-4b4b79c2b0f09cc516db1a9d581c5038"}}, -{"id":"lode","key":"lode","value":{"rev":"15-5062a9a0863770d172097c5074a2bdae"}}, -{"id":"log","key":"log","value":{"rev":"12-0aa7922459ff8397764956c56a106930"}}, -{"id":"log-buddy","key":"log-buddy","value":{"rev":"3-64c6d4927d1d235d927f09c16c874e06"}}, -{"id":"log-watcher","key":"log-watcher","value":{"rev":"3-70f8727054c8e4104f835930578f4ee1"}}, -{"id":"log4js","key":"log4js","value":{"rev":"38-137b28e6e96515da7a6399cae86795dc"}}, -{"id":"log4js-amqp","key":"log4js-amqp","value":{"rev":"3-90530c28ef63d4598c12dfcf450929c0"}}, -{"id":"log5","key":"log5","value":{"rev":"17-920e3765dcfdc31bddf13de6895122b3"}}, -{"id":"logbot","key":"logbot","value":{"rev":"3-234eedc70b5474c713832e642f4dc3b4"}}, -{"id":"logger","key":"logger","value":{"rev":"3-5eef338fb5e845a81452fbb22e582aa7"}}, -{"id":"logging","key":"logging","value":{"rev":"22-99d320792c5445bd04699c4cf19edd89"}}, -{"id":"logging-system","key":"logging-system","value":{"rev":"5-5eda9d0b1d04256f5f44abe51cd14626"}}, -{"id":"loggly","key":"loggly","value":{"rev":"49-944a404e188327431a404e5713691a8c"}}, -{"id":"login","key":"login","value":{"rev":"44-7c450fe861230a5121ff294bcd6f97c9"}}, -{"id":"logly","key":"logly","value":{"rev":"7-832fe9af1cd8bfed84a065822cec398a"}}, -{"id":"logmagic","key":"logmagic","value":{"rev":"11-5d2c7dd32ba55e5ab85127be09723ef8"}}, -{"id":"logmonger","key":"logmonger","value":{"rev":"3-07a101d795f43f7af668210660274a7b"}}, -{"id":"lokki","key":"lokki","value":{"rev":"3-f6efcce38029ea0b4889707764088540"}}, -{"id":"long-stack-traces","key":"long-stack-traces","value":{"rev":"7-4b2fe23359b29e188cb2b8936b63891a"}}, -{"id":"loom","key":"loom","value":{"rev":"3-6348ab890611154da4881a0b351b0cb5"}}, -{"id":"loop","key":"loop","value":{"rev":"3-a56e9a6144f573092bb441106b370e0c"}}, -{"id":"looseleaf","key":"looseleaf","value":{"rev":"57-46ef6f055a40c34c714e3e9b9fe5d4cd"}}, -{"id":"lovely","key":"lovely","value":{"rev":"21-f577923512458f02f48ef59eebe55176"}}, -{"id":"lpd","key":"lpd","value":{"rev":"3-433711ae25002f67aa339380668fd491"}}, -{"id":"lpd-printers","key":"lpd-printers","value":{"rev":"3-47060e6c05fb4aad227d36f6e7941227"}}, -{"id":"lru-cache","key":"lru-cache","value":{"rev":"10-23c5e7423fe315745ef924f58c36e119"}}, -{"id":"ls-r","key":"ls-r","value":{"rev":"7-a769b11a06fae8ff439fe7eeb0806b5e"}}, -{"id":"lsof","key":"lsof","value":{"rev":"5-82aa3bcf23b8026a95e469b6188938f9"}}, -{"id":"ltx","key":"ltx","value":{"rev":"21-89ca85a9ce0c9fc13b20c0f1131168b0"}}, -{"id":"lucky-server","key":"lucky-server","value":{"rev":"3-a50d87239166f0ffc374368463f96b07"}}, -{"id":"lunapark","key":"lunapark","value":{"rev":"3-841d197f404da2e63d69b0c2132d87db"}}, -{"id":"lunchbot","key":"lunchbot","value":{"rev":"3-5d8984bef249e3d9e271560b5753f4cf"}}, -{"id":"lw-nun","key":"lw-nun","value":{"rev":"3-b686f89361b7b405e4581db6c60145ed"}}, -{"id":"lw-sass","key":"lw-sass","value":{"rev":"3-e46f90e0c8eab0c8c5d5eb8cf2a9a6da"}}, -{"id":"lwes","key":"lwes","value":{"rev":"3-939bb87efcbede1c1a70de881686fbce"}}, -{"id":"lwink","key":"lwink","value":{"rev":"3-1c432fafe4809e8d4a7e6214123ae452"}}, -{"id":"lzma","key":"lzma","value":{"rev":"3-31dc39414531e329b42b3a4ea0292c43"}}, -{"id":"m1node","key":"m1node","value":{"rev":"11-b34d55bdbc6f65b1814e77fab4a7e823"}}, -{"id":"m1test","key":"m1test","value":{"rev":"3-815ce56949e41e120082632629439eac"}}, -{"id":"m2node","key":"m2node","value":{"rev":"7-f50ec5578d995dd6a0a38e1049604bfc"}}, -{"id":"m2pdb","key":"m2pdb","value":{"rev":"3-ee798ac17c8c554484aceae2f77a826b"}}, -{"id":"m3u","key":"m3u","value":{"rev":"5-7ca6d768e0aed5b88dd45c943ca9ffa0"}}, -{"id":"mac","key":"mac","value":{"rev":"21-db5883c390108ff9ba46660c78b18b6c"}}, -{"id":"macchiato","key":"macchiato","value":{"rev":"5-0df1c87029e6005577fd8fd5cdb25947"}}, -{"id":"macgyver","key":"macgyver","value":{"rev":"3-f517699102b7bd696d8197d7ce57afb9"}}, -{"id":"macros","key":"macros","value":{"rev":"3-8356bcc0d1b1bd3879eeb880b2f3330b"}}, -{"id":"macrotest","key":"macrotest","value":{"rev":"10-2c6ceffb38f8ce5b0f382dbb02720d70"}}, -{"id":"maddy","key":"maddy","value":{"rev":"9-93d59c65c3f44aa6ed43dc986dd73ca5"}}, -{"id":"madmimi-node","key":"madmimi-node","value":{"rev":"11-257e1b1bd5ee5194a7052542952b8b7a"}}, -{"id":"maga","key":"maga","value":{"rev":"24-c69734f9fc138788db741b862f889583"}}, -{"id":"magic","key":"magic","value":{"rev":"34-aed787cc30ab86c95f547b9555d6a381"}}, -{"id":"magic-templates","key":"magic-templates","value":{"rev":"3-89546e9a038150cf419b4b15a84fd2aa"}}, -{"id":"magickal","key":"magickal","value":{"rev":"3-e9ed74bb90df0a52564d47aed0451ce7"}}, -{"id":"mai","key":"mai","value":{"rev":"5-f3561fe6de2bd25201250ddb6dcf9f01"}}, -{"id":"mail","key":"mail","value":{"rev":"14-9ae558552e6a7c11017f118a71c072e9"}}, -{"id":"mail-stack","key":"mail-stack","value":{"rev":"5-c82567203540076cf4878ea1ab197b52"}}, -{"id":"mailbox","key":"mailbox","value":{"rev":"12-0b582e127dd7cf669de16ec36f8056a4"}}, -{"id":"mailchimp","key":"mailchimp","value":{"rev":"23-3d9328ee938b7940322351254ea54877"}}, -{"id":"mailer","key":"mailer","value":{"rev":"40-7b251b758f9dba4667a3127195ea0380"}}, -{"id":"mailer-bal","key":"mailer-bal","value":{"rev":"3-fc8265b1905ea37638309d7c10852050"}}, -{"id":"mailer-fixed","key":"mailer-fixed","value":{"rev":"13-3004df43c62eb64ed5fb0306b019fe66"}}, -{"id":"mailgun","key":"mailgun","value":{"rev":"25-29de1adb355636822dc21fef51f37aed"}}, -{"id":"mailparser","key":"mailparser","value":{"rev":"14-7142e4168046418afc4a76d1b330f302"}}, -{"id":"mailto-parser","key":"mailto-parser","value":{"rev":"3-f8dea7b60c0e993211f81a86dcf5b18d"}}, -{"id":"makeerror","key":"makeerror","value":{"rev":"17-ceb9789357d80467c9ae75caa64ca8ac"}}, -{"id":"malt","key":"malt","value":{"rev":"7-e5e76a842eb0764a5ebe57290b629097"}}, -{"id":"mango","key":"mango","value":{"rev":"7-6224e74a3132e54f294f62998ed9127f"}}, -{"id":"map-reduce","key":"map-reduce","value":{"rev":"11-a81d8bdc6dae7e7b76d5df74fff40ae1"}}, -{"id":"mapnik","key":"mapnik","value":{"rev":"64-693f5b957b7faf361c2cc2a22747ebf7"}}, -{"id":"maptail","key":"maptail","value":{"rev":"14-8334618ddc20006a5f77ff35b172c152"}}, -{"id":"marak","key":"marak","value":{"rev":"3-27be187af00fc97501035dfb97a11ecf"}}, -{"id":"markdoc","key":"markdoc","value":{"rev":"13-23becdeda44b26ee54c9aaa31457e4ba"}}, -{"id":"markdom","key":"markdom","value":{"rev":"10-3c0df12e4f4a2e675d0f0fde48aa425f"}}, -{"id":"markdown","key":"markdown","value":{"rev":"19-88e02c28ce0179be900bf9e6aadc070f"}}, -{"id":"markdown-js","key":"markdown-js","value":{"rev":"6-964647c2509850358f70f4e23670fbeb"}}, -{"id":"markdown-wiki","key":"markdown-wiki","value":{"rev":"6-ce35fb0612a463db5852c5d3dcc7fdd3"}}, -{"id":"markdown2html","key":"markdown2html","value":{"rev":"3-549babe5d9497785fa8b9305c81d7214"}}, -{"id":"marked","key":"marked","value":{"rev":"21-9371df65f63131c9f24e8805db99a7d9"}}, -{"id":"markov","key":"markov","value":{"rev":"13-9ab795448c54ef87851f1392d6f3671a"}}, -{"id":"maryjane","key":"maryjane","value":{"rev":"3-e2e6cce443850b5df1554bf851d16760"}}, -{"id":"massagist","key":"massagist","value":{"rev":"11-cac3a103aecb4ff3f0f607aca2b1d3fb"}}, -{"id":"masson","key":"masson","value":{"rev":"10-87a5e6fd05bd4b8697fa3fa636238c20"}}, -{"id":"masstransit","key":"masstransit","value":{"rev":"11-74898c746e541ff1a00438017ee66d4a"}}, -{"id":"matchmaker","key":"matchmaker","value":{"rev":"3-192db6fb162bdf84fa3e858092fd3e20"}}, -{"id":"math","key":"math","value":{"rev":"5-16a74d8639e44a5ccb265ab1a3b7703b"}}, -{"id":"math-lexer","key":"math-lexer","value":{"rev":"19-54b42374b0090eeee50f39cb35f2eb40"}}, -{"id":"matrices","key":"matrices","value":{"rev":"43-06d64271a5148f89d649645712f8971f"}}, -{"id":"matrix","key":"matrix","value":{"rev":"3-77cff57242445cf3d76313b72bbc38f4"}}, -{"id":"matrixlib","key":"matrixlib","value":{"rev":"11-b3c105a5e5be1835183e7965d04825d9"}}, -{"id":"matterhorn","key":"matterhorn","value":{"rev":"9-a310dba2ea054bdce65e6df2f6ae85e5"}}, -{"id":"matterhorn-dust","key":"matterhorn-dust","value":{"rev":"3-2fb311986d62cf9f180aa76038ebf7b3"}}, -{"id":"matterhorn-gui","key":"matterhorn-gui","value":{"rev":"3-7921b46c9bff3ee82e4b32bc0a0a977d"}}, -{"id":"matterhorn-prng","key":"matterhorn-prng","value":{"rev":"3-c33fd59c1f1d24fb423553ec242e444b"}}, -{"id":"matterhorn-standard","key":"matterhorn-standard","value":{"rev":"13-0aaab6ecf55cdad6f773736da968afba"}}, -{"id":"matterhorn-state","key":"matterhorn-state","value":{"rev":"3-0ba8fd8a4c644b18aff34f1aef95db33"}}, -{"id":"matterhorn-user","key":"matterhorn-user","value":{"rev":"17-e42dc37a5cb24710803b3bd8dee7484d"}}, -{"id":"matterhorn-view","key":"matterhorn-view","value":{"rev":"3-b39042d665f5912d02e724d33d129a97"}}, -{"id":"mbtiles","key":"mbtiles","value":{"rev":"41-b92035d0ec8f47850734c4bb995baf7d"}}, -{"id":"mcast","key":"mcast","value":{"rev":"8-559b2b09cfa34cb88c16ae72ec90d28a"}}, -{"id":"md5","key":"md5","value":{"rev":"3-43d600c70f6442d3878c447585bf43bf"}}, -{"id":"mdgram","key":"mdgram","value":{"rev":"15-4d65cf0d5edef976de9a612c0cde0907"}}, -{"id":"mdns","key":"mdns","value":{"rev":"11-8b6789c3779fce7f019f9f10c625147a"}}, -{"id":"mecab-binding","key":"mecab-binding","value":{"rev":"3-3395763d23a3f8e3e00ba75cb988f9b4"}}, -{"id":"mechanize","key":"mechanize","value":{"rev":"5-94b72f43e270aa24c00e283fa52ba398"}}, -{"id":"mediatags","key":"mediatags","value":{"rev":"3-d5ea41e140fbbc821590cfefdbd016a5"}}, -{"id":"mediator","key":"mediator","value":{"rev":"3-42aac2225b47f72f97001107a3d242f5"}}, -{"id":"memcache","key":"memcache","value":{"rev":"5-aebcc4babe11b654afd3cede51e945ec"}}, -{"id":"memcached","key":"memcached","value":{"rev":"9-7c46464425c78681a8e6767ef9993c4c"}}, -{"id":"memcouchd","key":"memcouchd","value":{"rev":"3-b57b9fb4f6c60604f616c2f70456b4d6"}}, -{"id":"meme","key":"meme","value":{"rev":"11-53fcb51e1d8f8908b95f0fa12788e9aa"}}, -{"id":"memo","key":"memo","value":{"rev":"9-3a9ca97227ed19cacdacf10ed193ee8b"}}, -{"id":"memoize","key":"memoize","value":{"rev":"15-44bdd127c49035c8bd781a9299c103c2"}}, -{"id":"memoizer","key":"memoizer","value":{"rev":"9-d9a147e8c8a58fd7e8f139dc902592a6"}}, -{"id":"memorystream","key":"memorystream","value":{"rev":"9-6d0656067790e158f3c4628968ed70d3"}}, -{"id":"memstore","key":"memstore","value":{"rev":"5-03dcac59882c8a434e4c2fe2ac354941"}}, -{"id":"mercury","key":"mercury","value":{"rev":"3-147af865af6f7924f44f14f4b5c14dac"}}, -{"id":"mersenne","key":"mersenne","value":{"rev":"7-d8ae550eb8d0deaa1fd60f86351cb548"}}, -{"id":"meryl","key":"meryl","value":{"rev":"23-2c0e3fad99005109c584530e303bc5bf"}}, -{"id":"mesh","key":"mesh","value":{"rev":"5-f3ea4aef5b3f169eab8b518e5044c950"}}, -{"id":"meta-promise","key":"meta-promise","value":{"rev":"5-0badf85ab432341e6256252463468b89"}}, -{"id":"meta-test","key":"meta-test","value":{"rev":"49-92df2922499960ac750ce96d861ddd7e"}}, -{"id":"meta_code","key":"meta_code","value":{"rev":"7-9b4313c0c52a09c788464f1fea05baf7"}}, -{"id":"metamanager","key":"metamanager","value":{"rev":"5-dbb0312dad15416d540eb3d860fbf205"}}, -{"id":"metaweblog","key":"metaweblog","value":{"rev":"3-d3ab090ec27242e220412d6413e388ee"}}, -{"id":"metric","key":"metric","value":{"rev":"3-8a706db5b518421ad640a75e65cb4be9"}}, -{"id":"metrics","key":"metrics","value":{"rev":"13-62e5627c1ca5e6d3b3bde8d17e675298"}}, -{"id":"metrics-broker","key":"metrics-broker","value":{"rev":"15-0fdf57ea4ec84aa1f905f53b4975e72d"}}, -{"id":"mhash","key":"mhash","value":{"rev":"3-f00d65dc939474a5c508d37a327e5074"}}, -{"id":"micro","key":"micro","value":{"rev":"17-882c0ecf34ddaef5c673c547ae80b80b"}}, -{"id":"microcache","key":"microcache","value":{"rev":"3-ef75e04bc6e86d14f93ad9c429503bd9"}}, -{"id":"microevent","key":"microevent","value":{"rev":"3-9c0369289b62873ef6e8624eef724d15"}}, -{"id":"microtest","key":"microtest","value":{"rev":"11-11afdadfb15c1db030768ce52f34de1a"}}, -{"id":"microtime","key":"microtime","value":{"rev":"20-5f75e87316cbb5f7a4be09142cd755e5"}}, -{"id":"middlefiddle","key":"middlefiddle","value":{"rev":"13-bb94c05d75c24bdeb23a4637c7ecf55e"}}, -{"id":"middleware","key":"middleware","value":{"rev":"5-80937a4c620fcc2a5532bf064ec0837b"}}, -{"id":"midi","key":"midi","value":{"rev":"9-96da6599a84a761430adfd41deb3969a"}}, -{"id":"midi-js","key":"midi-js","value":{"rev":"11-1d174af1352e3d37f6ec0df32d56ce1a"}}, -{"id":"migrate","key":"migrate","value":{"rev":"13-7493879fb60a31b9e2a9ad19e94bfef6"}}, -{"id":"mikronode","key":"mikronode","value":{"rev":"31-1edae4ffbdb74c43ea584a7757dacc9b"}}, -{"id":"milk","key":"milk","value":{"rev":"21-81fb117817ed2e4c19e16dc310c09735"}}, -{"id":"millstone","key":"millstone","value":{"rev":"29-73d54de4b4de313b0fec4edfaec741a4"}}, -{"id":"mime","key":"mime","value":{"rev":"33-de72b641474458cb21006dea6a524ceb"}}, -{"id":"mime-magic","key":"mime-magic","value":{"rev":"13-2df6b966d7f29d5ee2dd2e1028d825b1"}}, -{"id":"mimelib","key":"mimelib","value":{"rev":"9-7994cf0fe3007329b9397f4e08481487"}}, -{"id":"mimelib-noiconv","key":"mimelib-noiconv","value":{"rev":"5-c84995d4b2bbe786080c9b54227b5bb4"}}, -{"id":"mimeograph","key":"mimeograph","value":{"rev":"37-bead083230f48f354f3ccac35e11afc0"}}, -{"id":"mimeparse","key":"mimeparse","value":{"rev":"8-5ca7e6702fe7f1f37ed31b05e82f4a87"}}, -{"id":"mingy","key":"mingy","value":{"rev":"19-09b19690c55abc1e940374e25e9a0d26"}}, -{"id":"mini-lzo-wrapper","key":"mini-lzo-wrapper","value":{"rev":"4-d751d61f481363a2786ac0312893dfca"}}, -{"id":"miniee","key":"miniee","value":{"rev":"5-be0833a9f15382695f861a990f3d6108"}}, -{"id":"minifyjs","key":"minifyjs","value":{"rev":"13-f255df8c7567440bc4c0f8eaf04a18c6"}}, -{"id":"minimal","key":"minimal","value":{"rev":"5-6be6b3454d30c59a30f9ee8af0ee606c"}}, -{"id":"minimal-test","key":"minimal-test","value":{"rev":"15-65dca2c1ee27090264577cc8b93983cb"}}, -{"id":"minimatch","key":"minimatch","value":{"rev":"11-449e570c76f4e6015c3dc90f080f8c47"}}, -{"id":"minirpc","key":"minirpc","value":{"rev":"10-e85b92273a97fa86e20faef7a3b50518"}}, -{"id":"ministore","key":"ministore","value":{"rev":"11-f131868141ccd0851bb91800c86dfff1"}}, -{"id":"minitest","key":"minitest","value":{"rev":"13-c92e32499a25ff2d7e484fbbcabe1081"}}, -{"id":"miniweb","key":"miniweb","value":{"rev":"3-e8c413a77e24891138eaa9e73cb08715"}}, -{"id":"minj","key":"minj","value":{"rev":"9-ccf50caf8e38b0fc2508f01a63f80510"}}, -{"id":"minotaur","key":"minotaur","value":{"rev":"29-6d048956b26e8a213f6ccc96027bacde"}}, -{"id":"mirror","key":"mirror","value":{"rev":"21-01bdd78ff03ca3f8f99fce104baab9f9"}}, -{"id":"misao-chan","key":"misao-chan","value":{"rev":"13-f032690f0897fc4a1dc12f1e03926627"}}, -{"id":"mite.node","key":"mite.node","value":{"rev":"13-0bfb15c4a6f172991756660b29869dd4"}}, -{"id":"mixable","key":"mixable","value":{"rev":"3-bc518ab862a6ceacc48952b9bec7d61a"}}, -{"id":"mixin","key":"mixin","value":{"rev":"3-3a7ae89345d21ceaf545d93b20caf2f2"}}, -{"id":"mixinjs","key":"mixinjs","value":{"rev":"3-064173d86b243316ef1b6c5743a60bf9"}}, -{"id":"mixpanel","key":"mixpanel","value":{"rev":"7-f742248bfbfc480658c4c46f7ab7a74a"}}, -{"id":"mixpanel-api","key":"mixpanel-api","value":{"rev":"5-61a3fa28921887344d1af339917e147a"}}, -{"id":"mixpanel_api","key":"mixpanel_api","value":{"rev":"3-11939b6fd20b80bf9537380875bf3996"}}, -{"id":"mjoe","key":"mjoe","value":{"rev":"3-8b3549cd6edcc03112217370b071b076"}}, -{"id":"mjsunit.runner","key":"mjsunit.runner","value":{"rev":"12-94c779b555069ca5fb0bc9688515673e"}}, -{"id":"mkdir","key":"mkdir","value":{"rev":"3-e8fd61b35638f1f3a65d36f09344ff28"}}, -{"id":"mkdirp","key":"mkdirp","value":{"rev":"15-c8eacf17b336ea98d1d9960f02362cbf"}}, -{"id":"mmap","key":"mmap","value":{"rev":"16-df335eb3257dfbd2fb0de341970d2656"}}, -{"id":"mmikulicic-thrift","key":"mmikulicic-thrift","value":{"rev":"3-f4a9f7a97bf50e966d1184fba423a07f"}}, -{"id":"mmmodel","key":"mmmodel","value":{"rev":"7-00d61723742a325aaaa6955ba52cef60"}}, -{"id":"mmodel","key":"mmodel","value":{"rev":"3-717309af27d6c5d98ed188c9c9438a37"}}, -{"id":"mmseg","key":"mmseg","value":{"rev":"17-794d553e67d6023ca3d58dd99fe1da15"}}, -{"id":"mobilize","key":"mobilize","value":{"rev":"25-8a657ec0accf8db2e8d7b935931ab77b"}}, -{"id":"mock","key":"mock","value":{"rev":"3-d8805bff4796462750071cddd3f75ea7"}}, -{"id":"mock-request","key":"mock-request","value":{"rev":"7-4ac4814c23f0899b1100d5f0617e40f4"}}, -{"id":"mock-request-response","key":"mock-request-response","value":{"rev":"5-fe1566c9881039a92a80e0e82a95f096"}}, -{"id":"mocket","key":"mocket","value":{"rev":"13-9001879cd3cb6f52f3b2d85fb14b8f9b"}}, -{"id":"modbus-stack","key":"modbus-stack","value":{"rev":"7-50c56e74d9cb02c5d936b0b44c54f621"}}, -{"id":"model","key":"model","value":{"rev":"3-174181c2f314f35fc289b7a921ba4d39"}}, -{"id":"models","key":"models","value":{"rev":"8-6cc2748edfd96679f9bb3596864874a9"}}, -{"id":"modestmaps","key":"modestmaps","value":{"rev":"8-79265968137a2327f98bfc6943a84da9"}}, -{"id":"modjewel","key":"modjewel","value":{"rev":"3-73efc7b9dc24d82cab1de249896193fd"}}, -{"id":"modlr","key":"modlr","value":{"rev":"17-ccf16db98ab6ccb95e005b3bb76dba64"}}, -{"id":"module-grapher","key":"module-grapher","value":{"rev":"19-b6ba30b41e29fc01d4b679a643f030e5"}}, -{"id":"modulr","key":"modulr","value":{"rev":"15-8e8ffd75c6c6149206de4ce0c2aefad7"}}, -{"id":"mogile","key":"mogile","value":{"rev":"5-79a8af20dbe6bff166ac2197a3998b0c"}}, -{"id":"mojo","key":"mojo","value":{"rev":"25-1d9c26d6afd6ea77253f220d86d60307"}}, -{"id":"monad","key":"monad","value":{"rev":"10-cf20354900b7e67d94c342feb06a1eb9"}}, -{"id":"mongeese","key":"mongeese","value":{"rev":"3-f4b319d98f9f73fb17cd3ebc7fc86412"}}, -{"id":"mongo-pool","key":"mongo-pool","value":{"rev":"3-215481828e69fd874b5938a79a7e0934"}}, -{"id":"mongodb","key":"mongodb","value":{"rev":"147-3dc09965e762787f34131a8739297383"}}, -{"id":"mongodb-async","key":"mongodb-async","value":{"rev":"7-ba9097bdc86b72885fa5a9ebb49a64d0"}}, -{"id":"mongodb-provider","key":"mongodb-provider","value":{"rev":"5-5523643b403e969e0b80c57db08cb9d3"}}, -{"id":"mongodb-rest","key":"mongodb-rest","value":{"rev":"36-60b4abc4a22f31de09407cc7cdd0834f"}}, -{"id":"mongodb-wrapper","key":"mongodb-wrapper","value":{"rev":"13-7a6c5eaff36ede45211aa80f3a506cfe"}}, -{"id":"mongodb_heroku","key":"mongodb_heroku","value":{"rev":"3-05947c1e06e1f8860c7809b063a8d1a0"}}, -{"id":"mongode","key":"mongode","value":{"rev":"11-faa14f050da4a165e2568d413a6b8bc0"}}, -{"id":"mongojs","key":"mongojs","value":{"rev":"26-a628eb51534ffcdd97c1a940d460a52c"}}, -{"id":"mongolia","key":"mongolia","value":{"rev":"76-711c39de0e152e224d4118c9b0de834f"}}, -{"id":"mongolian","key":"mongolian","value":{"rev":"44-3773671b31c406a18cb9f5a1764ebee4"}}, -{"id":"mongoose","key":"mongoose","value":{"rev":"181-03a8aa7f691cbd987995bf6e3354e0f5"}}, -{"id":"mongoose-admin","key":"mongoose-admin","value":{"rev":"7-59078ad5a345e9e66574346d3e70f9ad"}}, -{"id":"mongoose-auth","key":"mongoose-auth","value":{"rev":"49-87c79f3a6164c438a53b7629be87ae5d"}}, -{"id":"mongoose-autoincr","key":"mongoose-autoincr","value":{"rev":"3-9c4dd7c3fdcd8621166665a68fccb602"}}, -{"id":"mongoose-closures","key":"mongoose-closures","value":{"rev":"3-2ff9cff790f387f2236a2c7382ebb55b"}}, -{"id":"mongoose-crypt","key":"mongoose-crypt","value":{"rev":"3-d77ffbf250e39fcc290ad37824fe2236"}}, -{"id":"mongoose-dbref","key":"mongoose-dbref","value":{"rev":"29-02090b9904fd6f5ce72afcfa729f7c96"}}, -{"id":"mongoose-flatmatcher","key":"mongoose-flatmatcher","value":{"rev":"5-4f0565901e8b588cc562ae457ad975a6"}}, -{"id":"mongoose-helpers","key":"mongoose-helpers","value":{"rev":"3-3a57e9819e24c9b0f5b5eabe41037092"}}, -{"id":"mongoose-joins","key":"mongoose-joins","value":{"rev":"3-9bae444730a329473421f50cba1c86a7"}}, -{"id":"mongoose-misc","key":"mongoose-misc","value":{"rev":"3-bcd7f3f450cf6ed233d042ac574409ce"}}, -{"id":"mongoose-relationships","key":"mongoose-relationships","value":{"rev":"9-6155a276b162ec6593b8542f0f769024"}}, -{"id":"mongoose-rest","key":"mongoose-rest","value":{"rev":"29-054330c035adf842ab34423215995113"}}, -{"id":"mongoose-spatial","key":"mongoose-spatial","value":{"rev":"3-88660dabd485edcaa29a2ea01afb90bd"}}, -{"id":"mongoose-temporal","key":"mongoose-temporal","value":{"rev":"3-1dd736395fe9be95498e588df502b7bb"}}, -{"id":"mongoose-types","key":"mongoose-types","value":{"rev":"13-8126458b91ef1bf46e582042f5dbd015"}}, -{"id":"mongoose-units","key":"mongoose-units","value":{"rev":"3-5fcdb7aedb1d5cff6e18ee1352c3d0f7"}}, -{"id":"mongoq","key":"mongoq","value":{"rev":"11-2060d674d5f8a964e800ed4470b92587"}}, -{"id":"mongoskin","key":"mongoskin","value":{"rev":"13-5a7bfacd9e9b95ec469f389751e7e435"}}, -{"id":"mongous","key":"mongous","value":{"rev":"3-4d98b4a4bfdd6d9f46342002a69d8d3a"}}, -{"id":"mongrel2","key":"mongrel2","value":{"rev":"3-93156356e478f30fc32455054e384b80"}}, -{"id":"monguava","key":"monguava","value":{"rev":"9-69ec50128220aba3e16128a4be2799c0"}}, -{"id":"mongueue","key":"mongueue","value":{"rev":"9-fc8d9df5bf15f5a25f68cf58866f11fe"}}, -{"id":"moniker","key":"moniker","value":{"rev":"5-a139616b725ddfdd1db6a376fb6584f7"}}, -{"id":"monitor","key":"monitor","value":{"rev":"56-44d2b8b7dec04b3f320f7dc4a1704c53"}}, -{"id":"monome","key":"monome","value":{"rev":"3-2776736715cbfc045bf7b42e70ccda9c"}}, -{"id":"monomi","key":"monomi","value":{"rev":"6-b6b745441f157cc40c846d23cd14297a"}}, -{"id":"moof","key":"moof","value":{"rev":"13-822b4ebf873b720bd4c7e16fcbbbbb3d"}}, -{"id":"moonshado","key":"moonshado","value":{"rev":"3-b54de1aef733c8fa118fa7cf6af2fb9b"}}, -{"id":"moose","key":"moose","value":{"rev":"5-e11c8b7c09826e3431ed3408ee874779"}}, -{"id":"mootools","key":"mootools","value":{"rev":"9-39f5535072748ccd3cf0212ef4c3d4fa"}}, -{"id":"mootools-array","key":"mootools-array","value":{"rev":"3-d1354704a9fe922d969c2bf718e0dc53"}}, -{"id":"mootools-browser","key":"mootools-browser","value":{"rev":"3-ce0946b357b6ddecc128febef2c5d720"}}, -{"id":"mootools-class","key":"mootools-class","value":{"rev":"3-0ea815d28b61f3880087e3f4b8668354"}}, -{"id":"mootools-class-extras","key":"mootools-class-extras","value":{"rev":"3-575796745bd169c35f4fc0019bb36b76"}}, -{"id":"mootools-client","key":"mootools-client","value":{"rev":"3-b658c331f629f80bfe17c3e6ed44c525"}}, -{"id":"mootools-cookie","key":"mootools-cookie","value":{"rev":"3-af93588531e5a52c76a8e7a4eac3612a"}}, -{"id":"mootools-core","key":"mootools-core","value":{"rev":"3-01b1678fc56d94d29566b7853ad56059"}}, -{"id":"mootools-domready","key":"mootools-domready","value":{"rev":"3-0fc6620e2c8f7d107816cace9c099633"}}, -{"id":"mootools-element","key":"mootools-element","value":{"rev":"3-bac857c1701c91207d1ec6d1eb002d07"}}, -{"id":"mootools-element-dimensions","key":"mootools-element-dimensions","value":{"rev":"3-d82df62b3e97122ad0a7668efb7ba776"}}, -{"id":"mootools-element-event","key":"mootools-element-event","value":{"rev":"3-a30380151989ca31851cf751fcd55e9a"}}, -{"id":"mootools-element-style","key":"mootools-element-style","value":{"rev":"3-6103fa8551a21dc592e410dc7df647f8"}}, -{"id":"mootools-event","key":"mootools-event","value":{"rev":"3-7327279ec157de8c47f3ee24615ead95"}}, -{"id":"mootools-function","key":"mootools-function","value":{"rev":"3-eb3ee17acf40d6cc05463cb88edc6f5e"}}, -{"id":"mootools-fx","key":"mootools-fx","value":{"rev":"3-757ab6c8423e8c434d1ee783ea28cdb5"}}, -{"id":"mootools-fx-css","key":"mootools-fx-css","value":{"rev":"3-8eb0cf468c826b9c485835fab94837e7"}}, -{"id":"mootools-fx-morph","key":"mootools-fx-morph","value":{"rev":"3-b91310f8a81221592970fe7632bd9f7a"}}, -{"id":"mootools-fx-transitions","key":"mootools-fx-transitions","value":{"rev":"3-a1ecde35dfbb80f3a6062005758bb934"}}, -{"id":"mootools-fx-tween","key":"mootools-fx-tween","value":{"rev":"3-39497defbffdf463932cc9f00cde8d5d"}}, -{"id":"mootools-json","key":"mootools-json","value":{"rev":"3-69deb6679a5d1d49f22e19834ae07c32"}}, -{"id":"mootools-more","key":"mootools-more","value":{"rev":"3-d8f46ce319ca0e3deb5fc04ad5f73cb9"}}, -{"id":"mootools-number","key":"mootools-number","value":{"rev":"3-9f4494883ac39f93734fea9af6ef2fc5"}}, -{"id":"mootools-object","key":"mootools-object","value":{"rev":"3-c9632dfa793ab4d9ad4b68a2e27f09fc"}}, -{"id":"mootools-request","key":"mootools-request","value":{"rev":"3-663e5472f351eea3b7488ee441bc6a61"}}, -{"id":"mootools-request-html","key":"mootools-request-html","value":{"rev":"3-0ab9576c11a564d44b3c3ca3ef3dc240"}}, -{"id":"mootools-request-json","key":"mootools-request-json","value":{"rev":"3-c0359201c94ba1684ea6336e35cd70c2"}}, -{"id":"mootools-server","key":"mootools-server","value":{"rev":"3-98e89499f6eab137bbab053a3932a526"}}, -{"id":"mootools-slick-finder","key":"mootools-slick-finder","value":{"rev":"3-9a5820e90d6ea2d797268f3c60a9f177"}}, -{"id":"mootools-slick-parser","key":"mootools-slick-parser","value":{"rev":"3-d4e6b1673e6e2a6bcc66bf4988b2994d"}}, -{"id":"mootools-string","key":"mootools-string","value":{"rev":"3-2fda1c7915295df62e547018a7f05916"}}, -{"id":"mootools-swiff","key":"mootools-swiff","value":{"rev":"3-f0edeead85f3d48cf2af2ca35a4e67a5"}}, -{"id":"mootools.js","key":"mootools.js","value":{"rev":"3-085e50e3529d19e1d6ad630027ba51dc"}}, -{"id":"morestreams","key":"morestreams","value":{"rev":"7-3d0145c2cfb9429dfdcfa872998c9fe8"}}, -{"id":"morpheus","key":"morpheus","value":{"rev":"45-04335640f709335d1828523425a87909"}}, -{"id":"morton","key":"morton","value":{"rev":"11-abd787350e21bef65c1c6776e40a0753"}}, -{"id":"mothermayi","key":"mothermayi","value":{"rev":"5-2c46f9873efd19f543def5eeda0a05f1"}}, -{"id":"mountable-proxy","key":"mountable-proxy","value":{"rev":"7-3b91bd0707447885676727ad183bb051"}}, -{"id":"move","key":"move","value":{"rev":"69-ce11c235c78de6d6184a86aaa93769eb"}}, -{"id":"moviesearch","key":"moviesearch","value":{"rev":"3-72e77965a44264dfdd5af23e4a36d2ce"}}, -{"id":"mp","key":"mp","value":{"rev":"3-47899fb2bdaf21dda16abd037b325c3b"}}, -{"id":"mpdsocket","key":"mpdsocket","value":{"rev":"3-2dd4c9bb019f3f491c55364be7a56229"}}, -{"id":"mrcolor","key":"mrcolor","value":{"rev":"3-4695b11798a65c61714b8f236a40936c"}}, -{"id":"msgbus","key":"msgbus","value":{"rev":"27-a5d861b55c933842226d4e536820ec99"}}, -{"id":"msgme","key":"msgme","value":{"rev":"3-d1968af1234a2059eb3d84eb76cdaa4e"}}, -{"id":"msgpack","key":"msgpack","value":{"rev":"9-ecf7469392d87460ddebef2dd369b0e5"}}, -{"id":"msgpack-0.4","key":"msgpack-0.4","value":{"rev":"3-5d509ddba6c53ed6b8dfe4afb1d1661d"}}, -{"id":"msgpack2","key":"msgpack2","value":{"rev":"4-63b8f3ccf35498eb5c8bd9b8d683179b"}}, -{"id":"mu","key":"mu","value":{"rev":"7-7a8ce1cba5d6d98e696c4e633aa081fa"}}, -{"id":"mu2","key":"mu2","value":{"rev":"3-4ade1c5b1496c720312beae1822da9de"}}, -{"id":"mud","key":"mud","value":{"rev":"66-56e1b1a1e5af14c3df0520c58358e7cd"}}, -{"id":"muffin","key":"muffin","value":{"rev":"22-210c45a888fe1f095becdcf11876a2bc"}}, -{"id":"multi-node","key":"multi-node","value":{"rev":"1-224161d875f0e1cbf4b1e249603c670a"}}, -{"id":"multicast-eventemitter","key":"multicast-eventemitter","value":{"rev":"13-ede3e677d6e21bbfe42aad1b549a137c"}}, -{"id":"multimeter","key":"multimeter","value":{"rev":"7-847f45a6f592a8410a77d3e5efb5cbf3"}}, -{"id":"multipart-stack","key":"multipart-stack","value":{"rev":"9-85aaa2ed2180d3124d1dcd346955b672"}}, -{"id":"muse","key":"muse","value":{"rev":"3-d6bbc06df2e359d6ef285f9da2bd0efd"}}, -{"id":"musicmetadata","key":"musicmetadata","value":{"rev":"21-957bf986aa9d0db02175ea1d79293909"}}, -{"id":"mustache","key":"mustache","value":{"rev":"6-7f8458f2b52de5b37004b105c0f39e62"}}, -{"id":"mustachio","key":"mustachio","value":{"rev":"9-6ed3f41613f886128acd18b73b55439f"}}, -{"id":"mutex","key":"mutex","value":{"rev":"3-de95bdff3dd00271361067b5d70ea03b"}}, -{"id":"muzak","key":"muzak","value":{"rev":"9-5ff968ffadebe957b72a8b77b538b71c"}}, -{"id":"mvc","key":"mvc","value":{"rev":"52-7c954b6c3b90b1b734d8e8c3d2d34f5e"}}, -{"id":"mvc.coffee","key":"mvc.coffee","value":{"rev":"3-f203564ed70c0284455e7f96ea61fdb7"}}, -{"id":"mypackage","key":"mypackage","value":{"rev":"3-49cc95fb2e5ac8ee3dbbab1de451c0d1"}}, -{"id":"mypakege","key":"mypakege","value":{"rev":"3-e74d7dc2c2518304ff1700cf295eb823"}}, -{"id":"myrtle-parser","key":"myrtle-parser","value":{"rev":"3-9089c1a2f3c3a24f0bce3941bc1d534d"}}, -{"id":"mysql","key":"mysql","value":{"rev":"30-a8dc68eb056cb6f69fae2423c1337474"}}, -{"id":"mysql-activerecord","key":"mysql-activerecord","value":{"rev":"17-9d21d0b10a5c84f6cacfd8d2236f9887"}}, -{"id":"mysql-client","key":"mysql-client","value":{"rev":"5-cc877218864c319d17f179e49bf58c99"}}, -{"id":"mysql-helper","key":"mysql-helper","value":{"rev":"3-c6f3b9f00cd9fee675aa2a9942cc336a"}}, -{"id":"mysql-libmysqlclient","key":"mysql-libmysqlclient","value":{"rev":"38-51c08e24257b99bf5591232016ada8ab"}}, -{"id":"mysql-native","key":"mysql-native","value":{"rev":"12-0592fbf66c55e6e9db6a75c97be088c3"}}, -{"id":"mysql-native-prerelease","key":"mysql-native-prerelease","value":{"rev":"7-b1a6f3fc41f6c152f3b178e13f91b5c4"}}, -{"id":"mysql-oil","key":"mysql-oil","value":{"rev":"9-70c07b9c552ff592be8ca89ea6efa408"}}, -{"id":"mysql-pool","key":"mysql-pool","value":{"rev":"15-41f510c45174b6c887856120ce3d5a3b"}}, -{"id":"mysql-simple","key":"mysql-simple","value":{"rev":"13-7ee13f035e8ebcbc27f6fe910058aee9"}}, -{"id":"n","key":"n","value":{"rev":"31-bfaed5022beae2177a090c4c8fce82a4"}}, -{"id":"n-ext","key":"n-ext","value":{"rev":"3-5ad67a300f8e88ef1dd58983c9061bc1"}}, -{"id":"n-pubsub","key":"n-pubsub","value":{"rev":"3-af990bcbf9f94554365788b81715d3b4"}}, -{"id":"n-rest","key":"n-rest","value":{"rev":"7-42f1d92f9229f126a1b063ca27bfc85b"}}, -{"id":"n-util","key":"n-util","value":{"rev":"6-d0c59c7412408bc94e20de4d22396d79"}}, -{"id":"nMemcached","key":"nMemcached","value":{"rev":"3-be350fd46624a1cac0052231101e0594"}}, -{"id":"nStoreSession","key":"nStoreSession","value":{"rev":"3-a3452cddd2b9ff8edb6d46999fa5b0eb"}}, -{"id":"nTPL","key":"nTPL","value":{"rev":"41-16a54848286364d894906333b0c1bb2c"}}, -{"id":"nTunes","key":"nTunes","value":{"rev":"18-76bc566a504100507056316fe8d3cc35"}}, -{"id":"nabe","key":"nabe","value":{"rev":"13-dc93f35018e84a23ace4d5114fa1bb28"}}, -{"id":"nack","key":"nack","value":{"rev":"118-f629c8c208c76fa0c2ce66d21f927ee4"}}, -{"id":"nagari","key":"nagari","value":{"rev":"11-cb200690c6d606d8597178e492b54cde"}}, -{"id":"nailplate","key":"nailplate","value":{"rev":"11-e1532c42d9d83fc32942dec0b87df587"}}, -{"id":"nails","key":"nails","value":{"rev":"12-f472bf005c4a4c2b49fb0118b109bef1"}}, -{"id":"nake","key":"nake","value":{"rev":"11-250933df55fbe7bb19e34a84ed23ca3e"}}, -{"id":"named-routes","key":"named-routes","value":{"rev":"6-ffbdd4caa74a30e87aa6dbb36f2b967c"}}, -{"id":"namespace","key":"namespace","value":{"rev":"7-89e2850e14206af13f26441e75289878"}}, -{"id":"namespaces","key":"namespaces","value":{"rev":"11-7a9b3d2537438211021a472035109f3c"}}, -{"id":"nami","key":"nami","value":{"rev":"29-3d44b1338222a4d994d4030868a94ea8"}}, -{"id":"nano","key":"nano","value":{"rev":"105-50efc49a8f6424706af554872002c014"}}, -{"id":"nanostate","key":"nanostate","value":{"rev":"9-1664d985e8cdbf16e150ba6ba4d79ae5"}}, -{"id":"narcissus","key":"narcissus","value":{"rev":"3-46581eeceff566bd191a14dec7b337f6"}}, -{"id":"nariya","key":"nariya","value":{"rev":"13-d83b8b6162397b154a4b59553be225e9"}}, -{"id":"narrativ","key":"narrativ","value":{"rev":"9-ef215eff6bf222425f73d23e507f7ff3"}}, -{"id":"narrow","key":"narrow","value":{"rev":"5-c6963048ba02adaf819dc51815fa0015"}}, -{"id":"narwhal","key":"narwhal","value":{"rev":"6-13bf3f87e6cfb1e57662cc3e3be450fc"}}, -{"id":"narwhal-lib","key":"narwhal-lib","value":{"rev":"6-4722d9b35fed59a2e8f7345a1eb6769d"}}, -{"id":"nat","key":"nat","value":{"rev":"3-da0906c08792043546f98ace8ce59a78"}}, -{"id":"native2ascii","key":"native2ascii","value":{"rev":"3-9afd51209d67303a8ee807ff862e31fc"}}, -{"id":"nativeUtil","key":"nativeUtil","value":{"rev":"7-6e3e9757b436ebcee35a20e633c08d60"}}, -{"id":"natives","key":"natives","value":{"rev":"24-6c4269c9c7cfb52571bd2c94fa26efc6"}}, -{"id":"natural","key":"natural","value":{"rev":"110-fc92701ad8525f45fbdb5863959ca03c"}}, -{"id":"naturalsort","key":"naturalsort","value":{"rev":"3-4321f5e432aee224af0fee9e4fb901ff"}}, -{"id":"nave","key":"nave","value":{"rev":"29-79baa66065fa9075764cc3e5da2edaef"}}, -{"id":"navigator","key":"navigator","value":{"rev":"3-f2f4f5376afb10753006f40bd49689c3"}}, -{"id":"nbs-api","key":"nbs-api","value":{"rev":"3-94949b1f0797369abc0752482268ef08"}}, -{"id":"nbt","key":"nbt","value":{"rev":"3-b711b9db76f64449df7f43c659ad8e7f"}}, -{"id":"nclosure","key":"nclosure","value":{"rev":"9-042b39740a39f0556d0dc2c0990b7fa8"}}, -{"id":"nclosureultimate","key":"nclosureultimate","value":{"rev":"3-61ff4bc480239304c459374c9a5f5754"}}, -{"id":"nconf","key":"nconf","value":{"rev":"65-8d8c0d2c6d5d9d526b8a3f325f68eca1"}}, -{"id":"nconf-redis","key":"nconf-redis","value":{"rev":"5-21ae138633b20cb29ed49b9fcd425e10"}}, -{"id":"ncp","key":"ncp","value":{"rev":"23-6441091c6c27ecb5b99f5781299a2192"}}, -{"id":"ncss","key":"ncss","value":{"rev":"9-1d2330e0fdbc40f0810747c2b156ecf2"}}, -{"id":"ncurses","key":"ncurses","value":{"rev":"12-bb059ea6fee12ca77f1fbb7bb6dd9447"}}, -{"id":"ndb","key":"ndb","value":{"rev":"15-b3e826f68a57095413666e9fe74589da"}}, -{"id":"ndistro","key":"ndistro","value":{"rev":"3-fcda3c018d11000b2903ad7104b60b35"}}, -{"id":"ndns","key":"ndns","value":{"rev":"5-1aeaaca119be44af7a83207d76f263fc"}}, -{"id":"nebulog","key":"nebulog","value":{"rev":"3-1863b0ce17cc0f07a50532a830194254"}}, -{"id":"neco","key":"neco","value":{"rev":"43-e830913302b52012ab63177ecf292822"}}, -{"id":"ned","key":"ned","value":{"rev":"15-4230c69fb52dfddfd65526dcfe5c4ec6"}}, -{"id":"nedis","key":"nedis","value":{"rev":"7-d49e329dca586d1a3569266f0595c9ad"}}, -{"id":"neko","key":"neko","value":{"rev":"60-13aa87d2278c3a734733cff2a34a7970"}}, -{"id":"neo4j","key":"neo4j","value":{"rev":"7-dde7066eac32a405df95ccf9c50c8ae7"}}, -{"id":"nerve","key":"nerve","value":{"rev":"3-2c47b79586d7930aabf9325ca88ad7e8"}}, -{"id":"nest","key":"nest","value":{"rev":"23-560d67971e9acddacf087608306def24"}}, -{"id":"nestableflow","key":"nestableflow","value":{"rev":"5-ee8af667a84d333fcc8092c89f4189c3"}}, -{"id":"nestor","key":"nestor","value":{"rev":"3-f1affbc37be3bf4e337365bd172578dc"}}, -{"id":"net","key":"net","value":{"rev":"3-895103ee532ef31396d9c06764df1ed8"}}, -{"id":"netiface","key":"netiface","value":{"rev":"3-885c94284fd3a9601afe291ab68aca84"}}, -{"id":"netpool","key":"netpool","value":{"rev":"3-dadfd09b9eb7ef73e2bff34a381de207"}}, -{"id":"netstring","key":"netstring","value":{"rev":"9-d26e7bf4a3ce5eb91bb1889d362f71e6"}}, -{"id":"neuron","key":"neuron","value":{"rev":"11-edaed50492368ff39eaf7d2004d7f4d8"}}, -{"id":"new","key":"new","value":{"rev":"3-7789b37104d8161b7ccf898a9cda1fc6"}}, -{"id":"newforms","key":"newforms","value":{"rev":"9-2a87cb74477d210fcb1d0c3e3e236f03"}}, -{"id":"nexpect","key":"nexpect","value":{"rev":"15-e7127f41b9f3ec45185ede7bab7b4acd"}}, -{"id":"next","key":"next","value":{"rev":"13-de5e62125b72e48ea142a55a3817589c"}}, -{"id":"nextrip","key":"nextrip","value":{"rev":"5-1ac8103552967af98d3de452ef81a94f"}}, -{"id":"nexttick","key":"nexttick","value":{"rev":"9-c7ec279e713ea8483d33c31871aea0db"}}, -{"id":"ngen","key":"ngen","value":{"rev":"9-972980a439c34851d67e4f61a96c2632"}}, -{"id":"ngen-basicexample","key":"ngen-basicexample","value":{"rev":"3-897763c230081d320586bcadfa84499f"}}, -{"id":"ngeohash","key":"ngeohash","value":{"rev":"5-9ca0c06066bc798e934db35cad99453e"}}, -{"id":"ngist","key":"ngist","value":{"rev":"7-592c24e72708219ed1eb078ddff95ab6"}}, -{"id":"ngram","key":"ngram","value":{"rev":"5-00e6b24dc178bdeb49b1ac8cb09f6e77"}}, -{"id":"ngrep","key":"ngrep","value":{"rev":"3-49c1a3839b12083280475177c1a16e38"}}, -{"id":"nhp-body-restreamer","key":"nhp-body-restreamer","value":{"rev":"1-8a4e5e23ae681a3f8be9afb613648230"}}, -{"id":"nhttpd","key":"nhttpd","value":{"rev":"3-cdc73384e1a1a4666e813ff52f2f5e4f"}}, -{"id":"nib","key":"nib","value":{"rev":"25-d67d5a294ba5b8953472cf936b97e13d"}}, -{"id":"nicetime","key":"nicetime","value":{"rev":"3-39fdba269d712064dc1e02a7ab846821"}}, -{"id":"nicknack","key":"nicknack","value":{"rev":"5-7b5477b63f782d0a510b0c15d2824f20"}}, -{"id":"nide","key":"nide","value":{"rev":"9-74f642fced47c934f9bae29f04d17a46"}}, -{"id":"nih-op","key":"nih-op","value":{"rev":"3-6e649b45964f84cb04340ab7f0a36a1c"}}, -{"id":"nimble","key":"nimble","value":{"rev":"5-867b808dd80eab33e5f22f55bb5a7376"}}, -{"id":"ninjs","key":"ninjs","value":{"rev":"3-f59997cc4bacb2d9d9852f955d15199e"}}, -{"id":"ninotify","key":"ninotify","value":{"rev":"3-a0f3c7cbbe7ccf5d547551aa062cc8b5"}}, -{"id":"nirc","key":"nirc","value":{"rev":"3-28197984656939a5a93a77c0a1605406"}}, -{"id":"nithub","key":"nithub","value":{"rev":"3-eaa85e6ac6668a304e4e4a565c54f57d"}}, -{"id":"nix","key":"nix","value":{"rev":"12-7b338b03c0e110aeb348551b14796ff1"}}, -{"id":"nko","key":"nko","value":{"rev":"39-2bf94b2bc279b8cf847bfc7668029d37"}}, -{"id":"nlog","key":"nlog","value":{"rev":"3-ae469820484ca33f346001dcb7b63a2d"}}, -{"id":"nlog4js","key":"nlog4js","value":{"rev":"3-bc17a61a9023d64e192d249144e69f02"}}, -{"id":"nlogger","key":"nlogger","value":{"rev":"11-1e48fc9a5a4214d9e56db6c6b63f1eeb"}}, -{"id":"nmd","key":"nmd","value":{"rev":"27-2dcb60d0258a9cea838f7cc4e0922f90"}}, -{"id":"nntp","key":"nntp","value":{"rev":"5-c86b189e366b9a6a428f9a2ee88dccf1"}}, -{"id":"no.de","key":"no.de","value":{"rev":"10-0dc855fd6b0b36a710b473b2720b22c0"}}, -{"id":"nobj","key":"nobj","value":{"rev":"3-0b4a46b91b70117306a9888202117223"}}, -{"id":"noblemachine","key":"noblemachine","value":{"rev":"3-06fec410fe0c7328e06eec50b4fa5d9a"}}, -{"id":"noblerecord","key":"noblerecord","value":{"rev":"5-22f24c4285bd405785588480bb2bc324"}}, -{"id":"nock","key":"nock","value":{"rev":"5-f94423d37dbdf41001ec097f20635271"}}, -{"id":"nocr-mongo","key":"nocr-mongo","value":{"rev":"5-ce6335ed276187cc38c30cb5872d3d83"}}, -{"id":"nodast","key":"nodast","value":{"rev":"3-1c563107f2d77b79a8f0d0b8ba7041f5"}}, -{"id":"node-api","key":"node-api","value":{"rev":"3-b69cefec93d9f73256acf9fb9edeebd6"}}, -{"id":"node-apidoc","key":"node-apidoc","value":{"rev":"6-cd26945e959403fcbee8ba542e14e667"}}, -{"id":"node-app-reloader","key":"node-app-reloader","value":{"rev":"5-e08cac7656afd6c124f8e2a9b9d6fdd3"}}, -{"id":"node-arse","key":"node-arse","value":{"rev":"9-b643c828541739a5fa972c801f81b212"}}, -{"id":"node-assert-extras","key":"node-assert-extras","value":{"rev":"3-3498e17b996ffc42a29d46c9699a3b52"}}, -{"id":"node-assert-lint-free","key":"node-assert-lint-free","value":{"rev":"5-852130ba6bafc703657b833343bc5646"}}, -{"id":"node-asset","key":"node-asset","value":{"rev":"18-f7cf59be8e0d015a43d05807a1ed9c0c"}}, -{"id":"node-awesm","key":"node-awesm","value":{"rev":"3-539c10145541ac5efc4dd295767b2abc"}}, -{"id":"node-backbone-couch","key":"node-backbone-couch","value":{"rev":"19-c4d8e93436b60e098c81cc0fe50f960c"}}, -{"id":"node-base64","key":"node-base64","value":{"rev":"11-da10a7157fd9e139b48bc8d9e44a98fa"}}, -{"id":"node-bj","key":"node-bj","value":{"rev":"3-5cd21fa259199870d1917574cd167396"}}, -{"id":"node-bosh-stress-tool","key":"node-bosh-stress-tool","value":{"rev":"3-36afc4b47e570964b7f8d705e1d47732"}}, -{"id":"node-brainfuck","key":"node-brainfuck","value":{"rev":"5-c7a6f703a97a409670005cab52664629"}}, -{"id":"node-build","key":"node-build","value":{"rev":"10-4f2f137fb4ef032f9dca3e3c64c15270"}}, -{"id":"node-casa","key":"node-casa","value":{"rev":"3-3f80a478aa47620bfc0c64cc6f140d98"}}, -{"id":"node-ccl","key":"node-ccl","value":{"rev":"13-00498b820cc4cadce8cc5b7b76e30b0f"}}, -{"id":"node-chain","key":"node-chain","value":{"rev":"6-b543f421ac63eeedc667b3395e7b8971"}}, -{"id":"node-child-process-manager","key":"node-child-process-manager","value":{"rev":"36-befb1a0eeac02ad400e2aaa8a076a053"}}, -{"id":"node-chirpstream","key":"node-chirpstream","value":{"rev":"10-f20e404f9ae5d43dfb6bcee15bd9affe"}}, -{"id":"node-clone","key":"node-clone","value":{"rev":"5-5ace5d51179d0e642bf9085b3bbf999b"}}, -{"id":"node-cloudwatch","key":"node-cloudwatch","value":{"rev":"3-7f9d1e075fcc3bd3e7849acd893371d5"}}, -{"id":"node-combine","key":"node-combine","value":{"rev":"3-51891c3c7769ff11a243c89c7e537907"}}, -{"id":"node-compat","key":"node-compat","value":{"rev":"9-24fce8e15eed3e193832b1c93a482d15"}}, -{"id":"node-config","key":"node-config","value":{"rev":"6-8821f6b46347e57258e62e1be841c186"}}, -{"id":"node-crocodoc","key":"node-crocodoc","value":{"rev":"5-ad4436f633f37fe3248dce93777fc26e"}}, -{"id":"node-csv","key":"node-csv","value":{"rev":"10-cd15d347b595f1d9d1fd30b483c52724"}}, -{"id":"node-date","key":"node-date","value":{"rev":"3-a5b41cab3247e12f2beaf1e0b1ffadfa"}}, -{"id":"node-dbi","key":"node-dbi","value":{"rev":"27-96e1df6fdefbae77bfa02eda64c3e3b9"}}, -{"id":"node-debug-proxy","key":"node-debug-proxy","value":{"rev":"9-c00a14832cdd5ee4d489eb41a3d0d621"}}, -{"id":"node-dep","key":"node-dep","value":{"rev":"15-378dedd3f0b3e54329c00c675b19401c"}}, -{"id":"node-dev","key":"node-dev","value":{"rev":"48-6a98f38078fe5678d6c2fb48aec3c1c3"}}, -{"id":"node-downloader","key":"node-downloader","value":{"rev":"3-a541126c56c48681571e5e998c481343"}}, -{"id":"node-evented","key":"node-evented","value":{"rev":"6-a6ce8ab39e01cc0262c80d4bf08fc333"}}, -{"id":"node-exception-notifier","key":"node-exception-notifier","value":{"rev":"3-cebc02c45dace4852f8032adaa4e3c9c"}}, -{"id":"node-expat","key":"node-expat","value":{"rev":"33-261d85273a0a551e7815f835a933d5eb"}}, -{"id":"node-expect","key":"node-expect","value":{"rev":"7-5ba4539adfd3ba95dab21bb5bc0a5193"}}, -{"id":"node-express-boilerplate","key":"node-express-boilerplate","value":{"rev":"3-972f51d1ff9493e48d7cf508461f1114"}}, -{"id":"node-extjs","key":"node-extjs","value":{"rev":"7-33143616b4590523b4e1549dd8ffa991"}}, -{"id":"node-extjs4","key":"node-extjs4","value":{"rev":"3-8e5033aed477629a6fb9812466a90cfd"}}, -{"id":"node-fakeweb","key":"node-fakeweb","value":{"rev":"5-f01377fa6d03461cbe77f41b73577cf4"}}, -{"id":"node-fb","key":"node-fb","value":{"rev":"3-bc5f301a60e475de7c614837d3f9f35a"}}, -{"id":"node-fb-signed-request","key":"node-fb-signed-request","value":{"rev":"3-33c8f043bb947b63a84089d633d68f8e"}}, -{"id":"node-fects","key":"node-fects","value":{"rev":"3-151b7b895b74b24a87792fac34735814"}}, -{"id":"node-ffi","key":"node-ffi","value":{"rev":"22-25cf229f0ad4102333b2b13e03054ac5"}}, -{"id":"node-filter","key":"node-filter","value":{"rev":"3-0e6a86b4abb65df3594e5c93ab04bd31"}}, -{"id":"node-foursquare","key":"node-foursquare","value":{"rev":"25-549bbb0c2b4f96b2c5e6a5f642e8481d"}}, -{"id":"node-fs","key":"node-fs","value":{"rev":"5-14050cbc3887141f6b0e1e7d62736a63"}}, -{"id":"node-fs-synchronize","key":"node-fs-synchronize","value":{"rev":"11-6341e79f3391a9e1daa651a5932c8795"}}, -{"id":"node-gd","key":"node-gd","value":{"rev":"11-2ede7f4af38f062b86cc32bb0125e1bf"}}, -{"id":"node-geocode","key":"node-geocode","value":{"rev":"6-505af45c7ce679ac6738b495cc6b03c2"}}, -{"id":"node-get","key":"node-get","value":{"rev":"9-906945005a594ea1f05d4ad23170a83f"}}, -{"id":"node-gettext","key":"node-gettext","value":{"rev":"5-532ea4b528108b4c8387ddfc8fa690b2"}}, -{"id":"node-gist","key":"node-gist","value":{"rev":"11-3495a499c9496d01235676f429660424"}}, -{"id":"node-glbse","key":"node-glbse","value":{"rev":"5-69a537189610c69cc549f415431b181a"}}, -{"id":"node-google-sql","key":"node-google-sql","value":{"rev":"7-bfe20d25a4423651ecdff3f5054a6946"}}, -{"id":"node-gravatar","key":"node-gravatar","value":{"rev":"6-8265fc1ad003fd8a7383244c92abb346"}}, -{"id":"node-handlersocket","key":"node-handlersocket","value":{"rev":"16-f1dc0246559748a842dd0e1919c569ae"}}, -{"id":"node-hdfs","key":"node-hdfs","value":{"rev":"3-d460fba8ff515660de34cb216223c569"}}, -{"id":"node-hipchat","key":"node-hipchat","value":{"rev":"3-9d16738bf70f9e37565727e671ffe551"}}, -{"id":"node-hive","key":"node-hive","value":{"rev":"31-5eef1fa77a39e4bdacd8fa85ec2ce698"}}, -{"id":"node-html-encoder","key":"node-html-encoder","value":{"rev":"3-75f92e741a3b15eb56e3c4513feaca6d"}}, -{"id":"node-i3","key":"node-i3","value":{"rev":"3-5c489f43aeb06054b02ad3706183599c"}}, -{"id":"node-indextank","key":"node-indextank","value":{"rev":"5-235a17fce46c73c8b5abc4cf5f964385"}}, -{"id":"node-inherit","key":"node-inherit","value":{"rev":"3-099c0acf9c889eea94faaf64067bfc52"}}, -{"id":"node-inspector","key":"node-inspector","value":{"rev":"34-ca9fa856cf32a737d1ecccb759aaf5e1"}}, -{"id":"node-int64","key":"node-int64","value":{"rev":"11-50b92b5b65adf17e673b4d15df643ed4"}}, -{"id":"node-ip-lib","key":"node-ip-lib","value":{"rev":"3-2fe72f7b78cbc1739c71c7cfaec9fbcd"}}, -{"id":"node-iplookup","key":"node-iplookup","value":{"rev":"10-ba8474624dd852a46303d32ff0556883"}}, -{"id":"node-jdownloader","key":"node-jdownloader","value":{"rev":"3-b015035cfb8540568da5deb55b35248c"}}, -{"id":"node-jslint-all","key":"node-jslint-all","value":{"rev":"5-582f4a31160d3700731fa39771702896"}}, -{"id":"node-jsonengine","key":"node-jsonengine","value":{"rev":"3-6e429c32e42b205f3ed1ea1f48d67cbc"}}, -{"id":"node-khtml","key":"node-khtml","value":{"rev":"39-db8e8eea569657fc7de6300172a6a8a7"}}, -{"id":"node-linkshare","key":"node-linkshare","value":{"rev":"35-acc18a5d584b828bb2bd4f32bbcde98c"}}, -{"id":"node-log","key":"node-log","value":{"rev":"17-79cecc66227b4fb3a2ae04b7dac17cc2"}}, -{"id":"node-logentries","key":"node-logentries","value":{"rev":"3-0f640d5ff489a6904f4a8c18fb5f7e9c"}}, -{"id":"node-logger","key":"node-logger","value":{"rev":"3-75084f98359586bdd254e57ea5915d37"}}, -{"id":"node-logging","key":"node-logging","value":{"rev":"15-af01bc2b6128150787c85c8df1dae642"}}, -{"id":"node-mailer","key":"node-mailer","value":{"rev":"5-5b88675f05efe2836126336c880bd841"}}, -{"id":"node-mailgun","key":"node-mailgun","value":{"rev":"5-4bcfb7bf5163748b87c1b9ed429ed178"}}, -{"id":"node-markdown","key":"node-markdown","value":{"rev":"6-67137da4014f22f656aaefd9dfa2801b"}}, -{"id":"node-mdbm","key":"node-mdbm","value":{"rev":"22-3006800b042cf7d4b0b391c278405143"}}, -{"id":"node-minify","key":"node-minify","value":{"rev":"13-e853813d4b6519b168965979b8ccccdd"}}, -{"id":"node-mug","key":"node-mug","value":{"rev":"3-f7567ffac536bfa7eb5a7e3da7a0efa0"}}, -{"id":"node-mvc","key":"node-mvc","value":{"rev":"3-74f7c07b2991fcddb27afd2889b6db4e"}}, -{"id":"node-mwire","key":"node-mwire","value":{"rev":"26-79d7982748f42b9e07ab293447b167ec"}}, -{"id":"node-mynix-feed","key":"node-mynix-feed","value":{"rev":"3-59d4a624b3831bbab6ee99be2f84e568"}}, -{"id":"node-nether","key":"node-nether","value":{"rev":"3-0fbefe710fe0d74262bfa25f6b4e1baf"}}, -{"id":"node-nude","key":"node-nude","value":{"rev":"3-600abb219646299ac602fa51fa260f37"}}, -{"id":"node-nxt","key":"node-nxt","value":{"rev":"3-8ce48601c2b0164e2b125259a0c97d45"}}, -{"id":"node-oauth","key":"node-oauth","value":{"rev":"3-aa6cd61f44d74118bafa5408900c4984"}}, -{"id":"node-opencalais","key":"node-opencalais","value":{"rev":"13-a3c0b882aca7207ce36f107e40a0ce50"}}, -{"id":"node-props","key":"node-props","value":{"rev":"7-e400cee08cc9abdc1f1ce4f262a04b05"}}, -{"id":"node-proxy","key":"node-proxy","value":{"rev":"20-ce722bf45c84a7d925b8b7433e786ed6"}}, -{"id":"node-pusher","key":"node-pusher","value":{"rev":"3-7cc7cd5bffaf3b11c44438611beeba98"}}, -{"id":"node-putio","key":"node-putio","value":{"rev":"3-8a1fc6362fdcf16217cdb6846e419b4c"}}, -{"id":"node-raphael","key":"node-raphael","value":{"rev":"25-e419d98a12ace18a40d94a9e8e32cdd4"}}, -{"id":"node-rapleaf","key":"node-rapleaf","value":{"rev":"11-c849c8c8635e4eb2f81bd7810b7693fd"}}, -{"id":"node-rats","key":"node-rats","value":{"rev":"3-dca544587f3121148fe02410032cf726"}}, -{"id":"node-rdf2json","key":"node-rdf2json","value":{"rev":"3-bde382dc2fcb40986c5ac41643d44543"}}, -{"id":"node-recurly","key":"node-recurly","value":{"rev":"11-79cab9ccee7c1ddb83791e8de41c72f5"}}, -{"id":"node-redis","key":"node-redis","value":{"rev":"13-12adf3a3e986675637fa47b176f527e3"}}, -{"id":"node-redis-mapper","key":"node-redis-mapper","value":{"rev":"5-53ba8f67cc82dbf1d127fc7359353f32"}}, -{"id":"node-redis-monitor","key":"node-redis-monitor","value":{"rev":"3-79bcba76241d7c7dbc4b18d90a9d59e3"}}, -{"id":"node-restclient","key":"node-restclient","value":{"rev":"6-5844eba19bc465a8f75b6e94c061350f"}}, -{"id":"node-restclient2","key":"node-restclient2","value":{"rev":"5-950de911f7bde7900dfe5b324f49818c"}}, -{"id":"node-runner","key":"node-runner","value":{"rev":"3-e9a9e6bd10d2ab1aed8b401b04fadc7b"}}, -{"id":"node-sc-setup","key":"node-sc-setup","value":{"rev":"3-e89c496e03c48d8574ccaf61c9ed4fca"}}, -{"id":"node-schedule","key":"node-schedule","value":{"rev":"9-ae12fa59226f1c9b7257b8a2d71373b4"}}, -{"id":"node-sdlmixer","key":"node-sdlmixer","value":{"rev":"8-489d85278d6564b6a4e94990edcb0527"}}, -{"id":"node-secure","key":"node-secure","value":{"rev":"3-73673522a4bb5f853d55e535f0934803"}}, -{"id":"node-sendgrid","key":"node-sendgrid","value":{"rev":"9-4662c31304ca4ee4e702bd3a54ea7824"}}, -{"id":"node-sizzle","key":"node-sizzle","value":{"rev":"6-c08c24d9d769d3716e5c4e3441740eb2"}}, -{"id":"node-soap-client","key":"node-soap-client","value":{"rev":"9-35ff34a4a5af569de6a2e89d1b35b69a"}}, -{"id":"node-spec","key":"node-spec","value":{"rev":"9-92e99ca74b9a09a8ae2eb7382ef511ef"}}, -{"id":"node-static","key":"node-static","value":{"rev":"10-11b0480fcd416db3d3d4041f43a55290"}}, -{"id":"node-static-maccman","key":"node-static-maccman","value":{"rev":"3-49e256728b14c85776b74f2bd912eb42"}}, -{"id":"node-statsd","key":"node-statsd","value":{"rev":"5-08d3e6b4b2ed1d0b7916e9952f55573c"}}, -{"id":"node-statsd-instrument","key":"node-statsd-instrument","value":{"rev":"3-c3cd3315e1edcc91096830392f439305"}}, -{"id":"node-std","key":"node-std","value":{"rev":"3-f99be0f03be4175d546823799bb590d3"}}, -{"id":"node-store","key":"node-store","value":{"rev":"3-7cb6bf13de9550b869c768f464fd0f65"}}, -{"id":"node-stringprep","key":"node-stringprep","value":{"rev":"13-9b08baa97042f71c5c8e9e2fdcc2c300"}}, -{"id":"node-synapse","key":"node-synapse","value":{"rev":"3-c46c47099eb2792f4a57fdfd789520ca"}}, -{"id":"node-syslog","key":"node-syslog","value":{"rev":"23-34f7df06ba88d9f897b7e00404db7187"}}, -{"id":"node-t","key":"node-t","value":{"rev":"3-042225eff3208ba9add61a9f79d90871"}}, -{"id":"node-taobao","key":"node-taobao","value":{"rev":"7-c988ace74806b2e2f55e162f54ba1a2c"}}, -{"id":"node-term-ui","key":"node-term-ui","value":{"rev":"5-210310014b19ce26c5e3e840a8a0549e"}}, -{"id":"node-tiny","key":"node-tiny","value":{"rev":"7-df05ab471f25ca4532d80c83106944d7"}}, -{"id":"node-tmpl","key":"node-tmpl","value":{"rev":"3-6fcfa960da8eb72a5e3087559d3fe206"}}, -{"id":"node-twilio","key":"node-twilio","value":{"rev":"11-af69e600109d38c77eadbcec4bee4782"}}, -{"id":"node-twitter-mailer","key":"node-twitter-mailer","value":{"rev":"7-f915b76d834cb162c91816abc30cee5f"}}, -{"id":"node-usb","key":"node-usb","value":{"rev":"3-0c3837307f86a80427800f1b45aa5862"}}, -{"id":"node-uuid","key":"node-uuid","value":{"rev":"6-642efa619ad8a6476a44a5c6158e7a36"}}, -{"id":"node-vapor.js","key":"node-vapor.js","value":{"rev":"3-d293284cc415b2906533e91db13ee748"}}, -{"id":"node-version","key":"node-version","value":{"rev":"3-433b1529a6aa3d619314e461e978d2b6"}}, -{"id":"node-webapp","key":"node-webapp","value":{"rev":"11-65411bfd8eaf19d3539238360d904d43"}}, -{"id":"node-wiki","key":"node-wiki","value":{"rev":"5-22b0177c9a5e4dc1f72d36bb83c746d0"}}, -{"id":"node-wkhtml","key":"node-wkhtml","value":{"rev":"5-a8fa203720442b443d558670c9750548"}}, -{"id":"node-xerces","key":"node-xerces","value":{"rev":"3-de6d82ec712af997b7aae451277667f0"}}, -{"id":"node-xml","key":"node-xml","value":{"rev":"3-e14a52dcd04302aea7dd6943cf6dd886"}}, -{"id":"node-xmpp","key":"node-xmpp","value":{"rev":"36-031eb5e830ed2e2027ee4ee7f861cf81"}}, -{"id":"node-xmpp-bosh","key":"node-xmpp-bosh","value":{"rev":"85-f7f8b699b6fda74fc27c621466915bd1"}}, -{"id":"node-xmpp-via-bosh","key":"node-xmpp-via-bosh","value":{"rev":"3-5f5fee9e42ae8ce8f42d55c31808c969"}}, -{"id":"node.io","key":"node.io","value":{"rev":"224-e99561d454a7676d10875e1b06ba44c7"}}, -{"id":"node.io-min","key":"node.io-min","value":{"rev":"3-e8389bdcfa55c68ae9698794d9089ce4"}}, -{"id":"node.isbn","key":"node.isbn","value":{"rev":"3-76aa84f3c49a54b6c901f440af35192d"}}, -{"id":"node.uptime","key":"node.uptime","value":{"rev":"5-cfc2c1c1460d000eab4e1a28506e6d29"}}, -{"id":"node3p","key":"node3p","value":{"rev":"14-b1931b8aa96227854d78965cc4301168"}}, -{"id":"node3p-web","key":"node3p-web","value":{"rev":"12-bc783ee1e493e80b7e7a3c2fce39f55e"}}, -{"id":"nodeBase","key":"nodeBase","value":{"rev":"39-4d9ae0f18e0bca7192901422d85e85c7"}}, -{"id":"nodeCgi","key":"nodeCgi","value":{"rev":"9-bb65e71ee63551e519f49434f2ae1cd7"}}, -{"id":"nodeDocs","key":"nodeDocs","value":{"rev":"3-0c6e714d3e6d5c2cc9482444680fb3ca"}}, -{"id":"nodePhpSessions","key":"nodePhpSessions","value":{"rev":"3-5063b38582deaca9cacdc029db97c2b1"}}, -{"id":"node_bsdiff","key":"node_bsdiff","value":{"rev":"5-e244ef36755a2b6534ce50fa1ee5ee6e"}}, -{"id":"node_hash","key":"node_hash","value":{"rev":"3-cdce2fcc2c18fcd25e16be8e52add891"}}, -{"id":"node_util","key":"node_util","value":{"rev":"3-cde723ee2311cf48f7cf0a3bc3484f9a"}}, -{"id":"node_xslt","key":"node_xslt","value":{"rev":"3-f12035155aee31d1749204fdca2aee10"}}, -{"id":"nodec","key":"nodec","value":{"rev":"3-dba2af2d5b98a71964abb4328512b9e1"}}, -{"id":"nodefm","key":"nodefm","value":{"rev":"3-c652a95d30318a371736515feab649f9"}}, -{"id":"nodegit","key":"nodegit","value":{"rev":"31-92a2cea0d1c92086c920bc007f5a3f16"}}, -{"id":"nodeib","key":"nodeib","value":{"rev":"3-e67d779007817597ca36e8b821f38e6a"}}, -{"id":"nodeinfo","key":"nodeinfo","value":{"rev":"53-61bf0f48662dc2e04cde38a2b897c211"}}, -{"id":"nodejitsu-client","key":"nodejitsu-client","value":{"rev":"3-4fa613f888ebe249aff7b03aa9b8d7ef"}}, -{"id":"nodejs-intro","key":"nodejs-intro","value":{"rev":"4-c75f03e80b597f734f4466e62ecebfeb"}}, -{"id":"nodejs-tvrage","key":"nodejs-tvrage","value":{"rev":"9-88bb3b5d23652ebdb7186a30bc3be43f"}}, -{"id":"nodejs.be-cli","key":"nodejs.be-cli","value":{"rev":"3-d8f23777f9b18101f2d2dc5aa618a703"}}, -{"id":"nodeler","key":"nodeler","value":{"rev":"9-00760d261ea75164a5709109011afb25"}}, -{"id":"nodelint","key":"nodelint","value":{"rev":"8-31502553d4bb099ba519fb331cccdd63"}}, -{"id":"nodeload","key":"nodeload","value":{"rev":"12-f02626475b59ebe67a864a114c99ff9b"}}, -{"id":"nodemachine","key":"nodemachine","value":{"rev":"8-5342324502e677e35aefef17dc08c8db"}}, -{"id":"nodemailer","key":"nodemailer","value":{"rev":"63-d39a5143b06fa79edcb81252d6329861"}}, -{"id":"nodemock","key":"nodemock","value":{"rev":"33-7095334209b39c8e1482374bee1b712a"}}, -{"id":"nodemon","key":"nodemon","value":{"rev":"42-4f40ba2299ef4ae613a384a48e4045fa"}}, -{"id":"nodepad","key":"nodepad","value":{"rev":"5-93718cc67e97c89f45b753c1caef07e4"}}, -{"id":"nodepal","key":"nodepal","value":{"rev":"5-e53372a5081b3753993ee98299ecd550"}}, -{"id":"nodepie","key":"nodepie","value":{"rev":"21-a44a6d3575758ed591e13831a5420758"}}, -{"id":"nodepress","key":"nodepress","value":{"rev":"3-f17616b9ae61e15d1d219cb87ac5a63a"}}, -{"id":"noderelict","key":"noderelict","value":{"rev":"23-0ca0997e3ef112e9393ae8ccef63f1ee"}}, -{"id":"noderpc","key":"noderpc","value":{"rev":"27-7efb6365916b403c3aa4e1c766de75a2"}}, -{"id":"nodespec","key":"nodespec","value":{"rev":"3-69f357577e52e9fd096ac88a1e7e3445"}}, -{"id":"nodespy","key":"nodespy","value":{"rev":"3-ad33e14db2bcaf61bf99d3e8915da5ee"}}, -{"id":"nodestalker","key":"nodestalker","value":{"rev":"5-080eba88a3625ecf7935ec5e9d2db6e9"}}, -{"id":"nodester-api","key":"nodester-api","value":{"rev":"39-52046dbcdf4447bbb85aecc92086ae1d"}}, -{"id":"nodester-cli","key":"nodester-cli","value":{"rev":"89-6de3d724a974c1dd3b632417f8b01267"}}, -{"id":"nodetk","key":"nodetk","value":{"rev":"11-265d267335e7603249e1af9441700f2f"}}, -{"id":"nodeunit","key":"nodeunit","value":{"rev":"40-d1cc6c06f878fb0b86779186314bc193"}}, -{"id":"nodeunit-coverage","key":"nodeunit-coverage","value":{"rev":"3-29853918351e75e3f6f93acd97e2942f"}}, -{"id":"nodeunit-dsl","key":"nodeunit-dsl","value":{"rev":"6-91be44077bc80c942f86f0ac28a69c5e"}}, -{"id":"nodevlc","key":"nodevlc","value":{"rev":"3-e151577d3e1ba2f58db465d94ebcb1c1"}}, -{"id":"nodevore","key":"nodevore","value":{"rev":"3-ac73b3bc33e2f934776dda359869ddcf"}}, -{"id":"nodewatch","key":"nodewatch","value":{"rev":"9-267bfe1324c51993865dc41b09aee6dc"}}, -{"id":"nodewii","key":"nodewii","value":{"rev":"9-716b3faa8957c1aea337540402ae7f43"}}, -{"id":"nodie","key":"nodie","value":{"rev":"3-cc29702a2e7e295cfe583a05fb77b530"}}, -{"id":"nodify","key":"nodify","value":{"rev":"10-87fadf6bf262882bd71ab7e759b29949"}}, -{"id":"nodrrr","key":"nodrrr","value":{"rev":"3-75937f4ffb722a67d6c5a67663366854"}}, -{"id":"nodules","key":"nodules","value":{"rev":"8-2c6ec430f26ff7ef171e80b7b5e990c2"}}, -{"id":"nodysentary","key":"nodysentary","value":{"rev":"3-7574fc8e12b1271c2eb1c66026f702cb"}}, -{"id":"nohm","key":"nohm","value":{"rev":"45-09dcf4df92734b3c51c8df3c3b374b0b"}}, -{"id":"noid","key":"noid","value":{"rev":"5-ac31e001806789e80a7ffc64f2914eb4"}}, -{"id":"nolife","key":"nolife","value":{"rev":"7-cfd4fe84b1062303cefb83167ea48bba"}}, -{"id":"nolog","key":"nolog","value":{"rev":"9-6e82819b801f5d7ec6773596d5d2efb2"}}, -{"id":"nomnom","key":"nomnom","value":{"rev":"34-bf66753d1d155820cfacfc7fa7a830c9"}}, -{"id":"nomplate","key":"nomplate","value":{"rev":"9-6ea21ee9568421a60cb80637c4c6cb48"}}, -{"id":"nonogo","key":"nonogo","value":{"rev":"5-8307413f9a3da913f9818c4f2d951519"}}, -{"id":"noode","key":"noode","value":{"rev":"7-454df50a7cbd03c46a9951cb1ddbe1c6"}}, -{"id":"noodle","key":"noodle","value":{"rev":"7-163745527770de0de8e7e9d59fc3888c"}}, -{"id":"noop","key":"noop","value":{"rev":"5-ed9fd66573ed1186e66b4c2bc16192cb"}}, -{"id":"nope","key":"nope","value":{"rev":"3-7088ffb62b8e06261527cbfa69cb94c5"}}, -{"id":"nopro","key":"nopro","value":{"rev":"11-6c4aeafe6329821b2259ef11414481dd"}}, -{"id":"nopt","key":"nopt","value":{"rev":"23-cce441940b6f129cab94a359ddb8b3e4"}}, -{"id":"norm","key":"norm","value":{"rev":"9-2bf26c3803fdc3bb6319e490cae3b625"}}, -{"id":"norq","key":"norq","value":{"rev":"3-b1a80ad1aa4ccc493ac25da22b0f0697"}}, -{"id":"norris","key":"norris","value":{"rev":"3-a341286d9e83fa392c1ce6b764d0aace"}}, -{"id":"norris-ioc","key":"norris-ioc","value":{"rev":"15-d022f159229d89ce60fc2a15d71eac59"}}, -{"id":"norris-tester","key":"norris-tester","value":{"rev":"3-fc2f34c9373bbdf5a1cd9cfbaff21f83"}}, -{"id":"northwatcher","key":"northwatcher","value":{"rev":"13-edab28a123f0100e12f96c9828428a8a"}}, -{"id":"nosey","key":"nosey","value":{"rev":"4-10a22f27dd9f2a40acf035a7d250c661"}}, -{"id":"nosql-thin","key":"nosql-thin","value":{"rev":"6-604169cacf303b5278064f68b884090b"}}, -{"id":"notch","key":"notch","value":{"rev":"3-5b720089f0f9cfdbbbea8677216eeee5"}}, -{"id":"notes","key":"notes","value":{"rev":"3-5dfbd6ec33c69c0f1b619dd65d9e7a56"}}, -{"id":"nothing","key":"nothing","value":{"rev":"3-8b44e10efd7d6504755c0c4bd1043814"}}, -{"id":"notifications","key":"notifications","value":{"rev":"3-a68448bca7ea2d3d3ce43e4d03cd76c6"}}, -{"id":"notifo","key":"notifo","value":{"rev":"8-0bc13ea6135adfa80c5fac497a2ddeda"}}, -{"id":"notify","key":"notify","value":{"rev":"3-da00942576bcb5fab594186f80d4575a"}}, -{"id":"notify-send","key":"notify-send","value":{"rev":"7-89f5c6bc656d51577e3997b9f90d0454"}}, -{"id":"nova","key":"nova","value":{"rev":"3-4e136f35b7d5b85816c17496c6c0e382"}}, -{"id":"now","key":"now","value":{"rev":"84-dbfde18b3f6fe79dd3637b6da34b78cf"}}, -{"id":"now-bal","key":"now-bal","value":{"rev":"3-c769bcdd45a93095f68c2de54f35543f"}}, -{"id":"nowpad","key":"nowpad","value":{"rev":"51-8d90c49031f79a9d31eb4ed6f39609b6"}}, -{"id":"nowww","key":"nowww","value":{"rev":"3-541994af2e579b376d2037f4e34f31d8"}}, -{"id":"noxmox","key":"noxmox","value":{"rev":"9-4ac8b1529dced329cac0976b9ca9eed0"}}, -{"id":"nozzle","key":"nozzle","value":{"rev":"23-e60444326d11a5b57c208de548c325e8"}}, -{"id":"npm","key":"npm","value":{"rev":"665-71d13d024c846b2ee85ed054fcfcb242"}}, -{"id":"npm-deploy","key":"npm-deploy","value":{"rev":"23-751e9d3c2edac0fd9916b0e886414ef2"}}, -{"id":"npm-dev-install","key":"npm-dev-install","value":{"rev":"3-7a08e11a59758329ba8dc4e781ea9993"}}, -{"id":"npm-docsite","key":"npm-docsite","value":{"rev":"3-5ed4f1ffea02487ab9ea24cfa0196f76"}}, -{"id":"npm-github-service","key":"npm-github-service","value":{"rev":"8-6891bc055b499e088fc79a7f94b6a4ec"}}, -{"id":"npm-intro-slides","key":"npm-intro-slides","value":{"rev":"8-e95f28475662cb8f70f4cb48baaa9d27"}}, -{"id":"npm-monitor","key":"npm-monitor","value":{"rev":"7-4e3209ea893fe37c0e516fe21de2d8ad"}}, -{"id":"npm-remapper","key":"npm-remapper","value":{"rev":"3-69163475ee93f32faac3f934e772b6c7"}}, -{"id":"npm-tweets","key":"npm-tweets","value":{"rev":"9-86064412a8aa02d813b20d2e49d78d84"}}, -{"id":"npm-wrapper","key":"npm-wrapper","value":{"rev":"3-59c4d372b84f6e91dbe48a220511dfd5"}}, -{"id":"npm2debian","key":"npm2debian","value":{"rev":"3-3cf2f471f3bfbc613176c7c780a6aad6"}}, -{"id":"npmcount","key":"npmcount","value":{"rev":"5-59c55b09d9c2cc7da217cab3b0ea642c"}}, -{"id":"npmdep","key":"npmdep","value":{"rev":"9-78184ad3b841e5c91bbfa29ff722778a"}}, -{"id":"npmtop","key":"npmtop","value":{"rev":"19-2754af894829f22d6edb3a17a64cdf1e"}}, -{"id":"nquery","key":"nquery","value":{"rev":"9-461fb0c9bcc3c15e0696dc2e99807c98"}}, -{"id":"nrecipe","key":"nrecipe","value":{"rev":"15-a96b6b0134a7625eb4eb236b4bf3fbf3"}}, -{"id":"nserver","key":"nserver","value":{"rev":"5-ea895373c340dd8d9119f3f549990048"}}, -{"id":"nserver-util","key":"nserver-util","value":{"rev":"5-5e14eb0bc9f7ab0eac04c5699c6bb328"}}, -{"id":"nssocket","key":"nssocket","value":{"rev":"51-6aac1d5dd0aa7629b3619b3085d63c04"}}, -{"id":"nstore","key":"nstore","value":{"rev":"28-6e2639829539b7315040487dfa5c79af"}}, -{"id":"nstore-cache","key":"nstore-cache","value":{"rev":"3-453ed78dcbe68b31ff675f4d94b47c4a"}}, -{"id":"nstore-query","key":"nstore-query","value":{"rev":"3-39f46992dd278824db641a37ec5546f5"}}, -{"id":"ntodo","key":"ntodo","value":{"rev":"7-e214da8bbed2d3e40bdaec77d7a49831"}}, -{"id":"ntp","key":"ntp","value":{"rev":"5-5ee2b25e8f3bca06d1cc4ce3b25cac42"}}, -{"id":"nts","key":"nts","value":{"rev":"7-ecaf47f8af1f77de791d1d1fa9bab88e"}}, -{"id":"nttpd","key":"nttpd","value":{"rev":"21-cda7aa0f1db126428f6ca01d44b4d209"}}, -{"id":"ntwitter","key":"ntwitter","value":{"rev":"11-732c6f34137c942bc98967170b2f83fc"}}, -{"id":"nub","key":"nub","value":{"rev":"3-932ecf56889fa43584687dbb2cf4aa91"}}, -{"id":"nubnub","key":"nubnub","value":{"rev":"6-93a5267209e1aa869521a5952cbb1828"}}, -{"id":"null","key":"null","value":{"rev":"3-ae8247cfa9553d23a229993cfc8436c5"}}, -{"id":"numb","key":"numb","value":{"rev":"5-594cd9e8e8e4262ddb3ddd80e8084b62"}}, -{"id":"nun","key":"nun","value":{"rev":"8-3bd8b37ed85c1a5da211bd0d5766848e"}}, -{"id":"nunz","key":"nunz","value":{"rev":"3-040f033943158be495f6b0da1a0c0344"}}, -{"id":"nurl","key":"nurl","value":{"rev":"11-6c4ee6fc5c5119c56f2fd8ad8a0cb928"}}, -{"id":"nutil","key":"nutil","value":{"rev":"3-7785a1d4651dcfe78c874848f41d1348"}}, -{"id":"nutils","key":"nutils","value":{"rev":"13-889624db0c155fc2f0b501bba47e55ec"}}, -{"id":"nuvem","key":"nuvem","value":{"rev":"23-054b9b1240f4741f561ef0bb3197bdf8"}}, -{"id":"nvm","key":"nvm","value":{"rev":"28-251b7eb3429a00099b37810d05accd47"}}, -{"id":"nwm","key":"nwm","value":{"rev":"3-fe9274106aac9e67eea734159477acaf"}}, -{"id":"nx","key":"nx","value":{"rev":"55-7ad32fcb34ec25f841ddd0e5857375c7"}}, -{"id":"nx-core","key":"nx-core","value":{"rev":"33-a7bc62348591bae89fff82057bede1ab"}}, -{"id":"nx-daemon","key":"nx-daemon","value":{"rev":"3-7b86a87654c9e32746a4d36d7c527182"}}, -{"id":"nyaatorrents","key":"nyaatorrents","value":{"rev":"5-8600707a1e84f617bd5468b5c9179202"}}, -{"id":"nyala","key":"nyala","value":{"rev":"17-23c908297a37c47f9f09977f4cf101ff"}}, -{"id":"nyam","key":"nyam","value":{"rev":"17-697b5f17fe67630bc9494184146c12f1"}}, -{"id":"nyancat","key":"nyancat","value":{"rev":"13-84c18d007db41b40e9145bdc049b0a00"}}, -{"id":"nymph","key":"nymph","value":{"rev":"5-3a5d7a75d32f7a71bf4ec131f71484d8"}}, -{"id":"o3-xml","key":"o3-xml","value":{"rev":"3-cc4df881333805600467563f80b5216c"}}, -{"id":"oahu","key":"oahu","value":{"rev":"3-e789fc2098292518cb33606c73bfeca4"}}, -{"id":"oauth","key":"oauth","value":{"rev":"38-36b99063db7dc302b70d932e9bbafc24"}}, -{"id":"oauth-client","key":"oauth-client","value":{"rev":"12-ae097c9580ddcd5ca938b169486a63c6"}}, -{"id":"oauth-server","key":"oauth-server","value":{"rev":"7-ea931e31eaffaa843be61ffc89f29da7"}}, -{"id":"oauth2","key":"oauth2","value":{"rev":"3-4fce73fdc95580f397afeaf1bbd596bb"}}, -{"id":"oauth2-client","key":"oauth2-client","value":{"rev":"7-b5bd019159112384abc2087b2f8cb4f7"}}, -{"id":"oauth2-provider","key":"oauth2-provider","value":{"rev":"3-acd8f23b8c1c47b19838424b64618c70"}}, -{"id":"oauth2-server","key":"oauth2-server","value":{"rev":"11-316baa7e754053d0153086d0748b07c5"}}, -{"id":"obj_diff","key":"obj_diff","value":{"rev":"3-9289e14caaec4bb6aa64aa1be547db3b"}}, -{"id":"object-additions","key":"object-additions","value":{"rev":"3-11f03ae5afe00ad2be034fb313ce71a9"}}, -{"id":"object-proxy","key":"object-proxy","value":{"rev":"3-4d531308fc97bac6f6f9acd1e8f5b53a"}}, -{"id":"object-sync","key":"object-sync","value":{"rev":"5-6628fff49d65c96edc9d7a2e13db8d6d"}}, -{"id":"observer","key":"observer","value":{"rev":"3-a48052671a59b1c7874b4462e375664d"}}, -{"id":"octo.io","key":"octo.io","value":{"rev":"7-5692104396299695416ecb8548e53541"}}, -{"id":"octopus","key":"octopus","value":{"rev":"3-0a286abf59ba7232210e24a371902e7b"}}, -{"id":"odbc","key":"odbc","value":{"rev":"3-8550f0b183b229e41f3cb947bad9b059"}}, -{"id":"odot","key":"odot","value":{"rev":"13-3954b69c1a560a71fe58ab0c5c1072ba"}}, -{"id":"offliner","key":"offliner","value":{"rev":"3-9b58041cbd7b0365e04fec61c192c9b2"}}, -{"id":"ofxer","key":"ofxer","value":{"rev":"11-f8a79e1f27c92368ca1198ad37fbe83e"}}, -{"id":"ogre","key":"ogre","value":{"rev":"35-ea9c78c1d5b1761f059bb97ea568b23d"}}, -{"id":"oi.tekcos","key":"oi.tekcos","value":{"rev":"5-fdca9adb54acea3f91567082b107dde9"}}, -{"id":"oktest","key":"oktest","value":{"rev":"3-3b40312743a3eb1d8541ceee3ecfeace"}}, -{"id":"omcc","key":"omcc","value":{"rev":"3-19718e77bf82945c3ca7a3cdfb91188c"}}, -{"id":"omegle","key":"omegle","value":{"rev":"3-507ba8a51afbe2ff078e3e96712b7286"}}, -{"id":"ometa","key":"ometa","value":{"rev":"10-457fa17de89e1012ce812af3a53f4035"}}, -{"id":"ometa-highlighter","key":"ometa-highlighter","value":{"rev":"21-d18470d6d9a93bc7383c7d8ace22ad1d"}}, -{"id":"ometajs","key":"ometajs","value":{"rev":"20-c7e8c32926f2523e40e4a7ba2297192c"}}, -{"id":"onion","key":"onion","value":{"rev":"3-b46c000c8ff0b06f5f0028d268bc5c94"}}, -{"id":"onvalid","key":"onvalid","value":{"rev":"3-090bc1cf1418545b84db0fceb0846293"}}, -{"id":"oo","key":"oo","value":{"rev":"7-2297a18cdbcf29ad4867a2159912c04e"}}, -{"id":"oop","key":"oop","value":{"rev":"7-45fab8bae343e805d0c1863149dc20df"}}, -{"id":"op","key":"op","value":{"rev":"13-4efb059757caaecc18d5110b44266b35"}}, -{"id":"open-uri","key":"open-uri","value":{"rev":"21-023a00f26ecd89e278136fbb417ae9c3"}}, -{"id":"open.core","key":"open.core","value":{"rev":"35-f578db4e41dd4ae9128e3be574cf7b14"}}, -{"id":"open311","key":"open311","value":{"rev":"13-bb023a45d3c3988022d2fef809de8d98"}}, -{"id":"openid","key":"openid","value":{"rev":"29-b3c8a0e76d99ddb80c98d2aad5586771"}}, -{"id":"openlayers","key":"openlayers","value":{"rev":"3-602c34468c9be326e95be327b58d599b"}}, -{"id":"opentok","key":"opentok","value":{"rev":"5-5f4749f1763d45141d0272c1dbe6249a"}}, -{"id":"opentsdb-dashboard","key":"opentsdb-dashboard","value":{"rev":"3-2e0c5ccf3c9cfce17c20370c93283707"}}, -{"id":"opower-jobs","key":"opower-jobs","value":{"rev":"16-1602139f92e58d88178f21f1b3e0939f"}}, -{"id":"optimist","key":"optimist","value":{"rev":"64-ca3e5085acf135169d79949c25d84690"}}, -{"id":"optparse","key":"optparse","value":{"rev":"6-0200c34395f982ae3b80f4d18cb14483"}}, -{"id":"opts","key":"opts","value":{"rev":"8-ce2a0e31de55a1e02d5bbff66c4e8794"}}, -{"id":"orchestra","key":"orchestra","value":{"rev":"9-52ca98cddb51a2a43ec02338192c44fc"}}, -{"id":"orchid","key":"orchid","value":{"rev":"49-af9635443671ed769e4efa691b8ca84a"}}, -{"id":"orderly","key":"orderly","value":{"rev":"3-9ccc42d45b64278c9ffb1e64fc4f0d62"}}, -{"id":"orgsync.live","key":"orgsync.live","value":{"rev":"3-4dffc8ac43931364f59b9cb534acbaef"}}, -{"id":"orm","key":"orm","value":{"rev":"21-f3e7d89239364559d306110580bbb08f"}}, -{"id":"ormnomnom","key":"ormnomnom","value":{"rev":"15-0aacfbb5b7b580d76e9ecf5214a1d5ed"}}, -{"id":"orona","key":"orona","value":{"rev":"8-62d4ba1bf49098a140a2b85f80ebb103"}}, -{"id":"osc4node","key":"osc4node","value":{"rev":"3-0910613e78065f78b61142b35986e8b3"}}, -{"id":"oscar","key":"oscar","value":{"rev":"3-f5d2d39a67c67441bc2135cdaf2b47f8"}}, -{"id":"osrandom","key":"osrandom","value":{"rev":"3-026016691a5ad068543503e5e7ce6a84"}}, -{"id":"ossp-uuid","key":"ossp-uuid","value":{"rev":"10-8b7e1fba847d7cc9aa4f4c8813ebe6aa"}}, -{"id":"ostatus","key":"ostatus","value":{"rev":"3-76e0ec8c61c6df15c964197b722e24e7"}}, -{"id":"ostrich","key":"ostrich","value":{"rev":"3-637e0821e5ccfd0f6b1261b22c168c8d"}}, -{"id":"otk","key":"otk","value":{"rev":"5-2dc24e159cc618f43e573561286c4dcd"}}, -{"id":"ourl","key":"ourl","value":{"rev":"5-a3945e59e33faac96c75b508ef7fa1fb"}}, -{"id":"oursql","key":"oursql","value":{"rev":"21-bc53ab462155fa0aedbe605255fb9988"}}, -{"id":"out","key":"out","value":{"rev":"5-eb261f940b6382e2689210a58bc1b440"}}, -{"id":"overload","key":"overload","value":{"rev":"10-b88919e5654bef4922029afad4f1d519"}}, -{"id":"ox","key":"ox","value":{"rev":"3-0ca445370b4f76a93f2181ad113956d9"}}, -{"id":"pachube","key":"pachube","value":{"rev":"10-386ac6be925bab307b5d545516fb18ef"}}, -{"id":"pachube-stream","key":"pachube-stream","value":{"rev":"13-176dadcc5c516420fb3feb1f964739e0"}}, -{"id":"pack","key":"pack","value":{"rev":"29-8f8c511d95d1fb322c1a6d7965ef8f29"}}, -{"id":"packagebohrer","key":"packagebohrer","value":{"rev":"3-507358253a945a74c49cc169ad0bf5a2"}}, -{"id":"packer","key":"packer","value":{"rev":"9-23410d893d47418731e236cfcfcfbf03"}}, -{"id":"packet","key":"packet","value":{"rev":"8-1b366f97d599c455dcbbe4339da7cf9e"}}, -{"id":"pacote-sam-egenial","key":"pacote-sam-egenial","value":{"rev":"3-b967db1b9fceb9a937f3520efd89f479"}}, -{"id":"pacoteegenial","key":"pacoteegenial","value":{"rev":"3-9cfe8518b885bfd9a44ed38814f7d623"}}, -{"id":"pact","key":"pact","value":{"rev":"7-82996c1a0c8e9a5e9df959d4ad37085e"}}, -{"id":"pad","key":"pad","value":{"rev":"3-eef6147f09b662cff95c946f2b065da5"}}, -{"id":"paddle","key":"paddle","value":{"rev":"3-fedd0156b9a0dadb5e9b0f1cfab508fd"}}, -{"id":"padlock","key":"padlock","value":{"rev":"9-3a9e378fbe8e3817da7999f675af227e"}}, -{"id":"pagen","key":"pagen","value":{"rev":"9-9aac56724039c38dcdf7f6d5cbb4911c"}}, -{"id":"paginate-js","key":"paginate-js","value":{"rev":"5-995269155152db396662c59b67e9e93d"}}, -{"id":"pairtree","key":"pairtree","value":{"rev":"3-0361529e6c91271e2a61f3d7fd44366e"}}, -{"id":"palsu-app","key":"palsu-app","value":{"rev":"3-73f1fd9ae35e3769efc9c1aa25ec6da7"}}, -{"id":"pam","key":"pam","value":{"rev":"3-77b5bd15962e1c8be1980b33fd3b9737"}}, -{"id":"panache","key":"panache","value":{"rev":"25-749d2034f7f9179c2266cf896bb4abb0"}}, -{"id":"panic","key":"panic","value":{"rev":"7-068b22be54ca8ae7b03eb153c2ea849a"}}, -{"id":"pantry","key":"pantry","value":{"rev":"33-3896f0fc165092f6cabb2949be3952c4"}}, -{"id":"paper-keys","key":"paper-keys","value":{"rev":"3-729378943040ae01d59f07bb536309b7"}}, -{"id":"paperboy","key":"paperboy","value":{"rev":"8-db2d51c2793b4ffc82a1ae928c813aae"}}, -{"id":"paperserve","key":"paperserve","value":{"rev":"6-8509fb68217199a3eb74f223b1e2bee5"}}, -{"id":"parall","key":"parall","value":{"rev":"5-279d7105a425e136f6101250e8f81a14"}}, -{"id":"parallel","key":"parallel","value":{"rev":"14-f1294b3b840cfb26095107110b6720ec"}}, -{"id":"paramon","key":"paramon","value":{"rev":"3-37e599e924beb509c894c992cf72791b"}}, -{"id":"parannus","key":"parannus","value":{"rev":"7-7541f1ed13553261330b9e1c4706f112"}}, -{"id":"parasite","key":"parasite","value":{"rev":"13-83c26181bb92cddb8ff76bc154a50210"}}, -{"id":"parrot","key":"parrot","value":{"rev":"3-527d1cb4b5be0e252dc92a087d380f17"}}, -{"id":"parseUri","key":"parseUri","value":{"rev":"3-3b60b1fd6d8109279b5d0cfbdb89b343"}}, -{"id":"parseopt","key":"parseopt","value":{"rev":"10-065f1acaf02c94f0684f75fefc2fd1ec"}}, -{"id":"parser","key":"parser","value":{"rev":"5-f661f0b7ede9b6d3e0de259ed20759b1"}}, -{"id":"parser_email","key":"parser_email","value":{"rev":"12-63333860c62f2a9c9d6b0b7549bf1cdc"}}, -{"id":"parstream","key":"parstream","value":{"rev":"3-ef7e8ffc8ce1e7d951e37f85bfd445ab"}}, -{"id":"parted","key":"parted","value":{"rev":"9-250e4524994036bc92915b6760d62d8a"}}, -{"id":"partial","key":"partial","value":{"rev":"7-208411e6191275a4193755ee86834716"}}, -{"id":"party","key":"party","value":{"rev":"5-9337d8dc5e163f0300394f533ab1ecdf"}}, -{"id":"pashua","key":"pashua","value":{"rev":"3-b752778010f4e20f662a3d8f0f57b18b"}}, -{"id":"pass","key":"pass","value":{"rev":"3-66a2d55d93eae8535451f12965578db8"}}, -{"id":"passthru","key":"passthru","value":{"rev":"9-3c8f0b20f1a16976f3645a6f7411b56a"}}, -{"id":"passwd","key":"passwd","value":{"rev":"19-44ac384382a042faaa1f3b111786c831"}}, -{"id":"password","key":"password","value":{"rev":"9-0793f6a8d09076f25cde7c9e528eddec"}}, -{"id":"password-hash","key":"password-hash","value":{"rev":"9-590c62e275ad577c6f8ddbf5ba4579cc"}}, -{"id":"path","key":"path","value":{"rev":"3-3ec064cf3f3a85cb59528654c5bd938f"}}, -{"id":"pathjs","key":"pathjs","value":{"rev":"5-d5e1b1a63e711cae3ac79a3b1033b609"}}, -{"id":"pathname","key":"pathname","value":{"rev":"9-16f2c1473454900ce18a217b2ea52c57"}}, -{"id":"paths","key":"paths","value":{"rev":"3-fa47b7c1d533a7d9f4bbaffc5fb89905"}}, -{"id":"patr","key":"patr","value":{"rev":"7-7bcd37586389178b9f23d33c1d7a0292"}}, -{"id":"pattern","key":"pattern","value":{"rev":"36-3ded826185c384af535dcd428af3f626"}}, -{"id":"payment-paypal-payflowpro","key":"payment-paypal-payflowpro","value":{"rev":"14-d8814a1d8bba57a6ecf8027064adc7ad"}}, -{"id":"paynode","key":"paynode","value":{"rev":"16-16084e61db66ac18fdbf95a51d31c09a"}}, -{"id":"payos","key":"payos","value":{"rev":"3-373695bd80c454b32b83a5eba6044261"}}, -{"id":"paypal-ipn","key":"paypal-ipn","value":{"rev":"5-ef32291f9f8371b20509db3acee722f6"}}, -{"id":"pcap","key":"pcap","value":{"rev":"46-8ae9e919221102581d6bb848dc67b84b"}}, -{"id":"pd","key":"pd","value":{"rev":"7-82146739c4c0eb4e49e40aa80a29cc0a"}}, -{"id":"pdf","key":"pdf","value":{"rev":"6-5c6b6a133e1b3ce894ebb1a49090216c"}}, -{"id":"pdfcrowd","key":"pdfcrowd","value":{"rev":"5-026b4611b50374487bfd64fd3e0d562c"}}, -{"id":"pdfkit","key":"pdfkit","value":{"rev":"13-2fd34c03225a87dfd8057c85a83f3c50"}}, -{"id":"pdflatex","key":"pdflatex","value":{"rev":"3-bbbf61f09ebe4c49ca0aff8019611660"}}, -{"id":"pdl","key":"pdl","value":{"rev":"3-4c41bf12e901ee15bdca468db8c89102"}}, -{"id":"peanut","key":"peanut","value":{"rev":"55-b797121dbbcba1219934284ef56abb8a"}}, -{"id":"pebble","key":"pebble","value":{"rev":"21-3cd08362123260a2e96d96d80e723805"}}, -{"id":"pecode","key":"pecode","value":{"rev":"3-611f5e8c61bbf4467b84da954ebdd521"}}, -{"id":"pegjs","key":"pegjs","value":{"rev":"11-091040d16433014d1da895e32ac0f6a9"}}, -{"id":"per-second","key":"per-second","value":{"rev":"5-e1593b3f7008ab5e1c3cae86f39ba3f3"}}, -{"id":"permafrost","key":"permafrost","value":{"rev":"9-494cbc9a2f43a60b57f23c5f5b12270d"}}, -{"id":"perry","key":"perry","value":{"rev":"41-15aed7a778fc729ad62fdfb231c50774"}}, -{"id":"persistencejs","key":"persistencejs","value":{"rev":"20-2585af3f15f0a4a7395e937237124596"}}, -{"id":"pg","key":"pg","value":{"rev":"142-48de452fb8a84022ed7cae8ec2ebdaf6"}}, -{"id":"phonetap","key":"phonetap","value":{"rev":"7-2cc7d3c2a09518ad9b0fe816c6a99125"}}, -{"id":"php-autotest","key":"php-autotest","value":{"rev":"3-04470b38b259187729af574dd3dc1f97"}}, -{"id":"phpass","key":"phpass","value":{"rev":"3-66f4bec659bf45b312022bb047b18696"}}, -{"id":"piano","key":"piano","value":{"rev":"3-0bab6b5409e4305c87a775e96a2b7ad3"}}, -{"id":"picard","key":"picard","value":{"rev":"5-7676e6ad6d5154fdc016b001465891f3"}}, -{"id":"picardForTynt","key":"picardForTynt","value":{"rev":"3-09d205b790bd5022b69ec4ad54bad770"}}, -{"id":"pid","key":"pid","value":{"rev":"3-0ba7439d599b9d613461794c3892d479"}}, -{"id":"pieshop","key":"pieshop","value":{"rev":"12-7851afe1bbc20de5d054fe93b071f849"}}, -{"id":"pig","key":"pig","value":{"rev":"3-8e6968a7b64635fed1bad12c39d7a46a"}}, -{"id":"pigeons","key":"pigeons","value":{"rev":"53-8df70420d3c845cf0159b3f25d0aab90"}}, -{"id":"piles","key":"piles","value":{"rev":"3-140cb1e83b5a939ecd429b09886132ef"}}, -{"id":"pillar","key":"pillar","value":{"rev":"6-83c81550187f6d00e11dd9955c1c94b7"}}, -{"id":"pilot","key":"pilot","value":{"rev":"3-073ed1a083cbd4c2aa2561f19e5935ea"}}, -{"id":"pinboard","key":"pinboard","value":{"rev":"3-1020cab02a1183acdf82e1f7620dc1e0"}}, -{"id":"pinf-loader-js","key":"pinf-loader-js","value":{"rev":"5-709ba9c86fb4de906bd7bbca53771f0f"}}, -{"id":"pinf-loader-js-demos-npmpackage","key":"pinf-loader-js-demos-npmpackage","value":{"rev":"3-860569d98c83e59185cff356e56b10a6"}}, -{"id":"pingback","key":"pingback","value":{"rev":"5-5d0a05d65a14f6837b0deae16c550bec"}}, -{"id":"pingdom","key":"pingdom","value":{"rev":"11-f299d6e99122a9fa1497bfd166dadd02"}}, -{"id":"pintpay","key":"pintpay","value":{"rev":"3-eba9c4059283adec6b1ab017284c1f17"}}, -{"id":"pipe","key":"pipe","value":{"rev":"5-d202bf317c10a52ac817b5c1a4ce4c88"}}, -{"id":"pipe_utils","key":"pipe_utils","value":{"rev":"13-521857c99eb76bba849a22240308e584"}}, -{"id":"pipegram","key":"pipegram","value":{"rev":"3-1449333c81dd658d5de9eebf36c07709"}}, -{"id":"pipeline-surveyor","key":"pipeline-surveyor","value":{"rev":"11-464db89b17e7b44800088ec4a263d92e"}}, -{"id":"pipes","key":"pipes","value":{"rev":"99-8320636ff840a61d82d9c257a2e0ed48"}}, -{"id":"pipes-cellar","key":"pipes-cellar","value":{"rev":"27-e035e58a3d82e50842d766bb97ea3ed9"}}, -{"id":"pipes-cohort","key":"pipes-cohort","value":{"rev":"9-88fc0971e01516873396e44974874903"}}, -{"id":"piton-entity","key":"piton-entity","value":{"rev":"31-86254212066019f09d67dfd58524bd75"}}, -{"id":"piton-http-utils","key":"piton-http-utils","value":{"rev":"3-6cf6aa0c655ff6118d53e62e3b970745"}}, -{"id":"piton-mixin","key":"piton-mixin","value":{"rev":"3-7b7737004e53e04f7f95ba5850eb5e70"}}, -{"id":"piton-pipe","key":"piton-pipe","value":{"rev":"3-8d7df4e53f620ef2f24e9fc8b24f0238"}}, -{"id":"piton-simplate","key":"piton-simplate","value":{"rev":"3-9ac00835d3de59d535cdd2347011cdc9"}}, -{"id":"piton-string-utils","key":"piton-string-utils","value":{"rev":"3-ecab73993d764dfb378161ea730dbbd5"}}, -{"id":"piton-validity","key":"piton-validity","value":{"rev":"13-1766651d69e3e075bf2c66b174b66026"}}, -{"id":"pixel-ping","key":"pixel-ping","value":{"rev":"11-38d717c927e13306e8ff9032785b50f2"}}, -{"id":"pixelcloud","key":"pixelcloud","value":{"rev":"7-0897d734157b52dece8f86cde7be19d4"}}, -{"id":"pixiedust","key":"pixiedust","value":{"rev":"3-6b932dee4b6feeed2f797de5d0066f8a"}}, -{"id":"pkginfo","key":"pkginfo","value":{"rev":"13-3ee42503d6672812960a965d4f3a1bc2"}}, -{"id":"pksqlite","key":"pksqlite","value":{"rev":"13-095e7d7d0258b71491c39d0e8c4f19be"}}, -{"id":"plants.js","key":"plants.js","value":{"rev":"3-e3ef3a16f637787e84c100a9b9ec3b08"}}, -{"id":"plate","key":"plate","value":{"rev":"20-92ba0729b2edc931f28870fe7f2ca95a"}}, -{"id":"platform","key":"platform","value":{"rev":"4-be465a1d21be066c96e30a42b8602177"}}, -{"id":"platformjs","key":"platformjs","value":{"rev":"35-5c510fa0c90492fd1d0f0fc078460018"}}, -{"id":"platoon","key":"platoon","value":{"rev":"28-e0e0c5f852eadacac5a652860167aa11"}}, -{"id":"play","key":"play","value":{"rev":"5-17f7cf7cf5d1c21c7392f3c43473098d"}}, -{"id":"plist","key":"plist","value":{"rev":"10-2a23864923aeed93fb8e25c4b5b2e97e"}}, -{"id":"png","key":"png","value":{"rev":"14-9cc7aeaf0c036c9a880bcee5cd46229a"}}, -{"id":"png-guts","key":"png-guts","value":{"rev":"5-a29c7c686f9d08990ce29632bf59ef90"}}, -{"id":"policyfile","key":"policyfile","value":{"rev":"21-4a9229cca4bcac10f730f296f7118548"}}, -{"id":"polla","key":"polla","value":{"rev":"27-9af5a575961a4dddb6bef482c168c756"}}, -{"id":"poly","key":"poly","value":{"rev":"3-7f7fe29d9f0ec4fcbf8481c797b20455"}}, -{"id":"polyglot","key":"polyglot","value":{"rev":"3-9306e246d1f8b954b41bef76e3e81291"}}, -{"id":"pool","key":"pool","value":{"rev":"10-f364b59aa8a9076a17cd94251dd013ab"}}, -{"id":"poolr","key":"poolr","value":{"rev":"5-cacfbeaa7aaca40c1a41218e8ac8b732"}}, -{"id":"pop","key":"pop","value":{"rev":"41-8edd9ef2f34a90bf0ec5e8eb0e51e644"}}, -{"id":"pop-disqus","key":"pop-disqus","value":{"rev":"3-4a8272e6a8453ed2d754397dc8b349bb"}}, -{"id":"pop-ga","key":"pop-ga","value":{"rev":"3-5beaf7b355d46b3872043b97696ee693"}}, -{"id":"pop-gallery","key":"pop-gallery","value":{"rev":"3-1a88920ff930b8ce51cd50fcfe62675e"}}, -{"id":"pop3-client","key":"pop3-client","value":{"rev":"3-be8c314b0479d9d98384e2ff36d7f207"}}, -{"id":"poplib","key":"poplib","value":{"rev":"7-ab64c5c35269aee897b0904b4548096b"}}, -{"id":"porter-stemmer","key":"porter-stemmer","value":{"rev":"5-724a7b1d635b95a14c9ecd9d2f32487d"}}, -{"id":"portfinder","key":"portfinder","value":{"rev":"5-cdf36d1c666bbdae500817fa39b9c2bd"}}, -{"id":"portscanner","key":"portscanner","value":{"rev":"3-773c1923b6f3b914bd801476efcfdf64"}}, -{"id":"pos","key":"pos","value":{"rev":"3-1c1a27020560341ecd1b54d0e3cfaf2a"}}, -{"id":"posix-getopt","key":"posix-getopt","value":{"rev":"3-819b69724575b65fe25cf1c768e1b1c6"}}, -{"id":"postageapp","key":"postageapp","value":{"rev":"9-f5735237f7e6f0b467770e28e84c56db"}}, -{"id":"postal","key":"postal","value":{"rev":"19-dd70aeab4ae98ccf3d9f203dff9ccf37"}}, -{"id":"posterous","key":"posterous","value":{"rev":"3-6f8a9e7cae8a26f021653f2c27b0c67f"}}, -{"id":"postgres","key":"postgres","value":{"rev":"6-e8844a47c83ff3ef0a1ee7038b2046b2"}}, -{"id":"postgres-js","key":"postgres-js","value":{"rev":"3-bbe27a49ee9f8ae8789660e178d6459d"}}, -{"id":"postman","key":"postman","value":{"rev":"5-548538583f2e7ad448adae27f9a801e5"}}, -{"id":"postmark","key":"postmark","value":{"rev":"24-a6c61b346329e499d4a4a37dbfa446a2"}}, -{"id":"postmark-api","key":"postmark-api","value":{"rev":"3-79973af301aa820fc18c2c9d418adcd7"}}, -{"id":"postmessage","key":"postmessage","value":{"rev":"5-854bdb27c2a1af5b629b01f7d69691fe"}}, -{"id":"postpie","key":"postpie","value":{"rev":"10-88527e2731cd07a3b8ddec2608682700"}}, -{"id":"postprocess","key":"postprocess","value":{"rev":"5-513ecd54bf8df0ae73d2a50c717fd939"}}, -{"id":"potato","key":"potato","value":{"rev":"3-0f4cab343859692bf619e79cd9cc5be1"}}, -{"id":"pour","key":"pour","value":{"rev":"7-272bee63c5f19d12102198a23a4af902"}}, -{"id":"pow","key":"pow","value":{"rev":"22-58b557cd71ec0e95eef51dfd900e4736"}}, -{"id":"precious","key":"precious","value":{"rev":"19-b370292b258bcbca02c5d8861ebee0bb"}}, -{"id":"predicate","key":"predicate","value":{"rev":"3-1c6d1871fe71bc61457483793eecf7f9"}}, -{"id":"prefer","key":"prefer","value":{"rev":"11-236b9d16cd019e1d9af41e745bfed754"}}, -{"id":"prenup","key":"prenup","value":{"rev":"3-4c56ddf1ee22cd90c85963209736bc75"}}, -{"id":"pretty-json","key":"pretty-json","value":{"rev":"5-2dbb22fc9573c19e64725ac331a8d59c"}}, -{"id":"prettyfy","key":"prettyfy","value":{"rev":"3-fc7e39aad63a42533d4ac6d6bfa32325"}}, -{"id":"prick","key":"prick","value":{"rev":"10-71a02e1be02df2af0e6a958099be565a"}}, -{"id":"printf","key":"printf","value":{"rev":"5-2896b8bf90df19d4a432153211ca3a7e"}}, -{"id":"pro","key":"pro","value":{"rev":"5-e98adaf2f741e00953bbb942bbeb14d2"}}, -{"id":"probe_couchdb","key":"probe_couchdb","value":{"rev":"28-86f8918a3e64608f8009280fb28a983d"}}, -{"id":"process","key":"process","value":{"rev":"3-6865fc075d8083afd8e2aa266512447c"}}, -{"id":"procfile","key":"procfile","value":{"rev":"3-22dbb2289f5fb3060a8f7833b50116a4"}}, -{"id":"profile","key":"profile","value":{"rev":"29-5afee07fe4c334d9836fda1df51e1f2d"}}, -{"id":"profilejs","key":"profilejs","value":{"rev":"9-128c2b0e09624ee69a915cff20cdf359"}}, -{"id":"profiler","key":"profiler","value":{"rev":"13-4f1582fad93cac11daad5d5a67565e4f"}}, -{"id":"progress","key":"progress","value":{"rev":"7-bba60bc39153fa0fbf5e909b6df213b0"}}, -{"id":"progress-bar","key":"progress-bar","value":{"rev":"5-616721d3856b8e5a374f247404d6ab29"}}, -{"id":"progressify","key":"progressify","value":{"rev":"5-0379cbed5adc2c3f3ac6adf0307ec11d"}}, -{"id":"proj4js","key":"proj4js","value":{"rev":"5-7d209ce230f6a2d5931800acef436a06"}}, -{"id":"projectwatch","key":"projectwatch","value":{"rev":"15-d0eca46ffc3d9e18a51db2d772fa2778"}}, -{"id":"promise","key":"promise","value":{"rev":"3-1409350eb10aa9055ed13a5b59f0abc3"}}, -{"id":"promised-fs","key":"promised-fs","value":{"rev":"28-1d3e0dd1884e1c39a5d5e2d35bb1f911"}}, -{"id":"promised-http","key":"promised-http","value":{"rev":"8-3f8d560c800ddd44a617bf7d7c688392"}}, -{"id":"promised-io","key":"promised-io","value":{"rev":"11-e9a280e85c021cd8b77e524aac50fafb"}}, -{"id":"promised-traits","key":"promised-traits","value":{"rev":"14-62d0ac59d4ac1c6db99c0273020565ea"}}, -{"id":"promised-utils","key":"promised-utils","value":{"rev":"20-0c2488685eb8999c40ee5e7cfa4fd75d"}}, -{"id":"prompt","key":"prompt","value":{"rev":"32-d52a524c147e34c1258facab69660cc2"}}, -{"id":"props","key":"props","value":{"rev":"17-8c4c0bf1b69087510612c8d5ccbfbfeb"}}, -{"id":"proserver","key":"proserver","value":{"rev":"3-4b0a001404171eb0f6f3e5d73a35fcb1"}}, -{"id":"protege","key":"protege","value":{"rev":"150-9790c23d7b7eb5fb94cd5b8048bdbf10"}}, -{"id":"proto","key":"proto","value":{"rev":"6-29fe2869f34e2737b0cc2a0dbba8e397"}}, -{"id":"proto-list","key":"proto-list","value":{"rev":"3-0f64ff29a4a410d5e03a57125374b87b"}}, -{"id":"protobuf-stream","key":"protobuf-stream","value":{"rev":"3-950e621ce7eef306eff5f932a9c4cbae"}}, -{"id":"protodiv","key":"protodiv","value":{"rev":"9-ed8d84033943934eadf5d95dfd4d8eca"}}, -{"id":"proton","key":"proton","value":{"rev":"19-8ad32d57a3e71df786ff41ef8c7281f2"}}, -{"id":"protoparse","key":"protoparse","value":{"rev":"3-9fbcc3b26220f974d4b9c9c883a0260b"}}, -{"id":"prototype","key":"prototype","value":{"rev":"5-2a672703595e65f5d731a967b43655a7"}}, -{"id":"prowl","key":"prowl","value":{"rev":"5-ec480caa5a7db4f1ec2ce22d5eb1dad8"}}, -{"id":"prowler","key":"prowler","value":{"rev":"3-09747704f78c7c123fb1c719c4996924"}}, -{"id":"prox","key":"prox","value":{"rev":"5-0ac5f893b270a819d91f0c6581aca2a8"}}, -{"id":"proxify","key":"proxify","value":{"rev":"3-d24a979b708645328476bd42bd5aaba8"}}, -{"id":"proxino","key":"proxino","value":{"rev":"7-894cc6d453af00e5e39ebc8f0b0abe3a"}}, -{"id":"proxio","key":"proxio","value":{"rev":"55-a1b2744054b3dc3adc2f7f67d2c026a4"}}, -{"id":"proxy","key":"proxy","value":{"rev":"3-c6dd1a8b58e0ed7ac983c89c05ee987d"}}, -{"id":"proxy-by-url","key":"proxy-by-url","value":{"rev":"5-acfcf47f3575cea6594513ff459c5f2c"}}, -{"id":"pseudo","key":"pseudo","value":{"rev":"11-4d894a335036d96cdb9bb19f7b857293"}}, -{"id":"psk","key":"psk","value":{"rev":"17-375055bf6315476a37b5fadcdcb6b149"}}, -{"id":"pty","key":"pty","value":{"rev":"8-0b3ea0287fd23f882da27dabce4e3230"}}, -{"id":"pub-mix","key":"pub-mix","value":{"rev":"3-2c455b249167cbf6b1a6ea761bf119f4"}}, -{"id":"pubjs","key":"pubjs","value":{"rev":"3-a0ceab8bc6ec019dfcf9a8e16756bea0"}}, -{"id":"publicsuffix","key":"publicsuffix","value":{"rev":"8-1592f0714595c0ca0433272c60afc733"}}, -{"id":"publisher","key":"publisher","value":{"rev":"13-f2c8722f14732245d3ca8842fe5b7661"}}, -{"id":"pubnub-client","key":"pubnub-client","value":{"rev":"8-6e511a6dd2b7feb6cefe410facd61f53"}}, -{"id":"pubsub","key":"pubsub","value":{"rev":"11-6c6270bf95af417fb766c05f66b2cc9e"}}, -{"id":"pubsub.io","key":"pubsub.io","value":{"rev":"24-9686fe9ae3356966dffee99f53eaad2c"}}, -{"id":"pubsubd","key":"pubsubd","value":{"rev":"3-b1ff2fa958bd450933735162e9615449"}}, -{"id":"pulley","key":"pulley","value":{"rev":"13-f81ed698175ffd0b5b19357a623b8f15"}}, -{"id":"pulse","key":"pulse","value":{"rev":"9-da4bdabb6d7c189d05c8d6c64713e4ac"}}, -{"id":"pulverizr","key":"pulverizr","value":{"rev":"16-ffd4db4d2b1bfbd0b6ac794dca9e728e"}}, -{"id":"pulverizr-bal","key":"pulverizr-bal","value":{"rev":"5-dba279d07f3ed72990d10f11c5d10792"}}, -{"id":"punycode","key":"punycode","value":{"rev":"3-c0df35bb32d1490a4816161974610682"}}, -{"id":"puppy","key":"puppy","value":{"rev":"3-355fb490dba55efdf8840e2769cb7f41"}}, -{"id":"pure","key":"pure","value":{"rev":"7-b2da0d64ea12cea63bed940222bb36df"}}, -{"id":"purpose","key":"purpose","value":{"rev":"3-ef30ac479535bd603954c27ecb5d564a"}}, -{"id":"push-it","key":"push-it","value":{"rev":"35-2640be8ca8938768836520ce5fc7fff2"}}, -{"id":"pusher","key":"pusher","value":{"rev":"5-eb363d1e0ea2c59fd92a07ea642c5d03"}}, -{"id":"pusher-pipe","key":"pusher-pipe","value":{"rev":"11-11ab87d1288a8c7d11545fdab56616f6"}}, -{"id":"pushinator","key":"pushinator","value":{"rev":"15-6b2c37931bc9438e029a6af0cf97091c"}}, -{"id":"put","key":"put","value":{"rev":"12-4b05a7cdfdb24a980597b38781457cf5"}}, -{"id":"put-selector","key":"put-selector","value":{"rev":"1-1a9b3b8b5a44485b93966503370978aa"}}, -{"id":"putio","key":"putio","value":{"rev":"3-973b65e855e1cd0d3cc685542263cc55"}}, -{"id":"pwilang","key":"pwilang","value":{"rev":"43-49ad04f5abbdd9c5b16ec0271ab17520"}}, -{"id":"py","key":"py","value":{"rev":"3-aade832559d0fab88116aa794e3a9f35"}}, -{"id":"pygments","key":"pygments","value":{"rev":"3-2b2c96f39bdcb9ff38eb7d4bac7c90ba"}}, -{"id":"python","key":"python","value":{"rev":"15-706af811b5544a4aacc6ad1e9863e369"}}, -{"id":"q","key":"q","value":{"rev":"80-fd2397ad465750240d0f22a0abc53de5"}}, -{"id":"q-comm","key":"q-comm","value":{"rev":"17-972994947f097fdcffcfcb2277c966ce"}}, -{"id":"q-fs","key":"q-fs","value":{"rev":"68-958b01dd5bdc4da5ba3c1cd02c85fc0e"}}, -{"id":"q-http","key":"q-http","value":{"rev":"26-42a7db91b650386d920f52afe3e9161f"}}, -{"id":"q-io","key":"q-io","value":{"rev":"20-79f7b3d43bcbd53cc57b6531426738e2"}}, -{"id":"q-io-buffer","key":"q-io-buffer","value":{"rev":"5-05528d9a527da73357991bec449a1b76"}}, -{"id":"q-require","key":"q-require","value":{"rev":"12-e3fc0388e4d3e6d8a15274c3cc239712"}}, -{"id":"q-util","key":"q-util","value":{"rev":"10-94e0c392e70fec942aee0f024e5c090f"}}, -{"id":"qbox","key":"qbox","value":{"rev":"17-88f9148881ede94ae9dcbf4e1980aa69"}}, -{"id":"qfi","key":"qfi","value":{"rev":"3-a6052f02aec10f17085b09e4f9da1ce0"}}, -{"id":"qjscl","key":"qjscl","value":{"rev":"11-def1631b117a53cab5fd38ffec28d727"}}, -{"id":"qooxdoo","key":"qooxdoo","value":{"rev":"5-720d33ec2de3623d6535b3bdc8041d81"}}, -{"id":"qoper8","key":"qoper8","value":{"rev":"11-48fa2ec116bec46d64161e35b0f0cd86"}}, -{"id":"qq","key":"qq","value":{"rev":"23-6f7a5f158364bbf2e90a0c6eb1fbf8a9"}}, -{"id":"qqwry","key":"qqwry","value":{"rev":"10-bf0d6cc2420bdad92a1104c184e7e045"}}, -{"id":"qr","key":"qr","value":{"rev":"11-0a0120b7ec22bbcf76ff1d78fd4a7689"}}, -{"id":"qrcode","key":"qrcode","value":{"rev":"11-b578b6a76bffe996a0390e3d886b79bb"}}, -{"id":"qs","key":"qs","value":{"rev":"23-3da45c8c8a5eb33d45360d92b6072d37"}}, -{"id":"quack-array","key":"quack-array","value":{"rev":"5-6b676aa6273e4515ab5e7bfee1c331e0"}}, -{"id":"quadprog","key":"quadprog","value":{"rev":"7-c0ceeeb12735f334e8c7940ac1f0a896"}}, -{"id":"quadraticon","key":"quadraticon","value":{"rev":"66-1da88ea871e6f90967b9f65c0204309d"}}, -{"id":"quasi","key":"quasi","value":{"rev":"3-6fe0faa91d849938d8c92f91b0828395"}}, -{"id":"query","key":"query","value":{"rev":"13-635ff8d88c6a3f9d92f9ef465b14fb82"}}, -{"id":"query-engine","key":"query-engine","value":{"rev":"21-66feaee07df9fa1f625ac797e8f6b90b"}}, -{"id":"querystring","key":"querystring","value":{"rev":"5-2b509239fafba56319137bfbe1e9eeb7"}}, -{"id":"queue","key":"queue","value":{"rev":"3-5c4af574e5056f7e6ceb9bfefc1c632d"}}, -{"id":"queuelib","key":"queuelib","value":{"rev":"61-87c2abc94a5ad40af8193fac9a1d9f7e"}}, -{"id":"quickcheck","key":"quickcheck","value":{"rev":"7-64e6c1e9efc08a89abe3d01c414d1411"}}, -{"id":"quickserve","key":"quickserve","value":{"rev":"3-9c19f8ad7daf06182f42b8c7063b531f"}}, -{"id":"quip","key":"quip","value":{"rev":"8-0624055f5056f72bc719340c95e5111a"}}, -{"id":"qunit","key":"qunit","value":{"rev":"37-6e7fefdaffab8fc5fb92a391da227c38"}}, -{"id":"qunit-tap","key":"qunit-tap","value":{"rev":"22-0266cd1b5bb7cbab89fa52642f0e8277"}}, -{"id":"qwery","key":"qwery","value":{"rev":"66-29f9b44da544a3a9b4537a85ceace7c8"}}, -{"id":"qwery-mobile","key":"qwery-mobile","value":{"rev":"5-182264ca68c30519bf0d29cf1e15854b"}}, -{"id":"raZerdummy","key":"raZerdummy","value":{"rev":"7-1fa549e0cff60795b49cbd3732f32175"}}, -{"id":"rabbit.js","key":"rabbit.js","value":{"rev":"3-dbcd5cd590576673c65b34c44ff06bec"}}, -{"id":"rabblescay","key":"rabblescay","value":{"rev":"5-3fea196ffd581a842a24ab7bb2118fe2"}}, -{"id":"racer","key":"racer","value":{"rev":"51-41c65689a335d70fa6b55b9706b9c0fe"}}, -{"id":"radcouchdb","key":"radcouchdb","value":{"rev":"3-64ccb4d0acb2b11cbb1d3fcef5f9a68e"}}, -{"id":"radio-stream","key":"radio-stream","value":{"rev":"6-c5f80a0bef7bbaacdd22d92da3d09244"}}, -{"id":"railway","key":"railway","value":{"rev":"74-5ce92a45c7d11540b0e2b5a8455361ce"}}, -{"id":"railway-mailer","key":"railway-mailer","value":{"rev":"3-8df2fbe4af4d3b1f12557d8397bf0548"}}, -{"id":"railway-twitter","key":"railway-twitter","value":{"rev":"3-df984f182bb323052e36876e8e3a066c"}}, -{"id":"rand","key":"rand","value":{"rev":"11-abb69107c390e2a6dcec64cb72f36096"}}, -{"id":"random","key":"random","value":{"rev":"7-32550b221f3549b67f379c1c2dbc5c57"}}, -{"id":"random-data","key":"random-data","value":{"rev":"5-ae651ea36724105b8677ae489082ab4d"}}, -{"id":"range","key":"range","value":{"rev":"3-1d3925f30ffa6b5f3494d507fcef3aa1"}}, -{"id":"ranger","key":"ranger","value":{"rev":"17-6135a9a9d83cbd3945f1ce991f276cb8"}}, -{"id":"rap-battle","key":"rap-battle","value":{"rev":"3-6960516c0d27906bb9343805a5eb0e45"}}, -{"id":"raphael","key":"raphael","value":{"rev":"7-012f159593a82e4587ea024a5d4fbe41"}}, -{"id":"raphael-zoom","key":"raphael-zoom","value":{"rev":"3-aaab74bebbeb4241cade4f4d3c9b130e"}}, -{"id":"rapid","key":"rapid","value":{"rev":"8-ae0b05388c7904fc88c743e3dcde1d9d"}}, -{"id":"rasputin","key":"rasputin","value":{"rev":"3-87cdd9bd591606f4b8439e7a76681c7b"}}, -{"id":"rate-limiter","key":"rate-limiter","value":{"rev":"3-24cd20fef83ce02f17dd383b72f5f125"}}, -{"id":"rats","key":"rats","value":{"rev":"3-1ff1efb311451a17789da910eaf59fb6"}}, -{"id":"raydash","key":"raydash","value":{"rev":"7-96c345beb3564d2789d209d1fe695857"}}, -{"id":"rbytes","key":"rbytes","value":{"rev":"13-cf09d91347a646f590070e516f0c9bc9"}}, -{"id":"rdf","key":"rdf","value":{"rev":"3-9a5012d1fc10da762dbe285d0b317499"}}, -{"id":"rdf-raptor-parser","key":"rdf-raptor-parser","value":{"rev":"11-25c61e4d57cf67ee8a5afb6dfcf193e3"}}, -{"id":"rdfstore","key":"rdfstore","value":{"rev":"41-4499a73efc48ad07234e56fd4e27e4e0"}}, -{"id":"rdio","key":"rdio","value":{"rev":"5-fa20a8ab818a6150e38e9bb7744968f9"}}, -{"id":"rdx","key":"rdx","value":{"rev":"3-e1db5ee3aad06edd9eadcdaa8aaba149"}}, -{"id":"rea","key":"rea","value":{"rev":"3-f17ceeb35337bc9ccf9cb440d5c4dfaf"}}, -{"id":"read-files","key":"read-files","value":{"rev":"3-e08fac4abcdbc7312beb0362ff4427b4"}}, -{"id":"readability","key":"readability","value":{"rev":"3-475601a3d99d696763872c52bce6a155"}}, -{"id":"readabilitySAX","key":"readabilitySAX","value":{"rev":"19-83277777f3f721be26aca28c66227b01"}}, -{"id":"ready.js","key":"ready.js","value":{"rev":"39-8e309b8b274722c051c67f90885571e8"}}, -{"id":"readyjslint","key":"readyjslint","value":{"rev":"3-0a3742129bfbe07d47fcfb9ff67d39b2"}}, -{"id":"recaptcha","key":"recaptcha","value":{"rev":"8-8895926476be014fbe08b301294bf37b"}}, -{"id":"recaptcha-async","key":"recaptcha-async","value":{"rev":"9-3033260389f8afdb5351974119b78ca2"}}, -{"id":"recline","key":"recline","value":{"rev":"189-b56ab8c7791201dccf4aea2532189f1d"}}, -{"id":"recon","key":"recon","value":{"rev":"13-79cbddefb00fec6895342d18609cadb1"}}, -{"id":"reconf","key":"reconf","value":{"rev":"5-0596988db2cf9bf5921502a2aab24ade"}}, -{"id":"redback","key":"redback","value":{"rev":"37-03b390f69cacf42a46e393b7cf297d09"}}, -{"id":"rede","key":"rede","value":{"rev":"3-ee74c2fd990c7780dc823e22a9c3bef2"}}, -{"id":"redecard","key":"redecard","value":{"rev":"13-7dec5a50c34132a2f20f0f143d6b5215"}}, -{"id":"redim","key":"redim","value":{"rev":"15-91c9fd560d1ce87d210b461c52a6d258"}}, -{"id":"redis","key":"redis","value":{"rev":"98-ec237259e8ef5c42a76ff260be50f8fd"}}, -{"id":"redis-channels","key":"redis-channels","value":{"rev":"3-8efc40a25fd18c1c9c41bbaeedb0b22f"}}, -{"id":"redis-client","key":"redis-client","value":{"rev":"3-3376054236e651e7dfcf91be8632fd0e"}}, -{"id":"redis-completer","key":"redis-completer","value":{"rev":"11-9e5bf1f8d37df681e7896252809188d3"}}, -{"id":"redis-keyspace","key":"redis-keyspace","value":{"rev":"25-245f2375741eb3e574dfce9f2da2b687"}}, -{"id":"redis-lua","key":"redis-lua","value":{"rev":"7-81f3dd3a4601271818f15278f495717a"}}, -{"id":"redis-namespace","key":"redis-namespace","value":{"rev":"3-ddf52a172db190fe788aad4116b1cb29"}}, -{"id":"redis-node","key":"redis-node","value":{"rev":"24-7a1e9098d8b5a42a99ca71a01b0d7672"}}, -{"id":"redis-queue","key":"redis-queue","value":{"rev":"3-9896587800c4b98ff291b74210c16b6e"}}, -{"id":"redis-session-store","key":"redis-session-store","value":{"rev":"3-2229501ecf817f9ca60ff2c7721ddd73"}}, -{"id":"redis-tag","key":"redis-tag","value":{"rev":"9-6713e8e91a38613cfef09d7b40f4df71"}}, -{"id":"redis-url","key":"redis-url","value":{"rev":"5-f53545a0039b512a2f7afd4ba2e08773"}}, -{"id":"redis-user","key":"redis-user","value":{"rev":"11-a8c0f6d40cbfbb6183a46e121f31ec06"}}, -{"id":"redis2json","key":"redis2json","value":{"rev":"5-dd96f78f8db0bf695346c95c2ead1307"}}, -{"id":"redis_objects","key":"redis_objects","value":{"rev":"3-499fe6dd07e7a3839111b1892b97f54c"}}, -{"id":"redisev","key":"redisev","value":{"rev":"3-8e857dbe2341292c6e170a7bfe3fa81b"}}, -{"id":"redisfs","key":"redisfs","value":{"rev":"69-d9c90256d32348fdca7a4e646ab4d551"}}, -{"id":"redisify","key":"redisify","value":{"rev":"3-03fce3095b4129e71280d278f11121ba"}}, -{"id":"rediskit","key":"rediskit","value":{"rev":"5-6a0324708f45d884a492cbc408137059"}}, -{"id":"redisql","key":"redisql","value":{"rev":"6-b31802eb37910cb74bd3c9f7b477c025"}}, -{"id":"redmark","key":"redmark","value":{"rev":"5-8724ab00513b6bd7ddfdcd3cc2e0a4e8"}}, -{"id":"redmess","key":"redmess","value":{"rev":"13-14f58666444993ce899cd2260cdc9140"}}, -{"id":"redobj","key":"redobj","value":{"rev":"7-7ebbeffc306f4f7ff9b53ee57e1a250e"}}, -{"id":"redpack","key":"redpack","value":{"rev":"73-58b3fb3bcadf7d80fbe97d9e82d4928b"}}, -{"id":"reds","key":"reds","value":{"rev":"9-baebb36b92887d93fd79785a8c1e6355"}}, -{"id":"reed","key":"reed","value":{"rev":"45-5580f319dc3b5bfb66612ed5c7e17337"}}, -{"id":"reflect","key":"reflect","value":{"rev":"18-b590003cd55332160a5e5327e806e851"}}, -{"id":"reflect-builder","key":"reflect-builder","value":{"rev":"3-453d618b263f9452c0b6bbab0a701f49"}}, -{"id":"reflect-next","key":"reflect-next","value":{"rev":"9-4f2b27a38985d81e906e824321af7713"}}, -{"id":"reflect-tree-builder","key":"reflect-tree-builder","value":{"rev":"5-5f801f53e126dc8a72e13b1417904ce6"}}, -{"id":"reflect-unbuilder","key":"reflect-unbuilder","value":{"rev":"5-f36fd4182fd465a743198b5188697db9"}}, -{"id":"reflectjs","key":"reflectjs","value":{"rev":"3-e03bdb411ffcdd901b896a1cf43eea69"}}, -{"id":"reflex","key":"reflex","value":{"rev":"3-e8bb6b6de906265114b22036832ef650"}}, -{"id":"refmate","key":"refmate","value":{"rev":"3-7d44c45a2eb39236ad2071c84dc0fbba"}}, -{"id":"regext","key":"regext","value":{"rev":"4-97ca5c25fd2f3dc4bd1f3aa821d06f0f"}}, -{"id":"reid-yui3","key":"reid-yui3","value":{"rev":"5-cab8f6e22dfa9b9c508a5dd312bf56b0"}}, -{"id":"rel","key":"rel","value":{"rev":"7-f447870ac7a078f742e4295896646241"}}, -{"id":"relative-date","key":"relative-date","value":{"rev":"5-d0fa11f8100da888cbcce6e96d76b2e4"}}, -{"id":"reloadOnUpdate","key":"reloadOnUpdate","value":{"rev":"9-e7d4c215578b779b2f888381d398bd79"}}, -{"id":"reloaded","key":"reloaded","value":{"rev":"3-dba828b9ab73fc7ce8e47f98068bce8c"}}, -{"id":"remap","key":"remap","value":{"rev":"5-825ac1783df84aba3255c1d39f32ac00"}}, -{"id":"remedial","key":"remedial","value":{"rev":"17-9bb17db015e96db3c833f84d9dbd972a"}}, -{"id":"remote-console","key":"remote-console","value":{"rev":"6-104bae3ba9e4b0a8f772d0b8dc37007e"}}, -{"id":"remote_js","key":"remote_js","value":{"rev":"3-6c0e3058c33113346c037c59206ac0ec"}}, -{"id":"render","key":"render","value":{"rev":"27-fc8be4e9c50e49fb42df83e9446a1f58"}}, -{"id":"renode","key":"renode","value":{"rev":"11-107a3e15a987393157b47125487af296"}}, -{"id":"reparse","key":"reparse","value":{"rev":"10-210ec92e82f5a8515f45d20c7fa2f164"}}, -{"id":"repl","key":"repl","value":{"rev":"3-295279fe20b9ac54b2a235a6bc7013aa"}}, -{"id":"repl-edit","key":"repl-edit","value":{"rev":"18-eb2e604ab8bb65685376459beb417a31"}}, -{"id":"repl-utils","key":"repl-utils","value":{"rev":"7-fc31547ecb53e7e36610cdb68bcec582"}}, -{"id":"replace","key":"replace","value":{"rev":"17-a8976fcdbeb08e27ee2f0fc69ccd7c9d"}}, -{"id":"replica","key":"replica","value":{"rev":"3-f9dae960f91e8dc594f43b004f516d5f"}}, -{"id":"replicate","key":"replicate","value":{"rev":"3-3d6e52af6ff36c02139f619c7e5599c6"}}, -{"id":"replique","key":"replique","value":{"rev":"5-72d990b7d9ce9ff107d96be17490226a"}}, -{"id":"req2","key":"req2","value":{"rev":"3-712151f335b25b5bdef428982d77d0e0"}}, -{"id":"reqhooks","key":"reqhooks","value":{"rev":"17-2f0f0b73545bb1936f449a1ec4a28011"}}, -{"id":"request","key":"request","value":{"rev":"55-0d0b00eecde877ca5cd4ad9e0badc4d1"}}, -{"id":"require","key":"require","value":{"rev":"15-59e9fa05a9de52ee2a818c045736452b"}}, -{"id":"require-analyzer","key":"require-analyzer","value":{"rev":"72-f759f0cdc352df317df29791bfe451f1"}}, -{"id":"require-kiss","key":"require-kiss","value":{"rev":"5-f7ef9d7beda584e9c95635a281a01587"}}, -{"id":"require-like","key":"require-like","value":{"rev":"7-29d5de79e7ff14bb02da954bd9a2ee33"}}, -{"id":"requireincontext","key":"requireincontext","value":{"rev":"5-988ff7c27a21e527ceeb50cbedc8d1b0"}}, -{"id":"requirejs","key":"requirejs","value":{"rev":"3-e609bc91d12d698a17aa51bb50a50509"}}, -{"id":"requirejson","key":"requirejson","value":{"rev":"3-2b8173e58d08034a53a3226c464b1dc8"}}, -{"id":"reqwest","key":"reqwest","value":{"rev":"57-5aa2c1ed17b1e3630859bcad85559e6a"}}, -{"id":"resig-class","key":"resig-class","value":{"rev":"3-16b1a2cdb3224f2043708436dbac4395"}}, -{"id":"resistance","key":"resistance","value":{"rev":"9-9cacbf5fa8318419b4751034a511b8c1"}}, -{"id":"resmin","key":"resmin","value":{"rev":"17-a9c8ded5073118748d765784ca4ea069"}}, -{"id":"resolve","key":"resolve","value":{"rev":"11-bba3470bc93a617ccf9fb6c12097c793"}}, -{"id":"resource-router","key":"resource-router","value":{"rev":"13-7b2991958da4d7701c51537192ca756c"}}, -{"id":"resourcer","key":"resourcer","value":{"rev":"3-4e8b5493d6fcdf147f53d3aaa731a509"}}, -{"id":"response","key":"response","value":{"rev":"3-c5cadf4e5dd90dc1022b92a67853b0f8"}}, -{"id":"resque","key":"resque","value":{"rev":"12-e2f5e1bc3e53ac0a992d1a7da7da0d14"}}, -{"id":"rest-in-node","key":"rest-in-node","value":{"rev":"3-41d1ba925857302211bd0bf9d19975f9"}}, -{"id":"rest-mongo","key":"rest-mongo","value":{"rev":"3-583d2a4b672d6d7e7ad26d0b6df20b45"}}, -{"id":"rest.node","key":"rest.node","value":{"rev":"3-2ed59ba9dcc97123632dfdfaea2559ed"}}, -{"id":"restalytics","key":"restalytics","value":{"rev":"11-5fb3cd8e95b37f1725922fa6fbb146e0"}}, -{"id":"restarter","key":"restarter","value":{"rev":"52-ab0a4fe59128b8848ffd88f9756d0049"}}, -{"id":"restartr","key":"restartr","value":{"rev":"12-d3b86e43e7df7697293db65bb1a1ae65"}}, -{"id":"restify","key":"restify","value":{"rev":"132-054bdc85bebc6221a07dda186238b4c3"}}, -{"id":"restler","key":"restler","value":{"rev":"13-f5392d9dd22e34ce3bcc307c51c889b3"}}, -{"id":"restler-aaronblohowiak","key":"restler-aaronblohowiak","value":{"rev":"8-28b231eceb667153e10effcb1ebeb989"}}, -{"id":"restmvc.js","key":"restmvc.js","value":{"rev":"25-d57b550754437580c447adf612c87d9a"}}, -{"id":"resware","key":"resware","value":{"rev":"9-a5ecbc53fefb280c5d1e3efd822704ff"}}, -{"id":"retrie","key":"retrie","value":{"rev":"7-28ea803ad6b119928ac792cbc8f475c9"}}, -{"id":"retro","key":"retro","value":{"rev":"3-94c3aec940e28869554cbb8449d9369e"}}, -{"id":"retry","key":"retry","value":{"rev":"19-89f3ef664c6fa48ff33a0b9f7e798f15"}}, -{"id":"reut","key":"reut","value":{"rev":"23-d745dd7f8606275848a299ad7c38ceb7"}}, -{"id":"rewrite","key":"rewrite","value":{"rev":"3-5cb91fd831d0913e89354f53b875137d"}}, -{"id":"rex","key":"rex","value":{"rev":"39-59025e6947e5f197f124d24a5393865f"}}, -{"id":"rfb","key":"rfb","value":{"rev":"34-db6e684ac9366a0e3658a508a2187ae1"}}, -{"id":"rhyme","key":"rhyme","value":{"rev":"7-27347762f3f5bfa07307da4e476c2d52"}}, -{"id":"riak-js","key":"riak-js","value":{"rev":"55-11d4ee4beb566946f3968abdf1c4b0ef"}}, -{"id":"riakqp","key":"riakqp","value":{"rev":"7-83f562e6907431fcee56a9408ac6d2c1"}}, -{"id":"rightjs","key":"rightjs","value":{"rev":"9-d53ae4c4f5af3bbbe18d7c879e5bdd1b"}}, -{"id":"rimraf","key":"rimraf","value":{"rev":"17-3ddc3f3f36618712e5f4f27511836e7a"}}, -{"id":"rio","key":"rio","value":{"rev":"11-7c6249c241392b51b9142ca1b228dd4e"}}, -{"id":"ristretto","key":"ristretto","value":{"rev":"3-beb22d7a575e066781f1fd702c4572d7"}}, -{"id":"roast","key":"roast","value":{"rev":"32-17cb066823afab1656196a2fe81246cb"}}, -{"id":"robb","key":"robb","value":{"rev":"5-472ed7ba7928131d86a05fcae89b9f93"}}, -{"id":"robots","key":"robots","value":{"rev":"9-afac82b944045c82acb710cc98c7311d"}}, -{"id":"robotskirt","key":"robotskirt","value":{"rev":"63-29a66420951812d421bf6728f67e710c"}}, -{"id":"robotstxt","key":"robotstxt","value":{"rev":"25-1e01cac90f4570d35ab20232feaeebfa"}}, -{"id":"rocket","key":"rocket","value":{"rev":"27-b0f1ff02e70b237bcf6a5b46aa9b74df"}}, -{"id":"roil","key":"roil","value":{"rev":"48-6b00c09b576fe195546bd031763c0d79"}}, -{"id":"roll","key":"roll","value":{"rev":"5-d3fed9271132eb6c954b3ac6c7ffccf0"}}, -{"id":"rollin","key":"rollin","value":{"rev":"3-bd461bc810c12cfcea94109ba9a2ab39"}}, -{"id":"ron","key":"ron","value":{"rev":"5-913645180d29f377506bcd5292d3cb49"}}, -{"id":"rondo","key":"rondo","value":{"rev":"3-9bed539bbaa0cb978f5c1b711d70cd50"}}, -{"id":"ronn","key":"ronn","value":{"rev":"12-b1b1a1d47376fd11053e2b81fe772c4c"}}, -{"id":"rot13","key":"rot13","value":{"rev":"10-a41e8b581812f02ca1a593f6da0c52dc"}}, -{"id":"router","key":"router","value":{"rev":"26-a7883048759715134710d68f179da18b"}}, -{"id":"routes","key":"routes","value":{"rev":"3-d841826cfd365d8f383a9c4f4288933c"}}, -{"id":"rpc","key":"rpc","value":{"rev":"5-5896f380115a7a606cd7cbbc6d113f05"}}, -{"id":"rpc-socket","key":"rpc-socket","value":{"rev":"17-8743dc1a1f5ba391fc5c7d432cc6eeba"}}, -{"id":"rq","key":"rq","value":{"rev":"7-ba263671c3a3b52851dc7d5e6bd4ef8c"}}, -{"id":"rql","key":"rql","value":{"rev":"1-ac5ec10ed5e41a10a289f26aff4def5a"}}, -{"id":"rqueue","key":"rqueue","value":{"rev":"12-042898704386874c70d0ffaeea6ebc78"}}, -{"id":"rrd","key":"rrd","value":{"rev":"9-488adf135cf29cd4725865a8f25a57ba"}}, -{"id":"rsa","key":"rsa","value":{"rev":"8-7d6f981d72322028c3bebb7141252e98"}}, -{"id":"rss","key":"rss","value":{"rev":"3-0a97b20a0a9051876d779af7663880bd"}}, -{"id":"rssee","key":"rssee","value":{"rev":"9-da2599eae68e50c1695fd7f8fcba2b30"}}, -{"id":"rumba","key":"rumba","value":{"rev":"3-7a3827fa6eca2d02d3189cbad38dd6ca"}}, -{"id":"run","key":"run","value":{"rev":"9-0145abb61e6107a3507624928db461da"}}, -{"id":"runforcover","key":"runforcover","value":{"rev":"3-a36b00ea747c98c7cd7afebf1e1b203c"}}, -{"id":"runlol","key":"runlol","value":{"rev":"3-3c97684baaa3d5b31ca404e8a616fe41"}}, -{"id":"runner","key":"runner","value":{"rev":"11-b7ceeedf7b0dde19c809642f1537723a"}}, -{"id":"runways","key":"runways","value":{"rev":"5-f216f5fa6af7ccc7566cdd06cf424980"}}, -{"id":"rw-translate","key":"rw-translate","value":{"rev":"3-16d2beb17a27713e10459ce368c5d087"}}, -{"id":"rx","key":"rx","value":{"rev":"5-ea2a04ecf38963f8a99b7a408b45af31"}}, -{"id":"rzr","key":"rzr","value":{"rev":"4-6a137fa752709531f2715de5a213b326"}}, -{"id":"s-tpl","key":"s-tpl","value":{"rev":"3-1533cf9657cfe669a25da96b6a655f5c"}}, -{"id":"s3-post","key":"s3-post","value":{"rev":"9-ad3b268bc6754852086b50c2f465c02c"}}, -{"id":"safis","key":"safis","value":{"rev":"3-f1494d0dae2b7dfd60beba5a72412ad2"}}, -{"id":"saiga","key":"saiga","value":{"rev":"22-0c67e8cf8f4b6e8ea30552ffc57d222a"}}, -{"id":"sailthru-client","key":"sailthru-client","value":{"rev":"7-1c9c236050868fb8dec4a34ded2436d3"}}, -{"id":"saimonmoore-cradle","key":"saimonmoore-cradle","value":{"rev":"3-5059616ab0f0f10e1c2d164f686e127e"}}, -{"id":"salesforce","key":"salesforce","value":{"rev":"7-f88cbf517b1fb900358c97b2c049960f"}}, -{"id":"sam","key":"sam","value":{"rev":"7-d7e24d2e94411a17cbedfbd8083fd878"}}, -{"id":"sandbox","key":"sandbox","value":{"rev":"10-0b51bed24e0842f99744dcf5d79346a6"}}, -{"id":"sandboxed-module","key":"sandboxed-module","value":{"rev":"15-bf8fa69d15ae8416d534e3025a16d87d"}}, -{"id":"sanitizer","key":"sanitizer","value":{"rev":"32-6ea8f4c77cd17253c27d0d87e0790678"}}, -{"id":"sapnwrfc","key":"sapnwrfc","value":{"rev":"3-0bc717109ffcd5265ae24f00416a0281"}}, -{"id":"sardines","key":"sardines","value":{"rev":"7-82712731b5af112ca43b9e3fe9975bb0"}}, -{"id":"sargam","key":"sargam","value":{"rev":"3-6b4c70f4b2bcd2add43704bf40c44507"}}, -{"id":"sasl","key":"sasl","value":{"rev":"4-44a6e12b561b112a574ec9e0c4a8843f"}}, -{"id":"sass","key":"sass","value":{"rev":"14-46bcee5423a1efe22f039e116bb7a77c"}}, -{"id":"satisfic","key":"satisfic","value":{"rev":"3-c6e9a2e65a0e55868cea708bcf7b11cf"}}, -{"id":"sax","key":"sax","value":{"rev":"30-58c5dd2c3367522974406bbf29204a40"}}, -{"id":"say","key":"say","value":{"rev":"10-95f31672af6166ea9099d92706c49ed1"}}, -{"id":"sayndo","key":"sayndo","value":{"rev":"51-fd93715c5ff0fcaa68e4e13c2b51ba61"}}, -{"id":"sc-handlebars","key":"sc-handlebars","value":{"rev":"3-b424c3a66fd0e538b068c6046f404084"}}, -{"id":"scgi-server","key":"scgi-server","value":{"rev":"9-3364b5c39985ea8f3468b6abb53d5ea6"}}, -{"id":"scheduler","key":"scheduler","value":{"rev":"25-72bc526bb49b0dd42ad5917d38ea3b18"}}, -{"id":"schema","key":"schema","value":{"rev":"21-166410ae972449965dfa1ce615971168"}}, -{"id":"schema-builder","key":"schema-builder","value":{"rev":"3-bce4612e1e5e6a8a85f16326d3810145"}}, -{"id":"schema-org","key":"schema-org","value":{"rev":"15-59b3b654de0380669d0dcd7573c3b7a1"}}, -{"id":"scone","key":"scone","value":{"rev":"15-85ed2dd4894e896ca1c942322753b76b"}}, -{"id":"scooj","key":"scooj","value":{"rev":"3-1be2074aeba4df60594c03f3e59c7734"}}, -{"id":"scope","key":"scope","value":{"rev":"65-9d7eb8c5fc6c54d8e2c49f4b4b4f5166"}}, -{"id":"scope-provider","key":"scope-provider","value":{"rev":"22-2c25a0b260fd18236d5245c8250d990e"}}, -{"id":"scoped-http-client","key":"scoped-http-client","value":{"rev":"3-afa954fe6d1c8b64a1240b77292d99b5"}}, -{"id":"scottbot","key":"scottbot","value":{"rev":"3-d812ddb4af49976c391f14aeecf93180"}}, -{"id":"scraper","key":"scraper","value":{"rev":"19-e2166b3de2b33d7e6baa04c704887fa6"}}, -{"id":"scrapinode","key":"scrapinode","value":{"rev":"15-ae5bf5085d8c4d5390f7c313b0ad13d2"}}, -{"id":"scrappy-do","key":"scrappy-do","value":{"rev":"3-868f5d299da401112e3ed9976194f1ee"}}, -{"id":"scrapr","key":"scrapr","value":{"rev":"3-d700714a56e8f8b8e9b3bc94274f4a24"}}, -{"id":"scrawl","key":"scrawl","value":{"rev":"3-a70a2905b9a1d2f28eb379c14363955f"}}, -{"id":"scribe","key":"scribe","value":{"rev":"5-4cefaaf869ba8e6ae0257e5705532fbe"}}, -{"id":"scriptTools","key":"scriptTools","value":{"rev":"7-1b66b7f02f2f659ae224057afac60bcf"}}, -{"id":"scriptbroadcast","key":"scriptbroadcast","value":{"rev":"10-3cdc4dae471445b7e08e6fc37c2481e6"}}, -{"id":"scriptjs","key":"scriptjs","value":{"rev":"38-9a522df4f0707d47c904f6781fd97ff6"}}, -{"id":"scrowser","key":"scrowser","value":{"rev":"3-a76938b1f84db0793941dba1f84f4c2f"}}, -{"id":"scss","key":"scss","value":{"rev":"10-49a4ad40eca3c797add57986c74e100b"}}, -{"id":"scylla","key":"scylla","value":{"rev":"10-2c5a1efed63c0ac3a3e75861ee323af4"}}, -{"id":"sdl","key":"sdl","value":{"rev":"40-3df0824da620098c0253b5330c6b0c5c"}}, -{"id":"sdlmixer","key":"sdlmixer","value":{"rev":"4-91455739802a98a5549f6c2b8118758d"}}, -{"id":"search","key":"search","value":{"rev":"9-8f696da412a6ccd07c3b8f22cec315cb"}}, -{"id":"searchjs","key":"searchjs","value":{"rev":"3-59418ce307d41de5649dfc158be51adf"}}, -{"id":"searchparser","key":"searchparser","value":{"rev":"3-a84719692ee33c88f3419f033b839f7a"}}, -{"id":"sechash","key":"sechash","value":{"rev":"11-20db8651628dcf6e8cbbc9bf9b2c4f12"}}, -{"id":"secret","key":"secret","value":{"rev":"7-ac44b38fa32b3f5ebc8fd03b02ec69ec"}}, -{"id":"seedrandom","key":"seedrandom","value":{"rev":"3-becb92de803208672887fc22a1a33694"}}, -{"id":"seek","key":"seek","value":{"rev":"3-d778b8d56582e15d409e2346b86caa53"}}, -{"id":"sel","key":"sel","value":{"rev":"19-94c8bc0872d2da7eab2b35daff7a3b5d"}}, -{"id":"select","key":"select","value":{"rev":"5-43593bfec39caaf1a0bc1fedc96d0dce"}}, -{"id":"selenium","key":"selenium","value":{"rev":"3-8ae8ac7a491b813fd011671e0d494f20"}}, -{"id":"selfish","key":"selfish","value":{"rev":"17-827856c3f3b9a3fdd1758477a24bf706"}}, -{"id":"selleck","key":"selleck","value":{"rev":"13-b8325fcdb383397041e4a408b40d708c"}}, -{"id":"semver","key":"semver","value":{"rev":"25-b2aea0cc920a9981cd429442a3fd62f6"}}, -{"id":"sendgrid","key":"sendgrid","value":{"rev":"3-047e2ad730390bac7cf72b7fc3856c1c"}}, -{"id":"sendgrid-api","key":"sendgrid-api","value":{"rev":"5-6e951b0d60a1b7c778fbf548d4e3aed8"}}, -{"id":"sendgrid-web","key":"sendgrid-web","value":{"rev":"3-dc77d2dbcedfcbe4e497958a2a070cfd"}}, -{"id":"sentry","key":"sentry","value":{"rev":"7-57af332354cbd37ce1c743b424b27dd0"}}, -{"id":"seq","key":"seq","value":{"rev":"77-33a8f54017402835c8542945a5c0a443"}}, -{"id":"sequelize","key":"sequelize","value":{"rev":"63-4c28ad13b73549aad7edc57378b21854"}}, -{"id":"sequence","key":"sequence","value":{"rev":"3-914f8010dc12aec0749ddb719f5ac82d"}}, -{"id":"sequencer","key":"sequencer","value":{"rev":"7-d83e687509678c0f5bcf15e5297677c0"}}, -{"id":"sequent","key":"sequent","value":{"rev":"3-cc6f26ab708c7681fa7d9e3bc15d19c0"}}, -{"id":"serializer","key":"serializer","value":{"rev":"7-a0d13120e2d5cfaa6e453b085280fa08"}}, -{"id":"serialport","key":"serialport","value":{"rev":"32-dc365d057a4f46e9f140dc36d6cc825a"}}, -{"id":"serialportify","key":"serialportify","value":{"rev":"3-1bf4ad9c5ebb5d96ca91fc03a10b5443"}}, -{"id":"serialq","key":"serialq","value":{"rev":"3-5897fcd0fca7d8312e61dbcb93790a71"}}, -{"id":"series","key":"series","value":{"rev":"11-0374191f646c277c51602ebe73033b6a"}}, -{"id":"serve","key":"serve","value":{"rev":"11-560c0c1bdeb3348c7a7d18265d27988e"}}, -{"id":"servedir","key":"servedir","value":{"rev":"18-17cffd8d8326b26e7d9319c79d601dda"}}, -{"id":"server-backbone-redis","key":"server-backbone-redis","value":{"rev":"13-c56419457002aa4fa23b142634882594"}}, -{"id":"server-tracker","key":"server-tracker","value":{"rev":"21-f620e295079a8b0acd29fa1a1469100c"}}, -{"id":"service","key":"service","value":{"rev":"11-07533f9e5e854248c0a1d99e911fa419"}}, -{"id":"sesame","key":"sesame","value":{"rev":"19-1e7ad5d030566f4c67027cc5925a2bdb"}}, -{"id":"sesh","key":"sesh","value":{"rev":"4-1682b3ced38e95f2a11a2f545a820bd5"}}, -{"id":"session","key":"session","value":{"rev":"6-a798bf4cd7d127d0111da7cdc3e058a4"}}, -{"id":"session-mongoose","key":"session-mongoose","value":{"rev":"3-b089c8d365d7de3e659cfa7080697dba"}}, -{"id":"sessionvoc-client","key":"sessionvoc-client","value":{"rev":"23-0f9ed8cd4af55f2aae17cb841247b818"}}, -{"id":"set","key":"set","value":{"rev":"3-a285b30a9c1545b427ebd882bc53d8b2"}}, -{"id":"setInterval","key":"setInterval","value":{"rev":"3-0557f666d05223391466547f52cfff42"}}, -{"id":"setTimeout","key":"setTimeout","value":{"rev":"3-e3c059c93763967ddff5974471f227f8"}}, -{"id":"setochka","key":"setochka","value":{"rev":"3-d559e24618b4fc2d5fc4ef44bccb68be"}}, -{"id":"settings","key":"settings","value":{"rev":"5-4af85bb564a330886c79682d2f1d927c"}}, -{"id":"sexy","key":"sexy","value":{"rev":"7-e57fa6bca5d89be86467786fb9f9b997"}}, -{"id":"sexy-args","key":"sexy-args","value":{"rev":"3-715d7d57234220bd79c78772d2566355"}}, -{"id":"sfaClient","key":"sfaClient","value":{"rev":"3-5d9ddd6ea05d7ef366dbf4f66dd4f642"}}, -{"id":"sfml","key":"sfml","value":{"rev":"10-766c876cd1cc220f776e2fa3c1d9efbb"}}, -{"id":"sh","key":"sh","value":{"rev":"5-3ce779be28550e831cf3c0140477376c"}}, -{"id":"sha1","key":"sha1","value":{"rev":"3-66d4b67ace9c65ae8f03d6dd0647ff6b"}}, -{"id":"sha1_file","key":"sha1_file","value":{"rev":"7-eb25e9c5f470a1b80c1697a952a1c5ed"}}, -{"id":"shadows","key":"shadows","value":{"rev":"5-d6a1a21871c733f34495592307ab7961"}}, -{"id":"share","key":"share","value":{"rev":"15-ef81a004f0e115040dcc1510f6302fa9"}}, -{"id":"shared-views","key":"shared-views","value":{"rev":"11-2c83145e6deb3493e44805c92b58929e"}}, -{"id":"sharedjs","key":"sharedjs","value":{"rev":"9-d43a861b02aa88ae22810f9771d774ec"}}, -{"id":"shell","key":"shell","value":{"rev":"39-7e2042bd6f485b827d53f5f727164d6f"}}, -{"id":"shelld","key":"shelld","value":{"rev":"3-118a62ff31d85e61b78bbd97333a7330"}}, -{"id":"shimify","key":"shimify","value":{"rev":"3-dde4d45bcbd2f6f7faaeb7f8c31d5e8b"}}, -{"id":"ship","key":"ship","value":{"rev":"3-5f294fc3841c901d6cea7f3862625d95"}}, -{"id":"shmakowiki","key":"shmakowiki","value":{"rev":"15-079ae4595d1ddf019d22d3d0ac49a188"}}, -{"id":"shorten","key":"shorten","value":{"rev":"3-ed1395b35faf4639e25dacbb038cf237"}}, -{"id":"shorttag","key":"shorttag","value":{"rev":"5-21d15e4cb8b62aeefe23edc99ff768ec"}}, -{"id":"shorturl","key":"shorturl","value":{"rev":"5-58f78b2a5318ec7da8a5f88739f2796b"}}, -{"id":"shorty","key":"shorty","value":{"rev":"9-17f804ff6e94295549cca6fd534b89de"}}, -{"id":"shotenjin","key":"shotenjin","value":{"rev":"3-91a7864d216a931095e9999133d3c41f"}}, -{"id":"should","key":"should","value":{"rev":"19-ed561071d434f319080fa5d0f647dd93"}}, -{"id":"shovel","key":"shovel","value":{"rev":"5-0168a02a8fa8d7856a5f4a5c18706724"}}, -{"id":"showdown","key":"showdown","value":{"rev":"3-7be5479804451db3faed968fa428af56"}}, -{"id":"shredder","key":"shredder","value":{"rev":"3-93e12ab8822ba5fe86d662f124a8ad1a"}}, -{"id":"shrtn","key":"shrtn","value":{"rev":"19-5883692283903e3166b478b98bcad999"}}, -{"id":"shuffle","key":"shuffle","value":{"rev":"3-71c96da1843abb468649ab0806e6b9d3"}}, -{"id":"sibilant","key":"sibilant","value":{"rev":"18-4dcb400eb9ed9cb1c7826d155807f6d0"}}, -{"id":"sideline","key":"sideline","value":{"rev":"15-84f284a9277718bf90f68dc9351500ae"}}, -{"id":"siesta","key":"siesta","value":{"rev":"5-ff99a009e6e5897c6322237c51d0a142"}}, -{"id":"sign","key":"sign","value":{"rev":"3-2cf70313707c6a046a6ceca61431ea5e"}}, -{"id":"signals","key":"signals","value":{"rev":"7-c756190260cd3ea43e6d44e4722164cb"}}, -{"id":"signature","key":"signature","value":{"rev":"3-fb7552c27ace0f9321ec7438057a37bf"}}, -{"id":"signed-request","key":"signed-request","value":{"rev":"13-9f1563535dcc1a83338a7375d8240f35"}}, -{"id":"signer","key":"signer","value":{"rev":"5-32c9909da2c4dfb284b858164c03cfe0"}}, -{"id":"simple-class","key":"simple-class","value":{"rev":"3-92c6eea4b3a6169db9d62b12f66268cb"}}, -{"id":"simple-ffmpeg","key":"simple-ffmpeg","value":{"rev":"9-b6dd4fe162803e6db434d71035637993"}}, -{"id":"simple-logger","key":"simple-logger","value":{"rev":"5-52b4c957b3671375547d623c6a9444be"}}, -{"id":"simple-mime","key":"simple-mime","value":{"rev":"9-34e4b1dcc26047b64459d924abab65cc"}}, -{"id":"simple-proxy","key":"simple-proxy","value":{"rev":"9-ad6cd76215717527dc6b226e1219e98e"}}, -{"id":"simple-rest-client","key":"simple-rest-client","value":{"rev":"3-8331b3ae49b52720adf2b72d5da0353d"}}, -{"id":"simple-schedule","key":"simple-schedule","value":{"rev":"7-432d3803e1cf9ab5830923a30fd312e0"}}, -{"id":"simple-server","key":"simple-server","value":{"rev":"25-d4d8ba53d3829f4ca51545a3c23a1244"}}, -{"id":"simple-settings","key":"simple-settings","value":{"rev":"3-497d7c5422f764f3738b3ef303ff9737"}}, -{"id":"simple-static","key":"simple-static","value":{"rev":"3-64c9cf84e5140d4285e451357ac83df5"}}, -{"id":"simple-xml-writer","key":"simple-xml-writer","value":{"rev":"3-d1ca18252c341b4430ab6e1240b5f571"}}, -{"id":"simple-xmpp","key":"simple-xmpp","value":{"rev":"11-b4c10de5e4e12a81c4486206d7fb6b40"}}, -{"id":"simple_pubsub","key":"simple_pubsub","value":{"rev":"9-22ae79856ca25b152f104e5d8bc93f12"}}, -{"id":"simpledb","key":"simpledb","value":{"rev":"13-6bf111aa18bffd86e65fd996525a6113"}}, -{"id":"simplegeo","key":"simplegeo","value":{"rev":"8-eb684eea019ae7e5fa0c087a9747367e"}}, -{"id":"simplegeo-client","key":"simplegeo-client","value":{"rev":"7-b2c976bbf8c145c6b0e1744630548084"}}, -{"id":"simplegeo-thrift","key":"simplegeo-thrift","value":{"rev":"3-bf6ddf40c020889fe28630217f38a442"}}, -{"id":"simplelogger","key":"simplelogger","value":{"rev":"3-36634d2543faecdeccc962422d149ffc"}}, -{"id":"simplesets","key":"simplesets","value":{"rev":"26-48fc18f94744c9b288945844b7cc9196"}}, -{"id":"simplesmtp","key":"simplesmtp","value":{"rev":"6-0952f0c5f43a8e94b11355774bbbe9e8"}}, -{"id":"simplydb","key":"simplydb","value":{"rev":"5-34659bf97bbb40f0ec4a3af14107dc31"}}, -{"id":"sin","key":"sin","value":{"rev":"6-0e8bd66b3e2c8c91efef14a3ddc79c53"}}, -{"id":"sink","key":"sink","value":{"rev":"8-4c49709009dfb5719935dba568a3398e"}}, -{"id":"sink-test","key":"sink-test","value":{"rev":"18-411afcb398102f245e92f2ce91897d3e"}}, -{"id":"sinon","key":"sinon","value":{"rev":"19-fa38010bb1bbed437273e1296660d598"}}, -{"id":"sinon-buster","key":"sinon-buster","value":{"rev":"5-a456f0e21b3edb647ad11179cd02354b"}}, -{"id":"sinon-nodeunit","key":"sinon-nodeunit","value":{"rev":"7-d60aa76cc41a6c9d9db4e8ae268b7b3c"}}, -{"id":"sip","key":"sip","value":{"rev":"17-02be6fb014d41fe66ab22ff2ae60a5b8"}}, -{"id":"sitemap","key":"sitemap","value":{"rev":"13-a6d1c830fdc8942c317c1ebe00efbb6d"}}, -{"id":"sizlate","key":"sizlate","value":{"rev":"3-a86c680c681299045f9aabecb99dc161"}}, -{"id":"sizzle","key":"sizzle","value":{"rev":"5-f00e18a80fb8a4f6bdbf11735e265720"}}, -{"id":"sk","key":"sk","value":{"rev":"33-b0b894d02b0211dae08baadfd84b46c2"}}, -{"id":"skeleton","key":"skeleton","value":{"rev":"5-3559721c222b99cd3f56acaaf706992f"}}, -{"id":"skillet","key":"skillet","value":{"rev":"3-0d6bbe21952f85967a5e12425691ee50"}}, -{"id":"skull.io","key":"skull.io","value":{"rev":"3-082e9d58f24ac59144fc130f6b54927e"}}, -{"id":"slang","key":"slang","value":{"rev":"7-3cd6390e3421f677e4e1b00fdf2d3ee1"}}, -{"id":"sleepless","key":"sleepless","value":{"rev":"5-1482568719534caf17f12daf0130ae0d"}}, -{"id":"sleepylib","key":"sleepylib","value":{"rev":"3-60e851f120e34b0726eb50a38b1e27e2"}}, -{"id":"sleight","key":"sleight","value":{"rev":"3-a0f16b17befee698b172074f84daf44c"}}, -{"id":"slick","key":"slick","value":{"rev":"3-596b7b7cf7b8881c55327e8bcf373700"}}, -{"id":"slickback","key":"slickback","value":{"rev":"9-c036e7393d0f9a463a263f287f3bcefd"}}, -{"id":"slide","key":"slide","value":{"rev":"14-83ade7490da699cf0ed99cec818ce3cd"}}, -{"id":"slippers","key":"slippers","value":{"rev":"5-0d657ed5fca4c0ed8b51c6d7f6eac08a"}}, -{"id":"slug","key":"slug","value":{"rev":"3-046a5bd74cc1edce30faa3b6ab239652"}}, -{"id":"slugr","key":"slugr","value":{"rev":"39-ac346964f547433fe34e637de682f81a"}}, -{"id":"smartdc","key":"smartdc","value":{"rev":"31-8c9db85e4548007a0ef87b7286229952"}}, -{"id":"smoosh","key":"smoosh","value":{"rev":"34-ba1c140a173ff8d1f9cdbe5e5addcc43"}}, -{"id":"smores","key":"smores","value":{"rev":"17-1aef1fa2e1675093c5aaf33436d83f5a"}}, -{"id":"smpp","key":"smpp","value":{"rev":"5-9be31b75aee4db09cfe5a2ceef4bea13"}}, -{"id":"smsified","key":"smsified","value":{"rev":"13-bb97eae0bbb6f4d5c4f2f391cd20e891"}}, -{"id":"smtp","key":"smtp","value":{"rev":"20-c3de67c5d0b3c4493293d9f55adb21ad"}}, -{"id":"smtpc","key":"smtpc","value":{"rev":"11-7c4e1207be6eb06350221af0134e8bd7"}}, -{"id":"smtpclient","key":"smtpclient","value":{"rev":"3-ba61ad5f0fd3fdd382e505abcde8c24e"}}, -{"id":"snake","key":"snake","value":{"rev":"15-384892bf8a5ebf222f6fe0ae321aaaa4"}}, -{"id":"snappy","key":"snappy","value":{"rev":"11-94f2d59347c10cc41b6f4a2dd2b0f15e"}}, -{"id":"sng","key":"sng","value":{"rev":"41-a1d3c6253dec5da8b3134ba3505924f5"}}, -{"id":"snip","key":"snip","value":{"rev":"3-cc51d232fff6a7d7b24588bd98e5613b"}}, -{"id":"snipes","key":"snipes","value":{"rev":"3-12af12ca83e15d056969ec76a3cc2ef0"}}, -{"id":"snippets","key":"snippets","value":{"rev":"13-d19c8a99287ec721d56ef9efdf3ce729"}}, -{"id":"snorkel","key":"snorkel","value":{"rev":"11-bc7ba5d1465c7d1ba71479087292615e"}}, -{"id":"snowball","key":"snowball","value":{"rev":"3-76cfbdb9f379ac635874b76d7ee2fd3b"}}, -{"id":"snpp","key":"snpp","value":{"rev":"8-4f10a9f2bff48e348303d8a143afaa6c"}}, -{"id":"snsclient","key":"snsclient","value":{"rev":"3-302ce1c7132a36ef909ce534a509e27f"}}, -{"id":"soap","key":"soap","value":{"rev":"7-10f361a406dfee3074adac0cea127d87"}}, -{"id":"socket-push","key":"socket-push","value":{"rev":"22-196553953d58d92c288678b1dcd49ba7"}}, -{"id":"socket-twitchat","key":"socket-twitchat","value":{"rev":"11-9b159a4610ea444eaae39baa3bf05280"}}, -{"id":"socket.io","key":"socket.io","value":{"rev":"95-c29c929613dd95aa5aea8a5e14f2573f"}}, -{"id":"socket.io-client","key":"socket.io-client","value":{"rev":"33-a3c79d917bb038f0ca72f9cb27180a66"}}, -{"id":"socket.io-cluster","key":"socket.io-cluster","value":{"rev":"5-83bdaf79d2243eaf3a59b45fc604dc1a"}}, -{"id":"socket.io-connect","key":"socket.io-connect","value":{"rev":"17-62f00efc3bff3a1b549cc5e346da996f"}}, -{"id":"socket.io-context","key":"socket.io-context","value":{"rev":"42-a029996765557776d72690db1f14c1fa"}}, -{"id":"socket.io-ender","key":"socket.io-ender","value":{"rev":"9-c4523af5f5cc815ee69c325c1e29ede4"}}, -{"id":"socket.io-juggernaut","key":"socket.io-juggernaut","value":{"rev":"6-b8b97b2df2c186f24487e027278ec975"}}, -{"id":"socket.io-sessions","key":"socket.io-sessions","value":{"rev":"11-2151ee14eb29543811a9e567bcf6811a"}}, -{"id":"socketstream","key":"socketstream","value":{"rev":"29-b198d27ad6a3c4f9b63bc467e85a54a3"}}, -{"id":"sockjs","key":"sockjs","value":{"rev":"21-a8d6534c55e8b3e33cf06516b59aa408"}}, -{"id":"socksified","key":"socksified","value":{"rev":"3-92350ec9889b8db9c3d34bdbc41b1f7b"}}, -{"id":"soda","key":"soda","value":{"rev":"24-04987191e2c4241fbfaf78263c83d121"}}, -{"id":"soda-runner","key":"soda-runner","value":{"rev":"5-da4e8078a7666404d2a5ab3267a5ef75"}}, -{"id":"sodn","key":"sodn","value":{"rev":"3-3ee6350723c54aad792c769947c6b05e"}}, -{"id":"sofa","key":"sofa","value":{"rev":"7-2f8ffd47ce19e6fb7e1ea2e02076955d"}}, -{"id":"solder","key":"solder","value":{"rev":"10-8f7ad0a60c2716ce65658047c4ae5361"}}, -{"id":"solr","key":"solr","value":{"rev":"11-56a295dff56d9f2a4a7293257ca793a4"}}, -{"id":"solr-client","key":"solr-client","value":{"rev":"7-a296273d32224eb241343cb98ded7b82"}}, -{"id":"sones","key":"sones","value":{"rev":"3-9ddbbdc44f3501917e701d3304eb91a5"}}, -{"id":"song","key":"song","value":{"rev":"7-967aa3a58702b3470996cd8e63b1b18d"}}, -{"id":"sorted","key":"sorted","value":{"rev":"3-47b6ec0f744aa04929d48a7d3d10f581"}}, -{"id":"sosumi","key":"sosumi","value":{"rev":"10-8c3980beb3d7c48d4cccf44a8d1d5ff7"}}, -{"id":"soundcloud","key":"soundcloud","value":{"rev":"7-9ee76aecd3d1946731a1173185796864"}}, -{"id":"soupselect","key":"soupselect","value":{"rev":"12-5fea60f4e52117a8212aa7add6c34278"}}, -{"id":"source","key":"source","value":{"rev":"7-57d6cae0530c7cba4a3932f0df129f20"}}, -{"id":"source-map","key":"source-map","value":{"rev":"6-7da8d2ccc104fa30a93ee165975f28e8"}}, -{"id":"spacesocket","key":"spacesocket","value":{"rev":"6-d1679084b0917f86d6c4e3ac89a89809"}}, -{"id":"spark","key":"spark","value":{"rev":"12-64d44ebde2a4b48aed3bc7814c63e773"}}, -{"id":"spark2","key":"spark2","value":{"rev":"28-918548a309f0d18eebd5c64966376959"}}, -{"id":"sparql","key":"sparql","value":{"rev":"3-8eec87fe9fcb4d07aef214858eada777"}}, -{"id":"sparql-orm","key":"sparql-orm","value":{"rev":"3-b2a7efa5622b0b478fdca3f9050800cc"}}, -{"id":"spatial","key":"spatial","value":{"rev":"3-d09d40af02a9c9e5150500cc66d75f8d"}}, -{"id":"spawn","key":"spawn","value":{"rev":"3-f882c01cf1bb538f5f4be78769e1b097"}}, -{"id":"spdy","key":"spdy","value":{"rev":"13-1fbf077bbb8bc87d5058648c0c66288b"}}, -{"id":"spec","key":"spec","value":{"rev":"15-1074d3a8b8332fcc1059fbb5c4f69a7a"}}, -{"id":"speck","key":"speck","value":{"rev":"21-652b0670953ba79e548f4e5d9ce3d923"}}, -{"id":"spectrum","key":"spectrum","value":{"rev":"28-21fb9eeffe2e63a5383371a44a58a1ad"}}, -{"id":"speller","key":"speller","value":{"rev":"6-91e03f89b09338cf8f38d2e64c1778ce"}}, -{"id":"sphericalmercator","key":"sphericalmercator","value":{"rev":"9-3affc61ae0d64854d77829da5414bbc5"}}, -{"id":"spider","key":"spider","value":{"rev":"3-cd04679891875dfb2bf67613514238eb"}}, -{"id":"spider-tdd","key":"spider-tdd","value":{"rev":"3-d95b6d680d053a063e6fab3fdae16261"}}, -{"id":"spine","key":"spine","value":{"rev":"9-2a5cd4733be1d78376814e78966d885a"}}, -{"id":"spine.app","key":"spine.app","value":{"rev":"43-1044b31d4c53ff5c741a16d49291b321"}}, -{"id":"spine.mobile","key":"spine.mobile","value":{"rev":"19-220f64c212a5f22b27d597e299263490"}}, -{"id":"split_er","key":"split_er","value":{"rev":"3-3419662807bf16f7b5b53998a4759246"}}, -{"id":"spludo","key":"spludo","value":{"rev":"14-d41915fcd1b50553f5b9e706b41d2894"}}, -{"id":"spm","key":"spm","value":{"rev":"9-28d6699288d580807091aafdf78dd479"}}, -{"id":"spore","key":"spore","value":{"rev":"44-1c50fb0e6f7c3447f34b1927c976201f"}}, -{"id":"spork","key":"spork","value":{"rev":"3-e90976749b649b88ab83b59785dba101"}}, -{"id":"spotify","key":"spotify","value":{"rev":"3-90c74506a69e08a41feeb23541ac0b4f"}}, -{"id":"spotify-metadata","key":"spotify-metadata","value":{"rev":"3-a546d3e59e40ec0be5d8524f3a1e7a60"}}, -{"id":"spotlight","key":"spotlight","value":{"rev":"3-bead50ac8f53311d539a420c74ea23e2"}}, -{"id":"spread","key":"spread","value":{"rev":"3-ad7bf6d948043fc6dd47a6fcec7da294"}}, -{"id":"spreadsheet","key":"spreadsheet","value":{"rev":"11-94030e23cc9c8e515c1f340656aea031"}}, -{"id":"spreadsheets","key":"spreadsheets","value":{"rev":"3-6563c479735b1b6599bf9602fa65ff38"}}, -{"id":"sprintf","key":"sprintf","value":{"rev":"10-56c5bc7a19ecf8dd92e24d4dca081059"}}, -{"id":"spruce","key":"spruce","value":{"rev":"7-1ea45ef3c5412dd2a6c1fe7b2a083d68"}}, -{"id":"spy","key":"spy","value":{"rev":"3-f5546fdbbec80ba97756d0d1fefa7923"}}, -{"id":"sql","key":"sql","value":{"rev":"5-6c41452f684418ba521666e977f46e54"}}, -{"id":"sqlite","key":"sqlite","value":{"rev":"9-18761259920b497360f581ff8051dcbb"}}, -{"id":"sqlite3","key":"sqlite3","value":{"rev":"51-f9c99537afd9826819c5f40105e50987"}}, -{"id":"sqlmw","key":"sqlmw","value":{"rev":"17-b05b0b089c0f3b1185f96dc19bf61cf5"}}, -{"id":"squeeze","key":"squeeze","value":{"rev":"6-5e517be339d9aa409cedfcc11d1883b1"}}, -{"id":"squish","key":"squish","value":{"rev":"15-2334d8412df59ddd2fce60c1f77954c7"}}, -{"id":"sqwish","key":"sqwish","value":{"rev":"28-cc159dd5fd420432a7724c46456f4958"}}, -{"id":"srand","key":"srand","value":{"rev":"16-22f98b1b1a208c22dfbe95aa889cd08e"}}, -{"id":"srcds","key":"srcds","value":{"rev":"3-bd79da47d36662609c0c75c713874fd1"}}, -{"id":"srs","key":"srs","value":{"rev":"32-c8c961ea10fc60fc428bddff133a8aba"}}, -{"id":"sserve","key":"sserve","value":{"rev":"3-957457395e2c61c20bcb727fc19fc4d4"}}, -{"id":"ssh","key":"ssh","value":{"rev":"3-c7dda694daa7ca1e264b494400edfa18"}}, -{"id":"ssh-agent","key":"ssh-agent","value":{"rev":"3-dbc87102ed1f17b7253a1901976dfa9d"}}, -{"id":"sshmq","key":"sshmq","value":{"rev":"3-052f36ca47cddf069a1700fc79a08930"}}, -{"id":"stache","key":"stache","value":{"rev":"11-9bb0239153147939a25fd20184f20fc6"}}, -{"id":"stack","key":"stack","value":{"rev":"7-e18abdce80008ac9e2feb66f3407fe67"}}, -{"id":"stack-trace","key":"stack-trace","value":{"rev":"13-9fe20c5a3e34a5e4472c6f4fdea86efc"}}, -{"id":"stack.static","key":"stack.static","value":{"rev":"7-ad064faf6255a632cefa71a6ff3c47f3"}}, -{"id":"stack2","key":"stack2","value":{"rev":"3-e5f8ea94c0dd2b4c7f5d3941d689622b"}}, -{"id":"stackedy","key":"stackedy","value":{"rev":"25-f988787b9b5720dece8ae3cb83a2bc12"}}, -{"id":"stage","key":"stage","value":{"rev":"7-d2931fcb473f63320067c3e75638924e"}}, -{"id":"stalker","key":"stalker","value":{"rev":"19-ece35be8695846fc766a71c0022d4ff7"}}, -{"id":"startupify","key":"startupify","value":{"rev":"11-3c87ef5e9ee33122cf3515a63b22c52a"}}, -{"id":"stash","key":"stash","value":{"rev":"10-41239a1df74b69fe7bb3e360f9a35ad1"}}, -{"id":"statechart","key":"statechart","value":{"rev":"6-97e6947b5bbaf14bdb55efa6dfa5e19c"}}, -{"id":"stately","key":"stately","value":{"rev":"6-f8a257cd9fdd84947ff2cf7357afc88b"}}, -{"id":"stathat","key":"stathat","value":{"rev":"3-b79b7bd50bb1e4dcc1301424104a5b36"}}, -{"id":"station","key":"station","value":{"rev":"5-92e6387138b1ee10976bd92dd48ea818"}}, -{"id":"statistics","key":"statistics","value":{"rev":"3-a1c3a03d833c6f02fde403950790e9b4"}}, -{"id":"stats","key":"stats","value":{"rev":"13-fe513ea6b3b5b6b31935fd3464ec5d3b"}}, -{"id":"std","key":"std","value":{"rev":"55-58a4f182c3f51996a0d60a6f575cfefd"}}, -{"id":"steam","key":"steam","value":{"rev":"5-bffdf677d2d1ae3e8236892e68a3dd66"}}, -{"id":"stem","key":"stem","value":{"rev":"36-4f1c38eff671ede0241038017a810132"}}, -{"id":"step","key":"step","value":{"rev":"8-048d7707a45af3a7824a478d296cc467"}}, -{"id":"stepc","key":"stepc","value":{"rev":"3-be85de2c02f4889fdf77fda791feefea"}}, -{"id":"stepper","key":"stepper","value":{"rev":"9-cc54000dc973835c38e139b30cbb10cc"}}, -{"id":"steps","key":"steps","value":{"rev":"5-3561591b425e1fff52dc397f9688feae"}}, -{"id":"stextile","key":"stextile","value":{"rev":"29-9a8b6de917df01d322847f112dcadadf"}}, -{"id":"stitch","key":"stitch","value":{"rev":"13-8a50e4a4f015d1afe346aa6b6c8646bd"}}, -{"id":"stitchup","key":"stitchup","value":{"rev":"7-fe14604e3a8b82f62c38d0cb3ccce61e"}}, -{"id":"stomp","key":"stomp","value":{"rev":"15-e0430c0be74cd20c5204b571999922f7"}}, -{"id":"stopwords","key":"stopwords","value":{"rev":"3-2dd9fade030cfcce85848c5b3b4116fc"}}, -{"id":"store","key":"store","value":{"rev":"9-5537cc0f4827044504e8dae9617c9347"}}, -{"id":"store.js","key":"store.js","value":{"rev":"22-116c9a6194703ea98512d89ec5865e3d"}}, -{"id":"stories","key":"stories","value":{"rev":"11-244ca52d0a41f70bc4dfa0aca0f82a40"}}, -{"id":"storify","key":"storify","value":{"rev":"5-605b197219e916df561dd7722af97e2e"}}, -{"id":"storify-templates","key":"storify-templates","value":{"rev":"3-0960756aa963cee21b679a59cef114a1"}}, -{"id":"storm","key":"storm","value":{"rev":"3-9052e6af8528d1bc0d96021dfa21dd3e"}}, -{"id":"stove","key":"stove","value":{"rev":"17-01c9f0e87398e6bfa03a764e89295e00"}}, -{"id":"str.js","key":"str.js","value":{"rev":"9-301f54edeebde3c5084c3a8071e2aa09"}}, -{"id":"strack","key":"strack","value":{"rev":"10-5acf78ae6a417a82b49c221d606b8fed"}}, -{"id":"strappy","key":"strappy","value":{"rev":"3-fb63a899ff82c0f1142518cc263dd632"}}, -{"id":"strata","key":"strata","value":{"rev":"31-de615eccbda796e2bea405c2806ec792"}}, -{"id":"stream-buffers","key":"stream-buffers","value":{"rev":"7-d8fae628da43d377dd4e982f5bf7b09b"}}, -{"id":"stream-handler","key":"stream-handler","value":{"rev":"7-333eb7dcf2aeb550f948ee2162b21be2"}}, -{"id":"stream-stack","key":"stream-stack","value":{"rev":"22-a70979df042e2ff760b2d900259c84a1"}}, -{"id":"streamer","key":"streamer","value":{"rev":"17-dd16e62ada55311a793fbf7963a920f3"}}, -{"id":"streamlib","key":"streamlib","value":{"rev":"3-5125b1e6a92290f8d7f5fdad71e13fc2"}}, -{"id":"streamline","key":"streamline","value":{"rev":"152-0931f5697340c62e05dcd1a741afd38f"}}, -{"id":"streamline-streams","key":"streamline-streams","value":{"rev":"3-3224030ecfbf5a8ac5d218ab56dee545"}}, -{"id":"streamline-util","key":"streamline-util","value":{"rev":"3-a8047ecf37b985ec836c552fd2bcbf78"}}, -{"id":"streamlogger","key":"streamlogger","value":{"rev":"3-43f93a109774591f1409b0b86c363623"}}, -{"id":"streamlogger-fixed","key":"streamlogger-fixed","value":{"rev":"3-6e48de9e269b4f5bf979c560190b0680"}}, -{"id":"strftime","key":"strftime","value":{"rev":"25-74130d5c9cbf91025ce91f0463a9b1b5"}}, -{"id":"string-color","key":"string-color","value":{"rev":"3-9f336bf06bd80b2d2338c216099421c7"}}, -{"id":"strscan","key":"strscan","value":{"rev":"8-3e0d182a8d0c786754c555c0ac12e9d9"}}, -{"id":"strtok","key":"strtok","value":{"rev":"8-a1a1da7946d62fabb6cca56fc218654b"}}, -{"id":"struct","key":"struct","value":{"rev":"3-ff0f9cb336df73a5a19a38e17633583c"}}, -{"id":"structr","key":"structr","value":{"rev":"21-69b3672dab234d0effec5a72a2b1791c"}}, -{"id":"sty","key":"sty","value":{"rev":"9-ce5691388abc3ccaff23030bff190914"}}, -{"id":"style","key":"style","value":{"rev":"7-342569887fb53caddc60d745706cd66e"}}, -{"id":"style-compile","key":"style-compile","value":{"rev":"5-6f8b86c94c5344ec280a28f025691996"}}, -{"id":"styleless","key":"styleless","value":{"rev":"5-c236b81c38193ad71d7ed7c5b571995d"}}, -{"id":"stylewriter","key":"stylewriter","value":{"rev":"3-25a3f83252b220d8db0aa70c8fc1da4f"}}, -{"id":"stylus","key":"stylus","value":{"rev":"135-8b69084f50a95c297d1044e48b39a6c9"}}, -{"id":"stylus-blueprint","key":"stylus-blueprint","value":{"rev":"5-50ec59a9fa161ca68dac765f2281c13e"}}, -{"id":"stylus-sprite","key":"stylus-sprite","value":{"rev":"27-db597a75467baaad94de287494e9c21e"}}, -{"id":"styout","key":"styout","value":{"rev":"9-9d9460bb9bfa253ed0b5fbeb27f7710a"}}, -{"id":"sugar","key":"sugar","value":{"rev":"5-2722426edc51a7703f5c37306b03a8c4"}}, -{"id":"sugardoll","key":"sugardoll","value":{"rev":"16-cfadf4e7108357297be180a3868130db"}}, -{"id":"suger-pod","key":"suger-pod","value":{"rev":"5-c812b763cf6cdd218c6a18e1a4e2a4ac"}}, -{"id":"sunny","key":"sunny","value":{"rev":"3-c26b62eef1eeeeef58a7ea9373df3b39"}}, -{"id":"superagent","key":"superagent","value":{"rev":"3-1b32cc8372b7713f973bb1e044e6a86f"}}, -{"id":"supermarket","key":"supermarket","value":{"rev":"20-afa8a26ecec3069717c8ca7e5811cc31"}}, -{"id":"supershabam-websocket","key":"supershabam-websocket","value":{"rev":"7-513117fb37b3ab7cdaeeae31589e212e"}}, -{"id":"supervisor","key":"supervisor","value":{"rev":"16-2c6c141d018ef8927acee79f31d466ff"}}, -{"id":"supervisord","key":"supervisord","value":{"rev":"7-359ba115e5e10b5c95ef1a7562ad7a45"}}, -{"id":"svg2jadepartial","key":"svg2jadepartial","value":{"rev":"9-4a6260dd5d7c14801e8012e3ba7510f5"}}, -{"id":"swake","key":"swake","value":{"rev":"5-6f780362f0317427752d87cc5c640021"}}, -{"id":"swarm","key":"swarm","value":{"rev":"43-f1a963a0aeb043bf69529a82798b3afc"}}, -{"id":"sweet","key":"sweet","value":{"rev":"5-333f4d3529f65ce53b037cc282e3671d"}}, -{"id":"swig","key":"swig","value":{"rev":"29-53294b9d4f350192cf65817692092bfa"}}, -{"id":"switchback","key":"switchback","value":{"rev":"3-e117371d415f4a3d4ad30e78f5ec28bf"}}, -{"id":"switchboard","key":"switchboard","value":{"rev":"3-504d6c1e45165c54fbb1d3025d5120d7"}}, -{"id":"swiz","key":"swiz","value":{"rev":"82-cfb7840376b57896fba469e5c6ff3786"}}, -{"id":"swizec-bitly","key":"swizec-bitly","value":{"rev":"3-a705807238b8ef3ff2d008910bc350c3"}}, -{"id":"sws","key":"sws","value":{"rev":"5-bc5e8558bde6c2ae971abdd448a006d2"}}, -{"id":"symbie","key":"symbie","value":{"rev":"5-3184f869ed386341a4cdc35d85efb62a"}}, -{"id":"symbox","key":"symbox","value":{"rev":"5-eed33350cbb763726335ef1df74a6591"}}, -{"id":"synapse","key":"synapse","value":{"rev":"3-a9672d5159c0268babbfb94d7554d4bb"}}, -{"id":"sync","key":"sync","value":{"rev":"65-89fa6b8ab2df135d57e0bba4e921ad3b"}}, -{"id":"synchro","key":"synchro","value":{"rev":"21-6a881704308298f1894509a5b59287ae"}}, -{"id":"synchronous","key":"synchronous","value":{"rev":"7-bf89d61f001d994429e0fd12c26c2676"}}, -{"id":"syncler","key":"syncler","value":{"rev":"2-12870522e069945fc12f7d0f612700ee"}}, -{"id":"syncrepl","key":"syncrepl","value":{"rev":"5-e9234a1d8a529bc0d1b01c3b77c69c30"}}, -{"id":"synct","key":"synct","value":{"rev":"3-3664581b69e6f40dabc90525217f46cd"}}, -{"id":"syndicate","key":"syndicate","value":{"rev":"7-1db2b05d6b3e55fa622c3c26df7f9cad"}}, -{"id":"syslog","key":"syslog","value":{"rev":"5-d52fbc739505a2a194faf9a32da39d23"}}, -{"id":"syslog-node","key":"syslog-node","value":{"rev":"15-039177b9c516fd8d0b31faf92aa73f6f"}}, -{"id":"system","key":"system","value":{"rev":"18-33152371e0696a853ddb8b2234a6dfea"}}, -{"id":"taazr-uglify","key":"taazr-uglify","value":{"rev":"7-5c63dc75aa7c973df102c298291be8a5"}}, -{"id":"table","key":"table","value":{"rev":"9-a8a46ddf3a7cab63a0228303305cc32e"}}, -{"id":"tache.io","key":"tache.io","value":{"rev":"7-5639c70dc56b0a6333b568af377bb216"}}, -{"id":"taco","key":"taco","value":{"rev":"3-97cfbd54b4053c9e01e18af7c3902d1a"}}, -{"id":"tad","key":"tad","value":{"rev":"3-529ebda7291e24ae020d5c2931ba22cd"}}, -{"id":"tafa-misc-util","key":"tafa-misc-util","value":{"rev":"19-52984b66029c7d5cc78d3e2ae88c98d6"}}, -{"id":"tag","key":"tag","value":{"rev":"3-80b0d526b10a26f41fe73978843a07b9"}}, -{"id":"taglib","key":"taglib","value":{"rev":"3-efd2e6bc818bf3b385df40dfae506fa5"}}, -{"id":"tail","key":"tail","value":{"rev":"21-09bce80ad6aa4b01c6a70825fd141fd4"}}, -{"id":"tails","key":"tails","value":{"rev":"14-3ba6976831b1388e14235622ab001681"}}, -{"id":"tamejs","key":"tamejs","value":{"rev":"39-9a3657941df3bd24c43b5473e9f3b4c8"}}, -{"id":"taobao-js-api","key":"taobao-js-api","value":{"rev":"7-d46c8b48364b823dabf808f2b30e1eb8"}}, -{"id":"tap","key":"tap","value":{"rev":"35-1b8e553cf848f5ab27711efa0e74a033"}}, -{"id":"tap-assert","key":"tap-assert","value":{"rev":"19-f2960c64bcfa6ce4ed73e870d8d9e3fa"}}, -{"id":"tap-consumer","key":"tap-consumer","value":{"rev":"3-3e38aafb6d2d840bdb20818efbc75df4"}}, -{"id":"tap-global-harness","key":"tap-global-harness","value":{"rev":"3-f32589814daf8c1816c1f5a24de4ad12"}}, -{"id":"tap-harness","key":"tap-harness","value":{"rev":"7-a5af01384152c452abc11d4e641e6157"}}, -{"id":"tap-producer","key":"tap-producer","value":{"rev":"3-2db67a9541c37c912d4de2576bb3caa0"}}, -{"id":"tap-results","key":"tap-results","value":{"rev":"5-b8800525438965e38dc586e6b5cb142d"}}, -{"id":"tap-runner","key":"tap-runner","value":{"rev":"11-3975c0f5044530b61158a029899f4c03"}}, -{"id":"tap-test","key":"tap-test","value":{"rev":"5-0a3bba26b6b94dae8b7f59712335ee98"}}, -{"id":"tar","key":"tar","value":{"rev":"6-94226dd7add6ae6a1e68088360a466e4"}}, -{"id":"tar-async","key":"tar-async","value":{"rev":"37-d6579d43c1ee2f41205f28b0cde5da23"}}, -{"id":"tar-js","key":"tar-js","value":{"rev":"5-6826f2aad965fb532c7403964ce80d85"}}, -{"id":"task","key":"task","value":{"rev":"3-81f72759a5b64dff88a01a4838cc4a23"}}, -{"id":"task-extjs","key":"task-extjs","value":{"rev":"14-c9ba76374805425c332e0c66725e885c"}}, -{"id":"task-joose-nodejs","key":"task-joose-nodejs","value":{"rev":"20-6b8e4d24323d3240d5ee790d00c0d96a"}}, -{"id":"task-joose-stable","key":"task-joose-stable","value":{"rev":"32-026eada52cd5dd17a680359daec4917a"}}, -{"id":"tasks","key":"tasks","value":{"rev":"5-84e8f83d0c6ec27b4f05057c48063d62"}}, -{"id":"tav","key":"tav","value":{"rev":"3-da9899817edd20f0c73ad09bdf540cc6"}}, -{"id":"taxman","key":"taxman","value":{"rev":"5-9b9c68db8a1c8efedad800026cb23ae4"}}, -{"id":"tbone","key":"tbone","value":{"rev":"3-5789b010d0b1f1c663750c894fb5c570"}}, -{"id":"tcp-proxy","key":"tcp-proxy","value":{"rev":"3-118c6dc26d11537cf157fe2f28b05af5"}}, -{"id":"teamgrowl","key":"teamgrowl","value":{"rev":"8-3d13200b3bfeeace0787f9f9f027216d"}}, -{"id":"teamgrowl-server","key":"teamgrowl-server","value":{"rev":"8-a14dc4a26c2c06a4d9509eaff6e24735"}}, -{"id":"telehash","key":"telehash","value":{"rev":"6-4fae3629c1e7e111ba3e486b39a29913"}}, -{"id":"telemail","key":"telemail","value":{"rev":"3-60928460428265fc8002ca61c7f23abe"}}, -{"id":"telemetry","key":"telemetry","value":{"rev":"5-1be1d37ef62dc786b0a0f0d2d7984eb1"}}, -{"id":"teleport","key":"teleport","value":{"rev":"36-5b55a43ba83f4fe1a547c04e29139c3d"}}, -{"id":"teleport-dashboard","key":"teleport-dashboard","value":{"rev":"7-4cbc728d7a3052848a721fcdd92dda30"}}, -{"id":"teleport-site","key":"teleport-site","value":{"rev":"3-aeb8c0a93b7b0bcd7a30fe33bf23808c"}}, -{"id":"telnet","key":"telnet","value":{"rev":"11-7a587104b94ce135315c7540eb3493f6"}}, -{"id":"telnet-protocol","key":"telnet-protocol","value":{"rev":"3-8fcee2ed02c2e603c48e51e90ae78a00"}}, -{"id":"temp","key":"temp","value":{"rev":"6-91ef505da0a0860a13c0eb1a5d2531e6"}}, -{"id":"tempPath","key":"tempPath","value":{"rev":"3-34f2c1937d97207245986c344136547c"}}, -{"id":"tempis","key":"tempis","value":{"rev":"3-b2c0989068cc8125a519d19b9c79ffb6"}}, -{"id":"template","key":"template","value":{"rev":"6-d0088c6a5a7610570920db0f5c950bf9"}}, -{"id":"template-engine","key":"template-engine","value":{"rev":"3-3746216e1e2e456dbb0fd2f9070c1619"}}, -{"id":"tengwar","key":"tengwar","value":{"rev":"3-645a00f03e1e9546631ac22c37e1f3b4"}}, -{"id":"tenjin","key":"tenjin","value":{"rev":"5-0925c7535455266125b7730296c66356"}}, -{"id":"teriaki","key":"teriaki","value":{"rev":"3-d3c17f70d8697c03f43a7eae75f8c089"}}, -{"id":"terminal","key":"terminal","value":{"rev":"11-0e024d173ee3c28432877c0c5f633f19"}}, -{"id":"termspeak","key":"termspeak","value":{"rev":"7-fdfc93dd7d0d65fe502cabca191d8496"}}, -{"id":"termutil","key":"termutil","value":{"rev":"5-bccf8377ff28bc1f07f8b4b44d1e2335"}}, -{"id":"test","key":"test","value":{"rev":"38-129620013bbd3ec13617c403b02b52f1"}}, -{"id":"test-cmd","key":"test-cmd","value":{"rev":"35-7dd417a80390c2c124c66273ae33bd07"}}, -{"id":"test-helper","key":"test-helper","value":{"rev":"3-7b29af65825fc46d0603a39cdc6c95b4"}}, -{"id":"test-report","key":"test-report","value":{"rev":"5-e51cd1069b6cc442707f0861b35851be"}}, -{"id":"test-report-view","key":"test-report-view","value":{"rev":"3-9ba670940a8235eaef9b957dde6379af"}}, -{"id":"test-run","key":"test-run","value":{"rev":"20-6de89383602e6843d9376a78778bec19"}}, -{"id":"test_it","key":"test_it","value":{"rev":"5-be5cd436b9145398fa88c15c1269b102"}}, -{"id":"testbed","key":"testbed","value":{"rev":"2-db233788f7e516f227fac439d9450ef4"}}, -{"id":"testharness","key":"testharness","value":{"rev":"46-787468cb68ec31b442327639dcc0a4e5"}}, -{"id":"testingey","key":"testingey","value":{"rev":"17-a7ad6a9ff5721ae449876f6448d6f22f"}}, -{"id":"testnode","key":"testnode","value":{"rev":"9-cb63c450b241806e2271cd56fe502395"}}, -{"id":"testosterone","key":"testosterone","value":{"rev":"35-278e8af2b59bb6caf56728c67f720c37"}}, -{"id":"testqueue","key":"testqueue","value":{"rev":"3-59c574aeb345ef2d6e207a342be3f497"}}, -{"id":"testrunner","key":"testrunner","value":{"rev":"7-152e7d4a97f6cf6f00e22140e1969664"}}, -{"id":"testy","key":"testy","value":{"rev":"5-e8f4c9f4a799b6f8ab4effc21c3073a0"}}, -{"id":"text","key":"text","value":{"rev":"6-58a79b0db4968d6ad233898744a75351"}}, -{"id":"textareaserver","key":"textareaserver","value":{"rev":"3-f032b1397eb5e6369e1ac0ad1e78f466"}}, -{"id":"textile","key":"textile","value":{"rev":"6-2a8db66876f0119883449012c9c54c47"}}, -{"id":"textual","key":"textual","value":{"rev":"3-0ad9d5d3403b239185bad403625fed19"}}, -{"id":"tf2logparser","key":"tf2logparser","value":{"rev":"5-ffbc427b95ffeeb013dc13fa2b9621e3"}}, -{"id":"tfe-express","key":"tfe-express","value":{"rev":"3-b68ac01185885bcd22fa430ddb97e757"}}, -{"id":"tfidf","key":"tfidf","value":{"rev":"13-988808af905397dc103a0edf8c7c8a9f"}}, -{"id":"theBasics","key":"theBasics","value":{"rev":"7-9ebef2e59e1bd2fb3544ed16e1dc627b"}}, -{"id":"thefunlanguage.com","key":"thefunlanguage.com","value":{"rev":"3-25d56a3a4f639af23bb058db541bffe0"}}, -{"id":"thelinuxlich-docco","key":"thelinuxlich-docco","value":{"rev":"7-2ac0969da67ead2fa8bc0b21880b1d6b"}}, -{"id":"thelinuxlich-vogue","key":"thelinuxlich-vogue","value":{"rev":"5-ebc0a28cf0ae447b7ebdafc51c460bc0"}}, -{"id":"thepusher","key":"thepusher","value":{"rev":"5-b80cce6f81b1cae7373cd802df34c05c"}}, -{"id":"thetvdb","key":"thetvdb","value":{"rev":"3-a3a017a90b752d8158bf6dfcbcfdf250"}}, -{"id":"thirty-two","key":"thirty-two","value":{"rev":"3-1d4761ba7c4fa475e0c69e9c96d6ac04"}}, -{"id":"thoonk","key":"thoonk","value":{"rev":"15-c62c90d7e9072d96302d3a534ce943bb"}}, -{"id":"thrift","key":"thrift","value":{"rev":"14-447a41c9b655ec06e8e4854d5a55523a"}}, -{"id":"throttle","key":"throttle","value":{"rev":"3-8a3b3c657c49ede67c883806fbfb4df6"}}, -{"id":"thyme","key":"thyme","value":{"rev":"5-f06104f10d43a2b4cbcc7621ed45eacf"}}, -{"id":"tiamat","key":"tiamat","value":{"rev":"44-810633d6cd5edaa0510fe0f38c02ad58"}}, -{"id":"tictoc","key":"tictoc","value":{"rev":"3-0be6cf95d4466595376dadd0fc08bd95"}}, -{"id":"tidy","key":"tidy","value":{"rev":"3-25116d4dcf6765ef2a09711ecc1e03c9"}}, -{"id":"tiers","key":"tiers","value":{"rev":"3-ffaa8ffe472fe703de8f0bbeb8af5621"}}, -{"id":"tilejson","key":"tilejson","value":{"rev":"5-76b990dd945fb412ed00a96edc86b59d"}}, -{"id":"tilelive","key":"tilelive","value":{"rev":"57-9283e846e77263ed6e7299680d6b4b06"}}, -{"id":"tilelive-mapnik","key":"tilelive-mapnik","value":{"rev":"31-30f871ede46789fc6a36f427a1a99fff"}}, -{"id":"tilemill","key":"tilemill","value":{"rev":"19-7b884c9d707dd34f21cb71e88b45fc73"}}, -{"id":"tilestream","key":"tilestream","value":{"rev":"76-3a29ba96ecdb6c860c211ae8f2d909a9"}}, -{"id":"timbits","key":"timbits","value":{"rev":"59-b48dde4a210ec9fb4c33c07a52bce61e"}}, -{"id":"time","key":"time","value":{"rev":"51-907f587206e6a27803a3570e42650adc"}}, -{"id":"timeTraveller","key":"timeTraveller","value":{"rev":"7-389de8c8e86daea495d14aeb2b77df38"}}, -{"id":"timeout","key":"timeout","value":{"rev":"11-8e53dedecfaf6c4f1086eb0f43c71325"}}, -{"id":"timer","key":"timer","value":{"rev":"5-a8bcbb898a807e6662b54ac988fb967b"}}, -{"id":"timerjs","key":"timerjs","value":{"rev":"3-7d24eb268746fdb6b5e9be93bec93f1b"}}, -{"id":"timespan","key":"timespan","value":{"rev":"12-315b2793cbf28a18cea36e97a3c8a55f"}}, -{"id":"timezone","key":"timezone","value":{"rev":"35-2741d5d3b68a953d4cb3a596bc2bc15e"}}, -{"id":"tiny","key":"tiny","value":{"rev":"9-a61d26d02ce39381f7e865ad82494692"}}, -{"id":"tld","key":"tld","value":{"rev":"3-5ce4b4e48a11413ad8a1f3bfd0d0b778"}}, -{"id":"tldextract","key":"tldextract","value":{"rev":"7-620962e27145bd9fc17dc406c38b0c32"}}, -{"id":"tmp","key":"tmp","value":{"rev":"23-20f5c14244d58f35bd3e970f5f65cc32"}}, -{"id":"tmpl","key":"tmpl","value":{"rev":"5-5894c206e15fa58ab9415706b9d53f1f"}}, -{"id":"tmpl-precompile","key":"tmpl-precompile","value":{"rev":"15-3db34b681596b258cae1dae8cc24119d"}}, -{"id":"tmppckg","key":"tmppckg","value":{"rev":"11-b3a13e1280eb9cbef182c1f3f24bd570"}}, -{"id":"tnetstrings","key":"tnetstrings","value":{"rev":"3-d6b8ed2390a3e38138cb01b82d820079"}}, -{"id":"toDataURL","key":"toDataURL","value":{"rev":"3-1ea3cb62666b37343089bb9ef48fbace"}}, -{"id":"toYaml","key":"toYaml","value":{"rev":"11-3c629e3859c70d57b1ae51b2ac459011"}}, -{"id":"tob","key":"tob","value":{"rev":"7-376c174d06a675855406cfcdcacf61f5"}}, -{"id":"tobi","key":"tobi","value":{"rev":"50-d8749ac3739b042afe82657802bc3ba8"}}, -{"id":"toddick","key":"toddick","value":{"rev":"13-db528ef519f57b8c1d752ad7270b4d05"}}, -{"id":"tokenizer","key":"tokenizer","value":{"rev":"5-f6524fafb16059b66074cd04bf248a03"}}, -{"id":"tokyotosho","key":"tokyotosho","value":{"rev":"5-7432e0207165d9c165fd73d2a23410d6"}}, -{"id":"tolang","key":"tolang","value":{"rev":"7-65dbdf56b039f680e61a1e1d7feb9fb1"}}, -{"id":"toolkit","key":"toolkit","value":{"rev":"13-58075a57a6069dc39f98e72d473a0c30"}}, -{"id":"tools","key":"tools","value":{"rev":"3-ba301d25cfc6ad71dd68c811ea97fa01"}}, -{"id":"topcube","key":"topcube","value":{"rev":"29-736b3816d410f626dbc4da663acb05aa"}}, -{"id":"torrent-search","key":"torrent-search","value":{"rev":"7-7dd48fac0c1f99f34fad7da365085b6c"}}, -{"id":"tosource","key":"tosource","value":{"rev":"5-13483e2c11b07611c26b37f2e76a0bf3"}}, -{"id":"tplcpl","key":"tplcpl","value":{"rev":"15-8ba1e6d14ad6b8eb71b703e22054ac0a"}}, -{"id":"tracejs","key":"tracejs","value":{"rev":"23-1ffec83afc19855bcbed8049a009a910"}}, -{"id":"traceur","key":"traceur","value":{"rev":"9-a48f7e4cb1fb452125d81c62c8ab628b"}}, -{"id":"traceurl","key":"traceurl","value":{"rev":"21-e016db44a86b124ea00411f155d884d4"}}, -{"id":"tracey","key":"tracey","value":{"rev":"5-76699aab64e89271cbb7df80a00d3583"}}, -{"id":"tracy","key":"tracy","value":{"rev":"5-412f78082ba6f4c3c7d5328cf66d2e10"}}, -{"id":"traits","key":"traits","value":{"rev":"10-3a37dbec4b78518c00c577f5e286a9b9"}}, -{"id":"tramp","key":"tramp","value":{"rev":"5-3b6d27b8b432b925b7c9fc088e84d8e4"}}, -{"id":"transcode","key":"transcode","value":{"rev":"6-a6494707bd94b5e6d1aa9df3dbcf8d7c"}}, -{"id":"transformer","key":"transformer","value":{"rev":"15-7738ac7c02f03d64f73610fbf7ed92a6"}}, -{"id":"transformjs","key":"transformjs","value":{"rev":"5-f1ab667c430838e1d3238e1f878998e2"}}, -{"id":"transitive","key":"transitive","value":{"rev":"43-841de40a5e3434bd51a1c8f19891f982"}}, -{"id":"translate","key":"translate","value":{"rev":"12-f3ddbbada2f109843c5422d83dd7a203"}}, -{"id":"transliteration.ua","key":"transliteration.ua","value":{"rev":"3-f847c62d8749904fc7de6abe075e619a"}}, -{"id":"transmission","key":"transmission","value":{"rev":"9-587eaa395430036f17b175bc439eabb6"}}, -{"id":"transmogrify","key":"transmogrify","value":{"rev":"5-3e415cd9420c66551cccc0aa91b11d98"}}, -{"id":"transporter","key":"transporter","value":{"rev":"6-698b696890bf01d751e9962bd86cfe7e"}}, -{"id":"traverse","key":"traverse","value":{"rev":"60-9432066ab44fbb0e913227dc62c953d9"}}, -{"id":"traverser","key":"traverser","value":{"rev":"11-1d50662f13134868a1df5019d99bf038"}}, -{"id":"treeeater","key":"treeeater","value":{"rev":"56-2c8a9fd3e842b221ab8da59c6d847327"}}, -{"id":"treelib","key":"treelib","value":{"rev":"13-212ccc836a943c8b2a5342b65ab9edf3"}}, -{"id":"trees","key":"trees","value":{"rev":"3-3ee9e9cf3fd8aa985e32b3d9586a7c0e"}}, -{"id":"trentm-datetime","key":"trentm-datetime","value":{"rev":"3-740a291379ddf97bda2aaf2ff0e1654d"}}, -{"id":"trentm-git","key":"trentm-git","value":{"rev":"3-b81ce3764a45e5d0862488fab9fac486"}}, -{"id":"trentm-hashlib","key":"trentm-hashlib","value":{"rev":"3-4b4175b6a8702bdb9c1fe5ac4786761b"}}, -{"id":"trial","key":"trial","value":{"rev":"3-cf77f189409517495dd8259f86e0620e"}}, -{"id":"trie","key":"trie","value":{"rev":"3-6cc3c209cf4aae5a4f92e1ca38c4c54c"}}, -{"id":"trollop","key":"trollop","value":{"rev":"6-75076593614c9cd51d61a76f73d2c5b5"}}, -{"id":"trollscript","key":"trollscript","value":{"rev":"5-fcf646075c5be575b9174f84d08fbb37"}}, -{"id":"trollscriptjs","key":"trollscriptjs","value":{"rev":"3-1dfd1acd3d15c0bd18ea407e3933b621"}}, -{"id":"tropo-webapi","key":"tropo-webapi","value":{"rev":"11-5106730dbd79167df38812ffaa912ded"}}, -{"id":"tropo-webapi-node","key":"tropo-webapi-node","value":{"rev":"15-483c64bcbf1dcadaea30e78d7bc3ebbc"}}, -{"id":"trundle","key":"trundle","value":{"rev":"3-2af32ed348fdedebd1077891bb22a756"}}, -{"id":"trust-reverse-proxy","key":"trust-reverse-proxy","value":{"rev":"6-ba5bed0849617e0390f0e24750bf5747"}}, -{"id":"trying","key":"trying","value":{"rev":"3-43b417160b178c710e0d85af6b3d56e7"}}, -{"id":"ttapi","key":"ttapi","value":{"rev":"51-727e47d8b383b387a498711c07ce4de6"}}, -{"id":"tubbs","key":"tubbs","value":{"rev":"7-b386e59f2205b22615a376f5ddee3eb0"}}, -{"id":"tuild","key":"tuild","value":{"rev":"13-4a2b92f95a0ee342c060974ce7a0021d"}}, -{"id":"tumbler","key":"tumbler","value":{"rev":"5-ff16653ab92d0af5e70d9caa88f3b7ed"}}, -{"id":"tumbler-sprite","key":"tumbler-sprite","value":{"rev":"3-604d25b7bb9e32b92cadd75aeb23997c"}}, -{"id":"tumblr","key":"tumblr","value":{"rev":"9-14d160f1f2854330fba300b3ea233893"}}, -{"id":"tumblr2","key":"tumblr2","value":{"rev":"7-29bb5d86501cdbcef889289fe7f4b51e"}}, -{"id":"tumblrrr","key":"tumblrrr","value":{"rev":"10-0c50379fbab7b39766e1a61379c39964"}}, -{"id":"tunguska","key":"tunguska","value":{"rev":"1-a6b24d2c2a5a9f091a9b6f13bac66927"}}, -{"id":"tupalocomapi","key":"tupalocomapi","value":{"rev":"3-a1cdf85a08784f62c2ec440a1ed90ad4"}}, -{"id":"turing","key":"turing","value":{"rev":"5-4ba083c8343718acb9450d96551b65c0"}}, -{"id":"tutti","key":"tutti","value":{"rev":"21-929cc205b3d8bc68f86aa63578e0af95"}}, -{"id":"tuttiserver","key":"tuttiserver","value":{"rev":"39-b3fe7cbaf2d43458dae061f37aa5ae18"}}, -{"id":"tuttiterm","key":"tuttiterm","value":{"rev":"7-6c0e9e7f6f137de0ee7c886351fdf373"}}, -{"id":"tvister","key":"tvister","value":{"rev":"7-963eab682ab09922a44fbca50c0ec019"}}, -{"id":"twbot","key":"twbot","value":{"rev":"15-923625f516566c977975b3da3d4bc46b"}}, -{"id":"tweasy","key":"tweasy","value":{"rev":"10-7215063e5729b1c114ef73f07a1368d3"}}, -{"id":"tweeter.js","key":"tweeter.js","value":{"rev":"3-bc8437157c11cf32eec168d7c71037bb"}}, -{"id":"tweetstream","key":"tweetstream","value":{"rev":"6-81a6bf2a3e29208e1c4c65a3958ee5d8"}}, -{"id":"twerk","key":"twerk","value":{"rev":"5-01cbfddf9ad25a67ff1e45ec39acb780"}}, -{"id":"twerp","key":"twerp","value":{"rev":"23-1b4726d1fef030a3dde6fae2cdfbb687"}}, -{"id":"twigjs","key":"twigjs","value":{"rev":"7-07b90e2c35c5c81d394b29086507de04"}}, -{"id":"twilio","key":"twilio","value":{"rev":"20-68d5439ecb1774226025e6f9125bbb86"}}, -{"id":"twilio-node","key":"twilio-node","value":{"rev":"13-84d31c2dc202df3924ed399289cbc1fc"}}, -{"id":"twiliode","key":"twiliode","value":{"rev":"3-6cbe432dd6c6d94d8a4faa6e0ea47dd3"}}, -{"id":"twill","key":"twill","value":{"rev":"5-3a0caf9c0e83ab732ae8ae61f4f17830"}}, -{"id":"twisted-deferred","key":"twisted-deferred","value":{"rev":"9-f35acecb8736d96582e1f9b62dd4ae47"}}, -{"id":"twitpic","key":"twitpic","value":{"rev":"11-55b11432a09edeec1189024f26a48153"}}, -{"id":"twitter","key":"twitter","value":{"rev":"60-9ad6368932c8a74ea5bd10dda993d74d"}}, -{"id":"twitter-client","key":"twitter-client","value":{"rev":"11-dc3da9e1724cf00aa86c1e7823cfd919"}}, -{"id":"twitter-connect","key":"twitter-connect","value":{"rev":"12-969292347a4251d121566169236a3091"}}, -{"id":"twitter-js","key":"twitter-js","value":{"rev":"24-251d0c54749e86bd544a15290e311370"}}, -{"id":"twitter-node","key":"twitter-node","value":{"rev":"12-a7ed6c69f05204de2e258f46230a05b6"}}, -{"id":"twitter-text","key":"twitter-text","value":{"rev":"16-978bda8ec4eaf68213d0ee54242feefa"}}, -{"id":"type","key":"type","value":{"rev":"3-c5b8b87cde9e27277302cb5cb6d00f85"}}, -{"id":"typecheck","key":"typecheck","value":{"rev":"5-79723661620bb0fb254bc7f888d6e937"}}, -{"id":"typed-array","key":"typed-array","value":{"rev":"3-89ac91e2a51a9e5872515d5a83691e83"}}, -{"id":"typhoon","key":"typhoon","value":{"rev":"23-2027c96b8fd971332848594f3b0526cb"}}, -{"id":"typogr","key":"typogr","value":{"rev":"13-2dfe00f08ee13e6b00a99df0a8f96718"}}, -{"id":"ua-parser","key":"ua-parser","value":{"rev":"14-d1a018354a583dba4506bdc0c04a416b"}}, -{"id":"uberblic","key":"uberblic","value":{"rev":"5-500704ed73f255eb5b86ad0a5e158bc9"}}, -{"id":"ucengine","key":"ucengine","value":{"rev":"5-1e8a91c813e39b6f1b9f988431bb65c8"}}, -{"id":"udon","key":"udon","value":{"rev":"3-9a819e835f88fc91272b6366c70d83c0"}}, -{"id":"ueberDB","key":"ueberDB","value":{"rev":"85-fa700e5a64efaf2e71de843d7175606c"}}, -{"id":"uglify-js","key":"uglify-js","value":{"rev":"30-9ac97132a90f94b0a3aadcd96ed51890"}}, -{"id":"uglify-js-middleware","key":"uglify-js-middleware","value":{"rev":"5-47bd98d7f1118f5cab617310d4022eb4"}}, -{"id":"uglifycss","key":"uglifycss","value":{"rev":"3-4eefc4632e6e61ec999e93a1e26e0c83"}}, -{"id":"ui","key":"ui","value":{"rev":"27-b6439c8fcb5feb1d8f722ac5a91727c0"}}, -{"id":"ukijs","key":"ukijs","value":{"rev":"13-a0d7b143104e6cc0760cbe7e61c4f293"}}, -{"id":"umecob","key":"umecob","value":{"rev":"19-960fef8b8b8468ee69096173baa63232"}}, -{"id":"underscore","key":"underscore","value":{"rev":"29-419857a1b0dc08311717d1f6066218b8"}}, -{"id":"underscore-data","key":"underscore-data","value":{"rev":"17-e763dd42ea6e4ab71bc442e9966e50e4"}}, -{"id":"underscore.date","key":"underscore.date","value":{"rev":"11-a1b5870b855d49a3bd37823a736e9f93"}}, -{"id":"underscore.inspector","key":"underscore.inspector","value":{"rev":"7-04d67b5bfe387391d461b11c6ddda231"}}, -{"id":"underscore.string","key":"underscore.string","value":{"rev":"31-4100a9e1f1d7e8dde007cc6736073e88"}}, -{"id":"underscorem","key":"underscorem","value":{"rev":"5-181dd113e62482020122e6a68f80cdc1"}}, -{"id":"underscorex","key":"underscorex","value":{"rev":"8-76b82cffecd4304822fbc346e6cebc1b"}}, -{"id":"underscorify","key":"underscorify","value":{"rev":"3-7bb03dccba21d30c50328e7d4878704e"}}, -{"id":"unicode","key":"unicode","value":{"rev":"45-2fc73b36aad2661e5bb2e703e62a6f71"}}, -{"id":"unicoder","key":"unicoder","value":{"rev":"3-6f6571d361217af7fea7c224ca8a1149"}}, -{"id":"unit","key":"unit","value":{"rev":"5-68847eeb11474765cf73f1e21ca4b839"}}, -{"id":"unite","key":"unite","value":{"rev":"3-a8812f4e77d1d1a9dc67c327d8e75b47"}}, -{"id":"unittest-jslint","key":"unittest-jslint","value":{"rev":"3-c371c63c7b68a32357becb7b6a02d048"}}, -{"id":"unixlib","key":"unixlib","value":{"rev":"3-41f4c2859ca92951cf40556faa4eacdb"}}, -{"id":"unlimit","key":"unlimit","value":{"rev":"3-f42d98066e6ebbc23ef67499845ac020"}}, -{"id":"unrequire","key":"unrequire","value":{"rev":"17-bc75241891ae005eb52844222daf8f97"}}, -{"id":"unshortener","key":"unshortener","value":{"rev":"15-0851cb8bc3c378c37a3df9760067a109"}}, -{"id":"unused","key":"unused","value":{"rev":"3-362e713349c4a5541564fa2de33d01ba"}}, -{"id":"upload","key":"upload","value":{"rev":"3-63aedcfb335754c3bca1675c4add51c4"}}, -{"id":"ups_node","key":"ups_node","value":{"rev":"15-fa6d0be3831ee09420fb703c4d508534"}}, -{"id":"upy","key":"upy","value":{"rev":"5-dab63054d02be71f9c2709659974a5e1"}}, -{"id":"uri","key":"uri","value":{"rev":"3-5baaa12433cff7539b1d39c0c7f62853"}}, -{"id":"uri-parser","key":"uri-parser","value":{"rev":"3-d7e81b08e8b3f6f5ac8c6b4220228529"}}, -{"id":"url","key":"url","value":{"rev":"3-0dfd5ec2904cb1f645fa7449dbb0ce52"}}, -{"id":"url-expander","key":"url-expander","value":{"rev":"21-73bf9fa3c98b15d5ef0ed9815d862953"}}, -{"id":"urllib","key":"urllib","value":{"rev":"5-b015944526c15589a1504d398dcb598a"}}, -{"id":"urn-parser","key":"urn-parser","value":{"rev":"3-08a35a166790ecf88729befd4ebc7bf1"}}, -{"id":"useless","key":"useless","value":{"rev":"3-9d7b7ab9d4811847ed6e99ce2226d687"}}, -{"id":"user-agent","key":"user-agent","value":{"rev":"16-ac00f085795346421242e3d4d75523ad"}}, -{"id":"useragent","key":"useragent","value":{"rev":"7-3184d8aba5540e6596da9e3635ee3c24"}}, -{"id":"useragent_parser","key":"useragent_parser","value":{"rev":"3-730427aba3f0825fd28850e96b1613d4"}}, -{"id":"utf7","key":"utf7","value":{"rev":"3-ad56e4c9ac5a509ff568a3cdf0ed074f"}}, -{"id":"utf8","key":"utf8","value":{"rev":"3-c530cad759dd6e4e471338a71a307434"}}, -{"id":"util","key":"util","value":{"rev":"3-0e55e3466bc3ea6aeda6384639e842c3"}}, -{"id":"utility-belt","key":"utility-belt","value":{"rev":"3-8de401b41ef742b3c0a144b99099771f"}}, -{"id":"utml","key":"utml","value":{"rev":"5-5f0f3de6f787056bd124ca98716fbc19"}}, -{"id":"uubench","key":"uubench","value":{"rev":"6-b6cb0756e35ce998b61bb9a6ea0f5732"}}, -{"id":"uuid","key":"uuid","value":{"rev":"13-3f014b236668ec5eb49d0a17ad54d397"}}, -{"id":"uuid-lib","key":"uuid-lib","value":{"rev":"3-3de40495439e240b5a41875c19c65b1a"}}, -{"id":"uuid-pure","key":"uuid-pure","value":{"rev":"19-b94e9f434901fe0a0bbfdfa06f785874"}}, -{"id":"uuid.js","key":"uuid.js","value":{"rev":"8-3232a97c9f4a2b601d207488350df01b"}}, -{"id":"v8-profiler","key":"v8-profiler","value":{"rev":"12-790c90391bcbec136e316e57b30a845c"}}, -{"id":"valentine","key":"valentine","value":{"rev":"35-dd4b0642aacaf833e1119fc42bb6e9df"}}, -{"id":"validate-json","key":"validate-json","value":{"rev":"5-6a71fb36b102b3a4c5f6cc35012518b3"}}, -{"id":"validations","key":"validations","value":{"rev":"5-7272c97d35e3269813d91f1ea06e7217"}}, -{"id":"validator","key":"validator","value":{"rev":"45-9983ff692c291143ba670b613e07ddab"}}, -{"id":"vanilla","key":"vanilla","value":{"rev":"3-2e1d05af0873386b7cd6d432f1e76217"}}, -{"id":"vapor","key":"vapor","value":{"rev":"1-e1f86f03c94a4b90bca347408dbc56ff"}}, -{"id":"vargs","key":"vargs","value":{"rev":"6-9e389cfd648034dd469348112eedb23b"}}, -{"id":"vash","key":"vash","value":{"rev":"9-85ade8b7249a0e8230e8f0aaf1c34e2a"}}, -{"id":"vbench","key":"vbench","value":{"rev":"3-059528251a566c6ac363e236212448ce"}}, -{"id":"vendor.js","key":"vendor.js","value":{"rev":"5-264b0f8a771cad113be6919b6004ff95"}}, -{"id":"ventstatus","key":"ventstatus","value":{"rev":"3-16aa39e22b149b23b64317991415f92c"}}, -{"id":"version-compare","key":"version-compare","value":{"rev":"3-a8d6eea31572fe973ddd98c0a8097bc6"}}, -{"id":"vertica","key":"vertica","value":{"rev":"37-035d50183c3ad3056db0d7a13c20005d"}}, -{"id":"vhost","key":"vhost","value":{"rev":"9-53bbdba14dae631a49e782d169e4fc5a"}}, -{"id":"vice","key":"vice","value":{"rev":"5-0f74600349f4540b1b104d4ebfec1309"}}, -{"id":"video","key":"video","value":{"rev":"10-65c0b603047188fe2b07cbd2e1c93fe7"}}, -{"id":"vie","key":"vie","value":{"rev":"5-94e23770c5a0510480a0bae07d846ebc"}}, -{"id":"view","key":"view","value":{"rev":"21-a2abdfc54ab732a906347090c68564a5"}}, -{"id":"vigilante","key":"vigilante","value":{"rev":"30-951541a8b2fc2364bb1ccd7cfae56482"}}, -{"id":"villain","key":"villain","value":{"rev":"10-8dbfc5db42230d8813e6cc61af14d575"}}, -{"id":"vine","key":"vine","value":{"rev":"17-e7ac5d190cacf0f2d17d27e37b2b9f5f"}}, -{"id":"vipe","key":"vipe","value":{"rev":"3-78996531221e08292b9ca3de6e19d578"}}, -{"id":"viralheat","key":"viralheat","value":{"rev":"3-b928ce797fd5955c766b6b7e9e9c8f54"}}, -{"id":"viralheat-sentiment","key":"viralheat-sentiment","value":{"rev":"3-5d083e0d141ecf36e06c7c2885b01b5c"}}, -{"id":"virustotal.js","key":"virustotal.js","value":{"rev":"3-074be49f7e877b154a2144ef844f78e9"}}, -{"id":"vk","key":"vk","value":{"rev":"9-48f53ea9ebe68c9d3af45eb601c71006"}}, -{"id":"vmcjs","key":"vmcjs","value":{"rev":"5-44d8dd906fa3530d2bfc2dfee7f498d4"}}, -{"id":"vogue","key":"vogue","value":{"rev":"38-891354d18638a26d5b5ba95933faae0e"}}, -{"id":"vogue-dtrejo","key":"vogue-dtrejo","value":{"rev":"3-3ef8d57d3b5c0aca297fe38c9040954f"}}, -{"id":"votizen-logger","key":"votizen-logger","value":{"rev":"4-ba0837a28693aba346fab885a3a8f315"}}, -{"id":"vows","key":"vows","value":{"rev":"80-43d6a81c184c06d73e692358e913821e"}}, -{"id":"vows-bdd","key":"vows-bdd","value":{"rev":"3-dc2a7013dd94b0b65a3ed3a8b69b680e"}}, -{"id":"vows-ext","key":"vows-ext","value":{"rev":"49-079067a01a681ca7df4dfaae74adb3fb"}}, -{"id":"vows-fluent","key":"vows-fluent","value":{"rev":"23-67625a035cedf90c8fed73722465ecea"}}, -{"id":"vows-is","key":"vows-is","value":{"rev":"68-45a13df422d08ab00cc8f785b6411741"}}, -{"id":"voyeur","key":"voyeur","value":{"rev":"5-56fe23f95df6ff648b67f1a9baf10d41"}}, -{"id":"vws.pubsub","key":"vws.pubsub","value":{"rev":"5-609497d66ab6a76c5201904e41b95715"}}, -{"id":"wabtools","key":"wabtools","value":{"rev":"7-b24cd7262720a29f59da103b7110325d"}}, -{"id":"wadey-ranger","key":"wadey-ranger","value":{"rev":"17-a0541bad0880ffc199e8b2ef4c80ddb8"}}, -{"id":"wagner","key":"wagner","value":{"rev":"3-4b76219928f409b7124e02c0518d6cb6"}}, -{"id":"wait","key":"wait","value":{"rev":"3-7f8a5f9c8e86da4f219353ae778868a9"}}, -{"id":"waiter","key":"waiter","value":{"rev":"5-680176b06719c9a8499725b0a617cdc9"}}, -{"id":"waitlist","key":"waitlist","value":{"rev":"17-f3b2a4cf58b940c3839debda23c12b8e"}}, -{"id":"wake_on_lan","key":"wake_on_lan","value":{"rev":"6-1295bb5c618495b74626aaaa1c644d32"}}, -{"id":"walk","key":"walk","value":{"rev":"22-c05e1e1252a59b1048a0b6464631d08b"}}, -{"id":"walker","key":"walker","value":{"rev":"18-e8a20efc286234fb20789dc68cd04cd1"}}, -{"id":"warp","key":"warp","value":{"rev":"19-c7f17d40291984cd27f1d57fe764a5d2"}}, -{"id":"watch","key":"watch","value":{"rev":"18-3bc43d36ea1dbf69b93d4ea3d9534d44"}}, -{"id":"watch-less","key":"watch-less","value":{"rev":"5-f69a778ee58c681ad3b24a766576c016"}}, -{"id":"watch-tree","key":"watch-tree","value":{"rev":"5-316b60e474c3ae6e97f7cdb06b65af78"}}, -{"id":"watch.js","key":"watch.js","value":{"rev":"11-8c02c7429f90ca5e756a131d85bd5a32"}}, -{"id":"watch_dir","key":"watch_dir","value":{"rev":"5-df0a592508e1e13f5d24c2863733a8b9"}}, -{"id":"watchable","key":"watchable","value":{"rev":"3-f8694ff0c3add9a1310f0980e24ea23b"}}, -{"id":"watchersto","key":"watchersto","value":{"rev":"5-06665e682f58f61831d41d08b4ea12e7"}}, -{"id":"watchman","key":"watchman","value":{"rev":"11-956ad2175d0c5b52e82988a697474244"}}, -{"id":"watchn","key":"watchn","value":{"rev":"15-9685afa8b501f8cd7e068beed1264cfe"}}, -{"id":"wave","key":"wave","value":{"rev":"7-d13054ac592b3b4f81147b6bc7a91ea1"}}, -{"id":"wax","key":"wax","value":{"rev":"71-2e8877b0b6df27c1375dcd7f6bbdb4b7"}}, -{"id":"waz-storage-js","key":"waz-storage-js","value":{"rev":"15-1aaa07353c3d25f5794fa004a23c4dfa"}}, -{"id":"wd","key":"wd","value":{"rev":"19-20c4ee8b83057ece691f9669e288059e"}}, -{"id":"weak","key":"weak","value":{"rev":"3-b774b8be74f33c843df631aa07854104"}}, -{"id":"web","key":"web","value":{"rev":"3-c571dee306020f6f92c7a3150e8023b1"}}, -{"id":"webapp","key":"webapp","value":{"rev":"5-60525be5734cf1d02a77508e5f46bafa"}}, -{"id":"webfonts","key":"webfonts","value":{"rev":"5-d7be242801702fd1eb728385b8982107"}}, -{"id":"webgenjs","key":"webgenjs","value":{"rev":"3-ac6be47eedcbb2561babdb9495d60f29"}}, -{"id":"webgl","key":"webgl","value":{"rev":"18-21cd40f6c7e4943a2d858ed813d3c45d"}}, -{"id":"webhookit-comment","key":"webhookit-comment","value":{"rev":"5-1fbed3d75bf485433bdcac4fac625eab"}}, -{"id":"webhookit-ejs","key":"webhookit-ejs","value":{"rev":"5-9b76f543e9c0941d0245cb3bfd2cc64e"}}, -{"id":"webhookit-email","key":"webhookit-email","value":{"rev":"5-d472fde4f101d55d029a29777bbdb952"}}, -{"id":"webhookit-http","key":"webhookit-http","value":{"rev":"13-9f6f05cdb03f45a2227b9cd820565e63"}}, -{"id":"webhookit-jsonparse","key":"webhookit-jsonparse","value":{"rev":"3-6d49bf8a9849130d9bbc5b0d6fb0bf67"}}, -{"id":"webhookit-jsonpath","key":"webhookit-jsonpath","value":{"rev":"5-7acaf50267274584dca1cc5c1e77ce2e"}}, -{"id":"webhookit-objectbuilder","key":"webhookit-objectbuilder","value":{"rev":"5-e63fb26621929f3ab8d8519556116b30"}}, -{"id":"webhookit-soupselect","key":"webhookit-soupselect","value":{"rev":"9-726f2f4794437632032058bc81e6ee5d"}}, -{"id":"webhookit-xml2js","key":"webhookit-xml2js","value":{"rev":"3-ec959e474ecb3a163f2991767594a60e"}}, -{"id":"webhookit-yql","key":"webhookit-yql","value":{"rev":"9-c6ae87a8cc55d33901485ee7c3895ef8"}}, -{"id":"webify","key":"webify","value":{"rev":"3-86810874abf2274d1387ee748987b627"}}, -{"id":"webjs","key":"webjs","value":{"rev":"103-593a1e4e69d8db6284ecf4fce01b4668"}}, -{"id":"webmake","key":"webmake","value":{"rev":"13-f6588093a487212a151d1c00c26de7b4"}}, -{"id":"webmetrics","key":"webmetrics","value":{"rev":"3-44a428fd2ecb1b1bf50c33157750dd16"}}, -{"id":"webrepl","key":"webrepl","value":{"rev":"21-d6dcdbb59186092d9a0f1977c69394a5"}}, -{"id":"webservice","key":"webservice","value":{"rev":"18-05038f1cf997cff1ed81e783485680aa"}}, -{"id":"webshell","key":"webshell","value":{"rev":"3-05c431cf961a9dbaee1dfd95237e189a"}}, -{"id":"websocket","key":"websocket","value":{"rev":"33-7c20d55a88f187d7b398525824159f67"}}, -{"id":"websocket-client","key":"websocket-client","value":{"rev":"12-26a3530b9e6d465f472c791db01c9fc3"}}, -{"id":"websocket-protocol","key":"websocket-protocol","value":{"rev":"3-e52a8496f70686c289087149aee8b359"}}, -{"id":"websocket-server","key":"websocket-server","value":{"rev":"46-9f69e2f9408eb196b3a1aa990e5b5ac2"}}, -{"id":"websockets","key":"websockets","value":{"rev":"3-5535fcb4ae144909f021ee067eec7b2a"}}, -{"id":"webworker","key":"webworker","value":{"rev":"16-f7a4c758b176c6e464c93b6a9f79283b"}}, -{"id":"weibo","key":"weibo","value":{"rev":"21-8a50310389b2f43d8a7cb14e138eb122"}}, -{"id":"weld","key":"weld","value":{"rev":"7-16601ac41d79b3a01e4d2615035376ed"}}, -{"id":"whatlang","key":"whatlang","value":{"rev":"5-f7b10a0f8c3b6579c81d1d1222aeccd7"}}, -{"id":"wheat","key":"wheat","value":{"rev":"16-f6a97282f521edb7f2b0e5edc9577ce0"}}, -{"id":"which","key":"which","value":{"rev":"7-e5fdcb208715f2201d3911caf8a67042"}}, -{"id":"whiskers","key":"whiskers","value":{"rev":"9-2cfd73cebeaf8ce3cb1591e825380621"}}, -{"id":"whiskey","key":"whiskey","value":{"rev":"49-55367718b9067ff2bcb7fbb89327587b"}}, -{"id":"whisperjs","key":"whisperjs","value":{"rev":"19-e2182c72ea24b8c40e12b0c1027eb60d"}}, -{"id":"wikimapia","key":"wikimapia","value":{"rev":"11-8d1a314e8c827236e21e0aabc6e5efd9"}}, -{"id":"wikiminute","key":"wikiminute","value":{"rev":"11-d031a2c7d41bcecb52ac9c7bb5e75e8e"}}, -{"id":"wikiwym","key":"wikiwym","value":{"rev":"3-c0fd4c9b6b93b3a8b14021c2ebae5b0c"}}, -{"id":"wiky","key":"wiky","value":{"rev":"6-be49acce152652e9219a32da1dfd01ea"}}, -{"id":"wildfile","key":"wildfile","value":{"rev":"9-16a05032f890f07c72a5f48c3a6ffbc0"}}, -{"id":"willful.js","key":"willful.js","value":{"rev":"3-3bb957b0a5fc1b4b6c15bace7e8f5902"}}, -{"id":"wilson","key":"wilson","value":{"rev":"14-d4bf88484f1b1cf86b07f4b74f26991d"}}, -{"id":"window","key":"window","value":{"rev":"3-ea84e74fd5556ff662ff47f40522cfa2"}}, -{"id":"windshaft","key":"windshaft","value":{"rev":"21-1d31e4eb7482d15b97c919a4b051ea9c"}}, -{"id":"windtunnel","key":"windtunnel","value":{"rev":"5-0d2ef7faed1b221a3eaa581480adad64"}}, -{"id":"wingrr","key":"wingrr","value":{"rev":"9-a599fad3e0c74895aa266c61805b76cb"}}, -{"id":"wings","key":"wings","value":{"rev":"3-cfcfd262d905cd3be1d1bae82fafd9f0"}}, -{"id":"winston","key":"winston","value":{"rev":"111-13acba5a9ba6d4f19469acb4122d72ea"}}, -{"id":"winston-amqp","key":"winston-amqp","value":{"rev":"5-61408e1dde45f974a995dd27905b8831"}}, -{"id":"winston-mongodb","key":"winston-mongodb","value":{"rev":"9-ae755237a8faa8f5a0b92029c236691a"}}, -{"id":"winston-redis","key":"winston-redis","value":{"rev":"3-1fb861edc109ed5cbd735320124ba103"}}, -{"id":"winston-riak","key":"winston-riak","value":{"rev":"15-3f2923a73386524d851244ace1bece98"}}, -{"id":"winston-syslog","key":"winston-syslog","value":{"rev":"9-7f256bd63aebec19edea47f80de21dfd"}}, -{"id":"winstoon","key":"winstoon","value":{"rev":"9-d719ca7abfeeaa468d1b431c24836089"}}, -{"id":"wirez","key":"wirez","value":{"rev":"5-5c5d0768485ed11c2b80a8a6a3699c39"}}, -{"id":"wobot","key":"wobot","value":{"rev":"9-176ed86fd9d94a7e94efb782c7512533"}}, -{"id":"word-generator","key":"word-generator","value":{"rev":"5-a2c67f11474a8925eb67f04369ac068a"}}, -{"id":"wordnik","key":"wordnik","value":{"rev":"3-4e371fbf7063ced50bbe726079fda1ec"}}, -{"id":"wordpress-auth","key":"wordpress-auth","value":{"rev":"5-05eef01542e00a88418d2885efb4c9ad"}}, -{"id":"wordwrap","key":"wordwrap","value":{"rev":"5-a728ce2cdeab69b71d40fe7c1c41d7c1"}}, -{"id":"wordy","key":"wordy","value":{"rev":"3-bc220ca3dbd008aee932c551cfbdcc6b"}}, -{"id":"worker","key":"worker","value":{"rev":"6-3b03aa764c9fac66ec5c1773e9abc43b"}}, -{"id":"worker-pool","key":"worker-pool","value":{"rev":"3-e3550e704b48f5799a4cc02af7d27355"}}, -{"id":"workflow","key":"workflow","value":{"rev":"3-817c6c77cbb2f332ea9bdddf3b565c00"}}, -{"id":"workhorse","key":"workhorse","value":{"rev":"30-c39ae2ddd867a137073a289c1709f229"}}, -{"id":"world-db","key":"world-db","value":{"rev":"6-eaef1beb6abbebd3e903a28a7f46aa81"}}, -{"id":"worm","key":"worm","value":{"rev":"7-00db15dc9cfd48777cce32fb93e1df6b"}}, -{"id":"wormhole","key":"wormhole","value":{"rev":"37-21e2db062666040c477a7042fc2ffc9d"}}, -{"id":"wrap","key":"wrap","value":{"rev":"3-aded14c091b730813bd24d92cae45cd6"}}, -{"id":"wrench","key":"wrench","value":{"rev":"12-57d3da63e34e59e1f5d1b3bde471e31f"}}, -{"id":"wsclient","key":"wsclient","value":{"rev":"17-f962faf4f6c9d4eda9111e90b2d0735d"}}, -{"id":"wscomm","key":"wscomm","value":{"rev":"47-80affda45da523e57c87b8d43ef73ec9"}}, -{"id":"wsscraper","key":"wsscraper","value":{"rev":"3-94a84fe9b3df46b8d6ad4851e389dae1"}}, -{"id":"wu","key":"wu","value":{"rev":"4-f307d3a00e7a1212b7949bcb96161088"}}, -{"id":"wunderapi","key":"wunderapi","value":{"rev":"17-31e3b991e97931022992b97f9441b9af"}}, -{"id":"wurfl-client","key":"wurfl-client","value":{"rev":"3-a8c3e454d6d9c9b23b7290eb64866e80"}}, -{"id":"wwwdude","key":"wwwdude","value":{"rev":"19-eb8192461b8864af59740f9b44e168ca"}}, -{"id":"x","key":"x","value":{"rev":"9-10403358980aba239b7a9af78175589d"}}, -{"id":"x-core","key":"x-core","value":{"rev":"13-f04b063855da231539d1945a35802d9e"}}, -{"id":"x11","key":"x11","value":{"rev":"5-e5b1435c0aa29207c90fdeaa87570bb7"}}, -{"id":"xappy-async_testing","key":"xappy-async_testing","value":{"rev":"3-747c934540267492b0e6d3bb6d65964c"}}, -{"id":"xappy-pg","key":"xappy-pg","value":{"rev":"4-119e8f93af1e4976900441ec5e3bb0b9"}}, -{"id":"xcbjs","key":"xcbjs","value":{"rev":"3-095a693f9ac7b4e2c319f79d95eb3e95"}}, -{"id":"xemplar","key":"xemplar","value":{"rev":"9-2ccde68ffac8e66aa8013b98d82ff20c"}}, -{"id":"xfer","key":"xfer","value":{"rev":"3-c1875506ed132c6a2b5e7d7eaff9df14"}}, -{"id":"xjs","key":"xjs","value":{"rev":"11-05d5cd002298894ed582a9f5bff5a762"}}, -{"id":"xjst","key":"xjst","value":{"rev":"11-68774970fc7f413ff620fb0d50d8a1d9"}}, -{"id":"xkcdbot","key":"xkcdbot","value":{"rev":"3-7cc9affb442c9ae4c7a109a0b72c2600"}}, -{"id":"xml","key":"xml","value":{"rev":"12-0d1a69f11767de47bfc4a0fce566e36e"}}, -{"id":"xml-markup","key":"xml-markup","value":{"rev":"6-100a92d1f7fe9444e285365dce8203de"}}, -{"id":"xml-simple","key":"xml-simple","value":{"rev":"3-d60e388df5b65128a5e000381643dd31"}}, -{"id":"xml-stream","key":"xml-stream","value":{"rev":"13-44d6ee47e00c91735e908e69c5dffc6b"}}, -{"id":"xml2js","key":"xml2js","value":{"rev":"27-434297bcd9db7628c57fcc9bbbe2671e"}}, -{"id":"xml2js-expat","key":"xml2js-expat","value":{"rev":"15-a8c5c0ba64584d07ed94c0a14dc55fe8"}}, -{"id":"xml2json","key":"xml2json","value":{"rev":"17-fa740417285834be1aa4d95e1ed6d9b9"}}, -{"id":"xmlbuilder","key":"xmlbuilder","value":{"rev":"32-63e3be32dda07c6e998866cddd8a879e"}}, -{"id":"xmlhttprequest","key":"xmlhttprequest","value":{"rev":"9-570fba8bfd5b0958c258cee7309c4b54"}}, -{"id":"xmlrpc","key":"xmlrpc","value":{"rev":"15-ae062e34a965e7543d4fd7b6c3f29cb7"}}, -{"id":"xmpp-client","key":"xmpp-client","value":{"rev":"6-2d123b4666b5deda71f071295cfca793"}}, -{"id":"xmpp-muc","key":"xmpp-muc","value":{"rev":"6-d95b8bca67f406a281a27aa4d89f6f46"}}, -{"id":"xmpp-server","key":"xmpp-server","value":{"rev":"9-44374bc3398cc74f2a36ff973fa0d35f"}}, -{"id":"xp","key":"xp","value":{"rev":"7-781a5e1da74332f25c441f627cd0b4ea"}}, -{"id":"xregexp","key":"xregexp","value":{"rev":"3-c34025fdeb13c18389e737a4b3d4ddf7"}}, -{"id":"xsd","key":"xsd","value":{"rev":"5-566590ccb8923453175a3f1f3b6cbf24"}}, -{"id":"ya-csv","key":"ya-csv","value":{"rev":"28-d485b812914b3c3f5d7e9c4bcee0c3ea"}}, -{"id":"yabble","key":"yabble","value":{"rev":"5-5370a53003a122fe40a16ed2b0e5cead"}}, -{"id":"yaconfig","key":"yaconfig","value":{"rev":"3-f82a452260b010cc5128818741c46017"}}, -{"id":"yah","key":"yah","value":{"rev":"3-cfc0c10f85a9e3076247ca350077e90f"}}, -{"id":"yajet","key":"yajet","value":{"rev":"5-6f7f24335436c84081adf0bbb020b151"}}, -{"id":"yajl","key":"yajl","value":{"rev":"3-8ac011e5a00368aad8d58d95a64c7254"}}, -{"id":"yaml","key":"yaml","value":{"rev":"16-732e5cb6dc10eefeb7dae959e677fb5b"}}, -{"id":"yaml-config","key":"yaml-config","value":{"rev":"3-fb817000005d48526a106ecda5ac5435"}}, -{"id":"yamlish","key":"yamlish","value":{"rev":"3-604fb4f1de9d5aa5ed48432c7db4a8a1"}}, -{"id":"yamlparser","key":"yamlparser","value":{"rev":"13-130a82262c7f742c2a1e26fc58983503"}}, -{"id":"yammer-js","key":"yammer-js","value":{"rev":"3-16ec240ab0b26fa9f0513ada8c769c1f"}}, -{"id":"yanc","key":"yanc","value":{"rev":"15-33d713f0dee42efe8306e6b2a43fe336"}}, -{"id":"yanlibs","key":"yanlibs","value":{"rev":"3-e481217d43b9f79b80e22538eabadabc"}}, -{"id":"yanop","key":"yanop","value":{"rev":"5-6c407ce6f1c18b6bac37ad5945ff8fed"}}, -{"id":"yanx","key":"yanx","value":{"rev":"6-f4c4d255526eaa922baa498f37d38fe0"}}, -{"id":"yasession","key":"yasession","value":{"rev":"7-6e2598123d41b33535b88e99eb87828f"}}, -{"id":"yelp","key":"yelp","value":{"rev":"3-5c769f488a65addba313ff3b6256c365"}}, -{"id":"yeti","key":"yeti","value":{"rev":"50-65338f573ed8f799ec9b1c9bd2643e34"}}, -{"id":"youtube","key":"youtube","value":{"rev":"7-5020698499af8946e9578864a21f6ac5"}}, -{"id":"youtube-dl","key":"youtube-dl","value":{"rev":"76-a42f09b7bf87e7e6157d5d9835cca8a7"}}, -{"id":"youtube-js","key":"youtube-js","value":{"rev":"5-e2d798a185490ad98cb57c2641c4658e"}}, -{"id":"yproject","key":"yproject","value":{"rev":"7-70cb1624de9e8321c67f1f348dc80ff4"}}, -{"id":"yql","key":"yql","value":{"rev":"18-d19123b254abfb097648c4a242513fd3"}}, -{"id":"yubico","key":"yubico","value":{"rev":"9-0e2bd84479a68e1f12c89800a4049053"}}, -{"id":"yui-cli","key":"yui-cli","value":{"rev":"7-0186f7278da8734861109799b9123197"}}, -{"id":"yui-compressor","key":"yui-compressor","value":{"rev":"12-5804d78bb24bb2d3555ca2e28ecc6b70"}}, -{"id":"yui-repl","key":"yui-repl","value":{"rev":"25-9b202e835a46a07be931e6529a4ccb61"}}, -{"id":"yui3","key":"yui3","value":{"rev":"93-4decc441f19acf0ab5abd1a81e3cbb40"}}, -{"id":"yui3-2in3","key":"yui3-2in3","value":{"rev":"10-dc0429fe818aceeca80d075613c9547a"}}, -{"id":"yui3-bare","key":"yui3-bare","value":{"rev":"33-60779e2088efe782b437ecc053c01e2f"}}, -{"id":"yui3-base","key":"yui3-base","value":{"rev":"33-89017bb5dfde621fc7d179f2939e3d1b"}}, -{"id":"yui3-core","key":"yui3-core","value":{"rev":"17-3759fa0072e24f4bb29e22144cb3dda3"}}, -{"id":"yui3-gallery","key":"yui3-gallery","value":{"rev":"38-9ce6f7a60b2f815337767249d1827951"}}, -{"id":"yui3-mocha","key":"yui3-mocha","value":{"rev":"3-83ff9c42a37f63de0c132ce6cb1ad282"}}, -{"id":"yuitest","key":"yuitest","value":{"rev":"17-b5dd4ad4e82b6b310d7a6e9103570779"}}, -{"id":"zap","key":"zap","value":{"rev":"15-9b9b7c6badb0a9fd9d469934e9be12c0"}}, -{"id":"zappa","key":"zappa","value":{"rev":"26-d193767b488e778db41455924001b1fb"}}, -{"id":"zen","key":"zen","value":{"rev":"7-23a260d4379816a5c931c2e823bda1ae"}}, -{"id":"zeppelin","key":"zeppelin","value":{"rev":"7-9db2e313fe323749e259be91edcdee8e"}}, -{"id":"zeromq","key":"zeromq","value":{"rev":"24-7cb4cec19fb3a03871900ac3558fcbef"}}, -{"id":"zest","key":"zest","value":{"rev":"5-080a2a69a93d66fcaae0da7ddaa9ceab"}}, -{"id":"zest-js","key":"zest-js","value":{"rev":"5-541454063618fa3a9d6f44e0147ea622"}}, -{"id":"zip","key":"zip","value":{"rev":"11-443da314322b6a1a93b40a38124610f2"}}, -{"id":"zipfile","key":"zipfile","value":{"rev":"32-e846d29fc615e8fbc610f44653a1e085"}}, -{"id":"zipper","key":"zipper","value":{"rev":"5-cde0a4a7f03c139dcd779f3ede55bd0e"}}, -{"id":"zippy","key":"zippy","value":{"rev":"7-3906ca62dd8020e9673a7c229944bd3f"}}, -{"id":"zipwith","key":"zipwith","value":{"rev":"3-58c50c6220d6493047f8333c5db22cc9"}}, -{"id":"zlib","key":"zlib","value":{"rev":"27-e0443f2d9a0c9db31f86a6c5b9ba78ba"}}, -{"id":"zlib-sync","key":"zlib-sync","value":{"rev":"3-b17a39dd23b3455d35ffd862004ed677"}}, -{"id":"zlibcontext","key":"zlibcontext","value":{"rev":"11-1c0c6b34e87adab1b6d5ee60be6a608c"}}, -{"id":"zlibstream","key":"zlibstream","value":{"rev":"5-44e30d87de9aaaa975c64d8dcdcd1a94"}}, -{"id":"zmq","key":"zmq","value":{"rev":"7-eae5d939fcdb7be5edfb328aefeaba4e"}}, -{"id":"zo","key":"zo","value":{"rev":"5-956f084373731805e5871f4716049529"}}, -{"id":"zombie","key":"zombie","value":{"rev":"109-9eec325353a47bfcc32a94719bf147da"}}, -{"id":"zombie-https","key":"zombie-https","value":{"rev":"3-6aff25d319be319343882575acef4890"}}, -{"id":"zoneinfo","key":"zoneinfo","value":{"rev":"15-d95d2041324d961fe26a0217cf485511"}}, -{"id":"zookeeper","key":"zookeeper","value":{"rev":"11-5a5ed278a01e4b508ffa6e9a02059898"}}, -{"id":"zoom","key":"zoom","value":{"rev":"3-9d0277ad580d64c9a4d48a40d22976f0"}}, -{"id":"zsock","key":"zsock","value":{"rev":"16-4f975b91f0f9c2d2a2501e362401c368"}}, -{"id":"zutil","key":"zutil","value":{"rev":"9-3e7bc6520008b4fcd5ee6eb9e8e5adf5"}} -]} diff --git a/src/node_modules/JSONStream/test/fixtures/depth.json b/src/node_modules/JSONStream/test/fixtures/depth.json deleted file mode 100644 index 868062f..0000000 --- a/src/node_modules/JSONStream/test/fixtures/depth.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "total": 5, - "docs": [ - { - "key": { - "value": 0, - "some": "property" - } - }, - {"value": 1}, - {"value": 2}, - {"blbl": [{}, {"a":0, "b":1, "value":3}, 10]}, - {"value": 4} - ] -} \ No newline at end of file diff --git a/src/node_modules/JSONStream/test/fn.js b/src/node_modules/JSONStream/test/fn.js deleted file mode 100644 index 4acc672..0000000 --- a/src/node_modules/JSONStream/test/fn.js +++ /dev/null @@ -1,39 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -function fn (s) { - return !isNaN(parseInt(s, 10)) -} - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows', fn]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it.has({ - id: it.typeof('string'), - value: {rev: it.typeof('string')}, - key:it.typeof('string') - }) - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - it(parsed).deepEqual(expected.rows) - console.error('PASSED') -}) diff --git a/src/node_modules/JSONStream/test/gen.js b/src/node_modules/JSONStream/test/gen.js deleted file mode 100644 index c233722..0000000 --- a/src/node_modules/JSONStream/test/gen.js +++ /dev/null @@ -1,135 +0,0 @@ -return // dont run this test for now since tape is weird and broken on 0.10 - -var fs = require('fs') -var JSONStream = require('../') -var file = process.argv[2] || '/tmp/JSONStream-test-large.json' -var size = Number(process.argv[3] || 100000) -var tape = require('tape') -// if (process.title !== 'browser') { - tape('out of mem', function (t) { - t.plan(1) - ////////////////////////////////////////////////////// - // Produces a random number between arg1 and arg2 - ////////////////////////////////////////////////////// - var randomNumber = function (min, max) { - var number = Math.floor(Math.random() * (max - min + 1) + min); - return number; - }; - - ////////////////////////////////////////////////////// - // Produces a random string of a length between arg1 and arg2 - ////////////////////////////////////////////////////// - var randomString = function (min, max) { - - // add several spaces to increase chanses of creating 'words' - var chars = ' 0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; - var result = ''; - - var randomLength = randomNumber(min, max); - - for (var i = randomLength; i > 0; --i) { - result += chars[Math.round(Math.random() * (chars.length - 1))]; - } - return result; - }; - - ////////////////////////////////////////////////////// - // Produces a random JSON document, as a string - ////////////////////////////////////////////////////// - var randomJsonDoc = function () { - - var doc = { - "CrashOccurenceID": randomNumber(10000, 50000), - "CrashID": randomNumber(1000, 10000), - "SiteName": randomString(10, 25), - "MachineName": randomString(10, 25), - "Date": randomString(26, 26), - "ProcessDuration": randomString(18, 18), - "ThreadIdentityName": null, - "WindowsIdentityName": randomString(15, 40), - "OperatingSystemName": randomString(35, 65), - "DetailedExceptionInformation": randomString(100, 800) - }; - - doc = JSON.stringify(doc); - doc = doc.replace(/\,/g, ',\n'); // add new lines after each attribute - return doc; - }; - - ////////////////////////////////////////////////////// - // generates test data - ////////////////////////////////////////////////////// - var generateTestData = function (cb) { - - console.log('generating large data file...'); - - var stream = fs.createWriteStream(file, { - encoding: 'utf8' - }); - - var i = 0; - var max = size; - var writing = false - var split = ',\n'; - var doc = randomJsonDoc(); - stream.write('['); - - function write () { - if(writing) return - writing = true - while(++i < max) { - if(Math.random() < 0.001) - console.log('generate..', i + ' / ' + size) - if(!stream.write(doc + split)) { - writing = false - return stream.once('drain', write) - } - } - stream.write(doc + ']') - stream.end(); - console.log('END') - } - write() - stream.on('close', cb) - }; - - ////////////////////////////////////////////////////// - // Shows that parsing 100000 instances using JSONStream fails - // - // After several seconds, you will get this crash - // FATAL ERROR: JS Allocation failed - process out of memory - ////////////////////////////////////////////////////// - var testJSONStreamParse_causesOutOfMem = function (done) { - var items = 0 - console.log('parsing data files using JSONStream...'); - - var parser = JSONStream.parse([true]); - var stream = fs.createReadStream(file); - stream.pipe(parser); - - parser.on('data', function (data) { - items++ - if(Math.random() < 0.01) console.log(items, '...') - }); - - parser.on('end', function () { - t.equal(items, size) - }); - - }; - - ////////////////////////////////////////////////////// - // main - ////////////////////////////////////////////////////// - - fs.stat(file, function (err, stat) { - console.log(stat) - if(err) - generateTestData(testJSONStreamParse_causesOutOfMem); - else - testJSONStreamParse_causesOutOfMem() - }) - - }) - -// } diff --git a/src/node_modules/JSONStream/test/issues.js b/src/node_modules/JSONStream/test/issues.js deleted file mode 100644 index eba392e..0000000 --- a/src/node_modules/JSONStream/test/issues.js +++ /dev/null @@ -1,20 +0,0 @@ -var JSONStream = require('../'); -var test = require('tape') - -test('#66', function (t) { - var error = 0; - var stream = JSONStream - .parse() - .on('error', function (err) { - t.ok(err); - error++; - }) - .on('end', function () { - t.ok(error === 1); - t.end(); - }); - - stream.write('["foo":bar['); - stream.end(); - -}); diff --git a/src/node_modules/JSONStream/test/map.js b/src/node_modules/JSONStream/test/map.js deleted file mode 100644 index 29b9d89..0000000 --- a/src/node_modules/JSONStream/test/map.js +++ /dev/null @@ -1,40 +0,0 @@ - -var test = require('tape') - -var JSONStream = require('../') - -test('map function', function (t) { - - var actual = [] - - stream = JSONStream.parse([true], function (e) { return e*10 }) - stream.on('data', function (v) { actual.push(v)}) - stream.on('end', function () { - t.deepEqual(actual, [10,20,30,40,50,60]) - t.end() - - }) - - stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) - stream.end() - -}) - -test('filter function', function (t) { - - var actual = [] - - stream = JSONStream - .parse([true], function (e) { return e%2 ? e : null}) - .on('data', function (v) { actual.push(v)}) - .on('end', function () { - t.deepEqual(actual, [1,3,5]) - t.end() - - }) - - stream.write(JSON.stringify([1,2,3,4,5,6], null, 2)) - stream.end() - -}) - diff --git a/src/node_modules/JSONStream/test/multiple_objects.js b/src/node_modules/JSONStream/test/multiple_objects.js deleted file mode 100644 index 22f6324..0000000 --- a/src/node_modules/JSONStream/test/multiple_objects.js +++ /dev/null @@ -1,36 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var it = require('it-is'); -var JSONStream = require('../'); - -var str = fs.readFileSync(file); - -var datas = {} - -var server = net.createServer(function(client) { - var data_calls = 0; - var parser = JSONStream.parse(['rows', true, 'key']); - parser.on('data', function(data) { - ++ data_calls; - datas[data] = (datas[data] || 0) + 1 - it(data).typeof('string') - }); - - parser.on('end', function() { - console.log('END') - var min = Infinity - for (var d in datas) - min = min > datas[d] ? datas[d] : min - it(min).equal(3); - server.close(); - }); - client.pipe(parser); -}); -server.listen(9999); - -var client = net.connect({ port : 9999 }, function() { - var msgs = str + ' ' + str + '\n\n' + str - client.end(msgs); -}); diff --git a/src/node_modules/JSONStream/test/multiple_objects_error.js b/src/node_modules/JSONStream/test/multiple_objects_error.js deleted file mode 100644 index 83d113b..0000000 --- a/src/node_modules/JSONStream/test/multiple_objects_error.js +++ /dev/null @@ -1,29 +0,0 @@ -var fs = require ('fs'); -var net = require('net'); -var join = require('path').join; -var file = join(__dirname, 'fixtures','all_npm.json'); -var it = require('it-is'); -var JSONStream = require('../'); - -var str = fs.readFileSync(file); - -var server = net.createServer(function(client) { - var data_calls = 0; - var parser = JSONStream.parse(); - parser.on('error', function(err) { - console.log(err); - server.close(); - }); - - parser.on('end', function() { - console.log('END'); - server.close(); - }); - client.pipe(parser); -}); -server.listen(9999); - -var client = net.connect({ port : 9999 }, function() { - var msgs = str + '}'; - client.end(msgs); -}); diff --git a/src/node_modules/JSONStream/test/null.js b/src/node_modules/JSONStream/test/null.js deleted file mode 100644 index 95dd60c..0000000 --- a/src/node_modules/JSONStream/test/null.js +++ /dev/null @@ -1,28 +0,0 @@ -var JSONStream = require('../') - -var data = [ - {ID: 1, optional: null}, - {ID: 2, optional: null}, - {ID: 3, optional: 20}, - {ID: 4, optional: null}, - {ID: 5, optional: 'hello'}, - {ID: 6, optional: null} -] - - -var test = require('tape') - -test ('null properties', function (t) { - var actual = [] - var stream = - - JSONStream.parse('*.optional') - .on('data', function (v) { actual.push(v) }) - .on('end', function () { - t.deepEqual(actual, [20, 'hello']) - t.end() - }) - - stream.write(JSON.stringify(data, null, 2)) - stream.end() -}) diff --git a/src/node_modules/JSONStream/test/parsejson.js b/src/node_modules/JSONStream/test/parsejson.js deleted file mode 100644 index 0279887..0000000 --- a/src/node_modules/JSONStream/test/parsejson.js +++ /dev/null @@ -1,28 +0,0 @@ - - -/* - sometimes jsonparse changes numbers slightly. -*/ - -var r = Math.random() - , Parser = require('jsonparse') - , p = new Parser() - , assert = require('assert') - , times = 20 -while (times --) { - - assert.equal(JSON.parse(JSON.stringify(r)), r, 'core JSON') - - p.onValue = function (v) { - console.error('parsed', v) - assert.equal( - String(v).slice(0,12), - String(r).slice(0,12) - ) - } - console.error('correct', r) - p.write (new Buffer(JSON.stringify([r]))) - - - -} diff --git a/src/node_modules/JSONStream/test/stringify.js b/src/node_modules/JSONStream/test/stringify.js deleted file mode 100644 index b6de85e..0000000 --- a/src/node_modules/JSONStream/test/stringify.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], - stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - //JSONStream.parse([/./]), - es.writeArray(function (err, lines) { - - it(JSON.parse(lines.join(''))).deepEqual(expected) - console.error('PASSED') - }) - ) diff --git a/src/node_modules/JSONStream/test/stringify_object.js b/src/node_modules/JSONStream/test/stringify_object.js deleted file mode 100644 index 9490115..0000000 --- a/src/node_modules/JSONStream/test/stringify_object.js +++ /dev/null @@ -1,47 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - , es = require('event-stream') - , pending = 10 - , passed = true - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], - stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -for (var ix = 0; ix < pending; ix++) (function (count) { - var expected = {} - , stringify = JSONStream.stringifyObject() - - es.connect( - stringify, - es.writeArray(function (err, lines) { - it(JSON.parse(lines.join(''))).deepEqual(expected) - if (--pending === 0) { - console.error('PASSED') - } - }) - ) - - while (count --) { - var key = Math.random().toString(16).slice(2) - expected[key] = randomObj() - stringify.write([ key, expected[key] ]) - } - - process.nextTick(function () { - stringify.end() - }) -})(ix) diff --git a/src/node_modules/JSONStream/test/test.js b/src/node_modules/JSONStream/test/test.js deleted file mode 100644 index 8ea7c2e..0000000 --- a/src/node_modules/JSONStream/test/test.js +++ /dev/null @@ -1,35 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse(['rows', /\d+/ /*, 'value'*/]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it.has({ - id: it.typeof('string'), - value: {rev: it.typeof('string')}, - key:it.typeof('string') - }) - parsed.push(data) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(expected.rows.length) - it(parsed).deepEqual(expected.rows) - console.error('PASSED') -}) diff --git a/src/node_modules/JSONStream/test/test2.js b/src/node_modules/JSONStream/test/test2.js deleted file mode 100644 index d09df7b..0000000 --- a/src/node_modules/JSONStream/test/test2.js +++ /dev/null @@ -1,29 +0,0 @@ - - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, '..','package.json') - , JSONStream = require('../') - , it = require('it-is') - -var expected = JSON.parse(fs.readFileSync(file)) - , parser = JSONStream.parse([]) - , called = 0 - , ended = false - , parsed = [] - -fs.createReadStream(file).pipe(parser) - -parser.on('data', function (data) { - called ++ - it(data).deepEqual(expected) -}) - -parser.on('end', function () { - ended = true -}) - -process.on('exit', function () { - it(called).equal(1) - console.error('PASSED') -}) \ No newline at end of file diff --git a/src/node_modules/JSONStream/test/two-ways.js b/src/node_modules/JSONStream/test/two-ways.js deleted file mode 100644 index 8f3b89c..0000000 --- a/src/node_modules/JSONStream/test/two-ways.js +++ /dev/null @@ -1,41 +0,0 @@ - -var fs = require ('fs') - , join = require('path').join - , file = join(__dirname, 'fixtures','all_npm.json') - , JSONStream = require('../') - , it = require('it-is').style('colour') - - function randomObj () { - return ( - Math.random () < 0.4 - ? {hello: 'eonuhckmqjk', - whatever: 236515, - lies: true, - nothing: [null], -// stuff: [Math.random(),Math.random(),Math.random()] - } - : ['AOREC', 'reoubaor', {ouec: 62642}, [[[], {}, 53]]] - ) - } - -var expected = [] - , stringify = JSONStream.stringify() - , es = require('event-stream') - , stringified = '' - , called = 0 - , count = 10 - , ended = false - -while (count --) - expected.push(randomObj()) - - es.connect( - es.readArray(expected), - stringify, - JSONStream.parse([/./]), - es.writeArray(function (err, lines) { - - it(lines).has(expected) - console.error('PASSED') - }) - ) diff --git a/src/node_modules/abbrev/.npmignore b/src/node_modules/abbrev/.npmignore deleted file mode 100644 index 9d6cd2f..0000000 --- a/src/node_modules/abbrev/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -.nyc_output -nyc_output -node_modules -coverage diff --git a/src/node_modules/abbrev/.travis.yml b/src/node_modules/abbrev/.travis.yml deleted file mode 100644 index 991d04b..0000000 --- a/src/node_modules/abbrev/.travis.yml +++ /dev/null @@ -1,5 +0,0 @@ -language: node_js -node_js: - - '0.10' - - '0.12' - - 'iojs' diff --git a/src/node_modules/abbrev/CONTRIBUTING.md b/src/node_modules/abbrev/CONTRIBUTING.md deleted file mode 100644 index 2f30261..0000000 --- a/src/node_modules/abbrev/CONTRIBUTING.md +++ /dev/null @@ -1,3 +0,0 @@ - To get started,
    sign the - Contributor License Agreement. diff --git a/src/node_modules/abbrev/LICENSE b/src/node_modules/abbrev/LICENSE deleted file mode 100644 index 19129e3..0000000 --- a/src/node_modules/abbrev/LICENSE +++ /dev/null @@ -1,15 +0,0 @@ -The ISC License - -Copyright (c) Isaac Z. Schlueter and Contributors - -Permission to use, copy, modify, and/or distribute this software for any -purpose with or without fee is hereby granted, provided that the above -copyright notice and this permission notice appear in all copies. - -THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES -WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF -MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR -ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES -WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN -ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR -IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. diff --git a/src/node_modules/abbrev/README.md b/src/node_modules/abbrev/README.md deleted file mode 100644 index 99746fe..0000000 --- a/src/node_modules/abbrev/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# abbrev-js - -Just like [ruby's Abbrev](http://apidock.com/ruby/Abbrev). - -Usage: - - var abbrev = require("abbrev"); - abbrev("foo", "fool", "folding", "flop"); - - // returns: - { fl: 'flop' - , flo: 'flop' - , flop: 'flop' - , fol: 'folding' - , fold: 'folding' - , foldi: 'folding' - , foldin: 'folding' - , folding: 'folding' - , foo: 'foo' - , fool: 'fool' - } - -This is handy for command-line scripts, or other cases where you want to be able to accept shorthands. diff --git a/src/node_modules/abbrev/abbrev.js b/src/node_modules/abbrev/abbrev.js deleted file mode 100644 index 69cfeac..0000000 --- a/src/node_modules/abbrev/abbrev.js +++ /dev/null @@ -1,62 +0,0 @@ - -module.exports = exports = abbrev.abbrev = abbrev - -abbrev.monkeyPatch = monkeyPatch - -function monkeyPatch () { - Object.defineProperty(Array.prototype, 'abbrev', { - value: function () { return abbrev(this) }, - enumerable: false, configurable: true, writable: true - }) - - Object.defineProperty(Object.prototype, 'abbrev', { - value: function () { return abbrev(Object.keys(this)) }, - enumerable: false, configurable: true, writable: true - }) -} - -function abbrev (list) { - if (arguments.length !== 1 || !Array.isArray(list)) { - list = Array.prototype.slice.call(arguments, 0) - } - for (var i = 0, l = list.length, args = [] ; i < l ; i ++) { - args[i] = typeof list[i] === "string" ? list[i] : String(list[i]) - } - - // sort them lexicographically, so that they're next to their nearest kin - args = args.sort(lexSort) - - // walk through each, seeing how much it has in common with the next and previous - var abbrevs = {} - , prev = "" - for (var i = 0, l = args.length ; i < l ; i ++) { - var current = args[i] - , next = args[i + 1] || "" - , nextMatches = true - , prevMatches = true - if (current === next) continue - for (var j = 0, cl = current.length ; j < cl ; j ++) { - var curChar = current.charAt(j) - nextMatches = nextMatches && curChar === next.charAt(j) - prevMatches = prevMatches && curChar === prev.charAt(j) - if (!nextMatches && !prevMatches) { - j ++ - break - } - } - prev = current - if (j === cl) { - abbrevs[current] = current - continue - } - for (var a = current.substr(0, j) ; j <= cl ; j ++) { - abbrevs[a] = current - a += current.charAt(j) - } - } - return abbrevs -} - -function lexSort (a, b) { - return a === b ? 0 : a > b ? 1 : -1 -} diff --git a/src/node_modules/abbrev/package.json b/src/node_modules/abbrev/package.json deleted file mode 100644 index c9a64e5..0000000 --- a/src/node_modules/abbrev/package.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "_args": [ - [ - "abbrev@1", - "/media/Github/Vertinext2/src/node_modules/nopt" - ] - ], - "_from": "abbrev@>=1.0.0 <2.0.0", - "_id": "abbrev@1.0.7", - "_inCache": true, - "_installable": true, - "_location": "/abbrev", - "_nodeVersion": "2.0.1", - "_npmUser": { - "email": "isaacs@npmjs.com", - "name": "isaacs" - }, - "_npmVersion": "2.10.1", - "_phantomChildren": {}, - "_requested": { - "name": "abbrev", - "raw": "abbrev@1", - "rawSpec": "1", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/nopt" - ], - "_resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz", - "_shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "_shrinkwrap": null, - "_spec": "abbrev@1", - "_where": "/media/Github/Vertinext2/src/node_modules/nopt", - "author": { - "email": "i@izs.me", - "name": "Isaac Z. Schlueter" - }, - "bugs": { - "url": "https://github.com/isaacs/abbrev-js/issues" - }, - "dependencies": {}, - "description": "Like ruby's abbrev module, but in js", - "devDependencies": { - "tap": "^1.2.0" - }, - "directories": {}, - "dist": { - "shasum": "5b6035b2ee9d4fb5cf859f08a9be81b208491843", - "tarball": "http://registry.npmjs.org/abbrev/-/abbrev-1.0.7.tgz" - }, - "gitHead": "821d09ce7da33627f91bbd8ed631497ed6f760c2", - "homepage": "https://github.com/isaacs/abbrev-js#readme", - "license": "ISC", - "main": "abbrev.js", - "maintainers": [ - { - "email": "i@izs.me", - "name": "isaacs" - } - ], - "name": "abbrev", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/isaacs/abbrev-js.git" - }, - "scripts": { - "test": "tap test.js --cov" - }, - "version": "1.0.7" -} diff --git a/src/node_modules/abbrev/test.js b/src/node_modules/abbrev/test.js deleted file mode 100644 index eb30e42..0000000 --- a/src/node_modules/abbrev/test.js +++ /dev/null @@ -1,47 +0,0 @@ -var abbrev = require('./abbrev.js') -var assert = require("assert") -var util = require("util") - -console.log("TAP version 13") -var count = 0 - -function test (list, expect) { - count++ - var actual = abbrev(list) - assert.deepEqual(actual, expect, - "abbrev("+util.inspect(list)+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - actual = abbrev.apply(exports, list) - assert.deepEqual(abbrev.apply(exports, list), expect, - "abbrev("+list.map(JSON.stringify).join(",")+") === " + util.inspect(expect) + "\n"+ - "actual: "+util.inspect(actual)) - console.log('ok - ' + list.join(' ')) -} - -test([ "ruby", "ruby", "rules", "rules", "rules" ], -{ rub: 'ruby' -, ruby: 'ruby' -, rul: 'rules' -, rule: 'rules' -, rules: 'rules' -}) -test(["fool", "foom", "pool", "pope"], -{ fool: 'fool' -, foom: 'foom' -, poo: 'pool' -, pool: 'pool' -, pop: 'pope' -, pope: 'pope' -}) -test(["a", "ab", "abc", "abcd", "abcde", "acde"], -{ a: 'a' -, ab: 'ab' -, abc: 'abc' -, abcd: 'abcd' -, abcde: 'abcde' -, ac: 'acde' -, acd: 'acde' -, acde: 'acde' -}) - -console.log("1..%d", count) diff --git a/src/node_modules/accepts/HISTORY.md b/src/node_modules/accepts/HISTORY.md deleted file mode 100644 index 397636e..0000000 --- a/src/node_modules/accepts/HISTORY.md +++ /dev/null @@ -1,170 +0,0 @@ -1.2.13 / 2015-09-06 -=================== - - * deps: mime-types@~2.1.6 - - deps: mime-db@~1.18.0 - -1.2.12 / 2015-07-30 -=================== - - * deps: mime-types@~2.1.4 - - deps: mime-db@~1.16.0 - -1.2.11 / 2015-07-16 -=================== - - * deps: mime-types@~2.1.3 - - deps: mime-db@~1.15.0 - -1.2.10 / 2015-07-01 -=================== - - * deps: mime-types@~2.1.2 - - deps: mime-db@~1.14.0 - -1.2.9 / 2015-06-08 -================== - - * deps: mime-types@~2.1.1 - - perf: fix deopt during mapping - -1.2.8 / 2015-06-07 -================== - - * deps: mime-types@~2.1.0 - - deps: mime-db@~1.13.0 - * perf: avoid argument reassignment & argument slice - * perf: avoid negotiator recursive construction - * perf: enable strict mode - * perf: remove unnecessary bitwise operator - -1.2.7 / 2015-05-10 -================== - - * deps: negotiator@0.5.3 - - Fix media type parameter matching to be case-insensitive - -1.2.6 / 2015-05-07 -================== - - * deps: mime-types@~2.0.11 - - deps: mime-db@~1.9.1 - * deps: negotiator@0.5.2 - - Fix comparing media types with quoted values - - Fix splitting media types with quoted commas - -1.2.5 / 2015-03-13 -================== - - * deps: mime-types@~2.0.10 - - deps: mime-db@~1.8.0 - -1.2.4 / 2015-02-14 -================== - - * Support Node.js 0.6 - * deps: mime-types@~2.0.9 - - deps: mime-db@~1.7.0 - * deps: negotiator@0.5.1 - - Fix preference sorting to be stable for long acceptable lists - -1.2.3 / 2015-01-31 -================== - - * deps: mime-types@~2.0.8 - - deps: mime-db@~1.6.0 - -1.2.2 / 2014-12-30 -================== - - * deps: mime-types@~2.0.7 - - deps: mime-db@~1.5.0 - -1.2.1 / 2014-12-30 -================== - - * deps: mime-types@~2.0.5 - - deps: mime-db@~1.3.1 - -1.2.0 / 2014-12-19 -================== - - * deps: negotiator@0.5.0 - - Fix list return order when large accepted list - - Fix missing identity encoding when q=0 exists - - Remove dynamic building of Negotiator class - -1.1.4 / 2014-12-10 -================== - - * deps: mime-types@~2.0.4 - - deps: mime-db@~1.3.0 - -1.1.3 / 2014-11-09 -================== - - * deps: mime-types@~2.0.3 - - deps: mime-db@~1.2.0 - -1.1.2 / 2014-10-14 -================== - - * deps: negotiator@0.4.9 - - Fix error when media type has invalid parameter - -1.1.1 / 2014-09-28 -================== - - * deps: mime-types@~2.0.2 - - deps: mime-db@~1.1.0 - * deps: negotiator@0.4.8 - - Fix all negotiations to be case-insensitive - - Stable sort preferences of same quality according to client order - -1.1.0 / 2014-09-02 -================== - - * update `mime-types` - -1.0.7 / 2014-07-04 -================== - - * Fix wrong type returned from `type` when match after unknown extension - -1.0.6 / 2014-06-24 -================== - - * deps: negotiator@0.4.7 - -1.0.5 / 2014-06-20 -================== - - * fix crash when unknown extension given - -1.0.4 / 2014-06-19 -================== - - * use `mime-types` - -1.0.3 / 2014-06-11 -================== - - * deps: negotiator@0.4.6 - - Order by specificity when quality is the same - -1.0.2 / 2014-05-29 -================== - - * Fix interpretation when header not in request - * deps: pin negotiator@0.4.5 - -1.0.1 / 2014-01-18 -================== - - * Identity encoding isn't always acceptable - * deps: negotiator@~0.4.0 - -1.0.0 / 2013-12-27 -================== - - * Genesis diff --git a/src/node_modules/accepts/LICENSE b/src/node_modules/accepts/LICENSE deleted file mode 100644 index 0616607..0000000 --- a/src/node_modules/accepts/LICENSE +++ /dev/null @@ -1,23 +0,0 @@ -(The MIT License) - -Copyright (c) 2014 Jonathan Ong -Copyright (c) 2015 Douglas Christopher Wilson - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/node_modules/accepts/README.md b/src/node_modules/accepts/README.md deleted file mode 100644 index ae36676..0000000 --- a/src/node_modules/accepts/README.md +++ /dev/null @@ -1,135 +0,0 @@ -# accepts - -[![NPM Version][npm-image]][npm-url] -[![NPM Downloads][downloads-image]][downloads-url] -[![Node.js Version][node-version-image]][node-version-url] -[![Build Status][travis-image]][travis-url] -[![Test Coverage][coveralls-image]][coveralls-url] - -Higher level content negotiation based on [negotiator](https://www.npmjs.com/package/negotiator). Extracted from [koa](https://www.npmjs.com/package/koa) for general use. - -In addition to negotiator, it allows: - -- Allows types as an array or arguments list, ie `(['text/html', 'application/json'])` as well as `('text/html', 'application/json')`. -- Allows type shorthands such as `json`. -- Returns `false` when no types match -- Treats non-existent headers as `*` - -## Installation - -```sh -npm install accepts -``` - -## API - -```js -var accepts = require('accepts') -``` - -### accepts(req) - -Create a new `Accepts` object for the given `req`. - -#### .charset(charsets) - -Return the first accepted charset. If nothing in `charsets` is accepted, -then `false` is returned. - -#### .charsets() - -Return the charsets that the request accepts, in the order of the client's -preference (most preferred first). - -#### .encoding(encodings) - -Return the first accepted encoding. If nothing in `encodings` is accepted, -then `false` is returned. - -#### .encodings() - -Return the encodings that the request accepts, in the order of the client's -preference (most preferred first). - -#### .language(languages) - -Return the first accepted language. If nothing in `languages` is accepted, -then `false` is returned. - -#### .languages() - -Return the languages that the request accepts, in the order of the client's -preference (most preferred first). - -#### .type(types) - -Return the first accepted type (and it is returned as the same text as what -appears in the `types` array). If nothing in `types` is accepted, then `false` -is returned. - -The `types` array can contain full MIME types or file extensions. Any value -that is not a full MIME types is passed to `require('mime-types').lookup`. - -#### .types() - -Return the types that the request accepts, in the order of the client's -preference (most preferred first). - -## Examples - -### Simple type negotiation - -This simple example shows how to use `accepts` to return a different typed -respond body based on what the client wants to accept. The server lists it's -preferences in order and will get back the best match between the client and -server. - -```js -var accepts = require('accepts') -var http = require('http') - -function app(req, res) { - var accept = accepts(req) - - // the order of this list is significant; should be server preferred order - switch(accept.type(['json', 'html'])) { - case 'json': - res.setHeader('Content-Type', 'application/json') - res.write('{"hello":"world!"}') - break - case 'html': - res.setHeader('Content-Type', 'text/html') - res.write('hello, world!') - break - default: - // the fallback is text/plain, so no need to specify it above - res.setHeader('Content-Type', 'text/plain') - res.write('hello, world!') - break - } - - res.end() -} - -http.createServer(app).listen(3000) -``` - -You can test this out with the cURL program: -```sh -curl -I -H'Accept: text/html' http://localhost:3000/ -``` - -## License - -[MIT](LICENSE) - -[npm-image]: https://img.shields.io/npm/v/accepts.svg -[npm-url]: https://npmjs.org/package/accepts -[node-version-image]: https://img.shields.io/node/v/accepts.svg -[node-version-url]: http://nodejs.org/download/ -[travis-image]: https://img.shields.io/travis/jshttp/accepts/master.svg -[travis-url]: https://travis-ci.org/jshttp/accepts -[coveralls-image]: https://img.shields.io/coveralls/jshttp/accepts/master.svg -[coveralls-url]: https://coveralls.io/r/jshttp/accepts -[downloads-image]: https://img.shields.io/npm/dm/accepts.svg -[downloads-url]: https://npmjs.org/package/accepts diff --git a/src/node_modules/accepts/index.js b/src/node_modules/accepts/index.js deleted file mode 100644 index e80192a..0000000 --- a/src/node_modules/accepts/index.js +++ /dev/null @@ -1,231 +0,0 @@ -/*! - * accepts - * Copyright(c) 2014 Jonathan Ong - * Copyright(c) 2015 Douglas Christopher Wilson - * MIT Licensed - */ - -'use strict' - -/** - * Module dependencies. - * @private - */ - -var Negotiator = require('negotiator') -var mime = require('mime-types') - -/** - * Module exports. - * @public - */ - -module.exports = Accepts - -/** - * Create a new Accepts object for the given req. - * - * @param {object} req - * @public - */ - -function Accepts(req) { - if (!(this instanceof Accepts)) - return new Accepts(req) - - this.headers = req.headers - this.negotiator = new Negotiator(req) -} - -/** - * Check if the given `type(s)` is acceptable, returning - * the best match when true, otherwise `undefined`, in which - * case you should respond with 406 "Not Acceptable". - * - * The `type` value may be a single mime type string - * such as "application/json", the extension name - * such as "json" or an array `["json", "html", "text/plain"]`. When a list - * or array is given the _best_ match, if any is returned. - * - * Examples: - * - * // Accept: text/html - * this.types('html'); - * // => "html" - * - * // Accept: text/*, application/json - * this.types('html'); - * // => "html" - * this.types('text/html'); - * // => "text/html" - * this.types('json', 'text'); - * // => "json" - * this.types('application/json'); - * // => "application/json" - * - * // Accept: text/*, application/json - * this.types('image/png'); - * this.types('png'); - * // => undefined - * - * // Accept: text/*;q=.5, application/json - * this.types(['html', 'json']); - * this.types('html', 'json'); - * // => "json" - * - * @param {String|Array} types... - * @return {String|Array|Boolean} - * @public - */ - -Accepts.prototype.type = -Accepts.prototype.types = function (types_) { - var types = types_ - - // support flattened arguments - if (types && !Array.isArray(types)) { - types = new Array(arguments.length) - for (var i = 0; i < types.length; i++) { - types[i] = arguments[i] - } - } - - // no types, return all requested types - if (!types || types.length === 0) { - return this.negotiator.mediaTypes() - } - - if (!this.headers.accept) return types[0]; - var mimes = types.map(extToMime); - var accepts = this.negotiator.mediaTypes(mimes.filter(validMime)); - var first = accepts[0]; - if (!first) return false; - return types[mimes.indexOf(first)]; -} - -/** - * Return accepted encodings or best fit based on `encodings`. - * - * Given `Accept-Encoding: gzip, deflate` - * an array sorted by quality is returned: - * - * ['gzip', 'deflate'] - * - * @param {String|Array} encodings... - * @return {String|Array} - * @public - */ - -Accepts.prototype.encoding = -Accepts.prototype.encodings = function (encodings_) { - var encodings = encodings_ - - // support flattened arguments - if (encodings && !Array.isArray(encodings)) { - encodings = new Array(arguments.length) - for (var i = 0; i < encodings.length; i++) { - encodings[i] = arguments[i] - } - } - - // no encodings, return all requested encodings - if (!encodings || encodings.length === 0) { - return this.negotiator.encodings() - } - - return this.negotiator.encodings(encodings)[0] || false -} - -/** - * Return accepted charsets or best fit based on `charsets`. - * - * Given `Accept-Charset: utf-8, iso-8859-1;q=0.2, utf-7;q=0.5` - * an array sorted by quality is returned: - * - * ['utf-8', 'utf-7', 'iso-8859-1'] - * - * @param {String|Array} charsets... - * @return {String|Array} - * @public - */ - -Accepts.prototype.charset = -Accepts.prototype.charsets = function (charsets_) { - var charsets = charsets_ - - // support flattened arguments - if (charsets && !Array.isArray(charsets)) { - charsets = new Array(arguments.length) - for (var i = 0; i < charsets.length; i++) { - charsets[i] = arguments[i] - } - } - - // no charsets, return all requested charsets - if (!charsets || charsets.length === 0) { - return this.negotiator.charsets() - } - - return this.negotiator.charsets(charsets)[0] || false -} - -/** - * Return accepted languages or best fit based on `langs`. - * - * Given `Accept-Language: en;q=0.8, es, pt` - * an array sorted by quality is returned: - * - * ['es', 'pt', 'en'] - * - * @param {String|Array} langs... - * @return {Array|String} - * @public - */ - -Accepts.prototype.lang = -Accepts.prototype.langs = -Accepts.prototype.language = -Accepts.prototype.languages = function (languages_) { - var languages = languages_ - - // support flattened arguments - if (languages && !Array.isArray(languages)) { - languages = new Array(arguments.length) - for (var i = 0; i < languages.length; i++) { - languages[i] = arguments[i] - } - } - - // no languages, return all requested languages - if (!languages || languages.length === 0) { - return this.negotiator.languages() - } - - return this.negotiator.languages(languages)[0] || false -} - -/** - * Convert extnames to mime. - * - * @param {String} type - * @return {String} - * @private - */ - -function extToMime(type) { - return type.indexOf('/') === -1 - ? mime.lookup(type) - : type -} - -/** - * Check if mime is valid. - * - * @param {String} type - * @return {String} - * @private - */ - -function validMime(type) { - return typeof type === 'string'; -} diff --git a/src/node_modules/accepts/package.json b/src/node_modules/accepts/package.json deleted file mode 100644 index d1f65fd..0000000 --- a/src/node_modules/accepts/package.json +++ /dev/null @@ -1,123 +0,0 @@ -{ - "_args": [ - [ - "accepts@~1.2.13", - "/media/Github/Vertinext2/src/node_modules/serve-index" - ] - ], - "_from": "accepts@>=1.2.13 <1.3.0", - "_id": "accepts@1.2.13", - "_inCache": true, - "_installable": true, - "_location": "/accepts", - "_npmUser": { - "email": "doug@somethingdoug.com", - "name": "dougwilson" - }, - "_npmVersion": "1.4.28", - "_phantomChildren": {}, - "_requested": { - "name": "accepts", - "raw": "accepts@~1.2.13", - "rawSpec": "~1.2.13", - "scope": null, - "spec": ">=1.2.13 <1.3.0", - "type": "range" - }, - "_requiredBy": [ - "/serve-index" - ], - "_resolved": "https://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz", - "_shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea", - "_shrinkwrap": null, - "_spec": "accepts@~1.2.13", - "_where": "/media/Github/Vertinext2/src/node_modules/serve-index", - "bugs": { - "url": "https://github.com/jshttp/accepts/issues" - }, - "contributors": [ - { - "email": "doug@somethingdoug.com", - "name": "Douglas Christopher Wilson" - }, - { - "email": "me@jongleberry.com", - "name": "Jonathan Ong", - "url": "http://jongleberry.com" - } - ], - "dependencies": { - "mime-types": "~2.1.6", - "negotiator": "0.5.3" - }, - "description": "Higher-level content negotiation", - "devDependencies": { - "istanbul": "0.3.19", - "mocha": "~1.21.5" - }, - "directories": {}, - "dist": { - "shasum": "e5f1f3928c6d95fd96558c36ec3d9d0de4a6ecea", - "tarball": "http://registry.npmjs.org/accepts/-/accepts-1.2.13.tgz" - }, - "engines": { - "node": ">= 0.6" - }, - "files": [ - "LICENSE", - "HISTORY.md", - "index.js" - ], - "gitHead": "b7e15ecb25dacc0b2133ed0553d64f8a79537e01", - "homepage": "https://github.com/jshttp/accepts", - "keywords": [ - "content", - "negotiation", - "accept", - "accepts" - ], - "license": "MIT", - "maintainers": [ - { - "email": "jonathanrichardong@gmail.com", - "name": "jongleberry" - }, - { - "email": "federomero@gmail.com", - "name": "federomero" - }, - { - "email": "doug@somethingdoug.com", - "name": "dougwilson" - }, - { - "email": "fishrock123@rocketmail.com", - "name": "fishrock123" - }, - { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" - }, - { - "email": "mscdex@mscdex.net", - "name": "mscdex" - }, - { - "email": "shtylman@gmail.com", - "name": "defunctzombie" - } - ], - "name": "accepts", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/jshttp/accepts.git" - }, - "scripts": { - "test": "mocha --reporter spec --check-leaks --bail test/", - "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot --check-leaks test/", - "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/" - }, - "version": "1.2.13" -} diff --git a/src/node_modules/acorn/.editorconfig b/src/node_modules/acorn/.editorconfig deleted file mode 100644 index c14d5c6..0000000 --- a/src/node_modules/acorn/.editorconfig +++ /dev/null @@ -1,7 +0,0 @@ -root = true - -[*] -indent_style = space -indent_size = 2 -end_of_line = lf -insert_final_newline = true diff --git a/src/node_modules/acorn/.gitattributes b/src/node_modules/acorn/.gitattributes deleted file mode 100644 index fcadb2c..0000000 --- a/src/node_modules/acorn/.gitattributes +++ /dev/null @@ -1 +0,0 @@ -* text eol=lf diff --git a/src/node_modules/acorn/.npmignore b/src/node_modules/acorn/.npmignore deleted file mode 100644 index ecba291..0000000 --- a/src/node_modules/acorn/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -/.tern-port -/test -/local diff --git a/src/node_modules/acorn/.tern-project b/src/node_modules/acorn/.tern-project deleted file mode 100644 index 9e26dfe..0000000 --- a/src/node_modules/acorn/.tern-project +++ /dev/null @@ -1 +0,0 @@ -{} \ No newline at end of file diff --git a/src/node_modules/acorn/.travis.yml b/src/node_modules/acorn/.travis.yml deleted file mode 100644 index ffb9f71..0000000 --- a/src/node_modules/acorn/.travis.yml +++ /dev/null @@ -1,2 +0,0 @@ -language: node_js -node_js: '0.10' diff --git a/src/node_modules/acorn/AUTHORS b/src/node_modules/acorn/AUTHORS deleted file mode 100644 index 0fb284b..0000000 --- a/src/node_modules/acorn/AUTHORS +++ /dev/null @@ -1,38 +0,0 @@ -List of Acorn contributors. Updated before every release. - -Adrian Rakovsky -Alistair Braidwood -Andres Suarez -Aparajita Fishman -Arian Stolwijk -Artem Govorov -Brandon Mills -Charles Hughes -Conrad Irwin -David Bonnet -Forbes Lindesay -Gilad Peleg -impinball -Ingvar Stepanyan -Jiaxing Wang -Johannes Herr -Jürg Lehni -keeyipchan -krator -Marijn Haverbeke -Martin Carlberg -Mathias Bynens -Mathieu 'p01' Henri -Max Schaefer -Max Zerzouri -Mihai Bazon -Mike Rennie -Nick Fitzgerald -Oskar Schöldström -Paul Harper -Peter Rust -PlNG -r-e-d -Rich Harris -Sebastian McKenzie -zsjforcn diff --git a/src/node_modules/acorn/LICENSE b/src/node_modules/acorn/LICENSE deleted file mode 100644 index d4c7fc5..0000000 --- a/src/node_modules/acorn/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (C) 2012-2014 by various contributors (see AUTHORS) - -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/src/node_modules/acorn/README.md b/src/node_modules/acorn/README.md deleted file mode 100644 index ec22d52..0000000 --- a/src/node_modules/acorn/README.md +++ /dev/null @@ -1,377 +0,0 @@ -# Acorn - -[![Build Status](https://travis-ci.org/marijnh/acorn.svg?branch=master)](https://travis-ci.org/marijnh/acorn) -[![NPM version](https://img.shields.io/npm/v/acorn.svg)](https://www.npmjs.org/package/acorn) -[Author funding status: ![maintainer happiness](https://marijnhaverbeke.nl/fund/status_s.png?force)](https://marijnhaverbeke.nl/fund/) - -A tiny, fast JavaScript parser, written completely in JavaScript. - -## Installation - -The easiest way to install acorn is with [`npm`][npm]. - -[npm]: http://npmjs.org - -```sh -npm install acorn -``` - -Alternately, download the source. - -```sh -git clone https://github.com/marijnh/acorn.git -``` - -## Components - -When run in a CommonJS (node.js) or AMD environment, exported values -appear in the interfaces exposed by the individual files, as usual. -When loaded in the browser (Acorn works in any JS-enabled browser more -recent than IE5) without any kind of module management, a single -global object `acorn` will be defined, and all the exported properties -will be added to that. - -### Main parser - -This is implemented in `dist/acorn.js`, and is what you get when you -`require("acorn")` in node.js. - -**parse**`(input, options)` is used to parse a JavaScript program. -The `input` parameter is a string, `options` can be undefined or an -object setting some of the options listed below. The return value will -be an abstract syntax tree object as specified by the -[Mozilla Parser API][mozapi]. - -When encountering a syntax error, the parser will raise a -`SyntaxError` object with a meaningful message. The error object will -have a `pos` property that indicates the character offset at which the -error occurred, and a `loc` object that contains a `{line, column}` -object referring to that same position. - -[mozapi]: https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API - -- **ecmaVersion**: Indicates the ECMAScript version to parse. Must be - either 3, 5, or 6. This influences support for strict mode, the set - of reserved words, and support for new syntax features. Default is 5. - -- **sourceType**: Indicate the mode the code should be parsed in. Can be - either `"script"` or `"module"`. - -- **onInsertedSemicolon**: If given a callback, that callback will be - called whenever a missing semicolon is inserted by the parser. The - callback will be given the character offset of the point where the - semicolon is inserted as argument, and if `locations` is on, also a - `{line, column}` object representing this position. - -- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing - commas. - -- **allowReserved**: If `false`, using a reserved word will generate - an error. Defaults to `true`. When given the value `"never"`, - reserved words and keywords can also not be used as property names - (as in Internet Explorer's old parser). - -- **allowReturnOutsideFunction**: By default, a return statement at - the top level raises an error. Set this to `true` to accept such - code. - -- **allowImportExportEverywhere**: By default, `import` and `export` - declarations can only appear at a program's top level. Setting this - option to `true` allows them anywhere where a statement is allowed. - -- **allowHashBang**: When this is enabled (off by default), if the - code starts with the characters `#!` (as in a shellscript), the - first line will be treated as a comment. - -- **locations**: When `true`, each node has a `loc` object attached - with `start` and `end` subobjects, each of which contains the - one-based line and zero-based column numbers in `{line, column}` - form. Default is `false`. - -- **onToken**: If a function is passed for this option, each found - token will be passed in same format as `tokenize()` returns. - - If array is passed, each found token is pushed to it. - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **onComment**: If a function is passed for this option, whenever a - comment is encountered the function will be called with the - following parameters: - - - `block`: `true` if the comment is a block comment, false if it - is a line comment. - - `text`: The content of the comment. - - `start`: Character offset of the start of the comment. - - `end`: Character offset of the end of the comment. - - When the `locations` options is on, the `{line, column}` locations - of the comment’s start and end are passed as two additional - parameters. - - If array is passed for this option, each found comment is pushed - to it as object in Esprima format: - - ```javascript - { - "type": "Line" | "Block", - "value": "comment text", - "range": ..., - "loc": ... - } - ``` - - Note that you are not allowed to call the parser from the - callback—that will corrupt its internal state. - -- **ranges**: Nodes have their start and end characters offsets - recorded in `start` and `end` properties (directly on the node, - rather than the `loc` object, which holds line/column data. To also - add a [semi-standardized][range] "range" property holding a - `[start, end]` array with the same numbers, set the `ranges` option - to `true`. - -- **program**: It is possible to parse multiple files into a single - AST by passing the tree produced by parsing the first file as the - `program` option in subsequent parses. This will add the toplevel - forms of the parsed file to the "Program" (top) node of an existing - parse tree. - -- **sourceFile**: When the `locations` option is `true`, you can pass - this option to add a `source` attribute in every node’s `loc` - object. Note that the contents of this option are not examined or - processed in any way; you are free to use whatever format you - choose. - -- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property - will be added directly to the nodes, rather than the `loc` object. - -- **preserveParens**: If this option is `true`, parenthesized expressions - are represented by (non-standard) `ParenthesizedExpression` nodes - that have a single `expression` property containing the expression - inside parentheses. - -[range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - -**parseExpressionAt**`(input, offset, options)` will parse a single -expression in a string, and return its AST. It will not complain if -there is more of the string left after the expression. - -**getLineInfo**`(input, offset)` can be used to get a `{line, -column}` object for a given program string and character offset. - -**tokenizer**`(input, options)` returns an object with a `getToken` -method that can be called repeatedly to get the next token, a `{start, -end, type, value}` object (with added `loc` property when the -`locations` option is enabled and `range` property when the `ranges` -option is enabled). When the token's type is `tokTypes.eof`, you -should stop calling the method, since it will keep returning that same -token forever. - -In ES6 environment, returned result can be used as any other -protocol-compliant iterable: - -```javascript -for (let token of acorn.tokenize(str)) { - // iterate over the tokens -} - -// transform code to array of tokens: -var tokens = [...acorn.tokenize(str)]; -``` - -**tokTypes** holds an object mapping names to the token type objects -that end up in the `type` properties of tokens. - -#### Note on using with [Escodegen][escodegen] - -Escodegen supports generating comments from AST, attached in -Esprima-specific format. In order to simulate same format in -Acorn, consider following example: - -```javascript -var comments = [], tokens = []; - -var ast = acorn.parse('var x = 42; // answer', { - // collect ranges for each node - ranges: true, - // collect comments in Esprima's format - onComment: comments, - // collect token ranges - onToken: tokens -}); - -// attach comments using collected information -escodegen.attachComments(ast, comments, tokens); - -// generate code -console.log(escodegen.generate(ast, {comment: true})); -// > 'var x = 42; // answer' -``` - -[escodegen]: https://github.com/Constellation/escodegen - -#### Using Acorn in an environment with a Content Security Policy - -Some contexts, such as Chrome Web Apps, disallow run-time code evaluation. -Acorn uses `new Function` to generate fast functions that test whether -a word is in a given set, and will trigger a security error when used -in a context with such a -[Content Security Policy](http://www.html5rocks.com/en/tutorials/security/content-security-policy/#eval-too) -(see [#90](https://github.com/marijnh/acorn/issues/90) and -[#123](https://github.com/marijnh/acorn/issues/123)). - -The `dist/acorn_csp.js` file in the distribution (which is built -by the `bin/without_eval` script) has the generated code inlined, and -can thus run without evaluating anything. - -### dist/acorn_loose.js ### - -This file implements an error-tolerant parser. It exposes a single -function. - -**parse_dammit**`(input, options)` takes the same arguments and -returns the same syntax tree as the `parse` function in `acorn.js`, -but never raises an error, and will do its best to parse syntactically -invalid code in as meaningful a way as it can. It'll insert identifier -nodes with name `"✖"` as placeholders in places where it can't make -sense of the input. Depends on `acorn.js`, because it uses the same -tokenizer. - -### dist/walk.js ### - -Implements an abstract syntax tree walker. Will store its interface in -`acorn.walk` when loaded without a module system. - -**simple**`(node, visitors, base, state)` does a 'simple' walk over -a tree. `node` should be the AST node to walk, and `visitors` an -object with properties whose names correspond to node types in the -[Mozilla Parser API][mozapi]. The properties should contain functions -that will be called with the node object and, if applicable the state -at that point. The last two arguments are optional. `base` is a walker -algorithm, and `state` is a start state. The default walker will -simply visit all statements and expressions and not produce a -meaningful state. (An example of a use of state it to track scope at -each point in the tree.) - -**ancestor**`(node, visitors, base, state)` does a 'simple' walk over -a tree, building up an array of ancestor nodes (including the current node) -and passing the array to callbacks in the `state` parameter. - -**recursive**`(node, state, functions, base)` does a 'recursive' -walk, where the walker functions are responsible for continuing the -walk on the child nodes of their target node. `state` is the start -state, and `functions` should contain an object that maps node types -to walker functions. Such functions are called with `(node, state, c)` -arguments, and can cause the walk to continue on a sub-node by calling -the `c` argument on it with `(node, state)` arguments. The optional -`base` argument provides the fallback walker functions for node types -that aren't handled in the `functions` object. If not given, the -default walkers will be used. - -**make**`(functions, base)` builds a new walker object by using the -walker functions in `functions` and filling in the missing ones by -taking defaults from `base`. - -**findNodeAt**`(node, start, end, test, base, state)` tries to -locate a node in a tree at the given start and/or end offsets, which -satisfies the predicate `test`. `start` end `end` can be either `null` -(as wildcard) or a number. `test` may be a string (indicating a node -type) or a function that takes `(nodeType, node)` arguments and -returns a boolean indicating whether this node is interesting. `base` -and `state` are optional, and can be used to specify a custom walker. -Nodes are tested from inner to outer, so if two nodes match the -boundaries, the inner one will be preferred. - -**findNodeAround**`(node, pos, test, base, state)` is a lot like -`findNodeAt`, but will match any node that exists 'around' (spanning) -the given position. - -**findNodeAfter**`(node, pos, test, base, state)` is similar to -`findNodeAround`, but will match all nodes *after* the given position -(testing outer nodes before inner nodes). - -## Command line interface - -The `bin/acorn` utility can be used to parse a file from the command -line. It accepts as arguments its input file and the following -options: - -- `--ecma3|--ecma5|--ecma6`: Sets the ECMAScript version to parse. Default is - version 5. - -- `--locations`: Attaches a "loc" object to each node with "start" and - "end" subobjects, each of which contains the one-based line and - zero-based column numbers in `{line, column}` form. - -- `--allow-hash-bang`: If the code starts with the characters #! (as in a shellscript), the first line will be treated as a comment. - -- `--compact`: No whitespace is used in the AST output. - -- `--silent`: Do not output the AST, just return the exit status. - -- `--help`: Print the usage information and quit. - -The utility spits out the syntax tree as JSON data. - -## Build system - -Acorn is written in ECMAScript 6, as a set of small modules, in the -project's `src` directory, and compiled down to bigger ECMAScript 3 -files in `dist` using [Browserify](http://browserify.org) and -[Babel](http://babeljs.io/). If you are already using Babel, you can -consider including the modules directly. - -The command-line test runner (`npm test`) uses the ES6 modules. The -browser-based test page (`test/index.html`) uses the compiled modules. -The `bin/build-acorn.js` script builds the latter from the former. - -If you are working on Acorn, you'll probably want to try the code out -directly, without an intermediate build step. In your scripts, you can -register the Babel require shim like this: - - require("babelify/node_modules/babel-core/register") - -That will allow you to directly `require` the ES6 modules. - -## Plugins - -Acorn is designed support allow plugins which, within reasonable -bounds, redefine the way the parser works. Plugins can add new token -types and new tokenizer contexts (if necessary), and extend methods in -the parser object. This is not a clean, elegant API—using it requires -an understanding of Acorn's internals, and plugins are likely to break -whenever those internals are significantly changed. But still, it is -_possible_, in this way, to create parsers for JavaScript dialects -without forking all of Acorn. And in principle it is even possible to -combine such plugins, so that if you have, for example, a plugin for -parsing types and a plugin for parsing JSX-style XML literals, you -could load them both and parse code with both JSX tags and types. - -A plugin should register itself by adding a property to -`acorn.plugins`, which holds a function. Calling `acorn.parse`, a -`plugin` option can be passed, holding an object mapping plugin names -to configuration values (or just `true` for plugins that don't take -options). After the parser object has been created, the initialization -functions for the chosen plugins are called with `(parser, -configValue)` arguments. They are expected to use the `parser.extend` -method to extend parser methods. For example, the `readToken` method -could be extended like this: - -```javascript -parser.extend("readToken", function(nextMethod) { - return function(code) { - console.log("Reading a token!") - return nextMethod.call(this, code) - } -}) -``` - -The `nextMethod` argument passed to `extend`'s second argument is the -previous value of this method, and should usually be called through to -whenever the extended method does not handle the call itself. - -There is a proof-of-concept JSX plugin in the [`jsx` -branch](https://github.com/marijnh/acorn/tree/jsx) branch of the -Github repository. diff --git a/src/node_modules/acorn/bin/acorn b/src/node_modules/acorn/bin/acorn deleted file mode 100755 index 76d8178..0000000 --- a/src/node_modules/acorn/bin/acorn +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env node - -var path = require("path"); -var fs = require("fs"); -var acorn = require("../dist/acorn.js"); - -var infile, parsed, tokens, options = {}, silent = false, compact = false, tokenize = false; - -function help(status) { - var print = (status == 0) ? console.log : console.error; - print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6]"); - print(" [--tokenize] [--locations] [---allow-hash-bang] [--compact] [--silent] [--help] [--] infile"); - process.exit(status); -} - -for (var i = 2; i < process.argv.length; ++i) { - var arg = process.argv[i]; - if (arg[0] != "-" && !infile) infile = arg; - else if (arg == "--" && !infile && i + 2 == process.argv.length) infile = process.argv[++i]; - else if (arg == "--ecma3") options.ecmaVersion = 3; - else if (arg == "--ecma5") options.ecmaVersion = 5; - else if (arg == "--ecma6") options.ecmaVersion = 6; - else if (arg == "--ecma7") options.ecmaVersion = 7; - else if (arg == "--locations") options.locations = true; - else if (arg == "--allow-hash-bang") options.allowHashBang = true; - else if (arg == "--silent") silent = true; - else if (arg == "--compact") compact = true; - else if (arg == "--help") help(0); - else if (arg == "--tokenize") tokenize = true; - else help(1); -} - -try { - var code = fs.readFileSync(infile, "utf8"); - - if (!tokenize) - parsed = acorn.parse(code, options); - else { - var get = acorn.tokenize(code, options); - tokens = []; - while (true) { - var token = get(); - tokens.push(token); - if (token.type.type == "eof") - break; - } - } -} catch(e) { - console.log(e.message); - process.exit(1); -} - -if (!silent) - console.log(JSON.stringify(tokenize ? tokens : parsed, null, compact ? null : 2)); diff --git a/src/node_modules/acorn/bin/build-acorn.js b/src/node_modules/acorn/bin/build-acorn.js deleted file mode 100644 index a97b757..0000000 --- a/src/node_modules/acorn/bin/build-acorn.js +++ /dev/null @@ -1,51 +0,0 @@ -var fs = require("fs"), path = require("path") -var stream = require("stream") - -var browserify = require("browserify") -var babelify = require("babelify").configure({loose: "all"}) - -process.chdir(path.resolve(__dirname, "..")) - -browserify({standalone: "acorn"}) - .plugin(require('browserify-derequire')) - .transform(babelify) - .require("./src/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(fs.createWriteStream("dist/acorn.js")) - -function acornShim(file) { - var tr = new stream.Transform - if (file == path.resolve(__dirname, "../src/index.js")) { - var sent = false - tr._transform = function(chunk, _, callback) { - if (!sent) { - sent = true - callback(null, "module.exports = typeof acorn != 'undefined' ? acorn : _dereq_(\"./acorn\")") - } else { - callback() - } - } - } else { - tr._transform = function(chunk, _, callback) { callback(null, chunk) } - } - return tr -} - -browserify({standalone: "acorn.loose"}) - .plugin(require('browserify-derequire')) - .transform(acornShim) - .transform(babelify) - .require("./src/loose/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(fs.createWriteStream("dist/acorn_loose.js")) - -browserify({standalone: "acorn.walk"}) - .plugin(require('browserify-derequire')) - .transform(acornShim) - .transform(babelify) - .require("./src/walk/index.js", {entry: true}) - .bundle() - .on("error", function (err) { console.log("Error: " + err.message) }) - .pipe(fs.createWriteStream("dist/walk.js")) diff --git a/src/node_modules/acorn/bin/generate-identifier-regex.js b/src/node_modules/acorn/bin/generate-identifier-regex.js deleted file mode 100644 index 0d7c50f..0000000 --- a/src/node_modules/acorn/bin/generate-identifier-regex.js +++ /dev/null @@ -1,47 +0,0 @@ -// Note: run `npm install unicode-7.0.0` first. - -// Which Unicode version should be used? -var version = '7.0.0'; - -var start = require('unicode-' + version + '/properties/ID_Start/code-points') - .filter(function(ch) { return ch > 127; }); -var cont = [0x200c, 0x200d].concat(require('unicode-' + version + '/properties/ID_Continue/code-points') - .filter(function(ch) { return ch > 127 && start.indexOf(ch) == -1; })); - -function pad(str, width) { - while (str.length < width) str = "0" + str; - return str; -} - -function esc(code) { - var hex = code.toString(16); - if (hex.length <= 2) return "\\x" + pad(hex, 2); - else return "\\u" + pad(hex, 4); -} - -function generate(chars) { - var astral = [], re = ""; - for (var i = 0, at = 0x10000; i < chars.length; i++) { - var from = chars[i], to = from; - while (i < chars.length - 1 && chars[i + 1] == to + 1) { - i++; - to++; - } - if (to <= 0xffff) { - if (from == to) re += esc(from); - else if (from + 1 == to) re += esc(from) + esc(to); - else re += esc(from) + "-" + esc(to); - } else { - astral.push(from - at, to - from); - at = to; - } - } - return {nonASCII: re, astral: astral}; -} - -var startData = generate(start), contData = generate(cont); - -console.log(" var nonASCIIidentifierStartChars = \"" + startData.nonASCII + "\";"); -console.log(" var nonASCIIidentifierChars = \"" + contData.nonASCII + "\";"); -console.log(" var astralIdentifierStartCodes = " + JSON.stringify(startData.astral) + ";"); -console.log(" var astralIdentifierCodes = " + JSON.stringify(contData.astral) + ";"); diff --git a/src/node_modules/acorn/bin/prepublish.sh b/src/node_modules/acorn/bin/prepublish.sh deleted file mode 100755 index 879834d..0000000 --- a/src/node_modules/acorn/bin/prepublish.sh +++ /dev/null @@ -1,2 +0,0 @@ -node bin/build-acorn.js -node bin/without_eval > dist/acorn_csp.js diff --git a/src/node_modules/acorn/bin/update_authors.sh b/src/node_modules/acorn/bin/update_authors.sh deleted file mode 100755 index 466c8db..0000000 --- a/src/node_modules/acorn/bin/update_authors.sh +++ /dev/null @@ -1,6 +0,0 @@ -# Combine existing list of authors with everyone known in git, sort, add header. -tail --lines=+3 AUTHORS > AUTHORS.tmp -git log --format='%aN' | grep -v abraidwood >> AUTHORS.tmp -echo -e "List of Acorn contributors. Updated before every release.\n" > AUTHORS -sort -u AUTHORS.tmp >> AUTHORS -rm -f AUTHORS.tmp diff --git a/src/node_modules/acorn/bin/without_eval b/src/node_modules/acorn/bin/without_eval deleted file mode 100755 index 4331e70..0000000 --- a/src/node_modules/acorn/bin/without_eval +++ /dev/null @@ -1,48 +0,0 @@ -#!/usr/bin/env node - -var fs = require("fs") - -var acornSrc = fs.readFileSync(require.resolve("../dist/acorn"), "utf8") -var acorn = require("../dist/acorn"), walk = require("../dist/walk") - -var ast = acorn.parse(acornSrc) -var touchups = [], uses = [] - -var makePred - -walk.simple(ast, { - FunctionDeclaration: function(node) { - if (node.id.name == "makePredicate") { - makePred = node - touchups.push({text: "// Removed to create an eval-free library", from: node.start, to: node.end}) - } - }, - ObjectExpression: function(node) { - node.properties.forEach(function(prop) { - if (prop.value.type == "CallExpression" && - prop.value.callee.name == "makePredicate") - uses.push(prop.value) - }) - } -}) - -var results = [] -var dryRun = acornSrc.slice(0, makePred.end) + "; makePredicate = (function(mp) {" + - "return function(words) { var r = mp(words); predicates.push(r); return r }})(makePredicate);" + - acornSrc.slice(makePred.end) -;(new Function("predicates", dryRun))(results) - -uses.forEach(function (node, i) { - touchups.push({text: results[i].toString(), from: node.start, to: node.end}) -}) - -var result = "", pos = 0 -touchups.sort(function(a, b) { return a.from - b.from }) -touchups.forEach(function(touchup) { - result += acornSrc.slice(pos, touchup.from) - result += touchup.text - pos = touchup.to -}) -result += acornSrc.slice(pos) - -process.stdout.write(result) diff --git a/src/node_modules/acorn/dist/acorn.js b/src/node_modules/acorn/dist/acorn.js deleted file mode 100644 index 1f1b6f2..0000000 --- a/src/node_modules/acorn/dist/acorn.js +++ /dev/null @@ -1,4014 +0,0 @@ -(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.acorn = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o= len) return x; - switch (x) { - case '%s': return String(args[i++]); - case '%d': return Number(args[i++]); - case '%j': - try { - return JSON.stringify(args[i++]); - } catch (_) { - return '[Circular]'; - } - default: - return x; - } - }); - for (var x = args[i]; i < len; x = args[++i]) { - if (isNull(x) || !isObject(x)) { - str += ' ' + x; - } else { - str += ' ' + inspect(x); - } - } - return str; -}; - - -// Mark that a method should not be used. -// Returns a modified function which warns once by default. -// If --no-deprecation is set, then it is a no-op. -exports.deprecate = function(fn, msg) { - // Allow for deprecating things in the process of starting up. - if (isUndefined(global.process)) { - return function() { - return exports.deprecate(fn, msg).apply(this, arguments); - }; - } - - if (process.noDeprecation === true) { - return fn; - } - - var warned = false; - function deprecated() { - if (!warned) { - if (process.throwDeprecation) { - throw new Error(msg); - } else if (process.traceDeprecation) { - console.trace(msg); - } else { - console.error(msg); - } - warned = true; - } - return fn.apply(this, arguments); - } - - return deprecated; -}; - - -var debugs = {}; -var debugEnviron; -exports.debuglog = function(set) { - if (isUndefined(debugEnviron)) - debugEnviron = process.env.NODE_DEBUG || ''; - set = set.toUpperCase(); - if (!debugs[set]) { - if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { - var pid = process.pid; - debugs[set] = function() { - var msg = exports.format.apply(exports, arguments); - console.error('%s %d: %s', set, pid, msg); - }; - } else { - debugs[set] = function() {}; - } - } - return debugs[set]; -}; - - -/** - * Echos the value of a value. Trys to print the value out - * in the best way possible given the different types. - * - * @param {Object} obj The object to print out. - * @param {Object} opts Optional options object that alters the output. - */ -/* legacy: obj, showHidden, depth, colors*/ -function inspect(obj, opts) { - // default options - var ctx = { - seen: [], - stylize: stylizeNoColor - }; - // legacy... - if (arguments.length >= 3) ctx.depth = arguments[2]; - if (arguments.length >= 4) ctx.colors = arguments[3]; - if (isBoolean(opts)) { - // legacy... - ctx.showHidden = opts; - } else if (opts) { - // got an "options" object - exports._extend(ctx, opts); - } - // set default options - if (isUndefined(ctx.showHidden)) ctx.showHidden = false; - if (isUndefined(ctx.depth)) ctx.depth = 2; - if (isUndefined(ctx.colors)) ctx.colors = false; - if (isUndefined(ctx.customInspect)) ctx.customInspect = true; - if (ctx.colors) ctx.stylize = stylizeWithColor; - return formatValue(ctx, obj, ctx.depth); -} -exports.inspect = inspect; - - -// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics -inspect.colors = { - 'bold' : [1, 22], - 'italic' : [3, 23], - 'underline' : [4, 24], - 'inverse' : [7, 27], - 'white' : [37, 39], - 'grey' : [90, 39], - 'black' : [30, 39], - 'blue' : [34, 39], - 'cyan' : [36, 39], - 'green' : [32, 39], - 'magenta' : [35, 39], - 'red' : [31, 39], - 'yellow' : [33, 39] -}; - -// Don't use 'blue' not visible on cmd.exe -inspect.styles = { - 'special': 'cyan', - 'number': 'yellow', - 'boolean': 'yellow', - 'undefined': 'grey', - 'null': 'bold', - 'string': 'green', - 'date': 'magenta', - // "name": intentionally not styling - 'regexp': 'red' -}; - - -function stylizeWithColor(str, styleType) { - var style = inspect.styles[styleType]; - - if (style) { - return '\u001b[' + inspect.colors[style][0] + 'm' + str + - '\u001b[' + inspect.colors[style][1] + 'm'; - } else { - return str; - } -} - - -function stylizeNoColor(str, styleType) { - return str; -} - - -function arrayToHash(array) { - var hash = {}; - - array.forEach(function(val, idx) { - hash[val] = true; - }); - - return hash; -} - - -function formatValue(ctx, value, recurseTimes) { - // Provide a hook for user-specified inspect functions. - // Check that value is an object with an inspect function on it - if (ctx.customInspect && - value && - isFunction(value.inspect) && - // Filter out the util module, it's inspect function is special - value.inspect !== exports.inspect && - // Also filter out any prototype objects using the circular check. - !(value.constructor && value.constructor.prototype === value)) { - var ret = value.inspect(recurseTimes, ctx); - if (!isString(ret)) { - ret = formatValue(ctx, ret, recurseTimes); - } - return ret; - } - - // Primitive types cannot have properties - var primitive = formatPrimitive(ctx, value); - if (primitive) { - return primitive; - } - - // Look up the keys of the object. - var keys = Object.keys(value); - var visibleKeys = arrayToHash(keys); - - if (ctx.showHidden) { - keys = Object.getOwnPropertyNames(value); - } - - // IE doesn't make error fields non-enumerable - // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx - if (isError(value) - && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) { - return formatError(value); - } - - // Some type of object without properties can be shortcutted. - if (keys.length === 0) { - if (isFunction(value)) { - var name = value.name ? ': ' + value.name : ''; - return ctx.stylize('[Function' + name + ']', 'special'); - } - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } - if (isDate(value)) { - return ctx.stylize(Date.prototype.toString.call(value), 'date'); - } - if (isError(value)) { - return formatError(value); - } - } - - var base = '', array = false, braces = ['{', '}']; - - // Make Array say that they are Array - if (isArray(value)) { - array = true; - braces = ['[', ']']; - } - - // Make functions say that they are functions - if (isFunction(value)) { - var n = value.name ? ': ' + value.name : ''; - base = ' [Function' + n + ']'; - } - - // Make RegExps say that they are RegExps - if (isRegExp(value)) { - base = ' ' + RegExp.prototype.toString.call(value); - } - - // Make dates with properties first say the date - if (isDate(value)) { - base = ' ' + Date.prototype.toUTCString.call(value); - } - - // Make error with message first say the error - if (isError(value)) { - base = ' ' + formatError(value); - } - - if (keys.length === 0 && (!array || value.length == 0)) { - return braces[0] + base + braces[1]; - } - - if (recurseTimes < 0) { - if (isRegExp(value)) { - return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); - } else { - return ctx.stylize('[Object]', 'special'); - } - } - - ctx.seen.push(value); - - var output; - if (array) { - output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); - } else { - output = keys.map(function(key) { - return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); - }); - } - - ctx.seen.pop(); - - return reduceToSingleString(output, base, braces); -} - - -function formatPrimitive(ctx, value) { - if (isUndefined(value)) - return ctx.stylize('undefined', 'undefined'); - if (isString(value)) { - var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') - .replace(/'/g, "\\'") - .replace(/\\"/g, '"') + '\''; - return ctx.stylize(simple, 'string'); - } - if (isNumber(value)) - return ctx.stylize('' + value, 'number'); - if (isBoolean(value)) - return ctx.stylize('' + value, 'boolean'); - // For some reason typeof null is "object", so special case here. - if (isNull(value)) - return ctx.stylize('null', 'null'); -} - - -function formatError(value) { - return '[' + Error.prototype.toString.call(value) + ']'; -} - - -function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { - var output = []; - for (var i = 0, l = value.length; i < l; ++i) { - if (hasOwnProperty(value, String(i))) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - String(i), true)); - } else { - output.push(''); - } - } - keys.forEach(function(key) { - if (!key.match(/^\d+$/)) { - output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, - key, true)); - } - }); - return output; -} - - -function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { - var name, str, desc; - desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; - if (desc.get) { - if (desc.set) { - str = ctx.stylize('[Getter/Setter]', 'special'); - } else { - str = ctx.stylize('[Getter]', 'special'); - } - } else { - if (desc.set) { - str = ctx.stylize('[Setter]', 'special'); - } - } - if (!hasOwnProperty(visibleKeys, key)) { - name = '[' + key + ']'; - } - if (!str) { - if (ctx.seen.indexOf(desc.value) < 0) { - if (isNull(recurseTimes)) { - str = formatValue(ctx, desc.value, null); - } else { - str = formatValue(ctx, desc.value, recurseTimes - 1); - } - if (str.indexOf('\n') > -1) { - if (array) { - str = str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n').substr(2); - } else { - str = '\n' + str.split('\n').map(function(line) { - return ' ' + line; - }).join('\n'); - } - } - } else { - str = ctx.stylize('[Circular]', 'special'); - } - } - if (isUndefined(name)) { - if (array && key.match(/^\d+$/)) { - return str; - } - name = JSON.stringify('' + key); - if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { - name = name.substr(1, name.length - 2); - name = ctx.stylize(name, 'name'); - } else { - name = name.replace(/'/g, "\\'") - .replace(/\\"/g, '"') - .replace(/(^"|"$)/g, "'"); - name = ctx.stylize(name, 'string'); - } - } - - return name + ': ' + str; -} - - -function reduceToSingleString(output, base, braces) { - var numLinesEst = 0; - var length = output.reduce(function(prev, cur) { - numLinesEst++; - if (cur.indexOf('\n') >= 0) numLinesEst++; - return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; - }, 0); - - if (length > 60) { - return braces[0] + - (base === '' ? '' : base + '\n ') + - ' ' + - output.join(',\n ') + - ' ' + - braces[1]; - } - - return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; -} - - -// NOTE: These type checking functions intentionally don't use `instanceof` -// because it is fragile and can be easily faked with `Object.create()`. -function isArray(ar) { - return Array.isArray(ar); -} -exports.isArray = isArray; - -function isBoolean(arg) { - return typeof arg === 'boolean'; -} -exports.isBoolean = isBoolean; - -function isNull(arg) { - return arg === null; -} -exports.isNull = isNull; - -function isNullOrUndefined(arg) { - return arg == null; -} -exports.isNullOrUndefined = isNullOrUndefined; - -function isNumber(arg) { - return typeof arg === 'number'; -} -exports.isNumber = isNumber; - -function isString(arg) { - return typeof arg === 'string'; -} -exports.isString = isString; - -function isSymbol(arg) { - return typeof arg === 'symbol'; -} -exports.isSymbol = isSymbol; - -function isUndefined(arg) { - return arg === void 0; -} -exports.isUndefined = isUndefined; - -function isRegExp(re) { - return isObject(re) && objectToString(re) === '[object RegExp]'; -} -exports.isRegExp = isRegExp; - -function isObject(arg) { - return typeof arg === 'object' && arg !== null; -} -exports.isObject = isObject; - -function isDate(d) { - return isObject(d) && objectToString(d) === '[object Date]'; -} -exports.isDate = isDate; - -function isError(e) { - return isObject(e) && - (objectToString(e) === '[object Error]' || e instanceof Error); -} -exports.isError = isError; - -function isFunction(arg) { - return typeof arg === 'function'; -} -exports.isFunction = isFunction; - -function isPrimitive(arg) { - return arg === null || - typeof arg === 'boolean' || - typeof arg === 'number' || - typeof arg === 'string' || - typeof arg === 'symbol' || // ES6 symbol - typeof arg === 'undefined'; -} -exports.isPrimitive = isPrimitive; - -exports.isBuffer = _dereq_('./support/isBuffer'); - -function objectToString(o) { - return Object.prototype.toString.call(o); -} - - -function pad(n) { - return n < 10 ? '0' + n.toString(10) : n.toString(10); -} - - -var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', - 'Oct', 'Nov', 'Dec']; - -// 26 Feb 16:19:34 -function timestamp() { - var d = new Date(); - var time = [pad(d.getHours()), - pad(d.getMinutes()), - pad(d.getSeconds())].join(':'); - return [d.getDate(), months[d.getMonth()], time].join(' '); -} - - -// log is just a thin wrapper to console.log that prepends a timestamp -exports.log = function() { - console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); -}; - - -/** - * Inherit the prototype methods from one constructor into another. - * - * The Function.prototype.inherits from lang.js rewritten as a standalone - * function (not on Function.prototype). NOTE: If this file is to be loaded - * during bootstrapping this function needs to be rewritten using some native - * functions as prototype setup using normal JavaScript does not work as - * expected during bootstrapping (see mirror.js in r114903). - * - * @param {function} ctor Constructor function which needs to inherit the - * prototype. - * @param {function} superCtor Constructor function to inherit prototype from. - */ -exports.inherits = _dereq_('inherits'); - -exports._extend = function(origin, add) { - // Don't do anything if add isn't an object - if (!add || !isObject(add)) return origin; - - var keys = Object.keys(add); - var i = keys.length; - while (i--) { - origin[keys[i]] = add[keys[i]]; - } - return origin; -}; - -function hasOwnProperty(obj, prop) { - return Object.prototype.hasOwnProperty.call(obj, prop); -} - -}).call(this,_dereq_('_process'),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"./support/isBuffer":4,"_process":3,"inherits":2}],6:[function(_dereq_,module,exports){ -// A recursive descent parser operates by defining functions for all -// syntactic elements, and recursively calling those, each function -// advancing the input stream and returning an AST node. Precedence -// of constructs (for example, the fact that `!x[1]` means `!(x[1])` -// instead of `(!x)[1]` is handled by the fact that the parser -// function that parses unary prefix operators is called first, and -// in turn calls the function that parses `[]` subscripts — that -// way, it'll receive the node for `x[1]` already parsed, and wraps -// *that* in the unary operator node. -// -// Acorn uses an [operator precedence parser][opp] to handle binary -// operator precedence, because it is much more compact than using -// the technique outlined above, which uses different, nesting -// functions to specify precedence, for all of the ten binary -// precedence levels that JavaScript defines. -// -// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - -"use strict"; - -var tt = _dereq_("./tokentype").types; - -var Parser = _dereq_("./state").Parser; - -var reservedWords = _dereq_("./identifier").reservedWords; - -var has = _dereq_("./util").has; - -var pp = Parser.prototype; - -// Check if property name clashes with already added. -// Object/class getters and setters are not allowed to clash — -// either with each other or with an init property — and in -// strict mode, init properties are also not allowed to be repeated. - -pp.checkPropClash = function (prop, propHash) { - if (this.options.ecmaVersion >= 6) return; - var key = prop.key, - name = undefined; - switch (key.type) { - case "Identifier": - name = key.name;break; - case "Literal": - name = String(key.value);break; - default: - return; - } - var kind = prop.kind || "init", - other = undefined; - if (has(propHash, name)) { - other = propHash[name]; - var isGetSet = kind !== "init"; - if ((this.strict || isGetSet) && other[kind] || !(isGetSet ^ other.init)) this.raise(key.start, "Redefinition of property"); - } else { - other = propHash[name] = { - init: false, - get: false, - set: false - }; - } - other[kind] = true; -}; - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function(s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. - -// Parse a full expression. The optional arguments are used to -// forbid the `in` operator (in for loops initalization expressions) -// and provide reference for storing '=' operator inside shorthand -// property assignment in contexts where both object expression -// and object pattern might appear (so it's possible to raise -// delayed syntax error at correct position). - -pp.parseExpression = function (noIn, refShorthandDefaultPos) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); - if (this.type === tt.comma) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(tt.comma)) node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); - return this.finishNode(node, "SequenceExpression"); - } - return expr; -}; - -// Parse an assignment expression. This includes applications of -// operators like `+=`. - -pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse) { - if (this.type == tt._yield && this.inGenerator) return this.parseYield(); - - var failOnShorthandAssign = undefined; - if (!refShorthandDefaultPos) { - refShorthandDefaultPos = { start: 0 }; - failOnShorthandAssign = true; - } else { - failOnShorthandAssign = false; - } - var startPos = this.start, - startLoc = this.startLoc; - if (this.type == tt.parenL || this.type == tt.name) this.potentialArrowAt = this.start; - var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - if (this.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - node.left = this.type === tt.eq ? this.toAssignable(left) : left; - refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly - this.checkLVal(left); - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - return left; -}; - -// Parse a ternary conditional (`?:`) operator. - -pp.parseMaybeConditional = function (noIn, refShorthandDefaultPos) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprOps(noIn, refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - if (this.eat(tt.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(tt.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; -}; - -// Start the precedence parser. - -pp.parseExprOps = function (noIn, refShorthandDefaultPos) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseMaybeUnary(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - return this.parseExprOp(expr, startPos, startLoc, -1, noIn); -}; - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. - -pp.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { - var prec = this.type.binop; - if (Array.isArray(leftStartPos)) { - if (this.options.locations && noIn === undefined) { - // shift arguments to left by one - noIn = minPrec; - minPrec = leftStartLoc; - // flatten leftStartPos - leftStartLoc = leftStartPos[1]; - leftStartPos = leftStartPos[0]; - } - } - if (prec != null && (!noIn || this.type !== tt._in)) { - if (prec > minPrec) { - var node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.value; - var op = this.type; - this.next(); - var startPos = this.start, - startLoc = this.startLoc; - node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, prec, noIn); - this.finishNode(node, op === tt.logicalOR || op === tt.logicalAND ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); - } - } - return left; -}; - -// Parse unary operators, both prefix and postfix. - -pp.parseMaybeUnary = function (refShorthandDefaultPos) { - if (this.type.prefix) { - var node = this.startNode(), - update = this.type === tt.incDec; - node.operator = this.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); - if (update) this.checkLVal(node.argument);else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") this.raise(node.start, "Deleting local variable in strict mode"); - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprSubscripts(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - while (this.type.postfix && !this.canInsertSemicolon()) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - return expr; -}; - -// Parse call, dot, and `[]`-subscript expressions. - -pp.parseExprSubscripts = function (refShorthandDefaultPos) { - var startPos = this.start, - startLoc = this.startLoc; - var expr = this.parseExprAtom(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - return this.parseSubscripts(expr, startPos, startLoc); -}; - -pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { - if (Array.isArray(startPos)) { - if (this.options.locations && noCalls === undefined) { - // shift arguments to left by one - noCalls = startLoc; - // flatten startPos - startLoc = startPos[1]; - startPos = startPos[0]; - } - } - for (;;) { - if (this.eat(tt.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseIdent(true); - node.computed = false; - base = this.finishNode(node, "MemberExpression"); - } else if (this.eat(tt.bracketL)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(tt.bracketR); - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.eat(tt.parenL)) { - var node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseExprList(tt.parenR, false); - base = this.finishNode(node, "CallExpression"); - } else if (this.type === tt.backQuote) { - var node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { - return base; - } - } -}; - -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. - -pp.parseExprAtom = function (refShorthandDefaultPos) { - var node = undefined, - canBeArrow = this.potentialArrowAt == this.start; - switch (this.type) { - case tt._this: - case tt._super: - var type = this.type === tt._this ? "ThisExpression" : "Super"; - node = this.startNode(); - this.next(); - return this.finishNode(node, type); - - case tt._yield: - if (this.inGenerator) this.unexpected(); - - case tt.name: - var startPos = this.start, - startLoc = this.startLoc; - var id = this.parseIdent(this.type !== tt.name); - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id]); - return id; - - case tt.regexp: - var value = this.value; - node = this.parseLiteral(value.value); - node.regex = { pattern: value.pattern, flags: value.flags }; - return node; - - case tt.num:case tt.string: - return this.parseLiteral(this.value); - - case tt._null:case tt._true:case tt._false: - node = this.startNode(); - node.value = this.type === tt._null ? null : this.type === tt._true; - node.raw = this.type.keyword; - this.next(); - return this.finishNode(node, "Literal"); - - case tt.parenL: - return this.parseParenAndDistinguishExpression(canBeArrow); - - case tt.bracketL: - node = this.startNode(); - this.next(); - // check whether this is array comprehension or regular array - if (this.options.ecmaVersion >= 7 && this.type === tt._for) { - return this.parseComprehension(node, false); - } - node.elements = this.parseExprList(tt.bracketR, true, true, refShorthandDefaultPos); - return this.finishNode(node, "ArrayExpression"); - - case tt.braceL: - return this.parseObj(false, refShorthandDefaultPos); - - case tt._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, false); - - case tt._class: - return this.parseClass(this.startNode(), false); - - case tt._new: - return this.parseNew(); - - case tt.backQuote: - return this.parseTemplate(); - - default: - this.unexpected(); - } -}; - -pp.parseLiteral = function (value) { - var node = this.startNode(); - node.value = value; - node.raw = this.input.slice(this.start, this.end); - this.next(); - return this.finishNode(node, "Literal"); -}; - -pp.parseParenExpression = function () { - this.expect(tt.parenL); - var val = this.parseExpression(); - this.expect(tt.parenR); - return val; -}; - -pp.parseParenAndDistinguishExpression = function (canBeArrow) { - var startPos = this.start, - startLoc = this.startLoc, - val = undefined; - if (this.options.ecmaVersion >= 6) { - this.next(); - - if (this.options.ecmaVersion >= 7 && this.type === tt._for) { - return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); - } - - var innerStartPos = this.start, - innerStartLoc = this.startLoc; - var exprList = [], - first = true; - var refShorthandDefaultPos = { start: 0 }, - spreadStart = undefined, - innerParenStart = undefined; - while (this.type !== tt.parenR) { - first ? first = false : this.expect(tt.comma); - if (this.type === tt.ellipsis) { - spreadStart = this.start; - exprList.push(this.parseParenItem(this.parseRest())); - break; - } else { - if (this.type === tt.parenL && !innerParenStart) { - innerParenStart = this.start; - } - exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem)); - } - } - var innerEndPos = this.start, - innerEndLoc = this.startLoc; - this.expect(tt.parenR); - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(tt.arrow)) { - if (innerParenStart) this.unexpected(innerParenStart); - return this.parseParenArrowList(startPos, startLoc, exprList); - } - - if (!exprList.length) this.unexpected(this.lastTokStart); - if (spreadStart) this.unexpected(spreadStart); - if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - } else { - val = this.parseParenExpression(); - } - - if (this.options.preserveParens) { - var par = this.startNodeAt(startPos, startLoc); - par.expression = val; - return this.finishNode(par, "ParenthesizedExpression"); - } else { - return val; - } -}; - -pp.parseParenItem = function (item) { - return item; -}; - -pp.parseParenArrowList = function (startPos, startLoc, exprList) { - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList); -}; - -// New's precedence is slightly tricky. It must allow its argument -// to be a `[]` or dot subscript expression, but not a call — at -// least, not without wrapping it in parentheses. Thus, it uses the - -var empty = []; - -pp.parseNew = function () { - var node = this.startNode(); - var meta = this.parseIdent(true); - if (this.options.ecmaVersion >= 6 && this.eat(tt.dot)) { - node.meta = meta; - node.property = this.parseIdent(true); - if (node.property.name !== "target") this.raise(node.property.start, "The only valid meta property for new is new.target"); - return this.finishNode(node, "MetaProperty"); - } - var startPos = this.start, - startLoc = this.startLoc; - node.callee = this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); - if (this.eat(tt.parenL)) node.arguments = this.parseExprList(tt.parenR, false);else node.arguments = empty; - return this.finishNode(node, "NewExpression"); -}; - -// Parse template expression. - -pp.parseTemplateElement = function () { - var elem = this.startNode(); - elem.value = { - raw: this.input.slice(this.start, this.end), - cooked: this.value - }; - this.next(); - elem.tail = this.type === tt.backQuote; - return this.finishNode(elem, "TemplateElement"); -}; - -pp.parseTemplate = function () { - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement(); - node.quasis = [curElt]; - while (!curElt.tail) { - this.expect(tt.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(tt.braceR); - node.quasis.push(curElt = this.parseTemplateElement()); - } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; - -// Parse an object literal or binding pattern. - -pp.parseObj = function (isPattern, refShorthandDefaultPos) { - var node = this.startNode(), - first = true, - propHash = {}; - node.properties = []; - this.next(); - while (!this.eat(tt.braceR)) { - if (!first) { - this.expect(tt.comma); - if (this.afterTrailingComma(tt.braceR)) break; - } else first = false; - - var prop = this.startNode(), - isGenerator = undefined, - startPos = undefined, - startLoc = undefined; - if (this.options.ecmaVersion >= 6) { - prop.method = false; - prop.shorthand = false; - if (isPattern || refShorthandDefaultPos) { - startPos = this.start; - startLoc = this.startLoc; - } - if (!isPattern) isGenerator = this.eat(tt.star); - } - this.parsePropertyName(prop); - this.parsePropertyValue(prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos); - this.checkPropClash(prop, propHash); - node.properties.push(this.finishNode(prop, "Property")); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; - -pp.parsePropertyValue = function (prop, isPattern, isGenerator, startPos, startLoc, refShorthandDefaultPos) { - if (this.eat(tt.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - prop.kind = "init"; - } else if (this.options.ecmaVersion >= 6 && this.type === tt.parenL) { - if (isPattern) this.unexpected(); - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator); - } else if (this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && (this.type != tt.comma && this.type != tt.braceR)) { - if (isGenerator || isPattern) this.unexpected(); - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") { - prop.kind = "init"; - if (isPattern) { - if (this.isKeyword(prop.key.name) || this.strict && (reservedWords.strictBind(prop.key.name) || reservedWords.strict(prop.key.name)) || !this.options.allowReserved && this.isReservedWord(prop.key.name)) this.raise(prop.key.start, "Binding " + prop.key.name); - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else if (this.type === tt.eq && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) refShorthandDefaultPos.start = this.start; - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key); - } else { - prop.value = prop.key; - } - prop.shorthand = true; - } else this.unexpected(); -}; - -pp.parsePropertyName = function (prop) { - if (this.options.ecmaVersion >= 6) { - if (this.eat(tt.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(tt.bracketR); - return prop.key; - } else { - prop.computed = false; - } - } - return prop.key = this.type === tt.num || this.type === tt.string ? this.parseExprAtom() : this.parseIdent(true); -}; - -// Initialize empty function node. - -pp.initFunction = function (node) { - node.id = null; - if (this.options.ecmaVersion >= 6) { - node.generator = false; - node.expression = false; - } -}; - -// Parse object or class method. - -pp.parseMethod = function (isGenerator) { - var node = this.startNode(); - this.initFunction(node); - this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR, false, false); - var allowExpressionBody = undefined; - if (this.options.ecmaVersion >= 6) { - node.generator = isGenerator; - allowExpressionBody = true; - } else { - allowExpressionBody = false; - } - this.parseFunctionBody(node, allowExpressionBody); - return this.finishNode(node, "FunctionExpression"); -}; - -// Parse arrow function expression with given parameters. - -pp.parseArrowExpression = function (node, params) { - this.initFunction(node); - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true); - return this.finishNode(node, "ArrowFunctionExpression"); -}; - -// Parse function body and check parameters. - -pp.parseFunctionBody = function (node, allowExpression) { - var isExpression = allowExpression && this.type !== tt.braceL; - - if (isExpression) { - node.body = this.parseMaybeAssign(); - node.expression = true; - } else { - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = this.inFunction, - oldInGen = this.inGenerator, - oldLabels = this.labels; - this.inFunction = true;this.inGenerator = node.generator;this.labels = []; - node.body = this.parseBlock(true); - node.expression = false; - this.inFunction = oldInFunc;this.inGenerator = oldInGen;this.labels = oldLabels; - } - - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { - var nameHash = {}, - oldStrict = this.strict; - this.strict = true; - if (node.id) this.checkLVal(node.id, true); - for (var i = 0; i < node.params.length; i++) { - this.checkLVal(node.params[i], true, nameHash); - }this.strict = oldStrict; - } -}; - -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). - -pp.parseExprList = function (close, allowTrailingComma, allowEmpty, refShorthandDefaultPos) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (!first) { - this.expect(tt.comma); - if (allowTrailingComma && this.afterTrailingComma(close)) break; - } else first = false; - - if (allowEmpty && this.type === tt.comma) { - elts.push(null); - } else { - if (this.type === tt.ellipsis) elts.push(this.parseSpread(refShorthandDefaultPos));else elts.push(this.parseMaybeAssign(false, refShorthandDefaultPos)); - } - } - return elts; -}; - -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. - -pp.parseIdent = function (liberal) { - var node = this.startNode(); - if (liberal && this.options.allowReserved == "never") liberal = false; - if (this.type === tt.name) { - if (!liberal && (!this.options.allowReserved && this.isReservedWord(this.value) || this.strict && reservedWords.strict(this.value) && (this.options.ecmaVersion >= 6 || this.input.slice(this.start, this.end).indexOf("\\") == -1))) this.raise(this.start, "The keyword '" + this.value + "' is reserved"); - node.name = this.value; - } else if (liberal && this.type.keyword) { - node.name = this.type.keyword; - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "Identifier"); -}; - -// Parses yield expression inside generator. - -pp.parseYield = function () { - var node = this.startNode(); - this.next(); - if (this.type == tt.semi || this.canInsertSemicolon() || this.type != tt.star && !this.type.startsExpr) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(tt.star); - node.argument = this.parseMaybeAssign(); - } - return this.finishNode(node, "YieldExpression"); -}; - -// Parses array and generator comprehensions. - -pp.parseComprehension = function (node, isGenerator) { - node.blocks = []; - while (this.type === tt._for) { - var block = this.startNode(); - this.next(); - this.expect(tt.parenL); - block.left = this.parseBindingAtom(); - this.checkLVal(block.left, true); - this.expectContextual("of"); - block.right = this.parseExpression(); - this.expect(tt.parenR); - node.blocks.push(this.finishNode(block, "ComprehensionBlock")); - } - node.filter = this.eat(tt._if) ? this.parseParenExpression() : null; - node.body = this.parseExpression(); - this.expect(isGenerator ? tt.parenR : tt.bracketR); - node.generator = isGenerator; - return this.finishNode(node, "ComprehensionExpression"); -}; - -},{"./identifier":7,"./state":13,"./tokentype":17,"./util":18}],7:[function(_dereq_,module,exports){ - - -// Test whether a given character code starts an identifier. - -"use strict"; - -exports.isIdentifierStart = isIdentifierStart; - -// Test whether a given character is part of an identifier. - -exports.isIdentifierChar = isIdentifierChar; -exports.__esModule = true; -// This is a trick taken from Esprima. It turns out that, on -// non-Chrome browsers, to check whether a string is in a set, a -// predicate containing a big ugly `switch` statement is faster than -// a regular expression, and on Chrome the two are about on par. -// This function uses `eval` (non-lexical) to produce such a -// predicate from a space-separated string of words. -// -// It starts by sorting the words by length. - -function makePredicate(words) { - words = words.split(" "); - var f = "", - cats = []; - out: for (var i = 0; i < words.length; ++i) { - for (var j = 0; j < cats.length; ++j) { - if (cats[j][0].length == words[i].length) { - cats[j].push(words[i]); - continue out; - } - }cats.push([words[i]]); - } - function compareTo(arr) { - if (arr.length == 1) { - return f += "return str === " + JSON.stringify(arr[0]) + ";"; - }f += "switch(str){"; - for (var i = 0; i < arr.length; ++i) { - f += "case " + JSON.stringify(arr[i]) + ":"; - }f += "return true}return false;"; - } - - // When there are more than three length categories, an outer - // switch first dispatches on the lengths, to save on comparisons. - - if (cats.length > 3) { - cats.sort(function (a, b) { - return b.length - a.length; - }); - f += "switch(str.length){"; - for (var i = 0; i < cats.length; ++i) { - var cat = cats[i]; - f += "case " + cat[0].length + ":"; - compareTo(cat); - } - f += "}" - - // Otherwise, simply generate a flat `switch` statement. - - ; - } else { - compareTo(words); - } - return new Function("str", f); -} - -// Reserved word lists for various dialects of the language - -var reservedWords = { - 3: makePredicate("abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile"), - 5: makePredicate("class enum extends super const export import"), - 6: makePredicate("enum await"), - strict: makePredicate("implements interface let package private protected public static yield"), - strictBind: makePredicate("eval arguments") -}; - -exports.reservedWords = reservedWords; -// And the keywords - -var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this"; - -var keywords = { - 5: makePredicate(ecma5AndLessKeywords), - 6: makePredicate(ecma5AndLessKeywords + " let const class extends export import yield super") -}; - -exports.keywords = keywords; -// ## Character categories - -// Big ugly regular expressions that match characters in the -// whitespace, identifier, and identifier-start categories. These -// are only applied when a character is found to actually have a -// code point above 128. -// Generated by `tools/generate-identifier-regex.js`. - -var nonASCIIidentifierStartChars = "ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠ-ࢲऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞭꞰꞱꟷ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭟꭤꭥꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ"; -var nonASCIIidentifierChars = "‌‍·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛ࣤ-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ଁ-ଃ଼ା-ୄେୈୋ-୍ୖୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఃా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ഁ-ഃാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ංඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ູົຼ່-ໍ໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜔ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠐-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏ᦰ-ᧀᧈᧉ᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭ᳲ-᳴᳸᳹᷀-᷵᷼-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯꘠-꘩꙯ꙴ-꙽ꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧꢀꢁꢴ-꣄꣐-꣙꣠-꣱꤀-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︭︳︴﹍-﹏0-9_"; - -var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]"); -var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]"); - -nonASCIIidentifierStartChars = nonASCIIidentifierChars = null; - -// These are a run-length and offset encoded representation of the -// >0xffff code points that are a valid part of identifiers. The -// offset starts at 0x10000, and each pair of numbers represents an -// offset to the next range, and then a size of the range. They were -// generated by tools/generate-identifier-regex.js -var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 17, 26, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 99, 39, 9, 51, 157, 310, 10, 21, 11, 7, 153, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 98, 21, 11, 25, 71, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 26, 45, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 955, 52, 76, 44, 33, 24, 27, 35, 42, 34, 4, 0, 13, 47, 15, 3, 22, 0, 38, 17, 2, 24, 133, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 32, 4, 287, 47, 21, 1, 2, 0, 185, 46, 82, 47, 21, 0, 60, 42, 502, 63, 32, 0, 449, 56, 1288, 920, 104, 110, 2962, 1070, 13266, 568, 8, 30, 114, 29, 19, 47, 17, 3, 32, 20, 6, 18, 881, 68, 12, 0, 67, 12, 16481, 1, 3071, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 4149, 196, 1340, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42710, 42, 4148, 12, 221, 16355, 541]; -var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 1306, 2, 54, 14, 32, 9, 16, 3, 46, 10, 54, 9, 7, 2, 37, 13, 2, 9, 52, 0, 13, 2, 49, 13, 16, 9, 83, 11, 168, 11, 6, 9, 8, 2, 57, 0, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 316, 19, 13, 9, 214, 6, 3, 8, 112, 16, 16, 9, 82, 12, 9, 9, 535, 9, 20855, 9, 135, 4, 60, 6, 26, 9, 1016, 45, 17, 3, 19723, 1, 5319, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 4305, 6, 792618, 239]; - -// This has a complexity linear to the value of the code. The -// assumption is that looking up astral identifier characters is -// rare. -function isInAstralSet(code, set) { - var pos = 65536; - for (var i = 0; i < set.length; i += 2) { - pos += set[i]; - if (pos > code) { - return false; - }pos += set[i + 1]; - if (pos >= code) { - return true; - } - } -} -function isIdentifierStart(code, astral) { - if (code < 65) { - return code === 36; - }if (code < 91) { - return true; - }if (code < 97) { - return code === 95; - }if (code < 123) { - return true; - }if (code <= 65535) { - return code >= 170 && nonASCIIidentifierStart.test(String.fromCharCode(code)); - }if (astral === false) { - return false; - }return isInAstralSet(code, astralIdentifierStartCodes); -} - -function isIdentifierChar(code, astral) { - if (code < 48) { - return code === 36; - }if (code < 58) { - return true; - }if (code < 65) { - return false; - }if (code < 91) { - return true; - }if (code < 97) { - return code === 95; - }if (code < 123) { - return true; - }if (code <= 65535) { - return code >= 170 && nonASCIIidentifier.test(String.fromCharCode(code)); - }if (astral === false) { - return false; - }return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes); -} - -},{}],8:[function(_dereq_,module,exports){ -"use strict"; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -// The `getLineInfo` function is mostly useful when the -// `locations` option is off (for performance reasons) and you -// want to find the line/column position for a given character -// offset. `input` should be the code string that the offset refers -// into. - -exports.getLineInfo = getLineInfo; -exports.__esModule = true; - -var Parser = _dereq_("./state").Parser; - -var lineBreakG = _dereq_("./whitespace").lineBreakG; - -var deprecate = _dereq_("util").deprecate; - -// These are used when `options.locations` is on, for the -// `startLoc` and `endLoc` properties. - -var Position = exports.Position = (function () { - function Position(line, col) { - _classCallCheck(this, Position); - - this.line = line; - this.column = col; - } - - Position.prototype.offset = function offset(n) { - return new Position(this.line, this.column + n); - }; - - return Position; -})(); - -var SourceLocation = exports.SourceLocation = function SourceLocation(p, start, end) { - _classCallCheck(this, SourceLocation); - - this.start = start; - this.end = end; - if (p.sourceFile !== null) this.source = p.sourceFile; -}; - -function getLineInfo(input, offset) { - for (var line = 1, cur = 0;;) { - lineBreakG.lastIndex = cur; - var match = lineBreakG.exec(input); - if (match && match.index < offset) { - ++line; - cur = match.index + match[0].length; - } else { - return new Position(line, offset - cur); - } - } -} - -var pp = Parser.prototype; - -// This function is used to raise exceptions on parse errors. It -// takes an offset integer (into the current `input`) to indicate -// the location of the error, attaches the position to the end -// of the error message, and then raises a `SyntaxError` with that -// message. - -pp.raise = function (pos, message) { - var loc = getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos;err.loc = loc;err.raisedAt = this.pos; - throw err; -}; - -pp.curPosition = function () { - return new Position(this.curLine, this.pos - this.lineStart); -}; - -pp.markPosition = function () { - return this.options.locations ? [this.start, this.startLoc] : this.start; -}; - -},{"./state":13,"./whitespace":19,"util":5}],9:[function(_dereq_,module,exports){ -"use strict"; - -var tt = _dereq_("./tokentype").types; - -var Parser = _dereq_("./state").Parser; - -var reservedWords = _dereq_("./identifier").reservedWords; - -var has = _dereq_("./util").has; - -var pp = Parser.prototype; - -// Convert existing expression atom to assignable pattern -// if possible. - -pp.toAssignable = function (node, isBinding) { - if (this.options.ecmaVersion >= 6 && node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - for (var i = 0; i < node.properties.length; i++) { - var prop = node.properties[i]; - if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - this.toAssignable(prop.value, isBinding); - } - break; - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding); - break; - - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - } - break; - - case "ParenthesizedExpression": - node.expression = this.toAssignable(node.expression, isBinding); - break; - - case "MemberExpression": - if (!isBinding) break; - - default: - this.raise(node.start, "Assigning to rvalue"); - } - } - return node; -}; - -// Convert list of expression atoms to binding list. - -pp.toAssignableList = function (exprList, isBinding) { - var end = exprList.length; - if (end) { - var last = exprList[end - 1]; - if (last && last.type == "RestElement") { - --end; - } else if (last && last.type == "SpreadElement") { - last.type = "RestElement"; - var arg = last.argument; - this.toAssignable(arg, isBinding); - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") this.unexpected(arg.start); - --end; - } - } - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) this.toAssignable(elt, isBinding); - } - return exprList; -}; - -// Parses spread element. - -pp.parseSpread = function (refShorthandDefaultPos) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(refShorthandDefaultPos); - return this.finishNode(node, "SpreadElement"); -}; - -pp.parseRest = function () { - var node = this.startNode(); - this.next(); - node.argument = this.type === tt.name || this.type === tt.bracketL ? this.parseBindingAtom() : this.unexpected(); - return this.finishNode(node, "RestElement"); -}; - -// Parses lvalue (assignable) atom. - -pp.parseBindingAtom = function () { - if (this.options.ecmaVersion < 6) return this.parseIdent(); - switch (this.type) { - case tt.name: - return this.parseIdent(); - - case tt.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(tt.bracketR, true, true); - return this.finishNode(node, "ArrayPattern"); - - case tt.braceL: - return this.parseObj(true); - - default: - this.unexpected(); - } -}; - -pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) first = false;else this.expect(tt.comma); - if (allowEmpty && this.type === tt.comma) { - elts.push(null); - } else if (allowTrailingComma && this.afterTrailingComma(close)) { - break; - } else if (this.type === tt.ellipsis) { - var rest = this.parseRest(); - this.parseBindingListItem(rest); - elts.push(rest); - this.expect(close); - break; - } else { - var elem = this.parseMaybeDefault(this.start, this.startLoc); - this.parseBindingListItem(elem); - elts.push(elem); - } - } - return elts; -}; - -pp.parseBindingListItem = function (param) { - return param; -}; - -// Parses assignment pattern around given atom if possible. - -pp.parseMaybeDefault = function (startPos, startLoc, left) { - if (Array.isArray(startPos)) { - if (this.options.locations && noCalls === undefined) { - // shift arguments to left by one - left = startLoc; - // flatten startPos - startLoc = startPos[1]; - startPos = startPos[0]; - } - } - left = left || this.parseBindingAtom(); - if (!this.eat(tt.eq)) return left; - var node = this.startNodeAt(startPos, startLoc); - node.operator = "="; - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern"); -}; - -// Verify that a node is an lval — something that can be assigned -// to. - -pp.checkLVal = function (expr, isBinding, checkClashes) { - switch (expr.type) { - case "Identifier": - if (this.strict && (reservedWords.strictBind(expr.name) || reservedWords.strict(expr.name))) this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); - if (checkClashes) { - if (has(checkClashes, expr.name)) this.raise(expr.start, "Argument name clash in strict mode"); - checkClashes[expr.name] = true; - } - break; - - case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; - - case "ObjectPattern": - for (var i = 0; i < expr.properties.length; i++) { - this.checkLVal(expr.properties[i].value, isBinding, checkClashes); - }break; - - case "ArrayPattern": - for (var i = 0; i < expr.elements.length; i++) { - var elem = expr.elements[i]; - if (elem) this.checkLVal(elem, isBinding, checkClashes); - } - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes); - break; - - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes); - break; - - case "ParenthesizedExpression": - this.checkLVal(expr.expression, isBinding, checkClashes); - break; - - default: - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); - } -}; - -},{"./identifier":7,"./state":13,"./tokentype":17,"./util":18}],10:[function(_dereq_,module,exports){ -"use strict"; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -exports.__esModule = true; - -var Parser = _dereq_("./state").Parser; - -var SourceLocation = _dereq_("./location").SourceLocation; - -// Start an AST node, attaching a start offset. - -var pp = Parser.prototype; - -var Node = exports.Node = function Node() { - _classCallCheck(this, Node); -}; - -pp.startNode = function () { - var node = new Node(); - node.start = this.start; - if (this.options.locations) node.loc = new SourceLocation(this, this.startLoc); - if (this.options.directSourceFile) node.sourceFile = this.options.directSourceFile; - if (this.options.ranges) node.range = [this.start, 0]; - return node; -}; - -pp.startNodeAt = function (pos, loc) { - var node = new Node(); - if (Array.isArray(pos)) { - if (this.options.locations && loc === undefined) { - // flatten pos - loc = pos[1]; - pos = pos[0]; - } - } - node.start = pos; - if (this.options.locations) node.loc = new SourceLocation(this, loc); - if (this.options.directSourceFile) node.sourceFile = this.options.directSourceFile; - if (this.options.ranges) node.range = [pos, 0]; - return node; -}; - -// Finish an AST node, adding `type` and `end` properties. - -pp.finishNode = function (node, type) { - node.type = type; - node.end = this.lastTokEnd; - if (this.options.locations) node.loc.end = this.lastTokEndLoc; - if (this.options.ranges) node.range[1] = this.lastTokEnd; - return node; -}; - -// Finish node at given position - -pp.finishNodeAt = function (node, type, pos, loc) { - node.type = type; - if (Array.isArray(pos)) { - if (this.options.locations && loc === undefined) { - // flatten pos - loc = pos[1]; - pos = pos[0]; - } - } - node.end = pos; - if (this.options.locations) node.loc.end = loc; - if (this.options.ranges) node.range[1] = pos; - return node; -}; - -},{"./location":8,"./state":13}],11:[function(_dereq_,module,exports){ - - -// Interpret and default an options object - -"use strict"; - -exports.getOptions = getOptions; -exports.__esModule = true; - -var _util = _dereq_("./util"); - -var has = _util.has; -var isArray = _util.isArray; - -var SourceLocation = _dereq_("./location").SourceLocation; - -// A second optional argument can be given to further configure -// the parser process. These options are recognized: - -var defaultOptions = { - // `ecmaVersion` indicates the ECMAScript version to parse. Must - // be either 3, or 5, or 6. This influences support for strict - // mode, the set of reserved words, support for getters and - // setters and other features. - ecmaVersion: 5, - // Source type ("script" or "module") for different semantics - sourceType: "script", - // `onInsertedSemicolon` can be a callback that will be called - // when a semicolon is automatically inserted. It will be passed - // th position of the comma as an offset, and if `locations` is - // enabled, it is given the location as a `{line, column}` object - // as second argument. - onInsertedSemicolon: null, - // `onTrailingComma` is similar to `onInsertedSemicolon`, but for - // trailing commas. - onTrailingComma: null, - // By default, reserved words are not enforced. Disable - // `allowReserved` to enforce them. When this option has the - // value "never", reserved words and keywords can also not be - // used as property names. - allowReserved: true, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program. - allowImportExportEverywhere: false, - // When enabled, hashbang directive in the beginning of file - // is allowed and treated as a line comment. - allowHashBang: false, - // When `locations` is on, `loc` properties holding objects with - // `start` and `end` properties in `{line, column}` form (with - // line being 1-based and column 0-based) will be attached to the - // nodes. - locations: false, - // A function can be passed as `onToken` option, which will - // cause Acorn to call that function with object in the same - // format as tokenize() returns. Note that you are not - // allowed to call the parser from the callback—that will - // corrupt its internal state. - onToken: null, - // A function can be passed as `onComment` option, which will - // cause Acorn to call that function with `(block, text, start, - // end)` parameters whenever a comment is skipped. `block` is a - // boolean indicating whether this is a block (`/* */`) comment, - // `text` is the content of the comment, and `start` and `end` are - // character offsets that denote the start and end of the comment. - // When the `locations` option is on, two more parameters are - // passed, the full `{line, column}` locations of the start and - // end of the comments. Note that you are not allowed to call the - // parser from the callback—that will corrupt its internal state. - onComment: null, - // Nodes have their start and end characters offsets recorded in - // `start` and `end` properties (directly on the node, rather than - // the `loc` object, which holds line/column data. To also add a - // [semi-standardized][range] `range` property holding a `[start, - // end]` array with the same numbers, set the `ranges` option to - // `true`. - // - // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678 - ranges: false, - // It is possible to parse multiple files into a single AST by - // passing the tree produced by parsing the first file as - // `program` option in subsequent parses. This will add the - // toplevel forms of the parsed file to the `Program` (top) node - // of an existing parse tree. - program: null, - // When `locations` is on, you can pass this to record the source - // file in every node's `loc` object. - sourceFile: null, - // This value, if given, is stored in every node, whether - // `locations` is on or off. - directSourceFile: null, - // When enabled, parenthesized expressions are represented by - // (non-standard) ParenthesizedExpression nodes - preserveParens: false, - plugins: {} -};exports.defaultOptions = defaultOptions; - -function getOptions(opts) { - var options = {}; - for (var opt in defaultOptions) { - options[opt] = opts && has(opts, opt) ? opts[opt] : defaultOptions[opt]; - }if (isArray(options.onToken)) { - (function () { - var tokens = options.onToken; - options.onToken = function (token) { - return tokens.push(token); - }; - })(); - } - if (isArray(options.onComment)) options.onComment = pushComment(options, options.onComment); - - return options; -} - -function pushComment(options, array) { - return function (block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "Block" : "Line", - value: text, - start: start, - end: end - }; - if (options.locations) comment.loc = new SourceLocation(this, startLoc, endLoc); - if (options.ranges) comment.range = [start, end]; - array.push(comment); - }; -} - -},{"./location":8,"./util":18}],12:[function(_dereq_,module,exports){ -"use strict"; - -var tt = _dereq_("./tokentype").types; - -var Parser = _dereq_("./state").Parser; - -var lineBreak = _dereq_("./whitespace").lineBreak; - -var pp = Parser.prototype; - -// ## Parser utilities - -// Test whether a statement node is the string literal `"use strict"`. - -pp.isUseStrict = function (stmt) { - return this.options.ecmaVersion >= 5 && stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.value === "use strict"; -}; - -// Predicate that tests whether the next token is of the given -// type, and if yes, consumes it as a side effect. - -pp.eat = function (type) { - if (this.type === type) { - this.next(); - return true; - } else { - return false; - } -}; - -// Tests whether parsed token is a contextual keyword. - -pp.isContextual = function (name) { - return this.type === tt.name && this.value === name; -}; - -// Consumes contextual keyword if possible. - -pp.eatContextual = function (name) { - return this.value === name && this.eat(tt.name); -}; - -// Asserts that following token is given contextual keyword. - -pp.expectContextual = function (name) { - if (!this.eatContextual(name)) this.unexpected(); -}; - -// Test whether a semicolon can be inserted at the current position. - -pp.canInsertSemicolon = function () { - return this.type === tt.eof || this.type === tt.braceR || lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); -}; - -pp.insertSemicolon = function () { - if (this.canInsertSemicolon()) { - if (this.options.onInsertedSemicolon) this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); - return true; - } -}; - -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. - -pp.semicolon = function () { - if (!this.eat(tt.semi) && !this.insertSemicolon()) this.unexpected(); -}; - -pp.afterTrailingComma = function (tokType) { - if (this.type == tokType) { - if (this.options.onTrailingComma) this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); - this.next(); - return true; - } -}; - -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error. - -pp.expect = function (type) { - this.eat(type) || this.unexpected(); -}; - -// Raise an unexpected token error. - -pp.unexpected = function (pos) { - this.raise(pos != null ? pos : this.start, "Unexpected token"); -}; - -},{"./state":13,"./tokentype":17,"./whitespace":19}],13:[function(_dereq_,module,exports){ -"use strict"; - -exports.Parser = Parser; -exports.__esModule = true; - -var _identifier = _dereq_("./identifier"); - -var reservedWords = _identifier.reservedWords; -var keywords = _identifier.keywords; - -var tt = _dereq_("./tokentype").types; - -var lineBreak = _dereq_("./whitespace").lineBreak; - -function Parser(options, input, startPos) { - this.options = options; - this.sourceFile = this.options.sourceFile || null; - this.isKeyword = keywords[this.options.ecmaVersion >= 6 ? 6 : 5]; - this.isReservedWord = reservedWords[this.options.ecmaVersion]; - this.input = input; - - // Load plugins - this.loadPlugins(this.options.plugins); - - // Set up token state - - // The current position of the tokenizer in the input. - if (startPos) { - this.pos = startPos; - this.lineStart = Math.max(0, this.input.lastIndexOf("\n", startPos)); - this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; - } else { - this.pos = this.lineStart = 0; - this.curLine = 1; - } - - // Properties of the current token: - // Its type - this.type = tt.eof; - // For tokens that include more information than their type, the value - this.value = null; - // Its start and end offset - this.start = this.end = this.pos; - // And, if locations are used, the {line, column} object - // corresponding to those offsets - this.startLoc = this.endLoc = null; - - // Position information for the previous token - this.lastTokEndLoc = this.lastTokStartLoc = null; - this.lastTokStart = this.lastTokEnd = this.pos; - - // The context stack is used to superficially track syntactic - // context to predict whether a regular expression is allowed in a - // given position. - this.context = this.initialContext(); - this.exprAllowed = true; - - // Figure out if it's a module code. - this.strict = this.inModule = this.options.sourceType === "module"; - - // Used to signify the start of a potential arrow function - this.potentialArrowAt = -1; - - // Flags to track whether we are in a function, a generator. - this.inFunction = this.inGenerator = false; - // Labels in scope. - this.labels = []; - - // If enabled, skip leading hashbang line. - if (this.pos === 0 && this.options.allowHashBang && this.input.slice(0, 2) === "#!") this.skipLineComment(2); -} - -Parser.prototype.extend = function (name, f) { - this[name] = f(this[name]); -}; - -// Registered plugins - -var plugins = {}; - -exports.plugins = plugins; -Parser.prototype.loadPlugins = function (plugins) { - for (var _name in plugins) { - var plugin = exports.plugins[_name]; - if (!plugin) throw new Error("Plugin '" + _name + "' not found"); - plugin(this, plugins[_name]); - } -}; - -},{"./identifier":7,"./tokentype":17,"./whitespace":19}],14:[function(_dereq_,module,exports){ -"use strict"; - -var tt = _dereq_("./tokentype").types; - -var Parser = _dereq_("./state").Parser; - -var lineBreak = _dereq_("./whitespace").lineBreak; - -var pp = Parser.prototype; - -// ### Statement parsing - -// Parse a program. Initializes the parser, reads any number of -// statements, and wraps them in a Program node. Optionally takes a -// `program` argument. If present, the statements will be appended -// to its body instead of creating a new node. - -pp.parseTopLevel = function (node) { - var first = true; - if (!node.body) node.body = []; - while (this.type !== tt.eof) { - var stmt = this.parseStatement(true, true); - node.body.push(stmt); - if (first && this.isUseStrict(stmt)) this.setStrict(true); - first = false; - } - this.next(); - if (this.options.ecmaVersion >= 6) { - node.sourceType = this.options.sourceType; - } - return this.finishNode(node, "Program"); -}; - -var loopLabel = { kind: "loop" }, - switchLabel = { kind: "switch" }; - -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. - -pp.parseStatement = function (declaration, topLevel) { - var starttype = this.type, - node = this.startNode(); - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case tt._break:case tt._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case tt._debugger: - return this.parseDebuggerStatement(node); - case tt._do: - return this.parseDoStatement(node); - case tt._for: - return this.parseForStatement(node); - case tt._function: - if (!declaration && this.options.ecmaVersion >= 6) this.unexpected(); - return this.parseFunctionStatement(node); - case tt._class: - if (!declaration) this.unexpected(); - return this.parseClass(node, true); - case tt._if: - return this.parseIfStatement(node); - case tt._return: - return this.parseReturnStatement(node); - case tt._switch: - return this.parseSwitchStatement(node); - case tt._throw: - return this.parseThrowStatement(node); - case tt._try: - return this.parseTryStatement(node); - case tt._let:case tt._const: - if (!declaration) this.unexpected(); // NOTE: falls through to _var - case tt._var: - return this.parseVarStatement(node, starttype); - case tt._while: - return this.parseWhileStatement(node); - case tt._with: - return this.parseWithStatement(node); - case tt.braceL: - return this.parseBlock(); - case tt.semi: - return this.parseEmptyStatement(node); - case tt._export: - case tt._import: - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) this.raise(this.start, "'import' and 'export' may only appear at the top level"); - if (!this.inModule) this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); - } - return starttype === tt._import ? this.parseImport(node) : this.parseExport(node); - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - var maybeName = this.value, - expr = this.parseExpression(); - if (starttype === tt.name && expr.type === "Identifier" && this.eat(tt.colon)) return this.parseLabeledStatement(node, maybeName, expr);else return this.parseExpressionStatement(node, expr); - } -}; - -pp.parseBreakContinueStatement = function (node, keyword) { - var isBreak = keyword == "break"; - this.next(); - if (this.eat(tt.semi) || this.insertSemicolon()) node.label = null;else if (this.type !== tt.name) this.unexpected();else { - node.label = this.parseIdent(); - this.semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; i < this.labels.length; ++i) { - var lab = this.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - if (i === this.labels.length) this.raise(node.start, "Unsyntactic " + keyword); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); -}; - -pp.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); -}; - -pp.parseDoStatement = function (node) { - this.next(); - this.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.labels.pop(); - this.expect(tt._while); - node.test = this.parseParenExpression(); - if (this.options.ecmaVersion >= 6) this.eat(tt.semi);else this.semicolon(); - return this.finishNode(node, "DoWhileStatement"); -}; - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. - -pp.parseForStatement = function (node) { - this.next(); - this.labels.push(loopLabel); - this.expect(tt.parenL); - if (this.type === tt.semi) return this.parseFor(node, null); - if (this.type === tt._var || this.type === tt._let || this.type === tt._const) { - var _init = this.startNode(), - varKind = this.type; - this.next(); - this.parseVar(_init, true, varKind); - this.finishNode(_init, "VariableDeclaration"); - if ((this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) && _init.declarations.length === 1 && !(varKind !== tt._var && _init.declarations[0].init)) return this.parseForIn(node, _init); - return this.parseFor(node, _init); - } - var refShorthandDefaultPos = { start: 0 }; - var init = this.parseExpression(true, refShorthandDefaultPos); - if (this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual("of")) { - this.toAssignable(init); - this.checkLVal(init); - return this.parseForIn(node, init); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - return this.parseFor(node, init); -}; - -pp.parseFunctionStatement = function (node) { - this.next(); - return this.parseFunction(node, true); -}; - -pp.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement(false); - node.alternate = this.eat(tt._else) ? this.parseStatement(false) : null; - return this.finishNode(node, "IfStatement"); -}; - -pp.parseReturnStatement = function (node) { - if (!this.inFunction && !this.options.allowReturnOutsideFunction) this.raise(this.start, "'return' outside of function"); - this.next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (this.eat(tt.semi) || this.insertSemicolon()) node.argument = null;else { - node.argument = this.parseExpression();this.semicolon(); - } - return this.finishNode(node, "ReturnStatement"); -}; - -pp.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(tt.braceL); - this.labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - for (var cur, sawDefault; this.type != tt.braceR;) { - if (this.type === tt._case || this.type === tt._default) { - var isCase = this.type === tt._case; - if (cur) this.finishNode(cur, "SwitchCase"); - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) this.raise(this.lastTokStart, "Multiple default clauses"); - sawDefault = true; - cur.test = null; - } - this.expect(tt.colon); - } else { - if (!cur) this.unexpected(); - cur.consequent.push(this.parseStatement(true)); - } - } - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); // Closing brace - this.labels.pop(); - return this.finishNode(node, "SwitchStatement"); -}; - -pp.parseThrowStatement = function (node) { - this.next(); - if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) this.raise(this.lastTokEnd, "Illegal newline after throw"); - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); -}; - -// Reused empty array added for node fields that are always empty. - -var empty = []; - -pp.parseTryStatement = function (node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.type === tt._catch) { - var clause = this.startNode(); - this.next(); - this.expect(tt.parenL); - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true); - this.expect(tt.parenR); - clause.guard = null; - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); - } - node.guardedHandlers = empty; - node.finalizer = this.eat(tt._finally) ? this.parseBlock() : null; - if (!node.handler && !node.finalizer) this.raise(node.start, "Missing catch or finally clause"); - return this.finishNode(node, "TryStatement"); -}; - -pp.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); -}; - -pp.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.labels.pop(); - return this.finishNode(node, "WhileStatement"); -}; - -pp.parseWithStatement = function (node) { - if (this.strict) this.raise(this.start, "'with' in strict mode"); - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement(false); - return this.finishNode(node, "WithStatement"); -}; - -pp.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); -}; - -pp.parseLabeledStatement = function (node, maybeName, expr) { - for (var i = 0; i < this.labels.length; ++i) { - if (this.labels[i].name === maybeName) this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - }var kind = this.type.isLoop ? "loop" : this.type === tt._switch ? "switch" : null; - this.labels.push({ name: maybeName, kind: kind }); - node.body = this.parseStatement(true); - this.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); -}; - -pp.parseExpressionStatement = function (node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); -}; - -// Parse a semicolon-enclosed block of statements, handling `"use -// strict"` declarations when `allowStrict` is true (used for -// function bodies). - -pp.parseBlock = function (allowStrict) { - var node = this.startNode(), - first = true, - oldStrict = undefined; - node.body = []; - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - var stmt = this.parseStatement(true); - node.body.push(stmt); - if (first && allowStrict && this.isUseStrict(stmt)) { - oldStrict = this.strict; - this.setStrict(this.strict = true); - } - first = false; - } - if (oldStrict === false) this.setStrict(false); - return this.finishNode(node, "BlockStatement"); -}; - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -pp.parseFor = function (node, init) { - node.init = init; - this.expect(tt.semi); - node.test = this.type === tt.semi ? null : this.parseExpression(); - this.expect(tt.semi); - node.update = this.type === tt.parenR ? null : this.parseExpression(); - this.expect(tt.parenR); - node.body = this.parseStatement(false); - this.labels.pop(); - return this.finishNode(node, "ForStatement"); -}; - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -pp.parseForIn = function (node, init) { - var type = this.type === tt._in ? "ForInStatement" : "ForOfStatement"; - this.next(); - node.left = init; - node.right = this.parseExpression(); - this.expect(tt.parenR); - node.body = this.parseStatement(false); - this.labels.pop(); - return this.finishNode(node, type); -}; - -// Parse a list of variable declarations. - -pp.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind.keyword; - for (;;) { - var decl = this.startNode(); - this.parseVarId(decl); - if (this.eat(tt.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === tt._const && !(this.type === tt._in || this.options.ecmaVersion >= 6 && this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type != "Identifier" && !(isFor && (this.type === tt._in || this.isContextual("of")))) { - this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(tt.comma)) break; - } - return node; -}; - -pp.parseVarId = function (decl) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true); -}; - -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseFunction = function (node, isStatement, allowExpressionBody) { - this.initFunction(node); - if (this.options.ecmaVersion >= 6) node.generator = this.eat(tt.star); - if (isStatement || this.type === tt.name) node.id = this.parseIdent(); - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); -}; - -pp.parseFunctionParams = function (node) { - this.expect(tt.parenL); - node.params = this.parseBindingList(tt.parenR, false, false); -}; - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseClass = function (node, isStatement) { - this.next(); - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - if (this.eat(tt.semi)) continue; - var method = this.startNode(); - var isGenerator = this.eat(tt.star); - var isMaybeStatic = this.type === tt.name && this.value === "static"; - this.parsePropertyName(method); - method["static"] = isMaybeStatic && this.type !== tt.parenL; - if (method["static"]) { - if (isGenerator) this.unexpected(); - isGenerator = this.eat(tt.star); - this.parsePropertyName(method); - } - method.kind = "method"; - if (!method.computed) { - var key = method.key; - - var isGetSet = false; - if (!isGenerator && key.type === "Identifier" && this.type !== tt.parenL && (key.name === "get" || key.name === "set")) { - isGetSet = true; - method.kind = key.name; - key = this.parsePropertyName(method); - } - if (!method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { - if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); - if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); - if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); - method.kind = "constructor"; - hadConstructor = true; - } - } - this.parseClassMethod(classBody, method, isGenerator); - } - node.body = this.finishNode(classBody, "ClassBody"); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; - -pp.parseClassMethod = function (classBody, method, isGenerator) { - method.value = this.parseMethod(isGenerator); - classBody.body.push(this.finishNode(method, "MethodDefinition")); -}; - -pp.parseClassId = function (node, isStatement) { - node.id = this.type === tt.name ? this.parseIdent() : isStatement ? this.unexpected() : null; -}; - -pp.parseClassSuper = function (node) { - node.superClass = this.eat(tt._extends) ? this.parseExprSubscripts() : null; -}; - -// Parses module export declaration. - -pp.parseExport = function (node) { - this.next(); - // export * from '...' - if (this.eat(tt.star)) { - this.expectContextual("from"); - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); - this.semicolon(); - return this.finishNode(node, "ExportAllDeclaration"); - } - if (this.eat(tt._default)) { - // export default ... - var expr = this.parseMaybeAssign(); - var needsSemi = true; - if (expr.type == "FunctionExpression" || expr.type == "ClassExpression") { - needsSemi = false; - if (expr.id) { - expr.type = expr.type == "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; - } - } - node.declaration = expr; - if (needsSemi) this.semicolon(); - return this.finishNode(node, "ExportDefaultDeclaration"); - } - // export var|const|let|function|class ... - if (this.shouldParseExportStatement()) { - node.declaration = this.parseStatement(true); - node.specifiers = []; - node.source = null; - } else { - // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(); - if (this.eatContextual("from")) { - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); - } else { - node.source = null; - } - this.semicolon(); - } - return this.finishNode(node, "ExportNamedDeclaration"); -}; - -pp.shouldParseExportStatement = function () { - return this.type.keyword; -}; - -// Parses a comma-separated list of module exports. - -pp.parseExportSpecifiers = function () { - var nodes = [], - first = true; - // export { x, y as z } [from '...'] - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - if (!first) { - this.expect(tt.comma); - if (this.afterTrailingComma(tt.braceR)) break; - } else first = false; - - var node = this.startNode(); - node.local = this.parseIdent(this.type === tt._default); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local; - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - return nodes; -}; - -// Parses import declaration. - -pp.parseImport = function (node) { - this.next(); - // import '...' - if (this.type === tt.string) { - node.specifiers = empty; - node.source = this.parseExprAtom(); - node.kind = ""; - } else { - node.specifiers = this.parseImportSpecifiers(); - this.expectContextual("from"); - node.source = this.type === tt.string ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); -}; - -// Parses a comma-separated list of module imports. - -pp.parseImportSpecifiers = function () { - var nodes = [], - first = true; - if (this.type === tt.name) { - // import defaultObj, { x, y as z } from '...' - var node = this.startNode(); - node.local = this.parseIdent(); - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportDefaultSpecifier")); - if (!this.eat(tt.comma)) return nodes; - } - if (this.type === tt.star) { - var node = this.startNode(); - this.next(); - this.expectContextual("as"); - node.local = this.parseIdent(); - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportNamespaceSpecifier")); - return nodes; - } - this.expect(tt.braceL); - while (!this.eat(tt.braceR)) { - if (!first) { - this.expect(tt.comma); - if (this.afterTrailingComma(tt.braceR)) break; - } else first = false; - - var node = this.startNode(); - node.imported = this.parseIdent(true); - node.local = this.eatContextual("as") ? this.parseIdent() : node.imported; - this.checkLVal(node.local, true); - nodes.push(this.finishNode(node, "ImportSpecifier")); - } - return nodes; -}; - -},{"./state":13,"./tokentype":17,"./whitespace":19}],15:[function(_dereq_,module,exports){ -"use strict"; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -exports.__esModule = true; -// The algorithm used to determine whether a regexp can appear at a -// given point in the program is loosely based on sweet.js' approach. -// See https://github.com/mozilla/sweet.js/wiki/design - -var Parser = _dereq_("./state").Parser; - -var tt = _dereq_("./tokentype").types; - -var lineBreak = _dereq_("./whitespace").lineBreak; - -var TokContext = exports.TokContext = function TokContext(token, isExpr, preserveSpace, override) { - _classCallCheck(this, TokContext); - - this.token = token; - this.isExpr = isExpr; - this.preserveSpace = preserveSpace; - this.override = override; -}; - -var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", true), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { - return p.readTmplToken(); - }), - f_expr: new TokContext("function", true) -}; - -exports.types = types; -var pp = Parser.prototype; - -pp.initialContext = function () { - return [types.b_stat]; -}; - -pp.braceIsBlock = function (prevType) { - var parent = undefined; - if (prevType === tt.colon && (parent = this.curContext()).token == "{") return !parent.isExpr; - if (prevType === tt._return) return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)); - if (prevType === tt._else || prevType === tt.semi || prevType === tt.eof) return true; - if (prevType == tt.braceL) return this.curContext() === types.b_stat; - return !this.exprAllowed; -}; - -pp.updateContext = function (prevType) { - var update = undefined, - type = this.type; - if (type.keyword && prevType == tt.dot) this.exprAllowed = false;else if (update = type.updateContext) update.call(this, prevType);else this.exprAllowed = type.beforeExpr; -}; - -// Token-specific context update code - -tt.parenR.updateContext = tt.braceR.updateContext = function () { - if (this.context.length == 1) { - this.exprAllowed = true; - return; - } - var out = this.context.pop(); - if (out === types.b_stat && this.curContext() === types.f_expr) { - this.context.pop(); - this.exprAllowed = false; - } else if (out === types.b_tmpl) { - this.exprAllowed = true; - } else { - this.exprAllowed = !out.isExpr; - } -}; - -tt.braceL.updateContext = function (prevType) { - this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.exprAllowed = true; -}; - -tt.dollarBraceL.updateContext = function () { - this.context.push(types.b_tmpl); - this.exprAllowed = true; -}; - -tt.parenL.updateContext = function (prevType) { - var statementParens = prevType === tt._if || prevType === tt._for || prevType === tt._with || prevType === tt._while; - this.context.push(statementParens ? types.p_stat : types.p_expr); - this.exprAllowed = true; -}; - -tt.incDec.updateContext = function () {}; - -tt._function.updateContext = function () { - if (this.curContext() !== types.b_stat) this.context.push(types.f_expr); - this.exprAllowed = false; -}; - -tt.backQuote.updateContext = function () { - if (this.curContext() === types.q_tmpl) this.context.pop();else this.context.push(types.q_tmpl); - this.exprAllowed = false; -}; - -// tokExprAllowed stays unchanged - -},{"./state":13,"./tokentype":17,"./whitespace":19}],16:[function(_dereq_,module,exports){ -"use strict"; - -var _classCallCheck = function (instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }; - -exports.__esModule = true; - -var _identifier = _dereq_("./identifier"); - -var isIdentifierStart = _identifier.isIdentifierStart; -var isIdentifierChar = _identifier.isIdentifierChar; - -var _tokentype = _dereq_("./tokentype"); - -var tt = _tokentype.types; -var keywordTypes = _tokentype.keywords; - -var Parser = _dereq_("./state").Parser; - -var SourceLocation = _dereq_("./location").SourceLocation; - -var _whitespace = _dereq_("./whitespace"); - -var lineBreak = _whitespace.lineBreak; -var lineBreakG = _whitespace.lineBreakG; -var isNewLine = _whitespace.isNewLine; -var nonASCIIwhitespace = _whitespace.nonASCIIwhitespace; - -// Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. - -var Token = exports.Token = function Token(p) { - _classCallCheck(this, Token); - - this.type = p.type; - this.value = p.value; - this.start = p.start; - this.end = p.end; - if (p.options.locations) this.loc = new SourceLocation(p, p.startLoc, p.endLoc); - if (p.options.ranges) this.range = [p.start, p.end]; -}; - -// ## Tokenizer - -var pp = Parser.prototype; - -// Are we running under Rhino? -var isRhino = typeof Packages !== "undefined"; - -// Move to the next token - -pp.next = function () { - if (this.options.onToken) this.options.onToken(new Token(this)); - - this.lastTokEnd = this.end; - this.lastTokStart = this.start; - this.lastTokEndLoc = this.endLoc; - this.lastTokStartLoc = this.startLoc; - this.nextToken(); -}; - -pp.getToken = function () { - this.next(); - return new Token(this); -}; - -// If we're in an ES6 environment, make parsers iterable -if (typeof Symbol !== "undefined") pp[Symbol.iterator] = function () { - var self = this; - return { next: function next() { - var token = self.getToken(); - return { - done: token.type === tt.eof, - value: token - }; - } }; -}; - -// Toggle strict mode. Re-reads the next number or string to please -// pedantic tests (`"use strict"; 010;` should fail). - -pp.setStrict = function (strict) { - this.strict = strict; - if (this.type !== tt.num && this.type !== tt.string) return; - this.pos = this.start; - if (this.options.locations) { - while (this.pos < this.lineStart) { - this.lineStart = this.input.lastIndexOf("\n", this.lineStart - 2) + 1; - --this.curLine; - } - } - this.nextToken(); -}; - -pp.curContext = function () { - return this.context[this.context.length - 1]; -}; - -// Read a single token, updating the parser object's token-related -// properties. - -pp.nextToken = function () { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) this.skipSpace(); - - this.start = this.pos; - if (this.options.locations) this.startLoc = this.curPosition(); - if (this.pos >= this.input.length) return this.finishToken(tt.eof); - - if (curContext.override) return curContext.override(this);else this.readToken(this.fullCharCodeAtPos()); -}; - -pp.readToken = function (code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */) return this.readWord(); - - return this.getTokenFromCode(code); -}; - -pp.fullCharCodeAtPos = function () { - var code = this.input.charCodeAt(this.pos); - if (code <= 55295 || code >= 57344) return code; - var next = this.input.charCodeAt(this.pos + 1); - return (code << 10) + next - 56613888; -}; - -pp.skipBlockComment = function () { - var startLoc = this.options.onComment && this.options.locations && this.curPosition(); - var start = this.pos, - end = this.input.indexOf("*/", this.pos += 2); - if (end === -1) this.raise(this.pos - 2, "Unterminated comment"); - this.pos = end + 2; - if (this.options.locations) { - lineBreakG.lastIndex = start; - var match = undefined; - while ((match = lineBreakG.exec(this.input)) && match.index < this.pos) { - ++this.curLine; - this.lineStart = match.index + match[0].length; - } - } - if (this.options.onComment) this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos, startLoc, this.options.locations && this.curPosition()); -}; - -pp.skipLineComment = function (startSkip) { - var start = this.pos; - var startLoc = this.options.onComment && this.options.locations && this.curPosition(); - var ch = this.input.charCodeAt(this.pos += startSkip); - while (this.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { - ++this.pos; - ch = this.input.charCodeAt(this.pos); - } - if (this.options.onComment) this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos, startLoc, this.options.locations && this.curPosition()); -}; - -// Called at the start of the parse and after every token. Skips -// whitespace and comments, and. - -pp.skipSpace = function () { - while (this.pos < this.input.length) { - var ch = this.input.charCodeAt(this.pos); - if (ch === 32) { - // ' ' - ++this.pos; - } else if (ch === 13) { - ++this.pos; - var next = this.input.charCodeAt(this.pos); - if (next === 10) { - ++this.pos; - } - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - } else if (ch === 10 || ch === 8232 || ch === 8233) { - ++this.pos; - if (this.options.locations) { - ++this.curLine; - this.lineStart = this.pos; - } - } else if (ch > 8 && ch < 14) { - ++this.pos; - } else if (ch === 47) { - // '/' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 42) { - // '*' - this.skipBlockComment(); - } else if (next === 47) { - // '/' - this.skipLineComment(2); - } else break; - } else if (ch === 160) { - // '\xa0' - ++this.pos; - } else if (ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.pos; - } else { - break; - } - } -}; - -// Called at the end of every token. Sets `end`, `val`, and -// maintains `context` and `exprAllowed`, and skips the space after -// the token, so that the next one's `start` will point at the -// right position. - -pp.finishToken = function (type, val) { - this.end = this.pos; - if (this.options.locations) this.endLoc = this.curPosition(); - var prevType = this.type; - this.type = type; - this.value = val; - - this.updateContext(prevType); -}; - -// ### Token reading - -// This is the function that is called to fetch the next token. It -// is somewhat obscure, because it works in character codes rather -// than characters, and because operator parsing has been inlined -// into it. -// -// All in the name of speed. -// -pp.readToken_dot = function () { - var next = this.input.charCodeAt(this.pos + 1); - if (next >= 48 && next <= 57) return this.readNumber(true); - var next2 = this.input.charCodeAt(this.pos + 2); - if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { - // 46 = dot '.' - this.pos += 3; - return this.finishToken(tt.ellipsis); - } else { - ++this.pos; - return this.finishToken(tt.dot); - } -}; - -pp.readToken_slash = function () { - // '/' - var next = this.input.charCodeAt(this.pos + 1); - if (this.exprAllowed) { - ++this.pos;return this.readRegexp(); - } - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(tt.slash, 1); -}; - -pp.readToken_mult_modulo = function (code) { - // '%*' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(code === 42 ? tt.star : tt.modulo, 1); -}; - -pp.readToken_pipe_amp = function (code) { - // '|&' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) return this.finishOp(code === 124 ? tt.logicalOR : tt.logicalAND, 2); - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(code === 124 ? tt.bitwiseOR : tt.bitwiseAND, 1); -}; - -pp.readToken_caret = function () { - // '^' - var next = this.input.charCodeAt(this.pos + 1); - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(tt.bitwiseXOR, 1); -}; - -pp.readToken_plus_min = function (code) { - // '+-' - var next = this.input.charCodeAt(this.pos + 1); - if (next === code) { - if (next == 45 && this.input.charCodeAt(this.pos + 2) == 62 && lineBreak.test(this.input.slice(this.lastTokEnd, this.pos))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(tt.incDec, 2); - } - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(tt.plusMin, 1); -}; - -pp.readToken_lt_gt = function (code) { - // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1); - return this.finishOp(tt.bitShift, size); - } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected(); - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(tt.incDec, 2); - } - if (next === 61) return this.finishOp(tt.assign, 2); - return this.finishOp(tt.plusMin, 1); -}; - -pp.readToken_lt_gt = function (code) { - // '<>' - var next = this.input.charCodeAt(this.pos + 1); - var size = 1; - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1); - return this.finishOp(tt.bitShift, size); - } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected(); - // `` line comment - this.skipLineComment(3) - this.skipSpace() - return this.nextToken() - } - return this.finishOp(tt.incDec, 2) - } - if (next === 61) return this.finishOp(tt.assign, 2) - return this.finishOp(tt.plusMin, 1) -} - -pp.readToken_lt_gt = function(code) { // '<>' - let next = this.input.charCodeAt(this.pos + 1) - let size = 1 - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2 - if (this.input.charCodeAt(this.pos + size) === 61) return this.finishOp(tt.assign, size + 1) - return this.finishOp(tt.bitShift, size) - } - if (next == 33 && code == 60 && this.input.charCodeAt(this.pos + 2) == 45 && - this.input.charCodeAt(this.pos + 3) == 45) { - if (this.inModule) this.unexpected() - // ` regexps - set = set.map(function (s, si, set) { - return s.map(this.parse, this) - }, this) - - this.debug(this.pattern, set) - - // filter out everything that didn't compile properly. - set = set.filter(function (s) { - return s.indexOf(false) === -1 - }) - - this.debug(this.pattern, set) - - this.set = set -} - -Minimatch.prototype.parseNegate = parseNegate -function parseNegate () { - var pattern = this.pattern - var negate = false - var options = this.options - var negateOffset = 0 - - if (options.nonegate) return - - for (var i = 0, l = pattern.length - ; i < l && pattern.charAt(i) === '!' - ; i++) { - negate = !negate - negateOffset++ - } - - if (negateOffset) this.pattern = pattern.substr(negateOffset) - this.negate = negate -} - -// Brace expansion: -// a{b,c}d -> abd acd -// a{b,}c -> abc ac -// a{0..3}d -> a0d a1d a2d a3d -// a{b,c{d,e}f}g -> abg acdfg acefg -// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg -// -// Invalid sets are not expanded. -// a{2..}b -> a{2..}b -// a{b}c -> a{b}c -minimatch.braceExpand = function (pattern, options) { - return braceExpand(pattern, options) -} - -Minimatch.prototype.braceExpand = braceExpand - -function braceExpand (pattern, options) { - if (!options) { - if (this instanceof Minimatch) { - options = this.options - } else { - options = {} - } - } - - pattern = typeof pattern === 'undefined' - ? this.pattern : pattern - - if (typeof pattern === 'undefined') { - throw new Error('undefined pattern') - } - - if (options.nobrace || - !pattern.match(/\{.*\}/)) { - // shortcut. no need to expand. - return [pattern] - } - - return expand(pattern) -} - -// parse a component of the expanded set. -// At this point, no pattern may contain "/" in it -// so we're going to return a 2d array, where each entry is the full -// pattern, split on '/', and then turned into a regular expression. -// A regexp is made at the end which joins each array with an -// escaped /, and another full one which joins each regexp with |. -// -// Following the lead of Bash 4.1, note that "**" only has special meaning -// when it is the *only* thing in a path portion. Otherwise, any series -// of * is equivalent to a single *. Globstar behavior is enabled by -// default, and can be disabled by setting options.noglobstar. -Minimatch.prototype.parse = parse -var SUBPARSE = {} -function parse (pattern, isSub) { - var options = this.options - - // shortcuts - if (!options.noglobstar && pattern === '**') return GLOBSTAR - if (pattern === '') return '' - - var re = '' - var hasMagic = !!options.nocase - var escaping = false - // ? => one single character - var patternListStack = [] - var negativeLists = [] - var plType - var stateChar - var inClass = false - var reClassStart = -1 - var classStart = -1 - // . and .. never match anything that doesn't start with ., - // even when options.dot is set. - var patternStart = pattern.charAt(0) === '.' ? '' // anything - // not (start or / followed by . or .. followed by / or end) - : options.dot ? '(?!(?:^|\\\/)\\.{1,2}(?:$|\\\/))' - : '(?!\\.)' - var self = this - - function clearStateChar () { - if (stateChar) { - // we had some state-tracking character - // that wasn't consumed by this pass. - switch (stateChar) { - case '*': - re += star - hasMagic = true - break - case '?': - re += qmark - hasMagic = true - break - default: - re += '\\' + stateChar - break - } - self.debug('clearStateChar %j %j', stateChar, re) - stateChar = false - } - } - - for (var i = 0, len = pattern.length, c - ; (i < len) && (c = pattern.charAt(i)) - ; i++) { - this.debug('%s\t%s %s %j', pattern, i, re, c) - - // skip over any that are escaped. - if (escaping && reSpecials[c]) { - re += '\\' + c - escaping = false - continue - } - - switch (c) { - case '/': - // completely not allowed, even escaped. - // Should already be path-split by now. - return false - - case '\\': - clearStateChar() - escaping = true - continue - - // the various stateChar values - // for the "extglob" stuff. - case '?': - case '*': - case '+': - case '@': - case '!': - this.debug('%s\t%s %s %j <-- stateChar', pattern, i, re, c) - - // all of those are literals inside a class, except that - // the glob [!a] means [^a] in regexp - if (inClass) { - this.debug(' in class') - if (c === '!' && i === classStart + 1) c = '^' - re += c - continue - } - - // if we already have a stateChar, then it means - // that there was something like ** or +? in there. - // Handle the stateChar, then proceed with this one. - self.debug('call clearStateChar %j', stateChar) - clearStateChar() - stateChar = c - // if extglob is disabled, then +(asdf|foo) isn't a thing. - // just clear the statechar *now*, rather than even diving into - // the patternList stuff. - if (options.noext) clearStateChar() - continue - - case '(': - if (inClass) { - re += '(' - continue - } - - if (!stateChar) { - re += '\\(' - continue - } - - plType = stateChar - patternListStack.push({ - type: plType, - start: i - 1, - reStart: re.length - }) - // negation is (?:(?!js)[^/]*) - re += stateChar === '!' ? '(?:(?!(?:' : '(?:' - this.debug('plType %j %j', stateChar, re) - stateChar = false - continue - - case ')': - if (inClass || !patternListStack.length) { - re += '\\)' - continue - } - - clearStateChar() - hasMagic = true - re += ')' - var pl = patternListStack.pop() - plType = pl.type - // negation is (?:(?!js)[^/]*) - // The others are (?:) - switch (plType) { - case '!': - negativeLists.push(pl) - re += ')[^/]*?)' - pl.reEnd = re.length - break - case '?': - case '+': - case '*': - re += plType - break - case '@': break // the default anyway - } - continue - - case '|': - if (inClass || !patternListStack.length || escaping) { - re += '\\|' - escaping = false - continue - } - - clearStateChar() - re += '|' - continue - - // these are mostly the same in regexp and glob - case '[': - // swallow any state-tracking char before the [ - clearStateChar() - - if (inClass) { - re += '\\' + c - continue - } - - inClass = true - classStart = i - reClassStart = re.length - re += c - continue - - case ']': - // a right bracket shall lose its special - // meaning and represent itself in - // a bracket expression if it occurs - // first in the list. -- POSIX.2 2.8.3.2 - if (i === classStart + 1 || !inClass) { - re += '\\' + c - escaping = false - continue - } - - // handle the case where we left a class open. - // "[z-a]" is valid, equivalent to "\[z-a\]" - if (inClass) { - // split where the last [ was, make sure we don't have - // an invalid re. if so, re-walk the contents of the - // would-be class to re-translate any characters that - // were passed through as-is - // TODO: It would probably be faster to determine this - // without a try/catch and a new RegExp, but it's tricky - // to do safely. For now, this is safe and works. - var cs = pattern.substring(classStart + 1, i) - try { - RegExp('[' + cs + ']') - } catch (er) { - // not a valid class! - var sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] + '\\]' - hasMagic = hasMagic || sp[1] - inClass = false - continue - } - } - - // finish up the class. - hasMagic = true - inClass = false - re += c - continue - - default: - // swallow any state char that wasn't consumed - clearStateChar() - - if (escaping) { - // no need - escaping = false - } else if (reSpecials[c] - && !(c === '^' && inClass)) { - re += '\\' - } - - re += c - - } // switch - } // for - - // handle the case where we left a class open. - // "[abc" is valid, equivalent to "\[abc" - if (inClass) { - // split where the last [ was, and escape it - // this is a huge pita. We now have to re-walk - // the contents of the would-be class to re-translate - // any characters that were passed through as-is - cs = pattern.substr(classStart + 1) - sp = this.parse(cs, SUBPARSE) - re = re.substr(0, reClassStart) + '\\[' + sp[0] - hasMagic = hasMagic || sp[1] - } - - // handle the case where we had a +( thing at the *end* - // of the pattern. - // each pattern list stack adds 3 chars, and we need to go through - // and escape any | chars that were passed through as-is for the regexp. - // Go through and escape them, taking care not to double-escape any - // | chars that were already escaped. - for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) { - var tail = re.slice(pl.reStart + 3) - // maybe some even number of \, then maybe 1 \, followed by a | - tail = tail.replace(/((?:\\{2})*)(\\?)\|/g, function (_, $1, $2) { - if (!$2) { - // the | isn't already escaped, so escape it. - $2 = '\\' - } - - // need to escape all those slashes *again*, without escaping the - // one that we need for escaping the | character. As it works out, - // escaping an even number of slashes can be done by simply repeating - // it exactly after itself. That's why this trick works. - // - // I am sorry that you have to see this. - return $1 + $1 + $2 + '|' - }) - - this.debug('tail=%j\n %s', tail, tail) - var t = pl.type === '*' ? star - : pl.type === '?' ? qmark - : '\\' + pl.type - - hasMagic = true - re = re.slice(0, pl.reStart) + t + '\\(' + tail - } - - // handle trailing things that only matter at the very end. - clearStateChar() - if (escaping) { - // trailing \\ - re += '\\\\' - } - - // only need to apply the nodot start if the re starts with - // something that could conceivably capture a dot - var addPatternStart = false - switch (re.charAt(0)) { - case '.': - case '[': - case '(': addPatternStart = true - } - - // Hack to work around lack of negative lookbehind in JS - // A pattern like: *.!(x).!(y|z) needs to ensure that a name - // like 'a.xyz.yz' doesn't match. So, the first negative - // lookahead, has to look ALL the way ahead, to the end of - // the pattern. - for (var n = negativeLists.length - 1; n > -1; n--) { - var nl = negativeLists[n] - - var nlBefore = re.slice(0, nl.reStart) - var nlFirst = re.slice(nl.reStart, nl.reEnd - 8) - var nlLast = re.slice(nl.reEnd - 8, nl.reEnd) - var nlAfter = re.slice(nl.reEnd) - - nlLast += nlAfter - - // Handle nested stuff like *(*.js|!(*.json)), where open parens - // mean that we should *not* include the ) in the bit that is considered - // "after" the negated section. - var openParensBefore = nlBefore.split('(').length - 1 - var cleanAfter = nlAfter - for (i = 0; i < openParensBefore; i++) { - cleanAfter = cleanAfter.replace(/\)[+*?]?/, '') - } - nlAfter = cleanAfter - - var dollar = '' - if (nlAfter === '' && isSub !== SUBPARSE) { - dollar = '$' - } - var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast - re = newRe - } - - // if the re is not "" at this point, then we need to make sure - // it doesn't match against an empty path part. - // Otherwise a/* will match a/, which it should not. - if (re !== '' && hasMagic) { - re = '(?=.)' + re - } - - if (addPatternStart) { - re = patternStart + re - } - - // parsing just a piece of a larger pattern. - if (isSub === SUBPARSE) { - return [re, hasMagic] - } - - // skip the regexp for non-magical patterns - // unescape anything in it, though, so that it'll be - // an exact match against a file etc. - if (!hasMagic) { - return globUnescape(pattern) - } - - var flags = options.nocase ? 'i' : '' - var regExp = new RegExp('^' + re + '$', flags) - - regExp._glob = pattern - regExp._src = re - - return regExp -} - -minimatch.makeRe = function (pattern, options) { - return new Minimatch(pattern, options || {}).makeRe() -} - -Minimatch.prototype.makeRe = makeRe -function makeRe () { - if (this.regexp || this.regexp === false) return this.regexp - - // at this point, this.set is a 2d array of partial - // pattern strings, or "**". - // - // It's better to use .match(). This function shouldn't - // be used, really, but it's pretty convenient sometimes, - // when you just want to work with a regex. - var set = this.set - - if (!set.length) { - this.regexp = false - return this.regexp - } - var options = this.options - - var twoStar = options.noglobstar ? star - : options.dot ? twoStarDot - : twoStarNoDot - var flags = options.nocase ? 'i' : '' - - var re = set.map(function (pattern) { - return pattern.map(function (p) { - return (p === GLOBSTAR) ? twoStar - : (typeof p === 'string') ? regExpEscape(p) - : p._src - }).join('\\\/') - }).join('|') - - // must match entire pattern - // ending in a * or ** will make it less strict. - re = '^(?:' + re + ')$' - - // can match anything, as long as it's not this. - if (this.negate) re = '^(?!' + re + ').*$' - - try { - this.regexp = new RegExp(re, flags) - } catch (ex) { - this.regexp = false - } - return this.regexp -} - -minimatch.match = function (list, pattern, options) { - options = options || {} - var mm = new Minimatch(pattern, options) - list = list.filter(function (f) { - return mm.match(f) - }) - if (mm.options.nonull && !list.length) { - list.push(pattern) - } - return list -} - -Minimatch.prototype.match = match -function match (f, partial) { - this.debug('match', f, this.pattern) - // short-circuit in the case of busted things. - // comments, etc. - if (this.comment) return false - if (this.empty) return f === '' - - if (f === '/' && partial) return true - - var options = this.options - - // windows: need to use /, not \ - if (path.sep !== '/') { - f = f.split(path.sep).join('/') - } - - // treat the test path as a set of pathparts. - f = f.split(slashSplit) - this.debug(this.pattern, 'split', f) - - // just ONE of the pattern sets in this.set needs to match - // in order for it to be valid. If negating, then just one - // match means that we have failed. - // Either way, return on the first hit. - - var set = this.set - this.debug(this.pattern, 'set', set) - - // Find the basename of the path by looking for the last non-empty segment - var filename - var i - for (i = f.length - 1; i >= 0; i--) { - filename = f[i] - if (filename) break - } - - for (i = 0; i < set.length; i++) { - var pattern = set[i] - var file = f - if (options.matchBase && pattern.length === 1) { - file = [filename] - } - var hit = this.matchOne(file, pattern, partial) - if (hit) { - if (options.flipNegate) return true - return !this.negate - } - } - - // didn't get any hits. this is success if it's a negative - // pattern, failure otherwise. - if (options.flipNegate) return false - return this.negate -} - -// set partial to true to test if, for example, -// "/a/b" matches the start of "/*/b/*/d" -// Partial means, if you run out of file before you run -// out of pattern, then that's fine, as long as all -// the parts match. -Minimatch.prototype.matchOne = function (file, pattern, partial) { - var options = this.options - - this.debug('matchOne', - { 'this': this, file: file, pattern: pattern }) - - this.debug('matchOne', file.length, pattern.length) - - for (var fi = 0, - pi = 0, - fl = file.length, - pl = pattern.length - ; (fi < fl) && (pi < pl) - ; fi++, pi++) { - this.debug('matchOne loop') - var p = pattern[pi] - var f = file[fi] - - this.debug(pattern, p, f) - - // should be impossible. - // some invalid regexp stuff in the set. - if (p === false) return false - - if (p === GLOBSTAR) { - this.debug('GLOBSTAR', [pattern, p, f]) - - // "**" - // a/**/b/**/c would match the following: - // a/b/x/y/z/c - // a/x/y/z/b/c - // a/b/x/b/x/c - // a/b/c - // To do this, take the rest of the pattern after - // the **, and see if it would match the file remainder. - // If so, return success. - // If not, the ** "swallows" a segment, and try again. - // This is recursively awful. - // - // a/**/b/**/c matching a/b/x/y/z/c - // - a matches a - // - doublestar - // - matchOne(b/x/y/z/c, b/**/c) - // - b matches b - // - doublestar - // - matchOne(x/y/z/c, c) -> no - // - matchOne(y/z/c, c) -> no - // - matchOne(z/c, c) -> no - // - matchOne(c, c) yes, hit - var fr = fi - var pr = pi + 1 - if (pr === pl) { - this.debug('** at the end') - // a ** at the end will just swallow the rest. - // We have found a match. - // however, it will not swallow /.x, unless - // options.dot is set. - // . and .. are *never* matched by **, for explosively - // exponential reasons. - for (; fi < fl; fi++) { - if (file[fi] === '.' || file[fi] === '..' || - (!options.dot && file[fi].charAt(0) === '.')) return false - } - return true - } - - // ok, let's see if we can swallow whatever we can. - while (fr < fl) { - var swallowee = file[fr] - - this.debug('\nglobstar while', file, fr, pattern, pr, swallowee) - - // XXX remove this slice. Just pass the start index. - if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) { - this.debug('globstar found match!', fr, fl, swallowee) - // found a match. - return true - } else { - // can't swallow "." or ".." ever. - // can only swallow ".foo" when explicitly asked. - if (swallowee === '.' || swallowee === '..' || - (!options.dot && swallowee.charAt(0) === '.')) { - this.debug('dot detected!', file, fr, pattern, pr) - break - } - - // ** swallows a segment, and continue. - this.debug('globstar swallow a segment, and continue') - fr++ - } - } - - // no match was found. - // However, in partial mode, we can't say this is necessarily over. - // If there's more *pattern* left, then - if (partial) { - // ran out of file - this.debug('\n>>> no match, partial?', file, fr, pattern, pr) - if (fr === fl) return true - } - return false - } - - // something other than ** - // non-magic patterns just have to match exactly - // patterns with magic have been turned into regexps. - var hit - if (typeof p === 'string') { - if (options.nocase) { - hit = f.toLowerCase() === p.toLowerCase() - } else { - hit = f === p - } - this.debug('string match', p, f, hit) - } else { - hit = f.match(p) - this.debug('pattern match', p, f, hit) - } - - if (!hit) return false - } - - // Note: ending in / means that we'll get a final "" - // at the end of the pattern. This can only match a - // corresponding "" at the end of the file. - // If the file ends in /, then it can only match a - // a pattern that ends in /, unless the pattern just - // doesn't have any more for it. But, a/b/ should *not* - // match "a/b/*", even though "" matches against the - // [^/]*? pattern, except in partial mode, where it might - // simply not be reached yet. - // However, a/b/ should still satisfy a/* - - // now either we fell off the end of the pattern, or we're done. - if (fi === fl && pi === pl) { - // ran out of pattern and filename at the same time. - // an exact hit! - return true - } else if (fi === fl) { - // ran out of file, but still had pattern left. - // this is ok if we're doing the match as part of - // a glob fs traversal. - return partial - } else if (pi === pl) { - // ran out of pattern, still have file left. - // this is only acceptable if we're on the very last - // empty segment of a file with a trailing slash. - // a/* should match a/b/ - var emptyFileEnd = (fi === fl - 1) && (file[fi] === '') - return emptyFileEnd - } - - // should be unreachable. - throw new Error('wtf?') -} - -// replace stuff like \* with * -function globUnescape (s) { - return s.replace(/\\(.)/g, '$1') -} - -function regExpEscape (s) { - return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') -} - -},{"531":531,"9":9}],531:[function(_dereq_,module,exports){ -var concatMap = _dereq_(533); -var balanced = _dereq_(532); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - - -},{"532":532,"533":533}],532:[function(_dereq_,module,exports){ -module.exports = balanced; -function balanced(a, b, str) { - var r = range(a, b, str); - - return r && { - start: r[0], - end: r[1], - pre: str.slice(0, r[0]), - body: str.slice(r[0] + a.length, r[1]), - post: str.slice(r[1] + b.length) - }; -} - -balanced.range = range; -function range(a, b, str) { - var begs, beg, left, right, result; - var ai = str.indexOf(a); - var bi = str.indexOf(b, ai + 1); - var i = ai; - - if (ai >= 0 && bi > 0) { - begs = []; - left = str.length; - - while (i < str.length && i >= 0 && ! result) { - if (i == ai) { - begs.push(i); - ai = str.indexOf(a, i + 1); - } else if (begs.length == 1) { - result = [ begs.pop(), bi ]; - } else { - beg = begs.pop(); - if (beg < left) { - left = beg; - right = bi; - } - - bi = str.indexOf(b, i + 1); - } - - i = ai < bi && ai >= 0 ? ai : bi; - } - - if (begs.length) { - result = [ left, right ]; - } - } - - return result; -} - -},{}],533:[function(_dereq_,module,exports){ -module.exports = function (xs, fn) { - var res = []; - for (var i = 0; i < xs.length; i++) { - var x = fn(xs[i], i); - if (isArray(x)) res.push.apply(res, x); - else res.push(x); - } - return res; -}; - -var isArray = Array.isArray || function (xs) { - return Object.prototype.toString.call(xs) === '[object Array]'; -}; - -},{}],534:[function(_dereq_,module,exports){ -'use strict'; -var fs = _dereq_(3) - -module.exports = function (pth, cb) { - var fn = typeof fs.access === 'function' ? fs.access : fs.stat; - - fn(pth, function (err) { - cb(null, !err); - }); -}; - -module.exports.sync = function (pth) { - var fn = typeof fs.accessSync === 'function' ? fs.accessSync : fs.statSync; - - try { - fn(pth); - return true; - } catch (err) { - return false; - } -}; - -},{"3":3}],535:[function(_dereq_,module,exports){ -(function (process){ -'use strict'; - -function posix(path) { - return path.charAt(0) === '/'; -}; - -function win32(path) { - // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56 - var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/; - var result = splitDeviceRe.exec(path); - var device = result[1] || ''; - var isUnc = !!device && device.charAt(1) !== ':'; - - // UNC paths are always absolute - return !!result[2] || isUnc; -}; - -module.exports = process.platform === 'win32' ? win32 : posix; -module.exports.posix = posix; -module.exports.win32 = win32; - -}).call(this,_dereq_(10)) -},{"10":10}],536:[function(_dereq_,module,exports){ -"use strict"; - -var originalObject = Object; -var originalDefProp = Object.defineProperty; -var originalCreate = Object.create; - -function defProp(obj, name, value) { - if (originalDefProp) try { - originalDefProp.call(originalObject, obj, name, { value: value }); - } catch (definePropertyIsBrokenInIE8) { - obj[name] = value; - } else { - obj[name] = value; - } -} - -// For functions that will be invoked using .call or .apply, we need to -// define those methods on the function objects themselves, rather than -// inheriting them from Function.prototype, so that a malicious or clumsy -// third party cannot interfere with the functionality of this module by -// redefining Function.prototype.call or .apply. -function makeSafeToCall(fun) { - if (fun) { - defProp(fun, "call", fun.call); - defProp(fun, "apply", fun.apply); - } - return fun; -} - -makeSafeToCall(originalDefProp); -makeSafeToCall(originalCreate); - -var hasOwn = makeSafeToCall(Object.prototype.hasOwnProperty); -var numToStr = makeSafeToCall(Number.prototype.toString); -var strSlice = makeSafeToCall(String.prototype.slice); - -var cloner = function(){}; -function create(prototype) { - if (originalCreate) { - return originalCreate.call(originalObject, prototype); - } - cloner.prototype = prototype || null; - return new cloner; -} - -var rand = Math.random; -var uniqueKeys = create(null); - -function makeUniqueKey() { - // Collisions are highly unlikely, but this module is in the business of - // making guarantees rather than safe bets. - do var uniqueKey = internString(strSlice.call(numToStr.call(rand(), 36), 2)); - while (hasOwn.call(uniqueKeys, uniqueKey)); - return uniqueKeys[uniqueKey] = uniqueKey; -} - -function internString(str) { - var obj = {}; - obj[str] = true; - return Object.keys(obj)[0]; -} - -// External users might find this function useful, but it is not necessary -// for the typical use of this module. -defProp(exports, "makeUniqueKey", makeUniqueKey); - -// Object.getOwnPropertyNames is the only way to enumerate non-enumerable -// properties, so if we wrap it to ignore our secret keys, there should be -// no way (except guessing) to access those properties. -var originalGetOPNs = Object.getOwnPropertyNames; -Object.getOwnPropertyNames = function getOwnPropertyNames(object) { - for (var names = originalGetOPNs(object), - src = 0, - dst = 0, - len = names.length; - src < len; - ++src) { - if (!hasOwn.call(uniqueKeys, names[src])) { - if (src > dst) { - names[dst] = names[src]; - } - ++dst; - } - } - names.length = dst; - return names; -}; - -function defaultCreatorFn(object) { - return create(null); -} - -function makeAccessor(secretCreatorFn) { - var brand = makeUniqueKey(); - var passkey = create(null); - - secretCreatorFn = secretCreatorFn || defaultCreatorFn; - - function register(object) { - var secret; // Created lazily. - - function vault(key, forget) { - // Only code that has access to the passkey can retrieve (or forget) - // the secret object. - if (key === passkey) { - return forget - ? secret = null - : secret || (secret = secretCreatorFn(object)); - } - } - - defProp(object, brand, vault); - } - - function accessor(object) { - if (!hasOwn.call(object, brand)) - register(object); - return object[brand](passkey); - } - - accessor.forget = function(object) { - if (hasOwn.call(object, brand)) - object[brand](passkey, true); - }; - - return accessor; -} - -defProp(exports, "makeAccessor", makeAccessor); - -},{}],537:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var types = _dereq_(568).types; -var isArray = types.builtInTypes.array; -var b = types.builders; -var n = types.namedTypes; -var leap = _dereq_(539); -var meta = _dereq_(540); -var util = _dereq_(541); -var runtimeProperty = util.runtimeProperty; -var hasOwn = Object.prototype.hasOwnProperty; - -function Emitter(contextId) { - assert.ok(this instanceof Emitter); - n.Identifier.assert(contextId); - - // Used to generate unique temporary names. - this.nextTempId = 0; - - Object.defineProperties(this, { - // In order to make sure the context object does not collide with - // anything in the local scope, we might have to rename it, so we - // refer to it symbolically instead of just assuming that it will be - // called "context". - contextId: { value: contextId }, - - // An append-only list of Statements that grows each time this.emit is - // called. - listing: { value: [] }, - - // A sparse array whose keys correspond to locations in this.listing - // that have been marked as branch/jump targets. - marked: { value: [true] }, - - // The last location will be marked when this.getDispatchLoop is - // called. - finalLoc: { value: loc() }, - - // A list of all leap.TryEntry statements emitted. - tryEntries: { value: [] } - }); - - // The .leapManager property needs to be defined by a separate - // defineProperties call so that .finalLoc will be visible to the - // leap.LeapManager constructor. - Object.defineProperties(this, { - // Each time we evaluate the body of a loop, we tell this.leapManager - // to enter a nested loop context that determines the meaning of break - // and continue statements therein. - leapManager: { value: new leap.LeapManager(this) } - }); -} - -var Ep = Emitter.prototype; -exports.Emitter = Emitter; - -// Offsets into this.listing that could be used as targets for branches or -// jumps are represented as numeric Literal nodes. This representation has -// the amazingly convenient benefit of allowing the exact value of the -// location to be determined at any time, even after generating code that -// refers to the location. -function loc() { - return b.literal(-1); -} - -// Sets the exact value of the given location to the offset of the next -// Statement emitted. -Ep.mark = function(loc) { - n.Literal.assert(loc); - var index = this.listing.length; - if (loc.value === -1) { - loc.value = index; - } else { - // Locations can be marked redundantly, but their values cannot change - // once set the first time. - assert.strictEqual(loc.value, index); - } - this.marked[index] = true; - return loc; -}; - -Ep.emit = function(node) { - if (n.Expression.check(node)) - node = b.expressionStatement(node); - n.Statement.assert(node); - this.listing.push(node); -}; - -// Shorthand for emitting assignment statements. This will come in handy -// for assignments to temporary variables. -Ep.emitAssign = function(lhs, rhs) { - this.emit(this.assign(lhs, rhs)); - return lhs; -}; - -// Shorthand for an assignment statement. -Ep.assign = function(lhs, rhs) { - return b.expressionStatement( - b.assignmentExpression("=", lhs, rhs)); -}; - -// Convenience function for generating expressions like context.next, -// context.sent, and context.rval. -Ep.contextProperty = function(name, computed) { - return b.memberExpression( - this.contextId, - computed ? b.literal(name) : b.identifier(name), - !!computed - ); -}; - -// Shorthand for setting context.rval and jumping to `context.stop()`. -Ep.stop = function(rval) { - if (rval) { - this.setReturnValue(rval); - } - - this.jump(this.finalLoc); -}; - -Ep.setReturnValue = function(valuePath) { - n.Expression.assert(valuePath.value); - - this.emitAssign( - this.contextProperty("rval"), - this.explodeExpression(valuePath) - ); -}; - -Ep.clearPendingException = function(tryLoc, assignee) { - n.Literal.assert(tryLoc); - - var catchCall = b.callExpression( - this.contextProperty("catch", true), - [tryLoc] - ); - - if (assignee) { - this.emitAssign(assignee, catchCall); - } else { - this.emit(catchCall); - } -}; - -// Emits code for an unconditional jump to the given location, even if the -// exact value of the location is not yet known. -Ep.jump = function(toLoc) { - this.emitAssign(this.contextProperty("next"), toLoc); - this.emit(b.breakStatement()); -}; - -// Conditional jump. -Ep.jumpIf = function(test, toLoc) { - n.Expression.assert(test); - n.Literal.assert(toLoc); - - this.emit(b.ifStatement( - test, - b.blockStatement([ - this.assign(this.contextProperty("next"), toLoc), - b.breakStatement() - ]) - )); -}; - -// Conditional jump, with the condition negated. -Ep.jumpIfNot = function(test, toLoc) { - n.Expression.assert(test); - n.Literal.assert(toLoc); - - var negatedTest; - if (n.UnaryExpression.check(test) && - test.operator === "!") { - // Avoid double negation. - negatedTest = test.argument; - } else { - negatedTest = b.unaryExpression("!", test); - } - - this.emit(b.ifStatement( - negatedTest, - b.blockStatement([ - this.assign(this.contextProperty("next"), toLoc), - b.breakStatement() - ]) - )); -}; - -// Returns a unique MemberExpression that can be used to store and -// retrieve temporary values. Since the object of the member expression is -// the context object, which is presumed to coexist peacefully with all -// other local variables, and since we just increment `nextTempId` -// monotonically, uniqueness is assured. -Ep.makeTempVar = function() { - return this.contextProperty("t" + this.nextTempId++); -}; - -Ep.getContextFunction = function(id) { - return b.functionExpression( - id || null/*Anonymous*/, - [this.contextId], - b.blockStatement([this.getDispatchLoop()]), - false, // Not a generator anymore! - false // Nor an expression. - ); -}; - -// Turns this.listing into a loop of the form -// -// while (1) switch (context.next) { -// case 0: -// ... -// case n: -// return context.stop(); -// } -// -// Each marked location in this.listing will correspond to one generated -// case statement. -Ep.getDispatchLoop = function() { - var self = this; - var cases = []; - var current; - - // If we encounter a break, continue, or return statement in a switch - // case, we can skip the rest of the statements until the next case. - var alreadyEnded = false; - - self.listing.forEach(function(stmt, i) { - if (self.marked.hasOwnProperty(i)) { - cases.push(b.switchCase( - b.literal(i), - current = [])); - alreadyEnded = false; - } - - if (!alreadyEnded) { - current.push(stmt); - if (isSwitchCaseEnder(stmt)) - alreadyEnded = true; - } - }); - - // Now that we know how many statements there will be in this.listing, - // we can finally resolve this.finalLoc.value. - this.finalLoc.value = this.listing.length; - - cases.push( - b.switchCase(this.finalLoc, [ - // Intentionally fall through to the "end" case... - ]), - - // So that the runtime can jump to the final location without having - // to know its offset, we provide the "end" case as a synonym. - b.switchCase(b.literal("end"), [ - // This will check/clear both context.thrown and context.rval. - b.returnStatement( - b.callExpression(this.contextProperty("stop"), []) - ) - ]) - ); - - return b.whileStatement( - b.literal(1), - b.switchStatement( - b.assignmentExpression( - "=", - this.contextProperty("prev"), - this.contextProperty("next") - ), - cases - ) - ); -}; - -// See comment above re: alreadyEnded. -function isSwitchCaseEnder(stmt) { - return n.BreakStatement.check(stmt) - || n.ContinueStatement.check(stmt) - || n.ReturnStatement.check(stmt) - || n.ThrowStatement.check(stmt); -} - -Ep.getTryLocsList = function() { - if (this.tryEntries.length === 0) { - // To avoid adding a needless [] to the majority of runtime.wrap - // argument lists, force the caller to handle this case specially. - return null; - } - - var lastLocValue = 0; - - return b.arrayExpression( - this.tryEntries.map(function(tryEntry) { - var thisLocValue = tryEntry.firstLoc.value; - assert.ok(thisLocValue >= lastLocValue, "try entries out of order"); - lastLocValue = thisLocValue; - - var ce = tryEntry.catchEntry; - var fe = tryEntry.finallyEntry; - - var locs = [ - tryEntry.firstLoc, - // The null here makes a hole in the array. - ce ? ce.firstLoc : null - ]; - - if (fe) { - locs[2] = fe.firstLoc; - locs[3] = fe.afterLoc; - } - - return b.arrayExpression(locs); - }) - ); -}; - -// All side effects must be realized in order. - -// If any subexpression harbors a leap, all subexpressions must be -// neutered of side effects. - -// No destructive modification of AST nodes. - -Ep.explode = function(path, ignoreResult) { - assert.ok(path instanceof types.NodePath); - - var node = path.value; - var self = this; - - n.Node.assert(node); - - if (n.Statement.check(node)) - return self.explodeStatement(path); - - if (n.Expression.check(node)) - return self.explodeExpression(path, ignoreResult); - - if (n.Declaration.check(node)) - throw getDeclError(node); - - switch (node.type) { - case "Program": - return path.get("body").map( - self.explodeStatement, - self - ); - - case "VariableDeclarator": - throw getDeclError(node); - - // These node types should be handled by their parent nodes - // (ObjectExpression, SwitchStatement, and TryStatement, respectively). - case "Property": - case "SwitchCase": - case "CatchClause": - throw new Error( - node.type + " nodes should be handled by their parents"); - - default: - throw new Error( - "unknown Node of type " + - JSON.stringify(node.type)); - } -}; - -function getDeclError(node) { - return new Error( - "all declarations should have been transformed into " + - "assignments before the Exploder began its work: " + - JSON.stringify(node)); -} - -Ep.explodeStatement = function(path, labelId) { - assert.ok(path instanceof types.NodePath); - - var stmt = path.value; - var self = this; - - n.Statement.assert(stmt); - - if (labelId) { - n.Identifier.assert(labelId); - } else { - labelId = null; - } - - // Explode BlockStatement nodes even if they do not contain a yield, - // because we don't want or need the curly braces. - if (n.BlockStatement.check(stmt)) { - return path.get("body").each( - self.explodeStatement, - self - ); - } - - if (!meta.containsLeap(stmt)) { - // Technically we should be able to avoid emitting the statement - // altogether if !meta.hasSideEffects(stmt), but that leads to - // confusing generated code (for instance, `while (true) {}` just - // disappears) and is probably a more appropriate job for a dedicated - // dead code elimination pass. - self.emit(stmt); - return; - } - - switch (stmt.type) { - case "ExpressionStatement": - self.explodeExpression(path.get("expression"), true); - break; - - case "LabeledStatement": - var after = loc(); - - // Did you know you can break from any labeled block statement or - // control structure? Well, you can! Note: when a labeled loop is - // encountered, the leap.LabeledEntry created here will immediately - // enclose a leap.LoopEntry on the leap manager's stack, and both - // entries will have the same label. Though this works just fine, it - // may seem a bit redundant. In theory, we could check here to - // determine if stmt knows how to handle its own label; for example, - // stmt happens to be a WhileStatement and so we know it's going to - // establish its own LoopEntry when we explode it (below). Then this - // LabeledEntry would be unnecessary. Alternatively, we might be - // tempted not to pass stmt.label down into self.explodeStatement, - // because we've handled the label here, but that's a mistake because - // labeled loops may contain labeled continue statements, which is not - // something we can handle in this generic case. All in all, I think a - // little redundancy greatly simplifies the logic of this case, since - // it's clear that we handle all possible LabeledStatements correctly - // here, regardless of whether they interact with the leap manager - // themselves. Also remember that labels and break/continue-to-label - // statements are rare, and all of this logic happens at transform - // time, so it has no additional runtime cost. - self.leapManager.withEntry( - new leap.LabeledEntry(after, stmt.label), - function() { - self.explodeStatement(path.get("body"), stmt.label); - } - ); - - self.mark(after); - - break; - - case "WhileStatement": - var before = loc(); - var after = loc(); - - self.mark(before); - self.jumpIfNot(self.explodeExpression(path.get("test")), after); - self.leapManager.withEntry( - new leap.LoopEntry(after, before, labelId), - function() { self.explodeStatement(path.get("body")); } - ); - self.jump(before); - self.mark(after); - - break; - - case "DoWhileStatement": - var first = loc(); - var test = loc(); - var after = loc(); - - self.mark(first); - self.leapManager.withEntry( - new leap.LoopEntry(after, test, labelId), - function() { self.explode(path.get("body")); } - ); - self.mark(test); - self.jumpIf(self.explodeExpression(path.get("test")), first); - self.mark(after); - - break; - - case "ForStatement": - var head = loc(); - var update = loc(); - var after = loc(); - - if (stmt.init) { - // We pass true here to indicate that if stmt.init is an expression - // then we do not care about its result. - self.explode(path.get("init"), true); - } - - self.mark(head); - - if (stmt.test) { - self.jumpIfNot(self.explodeExpression(path.get("test")), after); - } else { - // No test means continue unconditionally. - } - - self.leapManager.withEntry( - new leap.LoopEntry(after, update, labelId), - function() { self.explodeStatement(path.get("body")); } - ); - - self.mark(update); - - if (stmt.update) { - // We pass true here to indicate that if stmt.update is an - // expression then we do not care about its result. - self.explode(path.get("update"), true); - } - - self.jump(head); - - self.mark(after); - - break; - - case "ForInStatement": - var head = loc(); - var after = loc(); - - var keyIterNextFn = self.makeTempVar(); - self.emitAssign( - keyIterNextFn, - b.callExpression( - runtimeProperty("keys"), - [self.explodeExpression(path.get("right"))] - ) - ); - - self.mark(head); - - var keyInfoTmpVar = self.makeTempVar(); - self.jumpIf( - b.memberExpression( - b.assignmentExpression( - "=", - keyInfoTmpVar, - b.callExpression(keyIterNextFn, []) - ), - b.identifier("done"), - false - ), - after - ); - - self.emitAssign( - stmt.left, - b.memberExpression( - keyInfoTmpVar, - b.identifier("value"), - false - ) - ); - - self.leapManager.withEntry( - new leap.LoopEntry(after, head, labelId), - function() { self.explodeStatement(path.get("body")); } - ); - - self.jump(head); - - self.mark(after); - - break; - - case "BreakStatement": - self.emitAbruptCompletion({ - type: "break", - target: self.leapManager.getBreakLoc(stmt.label) - }); - - break; - - case "ContinueStatement": - self.emitAbruptCompletion({ - type: "continue", - target: self.leapManager.getContinueLoc(stmt.label) - }); - - break; - - case "SwitchStatement": - // Always save the discriminant into a temporary variable in case the - // test expressions overwrite values like context.sent. - var disc = self.emitAssign( - self.makeTempVar(), - self.explodeExpression(path.get("discriminant")) - ); - - var after = loc(); - var defaultLoc = loc(); - var condition = defaultLoc; - var caseLocs = []; - - // If there are no cases, .cases might be undefined. - var cases = stmt.cases || []; - - for (var i = cases.length - 1; i >= 0; --i) { - var c = cases[i]; - n.SwitchCase.assert(c); - - if (c.test) { - condition = b.conditionalExpression( - b.binaryExpression("===", disc, c.test), - caseLocs[i] = loc(), - condition - ); - } else { - caseLocs[i] = defaultLoc; - } - } - - self.jump(self.explodeExpression( - new types.NodePath(condition, path, "discriminant") - )); - - self.leapManager.withEntry( - new leap.SwitchEntry(after), - function() { - path.get("cases").each(function(casePath) { - var c = casePath.value; - var i = casePath.name; - - self.mark(caseLocs[i]); - - casePath.get("consequent").each( - self.explodeStatement, - self - ); - }); - } - ); - - self.mark(after); - if (defaultLoc.value === -1) { - self.mark(defaultLoc); - assert.strictEqual(after.value, defaultLoc.value); - } - - break; - - case "IfStatement": - var elseLoc = stmt.alternate && loc(); - var after = loc(); - - self.jumpIfNot( - self.explodeExpression(path.get("test")), - elseLoc || after - ); - - self.explodeStatement(path.get("consequent")); - - if (elseLoc) { - self.jump(after); - self.mark(elseLoc); - self.explodeStatement(path.get("alternate")); - } - - self.mark(after); - - break; - - case "ReturnStatement": - self.emitAbruptCompletion({ - type: "return", - value: self.explodeExpression(path.get("argument")) - }); - - break; - - case "WithStatement": - throw new Error( - node.type + " not supported in generator functions."); - - case "TryStatement": - var after = loc(); - - var handler = stmt.handler; - if (!handler && stmt.handlers) { - handler = stmt.handlers[0] || null; - } - - var catchLoc = handler && loc(); - var catchEntry = catchLoc && new leap.CatchEntry( - catchLoc, - handler.param - ); - - var finallyLoc = stmt.finalizer && loc(); - var finallyEntry = finallyLoc && - new leap.FinallyEntry(finallyLoc, after); - - var tryEntry = new leap.TryEntry( - self.getUnmarkedCurrentLoc(), - catchEntry, - finallyEntry - ); - - self.tryEntries.push(tryEntry); - self.updateContextPrevLoc(tryEntry.firstLoc); - - self.leapManager.withEntry(tryEntry, function() { - self.explodeStatement(path.get("block")); - - if (catchLoc) { - if (finallyLoc) { - // If we have both a catch block and a finally block, then - // because we emit the catch block first, we need to jump over - // it to the finally block. - self.jump(finallyLoc); - - } else { - // If there is no finally block, then we need to jump over the - // catch block to the fall-through location. - self.jump(after); - } - - self.updateContextPrevLoc(self.mark(catchLoc)); - - var bodyPath = path.get("handler", "body"); - var safeParam = self.makeTempVar(); - self.clearPendingException(tryEntry.firstLoc, safeParam); - - var catchScope = bodyPath.scope; - var catchParamName = handler.param.name; - n.CatchClause.assert(catchScope.node); - assert.strictEqual(catchScope.lookup(catchParamName), catchScope); - - types.visit(bodyPath, { - visitIdentifier: function(path) { - if (util.isReference(path, catchParamName) && - path.scope.lookup(catchParamName) === catchScope) { - return safeParam; - } - - this.traverse(path); - }, - - visitFunction: function(path) { - if (path.scope.declares(catchParamName)) { - // Don't descend into nested scopes that shadow the catch - // parameter with their own declarations. This isn't - // logically necessary because of the path.scope.lookup we - // do in visitIdentifier, but it saves time. - return false; - } - - this.traverse(path); - } - }); - - self.leapManager.withEntry(catchEntry, function() { - self.explodeStatement(bodyPath); - }); - } - - if (finallyLoc) { - self.updateContextPrevLoc(self.mark(finallyLoc)); - - self.leapManager.withEntry(finallyEntry, function() { - self.explodeStatement(path.get("finalizer")); - }); - - self.emit(b.returnStatement(b.callExpression( - self.contextProperty("finish"), - [finallyEntry.firstLoc] - ))); - } - }); - - self.mark(after); - - break; - - case "ThrowStatement": - self.emit(b.throwStatement( - self.explodeExpression(path.get("argument")) - )); - - break; - - default: - throw new Error( - "unknown Statement of type " + - JSON.stringify(stmt.type)); - } -}; - -Ep.emitAbruptCompletion = function(record) { - if (!isValidCompletion(record)) { - assert.ok( - false, - "invalid completion record: " + - JSON.stringify(record) - ); - } - - assert.notStrictEqual( - record.type, "normal", - "normal completions are not abrupt" - ); - - var abruptArgs = [b.literal(record.type)]; - - if (record.type === "break" || - record.type === "continue") { - n.Literal.assert(record.target); - abruptArgs[1] = record.target; - } else if (record.type === "return" || - record.type === "throw") { - if (record.value) { - n.Expression.assert(record.value); - abruptArgs[1] = record.value; - } - } - - this.emit( - b.returnStatement( - b.callExpression( - this.contextProperty("abrupt"), - abruptArgs - ) - ) - ); -}; - -function isValidCompletion(record) { - var type = record.type; - - if (type === "normal") { - return !hasOwn.call(record, "target"); - } - - if (type === "break" || - type === "continue") { - return !hasOwn.call(record, "value") - && n.Literal.check(record.target); - } - - if (type === "return" || - type === "throw") { - return hasOwn.call(record, "value") - && !hasOwn.call(record, "target"); - } - - return false; -} - - -// Not all offsets into emitter.listing are potential jump targets. For -// example, execution typically falls into the beginning of a try block -// without jumping directly there. This method returns the current offset -// without marking it, so that a switch case will not necessarily be -// generated for this offset (I say "not necessarily" because the same -// location might end up being marked in the process of emitting other -// statements). There's no logical harm in marking such locations as jump -// targets, but minimizing the number of switch cases keeps the generated -// code shorter. -Ep.getUnmarkedCurrentLoc = function() { - return b.literal(this.listing.length); -}; - -// The context.prev property takes the value of context.next whenever we -// evaluate the switch statement discriminant, which is generally good -// enough for tracking the last location we jumped to, but sometimes -// context.prev needs to be more precise, such as when we fall -// successfully out of a try block and into a finally block without -// jumping. This method exists to update context.prev to the freshest -// available location. If we were implementing a full interpreter, we -// would know the location of the current instruction with complete -// precision at all times, but we don't have that luxury here, as it would -// be costly and verbose to set context.prev before every statement. -Ep.updateContextPrevLoc = function(loc) { - if (loc) { - n.Literal.assert(loc); - - if (loc.value === -1) { - // If an uninitialized location literal was passed in, set its value - // to the current this.listing.length. - loc.value = this.listing.length; - } else { - // Otherwise assert that the location matches the current offset. - assert.strictEqual(loc.value, this.listing.length); - } - - } else { - loc = this.getUnmarkedCurrentLoc(); - } - - // Make sure context.prev is up to date in case we fell into this try - // statement without jumping to it. TODO Consider avoiding this - // assignment when we know control must have jumped here. - this.emitAssign(this.contextProperty("prev"), loc); -}; - -Ep.explodeExpression = function(path, ignoreResult) { - assert.ok(path instanceof types.NodePath); - - var expr = path.value; - if (expr) { - n.Expression.assert(expr); - } else { - return expr; - } - - var self = this; - var result; // Used optionally by several cases below. - - function finish(expr) { - n.Expression.assert(expr); - if (ignoreResult) { - self.emit(expr); - } else { - return expr; - } - } - - // If the expression does not contain a leap, then we either emit the - // expression as a standalone statement or return it whole. - if (!meta.containsLeap(expr)) { - return finish(expr); - } - - // If any child contains a leap (such as a yield or labeled continue or - // break statement), then any sibling subexpressions will almost - // certainly have to be exploded in order to maintain the order of their - // side effects relative to the leaping child(ren). - var hasLeapingChildren = meta.containsLeap.onlyChildren(expr); - - // In order to save the rest of explodeExpression from a combinatorial - // trainwreck of special cases, explodeViaTempVar is responsible for - // deciding when a subexpression needs to be "exploded," which is my - // very technical term for emitting the subexpression as an assignment - // to a temporary variable and the substituting the temporary variable - // for the original subexpression. Think of exploded view diagrams, not - // Michael Bay movies. The point of exploding subexpressions is to - // control the precise order in which the generated code realizes the - // side effects of those subexpressions. - function explodeViaTempVar(tempVar, childPath, ignoreChildResult) { - assert.ok(childPath instanceof types.NodePath); - - assert.ok( - !ignoreChildResult || !tempVar, - "Ignoring the result of a child expression but forcing it to " + - "be assigned to a temporary variable?" - ); - - var result = self.explodeExpression(childPath, ignoreChildResult); - - if (ignoreChildResult) { - // Side effects already emitted above. - - } else if (tempVar || (hasLeapingChildren && - !n.Literal.check(result))) { - // If tempVar was provided, then the result will always be assigned - // to it, even if the result does not otherwise need to be assigned - // to a temporary variable. When no tempVar is provided, we have - // the flexibility to decide whether a temporary variable is really - // necessary. Unfortunately, in general, a temporary variable is - // required whenever any child contains a yield expression, since it - // is difficult to prove (at all, let alone efficiently) whether - // this result would evaluate to the same value before and after the - // yield (see #206). One narrow case where we can prove it doesn't - // matter (and thus we do not need a temporary variable) is when the - // result in question is a Literal value. - result = self.emitAssign( - tempVar || self.makeTempVar(), - result - ); - } - return result; - } - - // If ignoreResult is true, then we must take full responsibility for - // emitting the expression with all its side effects, and we should not - // return a result. - - switch (expr.type) { - case "MemberExpression": - return finish(b.memberExpression( - self.explodeExpression(path.get("object")), - expr.computed - ? explodeViaTempVar(null, path.get("property")) - : expr.property, - expr.computed - )); - - case "CallExpression": - var calleePath = path.get("callee"); - var argsPath = path.get("arguments"); - - var newCallee; - var newArgs = []; - - var hasLeapingArgs = false; - argsPath.each(function(argPath) { - hasLeapingArgs = hasLeapingArgs || - meta.containsLeap(argPath.value); - }); - - if (n.MemberExpression.check(calleePath.value)) { - if (hasLeapingArgs) { - // If the arguments of the CallExpression contained any yield - // expressions, then we need to be sure to evaluate the callee - // before evaluating the arguments, but if the callee was a member - // expression, then we must be careful that the object of the - // member expression still gets bound to `this` for the call. - - var newObject = explodeViaTempVar( - // Assign the exploded callee.object expression to a temporary - // variable so that we can use it twice without reevaluating it. - self.makeTempVar(), - calleePath.get("object") - ); - - var newProperty = calleePath.value.computed - ? explodeViaTempVar(null, calleePath.get("property")) - : calleePath.value.property; - - newArgs.unshift(newObject); - - newCallee = b.memberExpression( - b.memberExpression( - newObject, - newProperty, - calleePath.value.computed - ), - b.identifier("call"), - false - ); - - } else { - newCallee = self.explodeExpression(calleePath); - } - - } else { - newCallee = self.explodeExpression(calleePath); - - if (n.MemberExpression.check(newCallee)) { - // If the callee was not previously a MemberExpression, then the - // CallExpression was "unqualified," meaning its `this` object - // should be the global object. If the exploded expression has - // become a MemberExpression (e.g. a context property, probably a - // temporary variable), then we need to force it to be unqualified - // by using the (0, object.property)(...) trick; otherwise, it - // will receive the object of the MemberExpression as its `this` - // object. - newCallee = b.sequenceExpression([ - b.literal(0), - newCallee - ]); - } - } - - argsPath.each(function(argPath) { - newArgs.push(explodeViaTempVar(null, argPath)); - }); - - return finish(b.callExpression( - newCallee, - newArgs - )); - - case "NewExpression": - return finish(b.newExpression( - explodeViaTempVar(null, path.get("callee")), - path.get("arguments").map(function(argPath) { - return explodeViaTempVar(null, argPath); - }) - )); - - case "ObjectExpression": - return finish(b.objectExpression( - path.get("properties").map(function(propPath) { - return b.property( - propPath.value.kind, - propPath.value.key, - explodeViaTempVar(null, propPath.get("value")) - ); - }) - )); - - case "ArrayExpression": - return finish(b.arrayExpression( - path.get("elements").map(function(elemPath) { - return explodeViaTempVar(null, elemPath); - }) - )); - - case "SequenceExpression": - var lastIndex = expr.expressions.length - 1; - - path.get("expressions").each(function(exprPath) { - if (exprPath.name === lastIndex) { - result = self.explodeExpression(exprPath, ignoreResult); - } else { - self.explodeExpression(exprPath, true); - } - }); - - return result; - - case "LogicalExpression": - var after = loc(); - - if (!ignoreResult) { - result = self.makeTempVar(); - } - - var left = explodeViaTempVar(result, path.get("left")); - - if (expr.operator === "&&") { - self.jumpIfNot(left, after); - } else { - assert.strictEqual(expr.operator, "||"); - self.jumpIf(left, after); - } - - explodeViaTempVar(result, path.get("right"), ignoreResult); - - self.mark(after); - - return result; - - case "ConditionalExpression": - var elseLoc = loc(); - var after = loc(); - var test = self.explodeExpression(path.get("test")); - - self.jumpIfNot(test, elseLoc); - - if (!ignoreResult) { - result = self.makeTempVar(); - } - - explodeViaTempVar(result, path.get("consequent"), ignoreResult); - self.jump(after); - - self.mark(elseLoc); - explodeViaTempVar(result, path.get("alternate"), ignoreResult); - - self.mark(after); - - return result; - - case "UnaryExpression": - return finish(b.unaryExpression( - expr.operator, - // Can't (and don't need to) break up the syntax of the argument. - // Think about delete a[b]. - self.explodeExpression(path.get("argument")), - !!expr.prefix - )); - - case "BinaryExpression": - return finish(b.binaryExpression( - expr.operator, - explodeViaTempVar(null, path.get("left")), - explodeViaTempVar(null, path.get("right")) - )); - - case "AssignmentExpression": - return finish(b.assignmentExpression( - expr.operator, - self.explodeExpression(path.get("left")), - self.explodeExpression(path.get("right")) - )); - - case "UpdateExpression": - return finish(b.updateExpression( - expr.operator, - self.explodeExpression(path.get("argument")), - expr.prefix - )); - - case "YieldExpression": - var after = loc(); - var arg = expr.argument && self.explodeExpression(path.get("argument")); - - if (arg && expr.delegate) { - var result = self.makeTempVar(); - - self.emit(b.returnStatement(b.callExpression( - self.contextProperty("delegateYield"), [ - arg, - b.literal(result.property.name), - after - ] - ))); - - self.mark(after); - - return result; - } - - self.emitAssign(self.contextProperty("next"), after); - self.emit(b.returnStatement(arg || null)); - self.mark(after); - - return self.contextProperty("sent"); - - default: - throw new Error( - "unknown Expression of type " + - JSON.stringify(expr.type)); - } -}; - -},{"1":1,"539":539,"540":540,"541":541,"568":568}],538:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var types = _dereq_(568).types; -var n = types.namedTypes; -var b = types.builders; -var hasOwn = Object.prototype.hasOwnProperty; - -// The hoist function takes a FunctionExpression or FunctionDeclaration -// and replaces any Declaration nodes in its body with assignments, then -// returns a VariableDeclaration containing just the names of the removed -// declarations. -exports.hoist = function(funPath) { - assert.ok(funPath instanceof types.NodePath); - n.Function.assert(funPath.value); - - var vars = {}; - - function varDeclToExpr(vdec, includeIdentifiers) { - n.VariableDeclaration.assert(vdec); - var exprs = []; - - vdec.declarations.forEach(function(dec) { - vars[dec.id.name] = dec.id; - - if (dec.init) { - exprs.push(b.assignmentExpression( - "=", dec.id, dec.init - )); - } else if (includeIdentifiers) { - exprs.push(dec.id); - } - }); - - if (exprs.length === 0) - return null; - - if (exprs.length === 1) - return exprs[0]; - - return b.sequenceExpression(exprs); - } - - types.visit(funPath.get("body"), { - visitVariableDeclaration: function(path) { - var expr = varDeclToExpr(path.value, false); - if (expr === null) { - path.replace(); - } else { - // We don't need to traverse this expression any further because - // there can't be any new declarations inside an expression. - return b.expressionStatement(expr); - } - - // Since the original node has been either removed or replaced, - // avoid traversing it any further. - return false; - }, - - visitForStatement: function(path) { - var init = path.value.init; - if (n.VariableDeclaration.check(init)) { - path.get("init").replace(varDeclToExpr(init, false)); - } - this.traverse(path); - }, - - visitForInStatement: function(path) { - var left = path.value.left; - if (n.VariableDeclaration.check(left)) { - path.get("left").replace(varDeclToExpr(left, true)); - } - this.traverse(path); - }, - - visitFunctionDeclaration: function(path) { - var node = path.value; - vars[node.id.name] = node.id; - - var parentNode = path.parent.node; - var assignment = b.expressionStatement( - b.assignmentExpression( - "=", - node.id, - b.functionExpression( - node.id, - node.params, - node.body, - node.generator, - node.expression - ) - ) - ); - - if (n.BlockStatement.check(path.parent.node)) { - // Insert the assignment form before the first statement in the - // enclosing block. - path.parent.get("body").unshift(assignment); - - // Remove the function declaration now that we've inserted the - // equivalent assignment form at the beginning of the block. - path.replace(); - - } else { - // If the parent node is not a block statement, then we can just - // replace the declaration with the equivalent assignment form - // without worrying about hoisting it. - path.replace(assignment); - } - - // Don't hoist variables out of inner functions. - return false; - }, - - visitFunctionExpression: function(path) { - // Don't descend into nested function expressions. - return false; - } - }); - - var paramNames = {}; - funPath.get("params").each(function(paramPath) { - var param = paramPath.value; - if (n.Identifier.check(param)) { - paramNames[param.name] = param; - } else { - // Variables declared by destructuring parameter patterns will be - // harmlessly re-declared. - } - }); - - var declarations = []; - - Object.keys(vars).forEach(function(name) { - if (!hasOwn.call(paramNames, name)) { - declarations.push(b.variableDeclarator(vars[name], null)); - } - }); - - if (declarations.length === 0) { - return null; // Be sure to handle this case! - } - - return b.variableDeclaration("var", declarations); -}; - -},{"1":1,"568":568}],539:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var types = _dereq_(568).types; -var n = types.namedTypes; -var b = types.builders; -var inherits = _dereq_(13).inherits; -var hasOwn = Object.prototype.hasOwnProperty; - -function Entry() { - assert.ok(this instanceof Entry); -} - -function FunctionEntry(returnLoc) { - Entry.call(this); - n.Literal.assert(returnLoc); - this.returnLoc = returnLoc; -} - -inherits(FunctionEntry, Entry); -exports.FunctionEntry = FunctionEntry; - -function LoopEntry(breakLoc, continueLoc, label) { - Entry.call(this); - - n.Literal.assert(breakLoc); - n.Literal.assert(continueLoc); - - if (label) { - n.Identifier.assert(label); - } else { - label = null; - } - - this.breakLoc = breakLoc; - this.continueLoc = continueLoc; - this.label = label; -} - -inherits(LoopEntry, Entry); -exports.LoopEntry = LoopEntry; - -function SwitchEntry(breakLoc) { - Entry.call(this); - n.Literal.assert(breakLoc); - this.breakLoc = breakLoc; -} - -inherits(SwitchEntry, Entry); -exports.SwitchEntry = SwitchEntry; - -function TryEntry(firstLoc, catchEntry, finallyEntry) { - Entry.call(this); - - n.Literal.assert(firstLoc); - - if (catchEntry) { - assert.ok(catchEntry instanceof CatchEntry); - } else { - catchEntry = null; - } - - if (finallyEntry) { - assert.ok(finallyEntry instanceof FinallyEntry); - } else { - finallyEntry = null; - } - - // Have to have one or the other (or both). - assert.ok(catchEntry || finallyEntry); - - this.firstLoc = firstLoc; - this.catchEntry = catchEntry; - this.finallyEntry = finallyEntry; -} - -inherits(TryEntry, Entry); -exports.TryEntry = TryEntry; - -function CatchEntry(firstLoc, paramId) { - Entry.call(this); - - n.Literal.assert(firstLoc); - n.Identifier.assert(paramId); - - this.firstLoc = firstLoc; - this.paramId = paramId; -} - -inherits(CatchEntry, Entry); -exports.CatchEntry = CatchEntry; - -function FinallyEntry(firstLoc, afterLoc) { - Entry.call(this); - n.Literal.assert(firstLoc); - n.Literal.assert(afterLoc); - this.firstLoc = firstLoc; - this.afterLoc = afterLoc; -} - -inherits(FinallyEntry, Entry); -exports.FinallyEntry = FinallyEntry; - -function LabeledEntry(breakLoc, label) { - Entry.call(this); - - n.Literal.assert(breakLoc); - n.Identifier.assert(label); - - this.breakLoc = breakLoc; - this.label = label; -} - -inherits(LabeledEntry, Entry); -exports.LabeledEntry = LabeledEntry; - -function LeapManager(emitter) { - assert.ok(this instanceof LeapManager); - - var Emitter = _dereq_(537).Emitter; - assert.ok(emitter instanceof Emitter); - - this.emitter = emitter; - this.entryStack = [new FunctionEntry(emitter.finalLoc)]; -} - -var LMp = LeapManager.prototype; -exports.LeapManager = LeapManager; - -LMp.withEntry = function(entry, callback) { - assert.ok(entry instanceof Entry); - this.entryStack.push(entry); - try { - callback.call(this.emitter); - } finally { - var popped = this.entryStack.pop(); - assert.strictEqual(popped, entry); - } -}; - -LMp._findLeapLocation = function(property, label) { - for (var i = this.entryStack.length - 1; i >= 0; --i) { - var entry = this.entryStack[i]; - var loc = entry[property]; - if (loc) { - if (label) { - if (entry.label && - entry.label.name === label.name) { - return loc; - } - } else if (entry instanceof LabeledEntry) { - // Ignore LabeledEntry entries unless we are actually breaking to - // a label. - } else { - return loc; - } - } - } - - return null; -}; - -LMp.getBreakLoc = function(label) { - return this._findLeapLocation("breakLoc", label); -}; - -LMp.getContinueLoc = function(label) { - return this._findLeapLocation("continueLoc", label); -}; - -},{"1":1,"13":13,"537":537,"568":568}],540:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var m = _dereq_(536).makeAccessor(); -var types = _dereq_(568).types; -var isArray = types.builtInTypes.array; -var n = types.namedTypes; -var hasOwn = Object.prototype.hasOwnProperty; - -function makePredicate(propertyName, knownTypes) { - function onlyChildren(node) { - n.Node.assert(node); - - // Assume no side effects until we find out otherwise. - var result = false; - - function check(child) { - if (result) { - // Do nothing. - } else if (isArray.check(child)) { - child.some(check); - } else if (n.Node.check(child)) { - assert.strictEqual(result, false); - result = predicate(child); - } - return result; - } - - types.eachField(node, function(name, child) { - check(child); - }); - - return result; - } - - function predicate(node) { - n.Node.assert(node); - - var meta = m(node); - if (hasOwn.call(meta, propertyName)) - return meta[propertyName]; - - // Certain types are "opaque," which means they have no side - // effects or leaps and we don't care about their subexpressions. - if (hasOwn.call(opaqueTypes, node.type)) - return meta[propertyName] = false; - - if (hasOwn.call(knownTypes, node.type)) - return meta[propertyName] = true; - - return meta[propertyName] = onlyChildren(node); - } - - predicate.onlyChildren = onlyChildren; - - return predicate; -} - -var opaqueTypes = { - FunctionExpression: true -}; - -// These types potentially have side effects regardless of what side -// effects their subexpressions have. -var sideEffectTypes = { - CallExpression: true, // Anything could happen! - ForInStatement: true, // Modifies the key variable. - UnaryExpression: true, // Think delete. - BinaryExpression: true, // Might invoke .toString() or .valueOf(). - AssignmentExpression: true, // Side-effecting by definition. - UpdateExpression: true, // Updates are essentially assignments. - NewExpression: true // Similar to CallExpression. -}; - -// These types are the direct cause of all leaps in control flow. -var leapTypes = { - YieldExpression: true, - BreakStatement: true, - ContinueStatement: true, - ReturnStatement: true, - ThrowStatement: true -}; - -// All leap types are also side effect types. -for (var type in leapTypes) { - if (hasOwn.call(leapTypes, type)) { - sideEffectTypes[type] = leapTypes[type]; - } -} - -exports.hasSideEffects = makePredicate("hasSideEffects", sideEffectTypes); -exports.containsLeap = makePredicate("containsLeap", leapTypes); - -},{"1":1,"536":536,"568":568}],541:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var types = _dereq_(568).types; -var n = types.namedTypes; -var b = types.builders; -var hasOwn = Object.prototype.hasOwnProperty; - -exports.defaults = function(obj) { - var len = arguments.length; - var extension; - - for (var i = 1; i < len; ++i) { - if ((extension = arguments[i])) { - for (var key in extension) { - if (hasOwn.call(extension, key) && !hasOwn.call(obj, key)) { - obj[key] = extension[key]; - } - } - } - } - - return obj; -}; - -exports.runtimeProperty = function(name) { - return b.memberExpression( - b.identifier("regeneratorRuntime"), - b.identifier(name), - false - ); -}; - -// Inspired by the isReference function from ast-util: -// https://github.com/eventualbuddha/ast-util/blob/9bf91c5ce8/lib/index.js#L466-L506 -exports.isReference = function(path, name) { - var node = path.value; - - if (!n.Identifier.check(node)) { - return false; - } - - if (name && node.name !== name) { - return false; - } - - var parent = path.parent.value; - - switch (parent.type) { - case "VariableDeclarator": - return path.name === "init"; - - case "MemberExpression": - return path.name === "object" || ( - parent.computed && path.name === "property" - ); - - case "FunctionExpression": - case "FunctionDeclaration": - case "ArrowFunctionExpression": - if (path.name === "id") { - return false; - } - - if (path.parentPath.name === "params" && - parent.params === path.parentPath.value && - parent.params[path.name] === node) { - return false; - } - - return true; - - case "ClassDeclaration": - case "ClassExpression": - return path.name !== "id"; - - case "CatchClause": - return path.name !== "param"; - - case "Property": - case "MethodDefinition": - return path.name !== "key"; - - case "ImportSpecifier": - case "ImportDefaultSpecifier": - case "ImportNamespaceSpecifier": - case "LabeledStatement": - return false; - - default: - return true; - } -}; - -},{"1":1,"568":568}],542:[function(_dereq_,module,exports){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var fs = _dereq_(3); -var recast = _dereq_(568); -var types = recast.types; -var n = types.namedTypes; -var b = types.builders; -var isArray = types.builtInTypes.array; -var isObject = types.builtInTypes.object; -var NodePath = types.NodePath; -var hoist = _dereq_(538).hoist; -var Emitter = _dereq_(537).Emitter; -var util = _dereq_(541); -var runtimeProperty = util.runtimeProperty; -var getMarkInfo = _dereq_(536).makeAccessor(); - -exports.transform = function transform(node, options) { - options = options || {}; - - var path = node instanceof NodePath ? node : new NodePath(node); - visitor.visit(path, options); - node = path.value; - - if (options.includeRuntime === true || - (options.includeRuntime === 'if used' && visitor.wasChangeReported())) { - injectRuntime(n.File.check(node) ? node.program : node); - } - - options.madeChanges = visitor.wasChangeReported(); - - return node; -}; - -function injectRuntime(program) { - n.Program.assert(program); - - // Include the runtime by modifying the AST rather than by concatenating - // strings. This technique will allow for more accurate source mapping. - var runtimePath = _dereq_(543).runtime.path; - var runtime = fs.readFileSync(runtimePath, "utf8"); - var runtimeBody = recast.parse(runtime, { - sourceFileName: runtimePath - }).program.body; - - var body = program.body; - body.unshift.apply(body, runtimeBody); -} - -var visitor = types.PathVisitor.fromMethodsObject({ - reset: function(node, options) { - this.options = options; - }, - - visitFunction: function(path) { - // Calling this.traverse(path) first makes for a post-order traversal. - this.traverse(path); - - var node = path.value; - var shouldTransformAsync = node.async && !this.options.disableAsync; - - if (!node.generator && !shouldTransformAsync) { - return; - } - - this.reportChanged(); - - if (node.expression) { - // Transform expression lambdas into normal functions. - node.expression = false; - node.body = b.blockStatement([ - b.returnStatement(node.body) - ]); - } - - if (shouldTransformAsync) { - awaitVisitor.visit(path.get("body")); - } - - var outerBody = []; - var innerBody = []; - var bodyPath = path.get("body", "body"); - - bodyPath.each(function(childPath) { - var node = childPath.value; - if (node && node._blockHoist != null) { - outerBody.push(node); - } else { - innerBody.push(node); - } - }); - - if (outerBody.length > 0) { - // Only replace the inner body if we actually hoisted any statements - // to the outer body. - bodyPath.replace(innerBody); - } - - var outerFnExpr = getOuterFnExpr(path); - // Note that getOuterFnExpr has the side-effect of ensuring that the - // function has a name (so node.id will always be an Identifier), even - // if a temporary name has to be synthesized. - n.Identifier.assert(node.id); - var innerFnId = b.identifier(node.id.name + "$"); - var contextId = path.scope.declareTemporary("context$"); - var argsId = path.scope.declareTemporary("args$"); - - // Turn all declarations into vars, and replace the original - // declarations with equivalent assignment expressions. - var vars = hoist(path); - - var didRenameArguments = renameArguments(path, argsId); - if (didRenameArguments) { - vars = vars || b.variableDeclaration("var", []); - vars.declarations.push(b.variableDeclarator( - argsId, b.identifier("arguments") - )); - } - - var emitter = new Emitter(contextId); - emitter.explode(path.get("body")); - - if (vars && vars.declarations.length > 0) { - outerBody.push(vars); - } - - var wrapArgs = [ - emitter.getContextFunction(innerFnId), - // Async functions that are not generators don't care about the - // outer function because they don't need it to be marked and don't - // inherit from its .prototype. - node.generator ? outerFnExpr : b.literal(null), - b.thisExpression() - ]; - - var tryLocsList = emitter.getTryLocsList(); - if (tryLocsList) { - wrapArgs.push(tryLocsList); - } - - var wrapCall = b.callExpression( - runtimeProperty(shouldTransformAsync ? "async" : "wrap"), - wrapArgs - ); - - outerBody.push(b.returnStatement(wrapCall)); - node.body = b.blockStatement(outerBody); - - var wasGeneratorFunction = node.generator; - if (wasGeneratorFunction) { - node.generator = false; - } - - if (shouldTransformAsync) { - node.async = false; - } - - if (wasGeneratorFunction && - n.Expression.check(node)) { - return b.callExpression(runtimeProperty("mark"), [node]); - } - }, - - visitForOfStatement: function(path) { - this.traverse(path); - - var node = path.value; - var tempIterId = path.scope.declareTemporary("t$"); - var tempIterDecl = b.variableDeclarator( - tempIterId, - b.callExpression( - runtimeProperty("values"), - [node.right] - ) - ); - - var tempInfoId = path.scope.declareTemporary("t$"); - var tempInfoDecl = b.variableDeclarator(tempInfoId, null); - - var init = node.left; - var loopId; - if (n.VariableDeclaration.check(init)) { - loopId = init.declarations[0].id; - init.declarations.push(tempIterDecl, tempInfoDecl); - } else { - loopId = init; - init = b.variableDeclaration("var", [ - tempIterDecl, - tempInfoDecl - ]); - } - n.Identifier.assert(loopId); - - var loopIdAssignExprStmt = b.expressionStatement( - b.assignmentExpression( - "=", - loopId, - b.memberExpression( - tempInfoId, - b.identifier("value"), - false - ) - ) - ); - - if (n.BlockStatement.check(node.body)) { - node.body.body.unshift(loopIdAssignExprStmt); - } else { - node.body = b.blockStatement([ - loopIdAssignExprStmt, - node.body - ]); - } - - return b.forStatement( - init, - b.unaryExpression( - "!", - b.memberExpression( - b.assignmentExpression( - "=", - tempInfoId, - b.callExpression( - b.memberExpression( - tempIterId, - b.identifier("next"), - false - ), - [] - ) - ), - b.identifier("done"), - false - ) - ), - null, - node.body - ); - } -}); - -// Given a NodePath for a Function, return an Expression node that can be -// used to refer reliably to the function object from inside the function. -// This expression is essentially a replacement for arguments.callee, with -// the key advantage that it works in strict mode. -function getOuterFnExpr(funPath) { - var node = funPath.value; - n.Function.assert(node); - - if (node.generator && // Non-generator functions don't need to be marked. - n.FunctionDeclaration.check(node)) { - var pp = funPath.parent; - - while (pp && !(n.BlockStatement.check(pp.value) || - n.Program.check(pp.value))) { - pp = pp.parent; - } - - if (!pp) { - return node.id; - } - - var markDecl = getRuntimeMarkDecl(pp); - var markedArray = markDecl.declarations[0].id; - var funDeclIdArray = markDecl.declarations[0].init.callee.object; - n.ArrayExpression.assert(funDeclIdArray); - - var index = funDeclIdArray.elements.length; - funDeclIdArray.elements.push(node.id); - - return b.memberExpression( - markedArray, - b.literal(index), - true - ); - } - - return node.id || ( - node.id = funPath.scope.parent.declareTemporary("callee$") - ); -} - -function getRuntimeMarkDecl(blockPath) { - assert.ok(blockPath instanceof NodePath); - var block = blockPath.node; - isArray.assert(block.body); - - var info = getMarkInfo(block); - if (info.decl) { - return info.decl; - } - - info.decl = b.variableDeclaration("var", [ - b.variableDeclarator( - blockPath.scope.declareTemporary("marked"), - b.callExpression( - b.memberExpression( - b.arrayExpression([]), - b.identifier("map"), - false - ), - [runtimeProperty("mark")] - ) - ) - ]); - - for (var i = 0; i < block.body.length; ++i) { - if (!shouldNotHoistAbove(blockPath.get("body", i))) { - break; - } - } - - blockPath.get("body").insertAt(i, info.decl); - - return info.decl; -} - -function shouldNotHoistAbove(stmtPath) { - var value = stmtPath.value; - n.Statement.assert(value); - - // If the first statement is a "use strict" declaration, make sure to - // insert hoisted declarations afterwards. - return n.ExpressionStatement.check(value) && - n.Literal.check(value.expression) && - value.expression.value === "use strict"; -} - -function renameArguments(funcPath, argsId) { - assert.ok(funcPath instanceof types.NodePath); - var func = funcPath.value; - var didRenameArguments = false; - - recast.visit(funcPath, { - visitFunction: function(path) { - if (path.value === func) { - this.traverse(path); - } else { - return false; - } - }, - - visitIdentifier: function(path) { - if (path.value.name === "arguments" && - util.isReference(path)) { - path.replace(argsId); - didRenameArguments = true; - return false; - } - - this.traverse(path); - } - }); - - // If the traversal replaced any arguments references, then we need to - // alias the outer function's arguments binding (be it the implicit - // arguments object or some other parameter or variable) to the variable - // named by argsId. - return didRenameArguments; -} - -var awaitVisitor = types.PathVisitor.fromMethodsObject({ - visitFunction: function(path) { - return false; // Don't descend into nested function scopes. - }, - - visitAwaitExpression: function(path) { - // Convert await and await* expressions to yield expressions. - var argument = path.value.argument; - - // If the parser supports await* syntax using a boolean .all property - // (#171), desugar that syntax to yield Promise.all(argument). - if (path.value.all) { - argument = b.callExpression( - b.memberExpression( - b.identifier("Promise"), - b.identifier("all"), - false - ), - [argument] - ); - } - - // Transforming `await x` to `yield regeneratorRuntime.awrap(x)` - // causes the argument to be wrapped in such a way that the runtime - // can distinguish between awaited and merely yielded values. - return b.yieldExpression( - b.callExpression( - runtimeProperty("awrap"), - [argument] - ), - false - ); - } -}); - -},{"1":1,"3":3,"536":536,"537":537,"538":538,"541":541,"543":543,"568":568}],543:[function(_dereq_,module,exports){ -(function (__dirname){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -var assert = _dereq_(1); -var path = _dereq_(9); -var fs = _dereq_(3); -var through = _dereq_(3); -var transform = _dereq_(542).transform; -var utils = _dereq_(541); -var recast = _dereq_(568); -var types = recast.types; -var genOrAsyncFunExp = /\bfunction\s*\*|\basync\b/; -var blockBindingExp = /\b(let|const)\s+/; - -function exports(file, options) { - var data = []; - return through(write, end); - - function write(buf) { - data.push(buf); - } - - function end() { - this.queue(compile(data.join(""), options).code); - this.queue(null); - } -} - -// To get a writable stream for use as a browserify transform, call -// require("regenerator")(). -module.exports = exports; - -// To include the runtime globally in the current node process, call -// require("regenerator").runtime(). -function runtime() { - _dereq_(585); -} -exports.runtime = runtime; -runtime.path = path.join(__dirname, "runtime.js"); - -function compile(source, options) { - options = normalizeOptions(options); - - if (!genOrAsyncFunExp.test(source)) { - return { - // Shortcut: no generators or async functions to transform. - code: (options.includeRuntime === true ? fs.readFileSync( - path.join(__dirname, "runtime.js"), "utf-8" - ) + "\n" : "") + source - }; - } - - var recastOptions = getRecastOptions(options); - var ast = recast.parse(source, recastOptions); - var nodePath = new types.NodePath(ast); - var programPath = nodePath.get("program"); - - if (shouldVarify(source, options)) { - // Transpile let/const into var declarations. - varifyAst(programPath.node); - } - - transform(programPath, options); - - return recast.print(nodePath, recastOptions); -} - -function normalizeOptions(options) { - options = utils.defaults(options || {}, { - includeRuntime: false, - supportBlockBinding: true - }); - - if (!options.esprima) { - options.esprima = _dereq_(3); - } - - assert.ok( - /harmony/.test(options.esprima.version), - "Bad esprima version: " + options.esprima.version - ); - - return options; -} - -function getRecastOptions(options) { - var recastOptions = { - range: true - }; - - function copy(name) { - if (name in options) { - recastOptions[name] = options[name]; - } - } - - copy("esprima"); - copy("sourceFileName"); - copy("sourceMapName"); - copy("inputSourceMap"); - copy("sourceRoot"); - - return recastOptions; -} - -function shouldVarify(source, options) { - var supportBlockBinding = !!options.supportBlockBinding; - if (supportBlockBinding) { - if (!blockBindingExp.test(source)) { - supportBlockBinding = false; - } - } - - return supportBlockBinding; -} - -function varify(source, options) { - var recastOptions = getRecastOptions(normalizeOptions(options)); - var ast = recast.parse(source, recastOptions); - varifyAst(ast.program); - return recast.print(ast, recastOptions).code; -} - -function varifyAst(ast) { - types.namedTypes.Program.assert(ast); - - var defsResult = _dereq_(544)(ast, { - ast: true, - disallowUnknownReferences: false, - disallowDuplicated: false, - disallowVars: false, - loopClosures: "iife" - }); - - if (defsResult.errors) { - throw new Error(defsResult.errors.join("\n")) - } - - return ast; -} - -// Convenience for just translating let/const to var declarations. -exports.varify = varify; - -// Allow packages that depend on Regenerator to use the same copy of -// ast-types, in case multiple versions are installed by NPM. -exports.types = types; - -// Transforms a string of source code, returning the { code, map? } result -// from recast.print. -exports.compile = compile; - -// To modify an AST directly, call require("regenerator").transform(ast). -exports.transform = transform; - -}).call(this,"/node_modules/regenerator") -},{"1":1,"3":3,"541":541,"542":542,"544":544,"568":568,"585":585,"9":9}],544:[function(_dereq_,module,exports){ -"use strict"; - -var assert = _dereq_(1); -var is = _dereq_(555); -var fmt = _dereq_(554); -var stringmap = _dereq_(556); -var stringset = _dereq_(557); -var alter = _dereq_(550); -var traverse = _dereq_(552); -var breakable = _dereq_(553); -var Scope = _dereq_(548); -var error = _dereq_(545); -var getline = error.getline; -var options = _dereq_(547); -var Stats = _dereq_(549); -var jshint_vars = _dereq_(546); - - -function isConstLet(kind) { - return is.someof(kind, ["const", "let"]); -} - -function isVarConstLet(kind) { - return is.someof(kind, ["var", "const", "let"]); -} - -function isNonFunctionBlock(node) { - return node.type === "BlockStatement" && is.noneof(node.$parent.type, ["FunctionDeclaration", "FunctionExpression"]); -} - -function isForWithConstLet(node) { - return node.type === "ForStatement" && node.init && node.init.type === "VariableDeclaration" && isConstLet(node.init.kind); -} - -function isForInOfWithConstLet(node) { - return isForInOf(node) && node.left.type === "VariableDeclaration" && isConstLet(node.left.kind); -} - -function isForInOf(node) { - return is.someof(node.type, ["ForInStatement", "ForOfStatement"]); -} - -function isFunction(node) { - return is.someof(node.type, ["FunctionDeclaration", "FunctionExpression"]); -} - -function isLoop(node) { - return is.someof(node.type, ["ForStatement", "ForInStatement", "ForOfStatement", "WhileStatement", "DoWhileStatement"]); -} - -function isReference(node) { - var parent = node.$parent; - return node.$refToScope || - node.type === "Identifier" && - !(parent.type === "VariableDeclarator" && parent.id === node) && // var|let|const $ - !(parent.type === "MemberExpression" && parent.computed === false && parent.property === node) && // obj.$ - !(parent.type === "Property" && parent.key === node) && // {$: ...} - !(parent.type === "LabeledStatement" && parent.label === node) && // $: ... - !(parent.type === "CatchClause" && parent.param === node) && // catch($) - !(isFunction(parent) && parent.id === node) && // function $(.. - !(isFunction(parent) && is.someof(node, parent.params)) && // function f($).. - true; -} - -function isLvalue(node) { - return isReference(node) && - ((node.$parent.type === "AssignmentExpression" && node.$parent.left === node) || - (node.$parent.type === "UpdateExpression" && node.$parent.argument === node)); -} - -function createScopes(node, parent) { - assert(!node.$scope); - - node.$parent = parent; - node.$scope = node.$parent ? node.$parent.$scope : null; // may be overridden - - if (node.type === "Program") { - // Top-level program is a scope - // There's no block-scope under it - node.$scope = new Scope({ - kind: "hoist", - node: node, - parent: null, - }); - - } else if (isFunction(node)) { - // Function is a scope, with params in it - // There's no block-scope under it - - node.$scope = new Scope({ - kind: "hoist", - node: node, - parent: node.$parent.$scope, - }); - - // function has a name - if (node.id) { - assert(node.id.type === "Identifier"); - - if (node.type === "FunctionDeclaration") { - // Function name goes in parent scope for declared functions - node.$parent.$scope.add(node.id.name, "fun", node.id, null); - } else if (node.type === "FunctionExpression") { - // Function name goes in function's scope for named function expressions - node.$scope.add(node.id.name, "fun", node.id, null); - } else { - assert(false); - } - } - - node.params.forEach(function(param) { - node.$scope.add(param.name, "param", param, null); - }); - - } else if (node.type === "VariableDeclaration") { - // Variable declarations names goes in current scope - assert(isVarConstLet(node.kind)); - node.declarations.forEach(function(declarator) { - assert(declarator.type === "VariableDeclarator"); - var name = declarator.id.name; - if (options.disallowVars && node.kind === "var") { - error(getline(declarator), "var {0} is not allowed (use let or const)", name); - } - node.$scope.add(name, node.kind, declarator.id, declarator.range[1]); - }); - - } else if (isForWithConstLet(node) || isForInOfWithConstLet(node)) { - // For(In/Of) loop with const|let declaration is a scope, with declaration in it - // There may be a block-scope under it - node.$scope = new Scope({ - kind: "block", - node: node, - parent: node.$parent.$scope, - }); - - } else if (isNonFunctionBlock(node)) { - // A block node is a scope unless parent is a function - node.$scope = new Scope({ - kind: "block", - node: node, - parent: node.$parent.$scope, - }); - - } else if (node.type === "CatchClause") { - var identifier = node.param; - - node.$scope = new Scope({ - kind: "catch-block", - node: node, - parent: node.$parent.$scope, - }); - node.$scope.add(identifier.name, "caught", identifier, null); - - // All hoist-scope keeps track of which variables that are propagated through, - // i.e. an reference inside the scope points to a declaration outside the scope. - // This is used to mark "taint" the name since adding a new variable in the scope, - // with a propagated name, would change the meaning of the existing references. - // - // catch(e) is special because even though e is a variable in its own scope, - // we want to make sure that catch(e){let e} is never transformed to - // catch(e){var e} (but rather var e$0). For that reason we taint the use of e - // in the closest hoist-scope, i.e. where var e$0 belongs. - node.$scope.closestHoistScope().markPropagates(identifier.name); - } -} - -function createTopScope(programScope, environments, globals) { - function inject(obj) { - for (var name in obj) { - var writeable = obj[name]; - var kind = (writeable ? "var" : "const"); - if (topScope.hasOwn(name)) { - topScope.remove(name); - } - topScope.add(name, kind, {loc: {start: {line: -1}}}, -1); - } - } - - var topScope = new Scope({ - kind: "hoist", - node: {}, - parent: null, - }); - - var complementary = { - undefined: false, - Infinity: false, - console: false, - }; - - inject(complementary); - inject(jshint_vars.reservedVars); - inject(jshint_vars.ecmaIdentifiers); - if (environments) { - environments.forEach(function(env) { - if (!jshint_vars[env]) { - error(-1, 'environment "{0}" not found', env); - } else { - inject(jshint_vars[env]); - } - }); - } - if (globals) { - inject(globals); - } - - // link it in - programScope.parent = topScope; - topScope.children.push(programScope); - - return topScope; -} - -function setupReferences(ast, allIdentifiers, opts) { - var analyze = (is.own(opts, "analyze") ? opts.analyze : true); - - function visit(node) { - if (!isReference(node)) { - return; - } - allIdentifiers.add(node.name); - - var scope = node.$scope.lookup(node.name); - if (analyze && !scope && options.disallowUnknownReferences) { - error(getline(node), "reference to unknown global variable {0}", node.name); - } - // check const and let for referenced-before-declaration - if (analyze && scope && is.someof(scope.getKind(node.name), ["const", "let"])) { - var allowedFromPos = scope.getFromPos(node.name); - var referencedAtPos = node.range[0]; - assert(is.finitenumber(allowedFromPos)); - assert(is.finitenumber(referencedAtPos)); - if (referencedAtPos < allowedFromPos) { - if (!node.$scope.hasFunctionScopeBetween(scope)) { - error(getline(node), "{0} is referenced before its declaration", node.name); - } - } - } - node.$refToScope = scope; - } - - traverse(ast, {pre: visit}); -} - -// TODO for loops init and body props are parallel to each other but init scope is outer that of body -// TODO is this a problem? - -function varify(ast, stats, allIdentifiers, changes) { - function unique(name) { - assert(allIdentifiers.has(name)); - for (var cnt = 0; ; cnt++) { - var genName = name + "$" + String(cnt); - if (!allIdentifiers.has(genName)) { - return genName; - } - } - } - - function renameDeclarations(node) { - if (node.type === "VariableDeclaration" && isConstLet(node.kind)) { - var hoistScope = node.$scope.closestHoistScope(); - var origScope = node.$scope; - - // text change const|let => var - changes.push({ - start: node.range[0], - end: node.range[0] + node.kind.length, - str: "var", - }); - - node.declarations.forEach(function(declarator) { - assert(declarator.type === "VariableDeclarator"); - var name = declarator.id.name; - - stats.declarator(node.kind); - - // rename if - // 1) name already exists in hoistScope, or - // 2) name is already propagated (passed) through hoistScope or manually tainted - var rename = (origScope !== hoistScope && - (hoistScope.hasOwn(name) || hoistScope.doesPropagate(name))); - - var newName = (rename ? unique(name) : name); - - origScope.remove(name); - hoistScope.add(newName, "var", declarator.id, declarator.range[1]); - - origScope.moves = origScope.moves || stringmap(); - origScope.moves.set(name, { - name: newName, - scope: hoistScope, - }); - - allIdentifiers.add(newName); - - if (newName !== name) { - stats.rename(name, newName, getline(declarator)); - - declarator.id.originalName = name; - declarator.id.name = newName; - - // textchange var x => var x$1 - changes.push({ - start: declarator.id.range[0], - end: declarator.id.range[1], - str: newName, - }); - } - }); - - // ast change const|let => var - node.kind = "var"; - } - } - - function renameReferences(node) { - if (!node.$refToScope) { - return; - } - var move = node.$refToScope.moves && node.$refToScope.moves.get(node.name); - if (!move) { - return; - } - node.$refToScope = move.scope; - - if (node.name !== move.name) { - node.originalName = node.name; - node.name = move.name; - - if (node.alterop) { - // node has no range because it is the result of another alter operation - var existingOp = null; - for (var i = 0; i < changes.length; i++) { - var op = changes[i]; - if (op.node === node) { - existingOp = op; - break; - } - } - assert(existingOp); - - // modify op - existingOp.str = move.name; - } else { - changes.push({ - start: node.range[0], - end: node.range[1], - str: move.name, - }); - } - } - } - - traverse(ast, {pre: renameDeclarations}); - traverse(ast, {pre: renameReferences}); - ast.$scope.traverse({pre: function(scope) { - delete scope.moves; - }}); -} - - -function detectLoopClosures(ast) { - traverse(ast, {pre: visit}); - - function detectIifyBodyBlockers(body, node) { - return breakable(function(brk) { - traverse(body, {pre: function(n) { - // if we hit an inner function of the loop body, don't traverse further - if (isFunction(n)) { - return false; - } - - var err = true; // reset to false in else-statement below - var msg = "loop-variable {0} is captured by a loop-closure that can't be transformed due to use of {1} at line {2}"; - if (n.type === "BreakStatement") { - error(getline(node), msg, node.name, "break", getline(n)); - } else if (n.type === "ContinueStatement") { - error(getline(node), msg, node.name, "continue", getline(n)); - } else if (n.type === "ReturnStatement") { - error(getline(node), msg, node.name, "return", getline(n)); - } else if (n.type === "YieldExpression") { - error(getline(node), msg, node.name, "yield", getline(n)); - } else if (n.type === "Identifier" && n.name === "arguments") { - error(getline(node), msg, node.name, "arguments", getline(n)); - } else if (n.type === "VariableDeclaration" && n.kind === "var") { - error(getline(node), msg, node.name, "var", getline(n)); - } else { - err = false; - } - if (err) { - brk(true); // break traversal - } - }}); - return false; - }); - } - - function visit(node) { - // forbidden pattern: - // * * * * - var loopNode = null; - if (isReference(node) && node.$refToScope && isConstLet(node.$refToScope.getKind(node.name))) { - // traverse nodes up towards root from constlet-def - // if we hit a function (before a loop) - ok! - // if we hit a loop - maybe-ouch - // if we reach root - ok! - for (var n = node.$refToScope.node; ; ) { - if (isFunction(n)) { - // we're ok (function-local) - return; - } else if (isLoop(n)) { - loopNode = n; - // maybe not ok (between loop and function) - break; - } - n = n.$parent; - if (!n) { - // ok (reached root) - return; - } - } - - assert(isLoop(loopNode)); - - // traverse scopes from reference-scope up towards definition-scope - // if we hit a function, ouch! - var defScope = node.$refToScope; - var generateIIFE = (options.loopClosures === "iife"); - - for (var s = node.$scope; s; s = s.parent) { - if (s === defScope) { - // we're ok - return; - } else if (isFunction(s.node)) { - // not ok (there's a function between the reference and definition) - // may be transformable via IIFE - - if (!generateIIFE) { - var msg = "loop-variable {0} is captured by a loop-closure. Tried \"loopClosures\": \"iife\" in defs-config.json?"; - return error(getline(node), msg, node.name); - } - - // here be dragons - // for (let x = ..; .. ; ..) { (function(){x})() } is forbidden because of current - // spec and VM status - if (loopNode.type === "ForStatement" && defScope.node === loopNode) { - var declarationNode = defScope.getNode(node.name); - return error(getline(declarationNode), "Not yet specced ES6 feature. {0} is declared in for-loop header and then captured in loop closure", declarationNode.name); - } - - // speak now or forever hold your peace - if (detectIifyBodyBlockers(loopNode.body, node)) { - // error already generated - return; - } - - // mark loop for IIFE-insertion - loopNode.$iify = true; - } - } - } - } -} - -function transformLoopClosures(root, ops, options) { - function insertOp(pos, str, node) { - var op = { - start: pos, - end: pos, - str: str, - } - if (node) { - op.node = node; - } - ops.push(op); - } - - traverse(root, {pre: function(node) { - if (!node.$iify) { - return; - } - - var hasBlock = (node.body.type === "BlockStatement"); - - var insertHead = (hasBlock ? - node.body.range[0] + 1 : // just after body { - node.body.range[0]); // just before existing expression - var insertFoot = (hasBlock ? - node.body.range[1] - 1 : // just before body } - node.body.range[1]); // just after existing expression - - var forInName = (isForInOf(node) && node.left.declarations[0].id.name);; - var iifeHead = fmt("(function({0}){", forInName ? forInName : ""); - var iifeTail = fmt("}).call(this{0});", forInName ? ", " + forInName : ""); - - // modify AST - var iifeFragment = options.parse(iifeHead + iifeTail); - var iifeExpressionStatement = iifeFragment.body[0]; - var iifeBlockStatement = iifeExpressionStatement.expression.callee.object.body; - - if (hasBlock) { - var forBlockStatement = node.body; - var tmp = forBlockStatement.body; - forBlockStatement.body = [iifeExpressionStatement]; - iifeBlockStatement.body = tmp; - } else { - var tmp$0 = node.body; - node.body = iifeExpressionStatement; - iifeBlockStatement.body[0] = tmp$0; - } - - // create ops - insertOp(insertHead, iifeHead); - - if (forInName) { - insertOp(insertFoot, "}).call(this, "); - - var args = iifeExpressionStatement.expression.arguments; - var iifeArgumentIdentifier = args[1]; - iifeArgumentIdentifier.alterop = true; - insertOp(insertFoot, forInName, iifeArgumentIdentifier); - - insertOp(insertFoot, ");"); - } else { - insertOp(insertFoot, iifeTail); - } - }}); -} - -function detectConstAssignment(ast) { - traverse(ast, {pre: function(node) { - if (isLvalue(node)) { - var scope = node.$scope.lookup(node.name); - if (scope && scope.getKind(node.name) === "const") { - error(getline(node), "can't assign to const variable {0}", node.name); - } - } - }}); -} - -function detectConstantLets(ast) { - traverse(ast, {pre: function(node) { - if (isLvalue(node)) { - var scope = node.$scope.lookup(node.name); - if (scope) { - scope.markWrite(node.name); - } - } - }}); - - ast.$scope.detectUnmodifiedLets(); -} - -function setupScopeAndReferences(root, opts) { - // setup scopes - traverse(root, {pre: createScopes}); - var topScope = createTopScope(root.$scope, options.environments, options.globals); - - // allIdentifiers contains all declared and referenced vars - // collect all declaration names (including those in topScope) - var allIdentifiers = stringset(); - topScope.traverse({pre: function(scope) { - allIdentifiers.addMany(scope.decls.keys()); - }}); - - // setup node.$refToScope, check for errors. - // also collects all referenced names to allIdentifiers - setupReferences(root, allIdentifiers, opts); - return allIdentifiers; -} - -function cleanupTree(root) { - traverse(root, {pre: function(node) { - for (var prop in node) { - if (prop[0] === "$") { - delete node[prop]; - } - } - }}); -} - -function run(src, config) { - // alter the options singleton with user configuration - for (var key in config) { - options[key] = config[key]; - } - - var parsed; - - if (is.object(src)) { - if (!options.ast) { - return { - errors: [ - "Can't produce string output when input is an AST. " + - "Did you forget to set options.ast = true?" - ], - }; - } - - // Received an AST object as src, so no need to parse it. - parsed = src; - - } else if (is.string(src)) { - try { - parsed = options.parse(src, { - loc: true, - range: true, - }); - } catch (e) { - return { - errors: [ - fmt("line {0} column {1}: Error during input file parsing\n{2}\n{3}", - e.lineNumber, - e.column, - src.split("\n")[e.lineNumber - 1], - fmt.repeat(" ", e.column - 1) + "^") - ], - }; - } - - } else { - return { - errors: ["Input was neither an AST object nor a string."], - }; - } - - var ast = parsed; - - // TODO detect unused variables (never read) - error.reset(); - - var allIdentifiers = setupScopeAndReferences(ast, {}); - - // static analysis passes - detectLoopClosures(ast); - detectConstAssignment(ast); - //detectConstantLets(ast); - - var changes = []; - transformLoopClosures(ast, changes, options); - - //ast.$scope.print(); process.exit(-1); - - if (error.errors.length >= 1) { - return { - errors: error.errors, - }; - } - - if (changes.length > 0) { - cleanupTree(ast); - allIdentifiers = setupScopeAndReferences(ast, {analyze: false}); - } - assert(error.errors.length === 0); - - // change constlet declarations to var, renamed if needed - // varify modifies the scopes and AST accordingly and - // returns a list of change fragments (to use with alter) - var stats = new Stats(); - varify(ast, stats, allIdentifiers, changes); - - if (options.ast) { - // return the modified AST instead of src code - // get rid of all added $ properties first, such as $parent and $scope - cleanupTree(ast); - return { - stats: stats, - ast: ast, - }; - } else { - // apply changes produced by varify and return the transformed src - var transformedSrc = alter(src, changes); - return { - stats: stats, - src: transformedSrc, - }; - } -} - -module.exports = run; - -},{"1":1,"545":545,"546":546,"547":547,"548":548,"549":549,"550":550,"552":552,"553":553,"554":554,"555":555,"556":556,"557":557}],545:[function(_dereq_,module,exports){ -"use strict"; - -var fmt = _dereq_(554); -var assert = _dereq_(1); - -function error(line, var_args) { - assert(arguments.length >= 2); - - var msg = (arguments.length === 2 ? - String(var_args) : fmt.apply(fmt, Array.prototype.slice.call(arguments, 1))); - - error.errors.push(line === -1 ? msg : fmt("line {0}: {1}", line, msg)); -} - -error.reset = function() { - error.errors = []; -}; - -error.getline = function(node) { - if (node && node.loc && node.loc.start) { - return node.loc.start.line; - } - return -1; -}; - -error.reset(); - -module.exports = error; - -},{"1":1,"554":554}],546:[function(_dereq_,module,exports){ -// jshint -W001 - -"use strict"; - -// Identifiers provided by the ECMAScript standard. - -exports.reservedVars = { - arguments : false, - NaN : false -}; - -exports.ecmaIdentifiers = { - Array : false, - Boolean : false, - Date : false, - decodeURI : false, - decodeURIComponent : false, - encodeURI : false, - encodeURIComponent : false, - Error : false, - "eval" : false, - EvalError : false, - Function : false, - hasOwnProperty : false, - isFinite : false, - isNaN : false, - JSON : false, - Math : false, - Map : false, - Number : false, - Object : false, - parseInt : false, - parseFloat : false, - RangeError : false, - ReferenceError : false, - RegExp : false, - Set : false, - String : false, - SyntaxError : false, - TypeError : false, - URIError : false, - WeakMap : false -}; - -// Global variables commonly provided by a web browser environment. - -exports.browser = { - ArrayBuffer : false, - ArrayBufferView : false, - Audio : false, - Blob : false, - addEventListener : false, - applicationCache : false, - atob : false, - blur : false, - btoa : false, - clearInterval : false, - clearTimeout : false, - close : false, - closed : false, - DataView : false, - DOMParser : false, - defaultStatus : false, - document : false, - Element : false, - event : false, - FileReader : false, - Float32Array : false, - Float64Array : false, - FormData : false, - focus : false, - frames : false, - getComputedStyle : false, - HTMLElement : false, - HTMLAnchorElement : false, - HTMLBaseElement : false, - HTMLBlockquoteElement: false, - HTMLBodyElement : false, - HTMLBRElement : false, - HTMLButtonElement : false, - HTMLCanvasElement : false, - HTMLDirectoryElement : false, - HTMLDivElement : false, - HTMLDListElement : false, - HTMLFieldSetElement : false, - HTMLFontElement : false, - HTMLFormElement : false, - HTMLFrameElement : false, - HTMLFrameSetElement : false, - HTMLHeadElement : false, - HTMLHeadingElement : false, - HTMLHRElement : false, - HTMLHtmlElement : false, - HTMLIFrameElement : false, - HTMLImageElement : false, - HTMLInputElement : false, - HTMLIsIndexElement : false, - HTMLLabelElement : false, - HTMLLayerElement : false, - HTMLLegendElement : false, - HTMLLIElement : false, - HTMLLinkElement : false, - HTMLMapElement : false, - HTMLMenuElement : false, - HTMLMetaElement : false, - HTMLModElement : false, - HTMLObjectElement : false, - HTMLOListElement : false, - HTMLOptGroupElement : false, - HTMLOptionElement : false, - HTMLParagraphElement : false, - HTMLParamElement : false, - HTMLPreElement : false, - HTMLQuoteElement : false, - HTMLScriptElement : false, - HTMLSelectElement : false, - HTMLStyleElement : false, - HTMLTableCaptionElement: false, - HTMLTableCellElement : false, - HTMLTableColElement : false, - HTMLTableElement : false, - HTMLTableRowElement : false, - HTMLTableSectionElement: false, - HTMLTextAreaElement : false, - HTMLTitleElement : false, - HTMLUListElement : false, - HTMLVideoElement : false, - history : false, - Int16Array : false, - Int32Array : false, - Int8Array : false, - Image : false, - length : false, - localStorage : false, - location : false, - MessageChannel : false, - MessageEvent : false, - MessagePort : false, - moveBy : false, - moveTo : false, - MutationObserver : false, - name : false, - Node : false, - NodeFilter : false, - navigator : false, - onbeforeunload : true, - onblur : true, - onerror : true, - onfocus : true, - onload : true, - onresize : true, - onunload : true, - open : false, - openDatabase : false, - opener : false, - Option : false, - parent : false, - print : false, - removeEventListener : false, - resizeBy : false, - resizeTo : false, - screen : false, - scroll : false, - scrollBy : false, - scrollTo : false, - sessionStorage : false, - setInterval : false, - setTimeout : false, - SharedWorker : false, - status : false, - top : false, - Uint16Array : false, - Uint32Array : false, - Uint8Array : false, - Uint8ClampedArray : false, - WebSocket : false, - window : false, - Worker : false, - XMLHttpRequest : false, - XMLSerializer : false, - XPathEvaluator : false, - XPathException : false, - XPathExpression : false, - XPathNamespace : false, - XPathNSResolver : false, - XPathResult : false -}; - -exports.devel = { - alert : false, - confirm: false, - console: false, - Debug : false, - opera : false, - prompt : false -}; - -exports.worker = { - importScripts: true, - postMessage : true, - self : true -}; - -// Widely adopted global names that are not part of ECMAScript standard -exports.nonstandard = { - escape : false, - unescape: false -}; - -// Globals provided by popular JavaScript environments. - -exports.couch = { - "require" : false, - respond : false, - getRow : false, - emit : false, - send : false, - start : false, - sum : false, - log : false, - exports : false, - module : false, - provides : false -}; - -exports.node = { - __filename : false, - __dirname : false, - Buffer : false, - DataView : false, - console : false, - exports : true, // In Node it is ok to exports = module.exports = foo(); - GLOBAL : false, - global : false, - module : false, - process : false, - require : false, - setTimeout : false, - clearTimeout : false, - setInterval : false, - clearInterval: false -}; - -exports.phantom = { - phantom : true, - require : true, - WebPage : true -}; - -exports.rhino = { - defineClass : false, - deserialize : false, - gc : false, - help : false, - importPackage: false, - "java" : false, - load : false, - loadClass : false, - print : false, - quit : false, - readFile : false, - readUrl : false, - runCommand : false, - seal : false, - serialize : false, - spawn : false, - sync : false, - toint32 : false, - version : false -}; - -exports.wsh = { - ActiveXObject : true, - Enumerator : true, - GetObject : true, - ScriptEngine : true, - ScriptEngineBuildVersion : true, - ScriptEngineMajorVersion : true, - ScriptEngineMinorVersion : true, - VBArray : true, - WSH : true, - WScript : true, - XDomainRequest : true -}; - -// Globals provided by popular JavaScript libraries. - -exports.dojo = { - dojo : false, - dijit : false, - dojox : false, - define : false, - "require": false -}; - -exports.jquery = { - "$" : false, - jQuery : false -}; - -exports.mootools = { - "$" : false, - "$$" : false, - Asset : false, - Browser : false, - Chain : false, - Class : false, - Color : false, - Cookie : false, - Core : false, - Document : false, - DomReady : false, - DOMEvent : false, - DOMReady : false, - Drag : false, - Element : false, - Elements : false, - Event : false, - Events : false, - Fx : false, - Group : false, - Hash : false, - HtmlTable : false, - Iframe : false, - IframeShim : false, - InputValidator: false, - instanceOf : false, - Keyboard : false, - Locale : false, - Mask : false, - MooTools : false, - Native : false, - Options : false, - OverText : false, - Request : false, - Scroller : false, - Slick : false, - Slider : false, - Sortables : false, - Spinner : false, - Swiff : false, - Tips : false, - Type : false, - typeOf : false, - URI : false, - Window : false -}; - -exports.prototypejs = { - "$" : false, - "$$" : false, - "$A" : false, - "$F" : false, - "$H" : false, - "$R" : false, - "$break" : false, - "$continue" : false, - "$w" : false, - Abstract : false, - Ajax : false, - Class : false, - Enumerable : false, - Element : false, - Event : false, - Field : false, - Form : false, - Hash : false, - Insertion : false, - ObjectRange : false, - PeriodicalExecuter: false, - Position : false, - Prototype : false, - Selector : false, - Template : false, - Toggle : false, - Try : false, - Autocompleter : false, - Builder : false, - Control : false, - Draggable : false, - Draggables : false, - Droppables : false, - Effect : false, - Sortable : false, - SortableObserver : false, - Sound : false, - Scriptaculous : false -}; - -exports.yui = { - YUI : false, - Y : false, - YUI_config: false -}; - - -},{}],547:[function(_dereq_,module,exports){ -// default configuration - -module.exports = { - disallowVars: false, - disallowDuplicated: true, - disallowUnknownReferences: true, - parse: _dereq_(3).parse, -}; - -},{"3":3}],548:[function(_dereq_,module,exports){ -"use strict"; - -var assert = _dereq_(1); -var stringmap = _dereq_(556); -var stringset = _dereq_(557); -var is = _dereq_(555); -var fmt = _dereq_(554); -var error = _dereq_(545); -var getline = error.getline; -var options = _dereq_(547); - -function Scope(args) { - assert(is.someof(args.kind, ["hoist", "block", "catch-block"])); - assert(is.object(args.node)); - assert(args.parent === null || is.object(args.parent)); - - // kind === "hoist": function scopes, program scope, injected globals - // kind === "block": ES6 block scopes - // kind === "catch-block": catch block scopes - this.kind = args.kind; - - // the AST node the block corresponds to - this.node = args.node; - - // parent scope - this.parent = args.parent; - - // children scopes for easier traversal (populated internally) - this.children = []; - - // scope declarations. decls[variable_name] = { - // kind: "fun" for functions, - // "param" for function parameters, - // "caught" for catch parameter - // "var", - // "const", - // "let" - // node: the AST node the declaration corresponds to - // from: source code index from which it is visible at earliest - // (only stored for "const", "let" [and "var"] nodes) - // } - this.decls = stringmap(); - - // names of all declarations within this scope that was ever written - // TODO move to decls.w? - // TODO create corresponding read? - this.written = stringset(); - - // names of all variables declared outside this hoist scope but - // referenced in this scope (immediately or in child). - // only stored on hoist scopes for efficiency - // (because we currently generate lots of empty block scopes) - this.propagates = (this.kind === "hoist" ? stringset() : null); - - // scopes register themselves with their parents for easier traversal - if (this.parent) { - this.parent.children.push(this); - } -} - -Scope.prototype.print = function(indent) { - indent = indent || 0; - var scope = this; - var names = this.decls.keys().map(function(name) { - return fmt("{0} [{1}]", name, scope.decls.get(name).kind); - }).join(", "); - var propagates = this.propagates ? this.propagates.items().join(", ") : ""; - console.log(fmt("{0}{1}: {2}. propagates: {3}", fmt.repeat(" ", indent), this.node.type, names, propagates)); - this.children.forEach(function(c) { - c.print(indent + 2); - }); -}; - -Scope.prototype.add = function(name, kind, node, referableFromPos) { - assert(is.someof(kind, ["fun", "param", "var", "caught", "const", "let"])); - - function isConstLet(kind) { - return is.someof(kind, ["const", "let"]); - } - - var scope = this; - - // search nearest hoist-scope for fun, param and var's - // const, let and caught variables go directly in the scope (which may be hoist, block or catch-block) - if (is.someof(kind, ["fun", "param", "var"])) { - while (scope.kind !== "hoist") { - if (scope.decls.has(name) && isConstLet(scope.decls.get(name).kind)) { // could be caught - return error(getline(node), "{0} is already declared", name); - } - scope = scope.parent; - } - } - // name exists in scope and either new or existing kind is const|let => error - if (scope.decls.has(name) && (options.disallowDuplicated || isConstLet(scope.decls.get(name).kind) || isConstLet(kind))) { - return error(getline(node), "{0} is already declared", name); - } - - var declaration = { - kind: kind, - node: node, - }; - if (referableFromPos) { - assert(is.someof(kind, ["var", "const", "let"])); - declaration.from = referableFromPos; - } - scope.decls.set(name, declaration); -}; - -Scope.prototype.getKind = function(name) { - assert(is.string(name)); - var decl = this.decls.get(name); - return decl ? decl.kind : null; -}; - -Scope.prototype.getNode = function(name) { - assert(is.string(name)); - var decl = this.decls.get(name); - return decl ? decl.node : null; -}; - -Scope.prototype.getFromPos = function(name) { - assert(is.string(name)); - var decl = this.decls.get(name); - return decl ? decl.from : null; -}; - -Scope.prototype.hasOwn = function(name) { - return this.decls.has(name); -}; - -Scope.prototype.remove = function(name) { - return this.decls.remove(name); -}; - -Scope.prototype.doesPropagate = function(name) { - return this.propagates.has(name); -}; - -Scope.prototype.markPropagates = function(name) { - this.propagates.add(name); -}; - -Scope.prototype.closestHoistScope = function() { - var scope = this; - while (scope.kind !== "hoist") { - scope = scope.parent; - } - return scope; -}; - -Scope.prototype.hasFunctionScopeBetween = function(outer) { - function isFunction(node) { - return is.someof(node.type, ["FunctionDeclaration", "FunctionExpression"]); - } - - for (var scope = this; scope; scope = scope.parent) { - if (scope === outer) { - return false; - } - if (isFunction(scope.node)) { - return true; - } - } - - throw new Error("wasn't inner scope of outer"); -}; - -Scope.prototype.lookup = function(name) { - for (var scope = this; scope; scope = scope.parent) { - if (scope.decls.has(name)) { - return scope; - } else if (scope.kind === "hoist") { - scope.propagates.add(name); - } - } - return null; -}; - -Scope.prototype.markWrite = function(name) { - assert(is.string(name)); - this.written.add(name); -}; - -// detects let variables that are never modified (ignores top-level) -Scope.prototype.detectUnmodifiedLets = function() { - var outmost = this; - - function detect(scope) { - if (scope !== outmost) { - scope.decls.keys().forEach(function(name) { - if (scope.getKind(name) === "let" && !scope.written.has(name)) { - return error(getline(scope.getNode(name)), "{0} is declared as let but never modified so could be const", name); - } - }); - } - - scope.children.forEach(function(childScope) { - detect(childScope); - }); - } - detect(this); -}; - -Scope.prototype.traverse = function(options) { - options = options || {}; - var pre = options.pre; - var post = options.post; - - function visit(scope) { - if (pre) { - pre(scope); - } - scope.children.forEach(function(childScope) { - visit(childScope); - }); - if (post) { - post(scope); - } - } - - visit(this); -}; - -module.exports = Scope; - -},{"1":1,"545":545,"547":547,"554":554,"555":555,"556":556,"557":557}],549:[function(_dereq_,module,exports){ -var fmt = _dereq_(554); -var is = _dereq_(555); -var assert = _dereq_(1); - -function Stats() { - this.lets = 0; - this.consts = 0; - this.renames = []; -} - -Stats.prototype.declarator = function(kind) { - assert(is.someof(kind, ["const", "let"])); - if (kind === "const") { - this.consts++; - } else { - this.lets++; - } -}; - -Stats.prototype.rename = function(oldName, newName, line) { - this.renames.push({ - oldName: oldName, - newName: newName, - line: line, - }); -}; - -Stats.prototype.toString = function() { -// console.log("defs.js stats for file {0}:", filename) - - var renames = this.renames.map(function(r) { - return r; - }).sort(function(a, b) { - return a.line - b.line; - }); // sort a copy of renames - - var renameStr = renames.map(function(rename) { - return fmt("\nline {0}: {1} => {2}", rename.line, rename.oldName, rename.newName); - }).join(""); - - var sum = this.consts + this.lets; - var constlets = (sum === 0 ? - "can't calculate const coverage (0 consts, 0 lets)" : - fmt("{0}% const coverage ({1} consts, {2} lets)", - Math.floor(100 * this.consts / sum), this.consts, this.lets)); - - return constlets + renameStr + "\n"; -}; - -module.exports = Stats; - -},{"1":1,"554":554,"555":555}],550:[function(_dereq_,module,exports){ -// alter.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013 Olov Lassus - -var assert = _dereq_(1); -var stableSort = _dereq_(551); - -// fragments is a list of {start: index, end: index, str: string to replace with} -function alter(str, fragments) { - "use strict"; - - var isArray = Array.isArray || function(v) { - return Object.prototype.toString.call(v) === "[object Array]"; - };; - - assert(typeof str === "string"); - assert(isArray(fragments)); - - // stableSort isn't in-place so no need to copy array first - var sortedFragments = stableSort(fragments, function(a, b) { - return a.start - b.start; - }); - - var outs = []; - - var pos = 0; - for (var i = 0; i < sortedFragments.length; i++) { - var frag = sortedFragments[i]; - - assert(pos <= frag.start); - assert(frag.start <= frag.end); - outs.push(str.slice(pos, frag.start)); - outs.push(frag.str); - pos = frag.end; - } - if (pos < str.length) { - outs.push(str.slice(pos)); - } - - return outs.join(""); -} - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = alter; -} - -},{"1":1,"551":551}],551:[function(_dereq_,module,exports){ -//! stable.js 0.1.5, https://github.com/Two-Screen/stable -//! © 2014 Angry Bytes and contributors. MIT licensed. - -(function() { - -// A stable array sort, because `Array#sort()` is not guaranteed stable. -// This is an implementation of merge sort, without recursion. - -var stable = function(arr, comp) { - return exec(arr.slice(), comp); -}; - -stable.inplace = function(arr, comp) { - var result = exec(arr, comp); - - // This simply copies back if the result isn't in the original array, - // which happens on an odd number of passes. - if (result !== arr) { - pass(result, null, arr.length, arr); - } - - return arr; -}; - -// Execute the sort using the input array and a second buffer as work space. -// Returns one of those two, containing the final result. -function exec(arr, comp) { - if (typeof(comp) !== 'function') { - comp = function(a, b) { - return String(a).localeCompare(b); - }; - } - - // Short-circuit when there's nothing to sort. - var len = arr.length; - if (len <= 1) { - return arr; - } - - // Rather than dividing input, simply iterate chunks of 1, 2, 4, 8, etc. - // Chunks are the size of the left or right hand in merge sort. - // Stop when the left-hand covers all of the array. - var buffer = new Array(len); - for (var chk = 1; chk < len; chk *= 2) { - pass(arr, comp, chk, buffer); - - var tmp = arr; - arr = buffer; - buffer = tmp; - } - - return arr; -} - -// Run a single pass with the given chunk size. -var pass = function(arr, comp, chk, result) { - var len = arr.length; - var i = 0; - // Step size / double chunk size. - var dbl = chk * 2; - // Bounds of the left and right chunks. - var l, r, e; - // Iterators over the left and right chunk. - var li, ri; - - // Iterate over pairs of chunks. - for (l = 0; l < len; l += dbl) { - r = l + chk; - e = r + chk; - if (r > len) r = len; - if (e > len) e = len; - - // Iterate both chunks in parallel. - li = l; - ri = r; - while (true) { - // Compare the chunks. - if (li < r && ri < e) { - // This works for a regular `sort()` compatible comparator, - // but also for a simple comparator like: `a > b` - if (comp(arr[li], arr[ri]) <= 0) { - result[i++] = arr[li++]; - } - else { - result[i++] = arr[ri++]; - } - } - // Nothing to compare, just flush what's left. - else if (li < r) { - result[i++] = arr[li++]; - } - else if (ri < e) { - result[i++] = arr[ri++]; - } - // Both iterators are at the chunk ends. - else { - break; - } - } - } -}; - -// Export using CommonJS or to the window. -if (typeof(module) !== 'undefined') { - module.exports = stable; -} -else { - window.stable = stable; -} - -})(); - -},{}],552:[function(_dereq_,module,exports){ -function traverse(root, options) { - "use strict"; - - options = options || {}; - var pre = options.pre; - var post = options.post; - var skipProperty = options.skipProperty; - - function visit(node, parent, prop, idx) { - if (!node || typeof node.type !== "string") { - return; - } - - var res = undefined; - if (pre) { - res = pre(node, parent, prop, idx); - } - - if (res !== false) { - for (var prop in node) { - if (skipProperty ? skipProperty(prop, node) : prop[0] === "$") { - continue; - } - - var child = node[prop]; - - if (Array.isArray(child)) { - for (var i = 0; i < child.length; i++) { - visit(child[i], node, prop, i); - } - } else { - visit(child, node, prop); - } - } - } - - if (post) { - post(node, parent, prop, idx); - } - } - - visit(root, null); -}; - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = traverse; -} - -},{}],553:[function(_dereq_,module,exports){ -// breakable.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013-2014 Olov Lassus - -var breakable = (function() { - "use strict"; - - function Val(val, brk) { - this.val = val; - this.brk = brk; - } - - function make_brk() { - return function brk(val) { - throw new Val(val, brk); - }; - } - - function breakable(fn) { - var brk = make_brk(); - try { - return fn(brk); - } catch (e) { - if (e instanceof Val && e.brk === brk) { - return e.val; - } - throw e; - } - } - - return breakable; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = breakable; -} - -},{}],554:[function(_dereq_,module,exports){ -// simple-fmt.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013 Olov Lassus - -var fmt = (function() { - "use strict"; - - function fmt(str, var_args) { - var args = Array.prototype.slice.call(arguments, 1); - return str.replace(/\{(\d+)\}/g, function(s, match) { - return (match in args ? args[match] : s); - }); - } - - function obj(str, obj) { - return str.replace(/\{([_$a-zA-Z0-9][_$a-zA-Z0-9]*)\}/g, function(s, match) { - return (match in obj ? obj[match] : s); - }); - } - - function repeat(str, n) { - return (new Array(n + 1)).join(str); - } - - fmt.fmt = fmt; - fmt.obj = obj; - fmt.repeat = repeat; - return fmt; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = fmt; -} - -},{}],555:[function(_dereq_,module,exports){ -// simple-is.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013 Olov Lassus - -var is = (function() { - "use strict"; - - var hasOwnProperty = Object.prototype.hasOwnProperty; - var toString = Object.prototype.toString; - var _undefined = void 0; - - return { - nan: function(v) { - return v !== v; - }, - boolean: function(v) { - return typeof v === "boolean"; - }, - number: function(v) { - return typeof v === "number"; - }, - string: function(v) { - return typeof v === "string"; - }, - fn: function(v) { - return typeof v === "function"; - }, - object: function(v) { - return v !== null && typeof v === "object"; - }, - primitive: function(v) { - var t = typeof v; - return v === null || v === _undefined || - t === "boolean" || t === "number" || t === "string"; - }, - array: Array.isArray || function(v) { - return toString.call(v) === "[object Array]"; - }, - finitenumber: function(v) { - return typeof v === "number" && isFinite(v); - }, - someof: function(v, values) { - return values.indexOf(v) >= 0; - }, - noneof: function(v, values) { - return values.indexOf(v) === -1; - }, - own: function(obj, prop) { - return hasOwnProperty.call(obj, prop); - }, - }; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = is; -} - -},{}],556:[function(_dereq_,module,exports){ -// stringmap.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013 Olov Lassus - -var StringMap = (function() { - "use strict"; - - // to save us a few characters - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var create = (function() { - function hasOwnEnumerableProps(obj) { - for (var prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; - } - // FF <= 3.6: - // o = {}; o.hasOwnProperty("__proto__" or "__count__" or "__parent__") => true - // o = {"__proto__": null}; Object.prototype.hasOwnProperty.call(o, "__proto__" or "__count__" or "__parent__") => false - function hasOwnPollutedProps(obj) { - return hasOwnProperty.call(obj, "__count__") || hasOwnProperty.call(obj, "__parent__"); - } - - var useObjectCreate = false; - if (typeof Object.create === "function") { - if (!hasOwnEnumerableProps(Object.create(null))) { - useObjectCreate = true; - } - } - if (useObjectCreate === false) { - if (hasOwnEnumerableProps({})) { - throw new Error("StringMap environment error 0, please file a bug at https://github.com/olov/stringmap/issues"); - } - } - // no throw yet means we can create objects without own enumerable props (safe-guard against VMs and shims) - - var o = (useObjectCreate ? Object.create(null) : {}); - var useProtoClear = false; - if (hasOwnPollutedProps(o)) { - o.__proto__ = null; - if (hasOwnEnumerableProps(o) || hasOwnPollutedProps(o)) { - throw new Error("StringMap environment error 1, please file a bug at https://github.com/olov/stringmap/issues"); - } - useProtoClear = true; - } - // no throw yet means we can create objects without own polluted props (safe-guard against VMs and shims) - - return function() { - var o = (useObjectCreate ? Object.create(null) : {}); - if (useProtoClear) { - o.__proto__ = null; - } - return o; - }; - })(); - - // stringmap ctor - function stringmap(optional_object) { - // use with or without new - if (!(this instanceof stringmap)) { - return new stringmap(optional_object); - } - this.obj = create(); - this.hasProto = false; // false (no __proto__ key) or true (has __proto__ key) - this.proto = undefined; // value for __proto__ key when hasProto is true, undefined otherwise - - if (optional_object) { - this.setMany(optional_object); - } - }; - - // primitive methods that deals with data representation - stringmap.prototype.has = function(key) { - // The type-check of key in has, get, set and delete is important because otherwise an object - // {toString: function() { return "__proto__"; }} can avoid the key === "__proto__" test. - // The alternative to type-checking would be to force string conversion, i.e. key = String(key); - if (typeof key !== "string") { - throw new Error("StringMap expected string key"); - } - return (key === "__proto__" ? - this.hasProto : - hasOwnProperty.call(this.obj, key)); - }; - - stringmap.prototype.get = function(key) { - if (typeof key !== "string") { - throw new Error("StringMap expected string key"); - } - return (key === "__proto__" ? - this.proto : - (hasOwnProperty.call(this.obj, key) ? this.obj[key] : undefined)); - }; - - stringmap.prototype.set = function(key, value) { - if (typeof key !== "string") { - throw new Error("StringMap expected string key"); - } - if (key === "__proto__") { - this.hasProto = true; - this.proto = value; - } else { - this.obj[key] = value; - } - }; - - stringmap.prototype.remove = function(key) { - if (typeof key !== "string") { - throw new Error("StringMap expected string key"); - } - var didExist = this.has(key); - if (key === "__proto__") { - this.hasProto = false; - this.proto = undefined; - } else { - delete this.obj[key]; - } - return didExist; - }; - - // alias remove to delete but beware: - // sm.delete("key"); // OK in ES5 and later - // sm['delete']("key"); // OK in all ES versions - // sm.remove("key"); // OK in all ES versions - stringmap.prototype['delete'] = stringmap.prototype.remove; - - stringmap.prototype.isEmpty = function() { - for (var key in this.obj) { - if (hasOwnProperty.call(this.obj, key)) { - return false; - } - } - return !this.hasProto; - }; - - stringmap.prototype.size = function() { - var len = 0; - for (var key in this.obj) { - if (hasOwnProperty.call(this.obj, key)) { - ++len; - } - } - return (this.hasProto ? len + 1 : len); - }; - - stringmap.prototype.keys = function() { - var keys = []; - for (var key in this.obj) { - if (hasOwnProperty.call(this.obj, key)) { - keys.push(key); - } - } - if (this.hasProto) { - keys.push("__proto__"); - } - return keys; - }; - - stringmap.prototype.values = function() { - var values = []; - for (var key in this.obj) { - if (hasOwnProperty.call(this.obj, key)) { - values.push(this.obj[key]); - } - } - if (this.hasProto) { - values.push(this.proto); - } - return values; - }; - - stringmap.prototype.items = function() { - var items = []; - for (var key in this.obj) { - if (hasOwnProperty.call(this.obj, key)) { - items.push([key, this.obj[key]]); - } - } - if (this.hasProto) { - items.push(["__proto__", this.proto]); - } - return items; - }; - - - // methods that rely on the above primitives - stringmap.prototype.setMany = function(object) { - if (object === null || (typeof object !== "object" && typeof object !== "function")) { - throw new Error("StringMap expected Object"); - } - for (var key in object) { - if (hasOwnProperty.call(object, key)) { - this.set(key, object[key]); - } - } - return this; - }; - - stringmap.prototype.merge = function(other) { - var keys = other.keys(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - this.set(key, other.get(key)); - } - return this; - }; - - stringmap.prototype.map = function(fn) { - var keys = this.keys(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - keys[i] = fn(this.get(key), key); // re-use keys array for results - } - return keys; - }; - - stringmap.prototype.forEach = function(fn) { - var keys = this.keys(); - for (var i = 0; i < keys.length; i++) { - var key = keys[i]; - fn(this.get(key), key); - } - }; - - stringmap.prototype.clone = function() { - var other = stringmap(); - return other.merge(this); - }; - - stringmap.prototype.toString = function() { - var self = this; - return "{" + this.keys().map(function(key) { - return JSON.stringify(key) + ":" + JSON.stringify(self.get(key)); - }).join(",") + "}"; - }; - - return stringmap; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = StringMap; -} - -},{}],557:[function(_dereq_,module,exports){ -// stringset.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013 Olov Lassus - -var StringSet = (function() { - "use strict"; - - // to save us a few characters - var hasOwnProperty = Object.prototype.hasOwnProperty; - - var create = (function() { - function hasOwnEnumerableProps(obj) { - for (var prop in obj) { - if (hasOwnProperty.call(obj, prop)) { - return true; - } - } - return false; - } - - // FF <= 3.6: - // o = {}; o.hasOwnProperty("__proto__" or "__count__" or "__parent__") => true - // o = {"__proto__": null}; Object.prototype.hasOwnProperty.call(o, "__proto__" or "__count__" or "__parent__") => false - function hasOwnPollutedProps(obj) { - return hasOwnProperty.call(obj, "__count__") || hasOwnProperty.call(obj, "__parent__"); - } - - var useObjectCreate = false; - if (typeof Object.create === "function") { - if (!hasOwnEnumerableProps(Object.create(null))) { - useObjectCreate = true; - } - } - if (useObjectCreate === false) { - if (hasOwnEnumerableProps({})) { - throw new Error("StringSet environment error 0, please file a bug at https://github.com/olov/stringset/issues"); - } - } - // no throw yet means we can create objects without own enumerable props (safe-guard against VMs and shims) - - var o = (useObjectCreate ? Object.create(null) : {}); - var useProtoClear = false; - if (hasOwnPollutedProps(o)) { - o.__proto__ = null; - if (hasOwnEnumerableProps(o) || hasOwnPollutedProps(o)) { - throw new Error("StringSet environment error 1, please file a bug at https://github.com/olov/stringset/issues"); - } - useProtoClear = true; - } - // no throw yet means we can create objects without own polluted props (safe-guard against VMs and shims) - - return function() { - var o = (useObjectCreate ? Object.create(null) : {}); - if (useProtoClear) { - o.__proto__ = null; - } - return o; - }; - })(); - - // stringset ctor - function stringset(optional_array) { - // use with or without new - if (!(this instanceof stringset)) { - return new stringset(optional_array); - } - this.obj = create(); - this.hasProto = false; // false (no __proto__ item) or true (has __proto__ item) - - if (optional_array) { - this.addMany(optional_array); - } - }; - - // primitive methods that deals with data representation - stringset.prototype.has = function(item) { - // The type-check of item in has, get, set and delete is important because otherwise an object - // {toString: function() { return "__proto__"; }} can avoid the item === "__proto__" test. - // The alternative to type-checking would be to force string conversion, i.e. item = String(item); - if (typeof item !== "string") { - throw new Error("StringSet expected string item"); - } - return (item === "__proto__" ? - this.hasProto : - hasOwnProperty.call(this.obj, item)); - }; - - stringset.prototype.add = function(item) { - if (typeof item !== "string") { - throw new Error("StringSet expected string item"); - } - if (item === "__proto__") { - this.hasProto = true; - } else { - this.obj[item] = true; - } - }; - - stringset.prototype.remove = function(item) { - if (typeof item !== "string") { - throw new Error("StringSet expected string item"); - } - var didExist = this.has(item); - if (item === "__proto__") { - this.hasProto = false; - } else { - delete this.obj[item]; - } - return didExist; - }; - - // alias remove to delete but beware: - // ss.delete("key"); // OK in ES5 and later - // ss['delete']("key"); // OK in all ES versions - // ss.remove("key"); // OK in all ES versions - stringset.prototype['delete'] = stringset.prototype.remove; - - stringset.prototype.isEmpty = function() { - for (var item in this.obj) { - if (hasOwnProperty.call(this.obj, item)) { - return false; - } - } - return !this.hasProto; - }; - - stringset.prototype.size = function() { - var len = 0; - for (var item in this.obj) { - if (hasOwnProperty.call(this.obj, item)) { - ++len; - } - } - return (this.hasProto ? len + 1 : len); - }; - - stringset.prototype.items = function() { - var items = []; - for (var item in this.obj) { - if (hasOwnProperty.call(this.obj, item)) { - items.push(item); - } - } - if (this.hasProto) { - items.push("__proto__"); - } - return items; - }; - - - // methods that rely on the above primitives - stringset.prototype.addMany = function(items) { - if (!Array.isArray(items)) { - throw new Error("StringSet expected array"); - } - for (var i = 0; i < items.length; i++) { - this.add(items[i]); - } - return this; - }; - - stringset.prototype.merge = function(other) { - this.addMany(other.items()); - return this; - }; - - stringset.prototype.clone = function() { - var other = stringset(); - return other.merge(this); - }; - - stringset.prototype.toString = function() { - return "{" + this.items().map(JSON.stringify).join(",") + "}"; - }; - - return stringset; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = StringSet; -} - -},{}],558:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var types = _dereq_(566); -var n = types.namedTypes; -var isArray = types.builtInTypes.array; -var isObject = types.builtInTypes.object; -var linesModule = _dereq_(560); -var fromString = linesModule.fromString; -var Lines = linesModule.Lines; -var concat = linesModule.concat; -var util = _dereq_(567); -var comparePos = util.comparePos; -var childNodesCacheKey = _dereq_(536).makeUniqueKey(); - -// TODO Move a non-caching implementation of this function into ast-types, -// and implement a caching wrapper function here. -function getSortedChildNodes(node, resultArray) { - if (!node) { - return; - } - - // The .loc checks below are sensitive to some of the problems that - // are fixed by this utility function. Specifically, if it decides to - // set node.loc to null, indicating that the node's .loc information - // is unreliable, then we don't want to add node to the resultArray. - util.fixFaultyLocations(node); - - if (resultArray) { - if (n.Node.check(node) && - n.SourceLocation.check(node.loc)) { - // This reverse insertion sort almost always takes constant - // time because we almost always (maybe always?) append the - // nodes in order anyway. - for (var i = resultArray.length - 1; i >= 0; --i) { - if (comparePos(resultArray[i].loc.end, - node.loc.start) <= 0) { - break; - } - } - resultArray.splice(i + 1, 0, node); - return; - } - } else if (node[childNodesCacheKey]) { - return node[childNodesCacheKey]; - } - - var names; - if (isArray.check(node)) { - names = Object.keys(node); - } else if (isObject.check(node)) { - names = types.getFieldNames(node); - } else { - return; - } - - if (!resultArray) { - Object.defineProperty(node, childNodesCacheKey, { - value: resultArray = [], - enumerable: false - }); - } - - for (var i = 0, nameCount = names.length; i < nameCount; ++i) { - getSortedChildNodes(node[names[i]], resultArray); - } - - return resultArray; -} - -// As efficiently as possible, decorate the comment object with -// .precedingNode, .enclosingNode, and/or .followingNode properties, at -// least one of which is guaranteed to be defined. -function decorateComment(node, comment) { - var childNodes = getSortedChildNodes(node); - - // Time to dust off the old binary search robes and wizard hat. - var left = 0, right = childNodes.length; - while (left < right) { - var middle = (left + right) >> 1; - var child = childNodes[middle]; - - if (comparePos(child.loc.start, comment.loc.start) <= 0 && - comparePos(comment.loc.end, child.loc.end) <= 0) { - // The comment is completely contained by this child node. - decorateComment(comment.enclosingNode = child, comment); - return; // Abandon the binary search at this level. - } - - if (comparePos(child.loc.end, comment.loc.start) <= 0) { - // This child node falls completely before the comment. - // Because we will never consider this node or any nodes - // before it again, this node must be the closest preceding - // node we have encountered so far. - var precedingNode = child; - left = middle + 1; - continue; - } - - if (comparePos(comment.loc.end, child.loc.start) <= 0) { - // This child node falls completely after the comment. - // Because we will never consider this node or any nodes after - // it again, this node must be the closest following node we - // have encountered so far. - var followingNode = child; - right = middle; - continue; - } - - throw new Error("Comment location overlaps with node location"); - } - - if (precedingNode) { - comment.precedingNode = precedingNode; - } - - if (followingNode) { - comment.followingNode = followingNode; - } -} - -exports.attach = function(comments, ast, lines) { - if (!isArray.check(comments)) { - return; - } - - var tiesToBreak = []; - - comments.forEach(function(comment) { - comment.loc.lines = lines; - decorateComment(ast, comment); - - var pn = comment.precedingNode; - var en = comment.enclosingNode; - var fn = comment.followingNode; - - if (pn && fn) { - var tieCount = tiesToBreak.length; - if (tieCount > 0) { - var lastTie = tiesToBreak[tieCount - 1]; - - assert.strictEqual( - lastTie.precedingNode === comment.precedingNode, - lastTie.followingNode === comment.followingNode - ); - - if (lastTie.followingNode !== comment.followingNode) { - breakTies(tiesToBreak, lines); - } - } - - tiesToBreak.push(comment); - - } else if (pn) { - // No contest: we have a trailing comment. - breakTies(tiesToBreak, lines); - addTrailingComment(pn, comment); - - } else if (fn) { - // No contest: we have a leading comment. - breakTies(tiesToBreak, lines); - addLeadingComment(fn, comment); - - } else if (en) { - // The enclosing node has no child nodes at all, so what we - // have here is a dangling comment, e.g. [/* crickets */]. - breakTies(tiesToBreak, lines); - addDanglingComment(en, comment); - - } else { - throw new Error("AST contains no nodes at all?"); - } - }); - - breakTies(tiesToBreak, lines); - - comments.forEach(function(comment) { - // These node references were useful for breaking ties, but we - // don't need them anymore, and they create cycles in the AST that - // may lead to infinite recursion if we don't delete them here. - delete comment.precedingNode; - delete comment.enclosingNode; - delete comment.followingNode; - }); -}; - -function breakTies(tiesToBreak, lines) { - var tieCount = tiesToBreak.length; - if (tieCount === 0) { - return; - } - - var pn = tiesToBreak[0].precedingNode; - var fn = tiesToBreak[0].followingNode; - var gapEndPos = fn.loc.start; - - // Iterate backwards through tiesToBreak, examining the gaps - // between the tied comments. In order to qualify as leading, a - // comment must be separated from fn by an unbroken series of - // whitespace-only gaps (or other comments). - for (var indexOfFirstLeadingComment = tieCount; - indexOfFirstLeadingComment > 0; - --indexOfFirstLeadingComment) { - var comment = tiesToBreak[indexOfFirstLeadingComment - 1]; - assert.strictEqual(comment.precedingNode, pn); - assert.strictEqual(comment.followingNode, fn); - - var gap = lines.sliceString(comment.loc.end, gapEndPos); - if (/\S/.test(gap)) { - // The gap string contained something other than whitespace. - break; - } - - gapEndPos = comment.loc.start; - } - - while (indexOfFirstLeadingComment <= tieCount && - (comment = tiesToBreak[indexOfFirstLeadingComment]) && - // If the comment is a //-style comment and indented more - // deeply than the node itself, reconsider it as trailing. - comment.type === "Line" && - comment.loc.start.column > fn.loc.start.column) { - ++indexOfFirstLeadingComment; - } - - tiesToBreak.forEach(function(comment, i) { - if (i < indexOfFirstLeadingComment) { - addTrailingComment(pn, comment); - } else { - addLeadingComment(fn, comment); - } - }); - - tiesToBreak.length = 0; -} - -function addCommentHelper(node, comment) { - var comments = node.comments || (node.comments = []); - comments.push(comment); -} - -function addLeadingComment(node, comment) { - comment.leading = true; - comment.trailing = false; - addCommentHelper(node, comment); -} - -function addDanglingComment(node, comment) { - comment.leading = false; - comment.trailing = false; - addCommentHelper(node, comment); -} - -function addTrailingComment(node, comment) { - comment.leading = false; - comment.trailing = true; - addCommentHelper(node, comment); -} - -function printLeadingComment(commentPath, print) { - var comment = commentPath.getValue(); - n.Comment.assert(comment); - - var loc = comment.loc; - var lines = loc && loc.lines; - var parts = [print(commentPath)]; - - if (comment.trailing) { - // When we print trailing comments as leading comments, we don't - // want to bring any trailing spaces along. - parts.push("\n"); - - } else if (lines instanceof Lines) { - var trailingSpace = lines.slice( - loc.end, - lines.skipSpaces(loc.end) - ); - - if (trailingSpace.length === 1) { - // If the trailing space contains no newlines, then we want to - // preserve it exactly as we found it. - parts.push(trailingSpace); - } else { - // If the trailing space contains newlines, then replace it - // with just that many newlines, with all other spaces removed. - parts.push(new Array(trailingSpace.length).join("\n")); - } - - } else { - parts.push("\n"); - } - - return concat(parts); -} - -function printTrailingComment(commentPath, print) { - var comment = commentPath.getValue(commentPath); - n.Comment.assert(comment); - - var loc = comment.loc; - var lines = loc && loc.lines; - var parts = []; - - if (lines instanceof Lines) { - var fromPos = lines.skipSpaces(loc.start, true) || lines.firstPos(); - var leadingSpace = lines.slice(fromPos, loc.start); - - if (leadingSpace.length === 1) { - // If the leading space contains no newlines, then we want to - // preserve it exactly as we found it. - parts.push(leadingSpace); - } else { - // If the leading space contains newlines, then replace it - // with just that many newlines, sans all other spaces. - parts.push(new Array(leadingSpace.length).join("\n")); - } - } - - parts.push(print(commentPath)); - - return concat(parts); -} - -exports.printComments = function(path, print) { - var value = path.getValue(); - var innerLines = print(path); - var comments = n.Node.check(value) && - types.getFieldValue(value, "comments"); - - if (!comments || comments.length === 0) { - return innerLines; - } - - var leadingParts = []; - var trailingParts = [innerLines]; - - path.each(function(commentPath) { - var comment = commentPath.getValue(); - var leading = types.getFieldValue(comment, "leading"); - var trailing = types.getFieldValue(comment, "trailing"); - - if (leading || (trailing && comment.type !== "Block")) { - leadingParts.push(printLeadingComment(commentPath, print)); - } else if (trailing) { - assert.strictEqual(comment.type, "Block"); - trailingParts.push(printTrailingComment(commentPath, print)); - } - }, "comments"); - - leadingParts.push.apply(leadingParts, trailingParts); - return concat(leadingParts); -}; - -},{"1":1,"536":536,"560":560,"566":566,"567":567}],559:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var types = _dereq_(566); -var n = types.namedTypes; -var Node = n.Node; -var isArray = types.builtInTypes.array; -var isNumber = types.builtInTypes.number; - -function FastPath(value) { - assert.ok(this instanceof FastPath); - this.stack = [value]; -} - -var FPp = FastPath.prototype; -module.exports = FastPath; - -// Static convenience function for coercing a value to a FastPath. -FastPath.from = function(obj) { - if (obj instanceof FastPath) { - // Return a defensive copy of any existing FastPath instances. - return obj.copy(); - } - - if (obj instanceof types.NodePath) { - // For backwards compatibility, unroll NodePath instances into - // lightweight FastPath [..., name, value] stacks. - var copy = Object.create(FastPath.prototype); - var stack = [obj.value]; - for (var pp; (pp = obj.parentPath); obj = pp) - stack.push(obj.name, pp.value); - copy.stack = stack.reverse(); - return copy; - } - - // Otherwise use obj as the value of the new FastPath instance. - return new FastPath(obj); -}; - -FPp.copy = function copy() { - var copy = Object.create(FastPath.prototype); - copy.stack = this.stack.slice(0); - return copy; -}; - -// The name of the current property is always the penultimate element of -// this.stack, and always a String. -FPp.getName = function getName() { - var s = this.stack; - var len = s.length; - if (len > 1) { - return s[len - 2]; - } - // Since the name is always a string, null is a safe sentinel value to - // return if we do not know the name of the (root) value. - return null; -}; - -// The value of the current property is always the final element of -// this.stack. -FPp.getValue = function getValue() { - var s = this.stack; - return s[s.length - 1]; -}; - -function getNodeHelper(path, count) { - var s = path.stack; - - for (var i = s.length - 1; i >= 0; i -= 2) { - var value = s[i]; - if (n.Node.check(value) && --count < 0) { - return value; - } - } - - return null; -} - -FPp.getNode = function getNode(count) { - return getNodeHelper(this, ~~count); -}; - -FPp.getParentNode = function getParentNode(count) { - return getNodeHelper(this, ~~count + 1); -}; - -// The length of the stack can be either even or odd, depending on whether -// or not we have a name for the root value. The difference between the -// index of the root value and the index of the final value is always -// even, though, which allows us to return the root value in constant time -// (i.e. without iterating backwards through the stack). -FPp.getRootValue = function getRootValue() { - var s = this.stack; - if (s.length % 2 === 0) { - return s[1]; - } - return s[0]; -}; - -// Temporarily push properties named by string arguments given after the -// callback function onto this.stack, then call the callback with a -// reference to this (modified) FastPath object. Note that the stack will -// be restored to its original state after the callback is finished, so it -// is probably a mistake to retain a reference to the path. -FPp.call = function call(callback/*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - var result = callback(this); - s.length = origLen; - return result; -}; - -// Similar to FastPath.prototype.call, except that the value obtained by -// accessing this.getValue()[name1][name2]... should be array-like. The -// callback will be called with a reference to this path object for each -// element of the array. -FPp.each = function each(callback/*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - - for (var i = 0; i < value.length; ++i) { - if (i in value) { - s.push(i, value[i]); - // If the callback needs to know the value of i, call - // path.getName(), assuming path is the parameter name. - callback(this); - s.length -= 2; - } - } - - s.length = origLen; -}; - -// Similar to FastPath.prototype.each, except that the results of the -// callback function invocations are stored in an array and returned at -// the end of the iteration. -FPp.map = function map(callback/*, name1, name2, ... */) { - var s = this.stack; - var origLen = s.length; - var value = s[origLen - 1]; - var argc = arguments.length; - - for (var i = 1; i < argc; ++i) { - var name = arguments[i]; - value = value[name]; - s.push(name, value); - } - - var result = new Array(value.length); - - for (var i = 0; i < value.length; ++i) { - if (i in value) { - s.push(i, value[i]); - result[i] = callback(this, i); - s.length -= 2; - } - } - - s.length = origLen; - - return result; -}; - -// Inspired by require("ast-types").NodePath.prototype.needsParens, but -// more efficient because we're iterating backwards through a stack. -FPp.needsParens = function(assumeExpressionContext) { - var parent = this.getParentNode(); - if (!parent) { - return false; - } - - var name = this.getName(); - var node = this.getNode(); - - // If the value of this path is some child of a Node and not a Node - // itself, then it doesn't need parentheses. Only Node objects (in - // fact, only Expression nodes) need parentheses. - if (this.getValue() !== node) { - return false; - } - - // Only expressions need parentheses. - if (!n.Expression.check(node)) { - return false; - } - - // Identifiers never need parentheses. - if (node.type === "Identifier") { - return false; - } - - if (parent.type === "ParenthesizedExpression") { - return false; - } - - switch (node.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return parent.type === "MemberExpression" - && name === "object" - && parent.object === node; - - case "BinaryExpression": - case "LogicalExpression": - switch (parent.type) { - case "CallExpression": - return name === "callee" - && parent.callee === node; - - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return true; - - case "MemberExpression": - return name === "object" - && parent.object === node; - - case "BinaryExpression": - case "LogicalExpression": - var po = parent.operator; - var pp = PRECEDENCE[po]; - var no = node.operator; - var np = PRECEDENCE[no]; - - if (pp > np) { - return true; - } - - if (pp === np && name === "right") { - assert.strictEqual(parent.right, node); - return true; - } - - default: - return false; - } - - case "SequenceExpression": - switch (parent.type) { - case "ForStatement": - // Although parentheses wouldn't hurt around sequence - // expressions in the head of for loops, traditional style - // dictates that e.g. i++, j++ should not be wrapped with - // parentheses. - return false; - - case "ExpressionStatement": - return name !== "expression"; - - default: - // Otherwise err on the side of overparenthesization, adding - // explicit exceptions above if this proves overzealous. - return true; - } - - case "YieldExpression": - switch (parent.type) { - case "BinaryExpression": - case "LogicalExpression": - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - case "CallExpression": - case "MemberExpression": - case "NewExpression": - case "ConditionalExpression": - case "YieldExpression": - return true; - - default: - return false; - } - - case "Literal": - return parent.type === "MemberExpression" - && isNumber.check(node.value) - && name === "object" - && parent.object === node; - - case "AssignmentExpression": - case "ConditionalExpression": - switch (parent.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - case "BinaryExpression": - case "LogicalExpression": - return true; - - case "CallExpression": - return name === "callee" - && parent.callee === node; - - case "ConditionalExpression": - return name === "test" - && parent.test === node; - - case "MemberExpression": - return name === "object" - && parent.object === node; - - default: - return false; - } - - case "ArrowFunctionExpression": - return isBinary(parent); - - case "ObjectExpression": - if (parent.type === "ArrowFunctionExpression" && - name === "body") { - return true; - } - - default: - if (parent.type === "NewExpression" && - name === "callee" && - parent.callee === node) { - return containsCallExpression(node); - } - } - - if (assumeExpressionContext !== true && - !this.canBeFirstInStatement() && - this.firstInStatement()) - return true; - - return false; -}; - -function isBinary(node) { - return n.BinaryExpression.check(node) - || n.LogicalExpression.check(node); -} - -function isUnaryLike(node) { - return n.UnaryExpression.check(node) - // I considered making SpreadElement and SpreadProperty subtypes - // of UnaryExpression, but they're not really Expression nodes. - || (n.SpreadElement && n.SpreadElement.check(node)) - || (n.SpreadProperty && n.SpreadProperty.check(node)); -} - -var PRECEDENCE = {}; -[["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] -].forEach(function(tier, i) { - tier.forEach(function(op) { - PRECEDENCE[op] = i; - }); -}); - -function containsCallExpression(node) { - if (n.CallExpression.check(node)) { - return true; - } - - if (isArray.check(node)) { - return node.some(containsCallExpression); - } - - if (n.Node.check(node)) { - return types.someField(node, function(name, child) { - return containsCallExpression(child); - }); - } - - return false; -} - -FPp.canBeFirstInStatement = function() { - var node = this.getNode(); - return !n.FunctionExpression.check(node) - && !n.ObjectExpression.check(node); -}; - -FPp.firstInStatement = function() { - var s = this.stack; - var parentName, parent; - var childName, child; - - for (var i = s.length - 1; i >= 0; i -= 2) { - if (n.Node.check(s[i])) { - childName = parentName; - child = parent; - parentName = s[i - 1]; - parent = s[i]; - } - - if (!parent || !child) { - continue; - } - - if (n.BlockStatement.check(parent) && - parentName === "body" && - childName === 0) { - assert.strictEqual(parent.body[0], child); - return true; - } - - if (n.ExpressionStatement.check(parent) && - childName === "expression") { - assert.strictEqual(parent.expression, child); - return true; - } - - if (n.SequenceExpression.check(parent) && - parentName === "expressions" && - childName === 0) { - assert.strictEqual(parent.expressions[0], child); - continue; - } - - if (n.CallExpression.check(parent) && - childName === "callee") { - assert.strictEqual(parent.callee, child); - continue; - } - - if (n.MemberExpression.check(parent) && - childName === "object") { - assert.strictEqual(parent.object, child); - continue; - } - - if (n.ConditionalExpression.check(parent) && - childName === "test") { - assert.strictEqual(parent.test, child); - continue; - } - - if (isBinary(parent) && - childName === "left") { - assert.strictEqual(parent.left, child); - continue; - } - - if (n.UnaryExpression.check(parent) && - !parent.prefix && - childName === "argument") { - assert.strictEqual(parent.argument, child); - continue; - } - - return false; - } - - return true; -}; - -},{"1":1,"566":566}],560:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var sourceMap = _dereq_(607); -var normalizeOptions = _dereq_(562).normalize; -var secretKey = _dereq_(536).makeUniqueKey(); -var types = _dereq_(566); -var isString = types.builtInTypes.string; -var comparePos = _dereq_(567).comparePos; -var Mapping = _dereq_(561); - -// Goals: -// 1. Minimize new string creation. -// 2. Keep (de)identation O(lines) time. -// 3. Permit negative indentations. -// 4. Enforce immutability. -// 5. No newline characters. - -function getSecret(lines) { - return lines[secretKey]; -} - -function Lines(infos, sourceFileName) { - assert.ok(this instanceof Lines); - assert.ok(infos.length > 0); - - if (sourceFileName) { - isString.assert(sourceFileName); - } else { - sourceFileName = null; - } - - Object.defineProperty(this, secretKey, { - value: { - infos: infos, - mappings: [], - name: sourceFileName, - cachedSourceMap: null - } - }); - - if (sourceFileName) { - getSecret(this).mappings.push(new Mapping(this, { - start: this.firstPos(), - end: this.lastPos() - })); - } -} - -// Exposed for instanceof checks. The fromString function should be used -// to create new Lines objects. -exports.Lines = Lines; -var Lp = Lines.prototype; - -// These properties used to be assigned to each new object in the Lines -// constructor, but we can more efficiently stuff them into the secret and -// let these lazy accessors compute their values on-the-fly. -Object.defineProperties(Lp, { - length: { - get: function() { - return getSecret(this).infos.length; - } - }, - - name: { - get: function() { - return getSecret(this).name; - } - } -}); - -function copyLineInfo(info) { - return { - line: info.line, - indent: info.indent, - sliceStart: info.sliceStart, - sliceEnd: info.sliceEnd - }; -} - -var fromStringCache = {}; -var hasOwn = fromStringCache.hasOwnProperty; -var maxCacheKeyLen = 10; - -function countSpaces(spaces, tabWidth) { - var count = 0; - var len = spaces.length; - - for (var i = 0; i < len; ++i) { - switch (spaces.charCodeAt(i)) { - case 9: // '\t' - assert.strictEqual(typeof tabWidth, "number"); - assert.ok(tabWidth > 0); - - var next = Math.ceil(count / tabWidth) * tabWidth; - if (next === count) { - count += tabWidth; - } else { - count = next; - } - - break; - - case 11: // '\v' - case 12: // '\f' - case 13: // '\r' - case 0xfeff: // zero-width non-breaking space - // These characters contribute nothing to indentation. - break; - - case 32: // ' ' - default: // Treat all other whitespace like ' '. - count += 1; - break; - } - } - - return count; -} -exports.countSpaces = countSpaces; - -var leadingSpaceExp = /^\s*/; - -// As specified here: http://www.ecma-international.org/ecma-262/6.0/#sec-line-terminators -var lineTerminatorSeqExp = - /\u000D\u000A|\u000D(?!\u000A)|\u000A|\u2028|\u2029/; - -/** - * @param {Object} options - Options object that configures printing. - */ -function fromString(string, options) { - if (string instanceof Lines) - return string; - - string += ""; - - var tabWidth = options && options.tabWidth; - var tabless = string.indexOf("\t") < 0; - var cacheable = !options && tabless && (string.length <= maxCacheKeyLen); - - assert.ok(tabWidth || tabless, "No tab width specified but encountered tabs in string\n" + string); - - if (cacheable && hasOwn.call(fromStringCache, string)) - return fromStringCache[string]; - - var lines = new Lines(string.split(lineTerminatorSeqExp).map(function(line) { - var spaces = leadingSpaceExp.exec(line)[0]; - return { - line: line, - indent: countSpaces(spaces, tabWidth), - sliceStart: spaces.length, - sliceEnd: line.length - }; - }), normalizeOptions(options).sourceFileName); - - if (cacheable) - fromStringCache[string] = lines; - - return lines; -} -exports.fromString = fromString; - -function isOnlyWhitespace(string) { - return !/\S/.test(string); -} - -Lp.toString = function(options) { - return this.sliceString(this.firstPos(), this.lastPos(), options); -}; - -Lp.getSourceMap = function(sourceMapName, sourceRoot) { - if (!sourceMapName) { - // Although we could make up a name or generate an anonymous - // source map, instead we assume that any consumer who does not - // provide a name does not actually want a source map. - return null; - } - - var targetLines = this; - - function updateJSON(json) { - json = json || {}; - - isString.assert(sourceMapName); - json.file = sourceMapName; - - if (sourceRoot) { - isString.assert(sourceRoot); - json.sourceRoot = sourceRoot; - } - - return json; - } - - var secret = getSecret(targetLines); - if (secret.cachedSourceMap) { - // Since Lines objects are immutable, we can reuse any source map - // that was previously generated. Nevertheless, we return a new - // JSON object here to protect the cached source map from outside - // modification. - return updateJSON(secret.cachedSourceMap.toJSON()); - } - - var smg = new sourceMap.SourceMapGenerator(updateJSON()); - var sourcesToContents = {}; - - secret.mappings.forEach(function(mapping) { - var sourceCursor = mapping.sourceLines.skipSpaces( - mapping.sourceLoc.start - ) || mapping.sourceLines.lastPos(); - - var targetCursor = targetLines.skipSpaces( - mapping.targetLoc.start - ) || targetLines.lastPos(); - - while (comparePos(sourceCursor, mapping.sourceLoc.end) < 0 && - comparePos(targetCursor, mapping.targetLoc.end) < 0) { - - var sourceChar = mapping.sourceLines.charAt(sourceCursor); - var targetChar = targetLines.charAt(targetCursor); - assert.strictEqual(sourceChar, targetChar); - - var sourceName = mapping.sourceLines.name; - - // Add mappings one character at a time for maximum resolution. - smg.addMapping({ - source: sourceName, - original: { line: sourceCursor.line, - column: sourceCursor.column }, - generated: { line: targetCursor.line, - column: targetCursor.column } - }); - - if (!hasOwn.call(sourcesToContents, sourceName)) { - var sourceContent = mapping.sourceLines.toString(); - smg.setSourceContent(sourceName, sourceContent); - sourcesToContents[sourceName] = sourceContent; - } - - targetLines.nextPos(targetCursor, true); - mapping.sourceLines.nextPos(sourceCursor, true); - } - }); - - secret.cachedSourceMap = smg; - - return smg.toJSON(); -}; - -Lp.bootstrapCharAt = function(pos) { - assert.strictEqual(typeof pos, "object"); - assert.strictEqual(typeof pos.line, "number"); - assert.strictEqual(typeof pos.column, "number"); - - var line = pos.line, - column = pos.column, - strings = this.toString().split(lineTerminatorSeqExp), - string = strings[line - 1]; - - if (typeof string === "undefined") - return ""; - - if (column === string.length && - line < strings.length) - return "\n"; - - if (column >= string.length) - return ""; - - return string.charAt(column); -}; - -Lp.charAt = function(pos) { - assert.strictEqual(typeof pos, "object"); - assert.strictEqual(typeof pos.line, "number"); - assert.strictEqual(typeof pos.column, "number"); - - var line = pos.line, - column = pos.column, - secret = getSecret(this), - infos = secret.infos, - info = infos[line - 1], - c = column; - - if (typeof info === "undefined" || c < 0) - return ""; - - var indent = this.getIndentAt(line); - if (c < indent) - return " "; - - c += info.sliceStart - indent; - - if (c === info.sliceEnd && - line < this.length) - return "\n"; - - if (c >= info.sliceEnd) - return ""; - - return info.line.charAt(c); -}; - -Lp.stripMargin = function(width, skipFirstLine) { - if (width === 0) - return this; - - assert.ok(width > 0, "negative margin: " + width); - - if (skipFirstLine && this.length === 1) - return this; - - var secret = getSecret(this); - - var lines = new Lines(secret.infos.map(function(info, i) { - if (info.line && (i > 0 || !skipFirstLine)) { - info = copyLineInfo(info); - info.indent = Math.max(0, info.indent - width); - } - return info; - })); - - if (secret.mappings.length > 0) { - var newMappings = getSecret(lines).mappings; - assert.strictEqual(newMappings.length, 0); - secret.mappings.forEach(function(mapping) { - newMappings.push(mapping.indent(width, skipFirstLine, true)); - }); - } - - return lines; -}; - -Lp.indent = function(by) { - if (by === 0) - return this; - - var secret = getSecret(this); - - var lines = new Lines(secret.infos.map(function(info) { - if (info.line) { - info = copyLineInfo(info); - info.indent += by; - } - return info - })); - - if (secret.mappings.length > 0) { - var newMappings = getSecret(lines).mappings; - assert.strictEqual(newMappings.length, 0); - secret.mappings.forEach(function(mapping) { - newMappings.push(mapping.indent(by)); - }); - } - - return lines; -}; - -Lp.indentTail = function(by) { - if (by === 0) - return this; - - if (this.length < 2) - return this; - - var secret = getSecret(this); - - var lines = new Lines(secret.infos.map(function(info, i) { - if (i > 0 && info.line) { - info = copyLineInfo(info); - info.indent += by; - } - - return info; - })); - - if (secret.mappings.length > 0) { - var newMappings = getSecret(lines).mappings; - assert.strictEqual(newMappings.length, 0); - secret.mappings.forEach(function(mapping) { - newMappings.push(mapping.indent(by, true)); - }); - } - - return lines; -}; - -Lp.getIndentAt = function(line) { - assert.ok(line >= 1, "no line " + line + " (line numbers start from 1)"); - var secret = getSecret(this), - info = secret.infos[line - 1]; - return Math.max(info.indent, 0); -}; - -Lp.guessTabWidth = function() { - var secret = getSecret(this); - if (hasOwn.call(secret, "cachedTabWidth")) { - return secret.cachedTabWidth; - } - - var counts = []; // Sparse array. - var lastIndent = 0; - - for (var line = 1, last = this.length; line <= last; ++line) { - var info = secret.infos[line - 1]; - var sliced = info.line.slice(info.sliceStart, info.sliceEnd); - - // Whitespace-only lines don't tell us much about the likely tab - // width of this code. - if (isOnlyWhitespace(sliced)) { - continue; - } - - var diff = Math.abs(info.indent - lastIndent); - counts[diff] = ~~counts[diff] + 1; - lastIndent = info.indent; - } - - var maxCount = -1; - var result = 2; - - for (var tabWidth = 1; - tabWidth < counts.length; - tabWidth += 1) { - if (hasOwn.call(counts, tabWidth) && - counts[tabWidth] > maxCount) { - maxCount = counts[tabWidth]; - result = tabWidth; - } - } - - return secret.cachedTabWidth = result; -}; - -Lp.isOnlyWhitespace = function() { - return isOnlyWhitespace(this.toString()); -}; - -Lp.isPrecededOnlyByWhitespace = function(pos) { - var secret = getSecret(this); - var info = secret.infos[pos.line - 1]; - var indent = Math.max(info.indent, 0); - - var diff = pos.column - indent; - if (diff <= 0) { - // If pos.column does not exceed the indentation amount, then - // there must be only whitespace before it. - return true; - } - - var start = info.sliceStart; - var end = Math.min(start + diff, info.sliceEnd); - var prefix = info.line.slice(start, end); - - return isOnlyWhitespace(prefix); -}; - -Lp.getLineLength = function(line) { - var secret = getSecret(this), - info = secret.infos[line - 1]; - return this.getIndentAt(line) + info.sliceEnd - info.sliceStart; -}; - -Lp.nextPos = function(pos, skipSpaces) { - var l = Math.max(pos.line, 0), - c = Math.max(pos.column, 0); - - if (c < this.getLineLength(l)) { - pos.column += 1; - - return skipSpaces - ? !!this.skipSpaces(pos, false, true) - : true; - } - - if (l < this.length) { - pos.line += 1; - pos.column = 0; - - return skipSpaces - ? !!this.skipSpaces(pos, false, true) - : true; - } - - return false; -}; - -Lp.prevPos = function(pos, skipSpaces) { - var l = pos.line, - c = pos.column; - - if (c < 1) { - l -= 1; - - if (l < 1) - return false; - - c = this.getLineLength(l); - - } else { - c = Math.min(c - 1, this.getLineLength(l)); - } - - pos.line = l; - pos.column = c; - - return skipSpaces - ? !!this.skipSpaces(pos, true, true) - : true; -}; - -Lp.firstPos = function() { - // Trivial, but provided for completeness. - return { line: 1, column: 0 }; -}; - -Lp.lastPos = function() { - return { - line: this.length, - column: this.getLineLength(this.length) - }; -}; - -Lp.skipSpaces = function(pos, backward, modifyInPlace) { - if (pos) { - pos = modifyInPlace ? pos : { - line: pos.line, - column: pos.column - }; - } else if (backward) { - pos = this.lastPos(); - } else { - pos = this.firstPos(); - } - - if (backward) { - while (this.prevPos(pos)) { - if (!isOnlyWhitespace(this.charAt(pos)) && - this.nextPos(pos)) { - return pos; - } - } - - return null; - - } else { - while (isOnlyWhitespace(this.charAt(pos))) { - if (!this.nextPos(pos)) { - return null; - } - } - - return pos; - } -}; - -Lp.trimLeft = function() { - var pos = this.skipSpaces(this.firstPos(), false, true); - return pos ? this.slice(pos) : emptyLines; -}; - -Lp.trimRight = function() { - var pos = this.skipSpaces(this.lastPos(), true, true); - return pos ? this.slice(this.firstPos(), pos) : emptyLines; -}; - -Lp.trim = function() { - var start = this.skipSpaces(this.firstPos(), false, true); - if (start === null) - return emptyLines; - - var end = this.skipSpaces(this.lastPos(), true, true); - assert.notStrictEqual(end, null); - - return this.slice(start, end); -}; - -Lp.eachPos = function(callback, startPos, skipSpaces) { - var pos = this.firstPos(); - - if (startPos) { - pos.line = startPos.line, - pos.column = startPos.column - } - - if (skipSpaces && !this.skipSpaces(pos, false, true)) { - return; // Encountered nothing but spaces. - } - - do callback.call(this, pos); - while (this.nextPos(pos, skipSpaces)); -}; - -Lp.bootstrapSlice = function(start, end) { - var strings = this.toString().split( - lineTerminatorSeqExp - ).slice( - start.line - 1, - end.line - ); - - strings.push(strings.pop().slice(0, end.column)); - strings[0] = strings[0].slice(start.column); - - return fromString(strings.join("\n")); -}; - -Lp.slice = function(start, end) { - if (!end) { - if (!start) { - // The client seems to want a copy of this Lines object, but - // Lines objects are immutable, so it's perfectly adequate to - // return the same object. - return this; - } - - // Slice to the end if no end position was provided. - end = this.lastPos(); - } - - var secret = getSecret(this); - var sliced = secret.infos.slice(start.line - 1, end.line); - - if (start.line === end.line) { - sliced[0] = sliceInfo(sliced[0], start.column, end.column); - } else { - assert.ok(start.line < end.line); - sliced[0] = sliceInfo(sliced[0], start.column); - sliced.push(sliceInfo(sliced.pop(), 0, end.column)); - } - - var lines = new Lines(sliced); - - if (secret.mappings.length > 0) { - var newMappings = getSecret(lines).mappings; - assert.strictEqual(newMappings.length, 0); - secret.mappings.forEach(function(mapping) { - var sliced = mapping.slice(this, start, end); - if (sliced) { - newMappings.push(sliced); - } - }, this); - } - - return lines; -}; - -function sliceInfo(info, startCol, endCol) { - var sliceStart = info.sliceStart; - var sliceEnd = info.sliceEnd; - var indent = Math.max(info.indent, 0); - var lineLength = indent + sliceEnd - sliceStart; - - if (typeof endCol === "undefined") { - endCol = lineLength; - } - - startCol = Math.max(startCol, 0); - endCol = Math.min(endCol, lineLength); - endCol = Math.max(endCol, startCol); - - if (endCol < indent) { - indent = endCol; - sliceEnd = sliceStart; - } else { - sliceEnd -= lineLength - endCol; - } - - lineLength = endCol; - lineLength -= startCol; - - if (startCol < indent) { - indent -= startCol; - } else { - startCol -= indent; - indent = 0; - sliceStart += startCol; - } - - assert.ok(indent >= 0); - assert.ok(sliceStart <= sliceEnd); - assert.strictEqual(lineLength, indent + sliceEnd - sliceStart); - - if (info.indent === indent && - info.sliceStart === sliceStart && - info.sliceEnd === sliceEnd) { - return info; - } - - return { - line: info.line, - indent: indent, - sliceStart: sliceStart, - sliceEnd: sliceEnd - }; -} - -Lp.bootstrapSliceString = function(start, end, options) { - return this.slice(start, end).toString(options); -}; - -Lp.sliceString = function(start, end, options) { - if (!end) { - if (!start) { - // The client seems to want a copy of this Lines object, but - // Lines objects are immutable, so it's perfectly adequate to - // return the same object. - return this; - } - - // Slice to the end if no end position was provided. - end = this.lastPos(); - } - - options = normalizeOptions(options); - - var infos = getSecret(this).infos; - var parts = []; - var tabWidth = options.tabWidth; - - for (var line = start.line; line <= end.line; ++line) { - var info = infos[line - 1]; - - if (line === start.line) { - if (line === end.line) { - info = sliceInfo(info, start.column, end.column); - } else { - info = sliceInfo(info, start.column); - } - } else if (line === end.line) { - info = sliceInfo(info, 0, end.column); - } - - var indent = Math.max(info.indent, 0); - - var before = info.line.slice(0, info.sliceStart); - if (options.reuseWhitespace && - isOnlyWhitespace(before) && - countSpaces(before, options.tabWidth) === indent) { - // Reuse original spaces if the indentation is correct. - parts.push(info.line.slice(0, info.sliceEnd)); - continue; - } - - var tabs = 0; - var spaces = indent; - - if (options.useTabs) { - tabs = Math.floor(indent / tabWidth); - spaces -= tabs * tabWidth; - } - - var result = ""; - - if (tabs > 0) { - result += new Array(tabs + 1).join("\t"); - } - - if (spaces > 0) { - result += new Array(spaces + 1).join(" "); - } - - result += info.line.slice(info.sliceStart, info.sliceEnd); - - parts.push(result); - } - - return parts.join(options.lineTerminator); -}; - -Lp.isEmpty = function() { - return this.length < 2 && this.getLineLength(1) < 1; -}; - -Lp.join = function(elements) { - var separator = this; - var separatorSecret = getSecret(separator); - var infos = []; - var mappings = []; - var prevInfo; - - function appendSecret(secret) { - if (secret === null) - return; - - if (prevInfo) { - var info = secret.infos[0]; - var indent = new Array(info.indent + 1).join(" "); - var prevLine = infos.length; - var prevColumn = Math.max(prevInfo.indent, 0) + - prevInfo.sliceEnd - prevInfo.sliceStart; - - prevInfo.line = prevInfo.line.slice( - 0, prevInfo.sliceEnd) + indent + info.line.slice( - info.sliceStart, info.sliceEnd); - - prevInfo.sliceEnd = prevInfo.line.length; - - if (secret.mappings.length > 0) { - secret.mappings.forEach(function(mapping) { - mappings.push(mapping.add(prevLine, prevColumn)); - }); - } - - } else if (secret.mappings.length > 0) { - mappings.push.apply(mappings, secret.mappings); - } - - secret.infos.forEach(function(info, i) { - if (!prevInfo || i > 0) { - prevInfo = copyLineInfo(info); - infos.push(prevInfo); - } - }); - } - - function appendWithSeparator(secret, i) { - if (i > 0) - appendSecret(separatorSecret); - appendSecret(secret); - } - - elements.map(function(elem) { - var lines = fromString(elem); - if (lines.isEmpty()) - return null; - return getSecret(lines); - }).forEach(separator.isEmpty() - ? appendSecret - : appendWithSeparator); - - if (infos.length < 1) - return emptyLines; - - var lines = new Lines(infos); - - getSecret(lines).mappings = mappings; - - return lines; -}; - -exports.concat = function(elements) { - return emptyLines.join(elements); -}; - -Lp.concat = function(other) { - var args = arguments, - list = [this]; - list.push.apply(list, args); - assert.strictEqual(list.length, args.length + 1); - return emptyLines.join(list); -}; - -// The emptyLines object needs to be created all the way down here so that -// Lines.prototype will be fully populated. -var emptyLines = fromString(""); - -},{"1":1,"536":536,"561":561,"562":562,"566":566,"567":567,"607":607}],561:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var types = _dereq_(566); -var isString = types.builtInTypes.string; -var isNumber = types.builtInTypes.number; -var SourceLocation = types.namedTypes.SourceLocation; -var Position = types.namedTypes.Position; -var linesModule = _dereq_(560); -var comparePos = _dereq_(567).comparePos; - -function Mapping(sourceLines, sourceLoc, targetLoc) { - assert.ok(this instanceof Mapping); - assert.ok(sourceLines instanceof linesModule.Lines); - SourceLocation.assert(sourceLoc); - - if (targetLoc) { - // In certain cases it's possible for targetLoc.{start,end}.column - // values to be negative, which technically makes them no longer - // valid SourceLocation nodes, so we need to be more forgiving. - assert.ok( - isNumber.check(targetLoc.start.line) && - isNumber.check(targetLoc.start.column) && - isNumber.check(targetLoc.end.line) && - isNumber.check(targetLoc.end.column) - ); - } else { - // Assume identity mapping if no targetLoc specified. - targetLoc = sourceLoc; - } - - Object.defineProperties(this, { - sourceLines: { value: sourceLines }, - sourceLoc: { value: sourceLoc }, - targetLoc: { value: targetLoc } - }); -} - -var Mp = Mapping.prototype; -module.exports = Mapping; - -Mp.slice = function(lines, start, end) { - assert.ok(lines instanceof linesModule.Lines); - Position.assert(start); - - if (end) { - Position.assert(end); - } else { - end = lines.lastPos(); - } - - var sourceLines = this.sourceLines; - var sourceLoc = this.sourceLoc; - var targetLoc = this.targetLoc; - - function skip(name) { - var sourceFromPos = sourceLoc[name]; - var targetFromPos = targetLoc[name]; - var targetToPos = start; - - if (name === "end") { - targetToPos = end; - } else { - assert.strictEqual(name, "start"); - } - - return skipChars( - sourceLines, sourceFromPos, - lines, targetFromPos, targetToPos - ); - } - - if (comparePos(start, targetLoc.start) <= 0) { - if (comparePos(targetLoc.end, end) <= 0) { - targetLoc = { - start: subtractPos(targetLoc.start, start.line, start.column), - end: subtractPos(targetLoc.end, start.line, start.column) - }; - - // The sourceLoc can stay the same because the contents of the - // targetLoc have not changed. - - } else if (comparePos(end, targetLoc.start) <= 0) { - return null; - - } else { - sourceLoc = { - start: sourceLoc.start, - end: skip("end") - }; - - targetLoc = { - start: subtractPos(targetLoc.start, start.line, start.column), - end: subtractPos(end, start.line, start.column) - }; - } - - } else { - if (comparePos(targetLoc.end, start) <= 0) { - return null; - } - - if (comparePos(targetLoc.end, end) <= 0) { - sourceLoc = { - start: skip("start"), - end: sourceLoc.end - }; - - targetLoc = { - // Same as subtractPos(start, start.line, start.column): - start: { line: 1, column: 0 }, - end: subtractPos(targetLoc.end, start.line, start.column) - }; - - } else { - sourceLoc = { - start: skip("start"), - end: skip("end") - }; - - targetLoc = { - // Same as subtractPos(start, start.line, start.column): - start: { line: 1, column: 0 }, - end: subtractPos(end, start.line, start.column) - }; - } - } - - return new Mapping(this.sourceLines, sourceLoc, targetLoc); -}; - -Mp.add = function(line, column) { - return new Mapping(this.sourceLines, this.sourceLoc, { - start: addPos(this.targetLoc.start, line, column), - end: addPos(this.targetLoc.end, line, column) - }); -}; - -function addPos(toPos, line, column) { - return { - line: toPos.line + line - 1, - column: (toPos.line === 1) - ? toPos.column + column - : toPos.column - }; -} - -Mp.subtract = function(line, column) { - return new Mapping(this.sourceLines, this.sourceLoc, { - start: subtractPos(this.targetLoc.start, line, column), - end: subtractPos(this.targetLoc.end, line, column) - }); -}; - -function subtractPos(fromPos, line, column) { - return { - line: fromPos.line - line + 1, - column: (fromPos.line === line) - ? fromPos.column - column - : fromPos.column - }; -} - -Mp.indent = function(by, skipFirstLine, noNegativeColumns) { - if (by === 0) { - return this; - } - - var targetLoc = this.targetLoc; - var startLine = targetLoc.start.line; - var endLine = targetLoc.end.line; - - if (skipFirstLine && startLine === 1 && endLine === 1) { - return this; - } - - targetLoc = { - start: targetLoc.start, - end: targetLoc.end - }; - - if (!skipFirstLine || startLine > 1) { - var startColumn = targetLoc.start.column + by; - targetLoc.start = { - line: startLine, - column: noNegativeColumns - ? Math.max(0, startColumn) - : startColumn - }; - } - - if (!skipFirstLine || endLine > 1) { - var endColumn = targetLoc.end.column + by; - targetLoc.end = { - line: endLine, - column: noNegativeColumns - ? Math.max(0, endColumn) - : endColumn - }; - } - - return new Mapping(this.sourceLines, this.sourceLoc, targetLoc); -}; - -function skipChars( - sourceLines, sourceFromPos, - targetLines, targetFromPos, targetToPos -) { - assert.ok(sourceLines instanceof linesModule.Lines); - assert.ok(targetLines instanceof linesModule.Lines); - Position.assert(sourceFromPos); - Position.assert(targetFromPos); - Position.assert(targetToPos); - - var targetComparison = comparePos(targetFromPos, targetToPos); - if (targetComparison === 0) { - // Trivial case: no characters to skip. - return sourceFromPos; - } - - if (targetComparison < 0) { - // Skipping forward. - - var sourceCursor = sourceLines.skipSpaces(sourceFromPos); - var targetCursor = targetLines.skipSpaces(targetFromPos); - - var lineDiff = targetToPos.line - targetCursor.line; - sourceCursor.line += lineDiff; - targetCursor.line += lineDiff; - - if (lineDiff > 0) { - // If jumping to later lines, reset columns to the beginnings - // of those lines. - sourceCursor.column = 0; - targetCursor.column = 0; - } else { - assert.strictEqual(lineDiff, 0); - } - - while (comparePos(targetCursor, targetToPos) < 0 && - targetLines.nextPos(targetCursor, true)) { - assert.ok(sourceLines.nextPos(sourceCursor, true)); - assert.strictEqual( - sourceLines.charAt(sourceCursor), - targetLines.charAt(targetCursor) - ); - } - - } else { - // Skipping backward. - - var sourceCursor = sourceLines.skipSpaces(sourceFromPos, true); - var targetCursor = targetLines.skipSpaces(targetFromPos, true); - - var lineDiff = targetToPos.line - targetCursor.line; - sourceCursor.line += lineDiff; - targetCursor.line += lineDiff; - - if (lineDiff < 0) { - // If jumping to earlier lines, reset columns to the ends of - // those lines. - sourceCursor.column = sourceLines.getLineLength(sourceCursor.line); - targetCursor.column = targetLines.getLineLength(targetCursor.line); - } else { - assert.strictEqual(lineDiff, 0); - } - - while (comparePos(targetToPos, targetCursor) < 0 && - targetLines.prevPos(targetCursor, true)) { - assert.ok(sourceLines.prevPos(sourceCursor, true)); - assert.strictEqual( - sourceLines.charAt(sourceCursor), - targetLines.charAt(targetCursor) - ); - } - } - - return sourceCursor; -} - -},{"1":1,"560":560,"566":566,"567":567}],562:[function(_dereq_,module,exports){ -var defaults = { - // If you want to use a different branch of esprima, or any other - // module that supports a .parse function, pass that module object to - // recast.parse as options.esprima. - esprima: _dereq_(3), - - // Number of spaces the pretty-printer should use per tab for - // indentation. If you do not pass this option explicitly, it will be - // (quite reliably!) inferred from the original code. - tabWidth: 4, - - // If you really want the pretty-printer to use tabs instead of - // spaces, make this option true. - useTabs: false, - - // The reprinting code leaves leading whitespace untouched unless it - // has to reindent a line, or you pass false for this option. - reuseWhitespace: true, - - // Override this option to use a different line terminator, e.g. \r\n. - lineTerminator: _dereq_(8).EOL, - - // Some of the pretty-printer code (such as that for printing function - // parameter lists) makes a valiant attempt to prevent really long - // lines. You can adjust the limit by changing this option; however, - // there is no guarantee that line length will fit inside this limit. - wrapColumn: 74, // Aspirational for now. - - // Pass a string as options.sourceFileName to recast.parse to tell the - // reprinter to keep track of reused code so that it can construct a - // source map automatically. - sourceFileName: null, - - // Pass a string as options.sourceMapName to recast.print, and - // (provided you passed options.sourceFileName earlier) the - // PrintResult of recast.print will have a .map property for the - // generated source map. - sourceMapName: null, - - // If provided, this option will be passed along to the source map - // generator as a root directory for relative source file paths. - sourceRoot: null, - - // If you provide a source map that was generated from a previous call - // to recast.print as options.inputSourceMap, the old source map will - // be composed with the new source map. - inputSourceMap: null, - - // If you want esprima to generate .range information (recast only - // uses .loc internally), pass true for this option. - range: false, - - // If you want esprima not to throw exceptions when it encounters - // non-fatal errors, keep this option true. - tolerant: true, - - // If you want to override the quotes used in string literals, specify - // either "single", "double", or "auto" here ("auto" will select the one - // which results in the shorter literal) - // Otherwise, the input marks will be preserved - quote: null, - - // If you want to print trailing commas in object literals, - // array expressions, functions calls and function definitions pass true - // for this option. - trailingComma: false, -}, hasOwn = defaults.hasOwnProperty; - -// Copy options and fill in default values. -exports.normalize = function(options) { - options = options || defaults; - - function get(key) { - return hasOwn.call(options, key) - ? options[key] - : defaults[key]; - } - - return { - tabWidth: +get("tabWidth"), - useTabs: !!get("useTabs"), - reuseWhitespace: !!get("reuseWhitespace"), - lineTerminator: get("lineTerminator"), - wrapColumn: Math.max(get("wrapColumn"), 0), - sourceFileName: get("sourceFileName"), - sourceMapName: get("sourceMapName"), - sourceRoot: get("sourceRoot"), - inputSourceMap: get("inputSourceMap"), - esprima: get("esprima"), - range: get("range"), - tolerant: get("tolerant"), - quote: get("quote"), - trailingComma: get("trailingComma"), - }; -}; - -},{"3":3,"8":8}],563:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var types = _dereq_(566); -var n = types.namedTypes; -var b = types.builders; -var isObject = types.builtInTypes.object; -var isArray = types.builtInTypes.array; -var isFunction = types.builtInTypes.function; -var Patcher = _dereq_(564).Patcher; -var normalizeOptions = _dereq_(562).normalize; -var fromString = _dereq_(560).fromString; -var attachComments = _dereq_(558).attach; -var util = _dereq_(567); - -exports.parse = function parse(source, options) { - options = normalizeOptions(options); - - var lines = fromString(source, options); - - var sourceWithoutTabs = lines.toString({ - tabWidth: options.tabWidth, - reuseWhitespace: false, - useTabs: false - }); - - var comments = []; - var program = options.esprima.parse(sourceWithoutTabs, { - loc: true, - locations: true, - range: options.range, - comment: true, - onComment: comments, - tolerant: options.tolerant, - ecmaVersion: 6, - sourceType: 'module' - }); - - program.loc = program.loc || { - start: lines.firstPos(), - end: lines.lastPos() - }; - - program.loc.lines = lines; - program.loc.indent = 0; - - // Expand the Program node's .loc to include all comments, since - // typically its .loc.start and .loc.end will coincide with those of - // the first and last statements, respectively, excluding any comments - // that fall outside that region. - var trueProgramLoc = util.getTrueLoc(program, lines); - program.loc.start = trueProgramLoc.start; - program.loc.end = trueProgramLoc.end; - - if (program.comments) { - comments = program.comments; - delete program.comments; - } - - // In order to ensure we reprint leading and trailing program - // comments, wrap the original Program node with a File node. - var file = b.file(program); - file.loc = { - lines: lines, - indent: 0, - start: lines.firstPos(), - end: lines.lastPos() - }; - - // Passing file.program here instead of just file means that initial - // comments will be attached to program.body[0] instead of program. - attachComments( - comments, - program.body.length ? file.program : file, - lines - ); - - // Return a copy of the original AST so that any changes made may be - // compared to the original. - return new TreeCopier(lines).copy(file); -}; - -function TreeCopier(lines) { - assert.ok(this instanceof TreeCopier); - this.lines = lines; - this.indent = 0; -} - -var TCp = TreeCopier.prototype; - -TCp.copy = function(node) { - if (isArray.check(node)) { - return node.map(this.copy, this); - } - - if (!isObject.check(node)) { - return node; - } - - util.fixFaultyLocations(node); - - var copy = Object.create(Object.getPrototypeOf(node), { - original: { // Provide a link from the copy to the original. - value: node, - configurable: false, - enumerable: false, - writable: true - } - }); - - var loc = node.loc; - var oldIndent = this.indent; - var newIndent = oldIndent; - - if (loc) { - // When node is a comment, we set node.loc.indent to - // node.loc.start.column so that, when/if we print the comment by - // itself, we can strip that much whitespace from the left margin - // of the comment. This only really matters for multiline Block - // comments, but it doesn't hurt for Line comments. - if (node.type === "Block" || node.type === "Line" || - this.lines.isPrecededOnlyByWhitespace(loc.start)) { - newIndent = this.indent = loc.start.column; - } - - loc.lines = this.lines; - loc.indent = newIndent; - } - - var keys = Object.keys(node); - var keyCount = keys.length; - for (var i = 0; i < keyCount; ++i) { - var key = keys[i]; - if (key === "loc") { - copy[key] = node[key]; - } else { - copy[key] = this.copy(node[key]); - } - } - - this.indent = oldIndent; - - return copy; -}; - -},{"1":1,"558":558,"560":560,"562":562,"564":564,"566":566,"567":567}],564:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var linesModule = _dereq_(560); -var types = _dereq_(566); -var getFieldValue = types.getFieldValue; -var Printable = types.namedTypes.Printable; -var Expression = types.namedTypes.Expression; -var SourceLocation = types.namedTypes.SourceLocation; -var util = _dereq_(567); -var comparePos = util.comparePos; -var FastPath = _dereq_(559); -var isObject = types.builtInTypes.object; -var isArray = types.builtInTypes.array; -var isString = types.builtInTypes.string; -var riskyAdjoiningCharExp = /[0-9a-z_$]/i; - -function Patcher(lines) { - assert.ok(this instanceof Patcher); - assert.ok(lines instanceof linesModule.Lines); - - var self = this, - replacements = []; - - self.replace = function(loc, lines) { - if (isString.check(lines)) - lines = linesModule.fromString(lines); - - replacements.push({ - lines: lines, - start: loc.start, - end: loc.end - }); - }; - - self.get = function(loc) { - // If no location is provided, return the complete Lines object. - loc = loc || { - start: { line: 1, column: 0 }, - end: { line: lines.length, - column: lines.getLineLength(lines.length) } - }; - - var sliceFrom = loc.start, - toConcat = []; - - function pushSlice(from, to) { - assert.ok(comparePos(from, to) <= 0); - toConcat.push(lines.slice(from, to)); - } - - replacements.sort(function(a, b) { - return comparePos(a.start, b.start); - }).forEach(function(rep) { - if (comparePos(sliceFrom, rep.start) > 0) { - // Ignore nested replacement ranges. - } else { - pushSlice(sliceFrom, rep.start); - toConcat.push(rep.lines); - sliceFrom = rep.end; - } - }); - - pushSlice(sliceFrom, loc.end); - - return linesModule.concat(toConcat); - }; -} -exports.Patcher = Patcher; - -var Pp = Patcher.prototype; - -Pp.tryToReprintComments = function(newNode, oldNode, print) { - var patcher = this; - - if (!newNode.comments && - !oldNode.comments) { - // We were (vacuously) able to reprint all the comments! - return true; - } - - var newPath = FastPath.from(newNode); - var oldPath = FastPath.from(oldNode); - - newPath.stack.push("comments", getSurroundingComments(newNode)); - oldPath.stack.push("comments", getSurroundingComments(oldNode)); - - var reprints = []; - var ableToReprintComments = - findArrayReprints(newPath, oldPath, reprints); - - // No need to pop anything from newPath.stack or oldPath.stack, since - // newPath and oldPath are fresh local variables. - - if (ableToReprintComments && reprints.length > 0) { - reprints.forEach(function(reprint) { - var oldComment = reprint.oldPath.getValue(); - assert.ok(oldComment.leading || oldComment.trailing); - patcher.replace( - oldComment.loc, - // Comments can't have .comments, so it doesn't matter - // whether we print with comments or without. - print(reprint.newPath).indentTail(oldComment.loc.indent) - ); - }); - } - - return ableToReprintComments; -}; - -// Get all comments that are either leading or trailing, ignoring any -// comments that occur inside node.loc. Returns an empty array for nodes -// with no leading or trailing comments. -function getSurroundingComments(node) { - var result = []; - if (node.comments && - node.comments.length > 0) { - node.comments.forEach(function(comment) { - if (comment.leading || comment.trailing) { - result.push(comment); - } - }); - } - return result; -} - -Pp.deleteComments = function(node) { - if (!node.comments) { - return; - } - - var patcher = this; - - node.comments.forEach(function(comment) { - if (comment.leading) { - // Delete leading comments along with any trailing whitespace - // they might have. - patcher.replace({ - start: comment.loc.start, - end: node.loc.lines.skipSpaces( - comment.loc.end, false, false) - }, ""); - - } else if (comment.trailing) { - // Delete trailing comments along with any leading whitespace - // they might have. - patcher.replace({ - start: node.loc.lines.skipSpaces( - comment.loc.start, true, false), - end: comment.loc.end - }, ""); - } - }); -}; - -exports.getReprinter = function(path) { - assert.ok(path instanceof FastPath); - - // Make sure that this path refers specifically to a Node, rather than - // some non-Node subproperty of a Node. - var node = path.getValue(); - if (!Printable.check(node)) - return; - - var orig = node.original; - var origLoc = orig && orig.loc; - var lines = origLoc && origLoc.lines; - var reprints = []; - - if (!lines || !findReprints(path, reprints)) - return; - - return function(print) { - var patcher = new Patcher(lines); - - reprints.forEach(function(reprint) { - var newNode = reprint.newPath.getValue(); - var oldNode = reprint.oldPath.getValue(); - - SourceLocation.assert(oldNode.loc, true); - - var needToPrintNewPathWithComments = - !patcher.tryToReprintComments(newNode, oldNode, print) - - if (needToPrintNewPathWithComments) { - // Since we were not able to preserve all leading/trailing - // comments, we delete oldNode's comments, print newPath - // with comments, and then patch the resulting lines where - // oldNode used to be. - patcher.deleteComments(oldNode); - } - - var pos = util.copyPos(oldNode.loc.start); - var needsLeadingSpace = lines.prevPos(pos) && - riskyAdjoiningCharExp.test(lines.charAt(pos)); - - var newLines = print( - reprint.newPath, - needToPrintNewPathWithComments - ).indentTail(oldNode.loc.indent); - - var needsTrailingSpace = - riskyAdjoiningCharExp.test(lines.charAt(oldNode.loc.end)); - - // If we try to replace the argument of a ReturnStatement like - // return"asdf" with e.g. a literal null expression, we run - // the risk of ending up with returnnull, so we need to add an - // extra leading space in situations where that might - // happen. Likewise for "asdf"in obj. See #170. - if (needsLeadingSpace || needsTrailingSpace) { - var newParts = []; - needsLeadingSpace && newParts.push(" "); - newParts.push(newLines); - needsTrailingSpace && newParts.push(" "); - newLines = linesModule.concat(newParts); - } - - patcher.replace(oldNode.loc, newLines); - }); - - // Recall that origLoc is the .loc of an ancestor node that is - // guaranteed to contain all the reprinted nodes and comments. - return patcher.get(origLoc).indentTail(-orig.loc.indent); - }; -}; - -function findReprints(newPath, reprints) { - var newNode = newPath.getValue(); - Printable.assert(newNode); - - var oldNode = newNode.original; - Printable.assert(oldNode); - - assert.deepEqual(reprints, []); - - if (newNode.type !== oldNode.type) { - return false; - } - - var oldPath = new FastPath(oldNode); - var canReprint = findChildReprints(newPath, oldPath, reprints); - - if (!canReprint) { - // Make absolutely sure the calling code does not attempt to reprint - // any nodes. - reprints.length = 0; - } - - return canReprint; -} - -function findAnyReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - - if (newNode === oldNode) - return true; - - if (isArray.check(newNode)) - return findArrayReprints(newPath, oldPath, reprints); - - if (isObject.check(newNode)) - return findObjectReprints(newPath, oldPath, reprints); - - return false; -} - -function findArrayReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - isArray.assert(newNode); - var len = newNode.length; - - if (!(isArray.check(oldNode) && - oldNode.length === len)) - return false; - - for (var i = 0; i < len; ++i) { - newPath.stack.push(i, newNode[i]); - oldPath.stack.push(i, oldNode[i]); - var canReprint = findAnyReprints(newPath, oldPath, reprints); - newPath.stack.length -= 2; - oldPath.stack.length -= 2; - if (!canReprint) { - return false; - } - } - - return true; -} - -function findObjectReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - isObject.assert(newNode); - - if (newNode.original === null) { - // If newNode.original node was set to null, reprint the node. - return false; - } - - var oldNode = oldPath.getValue(); - if (!isObject.check(oldNode)) - return false; - - if (Printable.check(newNode)) { - if (!Printable.check(oldNode)) { - return false; - } - - // Here we need to decide whether the reprinted code for newNode - // is appropriate for patching into the location of oldNode. - - if (newNode.type === oldNode.type) { - var childReprints = []; - - if (findChildReprints(newPath, oldPath, childReprints)) { - reprints.push.apply(reprints, childReprints); - } else if (oldNode.loc) { - // If we have no .loc information for oldNode, then we - // won't be able to reprint it. - reprints.push({ - oldPath: oldPath.copy(), - newPath: newPath.copy() - }); - } else { - return false; - } - - return true; - } - - if (Expression.check(newNode) && - Expression.check(oldNode) && - // If we have no .loc information for oldNode, then we won't - // be able to reprint it. - oldNode.loc) { - - // If both nodes are subtypes of Expression, then we should be - // able to fill the location occupied by the old node with - // code printed for the new node with no ill consequences. - reprints.push({ - oldPath: oldPath.copy(), - newPath: newPath.copy() - }); - - return true; - } - - // The nodes have different types, and at least one of the types - // is not a subtype of the Expression type, so we cannot safely - // assume the nodes are syntactically interchangeable. - return false; - } - - return findChildReprints(newPath, oldPath, reprints); -} - -// This object is reused in hasOpeningParen and hasClosingParen to avoid -// having to allocate a temporary object. -var reusablePos = { line: 1, column: 0 }; -var nonSpaceExp = /\S/; - -function hasOpeningParen(oldPath) { - var oldNode = oldPath.getValue(); - var loc = oldNode.loc; - var lines = loc && loc.lines; - - if (lines) { - var pos = reusablePos; - pos.line = loc.start.line; - pos.column = loc.start.column; - - while (lines.prevPos(pos)) { - var ch = lines.charAt(pos); - - if (ch === "(") { - // If we found an opening parenthesis but it occurred before - // the start of the original subtree for this reprinting, then - // we must not return true for hasOpeningParen(oldPath). - return comparePos(oldPath.getRootValue().loc.start, pos) <= 0; - } - - if (nonSpaceExp.test(ch)) { - return false; - } - } - } - - return false; -} - -function hasClosingParen(oldPath) { - var oldNode = oldPath.getValue(); - var loc = oldNode.loc; - var lines = loc && loc.lines; - - if (lines) { - var pos = reusablePos; - pos.line = loc.end.line; - pos.column = loc.end.column; - - do { - var ch = lines.charAt(pos); - - if (ch === ")") { - // If we found a closing parenthesis but it occurred after the - // end of the original subtree for this reprinting, then we - // must not return true for hasClosingParen(oldPath). - return comparePos(pos, oldPath.getRootValue().loc.end) <= 0; - } - - if (nonSpaceExp.test(ch)) { - return false; - } - - } while (lines.nextPos(pos)); - } - - return false; -} - -function hasParens(oldPath) { - // This logic can technically be fooled if the node has parentheses - // but there are comments intervening between the parentheses and the - // node. In such cases the node will be harmlessly wrapped in an - // additional layer of parentheses. - return hasOpeningParen(oldPath) && hasClosingParen(oldPath); -} - -function findChildReprints(newPath, oldPath, reprints) { - var newNode = newPath.getValue(); - var oldNode = oldPath.getValue(); - - isObject.assert(newNode); - isObject.assert(oldNode); - - if (newNode.original === null) { - // If newNode.original node was set to null, reprint the node. - return false; - } - - // If this type of node cannot come lexically first in its enclosing - // statement (e.g. a function expression or object literal), and it - // seems to be doing so, then the only way we can ignore this problem - // and save ourselves from falling back to the pretty printer is if an - // opening parenthesis happens to precede the node. For example, - // (function(){ ... }()); does not need to be reprinted, even though - // the FunctionExpression comes lexically first in the enclosing - // ExpressionStatement and fails the hasParens test, because the - // parent CallExpression passes the hasParens test. If we relied on - // the path.needsParens() && !hasParens(oldNode) check below, the - // absence of a closing parenthesis after the FunctionExpression would - // trigger pretty-printing unnecessarily. - if (!newPath.canBeFirstInStatement() && - newPath.firstInStatement() && - !hasOpeningParen(oldPath)) - return false; - - // If this node needs parentheses and will not be wrapped with - // parentheses when reprinted, then return false to skip reprinting - // and let it be printed generically. - if (newPath.needsParens(true) && !hasParens(oldPath)) { - return false; - } - - for (var k in util.getUnionOfKeys(newNode, oldNode)) { - if (k === "loc") - continue; - - newPath.stack.push(k, types.getFieldValue(newNode, k)); - oldPath.stack.push(k, types.getFieldValue(oldNode, k)); - var canReprint = findAnyReprints(newPath, oldPath, reprints); - newPath.stack.length -= 2; - oldPath.stack.length -= 2; - - if (!canReprint) { - return false; - } - } - - return true; -} - -},{"1":1,"559":559,"560":560,"566":566,"567":567}],565:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var sourceMap = _dereq_(607); -var printComments = _dereq_(558).printComments; -var linesModule = _dereq_(560); -var fromString = linesModule.fromString; -var concat = linesModule.concat; -var normalizeOptions = _dereq_(562).normalize; -var getReprinter = _dereq_(564).getReprinter; -var types = _dereq_(566); -var namedTypes = types.namedTypes; -var isString = types.builtInTypes.string; -var isObject = types.builtInTypes.object; -var FastPath = _dereq_(559); -var util = _dereq_(567); - -function PrintResult(code, sourceMap) { - assert.ok(this instanceof PrintResult); - - isString.assert(code); - this.code = code; - - if (sourceMap) { - isObject.assert(sourceMap); - this.map = sourceMap; - } -} - -var PRp = PrintResult.prototype; -var warnedAboutToString = false; - -PRp.toString = function() { - if (!warnedAboutToString) { - console.warn( - "Deprecation warning: recast.print now returns an object with " + - "a .code property. You appear to be treating the object as a " + - "string, which might still work but is strongly discouraged." - ); - - warnedAboutToString = true; - } - - return this.code; -}; - -var emptyPrintResult = new PrintResult(""); - -function Printer(originalOptions) { - assert.ok(this instanceof Printer); - - var explicitTabWidth = originalOptions && originalOptions.tabWidth; - var options = normalizeOptions(originalOptions); - assert.notStrictEqual(options, originalOptions); - - // It's common for client code to pass the same options into both - // recast.parse and recast.print, but the Printer doesn't need (and - // can be confused by) options.sourceFileName, so we null it out. - options.sourceFileName = null; - - function printWithComments(path) { - assert.ok(path instanceof FastPath); - return printComments(path, print); - } - - function print(path, includeComments) { - if (includeComments) - return printWithComments(path); - - assert.ok(path instanceof FastPath); - - if (!explicitTabWidth) { - var oldTabWidth = options.tabWidth; - var loc = path.getNode().loc; - if (loc && loc.lines && loc.lines.guessTabWidth) { - options.tabWidth = loc.lines.guessTabWidth(); - var lines = maybeReprint(path); - options.tabWidth = oldTabWidth; - return lines; - } - } - - return maybeReprint(path); - } - - function maybeReprint(path) { - var reprinter = getReprinter(path); - if (reprinter) - return maybeAddParens(path, reprinter(print)); - return printRootGenerically(path); - } - - // Print the root node generically, but then resume reprinting its - // children non-generically. - function printRootGenerically(path) { - return genericPrint(path, options, printWithComments); - } - - // Print the entire AST generically. - function printGenerically(path) { - return genericPrint(path, options, printGenerically); - } - - this.print = function(ast) { - if (!ast) { - return emptyPrintResult; - } - - var lines = print(FastPath.from(ast), true); - - return new PrintResult( - lines.toString(options), - util.composeSourceMaps( - options.inputSourceMap, - lines.getSourceMap( - options.sourceMapName, - options.sourceRoot - ) - ) - ); - }; - - this.printGenerically = function(ast) { - if (!ast) { - return emptyPrintResult; - } - - var path = FastPath.from(ast); - var oldReuseWhitespace = options.reuseWhitespace; - - // Do not reuse whitespace (or anything else, for that matter) - // when printing generically. - options.reuseWhitespace = false; - - // TODO Allow printing of comments? - var pr = new PrintResult(printGenerically(path).toString(options)); - options.reuseWhitespace = oldReuseWhitespace; - return pr; - }; -} - -exports.Printer = Printer; - -function maybeAddParens(path, lines) { - return path.needsParens() ? concat(["(", lines, ")"]) : lines; -} - -function genericPrint(path, options, printPath) { - assert.ok(path instanceof FastPath); - return maybeAddParens(path, genericPrintNoParens(path, options, printPath)); -} - -function genericPrintNoParens(path, options, print) { - var n = path.getValue(); - - if (!n) { - return fromString(""); - } - - if (typeof n === "string") { - return fromString(n, options); - } - - namedTypes.Printable.assert(n); - - switch (n.type) { - case "File": - return path.call(print, "program"); - - case "Program": - return path.call(function(bodyPath) { - return printStatementSequence(bodyPath, options, print); - }, "body"); - - case "Noop": // Babel extension. - case "EmptyStatement": - return fromString(""); - - case "ExpressionStatement": - return concat([path.call(print, "expression"), ";"]); - - case "ParenthesizedExpression": // Babel extension. - return concat(["(", path.call(print, "expression"), ")"]); - - case "BinaryExpression": - case "LogicalExpression": - case "AssignmentExpression": - return fromString(" ").join([ - path.call(print, "left"), - n.operator, - path.call(print, "right") - ]); - - case "AssignmentPattern": - return concat([ - path.call(print, "left"), - "=", - path.call(print, "right") - ]); - - case "MemberExpression": - var parts = [path.call(print, "object")]; - - var property = path.call(print, "property"); - if (n.computed) { - parts.push("[", property, "]"); - } else { - parts.push(".", property); - } - - return concat(parts); - - case "MetaProperty": - return concat([ - path.call(print, "meta"), - ".", - path.call(print, "property") - ]); - - case "BindExpression": - var parts = []; - - if (n.object) { - parts.push(path.call(print, "object")); - } - - parts.push("::", path.call(print, "callee")); - - return concat(parts); - - case "Path": - return fromString(".").join(n.body); - - case "Identifier": - return concat([ - fromString(n.name, options), - path.call(print, "typeAnnotation") - ]); - - case "SpreadElement": - case "SpreadElementPattern": - case "SpreadProperty": - case "SpreadPropertyPattern": - case "RestElement": - return concat(["...", path.call(print, "argument")]); - - case "FunctionDeclaration": - case "FunctionExpression": - var parts = []; - - if (n.async) - parts.push("async "); - - parts.push("function"); - - if (n.generator) - parts.push("*"); - - if (n.id) { - parts.push( - " ", - path.call(print, "id"), - path.call(print, "typeParameters") - ); - } - - parts.push( - "(", - printFunctionParams(path, options, print), - ")", - path.call(print, "returnType"), - " ", - path.call(print, "body") - ); - - return concat(parts); - - case "ArrowFunctionExpression": - var parts = []; - - if (n.async) - parts.push("async "); - - if ( - n.params.length === 1 && - !n.rest && - n.params[0].type !== 'SpreadElementPattern' && - n.params[0].type !== 'RestElement' - ) { - parts.push(path.call(print, "params", 0)); - } else { - parts.push( - "(", - printFunctionParams(path, options, print), - ")" - ); - } - - parts.push(" => ", path.call(print, "body")); - - return concat(parts); - - case "MethodDefinition": - var parts = []; - - if (n.static) { - parts.push("static "); - } - - parts.push(printMethod(path, options, print)); - - return concat(parts); - - case "YieldExpression": - var parts = ["yield"]; - - if (n.delegate) - parts.push("*"); - - if (n.argument) - parts.push(" ", path.call(print, "argument")); - - return concat(parts); - - case "AwaitExpression": - var parts = ["await"]; - - if (n.all) - parts.push("*"); - - if (n.argument) - parts.push(" ", path.call(print, "argument")); - - return concat(parts); - - case "ModuleDeclaration": - var parts = ["module", path.call(print, "id")]; - - if (n.source) { - assert.ok(!n.body); - parts.push("from", path.call(print, "source")); - } else { - parts.push(path.call(print, "body")); - } - - return fromString(" ").join(parts); - - case "ImportSpecifier": - var parts = []; - - if (n.imported) { - parts.push(path.call(print, "imported")); - if (n.local && - n.local.name !== n.imported.name) { - parts.push(" as ", path.call(print, "local")); - } - } else if (n.id) { - parts.push(path.call(print, "id")); - if (n.name) { - parts.push(" as ", path.call(print, "name")); - } - } - - return concat(parts); - - case "ExportSpecifier": - var parts = []; - - if (n.local) { - parts.push(path.call(print, "local")); - if (n.exported && - n.exported.name !== n.local.name) { - parts.push(" as ", path.call(print, "exported")); - } - } else if (n.id) { - parts.push(path.call(print, "id")); - if (n.name) { - parts.push(" as ", path.call(print, "name")); - } - } - - return concat(parts); - - case "ExportBatchSpecifier": - return fromString("*"); - - case "ImportNamespaceSpecifier": - var parts = ["* as "]; - if (n.local) { - parts.push(path.call(print, "local")); - } else if (n.id) { - parts.push(path.call(print, "id")); - } - return concat(parts); - - case "ImportDefaultSpecifier": - if (n.local) { - return path.call(print, "local"); - } - return path.call(print, "id"); - - case "ExportDeclaration": - var parts = ["export"]; - - if (n["default"]) { - parts.push(" default"); - - } else if (n.specifiers && - n.specifiers.length > 0) { - - if (n.specifiers.length === 1 && - n.specifiers[0].type === "ExportBatchSpecifier") { - parts.push(" *"); - } else { - parts.push( - " { ", - fromString(", ").join(path.map(print, "specifiers")), - " }" - ); - } - - if (n.source) - parts.push(" from ", path.call(print, "source")); - - parts.push(";"); - - return concat(parts); - } - - if (n.declaration) { - var decLines = path.call(print, "declaration"); - parts.push(" ", decLines); - if (lastNonSpaceCharacter(decLines) !== ";") { - parts.push(";"); - } - } - - return concat(parts); - - case "ExportDefaultDeclaration": - return concat([ - "export default ", - path.call(print, "declaration") - ]); - - case "ExportNamedDeclaration": - var parts = ["export "]; - - if (n.declaration) { - parts.push(path.call(print, "declaration")); - } - - if (n.specifiers && - n.specifiers.length > 0) { - parts.push( - n.declaration ? ", {" : "{", - fromString(", ").join(path.map(print, "specifiers")), - "}" - ); - } - - if (n.source) { - parts.push(" from ", path.call(print, "source")); - } - - return concat(parts); - - case "ExportAllDeclaration": - var parts = ["export *"]; - - if (n.exported) { - parts.push(" as ", path.call(print, "exported")); - } - - return concat([ - " from ", - path.call(print, "source") - ]); - - case "ExportNamespaceSpecifier": - return concat(["* as ", path.call(print, "exported")]); - - case "ExportDefaultSpecifier": - return path.call(print, "exported"); - - case "ImportDeclaration": - var parts = ["import "]; - - if (n.importKind && n.importKind !== "value") { - parts.push(n.importKind + " "); - } - - if (n.specifiers && - n.specifiers.length > 0) { - - var foundImportSpecifier = false; - - path.each(function(specifierPath) { - var i = specifierPath.getName(); - if (i > 0) { - parts.push(", "); - } - - var value = specifierPath.getValue(); - - if (namedTypes.ImportDefaultSpecifier.check(value) || - namedTypes.ImportNamespaceSpecifier.check(value)) { - assert.strictEqual(foundImportSpecifier, false); - } else { - namedTypes.ImportSpecifier.assert(value); - if (!foundImportSpecifier) { - foundImportSpecifier = true; - parts.push("{"); - } - } - - parts.push(print(specifierPath)); - }, "specifiers"); - - if (foundImportSpecifier) { - parts.push("}"); - } - - parts.push(" from "); - } - - parts.push(path.call(print, "source"), ";"); - - return concat(parts); - - case "BlockStatement": - var naked = path.call(function(bodyPath) { - return printStatementSequence(bodyPath, options, print); - }, "body"); - - if (naked.isEmpty()) { - return fromString("{}"); - } - - return concat([ - "{\n", - naked.indent(options.tabWidth), - "\n}" - ]); - - case "ReturnStatement": - var parts = ["return"]; - - if (n.argument) { - var argLines = path.call(print, "argument"); - if (argLines.length > 1 && - (namedTypes.XJSElement && - namedTypes.XJSElement.check(n.argument) || - namedTypes.JSXElement && - namedTypes.JSXElement.check(n.argument))) { - parts.push( - " (\n", - argLines.indent(options.tabWidth), - "\n)" - ); - } else { - parts.push(" ", argLines); - } - } - - parts.push(";"); - - return concat(parts); - - case "CallExpression": - return concat([ - path.call(print, "callee"), - printArgumentsList(path, options, print) - ]); - - case "ObjectExpression": - case "ObjectPattern": - case "ObjectTypeAnnotation": - var allowBreak = false; - var isTypeAnnotation = n.type === "ObjectTypeAnnotation"; - var separator = isTypeAnnotation ? ';' : ','; - var fields = []; - - if (isTypeAnnotation) { - fields.push("indexers", "callProperties"); - } - - fields.push("properties"); - - var len = 0; - fields.forEach(function(field) { - len += n[field].length; - }); - - var oneLine = (isTypeAnnotation && len === 1) || len === 0; - var parts = [oneLine ? "{" : "{\n"]; - - var i = 0; - fields.forEach(function(field) { - path.each(function(childPath) { - var lines = print(childPath); - - if (!oneLine) { - lines = lines.indent(options.tabWidth); - } - - var multiLine = !isTypeAnnotation && lines.length > 1; - if (multiLine && allowBreak) { - // Similar to the logic for BlockStatement. - parts.push("\n"); - } - - parts.push(lines); - - if (i < len - 1) { - // Add an extra line break if the previous object property - // had a multi-line value. - parts.push(separator + (multiLine ? "\n\n" : "\n")); - allowBreak = !multiLine; - } else if (len !== 1 && isTypeAnnotation) { - parts.push(separator); - } else if (options.trailingComma) { - parts.push(separator); - } - i++; - }, field); - }); - - parts.push(oneLine ? "}" : "\n}"); - - return concat(parts); - - case "PropertyPattern": - return concat([ - path.call(print, "key"), - ": ", - path.call(print, "pattern") - ]); - - case "Property": // Non-standard AST node type. - if (n.method || n.kind === "get" || n.kind === "set") { - return printMethod(path, options, print); - } - - var parts = []; - - if (n.decorators) { - path.each(function(decoratorPath) { - parts.push(print(decoratorPath), "\n"); - }, "decorators"); - } - - var key = path.call(print, "key"); - if (n.computed) { - parts.push("[", key, "]"); - } else { - parts.push(key); - } - - if (! n.shorthand) { - parts.push(": ", path.call(print, "value")); - } - - return concat(parts); - - case "Decorator": - return concat(["@", path.call(print, "expression")]); - - case "ArrayExpression": - case "ArrayPattern": - var elems = n.elements, - len = elems.length; - - var printed = path.map(print, "elements"); - var joined = fromString(", ").join(printed); - var oneLine = joined.getLineLength(1) <= options.wrapColumn; - var parts = [oneLine ? "[" : "[\n"]; - - path.each(function(elemPath) { - var i = elemPath.getName(); - var elem = elemPath.getValue(); - if (!elem) { - // If the array expression ends with a hole, that hole - // will be ignored by the interpreter, but if it ends with - // two (or more) holes, we need to write out two (or more) - // commas so that the resulting code is interpreted with - // both (all) of the holes. - parts.push(","); - } else { - var lines = printed[i]; - if (oneLine) { - if (i > 0) - parts.push(" "); - } else { - lines = lines.indent(options.tabWidth); - } - parts.push(lines); - if (i < len - 1 || (!oneLine && options.trailingComma)) - parts.push(","); - if (!oneLine) - parts.push("\n"); - } - }, "elements"); - - parts.push("]"); - - return concat(parts); - - case "SequenceExpression": - return fromString(", ").join(path.map(print, "expressions")); - - case "ThisExpression": - return fromString("this"); - - case "Super": - return fromString("super"); - - case "Literal": - if (typeof n.value !== "string") - return fromString(n.value, options); - - return fromString(nodeStr(n.value, options), options); - - case "ModuleSpecifier": - if (n.local) { - throw new Error( - "The ESTree ModuleSpecifier type should be abstract" - ); - } - - // The Esprima ModuleSpecifier type is just a string-valued - // Literal identifying the imported-from module. - return fromString(nodeStr(n.value, options), options); - - case "UnaryExpression": - var parts = [n.operator]; - if (/[a-z]$/.test(n.operator)) - parts.push(" "); - parts.push(path.call(print, "argument")); - return concat(parts); - - case "UpdateExpression": - var parts = [path.call(print, "argument"), n.operator]; - - if (n.prefix) - parts.reverse(); - - return concat(parts); - - case "ConditionalExpression": - return concat([ - "(", path.call(print, "test"), - " ? ", path.call(print, "consequent"), - " : ", path.call(print, "alternate"), ")" - ]); - - case "NewExpression": - var parts = ["new ", path.call(print, "callee")]; - var args = n.arguments; - if (args) { - parts.push(printArgumentsList(path, options, print)); - } - - return concat(parts); - - case "VariableDeclaration": - var parts = [n.kind, " "]; - var maxLen = 0; - var printed = path.map(function(childPath) { - var lines = print(childPath); - maxLen = Math.max(lines.length, maxLen); - return lines; - }, "declarations"); - - if (maxLen === 1) { - parts.push(fromString(", ").join(printed)); - } else if (printed.length > 1 ) { - parts.push( - fromString(",\n").join(printed) - .indentTail(n.kind.length + 1) - ); - } else { - parts.push(printed[0]); - } - - // We generally want to terminate all variable declarations with a - // semicolon, except when they are children of for loops. - var parentNode = path.getParentNode(); - if (!namedTypes.ForStatement.check(parentNode) && - !namedTypes.ForInStatement.check(parentNode) && - !(namedTypes.ForOfStatement && - namedTypes.ForOfStatement.check(parentNode))) { - parts.push(";"); - } - - return concat(parts); - - case "VariableDeclarator": - return n.init ? fromString(" = ").join([ - path.call(print, "id"), - path.call(print, "init") - ]) : path.call(print, "id"); - - case "WithStatement": - return concat([ - "with (", - path.call(print, "object"), - ") ", - path.call(print, "body") - ]); - - case "IfStatement": - var con = adjustClause(path.call(print, "consequent"), options), - parts = ["if (", path.call(print, "test"), ")", con]; - - if (n.alternate) - parts.push( - endsWithBrace(con) ? " else" : "\nelse", - adjustClause(path.call(print, "alternate"), options)); - - return concat(parts); - - case "ForStatement": - // TODO Get the for (;;) case right. - var init = path.call(print, "init"), - sep = init.length > 1 ? ";\n" : "; ", - forParen = "for (", - indented = fromString(sep).join([ - init, - path.call(print, "test"), - path.call(print, "update") - ]).indentTail(forParen.length), - head = concat([forParen, indented, ")"]), - clause = adjustClause(path.call(print, "body"), options), - parts = [head]; - - if (head.length > 1) { - parts.push("\n"); - clause = clause.trimLeft(); - } - - parts.push(clause); - - return concat(parts); - - case "WhileStatement": - return concat([ - "while (", - path.call(print, "test"), - ")", - adjustClause(path.call(print, "body"), options) - ]); - - case "ForInStatement": - // Note: esprima can't actually parse "for each (". - return concat([ - n.each ? "for each (" : "for (", - path.call(print, "left"), - " in ", - path.call(print, "right"), - ")", - adjustClause(path.call(print, "body"), options) - ]); - - case "ForOfStatement": - return concat([ - "for (", - path.call(print, "left"), - " of ", - path.call(print, "right"), - ")", - adjustClause(path.call(print, "body"), options) - ]); - - case "DoWhileStatement": - var doBody = concat([ - "do", - adjustClause(path.call(print, "body"), options) - ]), parts = [doBody]; - - if (endsWithBrace(doBody)) - parts.push(" while"); - else - parts.push("\nwhile"); - - parts.push(" (", path.call(print, "test"), ");"); - - return concat(parts); - - case "DoExpression": - var statements = path.call(function(bodyPath) { - return printStatementSequence(bodyPath, options, print); - }, "body"); - - return concat([ - "do {\n", - statements.indent(options.tabWidth), - "\n}" - ]); - - case "BreakStatement": - var parts = ["break"]; - if (n.label) - parts.push(" ", path.call(print, "label")); - parts.push(";"); - return concat(parts); - - case "ContinueStatement": - var parts = ["continue"]; - if (n.label) - parts.push(" ", path.call(print, "label")); - parts.push(";"); - return concat(parts); - - case "LabeledStatement": - return concat([ - path.call(print, "label"), - ":\n", - path.call(print, "body") - ]); - - case "TryStatement": - var parts = [ - "try ", - path.call(print, "block") - ]; - - if (n.handler) { - parts.push(" ", path.call(print, "handler")); - } else if (n.handlers) { - path.each(function(handlerPath) { - parts.push(" ", print(handlerPath)); - }, "handlers"); - } - - if (n.finalizer) { - parts.push(" finally ", path.call(print, "finalizer")); - } - - return concat(parts); - - case "CatchClause": - var parts = ["catch (", path.call(print, "param")]; - - if (n.guard) - // Note: esprima does not recognize conditional catch clauses. - parts.push(" if ", path.call(print, "guard")); - - parts.push(") ", path.call(print, "body")); - - return concat(parts); - - case "ThrowStatement": - return concat(["throw ", path.call(print, "argument"), ";"]); - - case "SwitchStatement": - return concat([ - "switch (", - path.call(print, "discriminant"), - ") {\n", - fromString("\n").join(path.map(print, "cases")), - "\n}" - ]); - - // Note: ignoring n.lexical because it has no printing consequences. - - case "SwitchCase": - var parts = []; - - if (n.test) - parts.push("case ", path.call(print, "test"), ":"); - else - parts.push("default:"); - - if (n.consequent.length > 0) { - parts.push("\n", path.call(function(consequentPath) { - return printStatementSequence(consequentPath, options, print); - }, "consequent").indent(options.tabWidth)); - } - - return concat(parts); - - case "DebuggerStatement": - return fromString("debugger;"); - - // JSX extensions below. - - case "XJSAttribute": - case "JSXAttribute": - var parts = [path.call(print, "name")]; - if (n.value) - parts.push("=", path.call(print, "value")); - return concat(parts); - - case "XJSIdentifier": - case "JSXIdentifier": - return fromString(n.name, options); - - case "XJSNamespacedName": - case "JSXNamespacedName": - return fromString(":").join([ - path.call(print, "namespace"), - path.call(print, "name") - ]); - - case "XJSMemberExpression": - case "JSXMemberExpression": - return fromString(".").join([ - path.call(print, "object"), - path.call(print, "property") - ]); - - case "XJSSpreadAttribute": - case "JSXSpreadAttribute": - return concat(["{...", path.call(print, "argument"), "}"]); - - case "XJSExpressionContainer": - case "JSXExpressionContainer": - return concat(["{", path.call(print, "expression"), "}"]); - - case "XJSElement": - case "JSXElement": - var openingLines = path.call(print, "openingElement"); - - if (n.openingElement.selfClosing) { - assert.ok(!n.closingElement); - return openingLines; - } - - var childLines = concat( - path.map(function(childPath) { - var child = childPath.getValue(); - - if (namedTypes.Literal.check(child) && - typeof child.value === "string") { - if (/\S/.test(child.value)) { - return child.value.replace(/^\s+|\s+$/g, ""); - } else if (/\n/.test(child.value)) { - return "\n"; - } - } - - return print(childPath); - }, "children") - ).indentTail(options.tabWidth); - - var closingLines = path.call(print, "closingElement"); - - return concat([ - openingLines, - childLines, - closingLines - ]); - - case "XJSOpeningElement": - case "JSXOpeningElement": - var parts = ["<", path.call(print, "name")]; - var attrParts = []; - - path.each(function(attrPath) { - attrParts.push(" ", print(attrPath)); - }, "attributes"); - - var attrLines = concat(attrParts); - - var needLineWrap = ( - attrLines.length > 1 || - attrLines.getLineLength(1) > options.wrapColumn - ); - - if (needLineWrap) { - attrParts.forEach(function(part, i) { - if (part === " ") { - assert.strictEqual(i % 2, 0); - attrParts[i] = "\n"; - } - }); - - attrLines = concat(attrParts).indentTail(options.tabWidth); - } - - parts.push(attrLines, n.selfClosing ? " />" : ">"); - - return concat(parts); - - case "XJSClosingElement": - case "JSXClosingElement": - return concat([""]); - - case "XJSText": - case "JSXText": - return fromString(n.value, options); - - case "XJSEmptyExpression": - case "JSXEmptyExpression": - return fromString(""); - - case "TypeAnnotatedIdentifier": - return concat([ - path.call(print, "annotation"), - " ", - path.call(print, "identifier") - ]); - - case "ClassBody": - if (n.body.length === 0) { - return fromString("{}"); - } - - return concat([ - "{\n", - path.call(function(bodyPath) { - return printStatementSequence(bodyPath, options, print); - }, "body").indent(options.tabWidth), - "\n}" - ]); - - case "ClassPropertyDefinition": - var parts = ["static ", path.call(print, "definition")]; - if (!namedTypes.MethodDefinition.check(n.definition)) - parts.push(";"); - return concat(parts); - - case "ClassProperty": - var parts = []; - if (n.static) - parts.push("static "); - - parts.push(path.call(print, "key")); - if (n.typeAnnotation) - parts.push(path.call(print, "typeAnnotation")); - - if (n.value) - parts.push(" = ", path.call(print, "value")); - - parts.push(";"); - return concat(parts); - - case "ClassDeclaration": - case "ClassExpression": - var parts = ["class"]; - - if (n.id) { - parts.push( - " ", - path.call(print, "id"), - path.call(print, "typeParameters") - ); - } - - if (n.superClass) { - parts.push( - " extends ", - path.call(print, "superClass"), - path.call(print, "superTypeParameters") - ); - } - - if (n["implements"]) { - parts.push( - " implements ", - fromString(", ").join(path.map(print, "implements")) - ); - } - - parts.push(" ", path.call(print, "body")); - - return concat(parts); - - case "TemplateElement": - return fromString(n.value.raw, options); - - case "TemplateLiteral": - var expressions = path.map(print, "expressions"); - var parts = ["`"]; - - path.each(function(childPath) { - var i = childPath.getName(); - parts.push(print(childPath)); - if (i < expressions.length) { - parts.push("${", expressions[i], "}"); - } - }, "quasis"); - - parts.push("`"); - - return concat(parts); - - case "TaggedTemplateExpression": - return concat([ - path.call(print, "tag"), - path.call(print, "quasi") - ]); - - // These types are unprintable because they serve as abstract - // supertypes for other (printable) types. - case "Node": - case "Printable": - case "SourceLocation": - case "Position": - case "Statement": - case "Function": - case "Pattern": - case "Expression": - case "Declaration": - case "Specifier": - case "NamedSpecifier": - case "Comment": // Supertype of Block and Line. - case "MemberTypeAnnotation": // Flow - case "TupleTypeAnnotation": // Flow - case "Type": // Flow - throw new Error("unprintable type: " + JSON.stringify(n.type)); - - case "CommentBlock": // Babel block comment. - case "Block": // Esprima block comment. - return concat(["/*", fromString(n.value, options), "*/"]); - - case "CommentLine": // Babel line comment. - case "Line": // Esprima line comment. - return concat(["//", fromString(n.value, options)]); - - // Type Annotations for Facebook Flow, typically stripped out or - // transformed away before printing. - case "TypeAnnotation": - var parts = []; - - if (n.typeAnnotation) { - if (n.typeAnnotation.type !== "FunctionTypeAnnotation") { - parts.push(": "); - } - parts.push(path.call(print, "typeAnnotation")); - return concat(parts); - } - - return fromString(""); - - case "AnyTypeAnnotation": - return fromString("any", options); - - case "MixedTypeAnnotation": - return fromString("mixed", options); - - case "ArrayTypeAnnotation": - return concat([ - path.call(print, "elementType"), - "[]" - ]); - - case "BooleanTypeAnnotation": - return fromString("boolean", options); - - case "BooleanLiteralTypeAnnotation": - assert.strictEqual(typeof n.value, "boolean"); - return fromString("" + n.value, options); - - case "DeclareClass": - return concat([ - fromString("declare class ", options), - path.call(print, "id"), - " ", - path.call(print, "body"), - ]); - - case "DeclareFunction": - return concat([ - fromString("declare function ", options), - path.call(print, "id"), - ";" - ]); - - case "DeclareModule": - return concat([ - fromString("declare module ", options), - path.call(print, "id"), - " ", - path.call(print, "body"), - ]); - - case "DeclareVariable": - return concat([ - fromString("declare var ", options), - path.call(print, "id"), - ";" - ]); - - case "FunctionTypeAnnotation": - // FunctionTypeAnnotation is ambiguous: - // declare function(a: B): void; OR - // var A: (a: B) => void; - var parts = []; - var parent = path.getParentNode(0); - var isArrowFunctionTypeAnnotation = !( - namedTypes.ObjectTypeCallProperty.check(parent) || - namedTypes.DeclareFunction.check(path.getParentNode(2)) - ); - - var needsColon = - isArrowFunctionTypeAnnotation && - !namedTypes.FunctionTypeParam.check(parent); - - if (needsColon) { - parts.push(": "); - } - - parts.push( - "(", - fromString(", ").join(path.map(print, "params")), - ")" - ); - - // The returnType is not wrapped in a TypeAnnotation, so the colon - // needs to be added separately. - if (n.returnType) { - parts.push( - isArrowFunctionTypeAnnotation ? " => " : ": ", - path.call(print, "returnType") - ); - } - - return concat(parts); - - case "FunctionTypeParam": - return concat([ - path.call(print, "name"), - ": ", - path.call(print, "typeAnnotation"), - ]); - - case "GenericTypeAnnotation": - return concat([ - path.call(print, "id"), - path.call(print, "typeParameters") - ]); - - case "InterfaceDeclaration": - var parts = [ - fromString("interface ", options), - path.call(print, "id"), - path.call(print, "typeParameters"), - " " - ]; - - if (n["extends"]) { - parts.push( - "extends ", - fromString(", ").join(path.map(print, "extends")) - ); - } - - parts.push(" ", path.call(print, "body")); - - return concat(parts); - - case "ClassImplements": - case "InterfaceExtends": - return concat([ - path.call(print, "id"), - path.call(print, "typeParameters") - ]); - - case "IntersectionTypeAnnotation": - return fromString(" & ").join(path.map(print, "types")); - - case "NullableTypeAnnotation": - return concat([ - "?", - path.call(print, "typeAnnotation") - ]); - - case "NumberTypeAnnotation": - return fromString("number", options); - - case "ObjectTypeCallProperty": - return path.call(print, "value"); - - case "ObjectTypeIndexer": - return concat([ - "[", - path.call(print, "id"), - ": ", - path.call(print, "key"), - "]: ", - path.call(print, "value") - ]); - - case "ObjectTypeProperty": - return concat([ - path.call(print, "key"), - ": ", - path.call(print, "value") - ]); - - case "QualifiedTypeIdentifier": - return concat([ - path.call(print, "qualification"), - ".", - path.call(print, "id") - ]); - - case "StringLiteralTypeAnnotation": - return fromString(nodeStr(n.value, options), options); - - case "NumberLiteralTypeAnnotation": - assert.strictEqual(typeof n.value, "number"); - return fromString("" + n.value, options); - - case "StringTypeAnnotation": - return fromString("string", options); - - case "TypeAlias": - return concat([ - "type ", - path.call(print, "id"), - " = ", - path.call(print, "right"), - ";" - ]); - - case "TypeCastExpression": - return concat([ - "(", - path.call(print, "expression"), - path.call(print, "typeAnnotation"), - ")" - ]); - - case "TypeParameterDeclaration": - case "TypeParameterInstantiation": - return concat([ - "<", - fromString(", ").join(path.map(print, "params")), - ">" - ]); - - case "TypeofTypeAnnotation": - return concat([ - fromString("typeof ", options), - path.call(print, "argument") - ]); - - case "UnionTypeAnnotation": - return fromString(" | ").join(path.map(print, "types")); - - case "VoidTypeAnnotation": - return fromString("void", options); - - // Unhandled types below. If encountered, nodes of these types should - // be either left alone or desugared into AST types that are fully - // supported by the pretty-printer. - case "ClassHeritage": // TODO - case "ComprehensionBlock": // TODO - case "ComprehensionExpression": // TODO - case "Glob": // TODO - case "GeneratorExpression": // TODO - case "LetStatement": // TODO - case "LetExpression": // TODO - case "GraphExpression": // TODO - case "GraphIndexExpression": // TODO - - // XML types that nobody cares about or needs to print. - case "XMLDefaultDeclaration": - case "XMLAnyName": - case "XMLQualifiedIdentifier": - case "XMLFunctionQualifiedIdentifier": - case "XMLAttributeSelector": - case "XMLFilterExpression": - case "XML": - case "XMLElement": - case "XMLList": - case "XMLEscape": - case "XMLText": - case "XMLStartTag": - case "XMLEndTag": - case "XMLPointTag": - case "XMLName": - case "XMLAttribute": - case "XMLCdata": - case "XMLComment": - case "XMLProcessingInstruction": - default: - debugger; - throw new Error("unknown type: " + JSON.stringify(n.type)); - } - - return p; -} - -function printStatementSequence(path, options, print) { - var inClassBody = - namedTypes.ClassBody && - namedTypes.ClassBody.check(path.getParentNode()); - - var filtered = []; - var sawComment = false; - var sawStatement = false; - - path.each(function(stmtPath) { - var i = stmtPath.getName(); - var stmt = stmtPath.getValue(); - - // Just in case the AST has been modified to contain falsy - // "statements," it's safer simply to skip them. - if (!stmt) { - return; - } - - // Skip printing EmptyStatement nodes to avoid leaving stray - // semicolons lying around. - if (stmt.type === "EmptyStatement") { - return; - } - - if (namedTypes.Comment.check(stmt)) { - // The pretty printer allows a dangling Comment node to act as - // a Statement when the Comment can't be attached to any other - // non-Comment node in the tree. - sawComment = true; - } else if (!inClassBody) { - namedTypes.Statement.assert(stmt); - sawStatement = true; - } - - // We can't hang onto stmtPath outside of this function, because - // it's just a reference to a mutable FastPath object, so we have - // to go ahead and print it here. - filtered.push({ - node: stmt, - printed: print(stmtPath) - }); - }); - - if (sawComment) { - assert.strictEqual( - sawStatement, false, - "Comments may appear as statements in otherwise empty statement " + - "lists, but may not coexist with non-Comment nodes." - ); - } - - var prevTrailingSpace = null; - var len = filtered.length; - var parts = []; - - filtered.forEach(function(info, i) { - var printed = info.printed; - var stmt = info.node; - var multiLine = printed.length > 1; - var notFirst = i > 0; - var notLast = i < len - 1; - var leadingSpace; - var trailingSpace; - var lines = stmt && stmt.loc && stmt.loc.lines; - var trueLoc = lines && options.reuseWhitespace && - util.getTrueLoc(stmt, lines); - - if (notFirst) { - if (trueLoc) { - var beforeStart = lines.skipSpaces(trueLoc.start, true); - var beforeStartLine = beforeStart ? beforeStart.line : 1; - var leadingGap = trueLoc.start.line - beforeStartLine; - leadingSpace = Array(leadingGap + 1).join("\n"); - } else { - leadingSpace = multiLine ? "\n\n" : "\n"; - } - } else { - leadingSpace = ""; - } - - if (notLast) { - if (trueLoc) { - var afterEnd = lines.skipSpaces(trueLoc.end); - var afterEndLine = afterEnd ? afterEnd.line : lines.length; - var trailingGap = afterEndLine - trueLoc.end.line; - trailingSpace = Array(trailingGap + 1).join("\n"); - } else { - trailingSpace = multiLine ? "\n\n" : "\n"; - } - } else { - trailingSpace = ""; - } - - parts.push( - maxSpace(prevTrailingSpace, leadingSpace), - printed - ); - - if (notLast) { - prevTrailingSpace = trailingSpace; - } else if (trailingSpace) { - parts.push(trailingSpace); - } - }); - - return concat(parts); -} - -function maxSpace(s1, s2) { - if (!s1 && !s2) { - return fromString(""); - } - - if (!s1) { - return fromString(s2); - } - - if (!s2) { - return fromString(s1); - } - - var spaceLines1 = fromString(s1); - var spaceLines2 = fromString(s2); - - if (spaceLines2.length > spaceLines1.length) { - return spaceLines2; - } - - return spaceLines1; -} - -function printMethod(path, options, print) { - var node = path.getNode(); - var kind = node.kind; - var parts = []; - - namedTypes.FunctionExpression.assert(node.value); - - if (node.decorators) { - path.each(function(decoratorPath) { - parts.push(print(decoratorPath), "\n"); - }, "decorators"); - } - - if (node.value.async) { - parts.push("async "); - } - - if (!kind || kind === "init" || kind === "method" || kind === "constructor") { - if (node.value.generator) { - parts.push("*"); - } - } else { - assert.ok(kind === "get" || kind === "set"); - parts.push(kind, " "); - } - - var key = path.call(print, "key"); - if (node.computed) { - key = concat(["[", key, "]"]); - } - - parts.push( - key, - path.call(print, "value", "typeParameters"), - "(", - path.call(function(valuePath) { - return printFunctionParams(valuePath, options, print); - }, "value"), - ")", - path.call(print, "value", "returnType"), - " ", - path.call(print, "value", "body") - ); - - return concat(parts); -} - -function printArgumentsList(path, options, print) { - var printed = path.map(print, "arguments"); - - var joined = fromString(", ").join(printed); - if (joined.getLineLength(1) > options.wrapColumn) { - joined = fromString(",\n").join(printed); - return concat([ - "(\n", - joined.indent(options.tabWidth), - options.trailingComma ? ",\n)" : "\n)" - ]); - } - - return concat(["(", joined, ")"]); -} - -function printFunctionParams(path, options, print) { - var fun = path.getValue(); - namedTypes.Function.assert(fun); - - var printed = path.map(print, "params"); - - if (fun.defaults) { - path.each(function(defExprPath) { - var i = defExprPath.getName(); - var p = printed[i]; - if (p && defExprPath.getValue()) { - printed[i] = concat([p, "=", print(defExprPath)]); - } - }, "defaults"); - } - - if (fun.rest) { - printed.push(concat(["...", path.call(print, "rest")])); - } - - var joined = fromString(", ").join(printed); - if (joined.length > 1 || - joined.getLineLength(1) > options.wrapColumn) { - joined = fromString(",\n").join(printed); - if (options.trailingComma && !fun.rest) { - joined = concat([joined, ",\n"]); - } - return concat(["\n", joined.indent(options.tabWidth)]); - } - - return joined; -} - -function adjustClause(clause, options) { - if (clause.length > 1) - return concat([" ", clause]); - - return concat([ - "\n", - maybeAddSemicolon(clause).indent(options.tabWidth) - ]); -} - -function lastNonSpaceCharacter(lines) { - var pos = lines.lastPos(); - do { - var ch = lines.charAt(pos); - if (/\S/.test(ch)) - return ch; - } while (lines.prevPos(pos)); -} - -function endsWithBrace(lines) { - return lastNonSpaceCharacter(lines) === "}"; -} - -function swapQuotes(str) { - return str.replace(/['"]/g, function(m) { - return m === '"' ? '\'' : '"'; - }); -} - -function nodeStr(str, options) { - isString.assert(str); - switch (options.quote) { - case "auto": - var double = JSON.stringify(str); - var single = swapQuotes(JSON.stringify(swapQuotes(str))); - return double.length > single.length ? single : double; - case "single": - return swapQuotes(JSON.stringify(swapQuotes(str))); - case "double": - default: - return JSON.stringify(str); - } -} - -function maybeAddSemicolon(lines) { - var eoc = lastNonSpaceCharacter(lines); - if (!eoc || "\n};".indexOf(eoc) < 0) - return concat([lines, ";"]); - return lines; -} - -},{"1":1,"558":558,"559":559,"560":560,"562":562,"564":564,"566":566,"567":567,"607":607}],566:[function(_dereq_,module,exports){ -// This module was originally created so that Recast could add its own -// custom types to the AST type system (in particular, the File type), but -// those types are now incorporated into ast-types, so this module doesn't -// have much to do anymore. Still, it might prove useful in the future. -module.exports = _dereq_(584); - -},{"584":584}],567:[function(_dereq_,module,exports){ -var assert = _dereq_(1); -var types = _dereq_(566); -var getFieldValue = types.getFieldValue; -var n = types.namedTypes; -var sourceMap = _dereq_(607); -var SourceMapConsumer = sourceMap.SourceMapConsumer; -var SourceMapGenerator = sourceMap.SourceMapGenerator; -var hasOwn = Object.prototype.hasOwnProperty; - -function getUnionOfKeys() { - var result = {}; - var argc = arguments.length; - for (var i = 0; i < argc; ++i) { - var keys = Object.keys(arguments[i]); - var keyCount = keys.length; - for (var j = 0; j < keyCount; ++j) { - result[keys[j]] = true; - } - } - return result; -} -exports.getUnionOfKeys = getUnionOfKeys; - -function comparePos(pos1, pos2) { - return (pos1.line - pos2.line) || (pos1.column - pos2.column); -} -exports.comparePos = comparePos; - -function copyPos(pos) { - return { - line: pos.line, - column: pos.column - }; -} -exports.copyPos = copyPos; - -exports.composeSourceMaps = function(formerMap, latterMap) { - if (formerMap) { - if (!latterMap) { - return formerMap; - } - } else { - return latterMap || null; - } - - var smcFormer = new SourceMapConsumer(formerMap); - var smcLatter = new SourceMapConsumer(latterMap); - var smg = new SourceMapGenerator({ - file: latterMap.file, - sourceRoot: latterMap.sourceRoot - }); - - var sourcesToContents = {}; - - smcLatter.eachMapping(function(mapping) { - var origPos = smcFormer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - - var sourceName = origPos.source; - if (sourceName === null) { - return; - } - - smg.addMapping({ - source: sourceName, - original: copyPos(origPos), - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - }, - name: mapping.name - }); - - var sourceContent = smcFormer.sourceContentFor(sourceName); - if (sourceContent && !hasOwn.call(sourcesToContents, sourceName)) { - sourcesToContents[sourceName] = sourceContent; - smg.setSourceContent(sourceName, sourceContent); - } - }); - - return smg.toJSON(); -}; - -exports.getTrueLoc = function(node, lines) { - // It's possible that node is newly-created (not parsed by Esprima), - // in which case it probably won't have a .loc property (or an - // .original property for that matter). That's fine; we'll just - // pretty-print it as usual. - if (!node.loc) { - return null; - } - - var start = node.loc.start; - var end = node.loc.end; - - // If the node has any comments, their locations might contribute to - // the true start/end positions of the node. - if (node.comments) { - node.comments.forEach(function(comment) { - if (comment.loc) { - if (comparePos(comment.loc.start, start) < 0) { - start = comment.loc.start; - } - - if (comparePos(end, comment.loc.end) < 0) { - end = comment.loc.end; - } - } - }); - } - - return { - // Finally, trim any leading or trailing whitespace from the true - // location of the node. - start: lines.skipSpaces(start, false, false), - end: lines.skipSpaces(end, true, false) - }; -}; - -exports.fixFaultyLocations = function(node) { - if ((n.MethodDefinition && n.MethodDefinition.check(node)) || - (n.Property.check(node) && (node.method || node.shorthand))) { - // If the node is a MethodDefinition or a .method or .shorthand - // Property, then the location information stored in - // node.value.loc is very likely untrustworthy (just the {body} - // part of a method, or nothing in the case of shorthand - // properties), so we null out that information to prevent - // accidental reuse of bogus source code during reprinting. - node.value.loc = null; - - if (n.FunctionExpression.check(node.value)) { - // FunctionExpression method values should be anonymous, - // because their .id fields are ignored anyway. - node.value.id = null; - } - } - - var loc = node.loc; - if (loc) { - if (loc.start.line < 1) { - loc.start.line = 1; - } - - if (loc.end.line < 1) { - loc.end.line = 1; - } - } -}; - -},{"1":1,"566":566,"607":607}],568:[function(_dereq_,module,exports){ -(function (process){ -var types = _dereq_(566); -var parse = _dereq_(563).parse; -var Printer = _dereq_(565).Printer; - -function print(node, options) { - return new Printer(options).print(node); -} - -function prettyPrint(node, options) { - return new Printer(options).printGenerically(node); -} - -function run(transformer, options) { - return runFile(process.argv[2], transformer, options); -} - -function runFile(path, transformer, options) { - _dereq_(3).readFile(path, "utf-8", function(err, code) { - if (err) { - console.error(err); - return; - } - - runString(code, transformer, options); - }); -} - -function defaultWriteback(output) { - process.stdout.write(output); -} - -function runString(code, transformer, options) { - var writeback = options && options.writeback || defaultWriteback; - transformer(parse(code, options), function(node) { - writeback(print(node, options).code); - }); -} - -Object.defineProperties(exports, { - /** - * Parse a string of code into an augmented syntax tree suitable for - * arbitrary modification and reprinting. - */ - parse: { - enumerable: true, - value: parse - }, - - /** - * Traverse and potentially modify an abstract syntax tree using a - * convenient visitor syntax: - * - * recast.visit(ast, { - * names: [], - * visitIdentifier: function(path) { - * var node = path.value; - * this.visitor.names.push(node.name); - * this.traverse(path); - * } - * }); - */ - visit: { - enumerable: true, - value: types.visit - }, - - /** - * Reprint a modified syntax tree using as much of the original source - * code as possible. - */ - print: { - enumerable: true, - value: print - }, - - /** - * Print without attempting to reuse any original source code. - */ - prettyPrint: { - enumerable: false, - value: prettyPrint - }, - - /** - * Customized version of require("ast-types"). - */ - types: { - enumerable: false, - value: types - }, - - /** - * Convenient command-line interface (see e.g. example/add-braces). - */ - run: { - enumerable: false, - value: run - } -}); - -}).call(this,_dereq_(10)) -},{"10":10,"3":3,"563":563,"565":565,"566":566}],569:[function(_dereq_,module,exports){ -_dereq_(573); - -var types = _dereq_(583); -var defaults = _dereq_(582).defaults; -var def = types.Type.def; -var or = types.Type.or; - -def("Noop") - .bases("Node") - .build(); - -def("DoExpression") - .bases("Expression") - .build("body") - .field("body", [def("Statement")]); - -def("Super") - .bases("Expression") - .build(); - -def("BindExpression") - .bases("Expression") - .build("object", "callee") - .field("object", or(def("Expression"), null)) - .field("callee", def("Expression")); - -def("Decorator") - .bases("Node") - .build("expression") - .field("expression", def("Expression")); - -def("Property") - .field("decorators", - or([def("Decorator")], null), - defaults["null"]); - -def("MethodDefinition") - .field("decorators", - or([def("Decorator")], null), - defaults["null"]); - -def("MetaProperty") - .bases("Expression") - .build("meta", "property") - .field("meta", def("Identifier")) - .field("property", def("Identifier")); - -def("ParenthesizedExpression") - .bases("Expression") - .build("expression") - .field("expression", def("Expression")); - -def("ImportSpecifier") - .bases("ModuleSpecifier") - .build("imported", "local") - .field("imported", def("Identifier")); - -def("ImportDefaultSpecifier") - .bases("ModuleSpecifier") - .build("local"); - -def("ImportNamespaceSpecifier") - .bases("ModuleSpecifier") - .build("local"); - -def("ExportDefaultDeclaration") - .bases("Declaration") - .build("declaration") - .field("declaration", or(def("Declaration"), def("Expression"))); - -def("ExportNamedDeclaration") - .bases("Declaration") - .build("declaration", "specifiers", "source") - .field("declaration", or(def("Declaration"), null)) - .field("specifiers", [def("ExportSpecifier")], defaults.emptyArray) - .field("source", or(def("Literal"), null), defaults["null"]); - -def("ExportSpecifier") - .bases("ModuleSpecifier") - .build("local", "exported") - .field("exported", def("Identifier")); - -def("ExportNamespaceSpecifier") - .bases("Specifier") - .build("exported") - .field("exported", def("Identifier")); - -def("ExportDefaultSpecifier") - .bases("Specifier") - .build("exported") - .field("exported", def("Identifier")); - -def("ExportAllDeclaration") - .bases("Declaration") - .build("exported", "source") - .field("exported", or(def("Identifier"), null)) - .field("source", def("Literal")); - -def("CommentBlock") - .bases("Comment") - .build("value", /*optional:*/ "leading", "trailing"); - -def("CommentLine") - .bases("Comment") - .build("value", /*optional:*/ "leading", "trailing"); - -},{"573":573,"582":582,"583":583}],570:[function(_dereq_,module,exports){ -var types = _dereq_(583); -var Type = types.Type; -var def = Type.def; -var or = Type.or; -var shared = _dereq_(582); -var defaults = shared.defaults; -var geq = shared.geq; - -// Abstract supertype of all syntactic entities that are allowed to have a -// .loc field. -def("Printable") - .field("loc", or( - def("SourceLocation"), - null - ), defaults["null"], true); - -def("Node") - .bases("Printable") - .field("type", String) - .field("comments", or( - [def("Comment")], - null - ), defaults["null"], true); - -def("SourceLocation") - .build("start", "end", "source") - .field("start", def("Position")) - .field("end", def("Position")) - .field("source", or(String, null), defaults["null"]); - -def("Position") - .build("line", "column") - .field("line", geq(1)) - .field("column", geq(0)); - -def("File") - .bases("Node") - .build("program") - .field("program", def("Program")); - -def("Program") - .bases("Node") - .build("body") - .field("body", [def("Statement")]); - -def("Function") - .bases("Node") - .field("id", or(def("Identifier"), null), defaults["null"]) - .field("params", [def("Pattern")]) - .field("body", def("BlockStatement")); - -def("Statement").bases("Node"); - -// The empty .build() here means that an EmptyStatement can be constructed -// (i.e. it's not abstract) but that it needs no arguments. -def("EmptyStatement").bases("Statement").build(); - -def("BlockStatement") - .bases("Statement") - .build("body") - .field("body", [def("Statement")]); - -// TODO Figure out how to silently coerce Expressions to -// ExpressionStatements where a Statement was expected. -def("ExpressionStatement") - .bases("Statement") - .build("expression") - .field("expression", def("Expression")); - -def("IfStatement") - .bases("Statement") - .build("test", "consequent", "alternate") - .field("test", def("Expression")) - .field("consequent", def("Statement")) - .field("alternate", or(def("Statement"), null), defaults["null"]); - -def("LabeledStatement") - .bases("Statement") - .build("label", "body") - .field("label", def("Identifier")) - .field("body", def("Statement")); - -def("BreakStatement") - .bases("Statement") - .build("label") - .field("label", or(def("Identifier"), null), defaults["null"]); - -def("ContinueStatement") - .bases("Statement") - .build("label") - .field("label", or(def("Identifier"), null), defaults["null"]); - -def("WithStatement") - .bases("Statement") - .build("object", "body") - .field("object", def("Expression")) - .field("body", def("Statement")); - -def("SwitchStatement") - .bases("Statement") - .build("discriminant", "cases", "lexical") - .field("discriminant", def("Expression")) - .field("cases", [def("SwitchCase")]) - .field("lexical", Boolean, defaults["false"]); - -def("ReturnStatement") - .bases("Statement") - .build("argument") - .field("argument", or(def("Expression"), null)); - -def("ThrowStatement") - .bases("Statement") - .build("argument") - .field("argument", def("Expression")); - -def("TryStatement") - .bases("Statement") - .build("block", "handler", "finalizer") - .field("block", def("BlockStatement")) - .field("handler", or(def("CatchClause"), null), function() { - return this.handlers && this.handlers[0] || null; - }) - .field("handlers", [def("CatchClause")], function() { - return this.handler ? [this.handler] : []; - }, true) // Indicates this field is hidden from eachField iteration. - .field("guardedHandlers", [def("CatchClause")], defaults.emptyArray) - .field("finalizer", or(def("BlockStatement"), null), defaults["null"]); - -def("CatchClause") - .bases("Node") - .build("param", "guard", "body") - .field("param", def("Pattern")) - .field("guard", or(def("Expression"), null), defaults["null"]) - .field("body", def("BlockStatement")); - -def("WhileStatement") - .bases("Statement") - .build("test", "body") - .field("test", def("Expression")) - .field("body", def("Statement")); - -def("DoWhileStatement") - .bases("Statement") - .build("body", "test") - .field("body", def("Statement")) - .field("test", def("Expression")); - -def("ForStatement") - .bases("Statement") - .build("init", "test", "update", "body") - .field("init", or( - def("VariableDeclaration"), - def("Expression"), - null)) - .field("test", or(def("Expression"), null)) - .field("update", or(def("Expression"), null)) - .field("body", def("Statement")); - -def("ForInStatement") - .bases("Statement") - .build("left", "right", "body") - .field("left", or( - def("VariableDeclaration"), - def("Expression"))) - .field("right", def("Expression")) - .field("body", def("Statement")); - -def("DebuggerStatement").bases("Statement").build(); - -def("Declaration").bases("Statement"); - -def("FunctionDeclaration") - .bases("Function", "Declaration") - .build("id", "params", "body") - .field("id", def("Identifier")); - -def("FunctionExpression") - .bases("Function", "Expression") - .build("id", "params", "body"); - -def("VariableDeclaration") - .bases("Declaration") - .build("kind", "declarations") - .field("kind", or("var", "let", "const")) - .field("declarations", [def("VariableDeclarator")]); - -def("VariableDeclarator") - .bases("Node") - .build("id", "init") - .field("id", def("Pattern")) - .field("init", or(def("Expression"), null)); - -// TODO Are all Expressions really Patterns? -def("Expression").bases("Node", "Pattern"); - -def("ThisExpression").bases("Expression").build(); - -def("ArrayExpression") - .bases("Expression") - .build("elements") - .field("elements", [or(def("Expression"), null)]); - -def("ObjectExpression") - .bases("Expression") - .build("properties") - .field("properties", [def("Property")]); - -// TODO Not in the Mozilla Parser API, but used by Esprima. -def("Property") - .bases("Node") // Want to be able to visit Property Nodes. - .build("kind", "key", "value") - .field("kind", or("init", "get", "set")) - .field("key", or(def("Literal"), def("Identifier"))) - .field("value", def("Expression")); - -def("SequenceExpression") - .bases("Expression") - .build("expressions") - .field("expressions", [def("Expression")]); - -var UnaryOperator = or( - "-", "+", "!", "~", - "typeof", "void", "delete"); - -def("UnaryExpression") - .bases("Expression") - .build("operator", "argument", "prefix") - .field("operator", UnaryOperator) - .field("argument", def("Expression")) - // Esprima doesn't bother with this field, presumably because it's - // always true for unary operators. - .field("prefix", Boolean, defaults["true"]); - -var BinaryOperator = or( - "==", "!=", "===", "!==", - "<", "<=", ">", ">=", - "<<", ">>", ">>>", - "+", "-", "*", "/", "%", - "&", // TODO Missing from the Parser API. - "|", "^", "in", - "instanceof", ".."); - -def("BinaryExpression") - .bases("Expression") - .build("operator", "left", "right") - .field("operator", BinaryOperator) - .field("left", def("Expression")) - .field("right", def("Expression")); - -var AssignmentOperator = or( - "=", "+=", "-=", "*=", "/=", "%=", - "<<=", ">>=", ">>>=", - "|=", "^=", "&="); - -def("AssignmentExpression") - .bases("Expression") - .build("operator", "left", "right") - .field("operator", AssignmentOperator) - .field("left", def("Pattern")) - .field("right", def("Expression")); - -var UpdateOperator = or("++", "--"); - -def("UpdateExpression") - .bases("Expression") - .build("operator", "argument", "prefix") - .field("operator", UpdateOperator) - .field("argument", def("Expression")) - .field("prefix", Boolean); - -var LogicalOperator = or("||", "&&"); - -def("LogicalExpression") - .bases("Expression") - .build("operator", "left", "right") - .field("operator", LogicalOperator) - .field("left", def("Expression")) - .field("right", def("Expression")); - -def("ConditionalExpression") - .bases("Expression") - .build("test", "consequent", "alternate") - .field("test", def("Expression")) - .field("consequent", def("Expression")) - .field("alternate", def("Expression")); - -def("NewExpression") - .bases("Expression") - .build("callee", "arguments") - .field("callee", def("Expression")) - // The Mozilla Parser API gives this type as [or(def("Expression"), - // null)], but null values don't really make sense at the call site. - // TODO Report this nonsense. - .field("arguments", [def("Expression")]); - -def("CallExpression") - .bases("Expression") - .build("callee", "arguments") - .field("callee", def("Expression")) - // See comment for NewExpression above. - .field("arguments", [def("Expression")]); - -def("MemberExpression") - .bases("Expression") - .build("object", "property", "computed") - .field("object", def("Expression")) - .field("property", or(def("Identifier"), def("Expression"))) - .field("computed", Boolean, defaults["false"]); - -def("Pattern").bases("Node"); - -def("SwitchCase") - .bases("Node") - .build("test", "consequent") - .field("test", or(def("Expression"), null)) - .field("consequent", [def("Statement")]); - -def("Identifier") - // But aren't Expressions and Patterns already Nodes? TODO Report this. - .bases("Node", "Expression", "Pattern") - .build("name") - .field("name", String); - -def("Literal") - // But aren't Expressions already Nodes? TODO Report this. - .bases("Node", "Expression") - .build("value") - .field("value", or(String, Boolean, null, Number, RegExp)) - .field("regex", or({ - pattern: String, - flags: String - }, null), function() { - if (this.value instanceof RegExp) { - var flags = ""; - - if (this.value.ignoreCase) flags += "i"; - if (this.value.multiline) flags += "m"; - if (this.value.global) flags += "g"; - - return { - pattern: this.value.source, - flags: flags - }; - } - - return null; - }); - -// Abstract (non-buildable) comment supertype. Not a Node. -def("Comment") - .bases("Printable") - .field("value", String) - // A .leading comment comes before the node, whereas a .trailing - // comment comes after it. These two fields should not both be true, - // but they might both be false when the comment falls inside a node - // and the node has no children for the comment to lead or trail, - // e.g. { /*dangling*/ }. - .field("leading", Boolean, defaults["true"]) - .field("trailing", Boolean, defaults["false"]); - -},{"582":582,"583":583}],571:[function(_dereq_,module,exports){ -_dereq_(570); -var types = _dereq_(583); -var def = types.Type.def; -var or = types.Type.or; - -// Note that none of these types are buildable because the Mozilla Parser -// API doesn't specify any builder functions, and nobody uses E4X anymore. - -def("XMLDefaultDeclaration") - .bases("Declaration") - .field("namespace", def("Expression")); - -def("XMLAnyName").bases("Expression"); - -def("XMLQualifiedIdentifier") - .bases("Expression") - .field("left", or(def("Identifier"), def("XMLAnyName"))) - .field("right", or(def("Identifier"), def("Expression"))) - .field("computed", Boolean); - -def("XMLFunctionQualifiedIdentifier") - .bases("Expression") - .field("right", or(def("Identifier"), def("Expression"))) - .field("computed", Boolean); - -def("XMLAttributeSelector") - .bases("Expression") - .field("attribute", def("Expression")); - -def("XMLFilterExpression") - .bases("Expression") - .field("left", def("Expression")) - .field("right", def("Expression")); - -def("XMLElement") - .bases("XML", "Expression") - .field("contents", [def("XML")]); - -def("XMLList") - .bases("XML", "Expression") - .field("contents", [def("XML")]); - -def("XML").bases("Node"); - -def("XMLEscape") - .bases("XML") - .field("expression", def("Expression")); - -def("XMLText") - .bases("XML") - .field("text", String); - -def("XMLStartTag") - .bases("XML") - .field("contents", [def("XML")]); - -def("XMLEndTag") - .bases("XML") - .field("contents", [def("XML")]); - -def("XMLPointTag") - .bases("XML") - .field("contents", [def("XML")]); - -def("XMLName") - .bases("XML") - .field("contents", or(String, [def("XML")])); - -def("XMLAttribute") - .bases("XML") - .field("value", String); - -def("XMLCdata") - .bases("XML") - .field("contents", String); - -def("XMLComment") - .bases("XML") - .field("contents", String); - -def("XMLProcessingInstruction") - .bases("XML") - .field("target", String) - .field("contents", or(String, null)); - -},{"570":570,"583":583}],572:[function(_dereq_,module,exports){ -_dereq_(570); -var types = _dereq_(583); -var def = types.Type.def; -var or = types.Type.or; -var defaults = _dereq_(582).defaults; - -def("Function") - .field("generator", Boolean, defaults["false"]) - .field("expression", Boolean, defaults["false"]) - .field("defaults", [or(def("Expression"), null)], defaults.emptyArray) - // TODO This could be represented as a RestElement in .params. - .field("rest", or(def("Identifier"), null), defaults["null"]); - -// The ESTree way of representing a ...rest parameter. -def("RestElement") - .bases("Pattern") - .build("argument") - .field("argument", def("Pattern")); - -def("SpreadElementPattern") - .bases("Pattern") - .build("argument") - .field("argument", def("Pattern")); - -def("FunctionDeclaration") - .build("id", "params", "body", "generator", "expression"); - -def("FunctionExpression") - .build("id", "params", "body", "generator", "expression"); - -// The Parser API calls this ArrowExpression, but Esprima and all other -// actual parsers use ArrowFunctionExpression. -def("ArrowFunctionExpression") - .bases("Function", "Expression") - .build("params", "body", "expression") - // The forced null value here is compatible with the overridden - // definition of the "id" field in the Function interface. - .field("id", null, defaults["null"]) - // Arrow function bodies are allowed to be expressions. - .field("body", or(def("BlockStatement"), def("Expression"))) - // The current spec forbids arrow generators, so I have taken the - // liberty of enforcing that. TODO Report this. - .field("generator", false, defaults["false"]); - -def("YieldExpression") - .bases("Expression") - .build("argument", "delegate") - .field("argument", or(def("Expression"), null)) - .field("delegate", Boolean, defaults["false"]); - -def("GeneratorExpression") - .bases("Expression") - .build("body", "blocks", "filter") - .field("body", def("Expression")) - .field("blocks", [def("ComprehensionBlock")]) - .field("filter", or(def("Expression"), null)); - -def("ComprehensionExpression") - .bases("Expression") - .build("body", "blocks", "filter") - .field("body", def("Expression")) - .field("blocks", [def("ComprehensionBlock")]) - .field("filter", or(def("Expression"), null)); - -def("ComprehensionBlock") - .bases("Node") - .build("left", "right", "each") - .field("left", def("Pattern")) - .field("right", def("Expression")) - .field("each", Boolean); - -def("Property") - .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) - .field("value", or(def("Expression"), def("Pattern"))) - .field("method", Boolean, defaults["false"]) - .field("shorthand", Boolean, defaults["false"]) - .field("computed", Boolean, defaults["false"]); - -def("PropertyPattern") - .bases("Pattern") - .build("key", "pattern") - .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) - .field("pattern", def("Pattern")) - .field("computed", Boolean, defaults["false"]); - -def("ObjectPattern") - .bases("Pattern") - .build("properties") - .field("properties", [or(def("PropertyPattern"), def("Property"))]); - -def("ArrayPattern") - .bases("Pattern") - .build("elements") - .field("elements", [or(def("Pattern"), null)]); - -def("MethodDefinition") - .bases("Declaration") - .build("kind", "key", "value", "static") - .field("kind", or("constructor", "method", "get", "set")) - .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) - .field("value", def("Function")) - .field("computed", Boolean, defaults["false"]) - .field("static", Boolean, defaults["false"]); - -def("SpreadElement") - .bases("Node") - .build("argument") - .field("argument", def("Expression")); - -def("ArrayExpression") - .field("elements", [or( - def("Expression"), - def("SpreadElement"), - def("RestElement"), - null - )]); - -def("NewExpression") - .field("arguments", [or(def("Expression"), def("SpreadElement"))]); - -def("CallExpression") - .field("arguments", [or(def("Expression"), def("SpreadElement"))]); - -// Note: this node type is *not* an AssignmentExpression with a Pattern on -// the left-hand side! The existing AssignmentExpression type already -// supports destructuring assignments. AssignmentPattern nodes may appear -// wherever a Pattern is allowed, and the right-hand side represents a -// default value to be destructured against the left-hand side, if no -// value is otherwise provided. For example: default parameter values. -def("AssignmentPattern") - .bases("Pattern") - .build("left", "right") - .field("left", def("Pattern")) - .field("right", def("Expression")); - -var ClassBodyElement = or( - def("MethodDefinition"), - def("VariableDeclarator"), - def("ClassPropertyDefinition"), - def("ClassProperty") -); - -def("ClassProperty") - .bases("Declaration") - .build("key") - .field("key", or(def("Literal"), def("Identifier"), def("Expression"))) - .field("computed", Boolean, defaults["false"]); - -def("ClassPropertyDefinition") // static property - .bases("Declaration") - .build("definition") - // Yes, Virginia, circular definitions are permitted. - .field("definition", ClassBodyElement); - -def("ClassBody") - .bases("Declaration") - .build("body") - .field("body", [ClassBodyElement]); - -def("ClassDeclaration") - .bases("Declaration") - .build("id", "body", "superClass") - .field("id", or(def("Identifier"), null)) - .field("body", def("ClassBody")) - .field("superClass", or(def("Expression"), null), defaults["null"]); - -def("ClassExpression") - .bases("Expression") - .build("id", "body", "superClass") - .field("id", or(def("Identifier"), null), defaults["null"]) - .field("body", def("ClassBody")) - .field("superClass", or(def("Expression"), null), defaults["null"]) - .field("implements", [def("ClassImplements")], defaults.emptyArray); - -def("ClassImplements") - .bases("Node") - .build("id") - .field("id", def("Identifier")) - .field("superClass", or(def("Expression"), null), defaults["null"]); - -// Specifier and ModuleSpecifier are abstract non-standard types -// introduced for definitional convenience. -def("Specifier").bases("Node"); - -// This supertype is shared/abused by both def/babel.js and -// def/esprima.js. In the future, it will be possible to load only one set -// of definitions appropriate for a given parser, but until then we must -// rely on default functions to reconcile the conflicting AST formats. -def("ModuleSpecifier") - .bases("Specifier") - // This local field is used by Babel/Acorn. It should not technically - // be optional in the Babel/Acorn AST format, but it must be optional - // in the Esprima AST format. - .field("local", or(def("Identifier"), null), defaults["null"]) - // The id and name fields are used by Esprima. The id field should not - // technically be optional in the Esprima AST format, but it must be - // optional in the Babel/Acorn AST format. - .field("id", or(def("Identifier"), null), defaults["null"]) - .field("name", or(def("Identifier"), null), defaults["null"]); - -def("TaggedTemplateExpression") - .bases("Expression") - .build("tag", "quasi") - .field("tag", def("Expression")) - .field("quasi", def("TemplateLiteral")); - -def("TemplateLiteral") - .bases("Expression") - .build("quasis", "expressions") - .field("quasis", [def("TemplateElement")]) - .field("expressions", [def("Expression")]); - -def("TemplateElement") - .bases("Node") - .build("value", "tail") - .field("value", {"cooked": String, "raw": String}) - .field("tail", Boolean); - -},{"570":570,"582":582,"583":583}],573:[function(_dereq_,module,exports){ -_dereq_(572); - -var types = _dereq_(583); -var def = types.Type.def; -var or = types.Type.or; -var builtin = types.builtInTypes; -var defaults = _dereq_(582).defaults; - -def("Function") - .field("async", Boolean, defaults["false"]); - -def("SpreadProperty") - .bases("Node") - .build("argument") - .field("argument", def("Expression")); - -def("ObjectExpression") - .field("properties", [or(def("Property"), def("SpreadProperty"))]); - -def("SpreadPropertyPattern") - .bases("Pattern") - .build("argument") - .field("argument", def("Pattern")); - -def("ObjectPattern") - .field("properties", [or( - def("Property"), - def("PropertyPattern"), - def("SpreadPropertyPattern") - )]); - -def("AwaitExpression") - .bases("Expression") - .build("argument", "all") - .field("argument", or(def("Expression"), null)) - .field("all", Boolean, defaults["false"]); - -},{"572":572,"582":582,"583":583}],574:[function(_dereq_,module,exports){ -_dereq_(573); - -var types = _dereq_(583); -var defaults = _dereq_(582).defaults; -var def = types.Type.def; -var or = types.Type.or; - -def("VariableDeclaration") - .field("declarations", [or( - def("VariableDeclarator"), - def("Identifier") // Esprima deviation. - )]); - -def("Property") - .field("value", or( - def("Expression"), - def("Pattern") // Esprima deviation. - )); - -def("ArrayPattern") - .field("elements", [or( - def("Pattern"), - def("SpreadElement"), - null - )]); - -def("ObjectPattern") - .field("properties", [or( - def("Property"), - def("PropertyPattern"), - def("SpreadPropertyPattern"), - def("SpreadProperty") // Used by Esprima. - )]); - -// Like ModuleSpecifier, except type:"ExportSpecifier" and buildable. -// export {} [from ...]; -def("ExportSpecifier") - .bases("ModuleSpecifier") - .build("id", "name"); - -// export <*> from ...; -def("ExportBatchSpecifier") - .bases("Specifier") - .build(); - -// Like ModuleSpecifier, except type:"ImportSpecifier" and buildable. -// import {} from ...; -def("ImportSpecifier") - .bases("ModuleSpecifier") - .build("id", "name"); - -// import <* as id> from ...; -def("ImportNamespaceSpecifier") - .bases("ModuleSpecifier") - .build("id"); - -// import from ...; -def("ImportDefaultSpecifier") - .bases("ModuleSpecifier") - .build("id"); - -def("ExportDeclaration") - .bases("Declaration") - .build("default", "declaration", "specifiers", "source") - .field("default", Boolean) - .field("declaration", or( - def("Declaration"), - def("Expression"), // Implies default. - null - )) - .field("specifiers", [or( - def("ExportSpecifier"), - def("ExportBatchSpecifier") - )], defaults.emptyArray) - .field("source", or( - def("Literal"), - null - ), defaults["null"]); - -def("ImportDeclaration") - .bases("Declaration") - .build("specifiers", "source") - .field("specifiers", [or( - def("ImportSpecifier"), - def("ImportNamespaceSpecifier"), - def("ImportDefaultSpecifier") - )], defaults.emptyArray) - .field("source", def("Literal")); - -def("Block") - .bases("Comment") - .build("value", /*optional:*/ "leading", "trailing"); - -def("Line") - .bases("Comment") - .build("value", /*optional:*/ "leading", "trailing"); - -},{"573":573,"582":582,"583":583}],575:[function(_dereq_,module,exports){ -_dereq_(573); - -var types = _dereq_(583); -var def = types.Type.def; -var or = types.Type.or; -var defaults = _dereq_(582).defaults; - -def("JSXAttribute") - .bases("Node") - .build("name", "value") - .field("name", or(def("JSXIdentifier"), def("JSXNamespacedName"))) - .field("value", or( - def("Literal"), // attr="value" - def("JSXExpressionContainer"), // attr={value} - null // attr= or just attr - ), defaults["null"]); - -def("JSXIdentifier") - .bases("Identifier") - .build("name") - .field("name", String); - -def("JSXNamespacedName") - .bases("Node") - .build("namespace", "name") - .field("namespace", def("JSXIdentifier")) - .field("name", def("JSXIdentifier")); - -def("JSXMemberExpression") - .bases("MemberExpression") - .build("object", "property") - .field("object", or(def("JSXIdentifier"), def("JSXMemberExpression"))) - .field("property", def("JSXIdentifier")) - .field("computed", Boolean, defaults.false); - -var JSXElementName = or( - def("JSXIdentifier"), - def("JSXNamespacedName"), - def("JSXMemberExpression") -); - -def("JSXSpreadAttribute") - .bases("Node") - .build("argument") - .field("argument", def("Expression")); - -var JSXAttributes = [or( - def("JSXAttribute"), - def("JSXSpreadAttribute") -)]; - -def("JSXExpressionContainer") - .bases("Expression") - .build("expression") - .field("expression", def("Expression")); - -def("JSXElement") - .bases("Expression") - .build("openingElement", "closingElement", "children") - .field("openingElement", def("JSXOpeningElement")) - .field("closingElement", or(def("JSXClosingElement"), null), defaults["null"]) - .field("children", [or( - def("JSXElement"), - def("JSXExpressionContainer"), - def("JSXText"), - def("Literal") // TODO Esprima should return JSXText instead. - )], defaults.emptyArray) - .field("name", JSXElementName, function() { - // Little-known fact: the `this` object inside a default function - // is none other than the partially-built object itself, and any - // fields initialized directly from builder function arguments - // (like openingElement, closingElement, and children) are - // guaranteed to be available. - return this.openingElement.name; - }, true) // hidden from traversal - .field("selfClosing", Boolean, function() { - return this.openingElement.selfClosing; - }, true) // hidden from traversal - .field("attributes", JSXAttributes, function() { - return this.openingElement.attributes; - }, true); // hidden from traversal - -def("JSXOpeningElement") - .bases("Node") // TODO Does this make sense? Can't really be an JSXElement. - .build("name", "attributes", "selfClosing") - .field("name", JSXElementName) - .field("attributes", JSXAttributes, defaults.emptyArray) - .field("selfClosing", Boolean, defaults["false"]); - -def("JSXClosingElement") - .bases("Node") // TODO Same concern. - .build("name") - .field("name", JSXElementName); - -def("JSXText") - .bases("Literal") - .build("value") - .field("value", String); - -def("JSXEmptyExpression").bases("Expression").build(); - -// Type Annotations -def("Type").bases("Node"); - -def("AnyTypeAnnotation") - .bases("Type") - .build(); - -def("MixedTypeAnnotation") - .bases("Type") - .build(); - -def("VoidTypeAnnotation") - .bases("Type") - .build(); - -def("NumberTypeAnnotation") - .bases("Type") - .build(); - -def("NumberLiteralTypeAnnotation") - .bases("Type") - .build("value", "raw") - .field("value", Number) - .field("raw", String); - -def("StringTypeAnnotation") - .bases("Type") - .build(); - -def("StringLiteralTypeAnnotation") - .bases("Type") - .build("value", "raw") - .field("value", String) - .field("raw", String); - -def("BooleanTypeAnnotation") - .bases("Type") - .build(); - -def("BooleanLiteralTypeAnnotation") - .bases("Type") - .build("value", "raw") - .field("value", Boolean) - .field("raw", String); - -def("TypeAnnotation") - .bases("Node") - .build("typeAnnotation") - .field("typeAnnotation", def("Type")); - -def("NullableTypeAnnotation") - .bases("Type") - .build("typeAnnotation") - .field("typeAnnotation", def("Type")); - -def("FunctionTypeAnnotation") - .bases("Type") - .build("params", "returnType", "rest", "typeParameters") - .field("params", [def("FunctionTypeParam")]) - .field("returnType", def("Type")) - .field("rest", or(def("FunctionTypeParam"), null)) - .field("typeParameters", or(def("TypeParameterDeclaration"), null)); - -def("FunctionTypeParam") - .bases("Node") - .build("name", "typeAnnotation", "optional") - .field("name", def("Identifier")) - .field("typeAnnotation", def("Type")) - .field("optional", Boolean); - -def("ArrayTypeAnnotation") - .bases("Type") - .build("elementType") - .field("elementType", def("Type")); - -def("ObjectTypeAnnotation") - .bases("Type") - .build("properties") - .field("properties", [def("ObjectTypeProperty")]) - .field("indexers", [def("ObjectTypeIndexer")], defaults.emptyArray) - .field("callProperties", - [def("ObjectTypeCallProperty")], - defaults.emptyArray); - -def("ObjectTypeProperty") - .bases("Node") - .build("key", "value", "optional") - .field("key", or(def("Literal"), def("Identifier"))) - .field("value", def("Type")) - .field("optional", Boolean); - -def("ObjectTypeIndexer") - .bases("Node") - .build("id", "key", "value") - .field("id", def("Identifier")) - .field("key", def("Type")) - .field("value", def("Type")); - -def("ObjectTypeCallProperty") - .bases("Node") - .build("value") - .field("value", def("FunctionTypeAnnotation")) - .field("static", Boolean, false); - -def("QualifiedTypeIdentifier") - .bases("Node") - .build("qualification", "id") - .field("qualification", - or(def("Identifier"), - def("QualifiedTypeIdentifier"))) - .field("id", def("Identifier")); - -def("GenericTypeAnnotation") - .bases("Type") - .build("id", "typeParameters") - .field("id", or(def("Identifier"), def("QualifiedTypeIdentifier"))) - .field("typeParameters", or(def("TypeParameterInstantiation"), null)); - -def("MemberTypeAnnotation") - .bases("Type") - .build("object", "property") - .field("object", def("Identifier")) - .field("property", - or(def("MemberTypeAnnotation"), - def("GenericTypeAnnotation"))); - -def("UnionTypeAnnotation") - .bases("Type") - .build("types") - .field("types", [def("Type")]); - -def("IntersectionTypeAnnotation") - .bases("Type") - .build("types") - .field("types", [def("Type")]); - -def("TypeofTypeAnnotation") - .bases("Type") - .build("argument") - .field("argument", def("Type")); - -def("Identifier") - .field("typeAnnotation", or(def("TypeAnnotation"), null), defaults["null"]); - -def("TypeParameterDeclaration") - .bases("Node") - .build("params") - .field("params", [def("Identifier")]); - -def("TypeParameterInstantiation") - .bases("Node") - .build("params") - .field("params", [def("Type")]); - -def("Function") - .field("returnType", - or(def("TypeAnnotation"), null), - defaults["null"]) - .field("typeParameters", - or(def("TypeParameterDeclaration"), null), - defaults["null"]); - -def("ClassProperty") - .build("key", "value", "typeAnnotation", "static") - .field("value", or(def("Expression"), null)) - .field("typeAnnotation", or(def("TypeAnnotation"), null)) - .field("static", Boolean, defaults["false"]); - -def("ClassImplements") - .field("typeParameters", - or(def("TypeParameterInstantiation"), null), - defaults["null"]); - -def("InterfaceDeclaration") - .bases("Statement") - .build("id", "body", "extends") - .field("id", def("Identifier")) - .field("typeParameters", - or(def("TypeParameterDeclaration"), null), - defaults["null"]) - .field("body", def("ObjectTypeAnnotation")) - .field("extends", [def("InterfaceExtends")]); - -def("InterfaceExtends") - .bases("Node") - .build("id") - .field("id", def("Identifier")) - .field("typeParameters", or(def("TypeParameterInstantiation"), null)); - -def("TypeAlias") - .bases("Statement") - .build("id", "typeParameters", "right") - .field("id", def("Identifier")) - .field("typeParameters", or(def("TypeParameterDeclaration"), null)) - .field("right", def("Type")); - -def("TypeCastExpression") - .bases("Expression") - .build("expression", "typeAnnotation") - .field("expression", def("Expression")) - .field("typeAnnotation", def("TypeAnnotation")); - -def("TupleTypeAnnotation") - .bases("Type") - .build("types") - .field("types", [def("Type")]); - -def("DeclareVariable") - .bases("Statement") - .build("id") - .field("id", def("Identifier")); - -def("DeclareFunction") - .bases("Statement") - .build("id") - .field("id", def("Identifier")); - -def("DeclareClass") - .bases("InterfaceDeclaration") - .build("id"); - -def("DeclareModule") - .bases("Statement") - .build("id", "body") - .field("id", or(def("Identifier"), def("Literal"))) - .field("body", def("BlockStatement")); - -},{"573":573,"582":582,"583":583}],576:[function(_dereq_,module,exports){ -_dereq_(570); -var types = _dereq_(583); -var def = types.Type.def; -var or = types.Type.or; -var shared = _dereq_(582); -var geq = shared.geq; -var defaults = shared.defaults; - -def("Function") - // SpiderMonkey allows expression closures: function(x) x+1 - .field("body", or(def("BlockStatement"), def("Expression"))); - -def("ForInStatement") - .build("left", "right", "body", "each") - .field("each", Boolean, defaults["false"]); - -def("ForOfStatement") - .bases("Statement") - .build("left", "right", "body") - .field("left", or( - def("VariableDeclaration"), - def("Expression"))) - .field("right", def("Expression")) - .field("body", def("Statement")); - -def("LetStatement") - .bases("Statement") - .build("head", "body") - // TODO Deviating from the spec by reusing VariableDeclarator here. - .field("head", [def("VariableDeclarator")]) - .field("body", def("Statement")); - -def("LetExpression") - .bases("Expression") - .build("head", "body") - // TODO Deviating from the spec by reusing VariableDeclarator here. - .field("head", [def("VariableDeclarator")]) - .field("body", def("Expression")); - -def("GraphExpression") - .bases("Expression") - .build("index", "expression") - .field("index", geq(0)) - .field("expression", def("Literal")); - -def("GraphIndexExpression") - .bases("Expression") - .build("index") - .field("index", geq(0)); - -},{"570":570,"582":582,"583":583}],577:[function(_dereq_,module,exports){ -var types = _dereq_(584); -var getFieldNames = types.getFieldNames; -var getFieldValue = types.getFieldValue; -var isArray = types.builtInTypes.array; -var isObject = types.builtInTypes.object; -var isDate = types.builtInTypes.Date; -var isRegExp = types.builtInTypes.RegExp; -var hasOwn = Object.prototype.hasOwnProperty; - -function astNodesAreEquivalent(a, b, problemPath) { - if (isArray.check(problemPath)) { - problemPath.length = 0; - } else { - problemPath = null; - } - - return areEquivalent(a, b, problemPath); -} - -astNodesAreEquivalent.assert = function(a, b) { - var problemPath = []; - if (!astNodesAreEquivalent(a, b, problemPath)) { - if (problemPath.length === 0) { - if (a !== b) { - throw new Error("Nodes must be equal"); - } - } else { - throw new Error( - "Nodes differ in the following path: " + - problemPath.map(subscriptForProperty).join("") - ); - } - } -}; - -function subscriptForProperty(property) { - if (/[_$a-z][_$a-z0-9]*/i.test(property)) { - return "." + property; - } - return "[" + JSON.stringify(property) + "]"; -} - -function areEquivalent(a, b, problemPath) { - if (a === b) { - return true; - } - - if (isArray.check(a)) { - return arraysAreEquivalent(a, b, problemPath); - } - - if (isObject.check(a)) { - return objectsAreEquivalent(a, b, problemPath); - } - - if (isDate.check(a)) { - return isDate.check(b) && (+a === +b); - } - - if (isRegExp.check(a)) { - return isRegExp.check(b) && ( - a.source === b.source && - a.global === b.global && - a.multiline === b.multiline && - a.ignoreCase === b.ignoreCase - ); - } - - return a == b; -} - -function arraysAreEquivalent(a, b, problemPath) { - isArray.assert(a); - var aLength = a.length; - - if (!isArray.check(b) || b.length !== aLength) { - if (problemPath) { - problemPath.push("length"); - } - return false; - } - - for (var i = 0; i < aLength; ++i) { - if (problemPath) { - problemPath.push(i); - } - - if (i in a !== i in b) { - return false; - } - - if (!areEquivalent(a[i], b[i], problemPath)) { - return false; - } - - if (problemPath) { - var problemPathTail = problemPath.pop(); - if (problemPathTail !== i) { - throw new Error("" + problemPathTail); - } - } - } - - return true; -} - -function objectsAreEquivalent(a, b, problemPath) { - isObject.assert(a); - if (!isObject.check(b)) { - return false; - } - - // Fast path for a common property of AST nodes. - if (a.type !== b.type) { - if (problemPath) { - problemPath.push("type"); - } - return false; - } - - var aNames = getFieldNames(a); - var aNameCount = aNames.length; - - var bNames = getFieldNames(b); - var bNameCount = bNames.length; - - if (aNameCount === bNameCount) { - for (var i = 0; i < aNameCount; ++i) { - var name = aNames[i]; - var aChild = getFieldValue(a, name); - var bChild = getFieldValue(b, name); - - if (problemPath) { - problemPath.push(name); - } - - if (!areEquivalent(aChild, bChild, problemPath)) { - return false; - } - - if (problemPath) { - var problemPathTail = problemPath.pop(); - if (problemPathTail !== name) { - throw new Error("" + problemPathTail); - } - } - } - - return true; - } - - if (!problemPath) { - return false; - } - - // Since aNameCount !== bNameCount, we need to find some name that's - // missing in aNames but present in bNames, or vice-versa. - - var seenNames = Object.create(null); - - for (i = 0; i < aNameCount; ++i) { - seenNames[aNames[i]] = true; - } - - for (i = 0; i < bNameCount; ++i) { - name = bNames[i]; - - if (!hasOwn.call(seenNames, name)) { - problemPath.push(name); - return false; - } - - delete seenNames[name]; - } - - for (name in seenNames) { - problemPath.push(name); - break; - } - - return false; -} - -module.exports = astNodesAreEquivalent; - -},{"584":584}],578:[function(_dereq_,module,exports){ -var types = _dereq_(583); -var n = types.namedTypes; -var b = types.builders; -var isNumber = types.builtInTypes.number; -var isArray = types.builtInTypes.array; -var Path = _dereq_(580); -var Scope = _dereq_(581); - -function NodePath(value, parentPath, name) { - if (!(this instanceof NodePath)) { - throw new Error("NodePath constructor cannot be invoked without 'new'"); - } - Path.call(this, value, parentPath, name); -} - -var NPp = NodePath.prototype = Object.create(Path.prototype, { - constructor: { - value: NodePath, - enumerable: false, - writable: true, - configurable: true - } -}); - -Object.defineProperties(NPp, { - node: { - get: function() { - Object.defineProperty(this, "node", { - configurable: true, // Enable deletion. - value: this._computeNode() - }); - - return this.node; - } - }, - - parent: { - get: function() { - Object.defineProperty(this, "parent", { - configurable: true, // Enable deletion. - value: this._computeParent() - }); - - return this.parent; - } - }, - - scope: { - get: function() { - Object.defineProperty(this, "scope", { - configurable: true, // Enable deletion. - value: this._computeScope() - }); - - return this.scope; - } - } -}); - -NPp.replace = function() { - delete this.node; - delete this.parent; - delete this.scope; - return Path.prototype.replace.apply(this, arguments); -}; - -NPp.prune = function() { - var remainingNodePath = this.parent; - - this.replace(); - - return cleanUpNodesAfterPrune(remainingNodePath); -}; - -// The value of the first ancestor Path whose value is a Node. -NPp._computeNode = function() { - var value = this.value; - if (n.Node.check(value)) { - return value; - } - - var pp = this.parentPath; - return pp && pp.node || null; -}; - -// The first ancestor Path whose value is a Node distinct from this.node. -NPp._computeParent = function() { - var value = this.value; - var pp = this.parentPath; - - if (!n.Node.check(value)) { - while (pp && !n.Node.check(pp.value)) { - pp = pp.parentPath; - } - - if (pp) { - pp = pp.parentPath; - } - } - - while (pp && !n.Node.check(pp.value)) { - pp = pp.parentPath; - } - - return pp || null; -}; - -// The closest enclosing scope that governs this node. -NPp._computeScope = function() { - var value = this.value; - var pp = this.parentPath; - var scope = pp && pp.scope; - - if (n.Node.check(value) && - Scope.isEstablishedBy(value)) { - scope = new Scope(this, scope); - } - - return scope || null; -}; - -NPp.getValueProperty = function(name) { - return types.getFieldValue(this.value, name); -}; - -/** - * Determine whether this.node needs to be wrapped in parentheses in order - * for a parser to reproduce the same local AST structure. - * - * For instance, in the expression `(1 + 2) * 3`, the BinaryExpression - * whose operator is "+" needs parentheses, because `1 + 2 * 3` would - * parse differently. - * - * If assumeExpressionContext === true, we don't worry about edge cases - * like an anonymous FunctionExpression appearing lexically first in its - * enclosing statement and thus needing parentheses to avoid being parsed - * as a FunctionDeclaration with a missing name. - */ -NPp.needsParens = function(assumeExpressionContext) { - var pp = this.parentPath; - if (!pp) { - return false; - } - - var node = this.value; - - // Only expressions need parentheses. - if (!n.Expression.check(node)) { - return false; - } - - // Identifiers never need parentheses. - if (node.type === "Identifier") { - return false; - } - - while (!n.Node.check(pp.value)) { - pp = pp.parentPath; - if (!pp) { - return false; - } - } - - var parent = pp.value; - - switch (node.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return parent.type === "MemberExpression" - && this.name === "object" - && parent.object === node; - - case "BinaryExpression": - case "LogicalExpression": - switch (parent.type) { - case "CallExpression": - return this.name === "callee" - && parent.callee === node; - - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - return true; - - case "MemberExpression": - return this.name === "object" - && parent.object === node; - - case "BinaryExpression": - case "LogicalExpression": - var po = parent.operator; - var pp = PRECEDENCE[po]; - var no = node.operator; - var np = PRECEDENCE[no]; - - if (pp > np) { - return true; - } - - if (pp === np && this.name === "right") { - if (parent.right !== node) { - throw new Error("Nodes must be equal"); - } - return true; - } - - default: - return false; - } - - case "SequenceExpression": - switch (parent.type) { - case "ForStatement": - // Although parentheses wouldn't hurt around sequence - // expressions in the head of for loops, traditional style - // dictates that e.g. i++, j++ should not be wrapped with - // parentheses. - return false; - - case "ExpressionStatement": - return this.name !== "expression"; - - default: - // Otherwise err on the side of overparenthesization, adding - // explicit exceptions above if this proves overzealous. - return true; - } - - case "YieldExpression": - switch (parent.type) { - case "BinaryExpression": - case "LogicalExpression": - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - case "CallExpression": - case "MemberExpression": - case "NewExpression": - case "ConditionalExpression": - case "YieldExpression": - return true; - - default: - return false; - } - - case "Literal": - return parent.type === "MemberExpression" - && isNumber.check(node.value) - && this.name === "object" - && parent.object === node; - - case "AssignmentExpression": - case "ConditionalExpression": - switch (parent.type) { - case "UnaryExpression": - case "SpreadElement": - case "SpreadProperty": - case "BinaryExpression": - case "LogicalExpression": - return true; - - case "CallExpression": - return this.name === "callee" - && parent.callee === node; - - case "ConditionalExpression": - return this.name === "test" - && parent.test === node; - - case "MemberExpression": - return this.name === "object" - && parent.object === node; - - default: - return false; - } - - default: - if (parent.type === "NewExpression" && - this.name === "callee" && - parent.callee === node) { - return containsCallExpression(node); - } - } - - if (assumeExpressionContext !== true && - !this.canBeFirstInStatement() && - this.firstInStatement()) - return true; - - return false; -}; - -function isBinary(node) { - return n.BinaryExpression.check(node) - || n.LogicalExpression.check(node); -} - -function isUnaryLike(node) { - return n.UnaryExpression.check(node) - // I considered making SpreadElement and SpreadProperty subtypes - // of UnaryExpression, but they're not really Expression nodes. - || (n.SpreadElement && n.SpreadElement.check(node)) - || (n.SpreadProperty && n.SpreadProperty.check(node)); -} - -var PRECEDENCE = {}; -[["||"], - ["&&"], - ["|"], - ["^"], - ["&"], - ["==", "===", "!=", "!=="], - ["<", ">", "<=", ">=", "in", "instanceof"], - [">>", "<<", ">>>"], - ["+", "-"], - ["*", "/", "%"] -].forEach(function(tier, i) { - tier.forEach(function(op) { - PRECEDENCE[op] = i; - }); -}); - -function containsCallExpression(node) { - if (n.CallExpression.check(node)) { - return true; - } - - if (isArray.check(node)) { - return node.some(containsCallExpression); - } - - if (n.Node.check(node)) { - return types.someField(node, function(name, child) { - return containsCallExpression(child); - }); - } - - return false; -} - -NPp.canBeFirstInStatement = function() { - var node = this.node; - return !n.FunctionExpression.check(node) - && !n.ObjectExpression.check(node); -}; - -NPp.firstInStatement = function() { - return firstInStatement(this); -}; - -function firstInStatement(path) { - for (var node, parent; path.parent; path = path.parent) { - node = path.node; - parent = path.parent.node; - - if (n.BlockStatement.check(parent) && - path.parent.name === "body" && - path.name === 0) { - if (parent.body[0] !== node) { - throw new Error("Nodes must be equal"); - } - return true; - } - - if (n.ExpressionStatement.check(parent) && - path.name === "expression") { - if (parent.expression !== node) { - throw new Error("Nodes must be equal"); - } - return true; - } - - if (n.SequenceExpression.check(parent) && - path.parent.name === "expressions" && - path.name === 0) { - if (parent.expressions[0] !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - if (n.CallExpression.check(parent) && - path.name === "callee") { - if (parent.callee !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - if (n.MemberExpression.check(parent) && - path.name === "object") { - if (parent.object !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - if (n.ConditionalExpression.check(parent) && - path.name === "test") { - if (parent.test !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - if (isBinary(parent) && - path.name === "left") { - if (parent.left !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - if (n.UnaryExpression.check(parent) && - !parent.prefix && - path.name === "argument") { - if (parent.argument !== node) { - throw new Error("Nodes must be equal"); - } - continue; - } - - return false; - } - - return true; -} - -/** - * Pruning certain nodes will result in empty or incomplete nodes, here we clean those nodes up. - */ -function cleanUpNodesAfterPrune(remainingNodePath) { - if (n.VariableDeclaration.check(remainingNodePath.node)) { - var declarations = remainingNodePath.get('declarations').value; - if (!declarations || declarations.length === 0) { - return remainingNodePath.prune(); - } - } else if (n.ExpressionStatement.check(remainingNodePath.node)) { - if (!remainingNodePath.get('expression').value) { - return remainingNodePath.prune(); - } - } else if (n.IfStatement.check(remainingNodePath.node)) { - cleanUpIfStatementAfterPrune(remainingNodePath); - } - - return remainingNodePath; -} - -function cleanUpIfStatementAfterPrune(ifStatement) { - var testExpression = ifStatement.get('test').value; - var alternate = ifStatement.get('alternate').value; - var consequent = ifStatement.get('consequent').value; - - if (!consequent && !alternate) { - var testExpressionStatement = b.expressionStatement(testExpression); - - ifStatement.replace(testExpressionStatement); - } else if (!consequent && alternate) { - var negatedTestExpression = b.unaryExpression('!', testExpression, true); - - if (n.UnaryExpression.check(testExpression) && testExpression.operator === '!') { - negatedTestExpression = testExpression.argument; - } - - ifStatement.get("test").replace(negatedTestExpression); - ifStatement.get("consequent").replace(alternate); - ifStatement.get("alternate").replace(); - } -} - -module.exports = NodePath; - -},{"580":580,"581":581,"583":583}],579:[function(_dereq_,module,exports){ -var types = _dereq_(583); -var NodePath = _dereq_(578); -var Printable = types.namedTypes.Printable; -var isArray = types.builtInTypes.array; -var isObject = types.builtInTypes.object; -var isFunction = types.builtInTypes.function; -var hasOwn = Object.prototype.hasOwnProperty; -var undefined; - -function PathVisitor() { - if (!(this instanceof PathVisitor)) { - throw new Error( - "PathVisitor constructor cannot be invoked without 'new'" - ); - } - - // Permanent state. - this._reusableContextStack = []; - - this._methodNameTable = computeMethodNameTable(this); - this._shouldVisitComments = - hasOwn.call(this._methodNameTable, "Block") || - hasOwn.call(this._methodNameTable, "Line"); - - this.Context = makeContextConstructor(this); - - // State reset every time PathVisitor.prototype.visit is called. - this._visiting = false; - this._changeReported = false; -} - -function computeMethodNameTable(visitor) { - var typeNames = Object.create(null); - - for (var methodName in visitor) { - if (/^visit[A-Z]/.test(methodName)) { - typeNames[methodName.slice("visit".length)] = true; - } - } - - var supertypeTable = types.computeSupertypeLookupTable(typeNames); - var methodNameTable = Object.create(null); - - var typeNames = Object.keys(supertypeTable); - var typeNameCount = typeNames.length; - for (var i = 0; i < typeNameCount; ++i) { - var typeName = typeNames[i]; - methodName = "visit" + supertypeTable[typeName]; - if (isFunction.check(visitor[methodName])) { - methodNameTable[typeName] = methodName; - } - } - - return methodNameTable; -} - -PathVisitor.fromMethodsObject = function fromMethodsObject(methods) { - if (methods instanceof PathVisitor) { - return methods; - } - - if (!isObject.check(methods)) { - // An empty visitor? - return new PathVisitor; - } - - function Visitor() { - if (!(this instanceof Visitor)) { - throw new Error( - "Visitor constructor cannot be invoked without 'new'" - ); - } - PathVisitor.call(this); - } - - var Vp = Visitor.prototype = Object.create(PVp); - Vp.constructor = Visitor; - - extend(Vp, methods); - extend(Visitor, PathVisitor); - - isFunction.assert(Visitor.fromMethodsObject); - isFunction.assert(Visitor.visit); - - return new Visitor; -}; - -function extend(target, source) { - for (var property in source) { - if (hasOwn.call(source, property)) { - target[property] = source[property]; - } - } - - return target; -} - -PathVisitor.visit = function visit(node, methods) { - return PathVisitor.fromMethodsObject(methods).visit(node); -}; - -var PVp = PathVisitor.prototype; - -PVp.visit = function() { - if (this._visiting) { - throw new Error( - "Recursively calling visitor.visit(path) resets visitor state. " + - "Try this.visit(path) or this.traverse(path) instead." - ); - } - - // Private state that needs to be reset before every traversal. - this._visiting = true; - this._changeReported = false; - this._abortRequested = false; - - var argc = arguments.length; - var args = new Array(argc) - for (var i = 0; i < argc; ++i) { - args[i] = arguments[i]; - } - - if (!(args[0] instanceof NodePath)) { - args[0] = new NodePath({ root: args[0] }).get("root"); - } - - // Called with the same arguments as .visit. - this.reset.apply(this, args); - - try { - var root = this.visitWithoutReset(args[0]); - var didNotThrow = true; - } finally { - this._visiting = false; - - if (!didNotThrow && this._abortRequested) { - // If this.visitWithoutReset threw an exception and - // this._abortRequested was set to true, return the root of - // the AST instead of letting the exception propagate, so that - // client code does not have to provide a try-catch block to - // intercept the AbortRequest exception. Other kinds of - // exceptions will propagate without being intercepted and - // rethrown by a catch block, so their stacks will accurately - // reflect the original throwing context. - return args[0].value; - } - } - - return root; -}; - -PVp.AbortRequest = function AbortRequest() {}; -PVp.abort = function() { - var visitor = this; - visitor._abortRequested = true; - var request = new visitor.AbortRequest(); - - // If you decide to catch this exception and stop it from propagating, - // make sure to call its cancel method to avoid silencing other - // exceptions that might be thrown later in the traversal. - request.cancel = function() { - visitor._abortRequested = false; - }; - - throw request; -}; - -PVp.reset = function(path/*, additional arguments */) { - // Empty stub; may be reassigned or overridden by subclasses. -}; - -PVp.visitWithoutReset = function(path) { - if (this instanceof this.Context) { - // Since this.Context.prototype === this, there's a chance we - // might accidentally call context.visitWithoutReset. If that - // happens, re-invoke the method against context.visitor. - return this.visitor.visitWithoutReset(path); - } - - if (!(path instanceof NodePath)) { - throw new Error(""); - } - - var value = path.value; - - var methodName = value && - typeof value === "object" && - typeof value.type === "string" && - this._methodNameTable[value.type]; - - if (methodName) { - var context = this.acquireContext(path); - try { - return context.invokeVisitorMethod(methodName); - } finally { - this.releaseContext(context); - } - - } else { - // If there was no visitor method to call, visit the children of - // this node generically. - return visitChildren(path, this); - } -}; - -function visitChildren(path, visitor) { - if (!(path instanceof NodePath)) { - throw new Error(""); - } - if (!(visitor instanceof PathVisitor)) { - throw new Error(""); - } - - var value = path.value; - - if (isArray.check(value)) { - path.each(visitor.visitWithoutReset, visitor); - } else if (!isObject.check(value)) { - // No children to visit. - } else { - var childNames = types.getFieldNames(value); - - // The .comments field of the Node type is hidden, so we only - // visit it if the visitor defines visitBlock or visitLine, and - // value.comments is defined. - if (visitor._shouldVisitComments && - value.comments && - childNames.indexOf("comments") < 0) { - childNames.push("comments"); - } - - var childCount = childNames.length; - var childPaths = []; - - for (var i = 0; i < childCount; ++i) { - var childName = childNames[i]; - if (!hasOwn.call(value, childName)) { - value[childName] = types.getFieldValue(value, childName); - } - childPaths.push(path.get(childName)); - } - - for (var i = 0; i < childCount; ++i) { - visitor.visitWithoutReset(childPaths[i]); - } - } - - return path.value; -} - -PVp.acquireContext = function(path) { - if (this._reusableContextStack.length === 0) { - return new this.Context(path); - } - return this._reusableContextStack.pop().reset(path); -}; - -PVp.releaseContext = function(context) { - if (!(context instanceof this.Context)) { - throw new Error(""); - } - this._reusableContextStack.push(context); - context.currentPath = null; -}; - -PVp.reportChanged = function() { - this._changeReported = true; -}; - -PVp.wasChangeReported = function() { - return this._changeReported; -}; - -function makeContextConstructor(visitor) { - function Context(path) { - if (!(this instanceof Context)) { - throw new Error(""); - } - if (!(this instanceof PathVisitor)) { - throw new Error(""); - } - if (!(path instanceof NodePath)) { - throw new Error(""); - } - - Object.defineProperty(this, "visitor", { - value: visitor, - writable: false, - enumerable: true, - configurable: false - }); - - this.currentPath = path; - this.needToCallTraverse = true; - - Object.seal(this); - } - - if (!(visitor instanceof PathVisitor)) { - throw new Error(""); - } - - // Note that the visitor object is the prototype of Context.prototype, - // so all visitor methods are inherited by context objects. - var Cp = Context.prototype = Object.create(visitor); - - Cp.constructor = Context; - extend(Cp, sharedContextProtoMethods); - - return Context; -} - -// Every PathVisitor has a different this.Context constructor and -// this.Context.prototype object, but those prototypes can all use the -// same reset, invokeVisitorMethod, and traverse function objects. -var sharedContextProtoMethods = Object.create(null); - -sharedContextProtoMethods.reset = -function reset(path) { - if (!(this instanceof this.Context)) { - throw new Error(""); - } - if (!(path instanceof NodePath)) { - throw new Error(""); - } - - this.currentPath = path; - this.needToCallTraverse = true; - - return this; -}; - -sharedContextProtoMethods.invokeVisitorMethod = -function invokeVisitorMethod(methodName) { - if (!(this instanceof this.Context)) { - throw new Error(""); - } - if (!(this.currentPath instanceof NodePath)) { - throw new Error(""); - } - - var result = this.visitor[methodName].call(this, this.currentPath); - - if (result === false) { - // Visitor methods return false to indicate that they have handled - // their own traversal needs, and we should not complain if - // this.needToCallTraverse is still true. - this.needToCallTraverse = false; - - } else if (result !== undefined) { - // Any other non-undefined value returned from the visitor method - // is interpreted as a replacement value. - this.currentPath = this.currentPath.replace(result)[0]; - - if (this.needToCallTraverse) { - // If this.traverse still hasn't been called, visit the - // children of the replacement node. - this.traverse(this.currentPath); - } - } - - if (this.needToCallTraverse !== false) { - throw new Error( - "Must either call this.traverse or return false in " + methodName - ); - } - - var path = this.currentPath; - return path && path.value; -}; - -sharedContextProtoMethods.traverse = -function traverse(path, newVisitor) { - if (!(this instanceof this.Context)) { - throw new Error(""); - } - if (!(path instanceof NodePath)) { - throw new Error(""); - } - if (!(this.currentPath instanceof NodePath)) { - throw new Error(""); - } - - this.needToCallTraverse = false; - - return visitChildren(path, PathVisitor.fromMethodsObject( - newVisitor || this.visitor - )); -}; - -sharedContextProtoMethods.visit = -function visit(path, newVisitor) { - if (!(this instanceof this.Context)) { - throw new Error(""); - } - if (!(path instanceof NodePath)) { - throw new Error(""); - } - if (!(this.currentPath instanceof NodePath)) { - throw new Error(""); - } - - this.needToCallTraverse = false; - - return PathVisitor.fromMethodsObject( - newVisitor || this.visitor - ).visitWithoutReset(path); -}; - -sharedContextProtoMethods.reportChanged = function reportChanged() { - this.visitor.reportChanged(); -}; - -sharedContextProtoMethods.abort = function abort() { - this.needToCallTraverse = false; - this.visitor.abort(); -}; - -module.exports = PathVisitor; - -},{"578":578,"583":583}],580:[function(_dereq_,module,exports){ -var Op = Object.prototype; -var hasOwn = Op.hasOwnProperty; -var types = _dereq_(583); -var isArray = types.builtInTypes.array; -var isNumber = types.builtInTypes.number; -var Ap = Array.prototype; -var slice = Ap.slice; -var map = Ap.map; - -function Path(value, parentPath, name) { - if (!(this instanceof Path)) { - throw new Error("Path constructor cannot be invoked without 'new'"); - } - - if (parentPath) { - if (!(parentPath instanceof Path)) { - throw new Error(""); - } - } else { - parentPath = null; - name = null; - } - - // The value encapsulated by this Path, generally equal to - // parentPath.value[name] if we have a parentPath. - this.value = value; - - // The immediate parent Path of this Path. - this.parentPath = parentPath; - - // The name of the property of parentPath.value through which this - // Path's value was reached. - this.name = name; - - // Calling path.get("child") multiple times always returns the same - // child Path object, for both performance and consistency reasons. - this.__childCache = null; -} - -var Pp = Path.prototype; - -function getChildCache(path) { - // Lazily create the child cache. This also cheapens cache - // invalidation, since you can just reset path.__childCache to null. - return path.__childCache || (path.__childCache = Object.create(null)); -} - -function getChildPath(path, name) { - var cache = getChildCache(path); - var actualChildValue = path.getValueProperty(name); - var childPath = cache[name]; - if (!hasOwn.call(cache, name) || - // Ensure consistency between cache and reality. - childPath.value !== actualChildValue) { - childPath = cache[name] = new path.constructor( - actualChildValue, path, name - ); - } - return childPath; -} - -// This method is designed to be overridden by subclasses that need to -// handle missing properties, etc. -Pp.getValueProperty = function getValueProperty(name) { - return this.value[name]; -}; - -Pp.get = function get(name) { - var path = this; - var names = arguments; - var count = names.length; - - for (var i = 0; i < count; ++i) { - path = getChildPath(path, names[i]); - } - - return path; -}; - -Pp.each = function each(callback, context) { - var childPaths = []; - var len = this.value.length; - var i = 0; - - // Collect all the original child paths before invoking the callback. - for (var i = 0; i < len; ++i) { - if (hasOwn.call(this.value, i)) { - childPaths[i] = this.get(i); - } - } - - // Invoke the callback on just the original child paths, regardless of - // any modifications made to the array by the callback. I chose these - // semantics over cleverly invoking the callback on new elements because - // this way is much easier to reason about. - context = context || this; - for (i = 0; i < len; ++i) { - if (hasOwn.call(childPaths, i)) { - callback.call(context, childPaths[i]); - } - } -}; - -Pp.map = function map(callback, context) { - var result = []; - - this.each(function(childPath) { - result.push(callback.call(this, childPath)); - }, context); - - return result; -}; - -Pp.filter = function filter(callback, context) { - var result = []; - - this.each(function(childPath) { - if (callback.call(this, childPath)) { - result.push(childPath); - } - }, context); - - return result; -}; - -function emptyMoves() {} -function getMoves(path, offset, start, end) { - isArray.assert(path.value); - - if (offset === 0) { - return emptyMoves; - } - - var length = path.value.length; - if (length < 1) { - return emptyMoves; - } - - var argc = arguments.length; - if (argc === 2) { - start = 0; - end = length; - } else if (argc === 3) { - start = Math.max(start, 0); - end = length; - } else { - start = Math.max(start, 0); - end = Math.min(end, length); - } - - isNumber.assert(start); - isNumber.assert(end); - - var moves = Object.create(null); - var cache = getChildCache(path); - - for (var i = start; i < end; ++i) { - if (hasOwn.call(path.value, i)) { - var childPath = path.get(i); - if (childPath.name !== i) { - throw new Error(""); - } - var newIndex = i + offset; - childPath.name = newIndex; - moves[newIndex] = childPath; - delete cache[i]; - } - } - - delete cache.length; - - return function() { - for (var newIndex in moves) { - var childPath = moves[newIndex]; - if (childPath.name !== +newIndex) { - throw new Error(""); - } - cache[newIndex] = childPath; - path.value[newIndex] = childPath.value; - } - }; -} - -Pp.shift = function shift() { - var move = getMoves(this, -1); - var result = this.value.shift(); - move(); - return result; -}; - -Pp.unshift = function unshift(node) { - var move = getMoves(this, arguments.length); - var result = this.value.unshift.apply(this.value, arguments); - move(); - return result; -}; - -Pp.push = function push(node) { - isArray.assert(this.value); - delete getChildCache(this).length - return this.value.push.apply(this.value, arguments); -}; - -Pp.pop = function pop() { - isArray.assert(this.value); - var cache = getChildCache(this); - delete cache[this.value.length - 1]; - delete cache.length; - return this.value.pop(); -}; - -Pp.insertAt = function insertAt(index, node) { - var argc = arguments.length; - var move = getMoves(this, argc - 1, index); - if (move === emptyMoves) { - return this; - } - - index = Math.max(index, 0); - - for (var i = 1; i < argc; ++i) { - this.value[index + i - 1] = arguments[i]; - } - - move(); - - return this; -}; - -Pp.insertBefore = function insertBefore(node) { - var pp = this.parentPath; - var argc = arguments.length; - var insertAtArgs = [this.name]; - for (var i = 0; i < argc; ++i) { - insertAtArgs.push(arguments[i]); - } - return pp.insertAt.apply(pp, insertAtArgs); -}; - -Pp.insertAfter = function insertAfter(node) { - var pp = this.parentPath; - var argc = arguments.length; - var insertAtArgs = [this.name + 1]; - for (var i = 0; i < argc; ++i) { - insertAtArgs.push(arguments[i]); - } - return pp.insertAt.apply(pp, insertAtArgs); -}; - -function repairRelationshipWithParent(path) { - if (!(path instanceof Path)) { - throw new Error(""); - } - - var pp = path.parentPath; - if (!pp) { - // Orphan paths have no relationship to repair. - return path; - } - - var parentValue = pp.value; - var parentCache = getChildCache(pp); - - // Make sure parentCache[path.name] is populated. - if (parentValue[path.name] === path.value) { - parentCache[path.name] = path; - } else if (isArray.check(parentValue)) { - // Something caused path.name to become out of date, so attempt to - // recover by searching for path.value in parentValue. - var i = parentValue.indexOf(path.value); - if (i >= 0) { - parentCache[path.name = i] = path; - } - } else { - // If path.value disagrees with parentValue[path.name], and - // path.name is not an array index, let path.value become the new - // parentValue[path.name] and update parentCache accordingly. - parentValue[path.name] = path.value; - parentCache[path.name] = path; - } - - if (parentValue[path.name] !== path.value) { - throw new Error(""); - } - if (path.parentPath.get(path.name) !== path) { - throw new Error(""); - } - - return path; -} - -Pp.replace = function replace(replacement) { - var results = []; - var parentValue = this.parentPath.value; - var parentCache = getChildCache(this.parentPath); - var count = arguments.length; - - repairRelationshipWithParent(this); - - if (isArray.check(parentValue)) { - var originalLength = parentValue.length; - var move = getMoves(this.parentPath, count - 1, this.name + 1); - - var spliceArgs = [this.name, 1]; - for (var i = 0; i < count; ++i) { - spliceArgs.push(arguments[i]); - } - - var splicedOut = parentValue.splice.apply(parentValue, spliceArgs); - - if (splicedOut[0] !== this.value) { - throw new Error(""); - } - if (parentValue.length !== (originalLength - 1 + count)) { - throw new Error(""); - } - - move(); - - if (count === 0) { - delete this.value; - delete parentCache[this.name]; - this.__childCache = null; - - } else { - if (parentValue[this.name] !== replacement) { - throw new Error(""); - } - - if (this.value !== replacement) { - this.value = replacement; - this.__childCache = null; - } - - for (i = 0; i < count; ++i) { - results.push(this.parentPath.get(this.name + i)); - } - - if (results[0] !== this) { - throw new Error(""); - } - } - - } else if (count === 1) { - if (this.value !== replacement) { - this.__childCache = null; - } - this.value = parentValue[this.name] = replacement; - results.push(this); - - } else if (count === 0) { - delete parentValue[this.name]; - delete this.value; - this.__childCache = null; - - // Leave this path cached as parentCache[this.name], even though - // it no longer has a value defined. - - } else { - throw new Error("Could not replace path"); - } - - return results; -}; - -module.exports = Path; - -},{"583":583}],581:[function(_dereq_,module,exports){ -var types = _dereq_(583); -var Type = types.Type; -var namedTypes = types.namedTypes; -var Node = namedTypes.Node; -var Expression = namedTypes.Expression; -var isArray = types.builtInTypes.array; -var hasOwn = Object.prototype.hasOwnProperty; -var b = types.builders; - -function Scope(path, parentScope) { - if (!(this instanceof Scope)) { - throw new Error("Scope constructor cannot be invoked without 'new'"); - } - if (!(path instanceof _dereq_(578))) { - throw new Error(""); - } - ScopeType.assert(path.value); - - var depth; - - if (parentScope) { - if (!(parentScope instanceof Scope)) { - throw new Error(""); - } - depth = parentScope.depth + 1; - } else { - parentScope = null; - depth = 0; - } - - Object.defineProperties(this, { - path: { value: path }, - node: { value: path.value }, - isGlobal: { value: !parentScope, enumerable: true }, - depth: { value: depth }, - parent: { value: parentScope }, - bindings: { value: {} } - }); -} - -var scopeTypes = [ - // Program nodes introduce global scopes. - namedTypes.Program, - - // Function is the supertype of FunctionExpression, - // FunctionDeclaration, ArrowExpression, etc. - namedTypes.Function, - - // In case you didn't know, the caught parameter shadows any variable - // of the same name in an outer scope. - namedTypes.CatchClause -]; - -var ScopeType = Type.or.apply(Type, scopeTypes); - -Scope.isEstablishedBy = function(node) { - return ScopeType.check(node); -}; - -var Sp = Scope.prototype; - -// Will be overridden after an instance lazily calls scanScope. -Sp.didScan = false; - -Sp.declares = function(name) { - this.scan(); - return hasOwn.call(this.bindings, name); -}; - -Sp.declareTemporary = function(prefix) { - if (prefix) { - if (!/^[a-z$_]/i.test(prefix)) { - throw new Error(""); - } - } else { - prefix = "t$"; - } - - // Include this.depth in the name to make sure the name does not - // collide with any variables in nested/enclosing scopes. - prefix += this.depth.toString(36) + "$"; - - this.scan(); - - var index = 0; - while (this.declares(prefix + index)) { - ++index; - } - - var name = prefix + index; - return this.bindings[name] = types.builders.identifier(name); -}; - -Sp.injectTemporary = function(identifier, init) { - identifier || (identifier = this.declareTemporary()); - - var bodyPath = this.path.get("body"); - if (namedTypes.BlockStatement.check(bodyPath.value)) { - bodyPath = bodyPath.get("body"); - } - - bodyPath.unshift( - b.variableDeclaration( - "var", - [b.variableDeclarator(identifier, init || null)] - ) - ); - - return identifier; -}; - -Sp.scan = function(force) { - if (force || !this.didScan) { - for (var name in this.bindings) { - // Empty out this.bindings, just in cases. - delete this.bindings[name]; - } - scanScope(this.path, this.bindings); - this.didScan = true; - } -}; - -Sp.getBindings = function () { - this.scan(); - return this.bindings; -}; - -function scanScope(path, bindings) { - var node = path.value; - ScopeType.assert(node); - - if (namedTypes.CatchClause.check(node)) { - // A catch clause establishes a new scope but the only variable - // bound in that scope is the catch parameter. Any other - // declarations create bindings in the outer scope. - addPattern(path.get("param"), bindings); - - } else { - recursiveScanScope(path, bindings); - } -} - -function recursiveScanScope(path, bindings) { - var node = path.value; - - if (path.parent && - namedTypes.FunctionExpression.check(path.parent.node) && - path.parent.node.id) { - addPattern(path.parent.get("id"), bindings); - } - - if (!node) { - // None of the remaining cases matter if node is falsy. - - } else if (isArray.check(node)) { - path.each(function(childPath) { - recursiveScanChild(childPath, bindings); - }); - - } else if (namedTypes.Function.check(node)) { - path.get("params").each(function(paramPath) { - addPattern(paramPath, bindings); - }); - - recursiveScanChild(path.get("body"), bindings); - - } else if (namedTypes.VariableDeclarator.check(node)) { - addPattern(path.get("id"), bindings); - recursiveScanChild(path.get("init"), bindings); - - } else if (node.type === "ImportSpecifier" || - node.type === "ImportNamespaceSpecifier" || - node.type === "ImportDefaultSpecifier") { - addPattern( - // Esprima used to use the .name field to refer to the local - // binding identifier for ImportSpecifier nodes, but .id for - // ImportNamespaceSpecifier and ImportDefaultSpecifier nodes. - // ESTree/Acorn/ESpree use .local for all three node types. - path.get(node.local ? "local" : - node.name ? "name" : "id"), - bindings - ); - - } else if (Node.check(node) && !Expression.check(node)) { - types.eachField(node, function(name, child) { - var childPath = path.get(name); - if (childPath.value !== child) { - throw new Error(""); - } - recursiveScanChild(childPath, bindings); - }); - } -} - -function recursiveScanChild(path, bindings) { - var node = path.value; - - if (!node || Expression.check(node)) { - // Ignore falsy values and Expressions. - - } else if (namedTypes.FunctionDeclaration.check(node)) { - addPattern(path.get("id"), bindings); - - } else if (namedTypes.ClassDeclaration && - namedTypes.ClassDeclaration.check(node)) { - addPattern(path.get("id"), bindings); - - } else if (ScopeType.check(node)) { - if (namedTypes.CatchClause.check(node)) { - var catchParamName = node.param.name; - var hadBinding = hasOwn.call(bindings, catchParamName); - - // Any declarations that occur inside the catch body that do - // not have the same name as the catch parameter should count - // as bindings in the outer scope. - recursiveScanScope(path.get("body"), bindings); - - // If a new binding matching the catch parameter name was - // created while scanning the catch body, ignore it because it - // actually refers to the catch parameter and not the outer - // scope that we're currently scanning. - if (!hadBinding) { - delete bindings[catchParamName]; - } - } - - } else { - recursiveScanScope(path, bindings); - } -} - -function addPattern(patternPath, bindings) { - var pattern = patternPath.value; - namedTypes.Pattern.assert(pattern); - - if (namedTypes.Identifier.check(pattern)) { - if (hasOwn.call(bindings, pattern.name)) { - bindings[pattern.name].push(patternPath); - } else { - bindings[pattern.name] = [patternPath]; - } - - } else if (namedTypes.ObjectPattern && - namedTypes.ObjectPattern.check(pattern)) { - patternPath.get('properties').each(function(propertyPath) { - var property = propertyPath.value; - if (namedTypes.Pattern.check(property)) { - addPattern(propertyPath, bindings); - } else if (namedTypes.Property.check(property)) { - addPattern(propertyPath.get('value'), bindings); - } else if (namedTypes.SpreadProperty && - namedTypes.SpreadProperty.check(property)) { - addPattern(propertyPath.get('argument'), bindings); - } - }); - - } else if (namedTypes.ArrayPattern && - namedTypes.ArrayPattern.check(pattern)) { - patternPath.get('elements').each(function(elementPath) { - var element = elementPath.value; - if (namedTypes.Pattern.check(element)) { - addPattern(elementPath, bindings); - } else if (namedTypes.SpreadElement && - namedTypes.SpreadElement.check(element)) { - addPattern(elementPath.get("argument"), bindings); - } - }); - - } else if (namedTypes.PropertyPattern && - namedTypes.PropertyPattern.check(pattern)) { - addPattern(patternPath.get('pattern'), bindings); - - } else if ((namedTypes.SpreadElementPattern && - namedTypes.SpreadElementPattern.check(pattern)) || - (namedTypes.SpreadPropertyPattern && - namedTypes.SpreadPropertyPattern.check(pattern))) { - addPattern(patternPath.get('argument'), bindings); - } -} - -Sp.lookup = function(name) { - for (var scope = this; scope; scope = scope.parent) - if (scope.declares(name)) - break; - return scope; -}; - -Sp.getGlobalScope = function() { - var scope = this; - while (!scope.isGlobal) - scope = scope.parent; - return scope; -}; - -module.exports = Scope; - -},{"578":578,"583":583}],582:[function(_dereq_,module,exports){ -var types = _dereq_(583); -var Type = types.Type; -var builtin = types.builtInTypes; -var isNumber = builtin.number; - -// An example of constructing a new type with arbitrary constraints from -// an existing type. -exports.geq = function(than) { - return new Type(function(value) { - return isNumber.check(value) && value >= than; - }, isNumber + " >= " + than); -}; - -// Default value-returning functions that may optionally be passed as a -// third argument to Def.prototype.field. -exports.defaults = { - // Functions were used because (among other reasons) that's the most - // elegant way to allow for the emptyArray one always to give a new - // array instance. - "null": function() { return null }, - "emptyArray": function() { return [] }, - "false": function() { return false }, - "true": function() { return true }, - "undefined": function() {} -}; - -var naiveIsPrimitive = Type.or( - builtin.string, - builtin.number, - builtin.boolean, - builtin.null, - builtin.undefined -); - -exports.isPrimitive = new Type(function(value) { - if (value === null) - return true; - var type = typeof value; - return !(type === "object" || - type === "function"); -}, naiveIsPrimitive.toString()); - -},{"583":583}],583:[function(_dereq_,module,exports){ -var Ap = Array.prototype; -var slice = Ap.slice; -var map = Ap.map; -var each = Ap.forEach; -var Op = Object.prototype; -var objToStr = Op.toString; -var funObjStr = objToStr.call(function(){}); -var strObjStr = objToStr.call(""); -var hasOwn = Op.hasOwnProperty; - -// A type is an object with a .check method that takes a value and returns -// true or false according to whether the value matches the type. - -function Type(check, name) { - var self = this; - if (!(self instanceof Type)) { - throw new Error("Type constructor cannot be invoked without 'new'"); - } - - // Unfortunately we can't elegantly reuse isFunction and isString, - // here, because this code is executed while defining those types. - if (objToStr.call(check) !== funObjStr) { - throw new Error(check + " is not a function"); - } - - // The `name` parameter can be either a function or a string. - var nameObjStr = objToStr.call(name); - if (!(nameObjStr === funObjStr || - nameObjStr === strObjStr)) { - throw new Error(name + " is neither a function nor a string"); - } - - Object.defineProperties(self, { - name: { value: name }, - check: { - value: function(value, deep) { - var result = check.call(self, value, deep); - if (!result && deep && objToStr.call(deep) === funObjStr) - deep(self, value); - return result; - } - } - }); -} - -var Tp = Type.prototype; - -// Throughout this file we use Object.defineProperty to prevent -// redefinition of exported properties. -exports.Type = Type; - -// Like .check, except that failure triggers an AssertionError. -Tp.assert = function(value, deep) { - if (!this.check(value, deep)) { - var str = shallowStringify(value); - throw new Error(str + " does not match type " + this); - } - return true; -}; - -function shallowStringify(value) { - if (isObject.check(value)) - return "{" + Object.keys(value).map(function(key) { - return key + ": " + value[key]; - }).join(", ") + "}"; - - if (isArray.check(value)) - return "[" + value.map(shallowStringify).join(", ") + "]"; - - return JSON.stringify(value); -} - -Tp.toString = function() { - var name = this.name; - - if (isString.check(name)) - return name; - - if (isFunction.check(name)) - return name.call(this) + ""; - - return name + " type"; -}; - -var builtInCtorFns = []; -var builtInCtorTypes = []; -var builtInTypes = {}; -exports.builtInTypes = builtInTypes; - -function defBuiltInType(example, name) { - var objStr = objToStr.call(example); - - var type = new Type(function(value) { - return objToStr.call(value) === objStr; - }, name); - - builtInTypes[name] = type; - - if (example && typeof example.constructor === "function") { - builtInCtorFns.push(example.constructor); - builtInCtorTypes.push(type); - } - - return type; -} - -// These types check the underlying [[Class]] attribute of the given -// value, rather than using the problematic typeof operator. Note however -// that no subtyping is considered; so, for instance, isObject.check -// returns false for [], /./, new Date, and null. -var isString = defBuiltInType("truthy", "string"); -var isFunction = defBuiltInType(function(){}, "function"); -var isArray = defBuiltInType([], "array"); -var isObject = defBuiltInType({}, "object"); -var isRegExp = defBuiltInType(/./, "RegExp"); -var isDate = defBuiltInType(new Date, "Date"); -var isNumber = defBuiltInType(3, "number"); -var isBoolean = defBuiltInType(true, "boolean"); -var isNull = defBuiltInType(null, "null"); -var isUndefined = defBuiltInType(void 0, "undefined"); - -// There are a number of idiomatic ways of expressing types, so this -// function serves to coerce them all to actual Type objects. Note that -// providing the name argument is not necessary in most cases. -function toType(from, name) { - // The toType function should of course be idempotent. - if (from instanceof Type) - return from; - - // The Def type is used as a helper for constructing compound - // interface types for AST nodes. - if (from instanceof Def) - return from.type; - - // Support [ElemType] syntax. - if (isArray.check(from)) - return Type.fromArray(from); - - // Support { someField: FieldType, ... } syntax. - if (isObject.check(from)) - return Type.fromObject(from); - - if (isFunction.check(from)) { - var bicfIndex = builtInCtorFns.indexOf(from); - if (bicfIndex >= 0) { - return builtInCtorTypes[bicfIndex]; - } - - // If isFunction.check(from), and from is not a built-in - // constructor, assume from is a binary predicate function we can - // use to define the type. - return new Type(from, name); - } - - // As a last resort, toType returns a type that matches any value that - // is === from. This is primarily useful for literal values like - // toType(null), but it has the additional advantage of allowing - // toType to be a total function. - return new Type(function(value) { - return value === from; - }, isUndefined.check(name) ? function() { - return from + ""; - } : name); -} - -// Returns a type that matches the given value iff any of type1, type2, -// etc. match the value. -Type.or = function(/* type1, type2, ... */) { - var types = []; - var len = arguments.length; - for (var i = 0; i < len; ++i) - types.push(toType(arguments[i])); - - return new Type(function(value, deep) { - for (var i = 0; i < len; ++i) - if (types[i].check(value, deep)) - return true; - return false; - }, function() { - return types.join(" | "); - }); -}; - -Type.fromArray = function(arr) { - if (!isArray.check(arr)) { - throw new Error(""); - } - if (arr.length !== 1) { - throw new Error("only one element type is permitted for typed arrays"); - } - return toType(arr[0]).arrayOf(); -}; - -Tp.arrayOf = function() { - var elemType = this; - return new Type(function(value, deep) { - return isArray.check(value) && value.every(function(elem) { - return elemType.check(elem, deep); - }); - }, function() { - return "[" + elemType + "]"; - }); -}; - -Type.fromObject = function(obj) { - var fields = Object.keys(obj).map(function(name) { - return new Field(name, obj[name]); - }); - - return new Type(function(value, deep) { - return isObject.check(value) && fields.every(function(field) { - return field.type.check(value[field.name], deep); - }); - }, function() { - return "{ " + fields.join(", ") + " }"; - }); -}; - -function Field(name, type, defaultFn, hidden) { - var self = this; - - if (!(self instanceof Field)) { - throw new Error("Field constructor cannot be invoked without 'new'"); - } - isString.assert(name); - - type = toType(type); - - var properties = { - name: { value: name }, - type: { value: type }, - hidden: { value: !!hidden } - }; - - if (isFunction.check(defaultFn)) { - properties.defaultFn = { value: defaultFn }; - } - - Object.defineProperties(self, properties); -} - -var Fp = Field.prototype; - -Fp.toString = function() { - return JSON.stringify(this.name) + ": " + this.type; -}; - -Fp.getValue = function(obj) { - var value = obj[this.name]; - - if (!isUndefined.check(value)) - return value; - - if (this.defaultFn) - value = this.defaultFn.call(obj); - - return value; -}; - -// Define a type whose name is registered in a namespace (the defCache) so -// that future definitions will return the same type given the same name. -// In particular, this system allows for circular and forward definitions. -// The Def object d returned from Type.def may be used to configure the -// type d.type by calling methods such as d.bases, d.build, and d.field. -Type.def = function(typeName) { - isString.assert(typeName); - return hasOwn.call(defCache, typeName) - ? defCache[typeName] - : defCache[typeName] = new Def(typeName); -}; - -// In order to return the same Def instance every time Type.def is called -// with a particular name, those instances need to be stored in a cache. -var defCache = Object.create(null); - -function Def(typeName) { - var self = this; - if (!(self instanceof Def)) { - throw new Error("Def constructor cannot be invoked without 'new'"); - } - - Object.defineProperties(self, { - typeName: { value: typeName }, - baseNames: { value: [] }, - ownFields: { value: Object.create(null) }, - - // These two are populated during finalization. - allSupertypes: { value: Object.create(null) }, // Includes own typeName. - supertypeList: { value: [] }, // Linear inheritance hierarchy. - allFields: { value: Object.create(null) }, // Includes inherited fields. - fieldNames: { value: [] }, // Non-hidden keys of allFields. - - type: { - value: new Type(function(value, deep) { - return self.check(value, deep); - }, typeName) - } - }); -} - -Def.fromValue = function(value) { - if (value && typeof value === "object") { - var type = value.type; - if (typeof type === "string" && - hasOwn.call(defCache, type)) { - var d = defCache[type]; - if (d.finalized) { - return d; - } - } - } - - return null; -}; - -var Dp = Def.prototype; - -Dp.isSupertypeOf = function(that) { - if (that instanceof Def) { - if (this.finalized !== true || - that.finalized !== true) { - throw new Error(""); - } - return hasOwn.call(that.allSupertypes, this.typeName); - } else { - throw new Error(that + " is not a Def"); - } -}; - -// Note that the list returned by this function is a copy of the internal -// supertypeList, *without* the typeName itself as the first element. -exports.getSupertypeNames = function(typeName) { - if (!hasOwn.call(defCache, typeName)) { - throw new Error(""); - } - var d = defCache[typeName]; - if (d.finalized !== true) { - throw new Error(""); - } - return d.supertypeList.slice(1); -}; - -// Returns an object mapping from every known type in the defCache to the -// most specific supertype whose name is an own property of the candidates -// object. -exports.computeSupertypeLookupTable = function(candidates) { - var table = {}; - var typeNames = Object.keys(defCache); - var typeNameCount = typeNames.length; - - for (var i = 0; i < typeNameCount; ++i) { - var typeName = typeNames[i]; - var d = defCache[typeName]; - if (d.finalized !== true) { - throw new Error("" + typeName); - } - for (var j = 0; j < d.supertypeList.length; ++j) { - var superTypeName = d.supertypeList[j]; - if (hasOwn.call(candidates, superTypeName)) { - table[typeName] = superTypeName; - break; - } - } - } - - return table; -}; - -Dp.checkAllFields = function(value, deep) { - var allFields = this.allFields; - if (this.finalized !== true) { - throw new Error("" + this.typeName); - } - - function checkFieldByName(name) { - var field = allFields[name]; - var type = field.type; - var child = field.getValue(value); - return type.check(child, deep); - } - - return isObject.check(value) - && Object.keys(allFields).every(checkFieldByName); -}; - -Dp.check = function(value, deep) { - if (this.finalized !== true) { - throw new Error( - "prematurely checking unfinalized type " + this.typeName - ); - } - - // A Def type can only match an object value. - if (!isObject.check(value)) - return false; - - var vDef = Def.fromValue(value); - if (!vDef) { - // If we couldn't infer the Def associated with the given value, - // and we expected it to be a SourceLocation or a Position, it was - // probably just missing a "type" field (because Esprima does not - // assign a type property to such nodes). Be optimistic and let - // this.checkAllFields make the final decision. - if (this.typeName === "SourceLocation" || - this.typeName === "Position") { - return this.checkAllFields(value, deep); - } - - // Calling this.checkAllFields for any other type of node is both - // bad for performance and way too forgiving. - return false; - } - - // If checking deeply and vDef === this, then we only need to call - // checkAllFields once. Calling checkAllFields is too strict when deep - // is false, because then we only care about this.isSupertypeOf(vDef). - if (deep && vDef === this) - return this.checkAllFields(value, deep); - - // In most cases we rely exclusively on isSupertypeOf to make O(1) - // subtyping determinations. This suffices in most situations outside - // of unit tests, since interface conformance is checked whenever new - // instances are created using builder functions. - if (!this.isSupertypeOf(vDef)) - return false; - - // The exception is when deep is true; then, we recursively check all - // fields. - if (!deep) - return true; - - // Use the more specific Def (vDef) to perform the deep check, but - // shallow-check fields defined by the less specific Def (this). - return vDef.checkAllFields(value, deep) - && this.checkAllFields(value, false); -}; - -Dp.bases = function() { - var args = slice.call(arguments); - var bases = this.baseNames; - - if (this.finalized) { - if (args.length !== bases.length) { - throw new Error(""); - } - for (var i = 0; i < args.length; i++) { - if (args[i] !== bases[i]) { - throw new Error(""); - } - } - return this; - } - - args.forEach(function(baseName) { - isString.assert(baseName); - - // This indexOf lookup may be O(n), but the typical number of base - // names is very small, and indexOf is a native Array method. - if (bases.indexOf(baseName) < 0) - bases.push(baseName); - }); - - return this; // For chaining. -}; - -// False by default until .build(...) is called on an instance. -Object.defineProperty(Dp, "buildable", { value: false }); - -var builders = {}; -exports.builders = builders; - -// This object is used as prototype for any node created by a builder. -var nodePrototype = {}; - -// Call this function to define a new method to be shared by all AST -// nodes. The replaced method (if any) is returned for easy wrapping. -exports.defineMethod = function(name, func) { - var old = nodePrototype[name]; - - // Pass undefined as func to delete nodePrototype[name]. - if (isUndefined.check(func)) { - delete nodePrototype[name]; - - } else { - isFunction.assert(func); - - Object.defineProperty(nodePrototype, name, { - enumerable: true, // For discoverability. - configurable: true, // For delete proto[name]. - value: func - }); - } - - return old; -}; - -var isArrayOfString = isString.arrayOf(); - -// Calling the .build method of a Def simultaneously marks the type as -// buildable (by defining builders[getBuilderName(typeName)]) and -// specifies the order of arguments that should be passed to the builder -// function to create an instance of the type. -Dp.build = function(/* param1, param2, ... */) { - var self = this; - - var newBuildParams = slice.call(arguments); - isArrayOfString.assert(newBuildParams); - - // Calling Def.prototype.build multiple times has the effect of merely - // redefining this property. - Object.defineProperty(self, "buildParams", { - value: newBuildParams, - writable: false, - enumerable: false, - configurable: true - }); - - if (self.buildable) { - // If this Def is already buildable, update self.buildParams and - // continue using the old builder function. - return self; - } - - // Every buildable type will have its "type" field filled in - // automatically. This includes types that are not subtypes of Node, - // like SourceLocation, but that seems harmless (TODO?). - self.field("type", String, function() { return self.typeName }); - - // Override Dp.buildable for this Def instance. - Object.defineProperty(self, "buildable", { value: true }); - - Object.defineProperty(builders, getBuilderName(self.typeName), { - enumerable: true, - - value: function() { - var args = arguments; - var argc = args.length; - var built = Object.create(nodePrototype); - - if (!self.finalized) { - throw new Error( - "attempting to instantiate unfinalized type " + - self.typeName - ); - } - - function add(param, i) { - if (hasOwn.call(built, param)) - return; - - var all = self.allFields; - if (!hasOwn.call(all, param)) { - throw new Error("" + param); - } - - var field = all[param]; - var type = field.type; - var value; - - if (isNumber.check(i) && i < argc) { - value = args[i]; - } else if (field.defaultFn) { - // Expose the partially-built object to the default - // function as its `this` object. - value = field.defaultFn.call(built); - } else { - var message = "no value or default function given for field " + - JSON.stringify(param) + " of " + self.typeName + "(" + - self.buildParams.map(function(name) { - return all[name]; - }).join(", ") + ")"; - throw new Error(message); - } - - if (!type.check(value)) { - throw new Error( - shallowStringify(value) + - " does not match field " + field + - " of type " + self.typeName - ); - } - - // TODO Could attach getters and setters here to enforce - // dynamic type safety. - built[param] = value; - } - - self.buildParams.forEach(function(param, i) { - add(param, i); - }); - - Object.keys(self.allFields).forEach(function(param) { - add(param); // Use the default value. - }); - - // Make sure that the "type" field was filled automatically. - if (built.type !== self.typeName) { - throw new Error(""); - } - - return built; - } - }); - - return self; // For chaining. -}; - -function getBuilderName(typeName) { - return typeName.replace(/^[A-Z]+/, function(upperCasePrefix) { - var len = upperCasePrefix.length; - switch (len) { - case 0: return ""; - // If there's only one initial capital letter, just lower-case it. - case 1: return upperCasePrefix.toLowerCase(); - default: - // If there's more than one initial capital letter, lower-case - // all but the last one, so that XMLDefaultDeclaration (for - // example) becomes xmlDefaultDeclaration. - return upperCasePrefix.slice( - 0, len - 1).toLowerCase() + - upperCasePrefix.charAt(len - 1); - } - }); -} -exports.getBuilderName = getBuilderName; - -function getStatementBuilderName(typeName) { - typeName = getBuilderName(typeName); - return typeName.replace(/(Expression)?$/, "Statement"); -} -exports.getStatementBuilderName = getStatementBuilderName; - -// The reason fields are specified using .field(...) instead of an object -// literal syntax is somewhat subtle: the object literal syntax would -// support only one key and one value, but with .field(...) we can pass -// any number of arguments to specify the field. -Dp.field = function(name, type, defaultFn, hidden) { - if (this.finalized) { - console.error("Ignoring attempt to redefine field " + - JSON.stringify(name) + " of finalized type " + - JSON.stringify(this.typeName)); - return this; - } - this.ownFields[name] = new Field(name, type, defaultFn, hidden); - return this; // For chaining. -}; - -var namedTypes = {}; -exports.namedTypes = namedTypes; - -// Like Object.keys, but aware of what fields each AST type should have. -function getFieldNames(object) { - var d = Def.fromValue(object); - if (d) { - return d.fieldNames.slice(0); - } - - if ("type" in object) { - throw new Error( - "did not recognize object of type " + - JSON.stringify(object.type) - ); - } - - return Object.keys(object); -} -exports.getFieldNames = getFieldNames; - -// Get the value of an object property, taking object.type and default -// functions into account. -function getFieldValue(object, fieldName) { - var d = Def.fromValue(object); - if (d) { - var field = d.allFields[fieldName]; - if (field) { - return field.getValue(object); - } - } - - return object[fieldName]; -} -exports.getFieldValue = getFieldValue; - -// Iterate over all defined fields of an object, including those missing -// or undefined, passing each field name and effective value (as returned -// by getFieldValue) to the callback. If the object has no corresponding -// Def, the callback will never be called. -exports.eachField = function(object, callback, context) { - getFieldNames(object).forEach(function(name) { - callback.call(this, name, getFieldValue(object, name)); - }, context); -}; - -// Similar to eachField, except that iteration stops as soon as the -// callback returns a truthy value. Like Array.prototype.some, the final -// result is either true or false to indicates whether the callback -// returned true for any element or not. -exports.someField = function(object, callback, context) { - return getFieldNames(object).some(function(name) { - return callback.call(this, name, getFieldValue(object, name)); - }, context); -}; - -// This property will be overridden as true by individual Def instances -// when they are finalized. -Object.defineProperty(Dp, "finalized", { value: false }); - -Dp.finalize = function() { - var self = this; - - // It's not an error to finalize a type more than once, but only the - // first call to .finalize does anything. - if (!self.finalized) { - var allFields = self.allFields; - var allSupertypes = self.allSupertypes; - - self.baseNames.forEach(function(name) { - var def = defCache[name]; - if (def instanceof Def) { - def.finalize(); - extend(allFields, def.allFields); - extend(allSupertypes, def.allSupertypes); - } else { - var message = "unknown supertype name " + - JSON.stringify(name) + - " for subtype " + - JSON.stringify(self.typeName); - throw new Error(message); - } - }); - - // TODO Warn if fields are overridden with incompatible types. - extend(allFields, self.ownFields); - allSupertypes[self.typeName] = self; - - self.fieldNames.length = 0; - for (var fieldName in allFields) { - if (hasOwn.call(allFields, fieldName) && - !allFields[fieldName].hidden) { - self.fieldNames.push(fieldName); - } - } - - // Types are exported only once they have been finalized. - Object.defineProperty(namedTypes, self.typeName, { - enumerable: true, - value: self.type - }); - - Object.defineProperty(self, "finalized", { value: true }); - - // A linearization of the inheritance hierarchy. - populateSupertypeList(self.typeName, self.supertypeList); - - if (self.buildable && self.supertypeList.lastIndexOf("Expression") >= 0) { - wrapExpressionBuilderWithStatement(self.typeName); - } - } -}; - -// Adds an additional builder for Expression subtypes -// that wraps the built Expression in an ExpressionStatements. -function wrapExpressionBuilderWithStatement(typeName) { - var wrapperName = getStatementBuilderName(typeName); - - // skip if the builder already exists - if (builders[wrapperName]) return; - - // the builder function to wrap with builders.ExpressionStatement - var wrapped = builders[getBuilderName(typeName)]; - - // skip if there is nothing to wrap - if (!wrapped) return; - - builders[wrapperName] = function() { - return builders.expressionStatement(wrapped.apply(builders, arguments)); - }; -} - -function populateSupertypeList(typeName, list) { - list.length = 0; - list.push(typeName); - - var lastSeen = Object.create(null); - - for (var pos = 0; pos < list.length; ++pos) { - typeName = list[pos]; - var d = defCache[typeName]; - if (d.finalized !== true) { - throw new Error(""); - } - - // If we saw typeName earlier in the breadth-first traversal, - // delete the last-seen occurrence. - if (hasOwn.call(lastSeen, typeName)) { - delete list[lastSeen[typeName]]; - } - - // Record the new index of the last-seen occurrence of typeName. - lastSeen[typeName] = pos; - - // Enqueue the base names of this type. - list.push.apply(list, d.baseNames); - } - - // Compaction loop to remove array holes. - for (var to = 0, from = to, len = list.length; from < len; ++from) { - if (hasOwn.call(list, from)) { - list[to++] = list[from]; - } - } - - list.length = to; -} - -function extend(into, from) { - Object.keys(from).forEach(function(name) { - into[name] = from[name]; - }); - - return into; -}; - -exports.finalize = function() { - Object.keys(defCache).forEach(function(name) { - defCache[name].finalize(); - }); -}; - -},{}],584:[function(_dereq_,module,exports){ -var types = _dereq_(583); - -// This core module of AST types captures ES5 as it is parsed today by -// git://github.com/ariya/esprima.git#master. -_dereq_(570); - -// Feel free to add to or remove from this list of extension modules to -// configure the precise type hierarchy that you need. -_dereq_(572); -_dereq_(573); -_dereq_(576); -_dereq_(571); -_dereq_(575); -_dereq_(574); -_dereq_(569); - -types.finalize(); - -exports.Type = types.Type; -exports.builtInTypes = types.builtInTypes; -exports.namedTypes = types.namedTypes; -exports.builders = types.builders; -exports.defineMethod = types.defineMethod; -exports.getFieldNames = types.getFieldNames; -exports.getFieldValue = types.getFieldValue; -exports.eachField = types.eachField; -exports.someField = types.someField; -exports.getSupertypeNames = types.getSupertypeNames; -exports.astNodesAreEquivalent = _dereq_(577); -exports.finalize = types.finalize; -exports.NodePath = _dereq_(578); -exports.PathVisitor = _dereq_(579); -exports.visit = exports.PathVisitor.visit; - -},{"569":569,"570":570,"571":571,"572":572,"573":573,"574":574,"575":575,"576":576,"577":577,"578":578,"579":579,"583":583}],585:[function(_dereq_,module,exports){ -(function (process,global){ -/** - * Copyright (c) 2014, Facebook, Inc. - * All rights reserved. - * - * This source code is licensed under the BSD-style license found in the - * https://raw.github.com/facebook/regenerator/master/LICENSE file. An - * additional grant of patent rights can be found in the PATENTS file in - * the same directory. - */ - -!(function(global) { - "use strict"; - - var hasOwn = Object.prototype.hasOwnProperty; - var undefined; // More compressible than void 0. - var iteratorSymbol = - typeof Symbol === "function" && Symbol.iterator || "@@iterator"; - - var inModule = typeof module === "object"; - var runtime = global.regeneratorRuntime; - if (runtime) { - if (inModule) { - // If regeneratorRuntime is defined globally and we're in a module, - // make the exports object identical to regeneratorRuntime. - module.exports = runtime; - } - // Don't bother evaluating the rest of this file if the runtime was - // already defined globally. - return; - } - - // Define the runtime globally (as expected by generated code) as either - // module.exports (if we're in a module) or a new, empty object. - runtime = global.regeneratorRuntime = inModule ? module.exports : {}; - - function wrap(innerFn, outerFn, self, tryLocsList) { - // If outerFn provided, then outerFn.prototype instanceof Generator. - var generator = Object.create((outerFn || Generator).prototype); - var context = new Context(tryLocsList || []); - - // The ._invoke method unifies the implementations of the .next, - // .throw, and .return methods. - generator._invoke = makeInvokeMethod(innerFn, self, context); - - return generator; - } - runtime.wrap = wrap; - - // Try/catch helper to minimize deoptimizations. Returns a completion - // record like context.tryEntries[i].completion. This interface could - // have been (and was previously) designed to take a closure to be - // invoked without arguments, but in all the cases we care about we - // already have an existing method we want to call, so there's no need - // to create a new function object. We can even get away with assuming - // the method takes exactly one argument, since that happens to be true - // in every case, so we don't have to touch the arguments object. The - // only additional allocation required is the completion record, which - // has a stable shape and so hopefully should be cheap to allocate. - function tryCatch(fn, obj, arg) { - try { - return { type: "normal", arg: fn.call(obj, arg) }; - } catch (err) { - return { type: "throw", arg: err }; - } - } - - var GenStateSuspendedStart = "suspendedStart"; - var GenStateSuspendedYield = "suspendedYield"; - var GenStateExecuting = "executing"; - var GenStateCompleted = "completed"; - - // Returning this object from the innerFn has the same effect as - // breaking out of the dispatch switch statement. - var ContinueSentinel = {}; - - // Dummy constructor functions that we use as the .constructor and - // .constructor.prototype properties for functions that return Generator - // objects. For full spec compliance, you may wish to configure your - // minifier not to mangle the names of these two functions. - function Generator() {} - function GeneratorFunction() {} - function GeneratorFunctionPrototype() {} - - var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype; - GeneratorFunction.prototype = Gp.constructor = GeneratorFunctionPrototype; - GeneratorFunctionPrototype.constructor = GeneratorFunction; - GeneratorFunction.displayName = "GeneratorFunction"; - - // Helper for defining the .next, .throw, and .return methods of the - // Iterator interface in terms of a single ._invoke method. - function defineIteratorMethods(prototype) { - ["next", "throw", "return"].forEach(function(method) { - prototype[method] = function(arg) { - return this._invoke(method, arg); - }; - }); - } - - runtime.isGeneratorFunction = function(genFun) { - var ctor = typeof genFun === "function" && genFun.constructor; - return ctor - ? ctor === GeneratorFunction || - // For the native GeneratorFunction constructor, the best we can - // do is to check its .name property. - (ctor.displayName || ctor.name) === "GeneratorFunction" - : false; - }; - - runtime.mark = function(genFun) { - if (Object.setPrototypeOf) { - Object.setPrototypeOf(genFun, GeneratorFunctionPrototype); - } else { - genFun.__proto__ = GeneratorFunctionPrototype; - } - genFun.prototype = Object.create(Gp); - return genFun; - }; - - // Within the body of any async function, `await x` is transformed to - // `yield regeneratorRuntime.awrap(x)`, so that the runtime can test - // `value instanceof AwaitArgument` to determine if the yielded value is - // meant to be awaited. Some may consider the name of this method too - // cutesy, but they are curmudgeons. - runtime.awrap = function(arg) { - return new AwaitArgument(arg); - }; - - function AwaitArgument(arg) { - this.arg = arg; - } - - function AsyncIterator(generator) { - // This invoke function is written in a style that assumes some - // calling function (or Promise) will handle exceptions. - function invoke(method, arg) { - var result = generator[method](arg); - var value = result.value; - return value instanceof AwaitArgument - ? Promise.resolve(value.arg).then(invokeNext, invokeThrow) - : Promise.resolve(value).then(function(unwrapped) { - // When a yielded Promise is resolved, its final value becomes - // the .value of the Promise<{value,done}> result for the - // current iteration. If the Promise is rejected, however, the - // result for this iteration will be rejected with the same - // reason. Note that rejections of yielded Promises are not - // thrown back into the generator function, as is the case - // when an awaited Promise is rejected. This difference in - // behavior between yield and await is important, because it - // allows the consumer to decide what to do with the yielded - // rejection (swallow it and continue, manually .throw it back - // into the generator, abandon iteration, whatever). With - // await, by contrast, there is no opportunity to examine the - // rejection reason outside the generator function, so the - // only option is to throw it from the await expression, and - // let the generator function handle the exception. - result.value = unwrapped; - return result; - }); - } - - if (typeof process === "object" && process.domain) { - invoke = process.domain.bind(invoke); - } - - var invokeNext = invoke.bind(generator, "next"); - var invokeThrow = invoke.bind(generator, "throw"); - var invokeReturn = invoke.bind(generator, "return"); - var previousPromise; - - function enqueue(method, arg) { - function callInvokeWithMethodAndArg() { - return invoke(method, arg); - } - - return previousPromise = - // If enqueue has been called before, then we want to wait until - // all previous Promises have been resolved before calling invoke, - // so that results are always delivered in the correct order. If - // enqueue has not been called before, then it is important to - // call invoke immediately, without waiting on a callback to fire, - // so that the async generator function has the opportunity to do - // any necessary setup in a predictable way. This predictability - // is why the Promise constructor synchronously invokes its - // executor callback, and why async functions synchronously - // execute code before the first await. Since we implement simple - // async functions in terms of async generators, it is especially - // important to get this right, even though it requires care. - previousPromise ? previousPromise.then( - callInvokeWithMethodAndArg, - // Avoid propagating failures to Promises returned by later - // invocations of the iterator. - callInvokeWithMethodAndArg - ) : new Promise(function (resolve) { - resolve(callInvokeWithMethodAndArg()); - }); - } - - // Define the unified helper method that is used to implement .next, - // .throw, and .return (see defineIteratorMethods). - this._invoke = enqueue; - } - - defineIteratorMethods(AsyncIterator.prototype); - - // Note that simple async functions are implemented on top of - // AsyncIterator objects; they just return a Promise for the value of - // the final result produced by the iterator. - runtime.async = function(innerFn, outerFn, self, tryLocsList) { - var iter = new AsyncIterator( - wrap(innerFn, outerFn, self, tryLocsList) - ); - - return runtime.isGeneratorFunction(outerFn) - ? iter // If outerFn is a generator, return the full iterator. - : iter.next().then(function(result) { - return result.done ? result.value : iter.next(); - }); - }; - - function makeInvokeMethod(innerFn, self, context) { - var state = GenStateSuspendedStart; - - return function invoke(method, arg) { - if (state === GenStateExecuting) { - throw new Error("Generator is already running"); - } - - if (state === GenStateCompleted) { - if (method === "throw") { - throw arg; - } - - // Be forgiving, per 25.3.3.3.3 of the spec: - // https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume - return doneResult(); - } - - while (true) { - var delegate = context.delegate; - if (delegate) { - if (method === "return" || - (method === "throw" && delegate.iterator[method] === undefined)) { - // A return or throw (when the delegate iterator has no throw - // method) always terminates the yield* loop. - context.delegate = null; - - // If the delegate iterator has a return method, give it a - // chance to clean up. - var returnMethod = delegate.iterator["return"]; - if (returnMethod) { - var record = tryCatch(returnMethod, delegate.iterator, arg); - if (record.type === "throw") { - // If the return method threw an exception, let that - // exception prevail over the original return or throw. - method = "throw"; - arg = record.arg; - continue; - } - } - - if (method === "return") { - // Continue with the outer return, now that the delegate - // iterator has been terminated. - continue; - } - } - - var record = tryCatch( - delegate.iterator[method], - delegate.iterator, - arg - ); - - if (record.type === "throw") { - context.delegate = null; - - // Like returning generator.throw(uncaught), but without the - // overhead of an extra function call. - method = "throw"; - arg = record.arg; - continue; - } - - // Delegate generator ran and handled its own exceptions so - // regardless of what the method was, we continue as if it is - // "next" with an undefined arg. - method = "next"; - arg = undefined; - - var info = record.arg; - if (info.done) { - context[delegate.resultName] = info.value; - context.next = delegate.nextLoc; - } else { - state = GenStateSuspendedYield; - return info; - } - - context.delegate = null; - } - - if (method === "next") { - if (state === GenStateSuspendedYield) { - context.sent = arg; - } else { - context.sent = undefined; - } - - } else if (method === "throw") { - if (state === GenStateSuspendedStart) { - state = GenStateCompleted; - throw arg; - } - - if (context.dispatchException(arg)) { - // If the dispatched exception was caught by a catch block, - // then let that catch block handle the exception normally. - method = "next"; - arg = undefined; - } - - } else if (method === "return") { - context.abrupt("return", arg); - } - - state = GenStateExecuting; - - var record = tryCatch(innerFn, self, context); - if (record.type === "normal") { - // If an exception is thrown from innerFn, we leave state === - // GenStateExecuting and loop back for another invocation. - state = context.done - ? GenStateCompleted - : GenStateSuspendedYield; - - var info = { - value: record.arg, - done: context.done - }; - - if (record.arg === ContinueSentinel) { - if (context.delegate && method === "next") { - // Deliberately forget the last sent value so that we don't - // accidentally pass it on to the delegate. - arg = undefined; - } - } else { - return info; - } - - } else if (record.type === "throw") { - state = GenStateCompleted; - // Dispatch the exception by looping back around to the - // context.dispatchException(arg) call above. - method = "throw"; - arg = record.arg; - } - } - }; - } - - // Define Generator.prototype.{next,throw,return} in terms of the - // unified ._invoke helper method. - defineIteratorMethods(Gp); - - Gp[iteratorSymbol] = function() { - return this; - }; - - Gp.toString = function() { - return "[object Generator]"; - }; - - function pushTryEntry(locs) { - var entry = { tryLoc: locs[0] }; - - if (1 in locs) { - entry.catchLoc = locs[1]; - } - - if (2 in locs) { - entry.finallyLoc = locs[2]; - entry.afterLoc = locs[3]; - } - - this.tryEntries.push(entry); - } - - function resetTryEntry(entry) { - var record = entry.completion || {}; - record.type = "normal"; - delete record.arg; - entry.completion = record; - } - - function Context(tryLocsList) { - // The root entry object (effectively a try statement without a catch - // or a finally block) gives us a place to store values thrown from - // locations where there is no enclosing try statement. - this.tryEntries = [{ tryLoc: "root" }]; - tryLocsList.forEach(pushTryEntry, this); - this.reset(true); - } - - runtime.keys = function(object) { - var keys = []; - for (var key in object) { - keys.push(key); - } - keys.reverse(); - - // Rather than returning an object with a next method, we keep - // things simple and return the next function itself. - return function next() { - while (keys.length) { - var key = keys.pop(); - if (key in object) { - next.value = key; - next.done = false; - return next; - } - } - - // To avoid creating an additional object, we just hang the .value - // and .done properties off the next function object itself. This - // also ensures that the minifier will not anonymize the function. - next.done = true; - return next; - }; - }; - - function values(iterable) { - if (iterable) { - var iteratorMethod = iterable[iteratorSymbol]; - if (iteratorMethod) { - return iteratorMethod.call(iterable); - } - - if (typeof iterable.next === "function") { - return iterable; - } - - if (!isNaN(iterable.length)) { - var i = -1, next = function next() { - while (++i < iterable.length) { - if (hasOwn.call(iterable, i)) { - next.value = iterable[i]; - next.done = false; - return next; - } - } - - next.value = undefined; - next.done = true; - - return next; - }; - - return next.next = next; - } - } - - // Return an iterator with no values. - return { next: doneResult }; - } - runtime.values = values; - - function doneResult() { - return { value: undefined, done: true }; - } - - Context.prototype = { - constructor: Context, - - reset: function(skipTempReset) { - this.prev = 0; - this.next = 0; - this.sent = undefined; - this.done = false; - this.delegate = null; - - this.tryEntries.forEach(resetTryEntry); - - if (!skipTempReset) { - for (var name in this) { - // Not sure about the optimal order of these conditions: - if (name.charAt(0) === "t" && - hasOwn.call(this, name) && - !isNaN(+name.slice(1))) { - this[name] = undefined; - } - } - } - }, - - stop: function() { - this.done = true; - - var rootEntry = this.tryEntries[0]; - var rootRecord = rootEntry.completion; - if (rootRecord.type === "throw") { - throw rootRecord.arg; - } - - return this.rval; - }, - - dispatchException: function(exception) { - if (this.done) { - throw exception; - } - - var context = this; - function handle(loc, caught) { - record.type = "throw"; - record.arg = exception; - context.next = loc; - return !!caught; - } - - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - var record = entry.completion; - - if (entry.tryLoc === "root") { - // Exception thrown outside of any try block that could handle - // it, so set the completion value of the entire function to - // throw the exception. - return handle("end"); - } - - if (entry.tryLoc <= this.prev) { - var hasCatch = hasOwn.call(entry, "catchLoc"); - var hasFinally = hasOwn.call(entry, "finallyLoc"); - - if (hasCatch && hasFinally) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } else if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else if (hasCatch) { - if (this.prev < entry.catchLoc) { - return handle(entry.catchLoc, true); - } - - } else if (hasFinally) { - if (this.prev < entry.finallyLoc) { - return handle(entry.finallyLoc); - } - - } else { - throw new Error("try statement without catch or finally"); - } - } - } - }, - - abrupt: function(type, arg) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc <= this.prev && - hasOwn.call(entry, "finallyLoc") && - this.prev < entry.finallyLoc) { - var finallyEntry = entry; - break; - } - } - - if (finallyEntry && - (type === "break" || - type === "continue") && - finallyEntry.tryLoc <= arg && - arg <= finallyEntry.finallyLoc) { - // Ignore the finally entry if control is not jumping to a - // location outside the try/catch block. - finallyEntry = null; - } - - var record = finallyEntry ? finallyEntry.completion : {}; - record.type = type; - record.arg = arg; - - if (finallyEntry) { - this.next = finallyEntry.finallyLoc; - } else { - this.complete(record); - } - - return ContinueSentinel; - }, - - complete: function(record, afterLoc) { - if (record.type === "throw") { - throw record.arg; - } - - if (record.type === "break" || - record.type === "continue") { - this.next = record.arg; - } else if (record.type === "return") { - this.rval = record.arg; - this.next = "end"; - } else if (record.type === "normal" && afterLoc) { - this.next = afterLoc; - } - }, - - finish: function(finallyLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.finallyLoc === finallyLoc) { - this.complete(entry.completion, entry.afterLoc); - resetTryEntry(entry); - return ContinueSentinel; - } - } - }, - - "catch": function(tryLoc) { - for (var i = this.tryEntries.length - 1; i >= 0; --i) { - var entry = this.tryEntries[i]; - if (entry.tryLoc === tryLoc) { - var record = entry.completion; - if (record.type === "throw") { - var thrown = record.arg; - resetTryEntry(entry); - } - return thrown; - } - } - - // The context.catch method must only be called with a location - // argument that corresponds to a known catch block. - throw new Error("illegal catch attempt"); - }, - - delegateYield: function(iterable, resultName, nextLoc) { - this.delegate = { - iterator: values(iterable), - resultName: resultName, - nextLoc: nextLoc - }; - - return ContinueSentinel; - } - }; -})( - // Among the various tricks for obtaining a reference to the global - // object, this seems to be the most reliable technique that does not - // use indirect eval (which violates Content Security Policy). - typeof global === "object" ? global : - typeof window === "object" ? window : - typeof self === "object" ? self : this -); - -}).call(this,_dereq_(10),typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{"10":10}],586:[function(_dereq_,module,exports){ -// Generated by `/scripts/character-class-escape-sets.js`. Do not edit. -var regenerate = _dereq_(588); - -exports.REGULAR = { - 'd': regenerate() - .addRange(0x30, 0x39), - 'D': regenerate() - .addRange(0x0, 0x2F) - .addRange(0x3A, 0xFFFF), - 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) - .addRange(0x9, 0xD) - .addRange(0x2000, 0x200A) - .addRange(0x2028, 0x2029), - 'S': regenerate() - .addRange(0x0, 0x8) - .addRange(0xE, 0x1F) - .addRange(0x21, 0x9F) - .addRange(0xA1, 0x167F) - .addRange(0x1681, 0x180D) - .addRange(0x180F, 0x1FFF) - .addRange(0x200B, 0x2027) - .addRange(0x202A, 0x202E) - .addRange(0x2030, 0x205E) - .addRange(0x2060, 0x2FFF) - .addRange(0x3001, 0xFEFE) - .addRange(0xFF00, 0xFFFF), - 'w': regenerate(0x5F) - .addRange(0x30, 0x39) - .addRange(0x41, 0x5A) - .addRange(0x61, 0x7A), - 'W': regenerate(0x60) - .addRange(0x0, 0x2F) - .addRange(0x3A, 0x40) - .addRange(0x5B, 0x5E) - .addRange(0x7B, 0xFFFF) -}; - -exports.UNICODE = { - 'd': regenerate() - .addRange(0x30, 0x39), - 'D': regenerate() - .addRange(0x0, 0x2F) - .addRange(0x3A, 0x10FFFF), - 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) - .addRange(0x9, 0xD) - .addRange(0x2000, 0x200A) - .addRange(0x2028, 0x2029), - 'S': regenerate() - .addRange(0x0, 0x8) - .addRange(0xE, 0x1F) - .addRange(0x21, 0x9F) - .addRange(0xA1, 0x167F) - .addRange(0x1681, 0x180D) - .addRange(0x180F, 0x1FFF) - .addRange(0x200B, 0x2027) - .addRange(0x202A, 0x202E) - .addRange(0x2030, 0x205E) - .addRange(0x2060, 0x2FFF) - .addRange(0x3001, 0xFEFE) - .addRange(0xFF00, 0x10FFFF), - 'w': regenerate(0x5F) - .addRange(0x30, 0x39) - .addRange(0x41, 0x5A) - .addRange(0x61, 0x7A), - 'W': regenerate(0x60) - .addRange(0x0, 0x2F) - .addRange(0x3A, 0x40) - .addRange(0x5B, 0x5E) - .addRange(0x7B, 0x10FFFF) -}; - -exports.UNICODE_IGNORE_CASE = { - 'd': regenerate() - .addRange(0x30, 0x39), - 'D': regenerate() - .addRange(0x0, 0x2F) - .addRange(0x3A, 0x10FFFF), - 's': regenerate(0x20, 0xA0, 0x1680, 0x180E, 0x202F, 0x205F, 0x3000, 0xFEFF) - .addRange(0x9, 0xD) - .addRange(0x2000, 0x200A) - .addRange(0x2028, 0x2029), - 'S': regenerate() - .addRange(0x0, 0x8) - .addRange(0xE, 0x1F) - .addRange(0x21, 0x9F) - .addRange(0xA1, 0x167F) - .addRange(0x1681, 0x180D) - .addRange(0x180F, 0x1FFF) - .addRange(0x200B, 0x2027) - .addRange(0x202A, 0x202E) - .addRange(0x2030, 0x205E) - .addRange(0x2060, 0x2FFF) - .addRange(0x3001, 0xFEFE) - .addRange(0xFF00, 0x10FFFF), - 'w': regenerate(0x5F, 0x17F, 0x212A) - .addRange(0x30, 0x39) - .addRange(0x41, 0x5A) - .addRange(0x61, 0x7A), - 'W': regenerate(0x4B, 0x53, 0x60) - .addRange(0x0, 0x2F) - .addRange(0x3A, 0x40) - .addRange(0x5B, 0x5E) - .addRange(0x7B, 0x10FFFF) -}; - -},{"588":588}],587:[function(_dereq_,module,exports){ -module.exports={ - "75": 8490, - "83": 383, - "107": 8490, - "115": 383, - "181": 924, - "197": 8491, - "383": 83, - "452": 453, - "453": 452, - "455": 456, - "456": 455, - "458": 459, - "459": 458, - "497": 498, - "498": 497, - "837": 8126, - "914": 976, - "917": 1013, - "920": 1012, - "921": 8126, - "922": 1008, - "924": 181, - "928": 982, - "929": 1009, - "931": 962, - "934": 981, - "937": 8486, - "962": 931, - "976": 914, - "977": 1012, - "981": 934, - "982": 928, - "1008": 922, - "1009": 929, - "1012": [ - 920, - 977 - ], - "1013": 917, - "7776": 7835, - "7835": 7776, - "8126": [ - 837, - 921 - ], - "8486": 937, - "8490": 75, - "8491": 197, - "66560": 66600, - "66561": 66601, - "66562": 66602, - "66563": 66603, - "66564": 66604, - "66565": 66605, - "66566": 66606, - "66567": 66607, - "66568": 66608, - "66569": 66609, - "66570": 66610, - "66571": 66611, - "66572": 66612, - "66573": 66613, - "66574": 66614, - "66575": 66615, - "66576": 66616, - "66577": 66617, - "66578": 66618, - "66579": 66619, - "66580": 66620, - "66581": 66621, - "66582": 66622, - "66583": 66623, - "66584": 66624, - "66585": 66625, - "66586": 66626, - "66587": 66627, - "66588": 66628, - "66589": 66629, - "66590": 66630, - "66591": 66631, - "66592": 66632, - "66593": 66633, - "66594": 66634, - "66595": 66635, - "66596": 66636, - "66597": 66637, - "66598": 66638, - "66599": 66639, - "66600": 66560, - "66601": 66561, - "66602": 66562, - "66603": 66563, - "66604": 66564, - "66605": 66565, - "66606": 66566, - "66607": 66567, - "66608": 66568, - "66609": 66569, - "66610": 66570, - "66611": 66571, - "66612": 66572, - "66613": 66573, - "66614": 66574, - "66615": 66575, - "66616": 66576, - "66617": 66577, - "66618": 66578, - "66619": 66579, - "66620": 66580, - "66621": 66581, - "66622": 66582, - "66623": 66583, - "66624": 66584, - "66625": 66585, - "66626": 66586, - "66627": 66587, - "66628": 66588, - "66629": 66589, - "66630": 66590, - "66631": 66591, - "66632": 66592, - "66633": 66593, - "66634": 66594, - "66635": 66595, - "66636": 66596, - "66637": 66597, - "66638": 66598, - "66639": 66599, - "68736": 68800, - "68737": 68801, - "68738": 68802, - "68739": 68803, - "68740": 68804, - "68741": 68805, - "68742": 68806, - "68743": 68807, - "68744": 68808, - "68745": 68809, - "68746": 68810, - "68747": 68811, - "68748": 68812, - "68749": 68813, - "68750": 68814, - "68751": 68815, - "68752": 68816, - "68753": 68817, - "68754": 68818, - "68755": 68819, - "68756": 68820, - "68757": 68821, - "68758": 68822, - "68759": 68823, - "68760": 68824, - "68761": 68825, - "68762": 68826, - "68763": 68827, - "68764": 68828, - "68765": 68829, - "68766": 68830, - "68767": 68831, - "68768": 68832, - "68769": 68833, - "68770": 68834, - "68771": 68835, - "68772": 68836, - "68773": 68837, - "68774": 68838, - "68775": 68839, - "68776": 68840, - "68777": 68841, - "68778": 68842, - "68779": 68843, - "68780": 68844, - "68781": 68845, - "68782": 68846, - "68783": 68847, - "68784": 68848, - "68785": 68849, - "68786": 68850, - "68800": 68736, - "68801": 68737, - "68802": 68738, - "68803": 68739, - "68804": 68740, - "68805": 68741, - "68806": 68742, - "68807": 68743, - "68808": 68744, - "68809": 68745, - "68810": 68746, - "68811": 68747, - "68812": 68748, - "68813": 68749, - "68814": 68750, - "68815": 68751, - "68816": 68752, - "68817": 68753, - "68818": 68754, - "68819": 68755, - "68820": 68756, - "68821": 68757, - "68822": 68758, - "68823": 68759, - "68824": 68760, - "68825": 68761, - "68826": 68762, - "68827": 68763, - "68828": 68764, - "68829": 68765, - "68830": 68766, - "68831": 68767, - "68832": 68768, - "68833": 68769, - "68834": 68770, - "68835": 68771, - "68836": 68772, - "68837": 68773, - "68838": 68774, - "68839": 68775, - "68840": 68776, - "68841": 68777, - "68842": 68778, - "68843": 68779, - "68844": 68780, - "68845": 68781, - "68846": 68782, - "68847": 68783, - "68848": 68784, - "68849": 68785, - "68850": 68786, - "71840": 71872, - "71841": 71873, - "71842": 71874, - "71843": 71875, - "71844": 71876, - "71845": 71877, - "71846": 71878, - "71847": 71879, - "71848": 71880, - "71849": 71881, - "71850": 71882, - "71851": 71883, - "71852": 71884, - "71853": 71885, - "71854": 71886, - "71855": 71887, - "71856": 71888, - "71857": 71889, - "71858": 71890, - "71859": 71891, - "71860": 71892, - "71861": 71893, - "71862": 71894, - "71863": 71895, - "71864": 71896, - "71865": 71897, - "71866": 71898, - "71867": 71899, - "71868": 71900, - "71869": 71901, - "71870": 71902, - "71871": 71903, - "71872": 71840, - "71873": 71841, - "71874": 71842, - "71875": 71843, - "71876": 71844, - "71877": 71845, - "71878": 71846, - "71879": 71847, - "71880": 71848, - "71881": 71849, - "71882": 71850, - "71883": 71851, - "71884": 71852, - "71885": 71853, - "71886": 71854, - "71887": 71855, - "71888": 71856, - "71889": 71857, - "71890": 71858, - "71891": 71859, - "71892": 71860, - "71893": 71861, - "71894": 71862, - "71895": 71863, - "71896": 71864, - "71897": 71865, - "71898": 71866, - "71899": 71867, - "71900": 71868, - "71901": 71869, - "71902": 71870, - "71903": 71871 -} - -},{}],588:[function(_dereq_,module,exports){ -(function (global){ -/*! https://mths.be/regenerate v1.2.0 by @mathias | MIT license */ -;(function(root) { - - // Detect free variables `exports`. - var freeExports = typeof exports == 'object' && exports; - - // Detect free variable `module`. - var freeModule = typeof module == 'object' && module && - module.exports == freeExports && module; - - // Detect free variable `global`, from Node.js or Browserified code, - // and use it as `root`. - var freeGlobal = typeof global == 'object' && global; - if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - var ERRORS = { - 'rangeOrder': 'A range\u2019s `stop` value must be greater than or equal ' + - 'to the `start` value.', - 'codePointRange': 'Invalid code point value. Code points range from ' + - 'U+000000 to U+10FFFF.' - }; - - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-pairs - var HIGH_SURROGATE_MIN = 0xD800; - var HIGH_SURROGATE_MAX = 0xDBFF; - var LOW_SURROGATE_MIN = 0xDC00; - var LOW_SURROGATE_MAX = 0xDFFF; - - // In Regenerate output, `\0` will never be preceded by `\` because we sort - // by code point value, so let’s keep this regular expression simple. - var regexNull = /\\x00([^0123456789]|$)/g; - - var object = {}; - var hasOwnProperty = object.hasOwnProperty; - var extend = function(destination, source) { - var key; - for (key in source) { - if (hasOwnProperty.call(source, key)) { - destination[key] = source[key]; - } - } - return destination; - }; - - var forEach = function(array, callback) { - var index = -1; - var length = array.length; - while (++index < length) { - callback(array[index], index); - } - }; - - var toString = object.toString; - var isArray = function(value) { - return toString.call(value) == '[object Array]'; - }; - var isNumber = function(value) { - return typeof value == 'number' || - toString.call(value) == '[object Number]'; - }; - - // This assumes that `number` is a positive integer that `toString()`s nicely - // (which is the case for all code point values). - var zeroes = '0000'; - var pad = function(number, totalCharacters) { - var string = String(number); - return string.length < totalCharacters - ? (zeroes + string).slice(-totalCharacters) - : string; - }; - - var hex = function(number) { - return Number(number).toString(16).toUpperCase(); - }; - - var slice = [].slice; - - /*--------------------------------------------------------------------------*/ - - var dataFromCodePoints = function(codePoints) { - var index = -1; - var length = codePoints.length; - var max = length - 1; - var result = []; - var isStart = true; - var tmp; - var previous = 0; - while (++index < length) { - tmp = codePoints[index]; - if (isStart) { - result.push(tmp); - previous = tmp; - isStart = false; - } else { - if (tmp == previous + 1) { - if (index != max) { - previous = tmp; - continue; - } else { - isStart = true; - result.push(tmp + 1); - } - } else { - // End the previous range and start a new one. - result.push(previous + 1, tmp); - previous = tmp; - } - } - } - if (!isStart) { - result.push(tmp + 1); - } - return result; - }; - - var dataRemove = function(data, codePoint) { - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var length = data.length; - while (index < length) { - start = data[index]; - end = data[index + 1]; - if (codePoint >= start && codePoint < end) { - // Modify this pair. - if (codePoint == start) { - if (end == start + 1) { - // Just remove `start` and `end`. - data.splice(index, 2); - return data; - } else { - // Just replace `start` with a new value. - data[index] = codePoint + 1; - return data; - } - } else if (codePoint == end - 1) { - // Just replace `end` with a new value. - data[index + 1] = codePoint; - return data; - } else { - // Replace `[start, end]` with `[startA, endA, startB, endB]`. - data.splice(index, 2, start, codePoint, codePoint + 1, end); - return data; - } - } - index += 2; - } - return data; - }; - - var dataRemoveRange = function(data, rangeStart, rangeEnd) { - if (rangeEnd < rangeStart) { - throw Error(ERRORS.rangeOrder); - } - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - while (index < data.length) { - start = data[index]; - end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. - - // Exit as soon as no more matching pairs can be found. - if (start > rangeEnd) { - return data; - } - - // Check if this range pair is equal to, or forms a subset of, the range - // to be removed. - // E.g. we have `[0, 11, 40, 51]` and want to remove 0-10 → `[40, 51]`. - // E.g. we have `[40, 51]` and want to remove 0-100 → `[]`. - if (rangeStart <= start && rangeEnd >= end) { - // Remove this pair. - data.splice(index, 2); - continue; - } - - // Check if both `rangeStart` and `rangeEnd` are within the bounds of - // this pair. - // E.g. we have `[0, 11]` and want to remove 4-6 → `[0, 4, 7, 11]`. - if (rangeStart >= start && rangeEnd < end) { - if (rangeStart == start) { - // Replace `[start, end]` with `[startB, endB]`. - data[index] = rangeEnd + 1; - data[index + 1] = end + 1; - return data; - } - // Replace `[start, end]` with `[startA, endA, startB, endB]`. - data.splice(index, 2, start, rangeStart, rangeEnd + 1, end + 1); - return data; - } - - // Check if only `rangeStart` is within the bounds of this pair. - // E.g. we have `[0, 11]` and want to remove 4-20 → `[0, 4]`. - if (rangeStart >= start && rangeStart <= end) { - // Replace `end` with `rangeStart`. - data[index + 1] = rangeStart; - // Note: we cannot `return` just yet, in case any following pairs still - // contain matching code points. - // E.g. we have `[0, 11, 14, 31]` and want to remove 4-20 - // → `[0, 4, 21, 31]`. - } - - // Check if only `rangeEnd` is within the bounds of this pair. - // E.g. we have `[14, 31]` and want to remove 4-20 → `[21, 31]`. - else if (rangeEnd >= start && rangeEnd <= end) { - // Just replace `start`. - data[index] = rangeEnd + 1; - return data; - } - - index += 2; - } - return data; - }; - - var dataAdd = function(data, codePoint) { - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var lastIndex = null; - var length = data.length; - if (codePoint < 0x0 || codePoint > 0x10FFFF) { - throw RangeError(ERRORS.codePointRange); - } - while (index < length) { - start = data[index]; - end = data[index + 1]; - - // Check if the code point is already in the set. - if (codePoint >= start && codePoint < end) { - return data; - } - - if (codePoint == start - 1) { - // Just replace `start` with a new value. - data[index] = codePoint; - return data; - } - - // At this point, if `start` is `greater` than `codePoint`, insert a new - // `[start, end]` pair before the current pair, or after the current pair - // if there is a known `lastIndex`. - if (start > codePoint) { - data.splice( - lastIndex != null ? lastIndex + 2 : 0, - 0, - codePoint, - codePoint + 1 - ); - return data; - } - - if (codePoint == end) { - // Check if adding this code point causes two separate ranges to become - // a single range, e.g. `dataAdd([0, 4, 5, 10], 4)` → `[0, 10]`. - if (codePoint + 1 == data[index + 2]) { - data.splice(index, 4, start, data[index + 3]); - return data; - } - // Else, just replace `end` with a new value. - data[index + 1] = codePoint + 1; - return data; - } - lastIndex = index; - index += 2; - } - // The loop has finished; add the new pair to the end of the data set. - data.push(codePoint, codePoint + 1); - return data; - }; - - var dataAddData = function(dataA, dataB) { - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var data = dataA.slice(); - var length = dataB.length; - while (index < length) { - start = dataB[index]; - end = dataB[index + 1] - 1; - if (start == end) { - data = dataAdd(data, start); - } else { - data = dataAddRange(data, start, end); - } - index += 2; - } - return data; - }; - - var dataRemoveData = function(dataA, dataB) { - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var data = dataA.slice(); - var length = dataB.length; - while (index < length) { - start = dataB[index]; - end = dataB[index + 1] - 1; - if (start == end) { - data = dataRemove(data, start); - } else { - data = dataRemoveRange(data, start, end); - } - index += 2; - } - return data; - }; - - var dataAddRange = function(data, rangeStart, rangeEnd) { - if (rangeEnd < rangeStart) { - throw Error(ERRORS.rangeOrder); - } - if ( - rangeStart < 0x0 || rangeStart > 0x10FFFF || - rangeEnd < 0x0 || rangeEnd > 0x10FFFF - ) { - throw RangeError(ERRORS.codePointRange); - } - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var added = false; - var length = data.length; - while (index < length) { - start = data[index]; - end = data[index + 1]; - - if (added) { - // The range has already been added to the set; at this point, we just - // need to get rid of the following ranges in case they overlap. - - // Check if this range can be combined with the previous range. - if (start == rangeEnd + 1) { - data.splice(index - 1, 2); - return data; - } - - // Exit as soon as no more possibly overlapping pairs can be found. - if (start > rangeEnd) { - return data; - } - - // E.g. `[0, 11, 12, 16]` and we’ve added 5-15, so we now have - // `[0, 16, 12, 16]`. Remove the `12,16` part, as it lies within the - // `0,16` range that was previously added. - if (start >= rangeStart && start <= rangeEnd) { - // `start` lies within the range that was previously added. - - if (end > rangeStart && end - 1 <= rangeEnd) { - // `end` lies within the range that was previously added as well, - // so remove this pair. - data.splice(index, 2); - index -= 2; - // Note: we cannot `return` just yet, as there may still be other - // overlapping pairs. - } else { - // `start` lies within the range that was previously added, but - // `end` doesn’t. E.g. `[0, 11, 12, 31]` and we’ve added 5-15, so - // now we have `[0, 16, 12, 31]`. This must be written as `[0, 31]`. - // Remove the previously added `end` and the current `start`. - data.splice(index - 1, 2); - index -= 2; - } - - // Note: we cannot return yet. - } - - } - - else if (start == rangeEnd + 1) { - data[index] = rangeStart; - return data; - } - - // Check if a new pair must be inserted *before* the current one. - else if (start > rangeEnd) { - data.splice(index, 0, rangeStart, rangeEnd + 1); - return data; - } - - else if (rangeStart >= start && rangeStart < end && rangeEnd + 1 <= end) { - // The new range lies entirely within an existing range pair. No action - // needed. - return data; - } - - else if ( - // E.g. `[0, 11]` and you add 5-15 → `[0, 16]`. - (rangeStart >= start && rangeStart < end) || - // E.g. `[0, 3]` and you add 3-6 → `[0, 7]`. - end == rangeStart - ) { - // Replace `end` with the new value. - data[index + 1] = rangeEnd + 1; - // Make sure the next range pair doesn’t overlap, e.g. `[0, 11, 12, 14]` - // and you add 5-15 → `[0, 16]`, i.e. remove the `12,14` part. - added = true; - // Note: we cannot `return` just yet. - } - - else if (rangeStart <= start && rangeEnd + 1 >= end) { - // The new range is a superset of the old range. - data[index] = rangeStart; - data[index + 1] = rangeEnd + 1; - added = true; - } - - index += 2; - } - // The loop has finished without doing anything; add the new pair to the end - // of the data set. - if (!added) { - data.push(rangeStart, rangeEnd + 1); - } - return data; - }; - - var dataContains = function(data, codePoint) { - var index = 0; - var length = data.length; - // Exit early if `codePoint` is not within `data`’s overall range. - var start = data[index]; - var end = data[length - 1]; - if (length >= 2) { - if (codePoint < start || codePoint > end) { - return false; - } - } - // Iterate over the data per `(start, end)` pair. - while (index < length) { - start = data[index]; - end = data[index + 1]; - if (codePoint >= start && codePoint < end) { - return true; - } - index += 2; - } - return false; - }; - - var dataIntersection = function(data, codePoints) { - var index = 0; - var length = codePoints.length; - var codePoint; - var result = []; - while (index < length) { - codePoint = codePoints[index]; - if (dataContains(data, codePoint)) { - result.push(codePoint); - } - ++index; - } - return dataFromCodePoints(result); - }; - - var dataIsEmpty = function(data) { - return !data.length; - }; - - var dataIsSingleton = function(data) { - // Check if the set only represents a single code point. - return data.length == 2 && data[0] + 1 == data[1]; - }; - - var dataToArray = function(data) { - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var result = []; - var length = data.length; - while (index < length) { - start = data[index]; - end = data[index + 1]; - while (start < end) { - result.push(start); - ++start; - } - index += 2; - } - return result; - }; - - /*--------------------------------------------------------------------------*/ - - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - var floor = Math.floor; - var highSurrogate = function(codePoint) { - return parseInt( - floor((codePoint - 0x10000) / 0x400) + HIGH_SURROGATE_MIN, - 10 - ); - }; - - var lowSurrogate = function(codePoint) { - return parseInt( - (codePoint - 0x10000) % 0x400 + LOW_SURROGATE_MIN, - 10 - ); - }; - - var stringFromCharCode = String.fromCharCode; - var codePointToString = function(codePoint) { - var string; - // https://mathiasbynens.be/notes/javascript-escapes#single - // Note: the `\b` escape sequence for U+0008 BACKSPACE in strings has a - // different meaning in regular expressions (word boundary), so it cannot - // be used here. - if (codePoint == 0x09) { - string = '\\t'; - } - // Note: IE < 9 treats `'\v'` as `'v'`, so avoid using it. - // else if (codePoint == 0x0B) { - // string = '\\v'; - // } - else if (codePoint == 0x0A) { - string = '\\n'; - } - else if (codePoint == 0x0C) { - string = '\\f'; - } - else if (codePoint == 0x0D) { - string = '\\r'; - } - else if (codePoint == 0x5C) { - string = '\\\\'; - } - else if ( - codePoint == 0x24 || - (codePoint >= 0x28 && codePoint <= 0x2B) || - codePoint == 0x2D || codePoint == 0x2E || codePoint == 0x3F || - (codePoint >= 0x5B && codePoint <= 0x5E) || - (codePoint >= 0x7B && codePoint <= 0x7D) - ) { - // The code point maps to an unsafe printable ASCII character; - // backslash-escape it. Here’s the list of those symbols: - // - // $()*+-.?[\]^{|} - // - // See #7 for more info. - string = '\\' + stringFromCharCode(codePoint); - } - else if (codePoint >= 0x20 && codePoint <= 0x7E) { - // The code point maps to one of these printable ASCII symbols - // (including the space character): - // - // !"#%&',/0123456789:;<=>@ABCDEFGHIJKLMNO - // PQRSTUVWXYZ_`abcdefghijklmnopqrstuvwxyz~ - // - // These can safely be used directly. - string = stringFromCharCode(codePoint); - } - else if (codePoint <= 0xFF) { - // https://mathiasbynens.be/notes/javascript-escapes#hexadecimal - string = '\\x' + pad(hex(codePoint), 2); - } - else { // `codePoint <= 0xFFFF` holds true. - // https://mathiasbynens.be/notes/javascript-escapes#unicode - string = '\\u' + pad(hex(codePoint), 4); - } - - // There’s no need to account for astral symbols / surrogate pairs here, - // since `codePointToString` is private and only used for BMP code points. - // But if that’s what you need, just add an `else` block with this code: - // - // string = '\\u' + pad(hex(highSurrogate(codePoint)), 4) - // + '\\u' + pad(hex(lowSurrogate(codePoint)), 4); - - return string; - }; - - var symbolToCodePoint = function(symbol) { - var length = symbol.length; - var first = symbol.charCodeAt(0); - var second; - if ( - first >= HIGH_SURROGATE_MIN && first <= HIGH_SURROGATE_MAX && - length > 1 // There is a next code unit. - ) { - // `first` is a high surrogate, and there is a next character. Assume - // it’s a low surrogate (else it’s invalid usage of Regenerate anyway). - second = symbol.charCodeAt(1); - // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - return (first - HIGH_SURROGATE_MIN) * 0x400 + - second - LOW_SURROGATE_MIN + 0x10000; - } - return first; - }; - - var createBMPCharacterClasses = function(data) { - // Iterate over the data per `(start, end)` pair. - var result = ''; - var index = 0; - var start; - var end; - var length = data.length; - if (dataIsSingleton(data)) { - return codePointToString(data[0]); - } - while (index < length) { - start = data[index]; - end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. - if (start == end) { - result += codePointToString(start); - } else if (start + 1 == end) { - result += codePointToString(start) + codePointToString(end); - } else { - result += codePointToString(start) + '-' + codePointToString(end); - } - index += 2; - } - return '[' + result + ']'; - }; - - var splitAtBMP = function(data) { - // Iterate over the data per `(start, end)` pair. - var loneHighSurrogates = []; - var loneLowSurrogates = []; - var bmp = []; - var astral = []; - var index = 0; - var start; - var end; - var length = data.length; - while (index < length) { - start = data[index]; - end = data[index + 1] - 1; // Note: the `- 1` makes `end` inclusive. - - if (start < HIGH_SURROGATE_MIN) { - - // The range starts and ends before the high surrogate range. - // E.g. (0, 0x10). - if (end < HIGH_SURROGATE_MIN) { - bmp.push(start, end + 1); - } - - // The range starts before the high surrogate range and ends within it. - // E.g. (0, 0xD855). - if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { - bmp.push(start, HIGH_SURROGATE_MIN); - loneHighSurrogates.push(HIGH_SURROGATE_MIN, end + 1); - } - - // The range starts before the high surrogate range and ends in the low - // surrogate range. E.g. (0, 0xDCFF). - if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { - bmp.push(start, HIGH_SURROGATE_MIN); - loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); - loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); - } - - // The range starts before the high surrogate range and ends after the - // low surrogate range. E.g. (0, 0x10FFFF). - if (end > LOW_SURROGATE_MAX) { - bmp.push(start, HIGH_SURROGATE_MIN); - loneHighSurrogates.push(HIGH_SURROGATE_MIN, HIGH_SURROGATE_MAX + 1); - loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); - if (end <= 0xFFFF) { - bmp.push(LOW_SURROGATE_MAX + 1, end + 1); - } else { - bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); - astral.push(0xFFFF + 1, end + 1); - } - } - - } else if (start >= HIGH_SURROGATE_MIN && start <= HIGH_SURROGATE_MAX) { - - // The range starts and ends in the high surrogate range. - // E.g. (0xD855, 0xD866). - if (end >= HIGH_SURROGATE_MIN && end <= HIGH_SURROGATE_MAX) { - loneHighSurrogates.push(start, end + 1); - } - - // The range starts in the high surrogate range and ends in the low - // surrogate range. E.g. (0xD855, 0xDCFF). - if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { - loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); - loneLowSurrogates.push(LOW_SURROGATE_MIN, end + 1); - } - - // The range starts in the high surrogate range and ends after the low - // surrogate range. E.g. (0xD855, 0x10FFFF). - if (end > LOW_SURROGATE_MAX) { - loneHighSurrogates.push(start, HIGH_SURROGATE_MAX + 1); - loneLowSurrogates.push(LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1); - if (end <= 0xFFFF) { - bmp.push(LOW_SURROGATE_MAX + 1, end + 1); - } else { - bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); - astral.push(0xFFFF + 1, end + 1); - } - } - - } else if (start >= LOW_SURROGATE_MIN && start <= LOW_SURROGATE_MAX) { - - // The range starts and ends in the low surrogate range. - // E.g. (0xDCFF, 0xDDFF). - if (end >= LOW_SURROGATE_MIN && end <= LOW_SURROGATE_MAX) { - loneLowSurrogates.push(start, end + 1); - } - - // The range starts in the low surrogate range and ends after the low - // surrogate range. E.g. (0xDCFF, 0x10FFFF). - if (end > LOW_SURROGATE_MAX) { - loneLowSurrogates.push(start, LOW_SURROGATE_MAX + 1); - if (end <= 0xFFFF) { - bmp.push(LOW_SURROGATE_MAX + 1, end + 1); - } else { - bmp.push(LOW_SURROGATE_MAX + 1, 0xFFFF + 1); - astral.push(0xFFFF + 1, end + 1); - } - } - - } else if (start > LOW_SURROGATE_MAX && start <= 0xFFFF) { - - // The range starts and ends after the low surrogate range. - // E.g. (0xFFAA, 0x10FFFF). - if (end <= 0xFFFF) { - bmp.push(start, end + 1); - } else { - bmp.push(start, 0xFFFF + 1); - astral.push(0xFFFF + 1, end + 1); - } - - } else { - - // The range starts and ends in the astral range. - astral.push(start, end + 1); - - } - - index += 2; - } - return { - 'loneHighSurrogates': loneHighSurrogates, - 'loneLowSurrogates': loneLowSurrogates, - 'bmp': bmp, - 'astral': astral - }; - }; - - var optimizeSurrogateMappings = function(surrogateMappings) { - var result = []; - var tmpLow = []; - var addLow = false; - var mapping; - var nextMapping; - var highSurrogates; - var lowSurrogates; - var nextHighSurrogates; - var nextLowSurrogates; - var index = -1; - var length = surrogateMappings.length; - while (++index < length) { - mapping = surrogateMappings[index]; - nextMapping = surrogateMappings[index + 1]; - if (!nextMapping) { - result.push(mapping); - continue; - } - highSurrogates = mapping[0]; - lowSurrogates = mapping[1]; - nextHighSurrogates = nextMapping[0]; - nextLowSurrogates = nextMapping[1]; - - // Check for identical high surrogate ranges. - tmpLow = lowSurrogates; - while ( - nextHighSurrogates && - highSurrogates[0] == nextHighSurrogates[0] && - highSurrogates[1] == nextHighSurrogates[1] - ) { - // Merge with the next item. - if (dataIsSingleton(nextLowSurrogates)) { - tmpLow = dataAdd(tmpLow, nextLowSurrogates[0]); - } else { - tmpLow = dataAddRange( - tmpLow, - nextLowSurrogates[0], - nextLowSurrogates[1] - 1 - ); - } - ++index; - mapping = surrogateMappings[index]; - highSurrogates = mapping[0]; - lowSurrogates = mapping[1]; - nextMapping = surrogateMappings[index + 1]; - nextHighSurrogates = nextMapping && nextMapping[0]; - nextLowSurrogates = nextMapping && nextMapping[1]; - addLow = true; - } - result.push([ - highSurrogates, - addLow ? tmpLow : lowSurrogates - ]); - addLow = false; - } - return optimizeByLowSurrogates(result); - }; - - var optimizeByLowSurrogates = function(surrogateMappings) { - if (surrogateMappings.length == 1) { - return surrogateMappings; - } - var index = -1; - var innerIndex = -1; - while (++index < surrogateMappings.length) { - var mapping = surrogateMappings[index]; - var lowSurrogates = mapping[1]; - var lowSurrogateStart = lowSurrogates[0]; - var lowSurrogateEnd = lowSurrogates[1]; - innerIndex = index; // Note: the loop starts at the next index. - while (++innerIndex < surrogateMappings.length) { - var otherMapping = surrogateMappings[innerIndex]; - var otherLowSurrogates = otherMapping[1]; - var otherLowSurrogateStart = otherLowSurrogates[0]; - var otherLowSurrogateEnd = otherLowSurrogates[1]; - if ( - lowSurrogateStart == otherLowSurrogateStart && - lowSurrogateEnd == otherLowSurrogateEnd - ) { - // Add the code points in the other item to this one. - if (dataIsSingleton(otherMapping[0])) { - mapping[0] = dataAdd(mapping[0], otherMapping[0][0]); - } else { - mapping[0] = dataAddRange( - mapping[0], - otherMapping[0][0], - otherMapping[0][1] - 1 - ); - } - // Remove the other, now redundant, item. - surrogateMappings.splice(innerIndex, 1); - --innerIndex; - } - } - } - return surrogateMappings; - }; - - var surrogateSet = function(data) { - // Exit early if `data` is an empty set. - if (!data.length) { - return []; - } - - // Iterate over the data per `(start, end)` pair. - var index = 0; - var start; - var end; - var startHigh; - var startLow; - var prevStartHigh = 0; - var prevEndHigh = 0; - var tmpLow = []; - var endHigh; - var endLow; - var surrogateMappings = []; - var length = data.length; - var dataHigh = []; - while (index < length) { - start = data[index]; - end = data[index + 1] - 1; - - startHigh = highSurrogate(start); - startLow = lowSurrogate(start); - endHigh = highSurrogate(end); - endLow = lowSurrogate(end); - - var startsWithLowestLowSurrogate = startLow == LOW_SURROGATE_MIN; - var endsWithHighestLowSurrogate = endLow == LOW_SURROGATE_MAX; - var complete = false; - - // Append the previous high-surrogate-to-low-surrogate mappings. - // Step 1: `(startHigh, startLow)` to `(startHigh, LOW_SURROGATE_MAX)`. - if ( - startHigh == endHigh || - startsWithLowestLowSurrogate && endsWithHighestLowSurrogate - ) { - surrogateMappings.push([ - [startHigh, endHigh + 1], - [startLow, endLow + 1] - ]); - complete = true; - } else { - surrogateMappings.push([ - [startHigh, startHigh + 1], - [startLow, LOW_SURROGATE_MAX + 1] - ]); - } - - // Step 2: `(startHigh + 1, LOW_SURROGATE_MIN)` to - // `(endHigh - 1, LOW_SURROGATE_MAX)`. - if (!complete && startHigh + 1 < endHigh) { - if (endsWithHighestLowSurrogate) { - // Combine step 2 and step 3. - surrogateMappings.push([ - [startHigh + 1, endHigh + 1], - [LOW_SURROGATE_MIN, endLow + 1] - ]); - complete = true; - } else { - surrogateMappings.push([ - [startHigh + 1, endHigh], - [LOW_SURROGATE_MIN, LOW_SURROGATE_MAX + 1] - ]); - } - } - - // Step 3. `(endHigh, LOW_SURROGATE_MIN)` to `(endHigh, endLow)`. - if (!complete) { - surrogateMappings.push([ - [endHigh, endHigh + 1], - [LOW_SURROGATE_MIN, endLow + 1] - ]); - } - - prevStartHigh = startHigh; - prevEndHigh = endHigh; - - index += 2; - } - - // The format of `surrogateMappings` is as follows: - // - // [ surrogateMapping1, surrogateMapping2 ] - // - // i.e.: - // - // [ - // [ highSurrogates1, lowSurrogates1 ], - // [ highSurrogates2, lowSurrogates2 ] - // ] - return optimizeSurrogateMappings(surrogateMappings); - }; - - var createSurrogateCharacterClasses = function(surrogateMappings) { - var result = []; - forEach(surrogateMappings, function(surrogateMapping) { - var highSurrogates = surrogateMapping[0]; - var lowSurrogates = surrogateMapping[1]; - result.push( - createBMPCharacterClasses(highSurrogates) + - createBMPCharacterClasses(lowSurrogates) - ); - }); - return result.join('|'); - }; - - var createCharacterClassesFromData = function(data, bmpOnly) { - var result = []; - - var parts = splitAtBMP(data); - var loneHighSurrogates = parts.loneHighSurrogates; - var loneLowSurrogates = parts.loneLowSurrogates; - var bmp = parts.bmp; - var astral = parts.astral; - var hasAstral = !dataIsEmpty(parts.astral); - var hasLoneHighSurrogates = !dataIsEmpty(loneHighSurrogates); - var hasLoneLowSurrogates = !dataIsEmpty(loneLowSurrogates); - - var surrogateMappings = surrogateSet(astral); - - if (bmpOnly) { - bmp = dataAddData(bmp, loneHighSurrogates); - hasLoneHighSurrogates = false; - bmp = dataAddData(bmp, loneLowSurrogates); - hasLoneLowSurrogates = false; - } - - if (!dataIsEmpty(bmp)) { - // The data set contains BMP code points that are not high surrogates - // needed for astral code points in the set. - result.push(createBMPCharacterClasses(bmp)); - } - if (surrogateMappings.length) { - // The data set contains astral code points; append character classes - // based on their surrogate pairs. - result.push(createSurrogateCharacterClasses(surrogateMappings)); - } - // https://gist.github.com/mathiasbynens/bbe7f870208abcfec860 - if (hasLoneHighSurrogates) { - result.push( - createBMPCharacterClasses(loneHighSurrogates) + - // Make sure the high surrogates aren’t part of a surrogate pair. - '(?![\\uDC00-\\uDFFF])' - ); - } - if (hasLoneLowSurrogates) { - result.push( - // Make sure the low surrogates aren’t part of a surrogate pair. - '(?:[^\\uD800-\\uDBFF]|^)' + - createBMPCharacterClasses(loneLowSurrogates) - ); - } - return result.join('|'); - }; - - /*--------------------------------------------------------------------------*/ - - // `regenerate` can be used as a constructor (and new methods can be added to - // its prototype) but also as a regular function, the latter of which is the - // documented and most common usage. For that reason, it’s not capitalized. - var regenerate = function(value) { - if (arguments.length > 1) { - value = slice.call(arguments); - } - if (this instanceof regenerate) { - this.data = []; - return value ? this.add(value) : this; - } - return (new regenerate).add(value); - }; - - regenerate.version = '1.2.0'; - - var proto = regenerate.prototype; - extend(proto, { - 'add': function(value) { - var $this = this; - if (value == null) { - return $this; - } - if (value instanceof regenerate) { - // Allow passing other Regenerate instances. - $this.data = dataAddData($this.data, value.data); - return $this; - } - if (arguments.length > 1) { - value = slice.call(arguments); - } - if (isArray(value)) { - forEach(value, function(item) { - $this.add(item); - }); - return $this; - } - $this.data = dataAdd( - $this.data, - isNumber(value) ? value : symbolToCodePoint(value) - ); - return $this; - }, - 'remove': function(value) { - var $this = this; - if (value == null) { - return $this; - } - if (value instanceof regenerate) { - // Allow passing other Regenerate instances. - $this.data = dataRemoveData($this.data, value.data); - return $this; - } - if (arguments.length > 1) { - value = slice.call(arguments); - } - if (isArray(value)) { - forEach(value, function(item) { - $this.remove(item); - }); - return $this; - } - $this.data = dataRemove( - $this.data, - isNumber(value) ? value : symbolToCodePoint(value) - ); - return $this; - }, - 'addRange': function(start, end) { - var $this = this; - $this.data = dataAddRange($this.data, - isNumber(start) ? start : symbolToCodePoint(start), - isNumber(end) ? end : symbolToCodePoint(end) - ); - return $this; - }, - 'removeRange': function(start, end) { - var $this = this; - var startCodePoint = isNumber(start) ? start : symbolToCodePoint(start); - var endCodePoint = isNumber(end) ? end : symbolToCodePoint(end); - $this.data = dataRemoveRange( - $this.data, - startCodePoint, - endCodePoint - ); - return $this; - }, - 'intersection': function(argument) { - var $this = this; - // Allow passing other Regenerate instances. - // TODO: Optimize this by writing and using `dataIntersectionData()`. - var array = argument instanceof regenerate ? - dataToArray(argument.data) : - argument; - $this.data = dataIntersection($this.data, array); - return $this; - }, - 'contains': function(codePoint) { - return dataContains( - this.data, - isNumber(codePoint) ? codePoint : symbolToCodePoint(codePoint) - ); - }, - 'clone': function() { - var set = new regenerate; - set.data = this.data.slice(0); - return set; - }, - 'toString': function(options) { - var result = createCharacterClassesFromData( - this.data, - options ? options.bmpOnly : false - ); - // Use `\0` instead of `\x00` where possible. - return result.replace(regexNull, '\\0$1'); - }, - 'toRegExp': function(flags) { - return RegExp(this.toString(), flags || ''); - }, - 'valueOf': function() { // Note: `valueOf` is aliased as `toArray`. - return dataToArray(this.data); - } - }); - - proto.toArray = proto.valueOf; - - // Some AMD build optimizers, like r.js, check for specific condition patterns - // like the following: - if ( - typeof define == 'function' && - typeof define.amd == 'object' && - define.amd - ) { - define(function() { - return regenerate; - }); - } else if (freeExports && !freeExports.nodeType) { - if (freeModule) { // in Node.js, io.js, or RingoJS v0.8.0+ - freeModule.exports = regenerate; - } else { // in Narwhal or RingoJS v0.7.0- - freeExports.regenerate = regenerate; - } - } else { // in Rhino or a web browser - root.regenerate = regenerate; - } - -}(this)); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],589:[function(_dereq_,module,exports){ -(function (global){ -/*! - * RegJSGen - * Copyright 2014 Benjamin Tan - * Available under MIT license - */ -;(function() { - 'use strict'; - - /** Used to determine if values are of the language type `Object` */ - var objectTypes = { - 'function': true, - 'object': true - }; - - /** Used as a reference to the global object */ - var root = (objectTypes[typeof window] && window) || this; - - /** Backup possible global object */ - var oldRoot = root; - - /** Detect free variable `exports` */ - var freeExports = objectTypes[typeof exports] && exports; - - /** Detect free variable `module` */ - var freeModule = objectTypes[typeof module] && module && !module.nodeType && module; - - /** Detect free variable `global` from Node.js or Browserified code and use it as `root` */ - var freeGlobal = freeExports && freeModule && typeof global == 'object' && global; - if (freeGlobal && (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal || freeGlobal.self === freeGlobal)) { - root = freeGlobal; - } - - /*--------------------------------------------------------------------------*/ - - /*! Based on https://mths.be/fromcodepoint v0.2.0 by @mathias */ - - var stringFromCharCode = String.fromCharCode; - var floor = Math.floor; - function fromCodePoint() { - var MAX_SIZE = 0x4000; - var codeUnits = []; - var highSurrogate; - var lowSurrogate; - var index = -1; - var length = arguments.length; - if (!length) { - return ''; - } - var result = ''; - while (++index < length) { - var codePoint = Number(arguments[index]); - if ( - !isFinite(codePoint) || // `NaN`, `+Infinity`, or `-Infinity` - codePoint < 0 || // not a valid Unicode code point - codePoint > 0x10FFFF || // not a valid Unicode code point - floor(codePoint) != codePoint // not an integer - ) { - throw RangeError('Invalid code point: ' + codePoint); - } - if (codePoint <= 0xFFFF) { - // BMP code point - codeUnits.push(codePoint); - } else { - // Astral code point; split in surrogate halves - // http://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae - codePoint -= 0x10000; - highSurrogate = (codePoint >> 10) + 0xD800; - lowSurrogate = (codePoint % 0x400) + 0xDC00; - codeUnits.push(highSurrogate, lowSurrogate); - } - if (index + 1 == length || codeUnits.length > MAX_SIZE) { - result += stringFromCharCode.apply(null, codeUnits); - codeUnits.length = 0; - } - } - return result; - } - - function assertType(type, expected) { - if (expected.indexOf('|') == -1) { - if (type == expected) { - return; - } - - throw Error('Invalid node type: ' + type); - } - - expected = assertType.hasOwnProperty(expected) - ? assertType[expected] - : (assertType[expected] = RegExp('^(?:' + expected + ')$')); - - if (expected.test(type)) { - return; - } - - throw Error('Invalid node type: ' + type); - } - - /*--------------------------------------------------------------------------*/ - - function generate(node) { - var type = node.type; - - if (generate.hasOwnProperty(type) && typeof generate[type] == 'function') { - return generate[type](node); - } - - throw Error('Invalid node type: ' + type); - } - - /*--------------------------------------------------------------------------*/ - - function generateAlternative(node) { - assertType(node.type, 'alternative'); - - var terms = node.body, - length = terms ? terms.length : 0; - - if (length == 1) { - return generateTerm(terms[0]); - } else { - var i = -1, - result = ''; - - while (++i < length) { - result += generateTerm(terms[i]); - } - - return result; - } - } - - function generateAnchor(node) { - assertType(node.type, 'anchor'); - - switch (node.kind) { - case 'start': - return '^'; - case 'end': - return '$'; - case 'boundary': - return '\\b'; - case 'not-boundary': - return '\\B'; - default: - throw Error('Invalid assertion'); - } - } - - function generateAtom(node) { - assertType(node.type, 'anchor|characterClass|characterClassEscape|dot|group|reference|value'); - - return generate(node); - } - - function generateCharacterClass(node) { - assertType(node.type, 'characterClass'); - - var classRanges = node.body, - length = classRanges ? classRanges.length : 0; - - var i = -1, - result = '['; - - if (node.negative) { - result += '^'; - } - - while (++i < length) { - result += generateClassAtom(classRanges[i]); - } - - result += ']'; - - return result; - } - - function generateCharacterClassEscape(node) { - assertType(node.type, 'characterClassEscape'); - - return '\\' + node.value; - } - - function generateCharacterClassRange(node) { - assertType(node.type, 'characterClassRange'); - - var min = node.min, - max = node.max; - - if (min.type == 'characterClassRange' || max.type == 'characterClassRange') { - throw Error('Invalid character class range'); - } - - return generateClassAtom(min) + '-' + generateClassAtom(max); - } - - function generateClassAtom(node) { - assertType(node.type, 'anchor|characterClassEscape|characterClassRange|dot|value'); - - return generate(node); - } - - function generateDisjunction(node) { - assertType(node.type, 'disjunction'); - - var body = node.body, - length = body ? body.length : 0; - - if (length == 0) { - throw Error('No body'); - } else if (length == 1) { - return generate(body[0]); - } else { - var i = -1, - result = ''; - - while (++i < length) { - if (i != 0) { - result += '|'; - } - result += generate(body[i]); - } - - return result; - } - } - - function generateDot(node) { - assertType(node.type, 'dot'); - - return '.'; - } - - function generateGroup(node) { - assertType(node.type, 'group'); - - var result = '('; - - switch (node.behavior) { - case 'normal': - break; - case 'ignore': - result += '?:'; - break; - case 'lookahead': - result += '?='; - break; - case 'negativeLookahead': - result += '?!'; - break; - default: - throw Error('Invalid behaviour: ' + node.behaviour); - } - - var body = node.body, - length = body ? body.length : 0; - - if (length == 1) { - result += generate(body[0]); - } else { - var i = -1; - - while (++i < length) { - result += generate(body[i]); - } - } - - result += ')'; - - return result; - } - - function generateQuantifier(node) { - assertType(node.type, 'quantifier'); - - var quantifier = '', - min = node.min, - max = node.max; - - switch (max) { - case undefined: - case null: - switch (min) { - case 0: - quantifier = '*' - break; - case 1: - quantifier = '+'; - break; - default: - quantifier = '{' + min + ',}'; - break; - } - break; - default: - if (min == max) { - quantifier = '{' + min + '}'; - } - else if (min == 0 && max == 1) { - quantifier = '?'; - } else { - quantifier = '{' + min + ',' + max + '}'; - } - break; - } - - if (!node.greedy) { - quantifier += '?'; - } - - return generateAtom(node.body[0]) + quantifier; - } - - function generateReference(node) { - assertType(node.type, 'reference'); - - return '\\' + node.matchIndex; - } - - function generateTerm(node) { - assertType(node.type, 'anchor|characterClass|characterClassEscape|empty|group|quantifier|reference|value'); - - return generate(node); - } - - function generateValue(node) { - assertType(node.type, 'value'); - - var kind = node.kind, - codePoint = node.codePoint; - - switch (kind) { - case 'controlLetter': - return '\\c' + fromCodePoint(codePoint + 64); - case 'hexadecimalEscape': - return '\\x' + ('00' + codePoint.toString(16).toUpperCase()).slice(-2); - case 'identifier': - return '\\' + fromCodePoint(codePoint); - case 'null': - return '\\' + codePoint; - case 'octal': - return '\\' + codePoint.toString(8); - case 'singleEscape': - switch (codePoint) { - case 0x0008: - return '\\b'; - case 0x009: - return '\\t'; - case 0x00A: - return '\\n'; - case 0x00B: - return '\\v'; - case 0x00C: - return '\\f'; - case 0x00D: - return '\\r'; - default: - throw Error('Invalid codepoint: ' + codePoint); - } - case 'symbol': - return fromCodePoint(codePoint); - case 'unicodeEscape': - return '\\u' + ('0000' + codePoint.toString(16).toUpperCase()).slice(-4); - case 'unicodeCodePointEscape': - return '\\u{' + codePoint.toString(16).toUpperCase() + '}'; - default: - throw Error('Unsupported node kind: ' + kind); - } - } - - /*--------------------------------------------------------------------------*/ - - generate.alternative = generateAlternative; - generate.anchor = generateAnchor; - generate.characterClass = generateCharacterClass; - generate.characterClassEscape = generateCharacterClassEscape; - generate.characterClassRange = generateCharacterClassRange; - generate.disjunction = generateDisjunction; - generate.dot = generateDot; - generate.group = generateGroup; - generate.quantifier = generateQuantifier; - generate.reference = generateReference; - generate.value = generateValue; - - /*--------------------------------------------------------------------------*/ - - // export regjsgen - // some AMD build optimizers, like r.js, check for condition patterns like the following: - if (typeof define == 'function' && typeof define.amd == 'object' && define.amd) { - // define as an anonymous module so, through path mapping, it can be aliased - define(function() { - return { - 'generate': generate - }; - }); - } - // check for `exports` after `define` in case a build optimizer adds an `exports` object - else if (freeExports && freeModule) { - // in Narwhal, Node.js, Rhino -require, or RingoJS - freeExports.generate = generate; - } - // in a browser or Rhino - else { - root.regjsgen = { - 'generate': generate - }; - } -}.call(this)); - -}).call(this,typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {}) -},{}],590:[function(_dereq_,module,exports){ -// regjsparser -// -// ================================================================== -// -// See ECMA-262 Standard: 15.10.1 -// -// NOTE: The ECMA-262 standard uses the term "Assertion" for /^/. Here the -// term "Anchor" is used. -// -// Pattern :: -// Disjunction -// -// Disjunction :: -// Alternative -// Alternative | Disjunction -// -// Alternative :: -// [empty] -// Alternative Term -// -// Term :: -// Anchor -// Atom -// Atom Quantifier -// -// Anchor :: -// ^ -// $ -// \ b -// \ B -// ( ? = Disjunction ) -// ( ? ! Disjunction ) -// -// Quantifier :: -// QuantifierPrefix -// QuantifierPrefix ? -// -// QuantifierPrefix :: -// * -// + -// ? -// { DecimalDigits } -// { DecimalDigits , } -// { DecimalDigits , DecimalDigits } -// -// Atom :: -// PatternCharacter -// . -// \ AtomEscape -// CharacterClass -// ( Disjunction ) -// ( ? : Disjunction ) -// -// PatternCharacter :: -// SourceCharacter but not any of: ^ $ \ . * + ? ( ) [ ] { } | -// -// AtomEscape :: -// DecimalEscape -// CharacterEscape -// CharacterClassEscape -// -// CharacterEscape[U] :: -// ControlEscape -// c ControlLetter -// HexEscapeSequence -// RegExpUnicodeEscapeSequence[?U] (ES6) -// IdentityEscape[?U] -// -// ControlEscape :: -// one of f n r t v -// ControlLetter :: -// one of -// a b c d e f g h i j k l m n o p q r s t u v w x y z -// A B C D E F G H I J K L M N O P Q R S T U V W X Y Z -// -// IdentityEscape :: -// SourceCharacter but not IdentifierPart -// -// -// -// DecimalEscape :: -// DecimalIntegerLiteral [lookahead ∉ DecimalDigit] -// -// CharacterClassEscape :: -// one of d D s S w W -// -// CharacterClass :: -// [ [lookahead ∉ {^}] ClassRanges ] -// [ ^ ClassRanges ] -// -// ClassRanges :: -// [empty] -// NonemptyClassRanges -// -// NonemptyClassRanges :: -// ClassAtom -// ClassAtom NonemptyClassRangesNoDash -// ClassAtom - ClassAtom ClassRanges -// -// NonemptyClassRangesNoDash :: -// ClassAtom -// ClassAtomNoDash NonemptyClassRangesNoDash -// ClassAtomNoDash - ClassAtom ClassRanges -// -// ClassAtom :: -// - -// ClassAtomNoDash -// -// ClassAtomNoDash :: -// SourceCharacter but not one of \ or ] or - -// \ ClassEscape -// -// ClassEscape :: -// DecimalEscape -// b -// CharacterEscape -// CharacterClassEscape - -(function() { - - function parse(str, flags) { - function addRaw(node) { - node.raw = str.substring(node.range[0], node.range[1]); - return node; - } - - function updateRawStart(node, start) { - node.range[0] = start; - return addRaw(node); - } - - function createAnchor(kind, rawLength) { - return addRaw({ - type: 'anchor', - kind: kind, - range: [ - pos - rawLength, - pos - ] - }); - } - - function createValue(kind, codePoint, from, to) { - return addRaw({ - type: 'value', - kind: kind, - codePoint: codePoint, - range: [from, to] - }); - } - - function createEscaped(kind, codePoint, value, fromOffset) { - fromOffset = fromOffset || 0; - return createValue(kind, codePoint, pos - (value.length + fromOffset), pos); - } - - function createCharacter(matches) { - var _char = matches[0]; - var first = _char.charCodeAt(0); - if (hasUnicodeFlag) { - var second; - if (_char.length === 1 && first >= 0xD800 && first <= 0xDBFF) { - second = lookahead().charCodeAt(0); - if (second >= 0xDC00 && second <= 0xDFFF) { - // Unicode surrogate pair - pos++; - return createValue( - 'symbol', - (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000, - pos - 2, pos); - } - } - } - return createValue('symbol', first, pos - 1, pos); - } - - function createDisjunction(alternatives, from, to) { - return addRaw({ - type: 'disjunction', - body: alternatives, - range: [ - from, - to - ] - }); - } - - function createDot() { - return addRaw({ - type: 'dot', - range: [ - pos - 1, - pos - ] - }); - } - - function createCharacterClassEscape(value) { - return addRaw({ - type: 'characterClassEscape', - value: value, - range: [ - pos - 2, - pos - ] - }); - } - - function createReference(matchIndex) { - return addRaw({ - type: 'reference', - matchIndex: parseInt(matchIndex, 10), - range: [ - pos - 1 - matchIndex.length, - pos - ] - }); - } - - function createGroup(behavior, disjunction, from, to) { - return addRaw({ - type: 'group', - behavior: behavior, - body: disjunction, - range: [ - from, - to - ] - }); - } - - function createQuantifier(min, max, from, to) { - if (to == null) { - from = pos - 1; - to = pos; - } - - return addRaw({ - type: 'quantifier', - min: min, - max: max, - greedy: true, - body: null, // set later on - range: [ - from, - to - ] - }); - } - - function createAlternative(terms, from, to) { - return addRaw({ - type: 'alternative', - body: terms, - range: [ - from, - to - ] - }); - } - - function createCharacterClass(classRanges, negative, from, to) { - return addRaw({ - type: 'characterClass', - body: classRanges, - negative: negative, - range: [ - from, - to - ] - }); - } - - function createClassRange(min, max, from, to) { - // See 15.10.2.15: - if (min.codePoint > max.codePoint) { - bail('invalid range in character class', min.raw + '-' + max.raw, from, to); - } - - return addRaw({ - type: 'characterClassRange', - min: min, - max: max, - range: [ - from, - to - ] - }); - } - - function flattenBody(body) { - if (body.type === 'alternative') { - return body.body; - } else { - return [body]; - } - } - - function isEmpty(obj) { - return obj.type === 'empty'; - } - - function incr(amount) { - amount = (amount || 1); - var res = str.substring(pos, pos + amount); - pos += (amount || 1); - return res; - } - - function skip(value) { - if (!match(value)) { - bail('character', value); - } - } - - function match(value) { - if (str.indexOf(value, pos) === pos) { - return incr(value.length); - } - } - - function lookahead() { - return str[pos]; - } - - function current(value) { - return str.indexOf(value, pos) === pos; - } - - function next(value) { - return str[pos + 1] === value; - } - - function matchReg(regExp) { - var subStr = str.substring(pos); - var res = subStr.match(regExp); - if (res) { - res.range = []; - res.range[0] = pos; - incr(res[0].length); - res.range[1] = pos; - } - return res; - } - - function parseDisjunction() { - // Disjunction :: - // Alternative - // Alternative | Disjunction - var res = [], from = pos; - res.push(parseAlternative()); - - while (match('|')) { - res.push(parseAlternative()); - } - - if (res.length === 1) { - return res[0]; - } - - return createDisjunction(res, from, pos); - } - - function parseAlternative() { - var res = [], from = pos; - var term; - - // Alternative :: - // [empty] - // Alternative Term - while (term = parseTerm()) { - res.push(term); - } - - if (res.length === 1) { - return res[0]; - } - - return createAlternative(res, from, pos); - } - - function parseTerm() { - // Term :: - // Anchor - // Atom - // Atom Quantifier - - if (pos >= str.length || current('|') || current(')')) { - return null; /* Means: The term is empty */ - } - - var anchor = parseAnchor(); - - if (anchor) { - return anchor; - } - - var atom = parseAtom(); - if (!atom) { - bail('Expected atom'); - } - var quantifier = parseQuantifier() || false; - if (quantifier) { - quantifier.body = flattenBody(atom); - // The quantifier contains the atom. Therefore, the beginning of the - // quantifier range is given by the beginning of the atom. - updateRawStart(quantifier, atom.range[0]); - return quantifier; - } - return atom; - } - - function parseGroup(matchA, typeA, matchB, typeB) { - var type = null, from = pos; - - if (match(matchA)) { - type = typeA; - } else if (match(matchB)) { - type = typeB; - } else { - return false; - } - - var body = parseDisjunction(); - if (!body) { - bail('Expected disjunction'); - } - skip(')'); - var group = createGroup(type, flattenBody(body), from, pos); - - if (type == 'normal') { - // Keep track of the number of closed groups. This is required for - // parseDecimalEscape(). In case the string is parsed a second time the - // value already holds the total count and no incrementation is required. - if (firstIteration) { - closedCaptureCounter++; - } - } - return group; - } - - function parseAnchor() { - // Anchor :: - // ^ - // $ - // \ b - // \ B - // ( ? = Disjunction ) - // ( ? ! Disjunction ) - var res, from = pos; - - if (match('^')) { - return createAnchor('start', 1 /* rawLength */); - } else if (match('$')) { - return createAnchor('end', 1 /* rawLength */); - } else if (match('\\b')) { - return createAnchor('boundary', 2 /* rawLength */); - } else if (match('\\B')) { - return createAnchor('not-boundary', 2 /* rawLength */); - } else { - return parseGroup('(?=', 'lookahead', '(?!', 'negativeLookahead'); - } - } - - function parseQuantifier() { - // Quantifier :: - // QuantifierPrefix - // QuantifierPrefix ? - // - // QuantifierPrefix :: - // * - // + - // ? - // { DecimalDigits } - // { DecimalDigits , } - // { DecimalDigits , DecimalDigits } - - var res, from = pos; - var quantifier; - var min, max; - - if (match('*')) { - quantifier = createQuantifier(0); - } - else if (match('+')) { - quantifier = createQuantifier(1); - } - else if (match('?')) { - quantifier = createQuantifier(0, 1); - } - else if (res = matchReg(/^\{([0-9]+)\}/)) { - min = parseInt(res[1], 10); - quantifier = createQuantifier(min, min, res.range[0], res.range[1]); - } - else if (res = matchReg(/^\{([0-9]+),\}/)) { - min = parseInt(res[1], 10); - quantifier = createQuantifier(min, undefined, res.range[0], res.range[1]); - } - else if (res = matchReg(/^\{([0-9]+),([0-9]+)\}/)) { - min = parseInt(res[1], 10); - max = parseInt(res[2], 10); - if (min > max) { - bail('numbers out of order in {} quantifier', '', from, pos); - } - quantifier = createQuantifier(min, max, res.range[0], res.range[1]); - } - - if (quantifier) { - if (match('?')) { - quantifier.greedy = false; - quantifier.range[1] += 1; - } - } - - return quantifier; - } - - function parseAtom() { - // Atom :: - // PatternCharacter - // . - // \ AtomEscape - // CharacterClass - // ( Disjunction ) - // ( ? : Disjunction ) - - var res; - - // jviereck: allow ']', '}' here as well to be compatible with browser's - // implementations: ']'.match(/]/); - // if (res = matchReg(/^[^^$\\.*+?()[\]{}|]/)) { - if (res = matchReg(/^[^^$\\.*+?(){[|]/)) { - // PatternCharacter - return createCharacter(res); - } - else if (match('.')) { - // . - return createDot(); - } - else if (match('\\')) { - // \ AtomEscape - res = parseAtomEscape(); - if (!res) { - bail('atomEscape'); - } - return res; - } - else if (res = parseCharacterClass()) { - return res; - } - else { - // ( Disjunction ) - // ( ? : Disjunction ) - return parseGroup('(?:', 'ignore', '(', 'normal'); - } - } - - function parseUnicodeSurrogatePairEscape(firstEscape) { - if (hasUnicodeFlag) { - var first, second; - if (firstEscape.kind == 'unicodeEscape' && - (first = firstEscape.codePoint) >= 0xD800 && first <= 0xDBFF && - current('\\') && next('u') ) { - var prevPos = pos; - pos++; - var secondEscape = parseClassEscape(); - if (secondEscape.kind == 'unicodeEscape' && - (second = secondEscape.codePoint) >= 0xDC00 && second <= 0xDFFF) { - // Unicode surrogate pair - firstEscape.range[1] = secondEscape.range[1]; - firstEscape.codePoint = (first - 0xD800) * 0x400 + second - 0xDC00 + 0x10000; - firstEscape.type = 'value'; - firstEscape.kind = 'unicodeCodePointEscape'; - addRaw(firstEscape); - } - else { - pos = prevPos; - } - } - } - return firstEscape; - } - - function parseClassEscape() { - return parseAtomEscape(true); - } - - function parseAtomEscape(insideCharacterClass) { - // AtomEscape :: - // DecimalEscape - // CharacterEscape - // CharacterClassEscape - - var res, from = pos; - - res = parseDecimalEscape(); - if (res) { - return res; - } - - // For ClassEscape - if (insideCharacterClass) { - if (match('b')) { - // 15.10.2.19 - // The production ClassEscape :: b evaluates by returning the - // CharSet containing the one character (Unicode value 0008). - return createEscaped('singleEscape', 0x0008, '\\b'); - } else if (match('B')) { - bail('\\B not possible inside of CharacterClass', '', from); - } - } - - res = parseCharacterEscape(); - - return res; - } - - - function parseDecimalEscape() { - // DecimalEscape :: - // DecimalIntegerLiteral [lookahead ∉ DecimalDigit] - // CharacterClassEscape :: one of d D s S w W - - var res, match; - - if (res = matchReg(/^(?!0)\d+/)) { - match = res[0]; - var refIdx = parseInt(res[0], 10); - if (refIdx <= closedCaptureCounter) { - // If the number is smaller than the normal-groups found so - // far, then it is a reference... - return createReference(res[0]); - } else { - // ... otherwise it needs to be interpreted as a octal (if the - // number is in an octal format). If it is NOT octal format, - // then the slash is ignored and the number is matched later - // as normal characters. - - // Recall the negative decision to decide if the input must be parsed - // a second time with the total normal-groups. - backrefDenied.push(refIdx); - - // Reset the position again, as maybe only parts of the previous - // matched numbers are actual octal numbers. E.g. in '019' only - // the '01' should be matched. - incr(-res[0].length); - if (res = matchReg(/^[0-7]{1,3}/)) { - return createEscaped('octal', parseInt(res[0], 8), res[0], 1); - } else { - // If we end up here, we have a case like /\91/. Then the - // first slash is to be ignored and the 9 & 1 to be treated - // like ordinary characters. Create a character for the - // first number only here - other number-characters - // (if available) will be matched later. - res = createCharacter(matchReg(/^[89]/)); - return updateRawStart(res, res.range[0] - 1); - } - } - } - // Only allow octal numbers in the following. All matched numbers start - // with a zero (if the do not, the previous if-branch is executed). - // If the number is not octal format and starts with zero (e.g. `091`) - // then only the zeros `0` is treated here and the `91` are ordinary - // characters. - // Example: - // /\091/.exec('\091')[0].length === 3 - else if (res = matchReg(/^[0-7]{1,3}/)) { - match = res[0]; - if (/^0{1,3}$/.test(match)) { - // If they are all zeros, then only take the first one. - return createEscaped('null', 0x0000, '0', match.length + 1); - } else { - return createEscaped('octal', parseInt(match, 8), match, 1); - } - } else if (res = matchReg(/^[dDsSwW]/)) { - return createCharacterClassEscape(res[0]); - } - return false; - } - - function parseCharacterEscape() { - // CharacterEscape :: - // ControlEscape - // c ControlLetter - // HexEscapeSequence - // UnicodeEscapeSequence - // IdentityEscape - - var res; - if (res = matchReg(/^[fnrtv]/)) { - // ControlEscape - var codePoint = 0; - switch (res[0]) { - case 't': codePoint = 0x009; break; - case 'n': codePoint = 0x00A; break; - case 'v': codePoint = 0x00B; break; - case 'f': codePoint = 0x00C; break; - case 'r': codePoint = 0x00D; break; - } - return createEscaped('singleEscape', codePoint, '\\' + res[0]); - } else if (res = matchReg(/^c([a-zA-Z])/)) { - // c ControlLetter - return createEscaped('controlLetter', res[1].charCodeAt(0) % 32, res[1], 2); - } else if (res = matchReg(/^x([0-9a-fA-F]{2})/)) { - // HexEscapeSequence - return createEscaped('hexadecimalEscape', parseInt(res[1], 16), res[1], 2); - } else if (res = matchReg(/^u([0-9a-fA-F]{4})/)) { - // UnicodeEscapeSequence - return parseUnicodeSurrogatePairEscape( - createEscaped('unicodeEscape', parseInt(res[1], 16), res[1], 2) - ); - } else if (hasUnicodeFlag && (res = matchReg(/^u\{([0-9a-fA-F]+)\}/))) { - // RegExpUnicodeEscapeSequence (ES6 Unicode code point escape) - return createEscaped('unicodeCodePointEscape', parseInt(res[1], 16), res[1], 4); - } else { - // IdentityEscape - return parseIdentityEscape(); - } - } - - // Taken from the Esprima parser. - function isIdentifierPart(ch) { - // Generated by `tools/generate-identifier-regex.js`. - var NonAsciiIdentifierPart = new RegExp('[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\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\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-\u19D9\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\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\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\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\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]'); - - return (ch === 36) || (ch === 95) || // $ (dollar) and _ (underscore) - (ch >= 65 && ch <= 90) || // A..Z - (ch >= 97 && ch <= 122) || // a..z - (ch >= 48 && ch <= 57) || // 0..9 - (ch === 92) || // \ (backslash) - ((ch >= 0x80) && NonAsciiIdentifierPart.test(String.fromCharCode(ch))); - } - - function parseIdentityEscape() { - // IdentityEscape :: - // SourceCharacter but not IdentifierPart - // - // - - var ZWJ = '\u200C'; - var ZWNJ = '\u200D'; - - var tmp; - - if (!isIdentifierPart(lookahead())) { - tmp = incr(); - return createEscaped('identifier', tmp.charCodeAt(0), tmp, 1); - } - - if (match(ZWJ)) { - // - return createEscaped('identifier', 0x200C, ZWJ); - } else if (match(ZWNJ)) { - // - return createEscaped('identifier', 0x200D, ZWNJ); - } - - return null; - } - - function parseCharacterClass() { - // CharacterClass :: - // [ [lookahead ∉ {^}] ClassRanges ] - // [ ^ ClassRanges ] - - var res, from = pos; - if (res = matchReg(/^\[\^/)) { - res = parseClassRanges(); - skip(']'); - return createCharacterClass(res, true, from, pos); - } else if (match('[')) { - res = parseClassRanges(); - skip(']'); - return createCharacterClass(res, false, from, pos); - } - - return null; - } - - function parseClassRanges() { - // ClassRanges :: - // [empty] - // NonemptyClassRanges - - var res; - if (current(']')) { - // Empty array means nothing insinde of the ClassRange. - return []; - } else { - res = parseNonemptyClassRanges(); - if (!res) { - bail('nonEmptyClassRanges'); - } - return res; - } - } - - function parseHelperClassRanges(atom) { - var from, to, res; - if (current('-') && !next(']')) { - // ClassAtom - ClassAtom ClassRanges - skip('-'); - - res = parseClassAtom(); - if (!res) { - bail('classAtom'); - } - to = pos; - var classRanges = parseClassRanges(); - if (!classRanges) { - bail('classRanges'); - } - from = atom.range[0]; - if (classRanges.type === 'empty') { - return [createClassRange(atom, res, from, to)]; - } - return [createClassRange(atom, res, from, to)].concat(classRanges); - } - - res = parseNonemptyClassRangesNoDash(); - if (!res) { - bail('nonEmptyClassRangesNoDash'); - } - - return [atom].concat(res); - } - - function parseNonemptyClassRanges() { - // NonemptyClassRanges :: - // ClassAtom - // ClassAtom NonemptyClassRangesNoDash - // ClassAtom - ClassAtom ClassRanges - - var atom = parseClassAtom(); - if (!atom) { - bail('classAtom'); - } - - if (current(']')) { - // ClassAtom - return [atom]; - } - - // ClassAtom NonemptyClassRangesNoDash - // ClassAtom - ClassAtom ClassRanges - return parseHelperClassRanges(atom); - } - - function parseNonemptyClassRangesNoDash() { - // NonemptyClassRangesNoDash :: - // ClassAtom - // ClassAtomNoDash NonemptyClassRangesNoDash - // ClassAtomNoDash - ClassAtom ClassRanges - - var res = parseClassAtom(); - if (!res) { - bail('classAtom'); - } - if (current(']')) { - // ClassAtom - return res; - } - - // ClassAtomNoDash NonemptyClassRangesNoDash - // ClassAtomNoDash - ClassAtom ClassRanges - return parseHelperClassRanges(res); - } - - function parseClassAtom() { - // ClassAtom :: - // - - // ClassAtomNoDash - if (match('-')) { - return createCharacter('-'); - } else { - return parseClassAtomNoDash(); - } - } - - function parseClassAtomNoDash() { - // ClassAtomNoDash :: - // SourceCharacter but not one of \ or ] or - - // \ ClassEscape - - var res; - if (res = matchReg(/^[^\\\]-]/)) { - return createCharacter(res[0]); - } else if (match('\\')) { - res = parseClassEscape(); - if (!res) { - bail('classEscape'); - } - - return parseUnicodeSurrogatePairEscape(res); - } - } - - function bail(message, details, from, to) { - from = from == null ? pos : from; - to = to == null ? from : to; - - var contextStart = Math.max(0, from - 10); - var contextEnd = Math.min(to + 10, str.length); - - // Output a bit of context and a line pointing to where our error is. - // - // We are assuming that there are no actual newlines in the content as this is a regular expression. - var context = ' ' + str.substring(contextStart, contextEnd); - var pointer = ' ' + new Array(from - contextStart + 1).join(' ') + '^'; - - throw SyntaxError(message + ' at position ' + from + (details ? ': ' + details : '') + '\n' + context + '\n' + pointer); - } - - var backrefDenied = []; - var closedCaptureCounter = 0; - var firstIteration = true; - var hasUnicodeFlag = (flags || "").indexOf("u") !== -1; - var pos = 0; - - // Convert the input to a string and treat the empty string special. - str = String(str); - if (str === '') { - str = '(?:)'; - } - - var result = parseDisjunction(); - - if (result.range[1] !== str.length) { - bail('Could not parse entire input - got stuck', '', result.range[1]); - } - - // The spec requires to interpret the `\2` in `/\2()()/` as backreference. - // As the parser collects the number of capture groups as the string is - // parsed it is impossible to make these decisions at the point when the - // `\2` is handled. In case the local decision turns out to be wrong after - // the parsing has finished, the input string is parsed a second time with - // the total number of capture groups set. - // - // SEE: https://github.com/jviereck/regjsparser/issues/70 - for (var i = 0; i < backrefDenied.length; i++) { - if (backrefDenied[i] <= closedCaptureCounter) { - // Parse the input a second time. - pos = 0; - firstIteration = false; - return parseDisjunction(); - } - } - - return result; - } - - var regjsparser = { - parse: parse - }; - - if (typeof module !== 'undefined' && module.exports) { - module.exports = regjsparser; - } else { - window.regjsparser = regjsparser; - } - -}()); - -},{}],591:[function(_dereq_,module,exports){ -var generate = _dereq_(589).generate; -var parse = _dereq_(590).parse; -var regenerate = _dereq_(588); -var iuMappings = _dereq_(587); -var ESCAPE_SETS = _dereq_(586); - -function getCharacterClassEscapeSet(character) { - if (unicode) { - if (ignoreCase) { - return ESCAPE_SETS.UNICODE_IGNORE_CASE[character]; - } - return ESCAPE_SETS.UNICODE[character]; - } - return ESCAPE_SETS.REGULAR[character]; -} - -var object = {}; -var hasOwnProperty = object.hasOwnProperty; -function has(object, property) { - return hasOwnProperty.call(object, property); -} - -// Prepare a Regenerate set containing all code points, used for negative -// character classes (if any). -var UNICODE_SET = regenerate().addRange(0x0, 0x10FFFF); -// Without the `u` flag, the range stops at 0xFFFF. -// https://mths.be/es6#sec-pattern-semantics -var BMP_SET = regenerate().addRange(0x0, 0xFFFF); - -// Prepare a Regenerate set containing all code points that are supposed to be -// matched by `/./u`. https://mths.be/es6#sec-atom -var DOT_SET_UNICODE = UNICODE_SET.clone() // all Unicode code points - .remove( - // minus `LineTerminator`s (https://mths.be/es6#sec-line-terminators): - 0x000A, // Line Feed - 0x000D, // Carriage Return - 0x2028, // Line Separator - 0x2029 // Paragraph Separator - ); -// Prepare a Regenerate set containing all code points that are supposed to be -// matched by `/./` (only BMP code points). -var DOT_SET = DOT_SET_UNICODE.clone() - .intersection(BMP_SET); - -// Add a range of code points + any case-folded code points in that range to a -// set. -regenerate.prototype.iuAddRange = function(min, max) { - var $this = this; - do { - var folded = caseFold(min); - if (folded) { - $this.add(folded); - } - } while (++min <= max); - return $this; -}; - -function assign(target, source) { - for (var key in source) { - // Note: `hasOwnProperty` is not needed here. - target[key] = source[key]; - } -} - -function update(item, pattern) { - // TODO: Test if memoizing `pattern` here is worth the effort. - if (!pattern) { - return; - } - var tree = parse(pattern, ''); - switch (tree.type) { - case 'characterClass': - case 'group': - case 'value': - // No wrapping needed. - break; - default: - // Wrap the pattern in a non-capturing group. - tree = wrap(tree, pattern); - } - assign(item, tree); -} - -function wrap(tree, pattern) { - // Wrap the pattern in a non-capturing group. - return { - 'type': 'group', - 'behavior': 'ignore', - 'body': [tree], - 'raw': '(?:' + pattern + ')' - }; -} - -function caseFold(codePoint) { - return has(iuMappings, codePoint) ? iuMappings[codePoint] : false; -} - -var ignoreCase = false; -var unicode = false; -function processCharacterClass(characterClassItem) { - var set = regenerate(); - var body = characterClassItem.body.forEach(function(item) { - switch (item.type) { - case 'value': - set.add(item.codePoint); - if (ignoreCase && unicode) { - var folded = caseFold(item.codePoint); - if (folded) { - set.add(folded); - } - } - break; - case 'characterClassRange': - var min = item.min.codePoint; - var max = item.max.codePoint; - set.addRange(min, max); - if (ignoreCase && unicode) { - set.iuAddRange(min, max); - } - break; - case 'characterClassEscape': - set.add(getCharacterClassEscapeSet(item.value)); - break; - // The `default` clause is only here as a safeguard; it should never be - // reached. Code coverage tools should ignore it. - /* istanbul ignore next */ - default: - throw Error('Unknown term type: ' + item.type); - } - }); - if (characterClassItem.negative) { - set = (unicode ? UNICODE_SET : BMP_SET).clone().remove(set); - } - update(characterClassItem, set.toString()); - return characterClassItem; -} - -function processTerm(item) { - switch (item.type) { - case 'dot': - update( - item, - (unicode ? DOT_SET_UNICODE : DOT_SET).toString() - ); - break; - case 'characterClass': - item = processCharacterClass(item); - break; - case 'characterClassEscape': - update( - item, - getCharacterClassEscapeSet(item.value).toString() - ); - break; - case 'alternative': - case 'disjunction': - case 'group': - case 'quantifier': - item.body = item.body.map(processTerm); - break; - case 'value': - var codePoint = item.codePoint; - var set = regenerate(codePoint); - if (ignoreCase && unicode) { - var folded = caseFold(codePoint); - if (folded) { - set.add(folded); - } - } - update(item, set.toString()); - break; - case 'anchor': - case 'empty': - case 'group': - case 'reference': - // Nothing to do here. - break; - // The `default` clause is only here as a safeguard; it should never be - // reached. Code coverage tools should ignore it. - /* istanbul ignore next */ - default: - throw Error('Unknown term type: ' + item.type); - } - return item; -}; - -module.exports = function(pattern, flags) { - var tree = parse(pattern, flags); - ignoreCase = flags ? flags.indexOf('i') > -1 : false; - unicode = flags ? flags.indexOf('u') > -1 : false; - assign(tree, processTerm(tree)); - return generate(tree); -}; - -},{"586":586,"587":587,"588":588,"589":589,"590":590}],592:[function(_dereq_,module,exports){ -'use strict'; -var isFinite = _dereq_(593); - -module.exports = function (str, n) { - if (typeof str !== 'string') { - throw new TypeError('Expected a string as the first argument'); - } - - if (n < 0 || !isFinite(n)) { - throw new TypeError('Expected a finite positive number'); - } - - var ret = ''; - - do { - if (n & 1) { - ret += str; - } - - str += str; - } while (n = n >> 1); - - return ret; -}; - -},{"593":593}],593:[function(_dereq_,module,exports){ -arguments[4][407][0].apply(exports,arguments) -},{"407":407,"594":594}],594:[function(_dereq_,module,exports){ -arguments[4][408][0].apply(exports,arguments) -},{"408":408}],595:[function(_dereq_,module,exports){ -'use strict'; -module.exports = /^#!.*/; - -},{}],596:[function(_dereq_,module,exports){ -'use strict'; -module.exports = function (str) { - var isExtendedLengthPath = /^\\\\\?\\/.test(str); - var hasNonAscii = /[^\x00-\x80]+/.test(str); - - if (isExtendedLengthPath || hasNonAscii) { - return str; - } - - return str.replace(/\\/g, '/'); -}; - -},{}],597:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var util = _dereq_(606); - - /** - * A data structure which is a combination of an array and a set. Adding a new - * member is O(1), testing for membership is O(1), and finding the index of an - * element is O(1). Removing elements from the set is not supported. Only - * strings are supported for membership. - */ - function ArraySet() { - this._array = []; - this._set = {}; - } - - /** - * Static method for creating ArraySet instances from an existing array. - */ - ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) { - var set = new ArraySet(); - for (var i = 0, len = aArray.length; i < len; i++) { - set.add(aArray[i], aAllowDuplicates); - } - return set; - }; - - /** - * Return how many unique items are in this ArraySet. If duplicates have been - * added, than those do not count towards the size. - * - * @returns Number - */ - ArraySet.prototype.size = function ArraySet_size() { - return Object.getOwnPropertyNames(this._set).length; - }; - - /** - * Add the given string to this set. - * - * @param String aStr - */ - ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) { - var sStr = util.toSetString(aStr); - var isDuplicate = this._set.hasOwnProperty(sStr); - var idx = this._array.length; - if (!isDuplicate || aAllowDuplicates) { - this._array.push(aStr); - } - if (!isDuplicate) { - this._set[sStr] = idx; - } - }; - - /** - * Is the given string a member of this set? - * - * @param String aStr - */ - ArraySet.prototype.has = function ArraySet_has(aStr) { - var sStr = util.toSetString(aStr); - return this._set.hasOwnProperty(sStr); - }; - - /** - * What is the index of the given string in the array? - * - * @param String aStr - */ - ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) { - var sStr = util.toSetString(aStr); - if (this._set.hasOwnProperty(sStr)) { - return this._set[sStr]; - } - throw new Error('"' + aStr + '" is not in the set.'); - }; - - /** - * What is the element at the given index? - * - * @param Number aIdx - */ - ArraySet.prototype.at = function ArraySet_at(aIdx) { - if (aIdx >= 0 && aIdx < this._array.length) { - return this._array[aIdx]; - } - throw new Error('No element indexed by ' + aIdx); - }; - - /** - * Returns the array representation of this set (which has the proper indices - * indicated by indexOf). Note that this is a copy of the internal array used - * for storing the members so that no one can mess with internal state. - */ - ArraySet.prototype.toArray = function ArraySet_toArray() { - return this._array.slice(); - }; - - exports.ArraySet = ArraySet; -} - -},{"606":606}],598:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - * - * Based on the Base 64 VLQ implementation in Closure Compiler: - * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java - * - * Copyright 2011 The Closure Compiler Authors. All rights reserved. - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials provided - * with the distribution. - * * Neither the name of Google Inc. nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ -{ - var base64 = _dereq_(599); - - // A single base 64 digit can contain 6 bits of data. For the base 64 variable - // length quantities we use in the source map spec, the first bit is the sign, - // the next four bits are the actual value, and the 6th bit is the - // continuation bit. The continuation bit tells us whether there are more - // digits in this value following this digit. - // - // Continuation - // | Sign - // | | - // V V - // 101011 - - var VLQ_BASE_SHIFT = 5; - - // binary: 100000 - var VLQ_BASE = 1 << VLQ_BASE_SHIFT; - - // binary: 011111 - var VLQ_BASE_MASK = VLQ_BASE - 1; - - // binary: 100000 - var VLQ_CONTINUATION_BIT = VLQ_BASE; - - /** - * Converts from a two-complement value to a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 1 becomes 2 (10 binary), -1 becomes 3 (11 binary) - * 2 becomes 4 (100 binary), -2 becomes 5 (101 binary) - */ - function toVLQSigned(aValue) { - return aValue < 0 - ? ((-aValue) << 1) + 1 - : (aValue << 1) + 0; - } - - /** - * Converts to a two-complement value from a value where the sign bit is - * placed in the least significant bit. For example, as decimals: - * 2 (10 binary) becomes 1, 3 (11 binary) becomes -1 - * 4 (100 binary) becomes 2, 5 (101 binary) becomes -2 - */ - function fromVLQSigned(aValue) { - var isNegative = (aValue & 1) === 1; - var shifted = aValue >> 1; - return isNegative - ? -shifted - : shifted; - } - - /** - * Returns the base 64 VLQ encoded value. - */ - exports.encode = function base64VLQ_encode(aValue) { - var encoded = ""; - var digit; - - var vlq = toVLQSigned(aValue); - - do { - digit = vlq & VLQ_BASE_MASK; - vlq >>>= VLQ_BASE_SHIFT; - if (vlq > 0) { - // There are still more digits in this value, so we must make sure the - // continuation bit is marked. - digit |= VLQ_CONTINUATION_BIT; - } - encoded += base64.encode(digit); - } while (vlq > 0); - - return encoded; - }; - - /** - * Decodes the next base 64 VLQ value from the given string and returns the - * value and the rest of the string via the out parameter. - */ - exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) { - var strLen = aStr.length; - var result = 0; - var shift = 0; - var continuation, digit; - - do { - if (aIndex >= strLen) { - throw new Error("Expected more digits in base 64 VLQ value."); - } - - digit = base64.decode(aStr.charCodeAt(aIndex++)); - if (digit === -1) { - throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1)); - } - - continuation = !!(digit & VLQ_CONTINUATION_BIT); - digit &= VLQ_BASE_MASK; - result = result + (digit << shift); - shift += VLQ_BASE_SHIFT; - } while (continuation); - - aOutParam.value = fromVLQSigned(result); - aOutParam.rest = aIndex; - }; -} - -},{"599":599}],599:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split(''); - - /** - * Encode an integer in the range of 0 to 63 to a single base 64 digit. - */ - exports.encode = function (number) { - if (0 <= number && number < intToCharMap.length) { - return intToCharMap[number]; - } - throw new TypeError("Must be between 0 and 63: " + number); - }; - - /** - * Decode a single base 64 character code digit to an integer. Returns -1 on - * failure. - */ - exports.decode = function (charCode) { - var bigA = 65; // 'A' - var bigZ = 90; // 'Z' - - var littleA = 97; // 'a' - var littleZ = 122; // 'z' - - var zero = 48; // '0' - var nine = 57; // '9' - - var plus = 43; // '+' - var slash = 47; // '/' - - var littleOffset = 26; - var numberOffset = 52; - - // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ - if (bigA <= charCode && charCode <= bigZ) { - return (charCode - bigA); - } - - // 26 - 51: abcdefghijklmnopqrstuvwxyz - if (littleA <= charCode && charCode <= littleZ) { - return (charCode - littleA + littleOffset); - } - - // 52 - 61: 0123456789 - if (zero <= charCode && charCode <= nine) { - return (charCode - zero + numberOffset); - } - - // 62: + - if (charCode == plus) { - return 62; - } - - // 63: / - if (charCode == slash) { - return 63; - } - - // Invalid base64 digit. - return -1; - }; -} - -},{}],600:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - exports.GREATEST_LOWER_BOUND = 1; - exports.LEAST_UPPER_BOUND = 2; - - /** - * Recursive implementation of binary search. - * - * @param aLow Indices here and lower do not contain the needle. - * @param aHigh Indices here and higher do not contain the needle. - * @param aNeedle The element being searched for. - * @param aHaystack The non-empty array being searched. - * @param aCompare Function which takes two elements and returns -1, 0, or 1. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - */ - function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) { - // This function terminates when one of the following is true: - // - // 1. We find the exact element we are looking for. - // - // 2. We did not find the exact element, but we can return the index of - // the next-closest element. - // - // 3. We did not find the exact element, and there is no next-closest - // element than the one we are searching for, so we return -1. - var mid = Math.floor((aHigh - aLow) / 2) + aLow; - var cmp = aCompare(aNeedle, aHaystack[mid], true); - if (cmp === 0) { - // Found the element we are looking for. - return mid; - } - else if (cmp > 0) { - // Our needle is greater than aHaystack[mid]. - if (aHigh - mid > 1) { - // The element is in the upper half. - return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias); - } - - // The exact needle element was not found in this haystack. Determine if - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return aHigh < aHaystack.length ? aHigh : -1; - } else { - return mid; - } - } - else { - // Our needle is less than aHaystack[mid]. - if (mid - aLow > 1) { - // The element is in the lower half. - return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias); - } - - // we are in termination case (3) or (2) and return the appropriate thing. - if (aBias == exports.LEAST_UPPER_BOUND) { - return mid; - } else { - return aLow < 0 ? -1 : aLow; - } - } - } - - /** - * This is an implementation of binary search which will always try and return - * the index of the closest element if there is no exact hit. This is because - * mappings between original and generated line/col pairs are single points, - * and there is an implicit region between each of them, so a miss just means - * that you aren't on the very start of a region. - * - * @param aNeedle The element you are looking for. - * @param aHaystack The array that is being searched. - * @param aCompare A function which takes the needle and an element in the - * array and returns -1, 0, or 1 depending on whether the needle is less - * than, equal to, or greater than the element, respectively. - * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or - * 'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'binarySearch.GREATEST_LOWER_BOUND'. - */ - exports.search = function search(aNeedle, aHaystack, aCompare, aBias) { - if (aHaystack.length === 0) { - return -1; - } - - var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack, - aCompare, aBias || exports.GREATEST_LOWER_BOUND); - if (index < 0) { - return -1; - } - - // We have found either the exact element, or the next-closest element than - // the one we are searching for. However, there may be more than one such - // element. Make sure we always return the smallest of these. - while (index - 1 >= 0) { - if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) { - break; - } - --index; - } - - return index; - }; -} - -},{}],601:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2014 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var util = _dereq_(606); - - /** - * Determine whether mappingB is after mappingA with respect to generated - * position. - */ - function generatedPositionAfter(mappingA, mappingB) { - // Optimized for most common case - var lineA = mappingA.generatedLine; - var lineB = mappingB.generatedLine; - var columnA = mappingA.generatedColumn; - var columnB = mappingB.generatedColumn; - return lineB > lineA || lineB == lineA && columnB >= columnA || - util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0; - } - - /** - * A data structure to provide a sorted view of accumulated mappings in a - * performance conscious manner. It trades a neglibable overhead in general - * case for a large speedup in case of mappings being added in order. - */ - function MappingList() { - this._array = []; - this._sorted = true; - // Serves as infimum - this._last = {generatedLine: -1, generatedColumn: 0}; - } - - /** - * Iterate through internal items. This method takes the same arguments that - * `Array.prototype.forEach` takes. - * - * NOTE: The order of the mappings is NOT guaranteed. - */ - MappingList.prototype.unsortedForEach = - function MappingList_forEach(aCallback, aThisArg) { - this._array.forEach(aCallback, aThisArg); - }; - - /** - * Add the given source mapping. - * - * @param Object aMapping - */ - MappingList.prototype.add = function MappingList_add(aMapping) { - if (generatedPositionAfter(this._last, aMapping)) { - this._last = aMapping; - this._array.push(aMapping); - } else { - this._sorted = false; - this._array.push(aMapping); - } - }; - - /** - * Returns the flat, sorted array of mappings. The mappings are sorted by - * generated position. - * - * WARNING: This method returns internal data without copying, for - * performance. The return value must NOT be mutated, and should be treated as - * an immutable borrow. If you want to take ownership, you must make your own - * copy. - */ - MappingList.prototype.toArray = function MappingList_toArray() { - if (!this._sorted) { - this._array.sort(util.compareByGeneratedPositionsInflated); - this._sorted = true; - } - return this._array; - }; - - exports.MappingList = MappingList; -} - -},{"606":606}],602:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - // It turns out that some (most?) JavaScript engines don't self-host - // `Array.prototype.sort`. This makes sense because C++ will likely remain - // faster than JS when doing raw CPU-intensive sorting. However, when using a - // custom comparator function, calling back and forth between the VM's C++ and - // JIT'd JS is rather slow *and* loses JIT type information, resulting in - // worse generated code for the comparator function than would be optimal. In - // fact, when sorting with a comparator, these costs outweigh the benefits of - // sorting in C++. By using our own JS-implemented Quick Sort (below), we get - // a ~3500ms mean speed-up in `bench/bench.html`. - - /** - * Swap the elements indexed by `x` and `y` in the array `ary`. - * - * @param {Array} ary - * The array. - * @param {Number} x - * The index of the first item. - * @param {Number} y - * The index of the second item. - */ - function swap(ary, x, y) { - var temp = ary[x]; - ary[x] = ary[y]; - ary[y] = temp; - } - - /** - * Returns a random integer within the range `low .. high` inclusive. - * - * @param {Number} low - * The lower bound on the range. - * @param {Number} high - * The upper bound on the range. - */ - function randomIntInRange(low, high) { - return Math.round(low + (Math.random() * (high - low))); - } - - /** - * The Quick Sort algorithm. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - * @param {Number} p - * Start index of the array - * @param {Number} r - * End index of the array - */ - function doQuickSort(ary, comparator, p, r) { - // If our lower bound is less than our upper bound, we (1) partition the - // array into two pieces and (2) recurse on each half. If it is not, this is - // the empty array and our base case. - - if (p < r) { - // (1) Partitioning. - // - // The partitioning chooses a pivot between `p` and `r` and moves all - // elements that are less than or equal to the pivot to the before it, and - // all the elements that are greater than it after it. The effect is that - // once partition is done, the pivot is in the exact place it will be when - // the array is put in sorted order, and it will not need to be moved - // again. This runs in O(n) time. - - // Always choose a random pivot so that an input array which is reverse - // sorted does not cause O(n^2) running time. - var pivotIndex = randomIntInRange(p, r); - var i = p - 1; - - swap(ary, pivotIndex, r); - var pivot = ary[r]; - - // Immediately after `j` is incremented in this loop, the following hold - // true: - // - // * Every element in `ary[p .. i]` is less than or equal to the pivot. - // - // * Every element in `ary[i+1 .. j-1]` is greater than the pivot. - for (var j = p; j < r; j++) { - if (comparator(ary[j], pivot) <= 0) { - i += 1; - swap(ary, i, j); - } - } - - swap(ary, i + 1, j); - var q = i + 1; - - // (2) Recurse on each half. - - doQuickSort(ary, comparator, p, q - 1); - doQuickSort(ary, comparator, q + 1, r); - } - } - - /** - * Sort the given array in-place with the given comparator function. - * - * @param {Array} ary - * An array to sort. - * @param {function} comparator - * Function to use to compare two items. - */ - exports.quickSort = function (ary, comparator) { - doQuickSort(ary, comparator, 0, ary.length - 1); - }; -} - -},{}],603:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var util = _dereq_(606); - var binarySearch = _dereq_(600); - var ArraySet = _dereq_(597).ArraySet; - var base64VLQ = _dereq_(598); - var quickSort = _dereq_(602).quickSort; - - function SourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - return sourceMap.sections != null - ? new IndexedSourceMapConsumer(sourceMap) - : new BasicSourceMapConsumer(sourceMap); - } - - SourceMapConsumer.fromSourceMap = function(aSourceMap) { - return BasicSourceMapConsumer.fromSourceMap(aSourceMap); - } - - /** - * The version of the source mapping spec that we are consuming. - */ - SourceMapConsumer.prototype._version = 3; - - // `__generatedMappings` and `__originalMappings` are arrays that hold the - // parsed mapping coordinates from the source map's "mappings" attribute. They - // are lazily instantiated, accessed via the `_generatedMappings` and - // `_originalMappings` getters respectively, and we only parse the mappings - // and create these arrays once queried for a source location. We jump through - // these hoops because there can be many thousands of mappings, and parsing - // them is expensive, so we only want to do it if we must. - // - // Each object in the arrays is of the form: - // - // { - // generatedLine: The line number in the generated code, - // generatedColumn: The column number in the generated code, - // source: The path to the original source file that generated this - // chunk of code, - // originalLine: The line number in the original source that - // corresponds to this chunk of generated code, - // originalColumn: The column number in the original source that - // corresponds to this chunk of generated code, - // name: The name of the original symbol which generated this chunk of - // code. - // } - // - // All properties except for `generatedLine` and `generatedColumn` can be - // `null`. - // - // `_generatedMappings` is ordered by the generated positions. - // - // `_originalMappings` is ordered by the original positions. - - SourceMapConsumer.prototype.__generatedMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', { - get: function () { - if (!this.__generatedMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__generatedMappings; - } - }); - - SourceMapConsumer.prototype.__originalMappings = null; - Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', { - get: function () { - if (!this.__originalMappings) { - this._parseMappings(this._mappings, this.sourceRoot); - } - - return this.__originalMappings; - } - }); - - SourceMapConsumer.prototype._charIsMappingSeparator = - function SourceMapConsumer_charIsMappingSeparator(aStr, index) { - var c = aStr.charAt(index); - return c === ";" || c === ","; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - SourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - throw new Error("Subclasses must implement _parseMappings"); - }; - - SourceMapConsumer.GENERATED_ORDER = 1; - SourceMapConsumer.ORIGINAL_ORDER = 2; - - SourceMapConsumer.GREATEST_LOWER_BOUND = 1; - SourceMapConsumer.LEAST_UPPER_BOUND = 2; - - /** - * Iterate over each mapping between an original source/line/column and a - * generated line/column in this source map. - * - * @param Function aCallback - * The function that is called with each mapping. - * @param Object aContext - * Optional. If specified, this object will be the value of `this` every - * time that `aCallback` is called. - * @param aOrder - * Either `SourceMapConsumer.GENERATED_ORDER` or - * `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to - * iterate over the mappings sorted by the generated file's line/column - * order or the original's source/line/column order, respectively. Defaults to - * `SourceMapConsumer.GENERATED_ORDER`. - */ - SourceMapConsumer.prototype.eachMapping = - function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) { - var context = aContext || null; - var order = aOrder || SourceMapConsumer.GENERATED_ORDER; - - var mappings; - switch (order) { - case SourceMapConsumer.GENERATED_ORDER: - mappings = this._generatedMappings; - break; - case SourceMapConsumer.ORIGINAL_ORDER: - mappings = this._originalMappings; - break; - default: - throw new Error("Unknown order of iteration."); - } - - var sourceRoot = this.sourceRoot; - mappings.map(function (mapping) { - var source = mapping.source === null ? null : this._sources.at(mapping.source); - if (source != null && sourceRoot != null) { - source = util.join(sourceRoot, source); - } - return { - source: source, - generatedLine: mapping.generatedLine, - generatedColumn: mapping.generatedColumn, - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: mapping.name === null ? null : this._names.at(mapping.name) - }; - }, this).forEach(aCallback, context); - }; - - /** - * Returns all generated line and column information for the original source, - * line, and column provided. If no column is provided, returns all mappings - * corresponding to a either the line we are searching for or the next - * closest line that has any mappings. Otherwise, returns all mappings - * corresponding to the given line and either the column we are searching for - * or the next closest column that has any offsets. - * - * The only argument is an object with the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: Optional. the column number in the original source. - * - * and an array of objects is returned, each with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - SourceMapConsumer.prototype.allGeneratedPositionsFor = - function SourceMapConsumer_allGeneratedPositionsFor(aArgs) { - var line = util.getArg(aArgs, 'line'); - - // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping - // returns the index of the closest mapping less than the needle. By - // setting needle.originalColumn to 0, we thus find the last mapping for - // the given line, provided such a mapping exists. - var needle = { - source: util.getArg(aArgs, 'source'), - originalLine: line, - originalColumn: util.getArg(aArgs, 'column', 0) - }; - - if (this.sourceRoot != null) { - needle.source = util.relative(this.sourceRoot, needle.source); - } - if (!this._sources.has(needle.source)) { - return []; - } - needle.source = this._sources.indexOf(needle.source); - - var mappings = []; - - var index = this._findMapping(needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - binarySearch.LEAST_UPPER_BOUND); - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (aArgs.column === undefined) { - var originalLine = mapping.originalLine; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we found. Since - // mappings are sorted, this is guaranteed to find all mappings for - // the line we found. - while (mapping && mapping.originalLine === originalLine) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } else { - var originalColumn = mapping.originalColumn; - - // Iterate until either we run out of mappings, or we run into - // a mapping for a different line than the one we were searching for. - // Since mappings are sorted, this is guaranteed to find all mappings for - // the line we are searching for. - while (mapping && - mapping.originalLine === line && - mapping.originalColumn == originalColumn) { - mappings.push({ - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }); - - mapping = this._originalMappings[++index]; - } - } - } - - return mappings; - }; - - exports.SourceMapConsumer = SourceMapConsumer; - - /** - * A BasicSourceMapConsumer instance represents a parsed source map which we can - * query for information about the original file positions by giving it a file - * position in the generated source. - * - * The only parameter is the raw source map (either as a JSON string, or - * already parsed to an object). According to the spec, source maps have the - * following attributes: - * - * - version: Which version of the source map spec this map is following. - * - sources: An array of URLs to the original source files. - * - names: An array of identifiers which can be referrenced by individual mappings. - * - sourceRoot: Optional. The URL root from which all sources are relative. - * - sourcesContent: Optional. An array of contents of the original source files. - * - mappings: A string of base64 VLQs which contain the actual mappings. - * - file: Optional. The generated file this source map is associated with. - * - * Here is an example source map, taken from the source map spec[0]: - * - * { - * version : 3, - * file: "out.js", - * sourceRoot : "", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AA,AB;;ABCDE;" - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1# - */ - function BasicSourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sources = util.getArg(sourceMap, 'sources'); - // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which - // requires the array) to play nice here. - var names = util.getArg(sourceMap, 'names', []); - var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null); - var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null); - var mappings = util.getArg(sourceMap, 'mappings'); - var file = util.getArg(sourceMap, 'file', null); - - // Once again, Sass deviates from the spec and supplies the version as a - // string rather than a number, so we use loose equality checking here. - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - sources = sources - // Some source maps produce relative source paths like "./foo.js" instead of - // "foo.js". Normalize these first so that future comparisons will succeed. - // See bugzil.la/1090768. - .map(util.normalize) - // Always ensure that absolute sources are internally stored relative to - // the source root, if the source root is absolute. Not doing this would - // be particularly problematic when the source root is a prefix of the - // source (valid, but why??). See github issue #199 and bugzil.la/1188982. - .map(function (source) { - return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source) - ? util.relative(sourceRoot, source) - : source; - }); - - // Pass `true` below to allow duplicate names and sources. While source maps - // are intended to be compressed and deduplicated, the TypeScript compiler - // sometimes generates source maps with duplicates in them. See Github issue - // #72 and bugzil.la/889492. - this._names = ArraySet.fromArray(names, true); - this._sources = ArraySet.fromArray(sources, true); - - this.sourceRoot = sourceRoot; - this.sourcesContent = sourcesContent; - this._mappings = mappings; - this.file = file; - } - - BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer; - - /** - * Create a BasicSourceMapConsumer from a SourceMapGenerator. - * - * @param SourceMapGenerator aSourceMap - * The source map that will be consumed. - * @returns BasicSourceMapConsumer - */ - BasicSourceMapConsumer.fromSourceMap = - function SourceMapConsumer_fromSourceMap(aSourceMap) { - var smc = Object.create(BasicSourceMapConsumer.prototype); - - var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true); - var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true); - smc.sourceRoot = aSourceMap._sourceRoot; - smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(), - smc.sourceRoot); - smc.file = aSourceMap._file; - - // Because we are modifying the entries (by converting string sources and - // names to indices into the sources and names ArraySets), we have to make - // a copy of the entry or else bad things happen. Shared mutable state - // strikes again! See github issue #191. - - var generatedMappings = aSourceMap._mappings.toArray().slice(); - var destGeneratedMappings = smc.__generatedMappings = []; - var destOriginalMappings = smc.__originalMappings = []; - - for (var i = 0, length = generatedMappings.length; i < length; i++) { - var srcMapping = generatedMappings[i]; - var destMapping = new Mapping; - destMapping.generatedLine = srcMapping.generatedLine; - destMapping.generatedColumn = srcMapping.generatedColumn; - - if (srcMapping.source) { - destMapping.source = sources.indexOf(srcMapping.source); - destMapping.originalLine = srcMapping.originalLine; - destMapping.originalColumn = srcMapping.originalColumn; - - if (srcMapping.name) { - destMapping.name = names.indexOf(srcMapping.name); - } - - destOriginalMappings.push(destMapping); - } - - destGeneratedMappings.push(destMapping); - } - - quickSort(smc.__originalMappings, util.compareByOriginalPositions); - - return smc; - }; - - /** - * The version of the source mapping spec that we are consuming. - */ - BasicSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', { - get: function () { - return this._sources.toArray().map(function (s) { - return this.sourceRoot != null ? util.join(this.sourceRoot, s) : s; - }, this); - } - }); - - /** - * Provide the JIT with a nice shape / hidden class. - */ - function Mapping() { - this.generatedLine = 0; - this.generatedColumn = 0; - this.source = null; - this.originalLine = null; - this.originalColumn = null; - this.name = null; - } - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - BasicSourceMapConsumer.prototype._parseMappings = - function SourceMapConsumer_parseMappings(aStr, aSourceRoot) { - var generatedLine = 1; - var previousGeneratedColumn = 0; - var previousOriginalLine = 0; - var previousOriginalColumn = 0; - var previousSource = 0; - var previousName = 0; - var length = aStr.length; - var index = 0; - var cachedSegments = {}; - var temp = {}; - var originalMappings = []; - var generatedMappings = []; - var mapping, str, segment, end, value; - - while (index < length) { - if (aStr.charAt(index) === ';') { - generatedLine++; - index++; - previousGeneratedColumn = 0; - } - else if (aStr.charAt(index) === ',') { - index++; - } - else { - mapping = new Mapping(); - mapping.generatedLine = generatedLine; - - // Because each offset is encoded relative to the previous one, - // many segments often have the same encoding. We can exploit this - // fact by caching the parsed variable length fields of each segment, - // allowing us to avoid a second parse if we encounter the same - // segment again. - for (end = index; end < length; end++) { - if (this._charIsMappingSeparator(aStr, end)) { - break; - } - } - str = aStr.slice(index, end); - - segment = cachedSegments[str]; - if (segment) { - index += str.length; - } else { - segment = []; - while (index < end) { - base64VLQ.decode(aStr, index, temp); - value = temp.value; - index = temp.rest; - segment.push(value); - } - - if (segment.length === 2) { - throw new Error('Found a source, but no line and column'); - } - - if (segment.length === 3) { - throw new Error('Found a source and line, but no column'); - } - - cachedSegments[str] = segment; - } - - // Generated column. - mapping.generatedColumn = previousGeneratedColumn + segment[0]; - previousGeneratedColumn = mapping.generatedColumn; - - if (segment.length > 1) { - // Original source. - mapping.source = previousSource + segment[1]; - previousSource += segment[1]; - - // Original line. - mapping.originalLine = previousOriginalLine + segment[2]; - previousOriginalLine = mapping.originalLine; - // Lines are stored 0-based - mapping.originalLine += 1; - - // Original column. - mapping.originalColumn = previousOriginalColumn + segment[3]; - previousOriginalColumn = mapping.originalColumn; - - if (segment.length > 4) { - // Original name. - mapping.name = previousName + segment[4]; - previousName += segment[4]; - } - } - - generatedMappings.push(mapping); - if (typeof mapping.originalLine === 'number') { - originalMappings.push(mapping); - } - } - } - - quickSort(generatedMappings, util.compareByGeneratedPositionsDeflated); - this.__generatedMappings = generatedMappings; - - quickSort(originalMappings, util.compareByOriginalPositions); - this.__originalMappings = originalMappings; - }; - - /** - * Find the mapping that best matches the hypothetical "needle" mapping that - * we are searching for in the given "haystack" of mappings. - */ - BasicSourceMapConsumer.prototype._findMapping = - function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName, - aColumnName, aComparator, aBias) { - // To return the position we are searching for, we must first find the - // mapping for the given position and then return the opposite position it - // points to. Because the mappings are sorted, we can use binary search to - // find the best mapping. - - if (aNeedle[aLineName] <= 0) { - throw new TypeError('Line must be greater than or equal to 1, got ' - + aNeedle[aLineName]); - } - if (aNeedle[aColumnName] < 0) { - throw new TypeError('Column must be greater than or equal to 0, got ' - + aNeedle[aColumnName]); - } - - return binarySearch.search(aNeedle, aMappings, aComparator, aBias); - }; - - /** - * Compute the last column for each generated mapping. The last column is - * inclusive. - */ - BasicSourceMapConsumer.prototype.computeColumnSpans = - function SourceMapConsumer_computeColumnSpans() { - for (var index = 0; index < this._generatedMappings.length; ++index) { - var mapping = this._generatedMappings[index]; - - // Mappings do not contain a field for the last generated columnt. We - // can come up with an optimistic estimate, however, by assuming that - // mappings are contiguous (i.e. given two consecutive mappings, the - // first mapping ends where the second one starts). - if (index + 1 < this._generatedMappings.length) { - var nextMapping = this._generatedMappings[index + 1]; - - if (mapping.generatedLine === nextMapping.generatedLine) { - mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1; - continue; - } - } - - // The last mapping for each line spans the entire line. - mapping.lastGeneratedColumn = Infinity; - } - }; - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - BasicSourceMapConsumer.prototype.originalPositionFor = - function SourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._generatedMappings, - "generatedLine", - "generatedColumn", - util.compareByGeneratedPositionsDeflated, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._generatedMappings[index]; - - if (mapping.generatedLine === needle.generatedLine) { - var source = util.getArg(mapping, 'source', null); - if (source !== null) { - source = this._sources.at(source); - if (this.sourceRoot != null) { - source = util.join(this.sourceRoot, source); - } - } - var name = util.getArg(mapping, 'name', null); - if (name !== null) { - name = this._names.at(name); - } - return { - source: source, - line: util.getArg(mapping, 'originalLine', null), - column: util.getArg(mapping, 'originalColumn', null), - name: name - }; - } - } - - return { - source: null, - line: null, - column: null, - name: null - }; - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - BasicSourceMapConsumer.prototype.hasContentsOfAllSources = - function BasicSourceMapConsumer_hasContentsOfAllSources() { - if (!this.sourcesContent) { - return false; - } - return this.sourcesContent.length >= this._sources.size() && - !this.sourcesContent.some(function (sc) { return sc == null; }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - BasicSourceMapConsumer.prototype.sourceContentFor = - function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - if (!this.sourcesContent) { - return null; - } - - if (this.sourceRoot != null) { - aSource = util.relative(this.sourceRoot, aSource); - } - - if (this._sources.has(aSource)) { - return this.sourcesContent[this._sources.indexOf(aSource)]; - } - - var url; - if (this.sourceRoot != null - && (url = util.urlParse(this.sourceRoot))) { - // XXX: file:// URIs and absolute paths lead to unexpected behavior for - // many users. We can help them out when they expect file:// URIs to - // behave like it would if they were running a local HTTP server. See - // https://bugzilla.mozilla.org/show_bug.cgi?id=885597. - var fileUriAbsPath = aSource.replace(/^file:\/\//, ""); - if (url.scheme == "file" - && this._sources.has(fileUriAbsPath)) { - return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)] - } - - if ((!url.path || url.path == "/") - && this._sources.has("/" + aSource)) { - return this.sourcesContent[this._sources.indexOf("/" + aSource)]; - } - } - - // This function is used recursively from - // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we - // don't want to throw if we can't find the source - we just want to - // return null, so we provide a flag to exit gracefully. - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or - * 'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the - * closest element that is smaller than or greater than the one we are - * searching for, respectively, if the exact element cannot be found. - * Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - BasicSourceMapConsumer.prototype.generatedPositionFor = - function SourceMapConsumer_generatedPositionFor(aArgs) { - var source = util.getArg(aArgs, 'source'); - if (this.sourceRoot != null) { - source = util.relative(this.sourceRoot, source); - } - if (!this._sources.has(source)) { - return { - line: null, - column: null, - lastColumn: null - }; - } - source = this._sources.indexOf(source); - - var needle = { - source: source, - originalLine: util.getArg(aArgs, 'line'), - originalColumn: util.getArg(aArgs, 'column') - }; - - var index = this._findMapping( - needle, - this._originalMappings, - "originalLine", - "originalColumn", - util.compareByOriginalPositions, - util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND) - ); - - if (index >= 0) { - var mapping = this._originalMappings[index]; - - if (mapping.source === needle.source) { - return { - line: util.getArg(mapping, 'generatedLine', null), - column: util.getArg(mapping, 'generatedColumn', null), - lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null) - }; - } - } - - return { - line: null, - column: null, - lastColumn: null - }; - }; - - exports.BasicSourceMapConsumer = BasicSourceMapConsumer; - - /** - * An IndexedSourceMapConsumer instance represents a parsed source map which - * we can query for information. It differs from BasicSourceMapConsumer in - * that it takes "indexed" source maps (i.e. ones with a "sections" field) as - * input. - * - * The only parameter is a raw source map (either as a JSON string, or already - * parsed to an object). According to the spec for indexed source maps, they - * have the following attributes: - * - * - version: Which version of the source map spec this map is following. - * - file: Optional. The generated file this source map is associated with. - * - sections: A list of section definitions. - * - * Each value under the "sections" field has two fields: - * - offset: The offset into the original specified at which this section - * begins to apply, defined as an object with a "line" and "column" - * field. - * - map: A source map definition. This source map could also be indexed, - * but doesn't have to be. - * - * Instead of the "map" field, it's also possible to have a "url" field - * specifying a URL to retrieve a source map from, but that's currently - * unsupported. - * - * Here's an example source map, taken from the source map spec[0], but - * modified to omit a section which uses the "url" field. - * - * { - * version : 3, - * file: "app.js", - * sections: [{ - * offset: {line:100, column:10}, - * map: { - * version : 3, - * file: "section.js", - * sources: ["foo.js", "bar.js"], - * names: ["src", "maps", "are", "fun"], - * mappings: "AAAA,E;;ABCDE;" - * } - * }], - * } - * - * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt - */ - function IndexedSourceMapConsumer(aSourceMap) { - var sourceMap = aSourceMap; - if (typeof aSourceMap === 'string') { - sourceMap = JSON.parse(aSourceMap.replace(/^\)\]\}'/, '')); - } - - var version = util.getArg(sourceMap, 'version'); - var sections = util.getArg(sourceMap, 'sections'); - - if (version != this._version) { - throw new Error('Unsupported version: ' + version); - } - - this._sources = new ArraySet(); - this._names = new ArraySet(); - - var lastOffset = { - line: -1, - column: 0 - }; - this._sections = sections.map(function (s) { - if (s.url) { - // The url field will require support for asynchronicity. - // See https://github.com/mozilla/source-map/issues/16 - throw new Error('Support for url field in sections not implemented.'); - } - var offset = util.getArg(s, 'offset'); - var offsetLine = util.getArg(offset, 'line'); - var offsetColumn = util.getArg(offset, 'column'); - - if (offsetLine < lastOffset.line || - (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) { - throw new Error('Section offsets must be ordered and non-overlapping.'); - } - lastOffset = offset; - - return { - generatedOffset: { - // The offset fields are 0-based, but we use 1-based indices when - // encoding/decoding from VLQ. - generatedLine: offsetLine + 1, - generatedColumn: offsetColumn + 1 - }, - consumer: new SourceMapConsumer(util.getArg(s, 'map')) - } - }); - } - - IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype); - IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer; - - /** - * The version of the source mapping spec that we are consuming. - */ - IndexedSourceMapConsumer.prototype._version = 3; - - /** - * The list of original sources. - */ - Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', { - get: function () { - var sources = []; - for (var i = 0; i < this._sections.length; i++) { - for (var j = 0; j < this._sections[i].consumer.sources.length; j++) { - sources.push(this._sections[i].consumer.sources[j]); - } - } - return sources; - } - }); - - /** - * Returns the original source, line, and column information for the generated - * source's line and column positions provided. The only argument is an object - * with the following properties: - * - * - line: The line number in the generated source. - * - column: The column number in the generated source. - * - * and an object is returned with the following properties: - * - * - source: The original source file, or null. - * - line: The line number in the original source, or null. - * - column: The column number in the original source, or null. - * - name: The original identifier, or null. - */ - IndexedSourceMapConsumer.prototype.originalPositionFor = - function IndexedSourceMapConsumer_originalPositionFor(aArgs) { - var needle = { - generatedLine: util.getArg(aArgs, 'line'), - generatedColumn: util.getArg(aArgs, 'column') - }; - - // Find the section containing the generated position we're trying to map - // to an original position. - var sectionIndex = binarySearch.search(needle, this._sections, - function(needle, section) { - var cmp = needle.generatedLine - section.generatedOffset.generatedLine; - if (cmp) { - return cmp; - } - - return (needle.generatedColumn - - section.generatedOffset.generatedColumn); - }); - var section = this._sections[sectionIndex]; - - if (!section) { - return { - source: null, - line: null, - column: null, - name: null - }; - } - - return section.consumer.originalPositionFor({ - line: needle.generatedLine - - (section.generatedOffset.generatedLine - 1), - column: needle.generatedColumn - - (section.generatedOffset.generatedLine === needle.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - bias: aArgs.bias - }); - }; - - /** - * Return true if we have the source content for every source in the source - * map, false otherwise. - */ - IndexedSourceMapConsumer.prototype.hasContentsOfAllSources = - function IndexedSourceMapConsumer_hasContentsOfAllSources() { - return this._sections.every(function (s) { - return s.consumer.hasContentsOfAllSources(); - }); - }; - - /** - * Returns the original source content. The only argument is the url of the - * original source file. Returns null if no original source content is - * available. - */ - IndexedSourceMapConsumer.prototype.sourceContentFor = - function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - var content = section.consumer.sourceContentFor(aSource, true); - if (content) { - return content; - } - } - if (nullOnMissing) { - return null; - } - else { - throw new Error('"' + aSource + '" is not in the SourceMap.'); - } - }; - - /** - * Returns the generated line and column information for the original source, - * line, and column positions provided. The only argument is an object with - * the following properties: - * - * - source: The filename of the original source. - * - line: The line number in the original source. - * - column: The column number in the original source. - * - * and an object is returned with the following properties: - * - * - line: The line number in the generated source, or null. - * - column: The column number in the generated source, or null. - */ - IndexedSourceMapConsumer.prototype.generatedPositionFor = - function IndexedSourceMapConsumer_generatedPositionFor(aArgs) { - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - - // Only consider this section if the requested source is in the list of - // sources of the consumer. - if (section.consumer.sources.indexOf(util.getArg(aArgs, 'source')) === -1) { - continue; - } - var generatedPosition = section.consumer.generatedPositionFor(aArgs); - if (generatedPosition) { - var ret = { - line: generatedPosition.line + - (section.generatedOffset.generatedLine - 1), - column: generatedPosition.column + - (section.generatedOffset.generatedLine === generatedPosition.line - ? section.generatedOffset.generatedColumn - 1 - : 0) - }; - return ret; - } - } - - return { - line: null, - column: null - }; - }; - - /** - * Parse the mappings in a string in to a data structure which we can easily - * query (the ordered arrays in the `this.__generatedMappings` and - * `this.__originalMappings` properties). - */ - IndexedSourceMapConsumer.prototype._parseMappings = - function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) { - this.__generatedMappings = []; - this.__originalMappings = []; - for (var i = 0; i < this._sections.length; i++) { - var section = this._sections[i]; - var sectionMappings = section.consumer._generatedMappings; - for (var j = 0; j < sectionMappings.length; j++) { - var mapping = sectionMappings[j]; - - var source = section.consumer._sources.at(mapping.source); - if (section.consumer.sourceRoot !== null) { - source = util.join(section.consumer.sourceRoot, source); - } - this._sources.add(source); - source = this._sources.indexOf(source); - - var name = section.consumer._names.at(mapping.name); - this._names.add(name); - name = this._names.indexOf(name); - - // The mappings coming from the consumer for the section have - // generated positions relative to the start of the section, so we - // need to offset them to be relative to the start of the concatenated - // generated file. - var adjustedMapping = { - source: source, - generatedLine: mapping.generatedLine + - (section.generatedOffset.generatedLine - 1), - generatedColumn: mapping.generatedColumn + - (section.generatedOffset.generatedLine === mapping.generatedLine - ? section.generatedOffset.generatedColumn - 1 - : 0), - originalLine: mapping.originalLine, - originalColumn: mapping.originalColumn, - name: name - }; - - this.__generatedMappings.push(adjustedMapping); - if (typeof adjustedMapping.originalLine === 'number') { - this.__originalMappings.push(adjustedMapping); - } - } - } - - quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated); - quickSort(this.__originalMappings, util.compareByOriginalPositions); - }; - - exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer; -} - -},{"597":597,"598":598,"600":600,"602":602,"606":606}],604:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var base64VLQ = _dereq_(598); - var util = _dereq_(606); - var ArraySet = _dereq_(597).ArraySet; - var MappingList = _dereq_(601).MappingList; - - /** - * An instance of the SourceMapGenerator represents a source map which is - * being built incrementally. You may pass an object with the following - * properties: - * - * - file: The filename of the generated source. - * - sourceRoot: A root for all relative URLs in this source map. - */ - function SourceMapGenerator(aArgs) { - if (!aArgs) { - aArgs = {}; - } - this._file = util.getArg(aArgs, 'file', null); - this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null); - this._skipValidation = util.getArg(aArgs, 'skipValidation', false); - this._sources = new ArraySet(); - this._names = new ArraySet(); - this._mappings = new MappingList(); - this._sourcesContents = null; - } - - SourceMapGenerator.prototype._version = 3; - - /** - * Creates a new SourceMapGenerator based on a SourceMapConsumer - * - * @param aSourceMapConsumer The SourceMap. - */ - SourceMapGenerator.fromSourceMap = - function SourceMapGenerator_fromSourceMap(aSourceMapConsumer) { - var sourceRoot = aSourceMapConsumer.sourceRoot; - var generator = new SourceMapGenerator({ - file: aSourceMapConsumer.file, - sourceRoot: sourceRoot - }); - aSourceMapConsumer.eachMapping(function (mapping) { - var newMapping = { - generated: { - line: mapping.generatedLine, - column: mapping.generatedColumn - } - }; - - if (mapping.source != null) { - newMapping.source = mapping.source; - if (sourceRoot != null) { - newMapping.source = util.relative(sourceRoot, newMapping.source); - } - - newMapping.original = { - line: mapping.originalLine, - column: mapping.originalColumn - }; - - if (mapping.name != null) { - newMapping.name = mapping.name; - } - } - - generator.addMapping(newMapping); - }); - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - generator.setSourceContent(sourceFile, content); - } - }); - return generator; - }; - - /** - * Add a single mapping from original source line and column to the generated - * source's line and column for this source map being created. The mapping - * object should have the following properties: - * - * - generated: An object with the generated line and column positions. - * - original: An object with the original line and column positions. - * - source: The original source file (relative to the sourceRoot). - * - name: An optional original token name for this mapping. - */ - SourceMapGenerator.prototype.addMapping = - function SourceMapGenerator_addMapping(aArgs) { - var generated = util.getArg(aArgs, 'generated'); - var original = util.getArg(aArgs, 'original', null); - var source = util.getArg(aArgs, 'source', null); - var name = util.getArg(aArgs, 'name', null); - - if (!this._skipValidation) { - this._validateMapping(generated, original, source, name); - } - - if (source != null && !this._sources.has(source)) { - this._sources.add(source); - } - - if (name != null && !this._names.has(name)) { - this._names.add(name); - } - - this._mappings.add({ - generatedLine: generated.line, - generatedColumn: generated.column, - originalLine: original != null && original.line, - originalColumn: original != null && original.column, - source: source, - name: name - }); - }; - - /** - * Set the source content for a source file. - */ - SourceMapGenerator.prototype.setSourceContent = - function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) { - var source = aSourceFile; - if (this._sourceRoot != null) { - source = util.relative(this._sourceRoot, source); - } - - if (aSourceContent != null) { - // Add the source content to the _sourcesContents map. - // Create a new _sourcesContents map if the property is null. - if (!this._sourcesContents) { - this._sourcesContents = {}; - } - this._sourcesContents[util.toSetString(source)] = aSourceContent; - } else if (this._sourcesContents) { - // Remove the source file from the _sourcesContents map. - // If the _sourcesContents map is empty, set the property to null. - delete this._sourcesContents[util.toSetString(source)]; - if (Object.keys(this._sourcesContents).length === 0) { - this._sourcesContents = null; - } - } - }; - - /** - * Applies the mappings of a sub-source-map for a specific source file to the - * source map being generated. Each mapping to the supplied source file is - * rewritten using the supplied source map. Note: The resolution for the - * resulting mappings is the minimium of this map and the supplied map. - * - * @param aSourceMapConsumer The source map to be applied. - * @param aSourceFile Optional. The filename of the source file. - * If omitted, SourceMapConsumer's file property will be used. - * @param aSourceMapPath Optional. The dirname of the path to the source map - * to be applied. If relative, it is relative to the SourceMapConsumer. - * This parameter is needed when the two source maps aren't in the same - * directory, and the source map to be applied contains relative source - * paths. If so, those relative source paths need to be rewritten - * relative to the SourceMapGenerator. - */ - SourceMapGenerator.prototype.applySourceMap = - function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) { - var sourceFile = aSourceFile; - // If aSourceFile is omitted, we will use the file property of the SourceMap - if (aSourceFile == null) { - if (aSourceMapConsumer.file == null) { - throw new Error( - 'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' + - 'or the source map\'s "file" property. Both were omitted.' - ); - } - sourceFile = aSourceMapConsumer.file; - } - var sourceRoot = this._sourceRoot; - // Make "sourceFile" relative if an absolute Url is passed. - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - // Applying the SourceMap can add and remove items from the sources and - // the names array. - var newSources = new ArraySet(); - var newNames = new ArraySet(); - - // Find mappings for the "sourceFile" - this._mappings.unsortedForEach(function (mapping) { - if (mapping.source === sourceFile && mapping.originalLine != null) { - // Check if it can be mapped by the source map, then update the mapping. - var original = aSourceMapConsumer.originalPositionFor({ - line: mapping.originalLine, - column: mapping.originalColumn - }); - if (original.source != null) { - // Copy mapping - mapping.source = original.source; - if (aSourceMapPath != null) { - mapping.source = util.join(aSourceMapPath, mapping.source) - } - if (sourceRoot != null) { - mapping.source = util.relative(sourceRoot, mapping.source); - } - mapping.originalLine = original.line; - mapping.originalColumn = original.column; - if (original.name != null) { - mapping.name = original.name; - } - } - } - - var source = mapping.source; - if (source != null && !newSources.has(source)) { - newSources.add(source); - } - - var name = mapping.name; - if (name != null && !newNames.has(name)) { - newNames.add(name); - } - - }, this); - this._sources = newSources; - this._names = newNames; - - // Copy sourcesContents of applied map. - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aSourceMapPath != null) { - sourceFile = util.join(aSourceMapPath, sourceFile); - } - if (sourceRoot != null) { - sourceFile = util.relative(sourceRoot, sourceFile); - } - this.setSourceContent(sourceFile, content); - } - }, this); - }; - - /** - * A mapping can have one of the three levels of data: - * - * 1. Just the generated position. - * 2. The Generated position, original position, and original source. - * 3. Generated and original position, original source, as well as a name - * token. - * - * To maintain consistency, we validate that any new mapping being added falls - * in to one of these categories. - */ - SourceMapGenerator.prototype._validateMapping = - function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource, - aName) { - if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aGenerated.line > 0 && aGenerated.column >= 0 - && !aOriginal && !aSource && !aName) { - // Case 1. - return; - } - else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated - && aOriginal && 'line' in aOriginal && 'column' in aOriginal - && aGenerated.line > 0 && aGenerated.column >= 0 - && aOriginal.line > 0 && aOriginal.column >= 0 - && aSource) { - // Cases 2 and 3. - return; - } - else { - throw new Error('Invalid mapping: ' + JSON.stringify({ - generated: aGenerated, - source: aSource, - original: aOriginal, - name: aName - })); - } - }; - - /** - * Serialize the accumulated mappings in to the stream of base 64 VLQs - * specified by the source map format. - */ - SourceMapGenerator.prototype._serializeMappings = - function SourceMapGenerator_serializeMappings() { - var previousGeneratedColumn = 0; - var previousGeneratedLine = 1; - var previousOriginalColumn = 0; - var previousOriginalLine = 0; - var previousName = 0; - var previousSource = 0; - var result = ''; - var mapping; - var nameIdx; - var sourceIdx; - - var mappings = this._mappings.toArray(); - for (var i = 0, len = mappings.length; i < len; i++) { - mapping = mappings[i]; - - if (mapping.generatedLine !== previousGeneratedLine) { - previousGeneratedColumn = 0; - while (mapping.generatedLine !== previousGeneratedLine) { - result += ';'; - previousGeneratedLine++; - } - } - else { - if (i > 0) { - if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) { - continue; - } - result += ','; - } - } - - result += base64VLQ.encode(mapping.generatedColumn - - previousGeneratedColumn); - previousGeneratedColumn = mapping.generatedColumn; - - if (mapping.source != null) { - sourceIdx = this._sources.indexOf(mapping.source); - result += base64VLQ.encode(sourceIdx - previousSource); - previousSource = sourceIdx; - - // lines are stored 0-based in SourceMap spec version 3 - result += base64VLQ.encode(mapping.originalLine - 1 - - previousOriginalLine); - previousOriginalLine = mapping.originalLine - 1; - - result += base64VLQ.encode(mapping.originalColumn - - previousOriginalColumn); - previousOriginalColumn = mapping.originalColumn; - - if (mapping.name != null) { - nameIdx = this._names.indexOf(mapping.name); - result += base64VLQ.encode(nameIdx - previousName); - previousName = nameIdx; - } - } - } - - return result; - }; - - SourceMapGenerator.prototype._generateSourcesContent = - function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) { - return aSources.map(function (source) { - if (!this._sourcesContents) { - return null; - } - if (aSourceRoot != null) { - source = util.relative(aSourceRoot, source); - } - var key = util.toSetString(source); - return Object.prototype.hasOwnProperty.call(this._sourcesContents, - key) - ? this._sourcesContents[key] - : null; - }, this); - }; - - /** - * Externalize the source map. - */ - SourceMapGenerator.prototype.toJSON = - function SourceMapGenerator_toJSON() { - var map = { - version: this._version, - sources: this._sources.toArray(), - names: this._names.toArray(), - mappings: this._serializeMappings() - }; - if (this._file != null) { - map.file = this._file; - } - if (this._sourceRoot != null) { - map.sourceRoot = this._sourceRoot; - } - if (this._sourcesContents) { - map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot); - } - - return map; - }; - - /** - * Render the source map being generated to a string. - */ - SourceMapGenerator.prototype.toString = - function SourceMapGenerator_toString() { - return JSON.stringify(this.toJSON()); - }; - - exports.SourceMapGenerator = SourceMapGenerator; -} - -},{"597":597,"598":598,"601":601,"606":606}],605:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - var SourceMapGenerator = _dereq_(604).SourceMapGenerator; - var util = _dereq_(606); - - // Matches a Windows-style `\r\n` newline or a `\n` newline used by all other - // operating systems these days (capturing the result). - var REGEX_NEWLINE = /(\r?\n)/; - - // Newline character code for charCodeAt() comparisons - var NEWLINE_CODE = 10; - - // Private symbol for identifying `SourceNode`s when multiple versions of - // the source-map library are loaded. This MUST NOT CHANGE across - // versions! - var isSourceNode = "$$$isSourceNode$$$"; - - /** - * SourceNodes provide a way to abstract over interpolating/concatenating - * snippets of generated JavaScript source code while maintaining the line and - * column information associated with the original source code. - * - * @param aLine The original line number. - * @param aColumn The original column number. - * @param aSource The original source's filename. - * @param aChunks Optional. An array of strings which are snippets of - * generated JS, or other SourceNodes. - * @param aName The original identifier. - */ - function SourceNode(aLine, aColumn, aSource, aChunks, aName) { - this.children = []; - this.sourceContents = {}; - this.line = aLine == null ? null : aLine; - this.column = aColumn == null ? null : aColumn; - this.source = aSource == null ? null : aSource; - this.name = aName == null ? null : aName; - this[isSourceNode] = true; - if (aChunks != null) this.add(aChunks); - } - - /** - * Creates a SourceNode from generated code and a SourceMapConsumer. - * - * @param aGeneratedCode The generated code - * @param aSourceMapConsumer The SourceMap for the generated code - * @param aRelativePath Optional. The path that relative sources in the - * SourceMapConsumer should be relative to. - */ - SourceNode.fromStringWithSourceMap = - function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) { - // The SourceNode we want to fill with the generated code - // and the SourceMap - var node = new SourceNode(); - - // All even indices of this array are one line of the generated code, - // while all odd indices are the newlines between two adjacent lines - // (since `REGEX_NEWLINE` captures its match). - // Processed fragments are removed from this array, by calling `shiftNextLine`. - var remainingLines = aGeneratedCode.split(REGEX_NEWLINE); - var shiftNextLine = function() { - var lineContents = remainingLines.shift(); - // The last line of a file might not have a newline. - var newLine = remainingLines.shift() || ""; - return lineContents + newLine; - }; - - // We need to remember the position of "remainingLines" - var lastGeneratedLine = 1, lastGeneratedColumn = 0; - - // The generate SourceNodes we need a code range. - // To extract it current and last mapping is used. - // Here we store the last mapping. - var lastMapping = null; - - aSourceMapConsumer.eachMapping(function (mapping) { - if (lastMapping !== null) { - // We add the code from "lastMapping" to "mapping": - // First check if there is a new line in between. - if (lastGeneratedLine < mapping.generatedLine) { - // Associate first line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - lastGeneratedLine++; - lastGeneratedColumn = 0; - // The remaining code is added without mapping - } else { - // There is no new line in between. - // Associate the code between "lastGeneratedColumn" and - // "mapping.generatedColumn" with "lastMapping" - var nextLine = remainingLines[0]; - var code = nextLine.substr(0, mapping.generatedColumn - - lastGeneratedColumn); - remainingLines[0] = nextLine.substr(mapping.generatedColumn - - lastGeneratedColumn); - lastGeneratedColumn = mapping.generatedColumn; - addMappingWithCode(lastMapping, code); - // No more remaining code, continue - lastMapping = mapping; - return; - } - } - // We add the generated code until the first mapping - // to the SourceNode without any mapping. - // Each line is added as separate string. - while (lastGeneratedLine < mapping.generatedLine) { - node.add(shiftNextLine()); - lastGeneratedLine++; - } - if (lastGeneratedColumn < mapping.generatedColumn) { - var nextLine = remainingLines[0]; - node.add(nextLine.substr(0, mapping.generatedColumn)); - remainingLines[0] = nextLine.substr(mapping.generatedColumn); - lastGeneratedColumn = mapping.generatedColumn; - } - lastMapping = mapping; - }, this); - // We have processed all mappings. - if (remainingLines.length > 0) { - if (lastMapping) { - // Associate the remaining code in the current line with "lastMapping" - addMappingWithCode(lastMapping, shiftNextLine()); - } - // and add the remaining lines without any mapping - node.add(remainingLines.join("")); - } - - // Copy sourcesContent into SourceNode - aSourceMapConsumer.sources.forEach(function (sourceFile) { - var content = aSourceMapConsumer.sourceContentFor(sourceFile); - if (content != null) { - if (aRelativePath != null) { - sourceFile = util.join(aRelativePath, sourceFile); - } - node.setSourceContent(sourceFile, content); - } - }); - - return node; - - function addMappingWithCode(mapping, code) { - if (mapping === null || mapping.source === undefined) { - node.add(code); - } else { - var source = aRelativePath - ? util.join(aRelativePath, mapping.source) - : mapping.source; - node.add(new SourceNode(mapping.originalLine, - mapping.originalColumn, - source, - code, - mapping.name)); - } - } - }; - - /** - * Add a chunk of generated JS to this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.add = function SourceNode_add(aChunk) { - if (Array.isArray(aChunk)) { - aChunk.forEach(function (chunk) { - this.add(chunk); - }, this); - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - if (aChunk) { - this.children.push(aChunk); - } - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Add a chunk of generated JS to the beginning of this source node. - * - * @param aChunk A string snippet of generated JS code, another instance of - * SourceNode, or an array where each member is one of those things. - */ - SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) { - if (Array.isArray(aChunk)) { - for (var i = aChunk.length-1; i >= 0; i--) { - this.prepend(aChunk[i]); - } - } - else if (aChunk[isSourceNode] || typeof aChunk === "string") { - this.children.unshift(aChunk); - } - else { - throw new TypeError( - "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk - ); - } - return this; - }; - - /** - * Walk over the tree of JS snippets in this node and its children. The - * walking function is called once for each snippet of JS and is passed that - * snippet and the its original associated source's line/column location. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walk = function SourceNode_walk(aFn) { - var chunk; - for (var i = 0, len = this.children.length; i < len; i++) { - chunk = this.children[i]; - if (chunk[isSourceNode]) { - chunk.walk(aFn); - } - else { - if (chunk !== '') { - aFn(chunk, { source: this.source, - line: this.line, - column: this.column, - name: this.name }); - } - } - } - }; - - /** - * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between - * each of `this.children`. - * - * @param aSep The separator. - */ - SourceNode.prototype.join = function SourceNode_join(aSep) { - var newChildren; - var i; - var len = this.children.length; - if (len > 0) { - newChildren = []; - for (i = 0; i < len-1; i++) { - newChildren.push(this.children[i]); - newChildren.push(aSep); - } - newChildren.push(this.children[i]); - this.children = newChildren; - } - return this; - }; - - /** - * Call String.prototype.replace on the very right-most source snippet. Useful - * for trimming whitespace from the end of a source node, etc. - * - * @param aPattern The pattern to replace. - * @param aReplacement The thing to replace the pattern with. - */ - SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) { - var lastChild = this.children[this.children.length - 1]; - if (lastChild[isSourceNode]) { - lastChild.replaceRight(aPattern, aReplacement); - } - else if (typeof lastChild === 'string') { - this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement); - } - else { - this.children.push(''.replace(aPattern, aReplacement)); - } - return this; - }; - - /** - * Set the source content for a source file. This will be added to the SourceMapGenerator - * in the sourcesContent field. - * - * @param aSourceFile The filename of the source file - * @param aSourceContent The content of the source file - */ - SourceNode.prototype.setSourceContent = - function SourceNode_setSourceContent(aSourceFile, aSourceContent) { - this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent; - }; - - /** - * Walk over the tree of SourceNodes. The walking function is called for each - * source file content and is passed the filename and source content. - * - * @param aFn The traversal function. - */ - SourceNode.prototype.walkSourceContents = - function SourceNode_walkSourceContents(aFn) { - for (var i = 0, len = this.children.length; i < len; i++) { - if (this.children[i][isSourceNode]) { - this.children[i].walkSourceContents(aFn); - } - } - - var sources = Object.keys(this.sourceContents); - for (var i = 0, len = sources.length; i < len; i++) { - aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]); - } - }; - - /** - * Return the string representation of this source node. Walks over the tree - * and concatenates all the various snippets together to one string. - */ - SourceNode.prototype.toString = function SourceNode_toString() { - var str = ""; - this.walk(function (chunk) { - str += chunk; - }); - return str; - }; - - /** - * Returns the string representation of this source node along with a source - * map. - */ - SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) { - var generated = { - code: "", - line: 1, - column: 0 - }; - var map = new SourceMapGenerator(aArgs); - var sourceMappingActive = false; - var lastOriginalSource = null; - var lastOriginalLine = null; - var lastOriginalColumn = null; - var lastOriginalName = null; - this.walk(function (chunk, original) { - generated.code += chunk; - if (original.source !== null - && original.line !== null - && original.column !== null) { - if(lastOriginalSource !== original.source - || lastOriginalLine !== original.line - || lastOriginalColumn !== original.column - || lastOriginalName !== original.name) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - lastOriginalSource = original.source; - lastOriginalLine = original.line; - lastOriginalColumn = original.column; - lastOriginalName = original.name; - sourceMappingActive = true; - } else if (sourceMappingActive) { - map.addMapping({ - generated: { - line: generated.line, - column: generated.column - } - }); - lastOriginalSource = null; - sourceMappingActive = false; - } - for (var idx = 0, length = chunk.length; idx < length; idx++) { - if (chunk.charCodeAt(idx) === NEWLINE_CODE) { - generated.line++; - generated.column = 0; - // Mappings end at eol - if (idx + 1 === length) { - lastOriginalSource = null; - sourceMappingActive = false; - } else if (sourceMappingActive) { - map.addMapping({ - source: original.source, - original: { - line: original.line, - column: original.column - }, - generated: { - line: generated.line, - column: generated.column - }, - name: original.name - }); - } - } else { - generated.column++; - } - } - }); - this.walkSourceContents(function (sourceFile, sourceContent) { - map.setSourceContent(sourceFile, sourceContent); - }); - - return { code: generated.code, map: map }; - }; - - exports.SourceNode = SourceNode; -} - -},{"604":604,"606":606}],606:[function(_dereq_,module,exports){ -/* -*- Mode: js; js-indent-level: 2; -*- */ -/* - * Copyright 2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE or: - * http://opensource.org/licenses/BSD-3-Clause - */ -{ - /** - * This is a helper function for getting values from parameter/options - * objects. - * - * @param args The object we are extracting values from - * @param name The name of the property we are getting. - * @param defaultValue An optional value to return if the property is missing - * from the object. If this is not specified and the property is missing, an - * error will be thrown. - */ - function getArg(aArgs, aName, aDefaultValue) { - if (aName in aArgs) { - return aArgs[aName]; - } else if (arguments.length === 3) { - return aDefaultValue; - } else { - throw new Error('"' + aName + '" is a required argument.'); - } - } - exports.getArg = getArg; - - var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.]*)(?::(\d+))?(\S*)$/; - var dataUrlRegexp = /^data:.+\,.+$/; - - function urlParse(aUrl) { - var match = aUrl.match(urlRegexp); - if (!match) { - return null; - } - return { - scheme: match[1], - auth: match[2], - host: match[3], - port: match[4], - path: match[5] - }; - } - exports.urlParse = urlParse; - - function urlGenerate(aParsedUrl) { - var url = ''; - if (aParsedUrl.scheme) { - url += aParsedUrl.scheme + ':'; - } - url += '//'; - if (aParsedUrl.auth) { - url += aParsedUrl.auth + '@'; - } - if (aParsedUrl.host) { - url += aParsedUrl.host; - } - if (aParsedUrl.port) { - url += ":" + aParsedUrl.port - } - if (aParsedUrl.path) { - url += aParsedUrl.path; - } - return url; - } - exports.urlGenerate = urlGenerate; - - /** - * Normalizes a path, or the path portion of a URL: - * - * - Replaces consequtive slashes with one slash. - * - Removes unnecessary '.' parts. - * - Removes unnecessary '/..' parts. - * - * Based on code in the Node.js 'path' core module. - * - * @param aPath The path or url to normalize. - */ - function normalize(aPath) { - var path = aPath; - var url = urlParse(aPath); - if (url) { - if (!url.path) { - return aPath; - } - path = url.path; - } - var isAbsolute = exports.isAbsolute(path); - - var parts = path.split(/\/+/); - for (var part, up = 0, i = parts.length - 1; i >= 0; i--) { - part = parts[i]; - if (part === '.') { - parts.splice(i, 1); - } else if (part === '..') { - up++; - } else if (up > 0) { - if (part === '') { - // The first part is blank if the path is absolute. Trying to go - // above the root is a no-op. Therefore we can remove all '..' parts - // directly after the root. - parts.splice(i + 1, up); - up = 0; - } else { - parts.splice(i, 2); - up--; - } - } - } - path = parts.join('/'); - - if (path === '') { - path = isAbsolute ? '/' : '.'; - } - - if (url) { - url.path = path; - return urlGenerate(url); - } - return path; - } - exports.normalize = normalize; - - /** - * Joins two paths/URLs. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be joined with the root. - * - * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a - * scheme-relative URL: Then the scheme of aRoot, if any, is prepended - * first. - * - Otherwise aPath is a path. If aRoot is a URL, then its path portion - * is updated with the result and aRoot is returned. Otherwise the result - * is returned. - * - If aPath is absolute, the result is aPath. - * - Otherwise the two paths are joined with a slash. - * - Joining for example 'http://' and 'www.example.com' is also supported. - */ - function join(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - if (aPath === "") { - aPath = "."; - } - var aPathUrl = urlParse(aPath); - var aRootUrl = urlParse(aRoot); - if (aRootUrl) { - aRoot = aRootUrl.path || '/'; - } - - // `join(foo, '//www.example.org')` - if (aPathUrl && !aPathUrl.scheme) { - if (aRootUrl) { - aPathUrl.scheme = aRootUrl.scheme; - } - return urlGenerate(aPathUrl); - } - - if (aPathUrl || aPath.match(dataUrlRegexp)) { - return aPath; - } - - // `join('http://', 'www.example.com')` - if (aRootUrl && !aRootUrl.host && !aRootUrl.path) { - aRootUrl.host = aPath; - return urlGenerate(aRootUrl); - } - - var joined = aPath.charAt(0) === '/' - ? aPath - : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath); - - if (aRootUrl) { - aRootUrl.path = joined; - return urlGenerate(aRootUrl); - } - return joined; - } - exports.join = join; - - exports.isAbsolute = function (aPath) { - return aPath.charAt(0) === '/' || !!aPath.match(urlRegexp); - }; - - /** - * Make a path relative to a URL or another path. - * - * @param aRoot The root path or URL. - * @param aPath The path or URL to be made relative to aRoot. - */ - function relative(aRoot, aPath) { - if (aRoot === "") { - aRoot = "."; - } - - aRoot = aRoot.replace(/\/$/, ''); - - // It is possible for the path to be above the root. In this case, simply - // checking whether the root is a prefix of the path won't work. Instead, we - // need to remove components from the root one by one, until either we find - // a prefix that fits, or we run out of components to remove. - var level = 0; - while (aPath.indexOf(aRoot + '/') !== 0) { - var index = aRoot.lastIndexOf("/"); - if (index < 0) { - return aPath; - } - - // If the only part of the root that is left is the scheme (i.e. http://, - // file:///, etc.), one or more slashes (/), or simply nothing at all, we - // have exhausted all components, so the path is not relative to the root. - aRoot = aRoot.slice(0, index); - if (aRoot.match(/^([^\/]+:\/)?\/*$/)) { - return aPath; - } - - ++level; - } - - // Make sure we add a "../" for each component we removed from the root. - return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1); - } - exports.relative = relative; - - /** - * Because behavior goes wacky when you set `__proto__` on objects, we - * have to prefix all the strings in our set with an arbitrary character. - * - * See https://github.com/mozilla/source-map/pull/31 and - * https://github.com/mozilla/source-map/issues/30 - * - * @param String aStr - */ - function toSetString(aStr) { - return '$' + aStr; - } - exports.toSetString = toSetString; - - function fromSetString(aStr) { - return aStr.substr(1); - } - exports.fromSetString = fromSetString; - - /** - * Comparator between two mappings where the original positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same original source/line/column, but different generated - * line and column the same. Useful when searching for a mapping with a - * stubbed out mapping. - */ - function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) { - var cmp = mappingA.source - mappingB.source; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0 || onlyCompareOriginal) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - return mappingA.name - mappingB.name; - } - exports.compareByOriginalPositions = compareByOriginalPositions; - - /** - * Comparator between two mappings with deflated source and name indices where - * the generated positions are compared. - * - * Optionally pass in `true` as `onlyCompareGenerated` to consider two - * mappings with the same generated line and column, but different - * source/name/original line and column the same. Useful when searching for a - * mapping with a stubbed out mapping. - */ - function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0 || onlyCompareGenerated) { - return cmp; - } - - cmp = mappingA.source - mappingB.source; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return mappingA.name - mappingB.name; - } - exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated; - - function strcmp(aStr1, aStr2) { - if (aStr1 === aStr2) { - return 0; - } - - if (aStr1 > aStr2) { - return 1; - } - - return -1; - } - - /** - * Comparator between two mappings with inflated source and name strings where - * the generated positions are compared. - */ - function compareByGeneratedPositionsInflated(mappingA, mappingB) { - var cmp = mappingA.generatedLine - mappingB.generatedLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.generatedColumn - mappingB.generatedColumn; - if (cmp !== 0) { - return cmp; - } - - cmp = strcmp(mappingA.source, mappingB.source); - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalLine - mappingB.originalLine; - if (cmp !== 0) { - return cmp; - } - - cmp = mappingA.originalColumn - mappingB.originalColumn; - if (cmp !== 0) { - return cmp; - } - - return strcmp(mappingA.name, mappingB.name); - } - exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated; -} - -},{}],607:[function(_dereq_,module,exports){ -/* - * Copyright 2009-2011 Mozilla Foundation and contributors - * Licensed under the New BSD license. See LICENSE.txt or: - * http://opensource.org/licenses/BSD-3-Clause - */ -exports.SourceMapGenerator = _dereq_(604).SourceMapGenerator; -exports.SourceMapConsumer = _dereq_(603).SourceMapConsumer; -exports.SourceNode = _dereq_(605).SourceNode; - -},{"603":603,"604":604,"605":605}],608:[function(_dereq_,module,exports){ -'use strict'; -module.exports = function toFastProperties(obj) { - /*jshint -W027*/ - function f() {} - f.prototype = obj; - new f(); - return; - eval(obj); -}; - -},{}],609:[function(_dereq_,module,exports){ -'use strict'; -module.exports = function (str) { - var tail = str.length; - - while (/[\s\uFEFF\u00A0]/.test(str[tail - 1])) { - tail--; - } - - return str.slice(0, tail); -}; - -},{}],610:[function(_dereq_,module,exports){ -(function (process){ -var Module = _dereq_(3); - -var resolve = module.exports = function (loc, _require) { - try { - return (_require || _dereq_).resolve(loc); - } catch (err) { - return null; - } -}; - -var relativeMod; - -resolve.relative = function (loc) { - // we're in the browser, probably - if (typeof Module === "object") return null; - - if (!relativeMod) { - relativeMod = new Module; - relativeMod.paths = Module._nodeModulePaths(process.cwd()); - } - - try { - return Module._resolveFilename(loc, relativeMod); - } catch (err) { - return null; - } -}; - -}).call(this,_dereq_(10)) -},{"10":10,"3":3}],611:[function(_dereq_,module,exports){ -module.exports={ - "name": "babel-core", - "version": "5.8.35", - "description": "A compiler for writing next generation JavaScript", - "author": "Sebastian McKenzie ", - "homepage": "https://babeljs.io/", - "license": "MIT", - "repository": "babel/babel", - "browser": { - "./lib/api/register/node.js": "./lib/api/register/browser.js" - }, - "keywords": [ - "6to5", - "babel", - "classes", - "const", - "es6", - "harmony", - "let", - "modules", - "transpile", - "transpiler", - "var" - ], - "scripts": { - "bench": "make bench", - "test": "make test" - }, - "dependencies": { - "babel-plugin-constant-folding": "^1.0.1", - "babel-plugin-dead-code-elimination": "^1.0.2", - "babel-plugin-eval": "^1.0.1", - "babel-plugin-inline-environment-variables": "^1.0.1", - "babel-plugin-jscript": "^1.0.4", - "babel-plugin-member-expression-literals": "^1.0.1", - "babel-plugin-property-literals": "^1.0.1", - "babel-plugin-proto-to-assign": "^1.0.3", - "babel-plugin-react-constant-elements": "^1.0.3", - "babel-plugin-react-display-name": "^1.0.3", - "babel-plugin-remove-console": "^1.0.1", - "babel-plugin-remove-debugger": "^1.0.1", - "babel-plugin-runtime": "^1.0.7", - "babel-plugin-undeclared-variables-check": "^1.0.2", - "babel-plugin-undefined-to-void": "^1.1.6", - "babylon": "^5.8.35", - "bluebird": "^2.9.33", - "chalk": "^1.0.0", - "convert-source-map": "^1.1.0", - "core-js": "^1.0.0", - "debug": "^2.1.1", - "detect-indent": "^3.0.0", - "esutils": "^2.0.0", - "fs-readdir-recursive": "^0.1.0", - "globals": "^6.4.0", - "home-or-tmp": "^1.0.0", - "is-integer": "^1.0.4", - "js-tokens": "1.0.1", - "json5": "^0.4.0", - "line-numbers": "0.2.0", - "lodash": "^3.10.0", - "minimatch": "^2.0.3", - "output-file-sync": "^1.1.0", - "path-exists": "^1.0.0", - "path-is-absolute": "^1.0.0", - "private": "^0.1.6", - "regenerator": "0.8.40", - "regexpu": "^1.3.0", - "repeating": "^1.1.2", - "resolve": "^1.1.6", - "shebang-regex": "^1.0.0", - "slash": "^1.0.0", - "source-map": "^0.5.0", - "source-map-support": "^0.2.10", - "to-fast-properties": "^1.0.0", - "trim-right": "^1.0.0", - "try-resolve": "^1.0.0" - } -} -},{}],612:[function(_dereq_,module,exports){ -module.exports={"abstract-expression-call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceGet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-delete":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceDelete"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-get":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceGet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"}]}}]},"abstract-expression-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"PROPERTY"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"referenceSet"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"OBJECT"},{"type":"Identifier","name":"VALUE"}]}}]},"array-comprehension-container":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"KEY"}}]},"parenthesizedExpression":true},"arguments":[]}}]},"array-from":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"VALUE"}]}}]},"array-push":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"KEY"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"Identifier","name":"STATEMENT"}]}}]},"call":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"CONTEXT"}]}}]},"class-decorator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"CLASS_REF"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"DECORATOR"},"arguments":[{"type":"Identifier","name":"CLASS_REF"}]},"operator":"||","right":{"type":"Identifier","name":"CLASS_REF"}}}}]},"class-derived-default-constructor":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Super"},"arguments":[{"type":"SpreadElement","argument":{"type":"Identifier","name":"arguments"}}]}}]},"parenthesizedExpression":true}}]},"default-parameter-assign":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"VARIABLE_NAME"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"VARIABLE_NAME"},"right":{"type":"Identifier","name":"DEFAULT_VALUE"}}},"alternate":null}]},"default-parameter":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"<=","right":{"type":"Identifier","name":"ARGUMENT_KEY"}},"operator":"||","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"ARGUMENT_KEY"},"computed":true},"operator":"===","right":{"type":"Identifier","name":"undefined"}}},"consequent":{"type":"Identifier","name":"DEFAULT_VALUE"},"alternate":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"ARGUMENT_KEY"},"computed":true}}}],"kind":"let"}]},"exports-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"KEY"},"computed":false},"right":{"type":"Identifier","name":"VALUE"}}}]},"exports-default-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"module"},"property":{"type":"Identifier","name":"exports"},"computed":false},"right":{"type":"Identifier","name":"VALUE"}}}]},"exports-from-assign":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Identifier","name":"ID"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"get"},"value":{"type":"FunctionExpression","id":{"type":"Identifier","name":"get"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"INIT"}}]}},"kind":"init"}]}]}}]},"exports-module-declaration-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"__esModule"},"computed":false},"right":{"type":"Literal","value":true}}}]},"exports-module-declaration":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"exports"},{"type":"Literal","value":"__esModule"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Literal","value":true},"kind":"init"}]}]}}]},"for-of-array":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"KEY"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARR"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"KEY"}},"body":{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"BODY"}}}]},"for-of-loose":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LOOP_OBJECT"},"init":{"type":"Identifier","name":"OBJECT"}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"IS_ARRAY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"LOOP_OBJECT"}]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"INDEX"},"init":{"type":"Literal","value":0}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LOOP_OBJECT"},"init":{"type":"ConditionalExpression","test":{"type":"Identifier","name":"IS_ARRAY"},"consequent":{"type":"Identifier","name":"LOOP_OBJECT"},"alternate":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}}}],"kind":"var"},"test":null,"update":null,"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ID"},"init":null}],"kind":"var"},{"type":"IfStatement","test":{"type":"Identifier","name":"IS_ARRAY"},"consequent":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"INDEX"},"operator":">=","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"Identifier","name":"length"},"computed":false}},"consequent":{"type":"BreakStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ID"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"INDEX"}},"computed":true}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"INDEX"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"LOOP_OBJECT"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]}}},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"INDEX"},"property":{"type":"Identifier","name":"done"},"computed":false},"consequent":{"type":"BreakStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ID"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"INDEX"},"property":{"type":"Identifier","name":"value"},"computed":false}}}]}}]}}]},"for-of":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"init":{"type":"Literal","value":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"},"init":{"type":"Identifier","name":"undefined"}}],"kind":"var"},{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ITERATOR_KEY"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"OBJECT"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"STEP_KEY"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"right":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"STEP_KEY"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false},"parenthesizedExpression":true}},"update":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_COMPLETION"},"right":{"type":"Literal","value":true}},"body":{"type":"BlockStatement","body":[]}}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"err"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"},"right":{"type":"Identifier","name":"err"}}}]}},"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"ITERATOR_COMPLETION"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Literal","value":"return"},"computed":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"ITERATOR_KEY"},"property":{"type":"Literal","value":"return"},"computed":true},"arguments":[]}}]},"alternate":null}]},"handler":null,"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"ITERATOR_HAD_ERROR_KEY"},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"Identifier","name":"ITERATOR_ERROR_KEY"}}]},"alternate":null}]}}]}}]},"helper-async-to-generator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"fn"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"gen"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"fn"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}],"kind":"var"},{"type":"ReturnStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"Promise"},"arguments":[{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"resolve"},{"type":"Identifier","name":"reject"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"callNext"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"step"},"property":{"type":"Identifier","name":"bind"},"computed":false},"arguments":[{"type":"Literal","value":null,"rawValue":null},{"type":"Literal","value":"next"}]}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"callThrow"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"step"},"property":{"type":"Identifier","name":"bind"},"computed":false},"arguments":[{"type":"Literal","value":null,"rawValue":null},{"type":"Literal","value":"throw"}]}}],"kind":"var"},{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"step"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"key"},{"type":"Identifier","name":"arg"}],"body":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"info"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"gen"},"property":{"type":"Identifier","name":"key"},"computed":true},"arguments":[{"type":"Identifier","name":"arg"}]}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"value"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"info"},"property":{"type":"Identifier","name":"value"},"computed":false}}],"kind":"var"}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"error"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"reject"},"arguments":[{"type":"Identifier","name":"error"}]}},{"type":"ReturnStatement","argument":null}]}},"guardedHandlers":[],"finalizer":null},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"info"},"property":{"type":"Identifier","name":"done"},"computed":false},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"resolve"},"arguments":[{"type":"Identifier","name":"value"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Promise"},"property":{"type":"Identifier","name":"resolve"},"computed":false},"arguments":[{"type":"Identifier","name":"value"}]},"property":{"type":"Identifier","name":"then"},"computed":false},"arguments":[{"type":"Identifier","name":"callNext"},{"type":"Identifier","name":"callThrow"}]}}]}}]}},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"callNext"},"arguments":[]}}]}}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-bind":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Function"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"bind"},"computed":false}}]},"helper-class-call-check":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"instance"},{"type":"Identifier","name":"Constructor"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"BinaryExpression","left":{"type":"Identifier","name":"instance"},"operator":"instanceof","right":{"type":"Identifier","name":"Constructor"},"parenthesizedExpression":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot call a class as a function"}]}}]},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-create-class":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"defineProperties"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"props"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"operator":"||","right":{"type":"Literal","value":false}}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false},{"type":"Identifier","name":"descriptor"}]}}]}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"staticProps"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"protoProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"Constructor"},"property":{"type":"Identifier","name":"prototype"},"computed":false},{"type":"Identifier","name":"protoProps"}]}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"staticProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"staticProps"}]}},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"Constructor"}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-create-decorated-class":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"defineProperties"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"descriptors"},{"type":"Identifier","name":"initializers"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorators"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"key"},"computed":false,"leadingComments":null},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"operator":"||","right":{"type":"Literal","value":false}}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"operator":"||","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"decorators"},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"f"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"f"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"f"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorator"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"f"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}},"operator":"===","right":{"type":"Literal","value":"function"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"descriptor"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"decorator"},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]},"operator":"||","right":{"type":"Identifier","name":"descriptor"}}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"The decorator for method "},"operator":"+","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}},"operator":"+","right":{"type":"Literal","value":" is of the invalid type "}},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}}}]}}]}}]}},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"operator":"!==","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"initializers"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"Identifier","name":"descriptor"}}},{"type":"ContinueStatement","label":null}]},"alternate":null}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"staticProps"},{"type":"Identifier","name":"protoInitializers"},{"type":"Identifier","name":"staticInitializers"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"protoProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"Constructor"},"property":{"type":"Identifier","name":"prototype"},"computed":false},{"type":"Identifier","name":"protoProps"},{"type":"Identifier","name":"protoInitializers"}]}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"staticProps"},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"defineProperties"},"arguments":[{"type":"Identifier","name":"Constructor"},{"type":"Identifier","name":"staticProps"},{"type":"Identifier","name":"staticInitializers"}]}},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"Constructor"}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-create-decorated-object":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"descriptors"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"target"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorators"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"key"},"computed":false,"leadingComments":null},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"decorators"},"computed":false}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"enumerable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"configurable"},"computed":false},"right":{"type":"Literal","value":true}}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"descriptor"}},"operator":"||","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"writable"},"computed":false},"right":{"type":"Literal","value":true}}},"alternate":null},{"type":"IfStatement","test":{"type":"Identifier","name":"decorators"},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"f"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"f"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"f"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"decorator"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"decorators"},"property":{"type":"Identifier","name":"f"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}},"operator":"===","right":{"type":"Literal","value":"function"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"descriptor"},"right":{"type":"LogicalExpression","left":{"type":"CallExpression","callee":{"type":"Identifier","name":"decorator"},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]},"operator":"||","right":{"type":"Identifier","name":"descriptor"}}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"The decorator for method "},"operator":"+","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"key"},"computed":false}},"operator":"+","right":{"type":"Literal","value":" is of the invalid type "}},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"decorator"}}}]}}]}}]}}]},"alternate":null},{"type":"IfStatement","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"value"},"computed":false},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"target"}]}}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]},"parenthesizedExpression":true}}]},"helper-default-props":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"defaultProps"},{"type":"Identifier","name":"props"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"defaultProps"},"consequent":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"propName"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"defaultProps"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"propName"},"computed":true}},"operator":"===","right":{"type":"Literal","value":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"props"},"property":{"type":"Identifier","name":"propName"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"defaultProps"},"property":{"type":"Identifier","name":"propName"},"computed":true}}}]},"alternate":null}]}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"props"}}]},"parenthesizedExpression":true}}]},"helper-defaults":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"defaults"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"keys"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyNames"},"computed":false},"arguments":[{"type":"Identifier","name":"defaults"}]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"value"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"defaults"},{"type":"Identifier","name":"key"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"Identifier","name":"value"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"value"},"property":{"type":"Identifier","name":"configurable"},"computed":false}},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true},"operator":"===","right":{"type":"Identifier","name":"undefined"}}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"value"}]}}]},"alternate":null}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"parenthesizedExpression":true}}]},"helper-define-decorated-property-descriptor":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptors"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_descriptor"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptors"},"property":{"type":"Identifier","name":"key"},"computed":true}}],"kind":"var"},{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"_descriptor"}},"consequent":{"type":"ReturnStatement","argument":null,"leadingComments":null,"trailingComments":null},"alternate":null},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"descriptor","leadingComments":null},"init":{"type":"ObjectExpression","properties":[]},"leadingComments":null}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"_descriptor"},"body":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"_key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"_descriptor"},"property":{"type":"Identifier","name":"_key"},"computed":true}},"trailingComments":null}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor","leadingComments":null},"property":{"type":"Identifier","name":"value"},"computed":false,"leadingComments":null},"right":{"type":"ConditionalExpression","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"consequent":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"descriptor"},"property":{"type":"Identifier","name":"initializer"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"target"}]},"alternate":{"type":"Identifier","name":"undefined"}},"leadingComments":null}},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"target"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"descriptor"}]}}]},"parenthesizedExpression":true}}]},"helper-define-property":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"Identifier","name":"value"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"key","leadingComments":null},"operator":"in","right":{"type":"Identifier","name":"obj"},"leadingComments":null},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperty"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"value"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true},"kind":"init"}]}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"Identifier","name":"value"}}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"parenthesizedExpression":true}}]},"helper-extends":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"LogicalExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"assign"},"computed":false},"operator":"||","right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"target"}],"body":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":1}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arguments"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"source"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"arguments"},"property":{"type":"Identifier","name":"i"},"computed":true}}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"source"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"source"},{"type":"Identifier","name":"key"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"target"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"source"},"property":{"type":"Identifier","name":"key"},"computed":true}}}]},"alternate":null}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]}}}}]},"helper-get":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":{"type":"Identifier","name":"get"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"receiver"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"object"},"operator":"===","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"object"},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"Function"},"property":{"type":"Identifier","name":"prototype"},"computed":false}}},"alternate":null},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"desc"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"desc"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"parent"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"object"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"parent"},"operator":"===","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"undefined"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"Identifier","name":"get"},"arguments":[{"type":"Identifier","name":"parent"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"receiver"}]}}]}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"desc"}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"value"},"computed":false}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"getter"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"get"},"computed":false}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"getter"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"undefined"}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"getter"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"receiver"}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-has-own":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false}}]},"helper-inherits":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"subClass"},{"type":"Identifier","name":"superClass"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"superClass"}},"operator":"!==","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"Identifier","name":"superClass"},"operator":"!==","right":{"type":"Literal","value":null,"rawValue":null}}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"BinaryExpression","left":{"type":"Literal","value":"Super expression must either be null or a function, not "},"operator":"+","right":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"superClass"}}}]}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"subClass"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"create"},"computed":false},"arguments":[{"type":"LogicalExpression","left":{"type":"Identifier","name":"superClass"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"superClass"},"property":{"type":"Identifier","name":"prototype"},"computed":false}},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"constructor"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"Identifier","name":"subClass"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"enumerable"},"value":{"type":"Literal","value":false},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"writable"},"value":{"type":"Literal","value":true},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"configurable"},"value":{"type":"Literal","value":true},"kind":"init"}]},"kind":"init"}]}]}}},{"type":"IfStatement","test":{"type":"Identifier","name":"superClass"},"consequent":{"type":"ExpressionStatement","expression":{"type":"ConditionalExpression","test":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"setPrototypeOf"},"computed":false},"consequent":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"setPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"subClass"},{"type":"Identifier","name":"superClass"}]},"alternate":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"subClass"},"property":{"type":"Identifier","name":"__proto__"},"computed":false},"right":{"type":"Identifier","name":"superClass"}}}},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-instanceof":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"left"},{"type":"Identifier","name":"right"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Identifier","name":"right"},"operator":"!=","right":{"type":"Literal","value":null,"rawValue":null}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"right"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"hasInstance"},"computed":false},"computed":true}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"right"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"hasInstance"},"computed":false},"computed":true},"arguments":[{"type":"Identifier","name":"left"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"BinaryExpression","left":{"type":"Identifier","name":"left"},"operator":"instanceof","right":{"type":"Identifier","name":"right"}}}]}}]},"parenthesizedExpression":true}}]},"helper-interop-export-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"defaults"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"newObj"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"defaults"},"arguments":[{"type":"ObjectExpression","properties":[]},{"type":"Identifier","name":"obj"}]}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"UnaryExpression","operator":"delete","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Literal","value":"default"},"computed":true}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"newObj"}}]},"parenthesizedExpression":true}}]},"helper-interop-require-default":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"Identifier","name":"obj"},"alternate":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Literal","value":"default"},"value":{"type":"Identifier","name":"obj"},"kind":"init"}]}}}]},"parenthesizedExpression":true}}]},"helper-interop-require-wildcard":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"obj"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"newObj"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"obj"},"operator":"!=","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"key"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"key"}]},"consequent":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Identifier","name":"key"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"key"},"computed":true}}},"alternate":null}]}}]},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"newObj"},"property":{"type":"Literal","value":"default"},"computed":true},"right":{"type":"Identifier","name":"obj"}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"newObj"}}]}}]},"parenthesizedExpression":true}}]},"helper-interop-require":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"__esModule"},"computed":false}},"consequent":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Literal","value":"default"},"computed":true},"alternate":{"type":"Identifier","name":"obj"}}}]},"parenthesizedExpression":true}}]},"helper-new-arrow-check":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"innerThis"},{"type":"Identifier","name":"boundThis"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"innerThis"},"operator":"!==","right":{"type":"Identifier","name":"boundThis"}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot instantiate an arrow function"}]}}]},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-object-destructuring-empty":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"obj"},"operator":"==","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Cannot destructure undefined"}]}},"alternate":null}]},"parenthesizedExpression":true}}]},"helper-object-without-properties":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"keys"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"target"},"init":{"type":"ObjectExpression","properties":[]}}],"kind":"var"},{"type":"ForInStatement","left":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":null}],"kind":"var"},"right":{"type":"Identifier","name":"obj"},"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"keys"},"property":{"type":"Identifier","name":"indexOf"},"computed":false},"arguments":[{"type":"Identifier","name":"i"}]},"operator":">=","right":{"type":"Literal","value":0}},"consequent":{"type":"ContinueStatement","label":null},"alternate":null},{"type":"IfStatement","test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"hasOwnProperty"},"computed":false},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"obj"},{"type":"Identifier","name":"i"}]}},"consequent":{"type":"ContinueStatement","label":null},"alternate":null},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"target"},"property":{"type":"Identifier","name":"i"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"i"},"computed":true}}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"target"}}]},"parenthesizedExpression":true}}]},"helper-self-global":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"ConditionalExpression","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"global"}},"operator":"===","right":{"type":"Literal","value":"undefined"}},"consequent":{"type":"Identifier","name":"self"},"alternate":{"type":"Identifier","name":"global"}}}]},"helper-set":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":{"type":"Identifier","name":"set"},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"value"},{"type":"Identifier","name":"receiver"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"desc"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getOwnPropertyDescriptor"},"computed":false},"arguments":[{"type":"Identifier","name":"object"},{"type":"Identifier","name":"property"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"desc"},"operator":"===","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"parent"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"getPrototypeOf"},"computed":false},"arguments":[{"type":"Identifier","name":"object"}]}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"parent"},"operator":"!==","right":{"type":"Literal","value":null,"rawValue":null}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"set"},"arguments":[{"type":"Identifier","name":"parent"},{"type":"Identifier","name":"property"},{"type":"Identifier","name":"value"},{"type":"Identifier","name":"receiver"}]}}]},"alternate":null}]},"alternate":{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"Literal","value":"value"},"operator":"in","right":{"type":"Identifier","name":"desc"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"writable"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"value"},"computed":false},"right":{"type":"Identifier","name":"value"}}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"setter"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"desc"},"property":{"type":"Identifier","name":"set"},"computed":false}}],"kind":"var"},{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"setter"},"operator":"!==","right":{"type":"Identifier","name":"undefined"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"setter"},"property":{"type":"Identifier","name":"call"},"computed":false},"arguments":[{"type":"Identifier","name":"receiver"},{"type":"Identifier","name":"value"}]}}]},"alternate":null}]}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"value"}}]},"parenthesizedExpression":true}}]},"helper-slice":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"prototype"},"computed":false},"property":{"type":"Identifier","name":"slice"},"computed":false}}]},"helper-sliced-to-array-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr"}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"operator":"in","right":{"type":"CallExpression","callee":{"type":"Identifier","name":"Object"},"arguments":[{"type":"Identifier","name":"arr"}]}},"consequent":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_arr"},"init":{"type":"ArrayExpression","elements":[]}}],"kind":"var"},{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_iterator"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_step"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_step"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_iterator"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false}},"update":null,"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"_step"},"property":{"type":"Identifier","name":"value"},"computed":false}]}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"i"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"i"}}},"consequent":{"type":"BreakStatement","label":null},"alternate":null}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"_arr"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Invalid attempt to destructure non-iterable instance"}]}}]}}}]},"parenthesizedExpression":true}}]},"helper-sliced-to-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"sliceIterator","leadingComments":null},"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_arr","leadingComments":null},"init":{"type":"ArrayExpression","elements":[]},"leadingComments":null}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_n"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_d"},"init":{"type":"Literal","value":false}}],"kind":"var"},{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_e"},"init":{"type":"Identifier","name":"undefined"}}],"kind":"var"},{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_i"},"init":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"computed":true},"arguments":[]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"_s"},"init":null}],"kind":"var"},"test":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_n"},"right":{"type":"MemberExpression","object":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_s"},"right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Identifier","name":"next"},"computed":false},"arguments":[]},"parenthesizedExpression":true},"property":{"type":"Identifier","name":"done"},"computed":false},"parenthesizedExpression":true}},"update":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_n"},"right":{"type":"Literal","value":true}},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"push"},"computed":false},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"_s"},"property":{"type":"Identifier","name":"value"},"computed":false}]}},{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"i"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"_arr"},"property":{"type":"Identifier","name":"length"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"i"}}},"consequent":{"type":"BreakStatement","label":null},"alternate":null}]}}]},"handler":{"type":"CatchClause","param":{"type":"Identifier","name":"err"},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_d"},"right":{"type":"Literal","value":true}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"Identifier","name":"_e"},"right":{"type":"Identifier","name":"err"}}}]}},"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"TryStatement","block":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"UnaryExpression","operator":"!","prefix":true,"argument":{"type":"Identifier","name":"_n"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Literal","value":"return"},"computed":true}},"consequent":{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"_i"},"property":{"type":"Literal","value":"return"},"computed":true},"arguments":[]}},"alternate":null}]},"handler":null,"guardedHandlers":[],"finalizer":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"Identifier","name":"_d"},"consequent":{"type":"ThrowStatement","argument":{"type":"Identifier","name":"_e"}},"alternate":null}]}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"_arr"}}]}},{"type":"ReturnStatement","argument":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr"}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Identifier","name":"iterator"},"computed":false},"operator":"in","right":{"type":"CallExpression","callee":{"type":"Identifier","name":"Object"},"arguments":[{"type":"Identifier","name":"arr"}]}},"consequent":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"Identifier","name":"sliceIterator"},"arguments":[{"type":"Identifier","name":"arr"},{"type":"Identifier","name":"i"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"TypeError"},"arguments":[{"type":"Literal","value":"Invalid attempt to destructure non-iterable instance"}]}}]}}}]}}}]},"parenthesizedExpression":true},"arguments":[]}}]},"helper-tagged-template-literal-loose":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"strings"},{"type":"Identifier","name":"raw"}],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"strings"},"property":{"type":"Identifier","name":"raw"},"computed":false},"right":{"type":"Identifier","name":"raw"}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"strings"}}]},"parenthesizedExpression":true}}]},"helper-tagged-template-literal":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"strings"},{"type":"Identifier","name":"raw"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"freeze"},"computed":false},"arguments":[{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"defineProperties"},"computed":false},"arguments":[{"type":"Identifier","name":"strings"},{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"raw"},"value":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"value"},"value":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Object"},"property":{"type":"Identifier","name":"freeze"},"computed":false},"arguments":[{"type":"Identifier","name":"raw"}]},"kind":"init"}]},"kind":"init"}]}]}]}}]},"parenthesizedExpression":true}}]},"helper-temporal-assert-defined":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"val"},{"type":"Identifier","name":"name"},{"type":"Identifier","name":"undef"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"val"},"operator":"===","right":{"type":"Identifier","name":"undef"}},"consequent":{"type":"BlockStatement","body":[{"type":"ThrowStatement","argument":{"type":"NewExpression","callee":{"type":"Identifier","name":"ReferenceError"},"arguments":[{"type":"BinaryExpression","left":{"type":"Identifier","name":"name"},"operator":"+","right":{"type":"Literal","value":" is not defined - temporal dead zone"}}]}}]},"alternate":null},{"type":"ReturnStatement","argument":{"type":"Literal","value":true}}]},"parenthesizedExpression":true}}]},"helper-temporal-undefined":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"ObjectExpression","properties":[],"parenthesizedExpression":true}}]},"helper-to-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"Identifier","name":"arr"},"alternate":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]}}}]},"parenthesizedExpression":true}}]},"helper-to-consumable-array":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"arr"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"isArray"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]},"consequent":{"type":"BlockStatement","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"i"},"init":{"type":"Literal","value":0}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"arr2"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"Array"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"length"},"computed":false}]}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"i"},"operator":"<","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"length"},"computed":false}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"i"}},"body":{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr2"},"property":{"type":"Identifier","name":"i"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"arr"},"property":{"type":"Identifier","name":"i"},"computed":true}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"arr2"}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Array"},"property":{"type":"Identifier","name":"from"},"computed":false},"arguments":[{"type":"Identifier","name":"arr"}]}}]}}]},"parenthesizedExpression":true}}]},"helper-typeof-react-element":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"Symbol"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Literal","value":"for"},"computed":true}},"operator":"&&","right":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"Symbol"},"property":{"type":"Literal","value":"for"},"computed":true},"arguments":[{"type":"Literal","value":"react.element"}]}},"operator":"||","right":{"type":"Literal","value":60103}}}]},"helper-typeof":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"obj"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ConditionalExpression","test":{"type":"LogicalExpression","left":{"type":"Identifier","name":"obj"},"operator":"&&","right":{"type":"BinaryExpression","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"obj"},"property":{"type":"Identifier","name":"constructor"},"computed":false},"operator":"===","right":{"type":"Identifier","name":"Symbol"}}},"consequent":{"type":"Literal","value":"symbol"},"alternate":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"obj"}}}}]},"parenthesizedExpression":true}}]},"let-scoping-return":{"type":"Program","body":[{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"RETURN"}},"operator":"===","right":{"type":"Literal","value":"object"}},"consequent":{"type":"ReturnStatement","argument":{"type":"MemberExpression","object":{"type":"Identifier","name":"RETURN"},"property":{"type":"Identifier","name":"v"},"computed":false}},"alternate":null}]},"named-function":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"GET_OUTER_ID"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION"}}]},"parenthesizedExpression":true},"arguments":[]}}]},"property-method-assignment-wrapper-generator":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FUNCTION_KEY"}],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"FUNCTION_ID"},"generator":true,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"YieldExpression","delegate":true,"argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_ID"},"property":{"type":"Identifier","name":"toString"},"computed":false},"right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"toString"},"computed":false},"arguments":[]}}]}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"FUNCTION"}]}}]},"property-method-assignment-wrapper":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FUNCTION_KEY"}],"body":{"type":"BlockStatement","body":[{"type":"FunctionDeclaration","id":{"type":"Identifier","name":"FUNCTION_ID"},"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"apply"},"computed":false},"arguments":[{"type":"ThisExpression"},{"type":"Identifier","name":"arguments"}]}}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_ID"},"property":{"type":"Identifier","name":"toString"},"computed":false},"right":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"FUNCTION_KEY"},"property":{"type":"Identifier","name":"toString"},"computed":false},"arguments":[]}}]}}}},{"type":"ReturnStatement","argument":{"type":"Identifier","name":"FUNCTION_ID"}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"FUNCTION"}]}}]},"prototype-identifier":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"MemberExpression","object":{"type":"Identifier","name":"CLASS_NAME"},"property":{"type":"Identifier","name":"prototype"},"computed":false}}]},"require-assign-key":{"type":"Program","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"VARIABLE_NAME"},"init":{"type":"MemberExpression","object":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]},"property":{"type":"Identifier","name":"KEY"},"computed":false}}],"kind":"var"}]},"require":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"require"},"arguments":[{"type":"Identifier","name":"MODULE_NAME"}]}}]},"rest":{"type":"Program","body":[{"type":"ForStatement","init":{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"LEN"},"init":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"length"},"computed":false}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"ARRAY"},"init":{"type":"CallExpression","callee":{"type":"Identifier","name":"Array"},"arguments":[{"type":"Identifier","name":"ARRAY_LEN"}]}},{"type":"VariableDeclarator","id":{"type":"Identifier","name":"KEY"},"init":{"type":"Identifier","name":"START"}}],"kind":"var"},"test":{"type":"BinaryExpression","left":{"type":"Identifier","name":"KEY"},"operator":"<","right":{"type":"Identifier","name":"LEN"}},"update":{"type":"UpdateExpression","operator":"++","prefix":false,"argument":{"type":"Identifier","name":"KEY"}},"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARRAY"},"property":{"type":"Identifier","name":"ARRAY_KEY"},"computed":true},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"ARGUMENTS"},"property":{"type":"Identifier","name":"KEY"},"computed":true}}}]}}]},"self-contained-helpers-head":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Literal","value":"default"},"computed":true},"right":{"type":"Identifier","name":"HELPER"}}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"exports"},"property":{"type":"Identifier","name":"__esModule"},"computed":false},"right":{"type":"Literal","value":true}}}]},"system":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"MemberExpression","object":{"type":"Identifier","name":"System"},"property":{"type":"Identifier","name":"register"},"computed":false},"arguments":[{"type":"Identifier","name":"MODULE_NAME"},{"type":"Identifier","name":"MODULE_DEPENDENCIES"},{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"EXPORT_IDENTIFIER"}],"body":{"type":"BlockStatement","body":[{"type":"ReturnStatement","argument":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"setters"},"value":{"type":"Identifier","name":"SETTERS"},"kind":"init"},{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"execute"},"value":{"type":"Identifier","name":"EXECUTE"},"kind":"init"}]}}]}}]}}]},"tail-call-body":{"type":"Program","body":[{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"AGAIN_ID"},"init":{"type":"Literal","value":true}}],"kind":"var"},{"type":"LabeledStatement","body":{"type":"WhileStatement","test":{"type":"Identifier","name":"AGAIN_ID"},"body":{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"BLOCK"}}},"label":{"type":"Identifier","name":"FUNCTION_ID"}}]}]},"test-exports":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"exports"}},"operator":"!==","right":{"type":"Literal","value":"undefined"}}}]},"test-module":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"module"}},"operator":"!==","right":{"type":"Literal","value":"undefined"}}}]},"umd-commonjs-strict":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"root"},{"type":"Identifier","name":"factory"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"define"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"define"},"property":{"type":"Identifier","name":"amd"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"define"},"arguments":[{"type":"Identifier","name":"AMD_ARGUMENTS"},{"type":"Identifier","name":"factory"}]}}]},"alternate":{"type":"IfStatement","test":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"exports"}},"operator":"===","right":{"type":"Literal","value":"object"}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"COMMON_ARGUMENTS"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"BROWSER_ARGUMENTS"}]}}]}}}]},"parenthesizedExpression":true},"arguments":[{"type":"Identifier","name":"UMD_ROOT"},{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"FACTORY_PARAMETERS"}],"body":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"Identifier","name":"FACTORY_BODY"}}]}}]}}]},"umd-runner-body":{"type":"Program","body":[{"type":"ExpressionStatement","expression":{"type":"FunctionExpression","id":null,"generator":false,"expression":false,"params":[{"type":"Identifier","name":"global"},{"type":"Identifier","name":"factory"}],"body":{"type":"BlockStatement","body":[{"type":"IfStatement","test":{"type":"LogicalExpression","left":{"type":"BinaryExpression","left":{"type":"UnaryExpression","operator":"typeof","prefix":true,"argument":{"type":"Identifier","name":"define"}},"operator":"===","right":{"type":"Literal","value":"function"}},"operator":"&&","right":{"type":"MemberExpression","object":{"type":"Identifier","name":"define"},"property":{"type":"Identifier","name":"amd"},"computed":false}},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"define"},"arguments":[{"type":"Identifier","name":"AMD_ARGUMENTS"},{"type":"Identifier","name":"factory"}]}}]},"alternate":{"type":"IfStatement","test":{"type":"Identifier","name":"COMMON_TEST"},"consequent":{"type":"BlockStatement","body":[{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"Identifier","name":"COMMON_ARGUMENTS"}]}}]},"alternate":{"type":"BlockStatement","body":[{"type":"VariableDeclaration","declarations":[{"type":"VariableDeclarator","id":{"type":"Identifier","name":"mod"},"init":{"type":"ObjectExpression","properties":[{"type":"Property","method":false,"shorthand":false,"computed":false,"key":{"type":"Identifier","name":"exports"},"value":{"type":"ObjectExpression","properties":[]},"kind":"init"}]}}],"kind":"var"},{"type":"ExpressionStatement","expression":{"type":"CallExpression","callee":{"type":"Identifier","name":"factory"},"arguments":[{"type":"MemberExpression","object":{"type":"Identifier","name":"mod"},"property":{"type":"Identifier","name":"exports"},"computed":false},{"type":"Identifier","name":"BROWSER_ARGUMENTS"}]}},{"type":"ExpressionStatement","expression":{"type":"AssignmentExpression","operator":"=","left":{"type":"MemberExpression","object":{"type":"Identifier","name":"global"},"property":{"type":"Identifier","name":"GLOBAL_ARG"},"computed":false},"right":{"type":"MemberExpression","object":{"type":"Identifier","name":"mod"},"property":{"type":"Identifier","name":"exports"},"computed":false}}}]}}}]},"parenthesizedExpression":true}}]}} -},{}],613:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -exports.parse = parse; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _parser = _dereq_(617); - -var _parser2 = _interopRequireDefault(_parser); - -_dereq_(622); - -_dereq_(621); - -_dereq_(619); - -_dereq_(616); - -_dereq_(620); - -_dereq_(618); - -_dereq_(615); - -var _tokenizerTypes = _dereq_(629); - -_dereq_(627); - -_dereq_(626); - -var _pluginsFlow = _dereq_(623); - -var _pluginsFlow2 = _interopRequireDefault(_pluginsFlow); - -var _pluginsJsx = _dereq_(624); - -var _pluginsJsx2 = _interopRequireDefault(_pluginsJsx); - -_parser.plugins.flow = _pluginsFlow2["default"]; -_parser.plugins.jsx = _pluginsJsx2["default"]; - -function parse(input, options) { - return new _parser2["default"](options, input).parse(); -} - -exports.tokTypes = _tokenizerTypes.types; -},{"615":615,"616":616,"617":617,"618":618,"619":619,"620":620,"621":621,"622":622,"623":623,"624":624,"626":626,"627":627,"629":629}],614:[function(_dereq_,module,exports){ -// A second optional argument can be given to further configure -// the parser process. These options are recognized: - -"use strict"; - -exports.__esModule = true; -exports.getOptions = getOptions; -var defaultOptions = { - // Source type ("script" or "module") for different semantics - sourceType: "script", - // By default, reserved words are not enforced. Disable - // `allowReserved` to enforce them. When this option has the - // value "never", reserved words and keywords can also not be - // used as property names. - allowReserved: true, - // When enabled, a return at the top level is not considered an - // error. - allowReturnOutsideFunction: false, - // When enabled, import/export statements are not constrained to - // appearing at the top of the program. - allowImportExportEverywhere: false, - plugins: {}, - // Babel-specific options - features: {}, - strictMode: null -}; - -exports.defaultOptions = defaultOptions; -// Interpret and default an options object - -function getOptions(opts) { - var options = {}; - for (var key in defaultOptions) { - options[key] = opts && key in opts ? opts[key] : defaultOptions[key]; - } - return options; -} -},{}],615:[function(_dereq_,module,exports){ -/** - * Based on the comment attachment algorithm used in espree and estraverse. - * - * 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 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. - */ - -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -function last(stack) { - return stack[stack.length - 1]; -} - -var pp = _index2["default"].prototype; - -pp.addComment = function (comment) { - this.state.trailingComments.push(comment); - this.state.leadingComments.push(comment); -}; - -pp.processComment = function (node) { - if (node.type === "Program" && node.body.length > 0) return; - - var stack = this.state.commentStack; - - var lastChild, trailingComments, i; - - if (this.state.trailingComments.length > 0) { - // If the first comment in trailingComments comes after the - // current node, then we're good - all comments in the array will - // come after the node and so it's safe to add them as official - // trailingComments. - if (this.state.trailingComments[0].start >= node.end) { - trailingComments = this.state.trailingComments; - this.state.trailingComments = []; - } else { - // Otherwise, if the first comment doesn't come after the - // current node, that means we have a mix of leading and trailing - // comments in the array and that leadingComments contains the - // same items as trailingComments. Reset trailingComments to - // zero items and we'll handle this by evaluating leadingComments - // later. - this.state.trailingComments.length = 0; - } - } else { - var lastInStack = last(stack); - if (stack.length > 0 && lastInStack.trailingComments && lastInStack.trailingComments[0].start >= node.end) { - trailingComments = lastInStack.trailingComments; - lastInStack.trailingComments = null; - } - } - - // Eating the stack. - while (stack.length > 0 && last(stack).start >= node.start) { - lastChild = stack.pop(); - } - - if (lastChild) { - if (lastChild.leadingComments) { - if (lastChild !== node && last(lastChild.leadingComments).end <= node.start) { - node.leadingComments = lastChild.leadingComments; - lastChild.leadingComments = null; - } else { - // A leading comment for an anonymous class had been stolen by its first MethodDefinition, - // so this takes back the leading comment. - // See also: https://github.com/eslint/espree/issues/158 - for (i = lastChild.leadingComments.length - 2; i >= 0; --i) { - if (lastChild.leadingComments[i].end <= node.start) { - node.leadingComments = lastChild.leadingComments.splice(0, i + 1); - break; - } - } - } - } - } else if (this.state.leadingComments.length > 0) { - if (last(this.state.leadingComments).end <= node.start) { - node.leadingComments = this.state.leadingComments; - this.state.leadingComments = []; - } else { - // https://github.com/eslint/espree/issues/2 - // - // In special cases, such as return (without a value) and - // debugger, all comments will end up as leadingComments and - // will otherwise be eliminated. This step runs when the - // commentStack is empty and there are comments left - // in leadingComments. - // - // This loop figures out the stopping point between the actual - // leading and trailing comments by finding the location of the - // first comment that comes after the given node. - for (i = 0; i < this.state.leadingComments.length; i++) { - if (this.state.leadingComments[i].end > node.start) { - break; - } - } - - // Split the array based on the location of the first comment - // that comes after the node. Keep in mind that this could - // result in an empty array, and if so, the array must be - // deleted. - node.leadingComments = this.state.leadingComments.slice(0, i); - if (node.leadingComments.length === 0) { - node.leadingComments = null; - } - - // Similarly, trailing comments are attached later. The variable - // must be reset to null if there are no trailing comments. - trailingComments = this.state.leadingComments.slice(i); - if (trailingComments.length === 0) { - trailingComments = null; - } - } - } - - if (trailingComments) { - if (trailingComments.length && trailingComments[0].start >= node.start && last(trailingComments).end <= node.end) { - node.innerComments = trailingComments; - } else { - node.trailingComments = trailingComments; - } - } - - stack.push(node); -}; -},{"617":617}],616:[function(_dereq_,module,exports){ -// A recursive descent parser operates by defining functions for all -// syntactic elements, and recursively calling those, each function -// advancing the input stream and returning an AST node. Precedence -// of constructs (for example, the fact that `!x[1]` means `!(x[1])` -// instead of `(!x)[1]` is handled by the fact that the parser -// function that parses unary prefix operators is called first, and -// in turn calls the function that parses `[]` subscripts — that -// way, it'll receive the node for `x[1]` already parsed, and wraps -// *that* in the unary operator node. -// -// Acorn uses an [operator precedence parser][opp] to handle binary -// operator precedence, because it is much more compact than using -// the technique outlined above, which uses different, nesting -// functions to specify precedence, for all of the ten binary -// precedence levels that JavaScript defines. -// -// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser - -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _tokenizerTypes = _dereq_(629); - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var _utilIdentifier = _dereq_(630); - -var pp = _index2["default"].prototype; - -// Check if property name clashes with already added. -// Object/class getters and setters are not allowed to clash — -// either with each other or with an init property — and in -// strict mode, init properties are also not allowed to be repeated. - -pp.checkPropClash = function (prop, propHash) { - if (prop.computed || prop.method || prop.shorthand) return; - - var key = prop.key, - name = undefined; - switch (key.type) { - case "Identifier": - name = key.name;break; - case "Literal": - name = String(key.value);break; - default: - return; - } - - var kind = prop.kind; - if (name === "__proto__" && kind === "init") { - if (propHash.proto) this.raise(key.start, "Redefinition of __proto__ property"); - propHash.proto = true; - } -}; - -// ### Expression parsing - -// These nest, from the most general expression type at the top to -// 'atomic', nondivisible expression types at the bottom. Most of -// the functions will simply let the function (s) below them parse, -// and, *if* the syntactic construct they handle is present, wrap -// the AST node that the inner parser gave them in another node. - -// Parse a full expression. The optional arguments are used to -// forbid the `in` operator (in for loops initalization expressions) -// and provide reference for storing '=' operator inside shorthand -// property assignment in contexts where both object expression -// and object pattern might appear (so it's possible to raise -// delayed syntax error at correct position). - -pp.parseExpression = function (noIn, refShorthandDefaultPos) { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var expr = this.parseMaybeAssign(noIn, refShorthandDefaultPos); - if (this.match(_tokenizerTypes.types.comma)) { - var node = this.startNodeAt(startPos, startLoc); - node.expressions = [expr]; - while (this.eat(_tokenizerTypes.types.comma)) { - node.expressions.push(this.parseMaybeAssign(noIn, refShorthandDefaultPos)); - } - this.toReferencedList(node.expressions); - return this.finishNode(node, "SequenceExpression"); - } - return expr; -}; - -// Parse an assignment expression. This includes applications of -// operators like `+=`. - -pp.parseMaybeAssign = function (noIn, refShorthandDefaultPos, afterLeftParse) { - if (this.match(_tokenizerTypes.types._yield) && this.state.inGenerator) { - return this.parseYield(); - } - - var failOnShorthandAssign = undefined; - if (!refShorthandDefaultPos) { - refShorthandDefaultPos = { start: 0 }; - failOnShorthandAssign = true; - } else { - failOnShorthandAssign = false; - } - var startPos = this.state.start, - startLoc = this.state.startLoc; - if (this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.name)) { - this.state.potentialArrowAt = this.state.start; - } - var left = this.parseMaybeConditional(noIn, refShorthandDefaultPos); - if (afterLeftParse) left = afterLeftParse.call(this, left, startPos, startLoc); - if (this.state.type.isAssign) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.left = this.match(_tokenizerTypes.types.eq) ? this.toAssignable(left) : left; - refShorthandDefaultPos.start = 0; // reset because shorthand default was used correctly - this.checkLVal(left); - if (left.parenthesizedExpression) { - var errorMsg = undefined; - if (left.type === "ObjectPattern") { - errorMsg = "`({a}) = 0` use `({a} = 0)`"; - } else if (left.type === "ArrayPattern") { - errorMsg = "`([a]) = 0` use `([a] = 0)`"; - } - if (errorMsg) { - this.raise(left.start, "You're trying to assign to a parenthesized expression, eg. instead of " + errorMsg); - } - } - this.next(); - node.right = this.parseMaybeAssign(noIn); - return this.finishNode(node, "AssignmentExpression"); - } else if (failOnShorthandAssign && refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - return left; -}; - -// Parse a ternary conditional (`?:`) operator. - -pp.parseMaybeConditional = function (noIn, refShorthandDefaultPos) { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var expr = this.parseExprOps(noIn, refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - if (this.eat(_tokenizerTypes.types.question)) { - var node = this.startNodeAt(startPos, startLoc); - node.test = expr; - node.consequent = this.parseMaybeAssign(); - this.expect(_tokenizerTypes.types.colon); - node.alternate = this.parseMaybeAssign(noIn); - return this.finishNode(node, "ConditionalExpression"); - } - return expr; -}; - -// Start the precedence parser. - -pp.parseExprOps = function (noIn, refShorthandDefaultPos) { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var expr = this.parseMaybeUnary(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } else { - return this.parseExprOp(expr, startPos, startLoc, -1, noIn); - } -}; - -// Parse binary operators with the operator precedence parsing -// algorithm. `left` is the left-hand side of the operator. -// `minPrec` provides context that allows the function to stop and -// defer further parser to one of its callers when it encounters an -// operator that has a lower precedence than the set it is parsing. - -pp.parseExprOp = function (left, leftStartPos, leftStartLoc, minPrec, noIn) { - var prec = this.state.type.binop; - if (prec != null && (!noIn || !this.match(_tokenizerTypes.types._in))) { - if (prec > minPrec) { - var node = this.startNodeAt(leftStartPos, leftStartLoc); - node.left = left; - node.operator = this.state.value; - var op = this.state.type; - this.next(); - var startPos = this.state.start, - startLoc = this.state.startLoc; - node.right = this.parseExprOp(this.parseMaybeUnary(), startPos, startLoc, op.rightAssociative ? prec - 1 : prec, noIn); - this.finishNode(node, op === _tokenizerTypes.types.logicalOR || op === _tokenizerTypes.types.logicalAND ? "LogicalExpression" : "BinaryExpression"); - return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, noIn); - } - } - return left; -}; - -// Parse unary operators, both prefix and postfix. - -pp.parseMaybeUnary = function (refShorthandDefaultPos) { - if (this.state.type.prefix) { - var node = this.startNode(), - update = this.match(_tokenizerTypes.types.incDec); - node.operator = this.state.value; - node.prefix = true; - this.next(); - node.argument = this.parseMaybeUnary(); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); - if (update) { - this.checkLVal(node.argument); - } else if (this.strict && node.operator === "delete" && node.argument.type === "Identifier") { - this.raise(node.start, "Deleting local variable in strict mode"); - } - return this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression"); - } - - var startPos = this.state.start, - startLoc = this.state.startLoc; - var expr = this.parseExprSubscripts(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) return expr; - while (this.state.type.postfix && !this.canInsertSemicolon()) { - var node = this.startNodeAt(startPos, startLoc); - node.operator = this.state.value; - node.prefix = false; - node.argument = expr; - this.checkLVal(expr); - this.next(); - expr = this.finishNode(node, "UpdateExpression"); - } - return expr; -}; - -// Parse call, dot, and `[]`-subscript expressions. - -pp.parseExprSubscripts = function (refShorthandDefaultPos) { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var expr = this.parseExprAtom(refShorthandDefaultPos); - if (refShorthandDefaultPos && refShorthandDefaultPos.start) { - return expr; - } else { - return this.parseSubscripts(expr, startPos, startLoc); - } -}; - -pp.parseSubscripts = function (base, startPos, startLoc, noCalls) { - for (;;) { - if (!noCalls && this.eat(_tokenizerTypes.types.doubleColon)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.callee = this.parseNoCallExpr(); - return this.parseSubscripts(this.finishNode(node, "BindExpression"), startPos, startLoc, noCalls); - } else if (this.eat(_tokenizerTypes.types.dot)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseIdent(true); - node.computed = false; - base = this.finishNode(node, "MemberExpression"); - } else if (this.eat(_tokenizerTypes.types.bracketL)) { - var node = this.startNodeAt(startPos, startLoc); - node.object = base; - node.property = this.parseExpression(); - node.computed = true; - this.expect(_tokenizerTypes.types.bracketR); - base = this.finishNode(node, "MemberExpression"); - } else if (!noCalls && this.match(_tokenizerTypes.types.parenL)) { - var possibleAsync = base.type === "Identifier" && base.name === "async" && !this.canInsertSemicolon(); - this.next(); - - var node = this.startNodeAt(startPos, startLoc); - node.callee = base; - node.arguments = this.parseExprList(_tokenizerTypes.types.parenR, this.options.features["es7.trailingFunctionCommas"]); - base = this.finishNode(node, "CallExpression"); - - if (possibleAsync && (this.match(_tokenizerTypes.types.colon) || this.match(_tokenizerTypes.types.arrow))) { - base = this.parseAsyncArrowFromCallExpression(this.startNodeAt(startPos, startLoc), node); - } else { - this.toReferencedList(node.arguments); - } - } else if (this.match(_tokenizerTypes.types.backQuote)) { - var node = this.startNodeAt(startPos, startLoc); - node.tag = base; - node.quasi = this.parseTemplate(); - base = this.finishNode(node, "TaggedTemplateExpression"); - } else { - return base; - } - } -}; - -pp.parseAsyncArrowFromCallExpression = function (node, call) { - if (!this.options.features["es7.asyncFunctions"]) this.unexpected(); - this.expect(_tokenizerTypes.types.arrow); - return this.parseArrowExpression(node, call.arguments, true); -}; - -// Parse a no-call expression (like argument of `new` or `::` operators). - -pp.parseNoCallExpr = function () { - var startPos = this.state.start, - startLoc = this.state.startLoc; - return this.parseSubscripts(this.parseExprAtom(), startPos, startLoc, true); -}; - -// Parse an atomic expression — either a single token that is an -// expression, an expression started by a keyword like `function` or -// `new`, or an expression wrapped in punctuation like `()`, `[]`, -// or `{}`. - -pp.parseExprAtom = function (refShorthandDefaultPos) { - var node = undefined, - canBeArrow = this.state.potentialArrowAt === this.state.start; - switch (this.state.type) { - case _tokenizerTypes.types._super: - if (!this.state.inFunction) this.raise(this.state.start, "'super' outside of function or class"); - case _tokenizerTypes.types._this: - var type = this.match(_tokenizerTypes.types._this) ? "ThisExpression" : "Super"; - node = this.startNode(); - this.next(); - return this.finishNode(node, type); - - case _tokenizerTypes.types._yield: - if (this.state.inGenerator) this.unexpected(); - - case _tokenizerTypes.types._do: - if (this.options.features["es7.doExpressions"]) { - var _node = this.startNode(); - this.next(); - var oldInFunction = this.state.inFunction; - var oldLabels = this.state.labels; - this.state.labels = []; - this.state.inFunction = false; - _node.body = this.parseBlock(); - this.state.inFunction = oldInFunction; - this.state.labels = oldLabels; - return this.finishNode(_node, "DoExpression"); - } - - case _tokenizerTypes.types.name: - node = this.startNode(); - var id = this.parseIdent(true); - - if (this.options.features["es7.asyncFunctions"]) { - if (id.name === "await") { - if (this.inAsync) return this.parseAwait(node); - } else if (id.name === "async" && this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) { - this.next(); - return this.parseFunction(node, false, false, true); - } else if (canBeArrow && id.name === "async" && this.match(_tokenizerTypes.types.name)) { - var params = [this.parseIdent()]; - this.expect(_tokenizerTypes.types.arrow); - // var foo = bar => {}; - return this.parseArrowExpression(node, params, true); - } - } - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) { - return this.parseArrowExpression(node, [id]); - } - - return id; - - case _tokenizerTypes.types.regexp: - var value = this.state.value; - node = this.parseLiteral(value.value); - node.regex = { pattern: value.pattern, flags: value.flags }; - return node; - - case _tokenizerTypes.types.num:case _tokenizerTypes.types.string: - return this.parseLiteral(this.state.value); - - case _tokenizerTypes.types._null:case _tokenizerTypes.types._true:case _tokenizerTypes.types._false: - node = this.startNode(); - node.rawValue = node.value = this.match(_tokenizerTypes.types._null) ? null : this.match(_tokenizerTypes.types._true); - node.raw = this.state.type.keyword; - this.next(); - return this.finishNode(node, "Literal"); - - case _tokenizerTypes.types.parenL: - return this.parseParenAndDistinguishExpression(null, null, canBeArrow); - - case _tokenizerTypes.types.bracketL: - node = this.startNode(); - this.next(); - // check whether this is array comprehension or regular array - if (this.options.features["es7.comprehensions"] && this.match(_tokenizerTypes.types._for)) { - return this.parseComprehension(node, false); - } - node.elements = this.parseExprList(_tokenizerTypes.types.bracketR, true, true, refShorthandDefaultPos); - this.toReferencedList(node.elements); - return this.finishNode(node, "ArrayExpression"); - - case _tokenizerTypes.types.braceL: - return this.parseObj(false, refShorthandDefaultPos); - - case _tokenizerTypes.types._function: - node = this.startNode(); - this.next(); - return this.parseFunction(node, false); - - case _tokenizerTypes.types.at: - this.parseDecorators(); - - case _tokenizerTypes.types._class: - node = this.startNode(); - this.takeDecorators(node); - return this.parseClass(node, false); - - case _tokenizerTypes.types._new: - return this.parseNew(); - - case _tokenizerTypes.types.backQuote: - return this.parseTemplate(); - - case _tokenizerTypes.types.doubleColon: - node = this.startNode(); - this.next(); - node.object = null; - var callee = node.callee = this.parseNoCallExpr(); - if (callee.type === "MemberExpression") { - return this.finishNode(node, "BindExpression"); - } else { - this.raise(callee.start, "Binding should be performed on object property."); - } - - default: - this.unexpected(); - } -}; - -pp.parseLiteral = function (value) { - var node = this.startNode(); - node.rawValue = node.value = value; - node.raw = this.input.slice(this.state.start, this.state.end); - this.next(); - return this.finishNode(node, "Literal"); -}; - -pp.parseParenExpression = function () { - this.expect(_tokenizerTypes.types.parenL); - var val = this.parseExpression(); - this.expect(_tokenizerTypes.types.parenR); - return val; -}; - -pp.parseParenAndDistinguishExpression = function (startPos, startLoc, canBeArrow, isAsync) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - var val = undefined; - this.next(); - - if (this.options.features["es7.comprehensions"] && this.match(_tokenizerTypes.types._for)) { - return this.parseComprehension(this.startNodeAt(startPos, startLoc), true); - } - - var innerStartPos = this.state.start, - innerStartLoc = this.state.startLoc; - var exprList = [], - first = true; - var refShorthandDefaultPos = { start: 0 }, - spreadStart = undefined, - innerParenStart = undefined, - optionalCommaStart = undefined; - while (!this.match(_tokenizerTypes.types.parenR)) { - if (first) { - first = false; - } else { - this.expect(_tokenizerTypes.types.comma); - if (this.match(_tokenizerTypes.types.parenR) && this.options.features["es7.trailingFunctionCommas"]) { - optionalCommaStart = this.state.start; - break; - } - } - - if (this.match(_tokenizerTypes.types.ellipsis)) { - var spreadNodeStartPos = this.state.start, - spreadNodeStartLoc = this.state.startLoc; - spreadStart = this.state.start; - exprList.push(this.parseParenItem(this.parseRest(), spreadNodeStartLoc, spreadNodeStartPos)); - break; - } else { - if (this.match(_tokenizerTypes.types.parenL) && !innerParenStart) { - innerParenStart = this.state.start; - } - exprList.push(this.parseMaybeAssign(false, refShorthandDefaultPos, this.parseParenItem)); - } - } - var innerEndPos = this.state.start; - var innerEndLoc = this.state.startLoc; - this.expect(_tokenizerTypes.types.parenR); - - if (canBeArrow && !this.canInsertSemicolon() && this.eat(_tokenizerTypes.types.arrow)) { - if (innerParenStart) this.unexpected(innerParenStart); - return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, isAsync); - } - - if (!exprList.length) { - if (isAsync) { - return; - } else { - this.unexpected(this.state.lastTokStart); - } - } - if (optionalCommaStart) this.unexpected(optionalCommaStart); - if (spreadStart) this.unexpected(spreadStart); - if (refShorthandDefaultPos.start) this.unexpected(refShorthandDefaultPos.start); - - if (exprList.length > 1) { - val = this.startNodeAt(innerStartPos, innerStartLoc); - val.expressions = exprList; - this.toReferencedList(val.expressions); - this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc); - } else { - val = exprList[0]; - } - - val.parenthesizedExpression = true; - return val; -}; - -pp.parseParenItem = function (node) { - return node; -}; - -// New's precedence is slightly tricky. It must allow its argument -// to be a `[]` or dot subscript expression, but not a call — at -// least, not without wrapping it in parentheses. Thus, it uses the - -pp.parseNew = function () { - var node = this.startNode(); - var meta = this.parseIdent(true); - - if (this.eat(_tokenizerTypes.types.dot)) { - node.meta = meta; - node.property = this.parseIdent(true); - - if (node.property.name !== "target") { - this.raise(node.property.start, "The only valid meta property for new is new.target"); - } - - return this.finishNode(node, "MetaProperty"); - } - - node.callee = this.parseNoCallExpr(); - - if (this.eat(_tokenizerTypes.types.parenL)) { - node.arguments = this.parseExprList(_tokenizerTypes.types.parenR, this.options.features["es7.trailingFunctionCommas"]); - this.toReferencedList(node.arguments); - } else { - node.arguments = []; - } - - return this.finishNode(node, "NewExpression"); -}; - -// Parse template expression. - -pp.parseTemplateElement = function () { - var elem = this.startNode(); - elem.value = { - raw: this.input.slice(this.state.start, this.state.end).replace(/\r\n?/g, "\n"), - cooked: this.state.value - }; - this.next(); - elem.tail = this.match(_tokenizerTypes.types.backQuote); - return this.finishNode(elem, "TemplateElement"); -}; - -pp.parseTemplate = function () { - var node = this.startNode(); - this.next(); - node.expressions = []; - var curElt = this.parseTemplateElement(); - node.quasis = [curElt]; - while (!curElt.tail) { - this.expect(_tokenizerTypes.types.dollarBraceL); - node.expressions.push(this.parseExpression()); - this.expect(_tokenizerTypes.types.braceR); - node.quasis.push(curElt = this.parseTemplateElement()); - } - this.next(); - return this.finishNode(node, "TemplateLiteral"); -}; - -// Parse an object literal or binding pattern. - -pp.parseObj = function (isPattern, refShorthandDefaultPos) { - var node = this.startNode(), - first = true, - propHash = Object.create(null); - node.properties = []; - var decorators = []; - this.next(); - while (!this.eat(_tokenizerTypes.types.braceR)) { - if (first) { - first = false; - } else { - this.expect(_tokenizerTypes.types.comma); - if (this.eat(_tokenizerTypes.types.braceR)) break; - } - - while (this.match(_tokenizerTypes.types.at)) { - decorators.push(this.parseDecorator()); - } - - var prop = this.startNode(), - isGenerator = false, - isAsync = false, - startPos = undefined, - startLoc = undefined; - if (decorators.length) { - prop.decorators = decorators; - decorators = []; - } - if (this.options.features["es7.objectRestSpread"] && this.match(_tokenizerTypes.types.ellipsis)) { - prop = this.parseSpread(); - prop.type = "SpreadProperty"; - node.properties.push(prop); - continue; - } - prop.method = false; - prop.shorthand = false; - if (isPattern || refShorthandDefaultPos) { - startPos = this.state.start; - startLoc = this.state.startLoc; - } - if (!isPattern) { - isGenerator = this.eat(_tokenizerTypes.types.star); - } - if (!isPattern && this.options.features["es7.asyncFunctions"] && this.isContextual("async")) { - if (isGenerator) this.unexpected(); - var asyncId = this.parseIdent(); - if (this.match(_tokenizerTypes.types.colon) || this.match(_tokenizerTypes.types.parenL) || this.match(_tokenizerTypes.types.braceR)) { - prop.key = asyncId; - } else { - isAsync = true; - this.parsePropertyName(prop); - } - } else { - this.parsePropertyName(prop); - } - this.parseObjPropValue(prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos); - this.checkPropClash(prop, propHash); - node.properties.push(this.finishNode(prop, "Property")); - } - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no property"); - } - return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression"); -}; - -pp.parseObjPropValue = function (prop, startPos, startLoc, isGenerator, isAsync, isPattern, refShorthandDefaultPos) { - if (this.eat(_tokenizerTypes.types.colon)) { - prop.value = isPattern ? this.parseMaybeDefault(this.state.start, this.state.startLoc) : this.parseMaybeAssign(false, refShorthandDefaultPos); - prop.kind = "init"; - } else if (this.match(_tokenizerTypes.types.parenL)) { - if (isPattern) this.unexpected(); - prop.kind = "init"; - prop.method = true; - prop.value = this.parseMethod(isGenerator, isAsync); - } else if (!prop.computed && prop.key.type === "Identifier" && (prop.key.name === "get" || prop.key.name === "set") && !this.match(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) { - if (isGenerator || isAsync || isPattern) this.unexpected(); - prop.kind = prop.key.name; - this.parsePropertyName(prop); - prop.value = this.parseMethod(false); - var paramCount = prop.kind === "get" ? 0 : 1; - if (prop.value.params.length !== paramCount) { - var start = prop.value.start; - if (prop.kind === "get") this.raise(start, "getter should have no params");else this.raise(start, "setter should have exactly one param"); - } - } else if (!prop.computed && prop.key.type === "Identifier") { - prop.kind = "init"; - if (isPattern) { - if (this.isKeyword(prop.key.name) || this.strict && (_utilIdentifier.reservedWords.strictBind(prop.key.name) || _utilIdentifier.reservedWords.strict(prop.key.name)) || !this.options.allowReserved && this.isReservedWord(prop.key.name)) this.raise(prop.key.start, "Binding " + prop.key.name); - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else if (this.match(_tokenizerTypes.types.eq) && refShorthandDefaultPos) { - if (!refShorthandDefaultPos.start) refShorthandDefaultPos.start = this.state.start; - prop.value = this.parseMaybeDefault(startPos, startLoc, prop.key.__clone()); - } else { - prop.value = prop.key.__clone(); - } - prop.shorthand = true; - } else { - this.unexpected(); - } -}; - -pp.parsePropertyName = function (prop) { - if (this.eat(_tokenizerTypes.types.bracketL)) { - prop.computed = true; - prop.key = this.parseMaybeAssign(); - this.expect(_tokenizerTypes.types.bracketR); - return prop.key; - } else { - prop.computed = false; - return prop.key = this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdent(true); - } -}; - -// Initialize empty function node. - -pp.initFunction = function (node, isAsync) { - node.id = null; - node.generator = false; - node.expression = false; - if (this.options.features["es7.asyncFunctions"]) { - node.async = !!isAsync; - } -}; - -// Parse object or class method. - -pp.parseMethod = function (isGenerator, isAsync) { - var node = this.startNode(); - this.initFunction(node, isAsync); - this.expect(_tokenizerTypes.types.parenL); - node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.options.features["es7.trailingFunctionCommas"]); - node.generator = isGenerator; - this.parseFunctionBody(node); - return this.finishNode(node, "FunctionExpression"); -}; - -// Parse arrow function expression with given parameters. - -pp.parseArrowExpression = function (node, params, isAsync) { - this.initFunction(node, isAsync); - node.params = this.toAssignableList(params, true); - this.parseFunctionBody(node, true); - return this.finishNode(node, "ArrowFunctionExpression"); -}; - -// Parse function body and check parameters. - -pp.parseFunctionBody = function (node, allowExpression) { - var isExpression = allowExpression && !this.match(_tokenizerTypes.types.braceL); - - var oldInAsync = this.inAsync; - this.inAsync = node.async; - if (isExpression) { - node.body = this.parseMaybeAssign(); - node.expression = true; - } else { - // Start a new scope with regard to labels and the `inFunction` - // flag (restore them to their old value afterwards). - var oldInFunc = this.state.inFunction, - oldInGen = this.state.inGenerator, - oldLabels = this.state.labels; - this.state.inFunction = true;this.state.inGenerator = node.generator;this.state.labels = []; - node.body = this.parseBlock(true); - node.expression = false; - this.state.inFunction = oldInFunc;this.state.inGenerator = oldInGen;this.state.labels = oldLabels; - } - this.inAsync = oldInAsync; - - // If this is a strict mode function, verify that argument names - // are not repeated, and it does not try to bind the words `eval` - // or `arguments`. - if (this.strict || !isExpression && node.body.body.length && this.isUseStrict(node.body.body[0])) { - var nameHash = Object.create(null), - oldStrict = this.strict; - this.strict = true; - if (node.id) { - this.checkLVal(node.id, true); - } - var _arr = node.params; - for (var _i = 0; _i < _arr.length; _i++) { - var param = _arr[_i]; - this.checkLVal(param, true, nameHash); - } - this.strict = oldStrict; - } -}; - -// Parses a comma-separated list of expressions, and returns them as -// an array. `close` is the token type that ends the list, and -// `allowEmpty` can be turned on to allow subsequent commas with -// nothing in between them to be parsed as `null` (which is needed -// for array literals). - -pp.parseExprList = function (close, allowTrailingComma, allowEmpty, refShorthandDefaultPos) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) { - first = false; - } else { - this.expect(_tokenizerTypes.types.comma); - if (allowTrailingComma && this.eat(close)) break; - } - - elts.push(this.parseExprListItem(allowEmpty, refShorthandDefaultPos)); - } - return elts; -}; - -pp.parseExprListItem = function (allowEmpty, refShorthandDefaultPos) { - var elt = undefined; - if (allowEmpty && this.match(_tokenizerTypes.types.comma)) { - elt = null; - } else if (this.match(_tokenizerTypes.types.ellipsis)) { - elt = this.parseSpread(refShorthandDefaultPos); - } else { - elt = this.parseMaybeAssign(false, refShorthandDefaultPos); - } - return elt; -}; - -// Parse the next token as an identifier. If `liberal` is true (used -// when parsing properties), it will also convert keywords into -// identifiers. - -pp.parseIdent = function (liberal) { - var node = this.startNode(); - if (this.match(_tokenizerTypes.types.name)) { - if (!liberal && (!this.options.allowReserved && this.isReservedWord(this.state.value) || this.strict && _utilIdentifier.reservedWords.strict(this.state.value))) this.raise(this.state.start, "The keyword '" + this.state.value + "' is reserved"); - node.name = this.state.value; - } else if (liberal && this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "Identifier"); -}; - -// Parses await expression inside async function. - -pp.parseAwait = function (node) { - if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { - this.unexpected(); - } - node.all = this.eat(_tokenizerTypes.types.star); - node.argument = this.parseMaybeUnary(); - return this.finishNode(node, "AwaitExpression"); -}; - -// Parses yield expression inside generator. - -pp.parseYield = function () { - var node = this.startNode(); - this.next(); - if (this.match(_tokenizerTypes.types.semi) || this.canInsertSemicolon() || !this.match(_tokenizerTypes.types.star) && !this.state.type.startsExpr) { - node.delegate = false; - node.argument = null; - } else { - node.delegate = this.eat(_tokenizerTypes.types.star); - node.argument = this.parseMaybeAssign(); - } - return this.finishNode(node, "YieldExpression"); -}; - -// Parses array and generator comprehensions. - -pp.parseComprehension = function (node, isGenerator) { - node.blocks = []; - while (this.match(_tokenizerTypes.types._for)) { - var block = this.startNode(); - this.next(); - this.expect(_tokenizerTypes.types.parenL); - block.left = this.parseBindingAtom(); - this.checkLVal(block.left, true); - this.expectContextual("of"); - block.right = this.parseExpression(); - this.expect(_tokenizerTypes.types.parenR); - node.blocks.push(this.finishNode(block, "ComprehensionBlock")); - } - node.filter = this.eat(_tokenizerTypes.types._if) ? this.parseParenExpression() : null; - node.body = this.parseExpression(); - this.expect(isGenerator ? _tokenizerTypes.types.parenR : _tokenizerTypes.types.bracketR); - node.generator = isGenerator; - return this.finishNode(node, "ComprehensionExpression"); -}; -},{"617":617,"629":629,"630":630}],617:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// istanbul ignore next - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -// istanbul ignore next - -function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } - -var _utilIdentifier = _dereq_(630); - -var _options = _dereq_(614); - -var _tokenizer = _dereq_(627); - -var _tokenizer2 = _interopRequireDefault(_tokenizer); - -// Registered plugins - -var plugins = {}; - -exports.plugins = plugins; - -var Parser = (function (_Tokenizer) { - _inherits(Parser, _Tokenizer); - - function Parser(options, input) { - _classCallCheck(this, Parser); - - _Tokenizer.call(this, input); - - this.options = _options.getOptions(options); - this.isKeyword = _utilIdentifier.isKeyword; - this.isReservedWord = _utilIdentifier.reservedWords[6]; - this.input = input; - this.loadPlugins(this.options.plugins); - - // Figure out if it's a module code. - this.inModule = this.options.sourceType === "module"; - this.strict = this.options.strictMode === false ? false : this.inModule; - - // If enabled, skip leading hashbang line. - if (this.state.pos === 0 && this.input[0] === "#" && this.input[1] === "!") { - this.skipLineComment(2); - } - } - - Parser.prototype.extend = function extend(name, f) { - this[name] = f(this[name]); - }; - - Parser.prototype.loadPlugins = function loadPlugins(plugins) { - for (var _name in plugins) { - var plugin = exports.plugins[_name]; - if (!plugin) throw new Error("Plugin '" + _name + "' not found"); - plugin(this, plugins[_name]); - } - }; - - Parser.prototype.parse = function parse() { - var file = this.startNode(); - var program = this.startNode(); - this.nextToken(); - return this.parseTopLevel(file, program); - }; - - return Parser; -})(_tokenizer2["default"]); - -exports["default"] = Parser; -},{"614":614,"627":627,"630":630}],618:[function(_dereq_,module,exports){ -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _utilLocation = _dereq_(631); - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var pp = _index2["default"].prototype; - -// This function is used to raise exceptions on parse errors. It -// takes an offset integer (into the current `input`) to indicate -// the location of the error, attaches the position to the end -// of the error message, and then raises a `SyntaxError` with that -// message. - -pp.raise = function (pos, message) { - var loc = _utilLocation.getLineInfo(this.input, pos); - message += " (" + loc.line + ":" + loc.column + ")"; - var err = new SyntaxError(message); - err.pos = pos; - err.loc = loc; - throw err; -}; -},{"617":617,"631":631}],619:[function(_dereq_,module,exports){ -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _tokenizerTypes = _dereq_(629); - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var _utilIdentifier = _dereq_(630); - -var pp = _index2["default"].prototype; - -// Convert existing expression atom to assignable pattern -// if possible. - -pp.toAssignable = function (node, isBinding) { - if (node) { - switch (node.type) { - case "Identifier": - case "ObjectPattern": - case "ArrayPattern": - case "AssignmentPattern": - break; - - case "ObjectExpression": - node.type = "ObjectPattern"; - var _arr = node.properties; - for (var _i = 0; _i < _arr.length; _i++) { - var prop = _arr[_i]; - if (prop.type === "SpreadProperty") continue; - if (prop.kind !== "init") this.raise(prop.key.start, "Object pattern can't contain getter or setter"); - this.toAssignable(prop.value, isBinding); - } - break; - - case "ArrayExpression": - node.type = "ArrayPattern"; - this.toAssignableList(node.elements, isBinding); - break; - - case "AssignmentExpression": - if (node.operator === "=") { - node.type = "AssignmentPattern"; - delete node.operator; - } else { - this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); - } - break; - - case "MemberExpression": - if (!isBinding) break; - - default: - this.raise(node.start, "Assigning to rvalue"); - } - } - return node; -}; - -// Convert list of expression atoms to binding list. - -pp.toAssignableList = function (exprList, isBinding) { - var end = exprList.length; - if (end) { - var last = exprList[end - 1]; - if (last && last.type === "RestElement") { - --end; - } else if (last && last.type === "SpreadElement") { - last.type = "RestElement"; - var arg = last.argument; - this.toAssignable(arg, isBinding); - if (arg.type !== "Identifier" && arg.type !== "MemberExpression" && arg.type !== "ArrayPattern") { - this.unexpected(arg.start); - } - --end; - } - } - for (var i = 0; i < end; i++) { - var elt = exprList[i]; - if (elt) this.toAssignable(elt, isBinding); - } - return exprList; -}; - -// Convert list of expression atoms to a list of - -pp.toReferencedList = function (exprList) { - return exprList; -}; - -// Parses spread element. - -pp.parseSpread = function (refShorthandDefaultPos) { - var node = this.startNode(); - this.next(); - node.argument = this.parseMaybeAssign(refShorthandDefaultPos); - return this.finishNode(node, "SpreadElement"); -}; - -pp.parseRest = function () { - var node = this.startNode(); - this.next(); - node.argument = this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types.bracketL) ? this.parseBindingAtom() : this.unexpected(); - return this.finishNode(node, "RestElement"); -}; - -// Parses lvalue (assignable) atom. - -pp.parseBindingAtom = function () { - switch (this.state.type) { - case _tokenizerTypes.types.name: - return this.parseIdent(); - - case _tokenizerTypes.types.bracketL: - var node = this.startNode(); - this.next(); - node.elements = this.parseBindingList(_tokenizerTypes.types.bracketR, true, true); - return this.finishNode(node, "ArrayPattern"); - - case _tokenizerTypes.types.braceL: - return this.parseObj(true); - - default: - this.unexpected(); - } -}; - -pp.parseBindingList = function (close, allowEmpty, allowTrailingComma) { - var elts = [], - first = true; - while (!this.eat(close)) { - if (first) first = false;else this.expect(_tokenizerTypes.types.comma); - if (allowEmpty && this.match(_tokenizerTypes.types.comma)) { - elts.push(null); - } else if (allowTrailingComma && this.eat(close)) { - break; - } else if (this.match(_tokenizerTypes.types.ellipsis)) { - elts.push(this.parseAssignableListItemTypes(this.parseRest())); - this.expect(close); - break; - } else { - var left = this.parseMaybeDefault(); - this.parseAssignableListItemTypes(left); - elts.push(this.parseMaybeDefault(null, null, left)); - } - } - return elts; -}; - -pp.parseAssignableListItemTypes = function (param) { - return param; -}; - -// Parses assignment pattern around given atom if possible. - -pp.parseMaybeDefault = function (startPos, startLoc, left) { - startLoc = startLoc || this.state.startLoc; - startPos = startPos || this.state.start; - left = left || this.parseBindingAtom(); - if (!this.eat(_tokenizerTypes.types.eq)) return left; - - var node = this.startNodeAt(startPos, startLoc); - node.left = left; - node.right = this.parseMaybeAssign(); - return this.finishNode(node, "AssignmentPattern"); -}; - -// Verify that a node is an lval — something that can be assigned -// to. - -pp.checkLVal = function (expr, isBinding, checkClashes) { - switch (expr.type) { - case "Identifier": - if (this.strict && (_utilIdentifier.reservedWords.strictBind(expr.name) || _utilIdentifier.reservedWords.strict(expr.name))) this.raise(expr.start, (isBinding ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); - if (checkClashes) { - if (checkClashes[expr.name]) { - this.raise(expr.start, "Argument name clash in strict mode"); - } else { - checkClashes[expr.name] = true; - } - } - break; - - case "MemberExpression": - if (isBinding) this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " member expression"); - break; - - case "ObjectPattern": - var _arr2 = expr.properties; - - for (var _i2 = 0; _i2 < _arr2.length; _i2++) { - var prop = _arr2[_i2]; - if (prop.type === "Property") prop = prop.value; - this.checkLVal(prop, isBinding, checkClashes); - } - break; - - case "ArrayPattern": - var _arr3 = expr.elements; - - for (var _i3 = 0; _i3 < _arr3.length; _i3++) { - var elem = _arr3[_i3]; - if (elem) this.checkLVal(elem, isBinding, checkClashes); - } - break; - - case "AssignmentPattern": - this.checkLVal(expr.left, isBinding, checkClashes); - break; - - case "SpreadProperty": - case "RestElement": - this.checkLVal(expr.argument, isBinding, checkClashes); - break; - - default: - this.raise(expr.start, (isBinding ? "Binding" : "Assigning to") + " rvalue"); - } -}; -},{"617":617,"629":629,"630":630}],620:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// istanbul ignore next - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var _utilLocation = _dereq_(631); - -// Start an AST node, attaching a start offset. - -var pp = _index2["default"].prototype; - -var Node = (function () { - function Node(parser, pos, loc) { - _classCallCheck(this, Node); - - this.type = ""; - this.start = pos; - this.end = 0; - this.loc = new _utilLocation.SourceLocation(loc); - } - - Node.prototype.__clone = function __clone() { - var node2 = new Node(); - for (var key in this) node2[key] = this[key]; - return node2; - }; - - return Node; -})(); - -exports.Node = Node; - -pp.startNode = function () { - return new Node(this, this.state.start, this.state.startLoc); -}; - -pp.startNodeAt = function (pos, loc) { - return new Node(this, pos, loc); -}; - -function finishNodeAt(node, type, pos, loc) { - node.type = type; - node.end = pos; - node.loc.end = loc; - this.processComment(node); - return node; -} - -// Finish an AST node, adding `type` and `end` properties. - -pp.finishNode = function (node, type) { - return finishNodeAt.call(this, node, type, this.state.lastTokEnd, this.state.lastTokEndLoc); -}; - -// Finish node at given position - -pp.finishNodeAt = function (node, type, pos, loc) { - return finishNodeAt.call(this, node, type, pos, loc); -}; -},{"617":617,"631":631}],621:[function(_dereq_,module,exports){ -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _tokenizerTypes = _dereq_(629); - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var _utilWhitespace = _dereq_(632); - -var pp = _index2["default"].prototype; - -// ### Statement parsing - -// Parse a program. Initializes the parser, reads any number of -// statements, and wraps them in a Program node. Optionally takes a -// `program` argument. If present, the statements will be appended -// to its body instead of creating a new node. - -pp.parseTopLevel = function (file, program) { - program.sourceType = this.options.sourceType; - program.body = []; - - var first = true; - while (!this.match(_tokenizerTypes.types.eof)) { - var stmt = this.parseStatement(true, true); - program.body.push(stmt); - if (first) { - if (this.isUseStrict(stmt)) this.setStrict(true); - first = false; - } - } - this.next(); - - file.program = this.finishNode(program, "Program"); - file.comments = this.state.comments; - file.tokens = this.state.tokens; - - return this.finishNode(file, "File"); -}; - -var loopLabel = { kind: "loop" }, - switchLabel = { kind: "switch" }; - -// Parse a single statement. -// -// If expecting a statement and finding a slash operator, parse a -// regular expression literal. This is to handle cases like -// `if (foo) /blah/.exec(foo)`, where looking at the previous token -// does not help. - -pp.parseStatement = function (declaration, topLevel) { - if (this.match(_tokenizerTypes.types.at)) { - this.parseDecorators(true); - } - - var starttype = this.state.type, - node = this.startNode(); - - // Most types of statements are recognized by the keyword they - // start with. Many are trivial to parse, some require a bit of - // complexity. - - switch (starttype) { - case _tokenizerTypes.types._break:case _tokenizerTypes.types._continue: - return this.parseBreakContinueStatement(node, starttype.keyword); - case _tokenizerTypes.types._debugger: - return this.parseDebuggerStatement(node); - case _tokenizerTypes.types._do: - return this.parseDoStatement(node); - case _tokenizerTypes.types._for: - return this.parseForStatement(node); - case _tokenizerTypes.types._function: - if (!declaration) this.unexpected(); - return this.parseFunctionStatement(node); - - case _tokenizerTypes.types._class: - if (!declaration) this.unexpected(); - this.takeDecorators(node); - return this.parseClass(node, true); - - case _tokenizerTypes.types._if: - return this.parseIfStatement(node); - case _tokenizerTypes.types._return: - return this.parseReturnStatement(node); - case _tokenizerTypes.types._switch: - return this.parseSwitchStatement(node); - case _tokenizerTypes.types._throw: - return this.parseThrowStatement(node); - case _tokenizerTypes.types._try: - return this.parseTryStatement(node); - case _tokenizerTypes.types._let:case _tokenizerTypes.types._const: - if (!declaration) this.unexpected(); // NOTE: falls through to _var - case _tokenizerTypes.types._var: - return this.parseVarStatement(node, starttype); - case _tokenizerTypes.types._while: - return this.parseWhileStatement(node); - case _tokenizerTypes.types._with: - return this.parseWithStatement(node); - case _tokenizerTypes.types.braceL: - return this.parseBlock(); - case _tokenizerTypes.types.semi: - return this.parseEmptyStatement(node); - case _tokenizerTypes.types._export: - case _tokenizerTypes.types._import: - if (!this.options.allowImportExportEverywhere) { - if (!topLevel) this.raise(this.state.start, "'import' and 'export' may only appear at the top level"); - - if (!this.inModule) this.raise(this.state.start, "'import' and 'export' may appear only with 'sourceType: module'"); - } - return starttype === _tokenizerTypes.types._import ? this.parseImport(node) : this.parseExport(node); - - case _tokenizerTypes.types.name: - if (this.options.features["es7.asyncFunctions"] && this.state.value === "async") { - // peek ahead and see if next token is a function - var state = this.state.clone(); - this.next(); - if (this.match(_tokenizerTypes.types._function) && !this.canInsertSemicolon()) { - this.expect(_tokenizerTypes.types._function); - return this.parseFunction(node, true, false, true); - } else { - this.state = state; - } - } - - // If the statement does not start with a statement keyword or a - // brace, it's an ExpressionStatement or LabeledStatement. We - // simply start parsing an expression, and afterwards, if the - // next token is a colon and the expression was a simple - // Identifier node, we switch to interpreting it as a label. - default: - var maybeName = this.state.value, - expr = this.parseExpression(); - - if (starttype === _tokenizerTypes.types.name && expr.type === "Identifier" && this.eat(_tokenizerTypes.types.colon)) { - return this.parseLabeledStatement(node, maybeName, expr); - } else { - return this.parseExpressionStatement(node, expr); - } - } -}; - -pp.takeDecorators = function (node) { - if (this.state.decorators.length) { - node.decorators = this.state.decorators; - this.state.decorators = []; - } -}; - -pp.parseDecorators = function (allowExport) { - while (this.match(_tokenizerTypes.types.at)) { - this.state.decorators.push(this.parseDecorator()); - } - - if (allowExport && this.match(_tokenizerTypes.types._export)) { - return; - } - - if (!this.match(_tokenizerTypes.types._class)) { - this.raise(this.state.start, "Leading decorators must be attached to a class declaration"); - } -}; - -pp.parseDecorator = function () { - if (!this.options.features["es7.decorators"]) { - this.unexpected(); - } - var node = this.startNode(); - this.next(); - node.expression = this.parseMaybeAssign(); - return this.finishNode(node, "Decorator"); -}; - -pp.parseBreakContinueStatement = function (node, keyword) { - var isBreak = keyword === "break"; - this.next(); - - if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { - node.label = null; - } else if (!this.match(_tokenizerTypes.types.name)) { - this.unexpected(); - } else { - node.label = this.parseIdent(); - this.semicolon(); - } - - // Verify that there is an actual destination to break or - // continue to. - for (var i = 0; i < this.state.labels.length; ++i) { - var lab = this.state.labels[i]; - if (node.label == null || lab.name === node.label.name) { - if (lab.kind != null && (isBreak || lab.kind === "loop")) break; - if (node.label && isBreak) break; - } - } - if (i === this.state.labels.length) this.raise(node.start, "Unsyntactic " + keyword); - return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement"); -}; - -pp.parseDebuggerStatement = function (node) { - this.next(); - this.semicolon(); - return this.finishNode(node, "DebuggerStatement"); -}; - -pp.parseDoStatement = function (node) { - this.next(); - this.state.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.state.labels.pop(); - this.expect(_tokenizerTypes.types._while); - node.test = this.parseParenExpression(); - this.eat(_tokenizerTypes.types.semi); - return this.finishNode(node, "DoWhileStatement"); -}; - -// Disambiguating between a `for` and a `for`/`in` or `for`/`of` -// loop is non-trivial. Basically, we have to parse the init `var` -// statement or expression, disallowing the `in` operator (see -// the second parameter to `parseExpression`), and then check -// whether the next token is `in` or `of`. When there is no init -// part (semicolon immediately after the opening parenthesis), it -// is a regular `for` loop. - -pp.parseForStatement = function (node) { - this.next(); - this.state.labels.push(loopLabel); - this.expect(_tokenizerTypes.types.parenL); - - if (this.match(_tokenizerTypes.types.semi)) { - return this.parseFor(node, null); - } - - if (this.match(_tokenizerTypes.types._var) || this.match(_tokenizerTypes.types._let) || this.match(_tokenizerTypes.types._const)) { - var _init = this.startNode(), - varKind = this.state.type; - this.next(); - this.parseVar(_init, true, varKind); - this.finishNode(_init, "VariableDeclaration"); - if ((this.match(_tokenizerTypes.types._in) || this.isContextual("of")) && _init.declarations.length === 1 && !(varKind !== _tokenizerTypes.types._var && _init.declarations[0].init)) return this.parseForIn(node, _init); - return this.parseFor(node, _init); - } - - var refShorthandDefaultPos = { start: 0 }; - var init = this.parseExpression(true, refShorthandDefaultPos); - if (this.match(_tokenizerTypes.types._in) || this.isContextual("of")) { - this.toAssignable(init); - this.checkLVal(init); - return this.parseForIn(node, init); - } else if (refShorthandDefaultPos.start) { - this.unexpected(refShorthandDefaultPos.start); - } - return this.parseFor(node, init); -}; - -pp.parseFunctionStatement = function (node) { - this.next(); - return this.parseFunction(node, true); -}; - -pp.parseIfStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - node.consequent = this.parseStatement(false); - node.alternate = this.eat(_tokenizerTypes.types._else) ? this.parseStatement(false) : null; - return this.finishNode(node, "IfStatement"); -}; - -pp.parseReturnStatement = function (node) { - if (!this.state.inFunction && !this.options.allowReturnOutsideFunction) { - this.raise(this.state.start, "'return' outside of function"); - } - - this.next(); - - // In `return` (and `break`/`continue`), the keywords with - // optional arguments, we eagerly look for a semicolon or the - // possibility to insert one. - - if (this.eat(_tokenizerTypes.types.semi) || this.canInsertSemicolon()) { - node.argument = null; - } else { - node.argument = this.parseExpression(); - this.semicolon(); - } - - return this.finishNode(node, "ReturnStatement"); -}; - -pp.parseSwitchStatement = function (node) { - this.next(); - node.discriminant = this.parseParenExpression(); - node.cases = []; - this.expect(_tokenizerTypes.types.braceL); - this.state.labels.push(switchLabel); - - // Statements under must be grouped (by label) in SwitchCase - // nodes. `cur` is used to keep the node that we are currently - // adding statements to. - - for (var cur, sawDefault; !this.match(_tokenizerTypes.types.braceR);) { - if (this.match(_tokenizerTypes.types._case) || this.match(_tokenizerTypes.types._default)) { - var isCase = this.match(_tokenizerTypes.types._case); - if (cur) this.finishNode(cur, "SwitchCase"); - node.cases.push(cur = this.startNode()); - cur.consequent = []; - this.next(); - if (isCase) { - cur.test = this.parseExpression(); - } else { - if (sawDefault) this.raise(this.state.lastTokStart, "Multiple default clauses"); - sawDefault = true; - cur.test = null; - } - this.expect(_tokenizerTypes.types.colon); - } else { - if (!cur) this.unexpected(); - cur.consequent.push(this.parseStatement(true)); - } - } - if (cur) this.finishNode(cur, "SwitchCase"); - this.next(); // Closing brace - this.state.labels.pop(); - return this.finishNode(node, "SwitchStatement"); -}; - -pp.parseThrowStatement = function (node) { - this.next(); - if (_utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start))) this.raise(this.state.lastTokEnd, "Illegal newline after throw"); - node.argument = this.parseExpression(); - this.semicolon(); - return this.finishNode(node, "ThrowStatement"); -}; - -// Reused empty array added for node fields that are always empty. - -var empty = []; - -pp.parseTryStatement = function (node) { - this.next(); - node.block = this.parseBlock(); - node.handler = null; - if (this.match(_tokenizerTypes.types._catch)) { - var clause = this.startNode(); - this.next(); - this.expect(_tokenizerTypes.types.parenL); - clause.param = this.parseBindingAtom(); - this.checkLVal(clause.param, true); - this.expect(_tokenizerTypes.types.parenR); - clause.body = this.parseBlock(); - node.handler = this.finishNode(clause, "CatchClause"); - } - - node.guardedHandlers = empty; - node.finalizer = this.eat(_tokenizerTypes.types._finally) ? this.parseBlock() : null; - - if (!node.handler && !node.finalizer) { - this.raise(node.start, "Missing catch or finally clause"); - } - - return this.finishNode(node, "TryStatement"); -}; - -pp.parseVarStatement = function (node, kind) { - this.next(); - this.parseVar(node, false, kind); - this.semicolon(); - return this.finishNode(node, "VariableDeclaration"); -}; - -pp.parseWhileStatement = function (node) { - this.next(); - node.test = this.parseParenExpression(); - this.state.labels.push(loopLabel); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, "WhileStatement"); -}; - -pp.parseWithStatement = function (node) { - if (this.strict) this.raise(this.state.start, "'with' in strict mode"); - this.next(); - node.object = this.parseParenExpression(); - node.body = this.parseStatement(false); - return this.finishNode(node, "WithStatement"); -}; - -pp.parseEmptyStatement = function (node) { - this.next(); - return this.finishNode(node, "EmptyStatement"); -}; - -pp.parseLabeledStatement = function (node, maybeName, expr) { - var _arr = this.state.labels; - - for (var _i = 0; _i < _arr.length; _i++) { - var label = _arr[_i]; - if (label.name === maybeName) { - this.raise(expr.start, "Label '" + maybeName + "' is already declared"); - } - } - - var kind = this.state.type.isLoop ? "loop" : this.match(_tokenizerTypes.types._switch) ? "switch" : null; - for (var i = this.state.labels.length - 1; i >= 0; i--) { - var label = this.state.labels[i]; - if (label.statementStart === node.start) { - label.statementStart = this.state.start; - label.kind = kind; - } else { - break; - } - } - - this.state.labels.push({ name: maybeName, kind: kind, statementStart: this.state.start }); - node.body = this.parseStatement(true); - this.state.labels.pop(); - node.label = expr; - return this.finishNode(node, "LabeledStatement"); -}; - -pp.parseExpressionStatement = function (node, expr) { - node.expression = expr; - this.semicolon(); - return this.finishNode(node, "ExpressionStatement"); -}; - -// Parse a semicolon-enclosed block of statements, handling `"use -// strict"` declarations when `allowStrict` is true (used for -// function bodies). - -pp.parseBlock = function (allowStrict) { - var node = this.startNode(), - first = true, - oldStrict = undefined; - node.body = []; - this.expect(_tokenizerTypes.types.braceL); - while (!this.eat(_tokenizerTypes.types.braceR)) { - var stmt = this.parseStatement(true); - node.body.push(stmt); - if (first && allowStrict && this.isUseStrict(stmt)) { - oldStrict = this.strict; - this.setStrict(this.strict = true); - } - first = false; - } - if (oldStrict === false) this.setStrict(false); - return this.finishNode(node, "BlockStatement"); -}; - -// Parse a regular `for` loop. The disambiguation code in -// `parseStatement` will already have parsed the init statement or -// expression. - -pp.parseFor = function (node, init) { - node.init = init; - this.expect(_tokenizerTypes.types.semi); - node.test = this.match(_tokenizerTypes.types.semi) ? null : this.parseExpression(); - this.expect(_tokenizerTypes.types.semi); - node.update = this.match(_tokenizerTypes.types.parenR) ? null : this.parseExpression(); - this.expect(_tokenizerTypes.types.parenR); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, "ForStatement"); -}; - -// Parse a `for`/`in` and `for`/`of` loop, which are almost -// same from parser's perspective. - -pp.parseForIn = function (node, init) { - var type = this.match(_tokenizerTypes.types._in) ? "ForInStatement" : "ForOfStatement"; - this.next(); - node.left = init; - node.right = this.parseExpression(); - this.expect(_tokenizerTypes.types.parenR); - node.body = this.parseStatement(false); - this.state.labels.pop(); - return this.finishNode(node, type); -}; - -// Parse a list of variable declarations. - -pp.parseVar = function (node, isFor, kind) { - node.declarations = []; - node.kind = kind.keyword; - for (;;) { - var decl = this.startNode(); - this.parseVarHead(decl); - if (this.eat(_tokenizerTypes.types.eq)) { - decl.init = this.parseMaybeAssign(isFor); - } else if (kind === _tokenizerTypes.types._const && !(this.match(_tokenizerTypes.types._in) || this.isContextual("of"))) { - this.unexpected(); - } else if (decl.id.type !== "Identifier" && !(isFor && (this.match(_tokenizerTypes.types._in) || this.isContextual("of")))) { - this.raise(this.state.lastTokEnd, "Complex binding patterns require an initialization value"); - } else { - decl.init = null; - } - node.declarations.push(this.finishNode(decl, "VariableDeclarator")); - if (!this.eat(_tokenizerTypes.types.comma)) break; - } - return node; -}; - -pp.parseVarHead = function (decl) { - decl.id = this.parseBindingAtom(); - this.checkLVal(decl.id, true); -}; - -// Parse a function declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseFunction = function (node, isStatement, allowExpressionBody, isAsync) { - this.initFunction(node, isAsync); - node.generator = this.eat(_tokenizerTypes.types.star); - - if (isStatement || this.match(_tokenizerTypes.types.name)) { - node.id = this.parseIdent(); - } - - this.parseFunctionParams(node); - this.parseFunctionBody(node, allowExpressionBody); - return this.finishNode(node, isStatement ? "FunctionDeclaration" : "FunctionExpression"); -}; - -pp.parseFunctionParams = function (node) { - this.expect(_tokenizerTypes.types.parenL); - node.params = this.parseBindingList(_tokenizerTypes.types.parenR, false, this.options.features["es7.trailingFunctionCommas"]); -}; - -// Parse a class declaration or literal (depending on the -// `isStatement` parameter). - -pp.parseClass = function (node, isStatement) { - this.next(); - this.parseClassId(node, isStatement); - this.parseClassSuper(node); - var classBody = this.startNode(); - var hadConstructor = false; - classBody.body = []; - this.expect(_tokenizerTypes.types.braceL); - var decorators = []; - while (!this.eat(_tokenizerTypes.types.braceR)) { - if (this.eat(_tokenizerTypes.types.semi)) continue; - if (this.match(_tokenizerTypes.types.at)) { - decorators.push(this.parseDecorator()); - continue; - } - var method = this.startNode(); - if (decorators.length) { - method.decorators = decorators; - decorators = []; - } - var isMaybeStatic = this.match(_tokenizerTypes.types.name) && this.state.value === "static"; - var isGenerator = this.eat(_tokenizerTypes.types.star), - isAsync = false; - this.parsePropertyName(method); - method["static"] = isMaybeStatic && !this.match(_tokenizerTypes.types.parenL); - if (method["static"]) { - if (isGenerator) this.unexpected(); - isGenerator = this.eat(_tokenizerTypes.types.star); - this.parsePropertyName(method); - } - if (!isGenerator && method.key.type === "Identifier" && !method.computed && this.isClassProperty()) { - classBody.body.push(this.parseClassProperty(method)); - continue; - } - if (this.options.features["es7.asyncFunctions"] && !this.match(_tokenizerTypes.types.parenL) && !method.computed && method.key.type === "Identifier" && method.key.name === "async") { - isAsync = true; - this.parsePropertyName(method); - } - var isGetSet = false; - method.kind = "method"; - if (!method.computed) { - var key = method.key; - - if (!isAsync && !isGenerator && key.type === "Identifier" && !this.match(_tokenizerTypes.types.parenL) && (key.name === "get" || key.name === "set")) { - isGetSet = true; - method.kind = key.name; - key = this.parsePropertyName(method); - } - if (!method["static"] && (key.type === "Identifier" && key.name === "constructor" || key.type === "Literal" && key.value === "constructor")) { - if (hadConstructor) this.raise(key.start, "Duplicate constructor in the same class"); - if (isGetSet) this.raise(key.start, "Constructor can't have get/set modifier"); - if (isGenerator) this.raise(key.start, "Constructor can't be a generator"); - if (isAsync) this.raise(key.start, "Constructor can't be an async function"); - method.kind = "constructor"; - hadConstructor = true; - } - } - if (method.kind === "constructor" && method.decorators) { - this.raise(method.start, "You can't attach decorators to a class constructor"); - } - this.parseClassMethod(classBody, method, isGenerator, isAsync); - if (isGetSet) { - var paramCount = method.kind === "get" ? 0 : 1; - if (method.value.params.length !== paramCount) { - var start = method.value.start; - if (method.kind === "get") { - this.raise(start, "getter should have no params"); - } else { - this.raise(start, "setter should have exactly one param"); - } - } - } - } - - if (decorators.length) { - this.raise(this.state.start, "You have trailing decorators with no method"); - } - - node.body = this.finishNode(classBody, "ClassBody"); - return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression"); -}; - -pp.isClassProperty = function () { - return this.match(_tokenizerTypes.types.eq) || this.match(_tokenizerTypes.types.semi) || this.canInsertSemicolon(); -}; - -pp.parseClassProperty = function (node) { - if (this.match(_tokenizerTypes.types.eq)) { - if (!this.options.features["es7.classProperties"]) this.unexpected(); - this.next(); - node.value = this.parseMaybeAssign(); - } else { - node.value = null; - } - this.semicolon(); - return this.finishNode(node, "ClassProperty"); -}; - -pp.parseClassMethod = function (classBody, method, isGenerator, isAsync) { - method.value = this.parseMethod(isGenerator, isAsync); - classBody.body.push(this.finishNode(method, "MethodDefinition")); -}; - -pp.parseClassId = function (node, isStatement) { - node.id = this.match(_tokenizerTypes.types.name) ? this.parseIdent() : isStatement ? this.unexpected() : null; -}; - -pp.parseClassSuper = function (node) { - node.superClass = this.eat(_tokenizerTypes.types._extends) ? this.parseExprSubscripts() : null; -}; - -// Parses module export declaration. - -pp.parseExport = function (node) { - this.next(); - // export * from '...' - if (this.match(_tokenizerTypes.types.star)) { - var specifier = this.startNode(); - this.next(); - if (this.options.features["es7.exportExtensions"] && this.eatContextual("as")) { - specifier.exported = this.parseIdent(); - node.specifiers = [this.finishNode(specifier, "ExportNamespaceSpecifier")]; - this.parseExportSpecifiersMaybe(node); - this.parseExportFrom(node, true); - } else { - this.parseExportFrom(node, true); - return this.finishNode(node, "ExportAllDeclaration"); - } - } else if (this.options.features["es7.exportExtensions"] && this.isExportDefaultSpecifier()) { - var specifier = this.startNode(); - specifier.exported = this.parseIdent(true); - node.specifiers = [this.finishNode(specifier, "ExportDefaultSpecifier")]; - if (this.match(_tokenizerTypes.types.comma) && this.lookahead().type === _tokenizerTypes.types.star) { - this.expect(_tokenizerTypes.types.comma); - var _specifier = this.startNode(); - this.expect(_tokenizerTypes.types.star); - this.expectContextual("as"); - _specifier.exported = this.parseIdent(); - node.specifiers.push(this.finishNode(_specifier, "ExportNamespaceSpecifier")); - } else { - this.parseExportSpecifiersMaybe(node); - } - this.parseExportFrom(node, true); - } else if (this.eat(_tokenizerTypes.types._default)) { - // export default ... - var possibleDeclaration = this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._class); - var expr = this.parseMaybeAssign(); - var needsSemi = true; - if (possibleDeclaration) { - needsSemi = false; - if (expr.id) { - expr.type = expr.type === "FunctionExpression" ? "FunctionDeclaration" : "ClassDeclaration"; - } - } - node.declaration = expr; - if (needsSemi) this.semicolon(); - this.checkExport(node); - return this.finishNode(node, "ExportDefaultDeclaration"); - } else if (this.state.type.keyword || this.shouldParseExportDeclaration()) { - node.specifiers = []; - node.source = null; - node.declaration = this.parseExportDeclaration(node); - } else { - // export { x, y as z } [from '...'] - node.declaration = null; - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - } - this.checkExport(node); - return this.finishNode(node, "ExportNamedDeclaration"); -}; - -pp.parseExportDeclaration = function () { - return this.parseStatement(true); -}; - -pp.isExportDefaultSpecifier = function () { - if (this.match(_tokenizerTypes.types.name)) { - return this.state.value !== "type" && this.state.value !== "async" && this.state.value !== "interface"; - } - - if (!this.match(_tokenizerTypes.types._default)) { - return false; - } - - var lookahead = this.lookahead(); - return lookahead.type === _tokenizerTypes.types.comma || lookahead.type === _tokenizerTypes.types.name && lookahead.value === "from"; -}; - -pp.parseExportSpecifiersMaybe = function (node) { - if (this.eat(_tokenizerTypes.types.comma)) { - node.specifiers = node.specifiers.concat(this.parseExportSpecifiers()); - } -}; - -pp.parseExportFrom = function (node, expect) { - if (this.eatContextual("from")) { - node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected(); - this.checkExport(node); - } else { - if (expect) { - this.unexpected(); - } else { - node.source = null; - } - } - - this.semicolon(); -}; - -pp.shouldParseExportDeclaration = function () { - return this.options.features["es7.asyncFunctions"] && this.isContextual("async"); -}; - -pp.checkExport = function (node) { - if (this.state.decorators.length) { - var isClass = node.declaration && (node.declaration.type === "ClassDeclaration" || node.declaration.type === "ClassExpression"); - if (!node.declaration || !isClass) { - this.raise(node.start, "You can only use decorators on an export when exporting a class"); - } - this.takeDecorators(node.declaration); - } -}; - -// Parses a comma-separated list of module exports. - -pp.parseExportSpecifiers = function () { - var nodes = [], - first = true; - // export { x, y as z } [from '...'] - this.expect(_tokenizerTypes.types.braceL); - - while (!this.eat(_tokenizerTypes.types.braceR)) { - if (first) { - first = false; - } else { - this.expect(_tokenizerTypes.types.comma); - if (this.eat(_tokenizerTypes.types.braceR)) break; - } - - var node = this.startNode(); - node.local = this.parseIdent(this.match(_tokenizerTypes.types._default)); - node.exported = this.eatContextual("as") ? this.parseIdent(true) : node.local.__clone(); - nodes.push(this.finishNode(node, "ExportSpecifier")); - } - - return nodes; -}; - -// Parses import declaration. - -pp.parseImport = function (node) { - this.next(); - - // import '...' - if (this.match(_tokenizerTypes.types.string)) { - node.specifiers = []; - node.source = this.parseExprAtom(); - } else { - node.specifiers = []; - this.parseImportSpecifiers(node); - this.expectContextual("from"); - node.source = this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.unexpected(); - } - this.semicolon(); - return this.finishNode(node, "ImportDeclaration"); -}; - -// Parses a comma-separated list of module imports. - -pp.parseImportSpecifiers = function (node) { - var first = true; - if (this.match(_tokenizerTypes.types.name)) { - // import defaultObj, { x, y as z } from '...' - var startPos = this.state.start, - startLoc = this.state.startLoc; - node.specifiers.push(this.parseImportSpecifierDefault(this.parseIdent(), startPos, startLoc)); - if (!this.eat(_tokenizerTypes.types.comma)) return; - } - - if (this.match(_tokenizerTypes.types.star)) { - var specifier = this.startNode(); - this.next(); - this.expectContextual("as"); - specifier.local = this.parseIdent(); - this.checkLVal(specifier.local, true); - node.specifiers.push(this.finishNode(specifier, "ImportNamespaceSpecifier")); - return; - } - - this.expect(_tokenizerTypes.types.braceL); - while (!this.eat(_tokenizerTypes.types.braceR)) { - if (first) { - first = false; - } else { - this.expect(_tokenizerTypes.types.comma); - if (this.eat(_tokenizerTypes.types.braceR)) break; - } - - var specifier = this.startNode(); - specifier.imported = this.parseIdent(true); - specifier.local = this.eatContextual("as") ? this.parseIdent() : specifier.imported.__clone(); - this.checkLVal(specifier.local, true); - node.specifiers.push(this.finishNode(specifier, "ImportSpecifier")); - } -}; - -pp.parseImportSpecifierDefault = function (id, startPos, startLoc) { - var node = this.startNodeAt(startPos, startLoc); - node.local = id; - this.checkLVal(node.local, true); - return this.finishNode(node, "ImportDefaultSpecifier"); -}; -},{"617":617,"629":629,"632":632}],622:[function(_dereq_,module,exports){ -"use strict"; - -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _tokenizerTypes = _dereq_(629); - -var _index = _dereq_(617); - -var _index2 = _interopRequireDefault(_index); - -var _utilWhitespace = _dereq_(632); - -var pp = _index2["default"].prototype; - -// ## Parser utilities - -// Test whether a statement node is the string literal `"use strict"`. - -pp.isUseStrict = function (stmt) { - return stmt.type === "ExpressionStatement" && stmt.expression.type === "Literal" && stmt.expression.raw.slice(1, -1) === "use strict"; -}; - -// TODO - -pp.isRelational = function (op) { - return this.match(_tokenizerTypes.types.relational) && this.state.value === op; -}; - -// TODO - -pp.expectRelational = function (op) { - if (this.isRelational(op)) { - this.next(); - } else { - this.unexpected(); - } -}; - -// Tests whether parsed token is a contextual keyword. - -pp.isContextual = function (name) { - return this.match(_tokenizerTypes.types.name) && this.state.value === name; -}; - -// Consumes contextual keyword if possible. - -pp.eatContextual = function (name) { - return this.state.value === name && this.eat(_tokenizerTypes.types.name); -}; - -// Asserts that following token is given contextual keyword. - -pp.expectContextual = function (name) { - if (!this.eatContextual(name)) this.unexpected(); -}; - -// Test whether a semicolon can be inserted at the current position. - -pp.canInsertSemicolon = function () { - return this.match(_tokenizerTypes.types.eof) || this.match(_tokenizerTypes.types.braceR) || _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.start)); -}; - -// Consume a semicolon, or, failing that, see if we are allowed to -// pretend that there is a semicolon at this position. - -pp.semicolon = function () { - if (!this.eat(_tokenizerTypes.types.semi) && !this.canInsertSemicolon()) this.unexpected(); -}; - -// Expect a token of a given type. If found, consume it, otherwise, -// raise an unexpected token error. - -pp.expect = function (type) { - return this.eat(type) || this.unexpected(); -}; - -// Raise an unexpected token error. - -pp.unexpected = function (pos) { - this.raise(pos != null ? pos : this.state.start, "Unexpected token"); -}; -},{"617":617,"629":629,"632":632}],623:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _tokenizerTypes = _dereq_(629); - -var _parser = _dereq_(617); - -var _parser2 = _interopRequireDefault(_parser); - -var pp = _parser2["default"].prototype; - -pp.flowParseTypeInitialiser = function (tok) { - var oldInType = this.state.inType; - this.state.inType = true; - this.expect(tok || _tokenizerTypes.types.colon); - var type = this.flowParseType(); - this.state.inType = oldInType; - return type; -}; - -pp.flowParseDeclareClass = function (node) { - this.next(); - this.flowParseInterfaceish(node, true); - return this.finishNode(node, "DeclareClass"); -}; - -pp.flowParseDeclareFunction = function (node) { - this.next(); - - var id = node.id = this.parseIdent(); - - var typeNode = this.startNode(); - var typeContainer = this.startNode(); - - if (this.isRelational("<")) { - typeNode.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - typeNode.typeParameters = null; - } - - this.expect(_tokenizerTypes.types.parenL); - var tmp = this.flowParseFunctionTypeParams(); - typeNode.params = tmp.params; - typeNode.rest = tmp.rest; - this.expect(_tokenizerTypes.types.parenR); - typeNode.returnType = this.flowParseTypeInitialiser(); - - typeContainer.typeAnnotation = this.finishNode(typeNode, "FunctionTypeAnnotation"); - id.typeAnnotation = this.finishNode(typeContainer, "TypeAnnotation"); - - this.finishNode(id, id.type); - - this.semicolon(); - - return this.finishNode(node, "DeclareFunction"); -}; - -pp.flowParseDeclare = function (node) { - if (this.match(_tokenizerTypes.types._class)) { - return this.flowParseDeclareClass(node); - } else if (this.match(_tokenizerTypes.types._function)) { - return this.flowParseDeclareFunction(node); - } else if (this.match(_tokenizerTypes.types._var)) { - return this.flowParseDeclareVariable(node); - } else if (this.isContextual("module")) { - return this.flowParseDeclareModule(node); - } else if (this.isContextual("type")) { - return this.flowParseDeclareTypeAlias(node); - } else if (this.isContextual("interface")) { - return this.flowParseDeclareInterface(node); - } else { - this.unexpected(); - } -}; - -pp.flowParseDeclareVariable = function (node) { - this.next(); - node.id = this.flowParseTypeAnnotatableIdentifier(); - this.semicolon(); - return this.finishNode(node, "DeclareVariable"); -}; - -pp.flowParseDeclareModule = function (node) { - this.next(); - - if (this.match(_tokenizerTypes.types.string)) { - node.id = this.parseExprAtom(); - } else { - node.id = this.parseIdent(); - } - - var bodyNode = node.body = this.startNode(); - var body = bodyNode.body = []; - this.expect(_tokenizerTypes.types.braceL); - while (!this.match(_tokenizerTypes.types.braceR)) { - var node2 = this.startNode(); - - // todo: declare check - this.next(); - - body.push(this.flowParseDeclare(node2)); - } - this.expect(_tokenizerTypes.types.braceR); - - this.finishNode(bodyNode, "BlockStatement"); - return this.finishNode(node, "DeclareModule"); -}; - -pp.flowParseDeclareTypeAlias = function (node) { - this.next(); - this.flowParseTypeAlias(node); - return this.finishNode(node, "DeclareTypeAlias"); -}; - -pp.flowParseDeclareInterface = function (node) { - this.next(); - this.flowParseInterfaceish(node); - return this.finishNode(node, "DeclareInterface"); -}; - -// Interfaces - -pp.flowParseInterfaceish = function (node, allowStatic) { - node.id = this.parseIdent(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node["extends"] = []; - node.mixins = []; - - if (this.eat(_tokenizerTypes.types._extends)) { - do { - node["extends"].push(this.flowParseInterfaceExtends()); - } while (this.eat(_tokenizerTypes.types.comma)); - } - - if (this.isContextual("mixins")) { - this.next(); - do { - node.mixins.push(this.flowParseInterfaceExtends()); - } while (this.eat(_tokenizerTypes.types.comma)); - } - - node.body = this.flowParseObjectType(allowStatic); -}; - -pp.flowParseInterfaceExtends = function () { - var node = this.startNode(); - - node.id = this.parseIdent(); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - node.typeParameters = null; - } - - return this.finishNode(node, "InterfaceExtends"); -}; - -pp.flowParseInterface = function (node) { - this.flowParseInterfaceish(node, false); - return this.finishNode(node, "InterfaceDeclaration"); -}; - -// Type aliases - -pp.flowParseTypeAlias = function (node) { - node.id = this.parseIdent(); - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } else { - node.typeParameters = null; - } - - node.right = this.flowParseTypeInitialiser(_tokenizerTypes.types.eq); - this.semicolon(); - - return this.finishNode(node, "TypeAlias"); -}; - -// Type annotations - -pp.flowParseTypeParameterDeclaration = function () { - var node = this.startNode(); - node.params = []; - - this.expectRelational("<"); - while (!this.isRelational(">")) { - node.params.push(this.flowParseTypeAnnotatableIdentifier()); - if (!this.isRelational(">")) { - this.expect(_tokenizerTypes.types.comma); - } - } - this.expectRelational(">"); - - return this.finishNode(node, "TypeParameterDeclaration"); -}; - -pp.flowParseTypeParameterInstantiation = function () { - var node = this.startNode(), - oldInType = this.state.inType; - node.params = []; - - this.state.inType = true; - - this.expectRelational("<"); - while (!this.isRelational(">")) { - node.params.push(this.flowParseType()); - if (!this.isRelational(">")) { - this.expect(_tokenizerTypes.types.comma); - } - } - this.expectRelational(">"); - - this.state.inType = oldInType; - - return this.finishNode(node, "TypeParameterInstantiation"); -}; - -pp.flowParseObjectPropertyKey = function () { - return this.match(_tokenizerTypes.types.num) || this.match(_tokenizerTypes.types.string) ? this.parseExprAtom() : this.parseIdent(true); -}; - -pp.flowParseObjectTypeIndexer = function (node, isStatic) { - node["static"] = isStatic; - - this.expect(_tokenizerTypes.types.bracketL); - node.id = this.flowParseObjectPropertyKey(); - node.key = this.flowParseTypeInitialiser(); - this.expect(_tokenizerTypes.types.bracketR); - node.value = this.flowParseTypeInitialiser(); - - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeIndexer"); -}; - -pp.flowParseObjectTypeMethodish = function (node) { - node.params = []; - node.rest = null; - node.typeParameters = null; - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - - this.expect(_tokenizerTypes.types.parenL); - while (this.match(_tokenizerTypes.types.name)) { - node.params.push(this.flowParseFunctionTypeParam()); - if (!this.match(_tokenizerTypes.types.parenR)) { - this.expect(_tokenizerTypes.types.comma); - } - } - - if (this.eat(_tokenizerTypes.types.ellipsis)) { - node.rest = this.flowParseFunctionTypeParam(); - } - this.expect(_tokenizerTypes.types.parenR); - node.returnType = this.flowParseTypeInitialiser(); - - return this.finishNode(node, "FunctionTypeAnnotation"); -}; - -pp.flowParseObjectTypeMethod = function (startPos, startLoc, isStatic, key) { - var node = this.startNodeAt(startPos, startLoc); - node.value = this.flowParseObjectTypeMethodish(this.startNodeAt(startPos, startLoc)); - node["static"] = isStatic; - node.key = key; - node.optional = false; - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeProperty"); -}; - -pp.flowParseObjectTypeCallProperty = function (node, isStatic) { - var valueNode = this.startNode(); - node["static"] = isStatic; - node.value = this.flowParseObjectTypeMethodish(valueNode); - this.flowObjectTypeSemicolon(); - return this.finishNode(node, "ObjectTypeCallProperty"); -}; - -pp.flowParseObjectType = function (allowStatic) { - var nodeStart = this.startNode(); - var node; - var propertyKey; - var isStatic; - - nodeStart.callProperties = []; - nodeStart.properties = []; - nodeStart.indexers = []; - - this.expect(_tokenizerTypes.types.braceL); - - while (!this.match(_tokenizerTypes.types.braceR)) { - var optional = false; - var startPos = this.state.start, - startLoc = this.state.startLoc; - node = this.startNode(); - if (allowStatic && this.isContextual("static")) { - this.next(); - isStatic = true; - } - - if (this.match(_tokenizerTypes.types.bracketL)) { - nodeStart.indexers.push(this.flowParseObjectTypeIndexer(node, isStatic)); - } else if (this.match(_tokenizerTypes.types.parenL) || this.isRelational("<")) { - nodeStart.callProperties.push(this.flowParseObjectTypeCallProperty(node, allowStatic)); - } else { - if (isStatic && this.match(_tokenizerTypes.types.colon)) { - propertyKey = this.parseIdent(); - } else { - propertyKey = this.flowParseObjectPropertyKey(); - } - if (this.isRelational("<") || this.match(_tokenizerTypes.types.parenL)) { - // This is a method property - nodeStart.properties.push(this.flowParseObjectTypeMethod(startPos, startLoc, isStatic, propertyKey)); - } else { - if (this.eat(_tokenizerTypes.types.question)) { - optional = true; - } - node.key = propertyKey; - node.value = this.flowParseTypeInitialiser(); - node.optional = optional; - node["static"] = isStatic; - this.flowObjectTypeSemicolon(); - nodeStart.properties.push(this.finishNode(node, "ObjectTypeProperty")); - } - } - } - - this.expect(_tokenizerTypes.types.braceR); - - return this.finishNode(nodeStart, "ObjectTypeAnnotation"); -}; - -pp.flowObjectTypeSemicolon = function () { - if (!this.eat(_tokenizerTypes.types.semi) && !this.eat(_tokenizerTypes.types.comma) && !this.match(_tokenizerTypes.types.braceR)) { - this.unexpected(); - } -}; - -pp.flowParseGenericType = function (startPos, startLoc, id) { - var node = this.startNodeAt(startPos, startLoc); - - node.typeParameters = null; - node.id = id; - - while (this.eat(_tokenizerTypes.types.dot)) { - var node2 = this.startNodeAt(startPos, startLoc); - node2.qualification = node.id; - node2.id = this.parseIdent(); - node.id = this.finishNode(node2, "QualifiedTypeIdentifier"); - } - - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterInstantiation(); - } - - return this.finishNode(node, "GenericTypeAnnotation"); -}; - -pp.flowParseTypeofType = function () { - var node = this.startNode(); - this.expect(_tokenizerTypes.types._typeof); - node.argument = this.flowParsePrimaryType(); - return this.finishNode(node, "TypeofTypeAnnotation"); -}; - -pp.flowParseTupleType = function () { - var node = this.startNode(); - node.types = []; - this.expect(_tokenizerTypes.types.bracketL); - // We allow trailing commas - while (this.state.pos < this.input.length && !this.match(_tokenizerTypes.types.bracketR)) { - node.types.push(this.flowParseType()); - if (this.match(_tokenizerTypes.types.bracketR)) break; - this.expect(_tokenizerTypes.types.comma); - } - this.expect(_tokenizerTypes.types.bracketR); - return this.finishNode(node, "TupleTypeAnnotation"); -}; - -pp.flowParseFunctionTypeParam = function () { - var optional = false; - var node = this.startNode(); - node.name = this.parseIdent(); - if (this.eat(_tokenizerTypes.types.question)) { - optional = true; - } - node.optional = optional; - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "FunctionTypeParam"); -}; - -pp.flowParseFunctionTypeParams = function () { - var ret = { params: [], rest: null }; - while (this.match(_tokenizerTypes.types.name)) { - ret.params.push(this.flowParseFunctionTypeParam()); - if (!this.match(_tokenizerTypes.types.parenR)) { - this.expect(_tokenizerTypes.types.comma); - } - } - if (this.eat(_tokenizerTypes.types.ellipsis)) { - ret.rest = this.flowParseFunctionTypeParam(); - } - return ret; -}; - -pp.flowIdentToTypeAnnotation = function (startPos, startLoc, node, id) { - switch (id.name) { - case "any": - return this.finishNode(node, "AnyTypeAnnotation"); - - case "void": - return this.finishNode(node, "VoidTypeAnnotation"); - - case "bool": - case "boolean": - return this.finishNode(node, "BooleanTypeAnnotation"); - - case "mixed": - return this.finishNode(node, "MixedTypeAnnotation"); - - case "number": - return this.finishNode(node, "NumberTypeAnnotation"); - - case "string": - return this.finishNode(node, "StringTypeAnnotation"); - - default: - return this.flowParseGenericType(startPos, startLoc, id); - } -}; - -// The parsing of types roughly parallels the parsing of expressions, and -// primary types are kind of like primary expressions...they're the -// primitives with which other types are constructed. -pp.flowParsePrimaryType = function () { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var node = this.startNode(); - var tmp; - var type; - var isGroupedType = false; - - switch (this.state.type) { - case _tokenizerTypes.types.name: - return this.flowIdentToTypeAnnotation(startPos, startLoc, node, this.parseIdent()); - - case _tokenizerTypes.types.braceL: - return this.flowParseObjectType(); - - case _tokenizerTypes.types.bracketL: - return this.flowParseTupleType(); - - case _tokenizerTypes.types.relational: - if (this.state.value === "<") { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - this.expect(_tokenizerTypes.types.parenL); - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - this.expect(_tokenizerTypes.types.parenR); - - this.expect(_tokenizerTypes.types.arrow); - - node.returnType = this.flowParseType(); - - return this.finishNode(node, "FunctionTypeAnnotation"); - } - - case _tokenizerTypes.types.parenL: - this.next(); - - // Check to see if this is actually a grouped type - if (!this.match(_tokenizerTypes.types.parenR) && !this.match(_tokenizerTypes.types.ellipsis)) { - if (this.match(_tokenizerTypes.types.name)) { - var token = this.lookahead().type; - isGroupedType = token !== _tokenizerTypes.types.question && token !== _tokenizerTypes.types.colon; - } else { - isGroupedType = true; - } - } - - if (isGroupedType) { - type = this.flowParseType(); - this.expect(_tokenizerTypes.types.parenR); - - // If we see a => next then someone was probably confused about - // function types, so we can provide a better error message - if (this.eat(_tokenizerTypes.types.arrow)) { - this.raise(node, "Unexpected token =>. It looks like " + "you are trying to write a function type, but you ended up " + "writing a grouped type followed by an =>, which is a syntax " + "error. Remember, function type parameters are named so function " + "types look like (name1: type1, name2: type2) => returnType. You " + "probably wrote (type1) => returnType"); - } - - return type; - } - - tmp = this.flowParseFunctionTypeParams(); - node.params = tmp.params; - node.rest = tmp.rest; - - this.expect(_tokenizerTypes.types.parenR); - - this.expect(_tokenizerTypes.types.arrow); - - node.returnType = this.flowParseType(); - node.typeParameters = null; - - return this.finishNode(node, "FunctionTypeAnnotation"); - - case _tokenizerTypes.types.string: - node.rawValue = node.value = this.state.value; - node.raw = this.input.slice(this.state.start, this.state.end); - this.next(); - return this.finishNode(node, "StringLiteralTypeAnnotation"); - - case _tokenizerTypes.types._true:case _tokenizerTypes.types._false: - node.value = this.match(_tokenizerTypes.types._true); - this.next(); - return this.finishNode(node, "BooleanLiteralTypeAnnotation"); - - case _tokenizerTypes.types.num: - node.rawValue = node.value = this.state.value; - node.raw = this.input.slice(this.state.start, this.state.end); - this.next(); - return this.finishNode(node, "NumberLiteralTypeAnnotation"); - - case _tokenizerTypes.types._null: - node.value = this.match(_tokenizerTypes.types._null); - this.next(); - return this.finishNode(node, "NullLiteralTypeAnnotation"); - - case _tokenizerTypes.types._this: - node.value = this.match(_tokenizerTypes.types._this); - this.next(); - return this.finishNode(node, "ThisTypeAnnotation"); - - default: - if (this.state.type.keyword === "typeof") { - return this.flowParseTypeofType(); - } - } - - this.unexpected(); -}; - -pp.flowParsePostfixType = function () { - var node = this.startNode(); - var type = node.elementType = this.flowParsePrimaryType(); - if (this.match(_tokenizerTypes.types.bracketL)) { - this.expect(_tokenizerTypes.types.bracketL); - this.expect(_tokenizerTypes.types.bracketR); - return this.finishNode(node, "ArrayTypeAnnotation"); - } else { - return type; - } -}; - -pp.flowParsePrefixType = function () { - var node = this.startNode(); - if (this.eat(_tokenizerTypes.types.question)) { - node.typeAnnotation = this.flowParsePrefixType(); - return this.finishNode(node, "NullableTypeAnnotation"); - } else { - return this.flowParsePostfixType(); - } -}; - -pp.flowParseIntersectionType = function () { - var node = this.startNode(); - var type = this.flowParsePrefixType(); - node.types = [type]; - while (this.eat(_tokenizerTypes.types.bitwiseAND)) { - node.types.push(this.flowParsePrefixType()); - } - return node.types.length === 1 ? type : this.finishNode(node, "IntersectionTypeAnnotation"); -}; - -pp.flowParseUnionType = function () { - var node = this.startNode(); - var type = this.flowParseIntersectionType(); - node.types = [type]; - while (this.eat(_tokenizerTypes.types.bitwiseOR)) { - node.types.push(this.flowParseIntersectionType()); - } - return node.types.length === 1 ? type : this.finishNode(node, "UnionTypeAnnotation"); -}; - -pp.flowParseType = function () { - var oldInType = this.state.inType; - this.state.inType = true; - var type = this.flowParseUnionType(); - this.state.inType = oldInType; - return type; -}; - -pp.flowParseTypeAnnotation = function () { - var node = this.startNode(); - node.typeAnnotation = this.flowParseTypeInitialiser(); - return this.finishNode(node, "TypeAnnotation"); -}; - -pp.flowParseTypeAnnotatableIdentifier = function (requireTypeAnnotation, canBeOptionalParam) { - var ident = this.parseIdent(); - var isOptionalParam = false; - - if (canBeOptionalParam && this.eat(_tokenizerTypes.types.question)) { - this.expect(_tokenizerTypes.types.question); - isOptionalParam = true; - } - - if (requireTypeAnnotation || this.match(_tokenizerTypes.types.colon)) { - ident.typeAnnotation = this.flowParseTypeAnnotation(); - this.finishNode(ident, ident.type); - } - - if (isOptionalParam) { - ident.optional = true; - this.finishNode(ident, ident.type); - } - - return ident; -}; - -exports["default"] = function (instance) { - // function name(): string {} - instance.extend("parseFunctionBody", function (inner) { - return function (node, allowExpression) { - if (this.match(_tokenizerTypes.types.colon) && !allowExpression) { - // if allowExpression is true then we're parsing an arrow function and if - // there's a return type then it's been handled elsewhere - node.returnType = this.flowParseTypeAnnotation(); - } - - return inner.call(this, node, allowExpression); - }; - }); - - instance.extend("parseStatement", function (inner) { - return function (declaration, topLevel) { - // strict mode handling of `interface` since it's a reserved word - if (this.strict && this.match(_tokenizerTypes.types.name) && this.state.value === "interface") { - var node = this.startNode(); - this.next(); - return this.flowParseInterface(node); - } else { - return inner.call(this, declaration, topLevel); - } - }; - }); - - instance.extend("parseExpressionStatement", function (inner) { - return function (node, expr) { - if (expr.type === "Identifier") { - if (expr.name === "declare") { - if (this.match(_tokenizerTypes.types._class) || this.match(_tokenizerTypes.types.name) || this.match(_tokenizerTypes.types._function) || this.match(_tokenizerTypes.types._var)) { - return this.flowParseDeclare(node); - } - } else if (this.match(_tokenizerTypes.types.name)) { - if (expr.name === "interface") { - return this.flowParseInterface(node); - } else if (expr.name === "type") { - return this.flowParseTypeAlias(node); - } - } - } - - return inner.call(this, node, expr); - }; - }); - - instance.extend("shouldParseExportDeclaration", function (inner) { - return function () { - return this.isContextual("type") || this.isContextual("interface") || inner.call(this); - }; - }); - - instance.extend("parseParenItem", function () { - return function (node, startLoc, startPos, forceArrow) { - if (this.match(_tokenizerTypes.types.colon)) { - var typeCastNode = this.startNodeAt(startLoc, startPos); - typeCastNode.expression = node; - typeCastNode.typeAnnotation = this.flowParseTypeAnnotation(); - - if (forceArrow && !this.match(_tokenizerTypes.types.arrow)) { - this.unexpected(); - } - - if (this.eat(_tokenizerTypes.types.arrow)) { - // ((lol): number => {}); - var func = this.parseArrowExpression(this.startNodeAt(startLoc, startPos), [node]); - func.returnType = typeCastNode.typeAnnotation; - return func; - } else { - return this.finishNode(typeCastNode, "TypeCastExpression"); - } - } else { - return node; - } - }; - }); - - instance.extend("parseExport", function (inner) { - return function (node) { - node = inner.call(this, node); - if (node.type === "ExportNamedDeclaration") { - node.exportKind = node.exportKind || "value"; - } - return node; - }; - }); - - instance.extend("parseExportDeclaration", function (inner) { - return function (node) { - if (this.isContextual("type")) { - node.exportKind = "type"; - - var declarationNode = this.startNode(); - this.next(); - - if (this.match(_tokenizerTypes.types.braceL)) { - // export type { foo, bar }; - node.specifiers = this.parseExportSpecifiers(); - this.parseExportFrom(node); - return null; - } else { - // export type Foo = Bar; - return this.flowParseTypeAlias(declarationNode); - } - } else if (this.isContextual("interface")) { - node.exportKind = "type"; - var _declarationNode = this.startNode(); - this.next(); - return this.flowParseInterface(_declarationNode); - } else { - return inner.call(this, node); - } - }; - }); - - instance.extend("parseClassId", function (inner) { - return function (node, isStatement) { - inner.call(this, node, isStatement); - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - }; - }); - - // don't consider `void` to be a keyword as then it'll use the void token type - // and set startExpr - instance.extend("isKeyword", function (inner) { - return function (name) { - if (this.state.inType && name === "void") { - return false; - } else { - return inner.call(this, name); - } - }; - }); - - instance.extend("readToken", function (inner) { - return function (code) { - if (this.state.inType && (code === 62 || code === 60)) { - return this.finishOp(_tokenizerTypes.types.relational, 1); - } else { - return inner.call(this, code); - } - }; - }); - - instance.extend("jsx_readToken", function (inner) { - return function () { - if (!this.state.inType) return inner.call(this); - }; - }); - - function typeCastToParameter(node) { - node.expression.typeAnnotation = node.typeAnnotation; - return node.expression; - } - - instance.extend("toAssignableList", function (inner) { - return function (exprList, isBinding) { - for (var i = 0; i < exprList.length; i++) { - var expr = exprList[i]; - if (expr && expr.type === "TypeCastExpression") { - exprList[i] = typeCastToParameter(expr); - } - } - return inner.call(this, exprList, isBinding); - }; - }); - - instance.extend("toReferencedList", function () { - return function (exprList) { - for (var i = 0; i < exprList.length; i++) { - var expr = exprList[i]; - if (expr && expr._exprListItem && expr.type === "TypeCastExpression") { - this.raise(expr.start, "Unexpected type cast"); - } - } - - return exprList; - }; - }); - - instance.extend("parseExprListItem", function (inner) { - return function (allowEmpty, refShorthandDefaultPos) { - var container = this.startNode(); - var node = inner.call(this, allowEmpty, refShorthandDefaultPos); - if (this.match(_tokenizerTypes.types.colon)) { - container._exprListItem = true; - container.expression = node; - container.typeAnnotation = this.flowParseTypeAnnotation(); - return this.finishNode(container, "TypeCastExpression"); - } else { - return node; - } - }; - }); - - instance.extend("parseClassProperty", function (inner) { - return function (node) { - if (this.match(_tokenizerTypes.types.colon)) { - node.typeAnnotation = this.flowParseTypeAnnotation(); - } - return inner.call(this, node); - }; - }); - - instance.extend("isClassProperty", function (inner) { - return function () { - return this.match(_tokenizerTypes.types.colon) || inner.call(this); - }; - }); - - instance.extend("parseClassMethod", function () { - return function (classBody, method, isGenerator, isAsync) { - var typeParameters; - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - } - method.value = this.parseMethod(isGenerator, isAsync); - method.value.typeParameters = typeParameters; - classBody.body.push(this.finishNode(method, "MethodDefinition")); - }; - }); - - instance.extend("parseClassSuper", function (inner) { - return function (node, isStatement) { - inner.call(this, node, isStatement); - if (node.superClass && this.isRelational("<")) { - node.superTypeParameters = this.flowParseTypeParameterInstantiation(); - } - if (this.isContextual("implements")) { - this.next(); - var implemented = node["implements"] = []; - do { - var _node = this.startNode(); - _node.id = this.parseIdent(); - if (this.isRelational("<")) { - _node.typeParameters = this.flowParseTypeParameterInstantiation(); - } else { - _node.typeParameters = null; - } - implemented.push(this.finishNode(_node, "ClassImplements")); - } while (this.eat(_tokenizerTypes.types.comma)); - } - }; - }); - - instance.extend("parseObjPropValue", function (inner) { - return function (prop) { - var typeParameters; - - // method shorthand - if (this.isRelational("<")) { - typeParameters = this.flowParseTypeParameterDeclaration(); - if (!this.match(_tokenizerTypes.types.parenL)) this.unexpected(); - } - - inner.apply(this, arguments); - - // add typeParameters if we found them - if (typeParameters) { - prop.value.typeParameters = typeParameters; - } - }; - }); - - instance.extend("parseAssignableListItemTypes", function () { - return function (param) { - if (this.eat(_tokenizerTypes.types.question)) { - param.optional = true; - } - if (this.match(_tokenizerTypes.types.colon)) { - param.typeAnnotation = this.flowParseTypeAnnotation(); - } - this.finishNode(param, param.type); - return param; - }; - }); - - instance.extend("parseImportSpecifiers", function (inner) { - return function (node) { - node.importKind = "value"; - - var kind = this.match(_tokenizerTypes.types._typeof) ? "typeof" : this.isContextual("type") ? "type" : null; - if (kind) { - var lh = this.lookahead(); - if (lh.type === _tokenizerTypes.types.name && lh.value !== "from" || lh.type === _tokenizerTypes.types.braceL || lh.type === _tokenizerTypes.types.star) { - this.next(); - node.importKind = kind; - } - } - - inner.call(this, node); - }; - }); - - // function foo() {} - instance.extend("parseFunctionParams", function (inner) { - return function (node) { - if (this.isRelational("<")) { - node.typeParameters = this.flowParseTypeParameterDeclaration(); - } - inner.call(this, node); - }; - }); - - // var foo: string = bar - instance.extend("parseVarHead", function (inner) { - return function (decl) { - inner.call(this, decl); - if (this.match(_tokenizerTypes.types.colon)) { - decl.id.typeAnnotation = this.flowParseTypeAnnotation(); - this.finishNode(decl.id, decl.id.type); - } - }; - }); - - // var foo = (async (): number => {}); - instance.extend("parseAsyncArrowFromCallExpression", function (inner) { - return function (node, call) { - if (this.match(_tokenizerTypes.types.colon)) { - node.returnType = this.flowParseTypeAnnotation(); - } - - return inner.call(this, node, call); - }; - }); - - instance.extend("parseParenAndDistinguishExpression", function (inner) { - return function (startPos, startLoc, canBeArrow, isAsync) { - startPos = startPos || this.state.start; - startLoc = startLoc || this.state.startLoc; - - if (this.lookahead().type === _tokenizerTypes.types.parenR) { - // var foo = (): number => {}; - this.expect(_tokenizerTypes.types.parenL); - this.expect(_tokenizerTypes.types.parenR); - - var node = this.startNodeAt(startPos, startLoc); - if (this.match(_tokenizerTypes.types.colon)) node.returnType = this.flowParseTypeAnnotation(); - this.expect(_tokenizerTypes.types.arrow); - return this.parseArrowExpression(node, [], isAsync); - } else { - // var foo = (foo): number => {}; - var node = inner.call(this, startPos, startLoc, canBeArrow, isAsync); - - if (this.match(_tokenizerTypes.types.colon)) { - var state = this.state.clone(); - try { - return this.parseParenItem(node, startPos, startLoc, true); - } catch (err) { - if (err instanceof SyntaxError) { - this.state = state; - return node; - } else { - throw err; - } - } - } else { - return node; - } - } - }; - }); -}; - -module.exports = exports["default"]; -},{"617":617,"629":629}],624:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -var _xhtml = _dereq_(625); - -var _xhtml2 = _interopRequireDefault(_xhtml); - -var _tokenizerTypes = _dereq_(629); - -var _tokenizerContext = _dereq_(626); - -var _parser = _dereq_(617); - -var _parser2 = _interopRequireDefault(_parser); - -var _utilIdentifier = _dereq_(630); - -var _utilWhitespace = _dereq_(632); - -var HEX_NUMBER = /^[\da-fA-F]+$/; -var DECIMAL_NUMBER = /^\d+$/; - -_tokenizerContext.types.j_oTag = new _tokenizerContext.TokContext("...", true, true); - -_tokenizerTypes.types.jsxName = new _tokenizerTypes.TokenType("jsxName"); -_tokenizerTypes.types.jsxText = new _tokenizerTypes.TokenType("jsxText", { beforeExpr: true }); -_tokenizerTypes.types.jsxTagStart = new _tokenizerTypes.TokenType("jsxTagStart"); -_tokenizerTypes.types.jsxTagEnd = new _tokenizerTypes.TokenType("jsxTagEnd"); - -_tokenizerTypes.types.jsxTagStart.updateContext = function () { - this.state.context.push(_tokenizerContext.types.j_expr); // treat as beginning of JSX expression - this.state.context.push(_tokenizerContext.types.j_oTag); // start opening tag context - this.state.exprAllowed = false; -}; - -_tokenizerTypes.types.jsxTagEnd.updateContext = function (prevType) { - var out = this.state.context.pop(); - if (out === _tokenizerContext.types.j_oTag && prevType === _tokenizerTypes.types.slash || out === _tokenizerContext.types.j_cTag) { - this.state.context.pop(); - this.state.exprAllowed = this.curContext() === _tokenizerContext.types.j_expr; - } else { - this.state.exprAllowed = true; - } -}; - -var pp = _parser2["default"].prototype; - -// Reads inline JSX contents token. - -pp.jsxReadToken = function () { - var out = "", - chunkStart = this.state.pos; - for (;;) { - if (this.state.pos >= this.input.length) { - this.raise(this.state.start, "Unterminated JSX contents"); - } - - var ch = this.input.charCodeAt(this.state.pos); - - switch (ch) { - case 60: // "<" - case 123: - // "{" - if (this.state.pos === this.state.start) { - if (ch === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(_tokenizerTypes.types.jsxTagStart); - } - return this.getTokenFromCode(ch); - } - out += this.input.slice(chunkStart, this.state.pos); - return this.finishToken(_tokenizerTypes.types.jsxText, out); - - case 38: - // "&" - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - break; - - default: - if (_utilWhitespace.isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(true); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - } -}; - -pp.jsxReadNewLine = function (normalizeCRLF) { - var ch = this.input.charCodeAt(this.state.pos); - var out; - ++this.state.pos; - if (ch === 13 && this.input.charCodeAt(this.state.pos) === 10) { - ++this.state.pos; - out = normalizeCRLF ? "\n" : "\r\n"; - } else { - out = String.fromCharCode(ch); - } - ++this.state.curLine; - this.state.lineStart = this.state.pos; - - return out; -}; - -pp.jsxReadString = function (quote) { - var out = "", - chunkStart = ++this.state.pos; - for (;;) { - if (this.state.pos >= this.input.length) { - this.raise(this.state.start, "Unterminated string constant"); - } - - var ch = this.input.charCodeAt(this.state.pos); - if (ch === quote) break; - if (ch === 38) { - // "&" - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadEntity(); - chunkStart = this.state.pos; - } else if (_utilWhitespace.isNewLine(ch)) { - out += this.input.slice(chunkStart, this.state.pos); - out += this.jsxReadNewLine(false); - chunkStart = this.state.pos; - } else { - ++this.state.pos; - } - } - out += this.input.slice(chunkStart, this.state.pos++); - return this.finishToken(_tokenizerTypes.types.string, out); -}; - -pp.jsxReadEntity = function () { - var str = "", - count = 0, - entity; - var ch = this.input[this.state.pos]; - - var startPos = ++this.state.pos; - while (this.state.pos < this.input.length && count++ < 10) { - ch = this.input[this.state.pos++]; - if (ch === ";") { - if (str[0] === "#") { - if (str[1] === "x") { - str = str.substr(2); - if (HEX_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 16)); - } else { - str = str.substr(1); - if (DECIMAL_NUMBER.test(str)) entity = String.fromCharCode(parseInt(str, 10)); - } - } else { - entity = _xhtml2["default"][str]; - } - break; - } - str += ch; - } - if (!entity) { - this.state.pos = startPos; - return "&"; - } - return entity; -}; - -// Read a JSX identifier (valid tag or attribute name). -// -// Optimized version since JSX identifiers can"t contain -// escape characters and so can be read as single slice. -// Also assumes that first character was already checked -// by isIdentifierStart in readToken. - -pp.jsxReadWord = function () { - var ch, - start = this.state.pos; - do { - ch = this.input.charCodeAt(++this.state.pos); - } while (_utilIdentifier.isIdentifierChar(ch) || ch === 45); // "-" - return this.finishToken(_tokenizerTypes.types.jsxName, this.input.slice(start, this.state.pos)); -}; - -// Transforms JSX element name to string. - -function getQualifiedJSXName(object) { - if (object.type === "JSXIdentifier") { - return object.name; - } - - if (object.type === "JSXNamespacedName") { - return object.namespace.name + ":" + object.name.name; - } - - if (object.type === "JSXMemberExpression") { - return getQualifiedJSXName(object.object) + "." + getQualifiedJSXName(object.property); - } -} - -// Parse next token as JSX identifier - -pp.jsxParseIdentifier = function () { - var node = this.startNode(); - if (this.match(_tokenizerTypes.types.jsxName)) { - node.name = this.state.value; - } else if (this.state.type.keyword) { - node.name = this.state.type.keyword; - } else { - this.unexpected(); - } - this.next(); - return this.finishNode(node, "JSXIdentifier"); -}; - -// Parse namespaced identifier. - -pp.jsxParseNamespacedName = function () { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var name = this.jsxParseIdentifier(); - if (!this.eat(_tokenizerTypes.types.colon)) return name; - - var node = this.startNodeAt(startPos, startLoc); - node.namespace = name; - node.name = this.jsxParseIdentifier(); - return this.finishNode(node, "JSXNamespacedName"); -}; - -// Parses element name in any form - namespaced, member -// or single identifier. - -pp.jsxParseElementName = function () { - var startPos = this.state.start, - startLoc = this.state.startLoc; - var node = this.jsxParseNamespacedName(); - while (this.eat(_tokenizerTypes.types.dot)) { - var newNode = this.startNodeAt(startPos, startLoc); - newNode.object = node; - newNode.property = this.jsxParseIdentifier(); - node = this.finishNode(newNode, "JSXMemberExpression"); - } - return node; -}; - -// Parses any type of JSX attribute value. - -pp.jsxParseAttributeValue = function () { - var node; - switch (this.state.type) { - case _tokenizerTypes.types.braceL: - node = this.jsxParseExpressionContainer(); - if (node.expression.type === "JSXEmptyExpression") { - this.raise(node.start, "JSX attributes must only be assigned a non-empty expression"); - } else { - return node; - } - - case _tokenizerTypes.types.jsxTagStart: - case _tokenizerTypes.types.string: - node = this.parseExprAtom(); - node.rawValue = null; - return node; - - default: - this.raise(this.state.start, "JSX value should be either an expression or a quoted JSX text"); - } -}; - -// JSXEmptyExpression is unique type since it doesn"t actually parse anything, -// and so it should start at the end of last read token (left brace) and finish -// at the beginning of the next one (right brace). - -pp.jsxParseEmptyExpression = function () { - var tmp = this.state.start; - this.state.start = this.state.lastTokEnd; - this.state.lastTokEnd = tmp; - - tmp = this.state.startLoc; - this.state.startLoc = this.state.lastTokEndLoc; - this.state.lastTokEndLoc = tmp; - - return this.finishNode(this.startNode(), "JSXEmptyExpression"); -}; - -// Parses JSX expression enclosed into curly brackets. - -pp.jsxParseExpressionContainer = function () { - var node = this.startNode(); - this.next(); - if (this.match(_tokenizerTypes.types.braceR)) { - node.expression = this.jsxParseEmptyExpression(); - } else { - node.expression = this.parseExpression(); - } - this.expect(_tokenizerTypes.types.braceR); - return this.finishNode(node, "JSXExpressionContainer"); -}; - -// Parses following JSX attribute name-value pair. - -pp.jsxParseAttribute = function () { - var node = this.startNode(); - if (this.eat(_tokenizerTypes.types.braceL)) { - this.expect(_tokenizerTypes.types.ellipsis); - node.argument = this.parseMaybeAssign(); - this.expect(_tokenizerTypes.types.braceR); - return this.finishNode(node, "JSXSpreadAttribute"); - } - node.name = this.jsxParseNamespacedName(); - node.value = this.eat(_tokenizerTypes.types.eq) ? this.jsxParseAttributeValue() : null; - return this.finishNode(node, "JSXAttribute"); -}; - -// Parses JSX opening tag starting after "<". - -pp.jsxParseOpeningElementAt = function (startPos, startLoc) { - var node = this.startNodeAt(startPos, startLoc); - node.attributes = []; - node.name = this.jsxParseElementName(); - while (!this.match(_tokenizerTypes.types.slash) && !this.match(_tokenizerTypes.types.jsxTagEnd)) { - node.attributes.push(this.jsxParseAttribute()); - } - node.selfClosing = this.eat(_tokenizerTypes.types.slash); - this.expect(_tokenizerTypes.types.jsxTagEnd); - return this.finishNode(node, "JSXOpeningElement"); -}; - -// Parses JSX closing tag starting after ""); - } - } - - node.openingElement = openingElement; - node.closingElement = closingElement; - node.children = children; - if (this.match(_tokenizerTypes.types.relational) && this.state.value === "<") { - this.raise(this.state.start, "Adjacent JSX elements must be wrapped in an enclosing tag"); - } - return this.finishNode(node, "JSXElement"); -}; - -// Parses entire JSX element from current position. - -pp.jsxParseElement = function () { - var startPos = this.state.start, - startLoc = this.state.startLoc; - this.next(); - return this.jsxParseElementAt(startPos, startLoc); -}; - -exports["default"] = function (instance) { - instance.extend("parseExprAtom", function (inner) { - return function (refShortHandDefaultPos) { - if (this.match(_tokenizerTypes.types.jsxText)) { - var node = this.parseLiteral(this.state.value); - // https://github.com/babel/babel/issues/2078 - node.rawValue = null; - return node; - } else if (this.match(_tokenizerTypes.types.jsxTagStart)) { - return this.jsxParseElement(); - } else { - return inner.call(this, refShortHandDefaultPos); - } - }; - }); - - instance.extend("readToken", function (inner) { - return function (code) { - var context = this.curContext(); - - if (context === _tokenizerContext.types.j_expr) { - return this.jsxReadToken(); - } - - if (context === _tokenizerContext.types.j_oTag || context === _tokenizerContext.types.j_cTag) { - if (_utilIdentifier.isIdentifierStart(code)) { - return this.jsxReadWord(); - } - - if (code === 62) { - ++this.state.pos; - return this.finishToken(_tokenizerTypes.types.jsxTagEnd); - } - - if ((code === 34 || code === 39) && context === _tokenizerContext.types.j_oTag) { - return this.jsxReadString(code); - } - } - - if (code === 60 && this.state.exprAllowed) { - ++this.state.pos; - return this.finishToken(_tokenizerTypes.types.jsxTagStart); - } - - return inner.call(this, code); - }; - }); - - instance.extend("updateContext", function (inner) { - return function (prevType) { - if (this.match(_tokenizerTypes.types.braceL)) { - var curContext = this.curContext(); - if (curContext === _tokenizerContext.types.j_oTag) { - this.state.context.push(_tokenizerContext.types.b_expr); - } else if (curContext === _tokenizerContext.types.j_expr) { - this.state.context.push(_tokenizerContext.types.b_tmpl); - } else { - inner.call(this, prevType); - } - this.state.exprAllowed = true; - } else if (this.match(_tokenizerTypes.types.slash) && prevType === _tokenizerTypes.types.jsxTagStart) { - this.state.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore - this.state.context.push(_tokenizerContext.types.j_cTag); // reconsider as closing tag context - this.state.exprAllowed = false; - } else { - return inner.call(this, prevType); - } - }; - }); -}; - -module.exports = exports["default"]; -},{"617":617,"625":625,"626":626,"629":629,"630":630,"632":632}],625:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -exports["default"] = { - quot: "\"", - amp: "&", - apos: "'", - lt: "<", - gt: ">", - nbsp: " ", - iexcl: "¡", - cent: "¢", - pound: "£", - curren: "¤", - yen: "¥", - brvbar: "¦", - sect: "§", - uml: "¨", - copy: "©", - ordf: "ª", - laquo: "«", - not: "¬", - shy: "­", - reg: "®", - macr: "¯", - deg: "°", - plusmn: "±", - sup2: "²", - sup3: "³", - acute: "´", - micro: "µ", - para: "¶", - middot: "·", - cedil: "¸", - sup1: "¹", - ordm: "º", - raquo: "»", - frac14: "¼", - frac12: "½", - frac34: "¾", - iquest: "¿", - Agrave: "À", - Aacute: "Á", - Acirc: "Â", - Atilde: "Ã", - Auml: "Ä", - Aring: "Å", - AElig: "Æ", - Ccedil: "Ç", - Egrave: "È", - Eacute: "É", - Ecirc: "Ê", - Euml: "Ë", - Igrave: "Ì", - Iacute: "Í", - Icirc: "Î", - Iuml: "Ï", - ETH: "Ð", - Ntilde: "Ñ", - Ograve: "Ò", - Oacute: "Ó", - Ocirc: "Ô", - Otilde: "Õ", - Ouml: "Ö", - times: "×", - Oslash: "Ø", - Ugrave: "Ù", - Uacute: "Ú", - Ucirc: "Û", - Uuml: "Ü", - Yacute: "Ý", - THORN: "Þ", - szlig: "ß", - agrave: "à", - aacute: "á", - acirc: "â", - atilde: "ã", - auml: "ä", - aring: "å", - aelig: "æ", - ccedil: "ç", - egrave: "è", - eacute: "é", - ecirc: "ê", - euml: "ë", - igrave: "ì", - iacute: "í", - icirc: "î", - iuml: "ï", - eth: "ð", - ntilde: "ñ", - ograve: "ò", - oacute: "ó", - ocirc: "ô", - otilde: "õ", - ouml: "ö", - divide: "÷", - oslash: "ø", - ugrave: "ù", - uacute: "ú", - ucirc: "û", - uuml: "ü", - yacute: "ý", - thorn: "þ", - yuml: "ÿ", - OElig: "Œ", - oelig: "œ", - Scaron: "Š", - scaron: "š", - Yuml: "Ÿ", - fnof: "ƒ", - circ: "ˆ", - tilde: "˜", - Alpha: "Α", - Beta: "Β", - Gamma: "Γ", - Delta: "Δ", - Epsilon: "Ε", - Zeta: "Ζ", - Eta: "Η", - Theta: "Θ", - Iota: "Ι", - Kappa: "Κ", - Lambda: "Λ", - Mu: "Μ", - Nu: "Ν", - Xi: "Ξ", - Omicron: "Ο", - Pi: "Π", - Rho: "Ρ", - Sigma: "Σ", - Tau: "Τ", - Upsilon: "Υ", - Phi: "Φ", - Chi: "Χ", - Psi: "Ψ", - Omega: "Ω", - alpha: "α", - beta: "β", - gamma: "γ", - delta: "δ", - epsilon: "ε", - zeta: "ζ", - eta: "η", - theta: "θ", - iota: "ι", - kappa: "κ", - lambda: "λ", - mu: "μ", - nu: "ν", - xi: "ξ", - omicron: "ο", - pi: "π", - rho: "ρ", - sigmaf: "ς", - sigma: "σ", - tau: "τ", - upsilon: "υ", - phi: "φ", - chi: "χ", - psi: "ψ", - omega: "ω", - thetasym: "ϑ", - upsih: "ϒ", - piv: "ϖ", - ensp: " ", - emsp: " ", - thinsp: " ", - zwnj: "‌", - zwj: "‍", - lrm: "‎", - rlm: "‏", - ndash: "–", - mdash: "—", - lsquo: "‘", - rsquo: "’", - sbquo: "‚", - ldquo: "“", - rdquo: "”", - bdquo: "„", - dagger: "†", - Dagger: "‡", - bull: "•", - hellip: "…", - permil: "‰", - prime: "′", - Prime: "″", - lsaquo: "‹", - rsaquo: "›", - oline: "‾", - frasl: "⁄", - euro: "€", - image: "ℑ", - weierp: "℘", - real: "ℜ", - trade: "™", - alefsym: "ℵ", - larr: "←", - uarr: "↑", - rarr: "→", - darr: "↓", - harr: "↔", - crarr: "↵", - lArr: "⇐", - uArr: "⇑", - rArr: "⇒", - dArr: "⇓", - hArr: "⇔", - forall: "∀", - part: "∂", - exist: "∃", - empty: "∅", - nabla: "∇", - isin: "∈", - notin: "∉", - ni: "∋", - prod: "∏", - sum: "∑", - minus: "−", - lowast: "∗", - radic: "√", - prop: "∝", - infin: "∞", - ang: "∠", - and: "∧", - or: "∨", - cap: "∩", - cup: "∪", - "int": "∫", - there4: "∴", - sim: "∼", - cong: "≅", - asymp: "≈", - ne: "≠", - equiv: "≡", - le: "≤", - ge: "≥", - sub: "⊂", - sup: "⊃", - nsub: "⊄", - sube: "⊆", - supe: "⊇", - oplus: "⊕", - otimes: "⊗", - perp: "⊥", - sdot: "⋅", - lceil: "⌈", - rceil: "⌉", - lfloor: "⌊", - rfloor: "⌋", - lang: "〈", - rang: "〉", - loz: "◊", - spades: "♠", - clubs: "♣", - hearts: "♥", - diams: "♦" -}; -module.exports = exports["default"]; -},{}],626:[function(_dereq_,module,exports){ -// The algorithm used to determine whether a regexp can appear at a -// given point in the program is loosely based on sweet.js' approach. -// See https://github.com/mozilla/sweet.js/wiki/design - -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _types = _dereq_(629); - -var TokContext = function TokContext(token, isExpr, preserveSpace, override) { - _classCallCheck(this, TokContext); - - this.token = token; - this.isExpr = !!isExpr; - this.preserveSpace = !!preserveSpace; - this.override = override; -}; - -exports.TokContext = TokContext; -var types = { - b_stat: new TokContext("{", false), - b_expr: new TokContext("{", true), - b_tmpl: new TokContext("${", true), - p_stat: new TokContext("(", false), - p_expr: new TokContext("(", true), - q_tmpl: new TokContext("`", true, true, function (p) { - return p.readTmplToken(); - }), - f_expr: new TokContext("function", true) -}; - -exports.types = types; -// Token-specific context update code - -_types.types.parenR.updateContext = _types.types.braceR.updateContext = function () { - if (this.state.context.length === 1) { - this.state.exprAllowed = true; - return; - } - - var out = this.state.context.pop(); - if (out === types.b_stat && this.curContext() === types.f_expr) { - this.state.context.pop(); - this.state.exprAllowed = false; - } else if (out === types.b_tmpl) { - this.state.exprAllowed = true; - } else { - this.state.exprAllowed = !out.isExpr; - } -}; - -_types.types.braceL.updateContext = function (prevType) { - this.state.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr); - this.state.exprAllowed = true; -}; - -_types.types.dollarBraceL.updateContext = function () { - this.state.context.push(types.b_tmpl); - this.state.exprAllowed = true; -}; - -_types.types.parenL.updateContext = function (prevType) { - var statementParens = prevType === _types.types._if || prevType === _types.types._for || prevType === _types.types._with || prevType === _types.types._while; - this.state.context.push(statementParens ? types.p_stat : types.p_expr); - this.state.exprAllowed = true; -}; - -_types.types.incDec.updateContext = function () { - // tokExprAllowed stays unchanged -}; - -_types.types._function.updateContext = function () { - if (this.curContext() !== types.b_stat) { - this.state.context.push(types.f_expr); - } - - this.state.exprAllowed = false; -}; - -_types.types.backQuote.updateContext = function () { - if (this.curContext() === types.q_tmpl) { - this.state.context.pop(); - } else { - this.state.context.push(types.q_tmpl); - } - this.state.exprAllowed = false; -}; -},{"629":629}],627:[function(_dereq_,module,exports){ -"use strict"; - -exports.__esModule = true; -// istanbul ignore next - -function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; } - -// istanbul ignore next - -function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } - -var _utilIdentifier = _dereq_(630); - -var _types = _dereq_(629); - -var _context = _dereq_(626); - -var _utilLocation = _dereq_(631); - -var _utilWhitespace = _dereq_(632); - -var _state = _dereq_(628); - -var _state2 = _interopRequireDefault(_state); - -// Object type used to represent tokens. Note that normally, tokens -// simply exist as properties on the parser object. This is only -// used for the onToken callback and the external tokenizer. - -var Token = function Token(state) { - _classCallCheck(this, Token); - - this.type = state.type; - this.value = state.value; - this.start = state.start; - this.end = state.end; - this.loc = new _utilLocation.SourceLocation(state.startLoc, state.endLoc); -} - -// ## Tokenizer - -// Are we running under Rhino? -/* global Packages */ -; - -exports.Token = Token; -var isRhino = typeof Packages === "object" && Object.prototype.toString.call(Packages) === "[object JavaPackage]"; - -// Parse a regular expression. Some context-awareness is necessary, -// since a '/' inside a '[]' set does not end the expression. - -function tryCreateRegexp(src, flags, throwErrorStart) { - try { - return new RegExp(src, flags); - } catch (e) { - if (throwErrorStart !== undefined) { - if (e instanceof SyntaxError) this.raise(throwErrorStart, "Error parsing regular expression: " + e.message); - this.raise(e); - } - } -} - -var regexpUnicodeSupport = !!tryCreateRegexp("￿", "u"); - -function codePointToString(code) { - // UTF-16 Decoding - if (code <= 0xFFFF) return String.fromCharCode(code); - return String.fromCharCode((code - 0x10000 >> 10) + 0xD800, (code - 0x10000 & 1023) + 0xDC00); -} - -var Tokenizer = (function () { - function Tokenizer(input) { - _classCallCheck(this, Tokenizer); - - this.state = new _state2["default"](); - this.state.init(input); - } - - // Move to the next token - - Tokenizer.prototype.next = function next() { - this.state.tokens.push(new Token(this.state)); - - this.state.lastTokEnd = this.state.end; - this.state.lastTokStart = this.state.start; - this.state.lastTokEndLoc = this.state.endLoc; - this.state.lastTokStartLoc = this.state.startLoc; - this.nextToken(); - }; - - // TODO - - Tokenizer.prototype.eat = function eat(type) { - if (this.match(type)) { - this.next(); - return true; - } else { - return false; - } - }; - - // TODO - - Tokenizer.prototype.match = function match(type) { - return this.state.type === type; - }; - - // TODO - - Tokenizer.prototype.lookahead = function lookahead() { - var old = this.state; - this.state = old.clone(); - this.next(); - var curr = this.state.clone(); - this.state = old; - return curr; - }; - - // Toggle strict mode. Re-reads the next number or string to please - // pedantic tests (`"use strict"; 010;` should fail). - - Tokenizer.prototype.setStrict = function setStrict(strict) { - this.strict = strict; - if (!this.match(_types.types.num) && !this.match(_types.types.string)) return; - this.state.pos = this.state.start; - while (this.state.pos < this.state.lineStart) { - this.state.lineStart = this.input.lastIndexOf("\n", this.state.lineStart - 2) + 1; - --this.state.curLine; - } - this.nextToken(); - }; - - Tokenizer.prototype.curContext = function curContext() { - return this.state.context[this.state.context.length - 1]; - }; - - // Read a single token, updating the parser object's token-related - // properties. - - Tokenizer.prototype.nextToken = function nextToken() { - var curContext = this.curContext(); - if (!curContext || !curContext.preserveSpace) this.skipSpace(); - - this.state.start = this.state.pos; - this.state.startLoc = this.state.curPosition(); - if (this.state.pos >= this.input.length) return this.finishToken(_types.types.eof); - - if (curContext.override) { - return curContext.override(this); - } else { - return this.readToken(this.fullCharCodeAtPos()); - } - }; - - Tokenizer.prototype.readToken = function readToken(code) { - // Identifier or keyword. '\uXXXX' sequences are allowed in - // identifiers, so '\' also dispatches to that. - if (_utilIdentifier.isIdentifierStart(code, true) || code === 92 /* '\' */) return this.readWord(); - - return this.getTokenFromCode(code); - }; - - Tokenizer.prototype.fullCharCodeAtPos = function fullCharCodeAtPos() { - var code = this.input.charCodeAt(this.state.pos); - if (code <= 0xd7ff || code >= 0xe000) return code; - - var next = this.input.charCodeAt(this.state.pos + 1); - return (code << 10) + next - 0x35fdc00; - }; - - Tokenizer.prototype.pushComment = function pushComment(block, text, start, end, startLoc, endLoc) { - var comment = { - type: block ? "CommentBlock" : "CommentLine", - value: text, - start: start, - end: end, - loc: new _utilLocation.SourceLocation(startLoc, endLoc), - range: [start, end] - }; - - this.state.tokens.push(comment); - this.state.comments.push(comment); - this.addComment(comment); - }; - - Tokenizer.prototype.skipBlockComment = function skipBlockComment() { - var startLoc = this.state.curPosition(); - var start = this.state.pos, - end = this.input.indexOf("*/", this.state.pos += 2); - if (end === -1) this.raise(this.state.pos - 2, "Unterminated comment"); - - this.state.pos = end + 2; - _utilWhitespace.lineBreakG.lastIndex = start; - var match = undefined; - while ((match = _utilWhitespace.lineBreakG.exec(this.input)) && match.index < this.state.pos) { - ++this.state.curLine; - this.state.lineStart = match.index + match[0].length; - } - - this.pushComment(true, this.input.slice(start + 2, end), start, this.state.pos, startLoc, this.state.curPosition()); - }; - - Tokenizer.prototype.skipLineComment = function skipLineComment(startSkip) { - var start = this.state.pos; - var startLoc = this.state.curPosition(); - var ch = this.input.charCodeAt(this.state.pos += startSkip); - while (this.state.pos < this.input.length && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) { - ++this.state.pos; - ch = this.input.charCodeAt(this.state.pos); - } - - this.pushComment(false, this.input.slice(start + startSkip, this.state.pos), start, this.state.pos, startLoc, this.state.curPosition()); - }; - - // Called at the start of the parse and after every token. Skips - // whitespace and comments, and. - - Tokenizer.prototype.skipSpace = function skipSpace() { - loop: while (this.state.pos < this.input.length) { - var ch = this.input.charCodeAt(this.state.pos); - switch (ch) { - case 32:case 160: - // ' ' - ++this.state.pos; - break; - - case 13: - if (this.input.charCodeAt(this.state.pos + 1) === 10) { - ++this.state.pos; - } - - case 10:case 8232:case 8233: - ++this.state.pos; - ++this.state.curLine; - this.state.lineStart = this.state.pos; - break; - - case 47: - // '/' - switch (this.input.charCodeAt(this.state.pos + 1)) { - case 42: - // '*' - this.skipBlockComment(); - break; - - case 47: - this.skipLineComment(2); - break; - - default: - break loop; - } - break; - - default: - if (ch > 8 && ch < 14 || ch >= 5760 && _utilWhitespace.nonASCIIwhitespace.test(String.fromCharCode(ch))) { - ++this.state.pos; - } else { - break loop; - } - } - } - }; - - // Called at the end of every token. Sets `end`, `val`, and - // maintains `context` and `exprAllowed`, and skips the space after - // the token, so that the next one's `start` will point at the - // right position. - - Tokenizer.prototype.finishToken = function finishToken(type, val) { - this.state.end = this.state.pos; - this.state.endLoc = this.state.curPosition(); - var prevType = this.state.type; - this.state.type = type; - this.state.value = val; - - this.updateContext(prevType); - }; - - // ### Token reading - - // This is the function that is called to fetch the next token. It - // is somewhat obscure, because it works in character codes rather - // than characters, and because operator parsing has been inlined - // into it. - // - // All in the name of speed. - // - - Tokenizer.prototype.readToken_dot = function readToken_dot() { - var next = this.input.charCodeAt(this.state.pos + 1); - if (next >= 48 && next <= 57) { - return this.readNumber(true); - } - - var next2 = this.input.charCodeAt(this.state.pos + 2); - if (next === 46 && next2 === 46) { - // 46 = dot '.' - this.state.pos += 3; - return this.finishToken(_types.types.ellipsis); - } else { - ++this.state.pos; - return this.finishToken(_types.types.dot); - } - }; - - Tokenizer.prototype.readToken_slash = function readToken_slash() { - // '/' - if (this.state.exprAllowed) { - ++this.state.pos; - return this.readRegexp(); - } - - var next = this.input.charCodeAt(this.state.pos + 1); - if (next === 61) { - return this.finishOp(_types.types.assign, 2); - } else { - return this.finishOp(_types.types.slash, 1); - } - }; - - Tokenizer.prototype.readToken_mult_modulo = function readToken_mult_modulo(code) { - // '%*' - var type = code === 42 ? _types.types.star : _types.types.modulo; - var width = 1; - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === 42 && this.options.features["es7.exponentiationOperator"]) { - // '*' - width++; - next = this.input.charCodeAt(this.state.pos + 2); - type = _types.types.exponent; - } - - if (next === 61) { - width++; - type = _types.types.assign; - } - - return this.finishOp(type, width); - }; - - Tokenizer.prototype.readToken_pipe_amp = function readToken_pipe_amp(code) { - // '|&' - var next = this.input.charCodeAt(this.state.pos + 1); - if (next === code) return this.finishOp(code === 124 ? _types.types.logicalOR : _types.types.logicalAND, 2); - if (next === 61) return this.finishOp(_types.types.assign, 2); - return this.finishOp(code === 124 ? _types.types.bitwiseOR : _types.types.bitwiseAND, 1); - }; - - Tokenizer.prototype.readToken_caret = function readToken_caret() { - // '^' - var next = this.input.charCodeAt(this.state.pos + 1); - if (next === 61) { - return this.finishOp(_types.types.assign, 2); - } else { - return this.finishOp(_types.types.bitwiseXOR, 1); - } - }; - - Tokenizer.prototype.readToken_plus_min = function readToken_plus_min(code) { - // '+-' - var next = this.input.charCodeAt(this.state.pos + 1); - - if (next === code) { - if (next === 45 && this.input.charCodeAt(this.state.pos + 2) === 62 && _utilWhitespace.lineBreak.test(this.input.slice(this.state.lastTokEnd, this.state.pos))) { - // A `-->` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(_types.types.incDec, 2); - } - - if (next === 61) { - return this.finishOp(_types.types.assign, 2); - } else { - return this.finishOp(_types.types.plusMin, 1); - } - }; - - Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { - // '<>' - var next = this.input.charCodeAt(this.state.pos + 1); - var size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(_types.types.assign, size + 1); - return this.finishOp(_types.types.bitShift, size); - } - - if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - if (this.inModule) this.unexpected(); - // `` line comment - this.skipLineComment(3); - this.skipSpace(); - return this.nextToken(); - } - return this.finishOp(_types.types.incDec, 2); - } - - if (next === 61) { - return this.finishOp(_types.types.assign, 2); - } else { - return this.finishOp(_types.types.plusMin, 1); - } - }; - - Tokenizer.prototype.readToken_lt_gt = function readToken_lt_gt(code) { - // '<>' - var next = this.input.charCodeAt(this.state.pos + 1); - var size = 1; - - if (next === code) { - size = code === 62 && this.input.charCodeAt(this.state.pos + 2) === 62 ? 3 : 2; - if (this.input.charCodeAt(this.state.pos + size) === 61) return this.finishOp(_types.types.assign, size + 1); - return this.finishOp(_types.types.bitShift, size); - } - - if (next === 33 && code === 60 && this.input.charCodeAt(this.state.pos + 2) === 45 && this.input.charCodeAt(this.state.pos + 3) === 45) { - if (this.inModule) this.unexpected(); - // ` - - - - -## `Benchmark` -* [`Benchmark`](#benchmarkname-fn--options) -* [`Benchmark.version`](#benchmarkversion) -* [`Benchmark.deepClone`](#benchmarkdeepclonevalue) -* [`Benchmark.each`](#benchmarkeachobject-callback-thisarg) -* [`Benchmark.extend`](#benchmarkextenddestination--source) -* [`Benchmark.filter`](#benchmarkfilterarray-callback-thisarg) -* [`Benchmark.forEach`](#benchmarkforeacharray-callback-thisarg) -* [`Benchmark.formatNumber`](#benchmarkformatnumbernumber) -* [`Benchmark.forOwn`](#benchmarkforownobject-callback-thisarg) -* [`Benchmark.hasKey`](#benchmarkhaskeyobject-key) -* [`Benchmark.indexOf`](#benchmarkindexofarray-value--fromindex0) -* [`Benchmark.interpolate`](#benchmarkinterpolatestring-object) -* [`Benchmark.invoke`](#benchmarkinvokebenches-name--arg1-arg2-) -* [`Benchmark.join`](#benchmarkjoinobject--separator1--separator2:) -* [`Benchmark.map`](#benchmarkmaparray-callback-thisarg) -* [`Benchmark.pluck`](#benchmarkpluckarray-property) -* [`Benchmark.reduce`](#benchmarkreducearray-callback-accumulator) - - - - - - -## `Benchmark.prototype` -* [`Benchmark.prototype.aborted`](#benchmarkprototypeaborted) -* [`Benchmark.prototype.compiled`](#benchmarkprototypecompiled) -* [`Benchmark.prototype.count`](#benchmarkprototypecount) -* [`Benchmark.prototype.cycles`](#benchmarkprototypecycles) -* [`Benchmark.prototype.fn`](#benchmarkprototypefn) -* [`Benchmark.prototype.hz`](#benchmarkprototypehz) -* [`Benchmark.prototype.running`](#benchmarkprototyperunning) -* [`Benchmark.prototype.setup`](#benchmarkprototypesetup) -* [`Benchmark.prototype.teardown`](#benchmarkprototypeteardown) -* [`Benchmark.prototype.abort`](#benchmarkprototypeabort) -* [`Benchmark.prototype.clone`](#benchmarkprototypecloneoptions) -* [`Benchmark.prototype.compare`](#benchmarkprototypecompareother) -* [`Benchmark.prototype.emit`](#benchmarkprototypeemittype) -* [`Benchmark.prototype.listeners`](#benchmarkprototypelistenerstype) -* [`Benchmark.prototype.off`](#benchmarkprototypeofftype-listener) -* [`Benchmark.prototype.on`](#benchmarkprototypeontype-listener) -* [`Benchmark.prototype.reset`](#benchmarkprototypereset) -* [`Benchmark.prototype.run`](#benchmarkprototyperunoptions) -* [`Benchmark.prototype.toString`](#benchmarkprototypetostring) - - - - - - -## `Benchmark.options` -* [`Benchmark.options`](#benchmarkoptions) -* [`Benchmark.options.async`](#benchmarkoptionsasync) -* [`Benchmark.options.defer`](#benchmarkoptionsdefer) -* [`Benchmark.options.delay`](#benchmarkoptionsdelay) -* [`Benchmark.options.id`](#benchmarkoptionsid) -* [`Benchmark.options.initCount`](#benchmarkoptionsinitcount) -* [`Benchmark.options.maxTime`](#benchmarkoptionsmaxtime) -* [`Benchmark.options.minSamples`](#benchmarkoptionsminsamples) -* [`Benchmark.options.minTime`](#benchmarkoptionsmintime) -* [`Benchmark.options.name`](#benchmarkoptionsname) -* [`Benchmark.options.onAbort`](#benchmarkoptionsonabort) -* [`Benchmark.options.onComplete`](#benchmarkoptionsoncomplete) -* [`Benchmark.options.onCycle`](#benchmarkoptionsoncycle) -* [`Benchmark.options.onError`](#benchmarkoptionsonerror) -* [`Benchmark.options.onReset`](#benchmarkoptionsonreset) -* [`Benchmark.options.onStart`](#benchmarkoptionsonstart) - - - - - - -## `Benchmark.platform` -* [`Benchmark.platform`](#benchmarkplatform) -* [`Benchmark.platform.description`](#benchmarkplatformdescription) -* [`Benchmark.platform.layout`](#benchmarkplatformlayout) -* [`Benchmark.platform.manufacturer`](#benchmarkplatformmanufacturer) -* [`Benchmark.platform.name`](#benchmarkplatformname) -* [`Benchmark.platform.os`](#benchmarkplatformos) -* [`Benchmark.platform.prerelease`](#benchmarkplatformprerelease) -* [`Benchmark.platform.product`](#benchmarkplatformproduct) -* [`Benchmark.platform.version`](#benchmarkplatformversion) -* [`Benchmark.platform.toString`](#benchmarkplatformtostring) - - - - - - -## `Benchmark.support` -* [`Benchmark.support`](#benchmarksupport) -* [`Benchmark.support.air`](#benchmarksupportair) -* [`Benchmark.support.argumentsClass`](#benchmarksupportargumentsclass) -* [`Benchmark.support.browser`](#benchmarksupportbrowser) -* [`Benchmark.support.charByIndex`](#benchmarksupportcharbyindex) -* [`Benchmark.support.charByOwnIndex`](#benchmarksupportcharbyownindex) -* [`Benchmark.support.decompilation`](#benchmarksupportdecompilation) -* [`Benchmark.support.descriptors`](#benchmarksupportdescriptors) -* [`Benchmark.support.getAllKeys`](#benchmarksupportgetallkeys) -* [`Benchmark.support.iteratesOwnLast`](#benchmarksupportiteratesownfirst) -* [`Benchmark.support.java`](#benchmarksupportjava) -* [`Benchmark.support.nodeClass`](#benchmarksupportnodeclass) -* [`Benchmark.support.timeout`](#benchmarksupporttimeout) - - - - - - -## `Benchmark.prototype.error` -* [`Benchmark.prototype.error`](#benchmarkprototypeerror) - - - - - - -## `Benchmark.prototype.stats` -* [`Benchmark.prototype.stats`](#benchmarkprototypestats) -* [`Benchmark.prototype.stats.deviation`](#benchmark-statsdeviation) -* [`Benchmark.prototype.stats.mean`](#benchmark-statsmean) -* [`Benchmark.prototype.stats.moe`](#benchmark-statsmoe) -* [`Benchmark.prototype.stats.rme`](#benchmark-statsrme) -* [`Benchmark.prototype.stats.sample`](#benchmark-statssample) -* [`Benchmark.prototype.stats.sem`](#benchmark-statssem) -* [`Benchmark.prototype.stats.variance`](#benchmark-statsvariance) - - - - - - -## `Benchmark.prototype.times` -* [`Benchmark.prototype.times`](#benchmarkprototypetimes) -* [`Benchmark.prototype.times.cycle`](#benchmark-timescycle) -* [`Benchmark.prototype.times.elapsed`](#benchmark-timeselapsed) -* [`Benchmark.prototype.times.period`](#benchmark-timesperiod) -* [`Benchmark.prototype.times.timeStamp`](#benchmark-timestimestamp) - - - - - - -## `Benchmark.Deferred` -* [`Benchmark.Deferred`](#benchmarkdeferredclone) - - - - - - -## `Benchmark.Deferred.prototype` -* [`Benchmark.Deferred.prototype.benchmark`](#benchmarkdeferredprototypebenchmark) -* [`Benchmark.Deferred.prototype.cycles`](#benchmarkdeferredprototypecycles) -* [`Benchmark.Deferred.prototype.elapsed`](#benchmarkdeferredprototypeelapsed) -* [`Benchmark.Deferred.prototype.resolve`](#benchmarkdeferredprototyperesolve) -* [`Benchmark.Deferred.prototype.timeStamp`](#benchmarkdeferredprototypetimestamp) - - - - - - -## `Benchmark.Event` -* [`Benchmark.Event`](#benchmarkeventtype) - - - - - - -## `Benchmark.Event.prototype` -* [`Benchmark.Event.prototype.aborted`](#benchmarkeventprototypeaborted) -* [`Benchmark.Event.prototype.cancelled`](#benchmarkeventprototypecancelled) -* [`Benchmark.Event.prototype.result`](#benchmarkeventprototyperesult) -* [`Benchmark.Event.prototype.timeStamp`](#benchmarkeventprototypetimestamp) -* [`Benchmark.Event.prototype.type`](#benchmarkeventprototypetype) - - - - - - -## `Benchmark.Event.prototype.currentTarget` -* [`Benchmark.Event.prototype.currentTarget`](#benchmarkeventprototypecurrenttarget) - - - - - - -## `Benchmark.Event.prototype.target` -* [`Benchmark.Event.prototype.target`](#benchmarkeventprototypetarget) - - - - - - -## `Benchmark.Suite` -* [`Benchmark.Suite`](#benchmarksuitename--options) - - - - - - -## `Benchmark.Suite.prototype` -* [`Benchmark.Suite.prototype.aborted`](#benchmarksuiteprototypeaborted) -* [`Benchmark.Suite.prototype.length`](#benchmarksuiteprototypelength) -* [`Benchmark.Suite.prototype.running`](#benchmarksuiteprototyperunning) -* [`Benchmark.Suite.prototype.abort`](#benchmarksuiteprototypeabort) -* [`Benchmark.Suite.prototype.add`](#benchmarksuiteprototypeaddname-fn--options) -* [`Benchmark.Suite.prototype.clone`](#benchmarksuiteprototypecloneoptions) -* [`Benchmark.Suite.prototype.emit`](#benchmarkprototypeemittype) -* [`Benchmark.Suite.prototype.filter`](#benchmarksuiteprototypefiltercallback) -* [`Benchmark.Suite.prototype.forEach`](#benchmarksuiteprototypeforeachcallback) -* [`Benchmark.Suite.prototype.indexOf`](#benchmarksuiteprototypeindexofvalue) -* [`Benchmark.Suite.prototype.invoke`](#benchmarksuiteprototypeinvokename--arg1-arg2-) -* [`Benchmark.Suite.prototype.join`](#benchmarksuiteprototypejoinseparator-) -* [`Benchmark.Suite.prototype.listeners`](#benchmarkprototypelistenerstype) -* [`Benchmark.Suite.prototype.map`](#benchmarksuiteprototypemapcallback) -* [`Benchmark.Suite.prototype.off`](#benchmarkprototypeofftype-listener) -* [`Benchmark.Suite.prototype.on`](#benchmarkprototypeontype-listener) -* [`Benchmark.Suite.prototype.pluck`](#benchmarksuiteprototypepluckproperty) -* [`Benchmark.Suite.prototype.pop`](#benchmarksuiteprototypepop) -* [`Benchmark.Suite.prototype.push`](#benchmarksuiteprototypepush) -* [`Benchmark.Suite.prototype.reduce`](#benchmarksuiteprototypereducecallback-accumulator) -* [`Benchmark.Suite.prototype.reset`](#benchmarksuiteprototypereset) -* [`Benchmark.Suite.prototype.reverse`](#benchmarksuiteprototypereverse) -* [`Benchmark.Suite.prototype.run`](#benchmarksuiteprototyperunoptions) -* [`Benchmark.Suite.prototype.shift`](#benchmarksuiteprototypeshift) -* [`Benchmark.Suite.prototype.slice`](#benchmarksuiteprototypeslicestart-end) -* [`Benchmark.Suite.prototype.sort`](#benchmarksuiteprototypesortcomparefnnull) -* [`Benchmark.Suite.prototype.splice`](#benchmarksuiteprototypesplicestart-deletecount--val1-val2-) -* [`Benchmark.Suite.prototype.unshift`](#benchmarksuiteprototypeunshift) - - - - - - -## `Benchmark.Suite.options` -* [`Benchmark.Suite.options`](#benchmarksuiteoptions) -* [`Benchmark.Suite.options.name`](#benchmarksuiteoptionsname) - - - - - - - - - - - - -## `Benchmark` - - - -### `Benchmark(name, fn [, options={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L404 "View in source") [Ⓣ][1] - -The Benchmark constructor. - -#### Arguments -1. `name` *(String)*: A name to identify the benchmark. -2. `fn` *(Function|String)*: The test to benchmark. -3. `[options={}]` *(Object)*: Options object. - -#### Example -~~~ js -// basic usage (the `new` operator is optional) -var bench = new Benchmark(fn); - -// or using a name first -var bench = new Benchmark('foo', fn); - -// or with options -var bench = new Benchmark('foo', fn, { - - // displayed by Benchmark#toString if `name` is not available - 'id': 'xyz', - - // called when the benchmark starts running - 'onStart': onStart, - - // called after each run cycle - 'onCycle': onCycle, - - // called when aborted - 'onAbort': onAbort, - - // called when a test errors - 'onError': onError, - - // called when reset - 'onReset': onReset, - - // called when the benchmark completes running - 'onComplete': onComplete, - - // compiled/called before the test loop - 'setup': setup, - - // compiled/called after the test loop - 'teardown': teardown -}); - -// or name and options -var bench = new Benchmark('foo', { - - // a flag to indicate the benchmark is deferred - 'defer': true, - - // benchmark test function - 'fn': function(deferred) { - // call resolve() when the deferred test is finished - deferred.resolve(); - } -}); - -// or options only -var bench = new Benchmark({ - - // benchmark name - 'name': 'foo', - - // benchmark test as a string - 'fn': '[1,2,3,4].sort()' -}); - -// a test's `this` binding is set to the benchmark instance -var bench = new Benchmark('foo', function() { - 'My name is '.concat(this.name); // My name is foo -}); -~~~ - -* * * - - - - - - -### `Benchmark.version` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3267 "View in source") [Ⓣ][1] - -*(String)*: The semantic version number. - -* * * - - - - - - -### `Benchmark.deepClone(value)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1225 "View in source") [Ⓣ][1] - -A deep clone utility. - -#### Arguments -1. `value` *(Mixed)*: The value to clone. - -#### Returns -*(Mixed)*: The cloned value. - -* * * - - - - - - -### `Benchmark.each(object, callback, thisArg)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1400 "View in source") [Ⓣ][1] - -An iteration utility for arrays and objects. Callbacks may terminate the loop by explicitly returning `false`. - -#### Arguments -1. `object` *(Array|Object)*: The object to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `thisArg` *(Mixed)*: The `this` binding for the callback. - -#### Returns -*(Array, Object)*: Returns the object iterated over. - -* * * - - - - - - -### `Benchmark.extend(destination [, source={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1446 "View in source") [Ⓣ][1] - -Copies enumerable properties from the source(s) object to the destination object. - -#### Arguments -1. `destination` *(Object)*: The destination object. -2. `[source={}]` *(Object)*: The source object. - -#### Returns -*(Object)*: The destination object. - -* * * - - - - - - -### `Benchmark.filter(array, callback, thisArg)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1485 "View in source") [Ⓣ][1] - -A generic `Array#filter` like method. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `callback` *(Function|String)*: The function/alias called per iteration. -3. `thisArg` *(Mixed)*: The `this` binding for the callback. - -#### Returns -*(Array)*: A new array of values that passed callback filter. - -#### Example -~~~ js -// get odd numbers -Benchmark.filter([1, 2, 3, 4, 5], function(n) { - return n % 2; -}); // -> [1, 3, 5]; - -// get fastest benchmarks -Benchmark.filter(benches, 'fastest'); - -// get slowest benchmarks -Benchmark.filter(benches, 'slowest'); - -// get benchmarks that completed without erroring -Benchmark.filter(benches, 'successful'); -~~~ - -* * * - - - - - - -### `Benchmark.forEach(array, callback, thisArg)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1518 "View in source") [Ⓣ][1] - -A generic `Array#forEach` like method. Callbacks may terminate the loop by explicitly returning `false`. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `thisArg` *(Mixed)*: The `this` binding for the callback. - -#### Returns -*(Array)*: Returns the array iterated over. - -* * * - - - - - - -### `Benchmark.formatNumber(number)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1557 "View in source") [Ⓣ][1] - -Converts a number to a more readable comma-separated string representation. - -#### Arguments -1. `number` *(Number)*: The number to convert. - -#### Returns -*(String)*: The more readable string representation. - -* * * - - - - - - -### `Benchmark.forOwn(object, callback, thisArg)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1545 "View in source") [Ⓣ][1] - -Iterates over an object's own properties, executing the `callback` for each. Callbacks may terminate the loop by explicitly returning `false`. - -#### Arguments -1. `object` *(Object)*: The object to iterate over. -2. `callback` *(Function)*: The function executed per own property. -3. `thisArg` *(Mixed)*: The `this` binding for the callback. - -#### Returns -*(Object)*: Returns the object iterated over. - -* * * - - - - - - -### `Benchmark.hasKey(object, key)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1572 "View in source") [Ⓣ][1] - -Checks if an object has the specified key as a direct property. - -#### Arguments -1. `object` *(Object)*: The object to check. -2. `key` *(String)*: The key to check for. - -#### Returns -*(Boolean)*: Returns `true` if key is a direct property, else `false`. - -* * * - - - - - - -### `Benchmark.indexOf(array, value [, fromIndex=0])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1608 "View in source") [Ⓣ][1] - -A generic `Array#indexOf` like method. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `value` *(Mixed)*: The value to search for. -3. `[fromIndex=0]` *(Number)*: The index to start searching from. - -#### Returns -*(Number)*: The index of the matched value or `-1`. - -* * * - - - - - - -### `Benchmark.interpolate(string, object)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1630 "View in source") [Ⓣ][1] - -Modify a string by replacing named tokens with matching object property values. - -#### Arguments -1. `string` *(String)*: The string to modify. -2. `object` *(Object)*: The template object. - -#### Returns -*(String)*: The modified string. - -* * * - - - - - - -### `Benchmark.invoke(benches, name [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1677 "View in source") [Ⓣ][1] - -Invokes a method on all items in an array. - -#### Arguments -1. `benches` *(Array)*: Array of benchmarks to iterate over. -2. `name` *(String|Object)*: The name of the method to invoke OR options object. -3. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the method with. - -#### Returns -*(Array)*: A new array of values returned from each method invoked. - -#### Example -~~~ js -// invoke `reset` on all benchmarks -Benchmark.invoke(benches, 'reset'); - -// invoke `emit` with arguments -Benchmark.invoke(benches, 'emit', 'complete', listener); - -// invoke `run(true)`, treat benchmarks as a queue, and register invoke callbacks -Benchmark.invoke(benches, { - - // invoke the `run` method - 'name': 'run', - - // pass a single argument - 'args': true, - - // treat as queue, removing benchmarks from front of `benches` until empty - 'queued': true, - - // called before any benchmarks have been invoked. - 'onStart': onStart, - - // called between invoking benchmarks - 'onCycle': onCycle, - - // called after all benchmarks have been invoked. - 'onComplete': onComplete -}); -~~~ - -* * * - - - - - - -### `Benchmark.join(object [, separator1=',', separator2=': '])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1831 "View in source") [Ⓣ][1] - -Creates a string of joined array values or object key-value pairs. - -#### Arguments -1. `object` *(Array|Object)*: The object to operate on. -2. `[separator1=',']` *(String)*: The separator used between key-value pairs. -3. `[separator2=': ']` *(String)*: The separator used between keys and values. - -#### Returns -*(String)*: The joined result. - -* * * - - - - - - -### `Benchmark.map(array, callback, thisArg)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1853 "View in source") [Ⓣ][1] - -A generic `Array#map` like method. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `thisArg` *(Mixed)*: The `this` binding for the callback. - -#### Returns -*(Array)*: A new array of values returned by the callback. - -* * * - - - - - - -### `Benchmark.pluck(array, property)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1869 "View in source") [Ⓣ][1] - -Retrieves the value of a specified property from all items in an array. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `property` *(String)*: The property to pluck. - -#### Returns -*(Array)*: A new array of property values. - -* * * - - - - - - -### `Benchmark.reduce(array, callback, accumulator)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1885 "View in source") [Ⓣ][1] - -A generic `Array#reduce` like method. - -#### Arguments -1. `array` *(Array)*: The array to iterate over. -2. `callback` *(Function)*: The function called per iteration. -3. `accumulator` *(Mixed)*: Initial value of the accumulator. - -#### Returns -*(Mixed)*: The accumulator. - -* * * - - - - - - - - - -## `Benchmark.prototype` - - - -### `Benchmark.prototype.aborted` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3377 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the benchmark is aborted. - -* * * - - - - - - -### `Benchmark.prototype.compiled` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3353 "View in source") [Ⓣ][1] - -*(Function, String)*: The compiled test function. - -* * * - - - - - - -### `Benchmark.prototype.count` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3329 "View in source") [Ⓣ][1] - -*(Number)*: The number of times a test was executed. - -* * * - - - - - - -### `Benchmark.prototype.cycles` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3337 "View in source") [Ⓣ][1] - -*(Number)*: The number of cycles performed while benchmarking. - -* * * - - - - - - -### `Benchmark.prototype.fn` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3369 "View in source") [Ⓣ][1] - -*(Function, String)*: The test to benchmark. - -* * * - - - - - - -### `Benchmark.prototype.hz` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3345 "View in source") [Ⓣ][1] - -*(Number)*: The number of executions per second. - -* * * - - - - - - -### `Benchmark.prototype.running` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3385 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the benchmark is running. - -* * * - - - - - - -### `Benchmark.prototype.setup` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3448 "View in source") [Ⓣ][1] - -*(Function, String)*: Compiled into the test and executed immediately **before** the test loop. - -#### Example -~~~ js -// basic usage -var bench = Benchmark({ - 'setup': function() { - var c = this.count, - element = document.getElementById('container'); - while (c--) { - element.appendChild(document.createElement('div')); - } - }, - 'fn': function() { - element.removeChild(element.lastChild); - } -}); - -// compiles to something like: -var c = this.count, - element = document.getElementById('container'); -while (c--) { - element.appendChild(document.createElement('div')); -} -var start = new Date; -while (count--) { - element.removeChild(element.lastChild); -} -var end = new Date - start; - -// or using strings -var bench = Benchmark({ - 'setup': '\ - var a = 0;\n\ - (function() {\n\ - (function() {\n\ - (function() {', - 'fn': 'a += 1;', - 'teardown': '\ - }())\n\ - }())\n\ - }())' -}); - -// compiles to something like: -var a = 0; -(function() { - (function() { - (function() { - var start = new Date; - while (count--) { - a += 1; - } - var end = new Date - start; - }()) - }()) -}()) -~~~ - -* * * - - - - - - -### `Benchmark.prototype.teardown` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3456 "View in source") [Ⓣ][1] - -*(Function, String)*: Compiled into the test and executed immediately **after** the test loop. - -* * * - - - - - - -### `Benchmark.prototype.abort()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2218 "View in source") [Ⓣ][1] - -Aborts the benchmark without recording times. - -#### Returns -*(Object)*: The benchmark instance. - -* * * - - - - - - -### `Benchmark.prototype.clone(options)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2257 "View in source") [Ⓣ][1] - -Creates a new benchmark using the same test and options. - -#### Arguments -1. `options` *(Object)*: Options object to overwrite cloned options. - -#### Returns -*(Object)*: The new benchmark instance. - -#### Example -~~~ js -var bizarro = bench.clone({ - 'name': 'doppelganger' -}); -~~~ - -* * * - - - - - - -### `Benchmark.prototype.compare(other)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2280 "View in source") [Ⓣ][1] - -Determines if a benchmark is faster than another. - -#### Arguments -1. `other` *(Object)*: The benchmark to compare. - -#### Returns -*(Number)*: Returns `-1` if slower, `1` if faster, and `0` if indeterminate. - -* * * - - - - - - -### `Benchmark.Suite.prototype.emit(type)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2095 "View in source") [Ⓣ][1] - -Executes all registered listeners of the specified event type. - -#### Arguments -1. `type` *(String|Object)*: The event type or object. - -#### Returns -*(Mixed)*: Returns the return value of the last listener executed. - -* * * - - - - - - -### `Benchmark.Suite.prototype.listeners(type)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2125 "View in source") [Ⓣ][1] - -Returns an array of event listeners for a given type that can be manipulated to add or remove listeners. - -#### Arguments -1. `type` *(String)*: The event type. - -#### Returns -*(Array)*: The listeners array. - -* * * - - - - - - -### `Benchmark.Suite.prototype.off([type, listener])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2158 "View in source") [Ⓣ][1] - -Unregisters a listener for the specified event type(s), or unregisters all listeners for the specified event type(s), or unregisters all listeners for all event types. - -#### Arguments -1. `[type]` *(String)*: The event type. -2. `[listener]` *(Function)*: The function to unregister. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// unregister a listener for an event type -bench.off('cycle', listener); - -// unregister a listener for multiple event types -bench.off('start cycle', listener); - -// unregister all listeners for an event type -bench.off('cycle'); - -// unregister all listeners for multiple event types -bench.off('start cycle complete'); - -// unregister all listeners for all event types -bench.off(); -~~~ - -* * * - - - - - - -### `Benchmark.Suite.prototype.on(type, listener)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2197 "View in source") [Ⓣ][1] - -Registers a listener for the specified event type(s). - -#### Arguments -1. `type` *(String)*: The event type. -2. `listener` *(Function)*: The function to register. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// register a listener for an event type -bench.on('cycle', listener); - -// register a listener for multiple event types -bench.on('start cycle', listener); -~~~ - -* * * - - - - - - -### `Benchmark.prototype.reset()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2334 "View in source") [Ⓣ][1] - -Reset properties and abort if running. - -#### Returns -*(Object)*: The benchmark instance. - -* * * - - - - - - -### `Benchmark.prototype.run([options={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3000 "View in source") [Ⓣ][1] - -Runs the benchmark. - -#### Arguments -1. `[options={}]` *(Object)*: Options object. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// basic usage -bench.run(); - -// or with options -bench.run({ 'async': true }); -~~~ - -* * * - - - - - - -### `Benchmark.prototype.toString()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2405 "View in source") [Ⓣ][1] - -Displays relevant benchmark information when coerced to a string. - -#### Returns -*(String)*: A string representation of the benchmark instance. - -* * * - - - - - - - - - -## `Benchmark.options` - - - -### `Benchmark.options` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3049 "View in source") [Ⓣ][1] - -*(Object)*: The default options copied by benchmark instances. - -* * * - - - - - - -### `Benchmark.options.async` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3058 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate that benchmark cycles will execute asynchronously by default. - -* * * - - - - - - -### `Benchmark.options.defer` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3066 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate that the benchmark clock is deferred. - -* * * - - - - - - -### `Benchmark.options.delay` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3073 "View in source") [Ⓣ][1] - -*(Number)*: The delay between test cycles *(secs)*. - -* * * - - - - - - -### `Benchmark.options.id` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3082 "View in source") [Ⓣ][1] - -*(String)*: Displayed by Benchmark#toString when a `name` is not available *(auto-generated if absent)*. - -* * * - - - - - - -### `Benchmark.options.initCount` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3090 "View in source") [Ⓣ][1] - -*(Number)*: The default number of times to execute a test on a benchmark's first cycle. - -* * * - - - - - - -### `Benchmark.options.maxTime` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3099 "View in source") [Ⓣ][1] - -*(Number)*: The maximum time a benchmark is allowed to run before finishing *(secs)*. Note: Cycle delays aren't counted toward the maximum time. - -* * * - - - - - - -### `Benchmark.options.minSamples` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3107 "View in source") [Ⓣ][1] - -*(Number)*: The minimum sample size required to perform statistical analysis. - -* * * - - - - - - -### `Benchmark.options.minTime` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3115 "View in source") [Ⓣ][1] - -*(Number)*: The time needed to reduce the percent uncertainty of measurement to `1`% *(secs)*. - -* * * - - - - - - -### `Benchmark.options.name` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3123 "View in source") [Ⓣ][1] - -*(String)*: The name of the benchmark. - -* * * - - - - - - -### `Benchmark.options.onAbort` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3131 "View in source") [Ⓣ][1] - -An event listener called when the benchmark is aborted. - -* * * - - - - - - -### `Benchmark.options.onComplete` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3139 "View in source") [Ⓣ][1] - -An event listener called when the benchmark completes running. - -* * * - - - - - - -### `Benchmark.options.onCycle` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3147 "View in source") [Ⓣ][1] - -An event listener called after each run cycle. - -* * * - - - - - - -### `Benchmark.options.onError` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3155 "View in source") [Ⓣ][1] - -An event listener called when a test errors. - -* * * - - - - - - -### `Benchmark.options.onReset` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3163 "View in source") [Ⓣ][1] - -An event listener called when the benchmark is reset. - -* * * - - - - - - -### `Benchmark.options.onStart` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3171 "View in source") [Ⓣ][1] - -An event listener called when the benchmark starts running. - -* * * - - - - - - - - - -## `Benchmark.platform` - - - -### `Benchmark.platform` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3182 "View in source") [Ⓣ][1] - -*(Object)*: Platform object with properties describing things like browser name, version, and operating system. - -* * * - - - - - - -### `Benchmark.platform.description` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3190 "View in source") [Ⓣ][1] - -*(String)*: The platform description. - -* * * - - - - - - -### `Benchmark.platform.layout` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3198 "View in source") [Ⓣ][1] - -*(String, Null)*: The name of the browser layout engine. - -* * * - - - - - - -### `Benchmark.platform.manufacturer` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3222 "View in source") [Ⓣ][1] - -*(String, Null)*: The name of the product's manufacturer. - -* * * - - - - - - -### `Benchmark.platform.name` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3214 "View in source") [Ⓣ][1] - -*(String, Null)*: The name of the browser/environment. - -* * * - - - - - - -### `Benchmark.platform.os` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3230 "View in source") [Ⓣ][1] - -*(String, Null)*: The name of the operating system. - -* * * - - - - - - -### `Benchmark.platform.prerelease` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3238 "View in source") [Ⓣ][1] - -*(String, Null)*: The alpha/beta release indicator. - -* * * - - - - - - -### `Benchmark.platform.product` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3206 "View in source") [Ⓣ][1] - -*(String, Null)*: The name of the product hosting the browser. - -* * * - - - - - - -### `Benchmark.platform.version` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3246 "View in source") [Ⓣ][1] - -*(String, Null)*: The browser/environment version. - -* * * - - - - - - -### `Benchmark.platform.toString()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3255 "View in source") [Ⓣ][1] - -Return platform description when the platform object is coerced to a string. - -#### Returns -*(String)*: The platform description. - -* * * - - - - - - - - - -## `Benchmark.support` - - - -### `Benchmark.support` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L135 "View in source") [Ⓣ][1] - -*(Object)*: An object used to flag environments/features. - -* * * - - - - - - -### `Benchmark.support.air` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L145 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect Adobe AIR. - -* * * - - - - - - -### `Benchmark.support.argumentsClass` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L153 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if `arguments` objects have the correct internal [[Class]] value. - -* * * - - - - - - -### `Benchmark.support.browser` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L161 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if in a browser environment. - -* * * - - - - - - -### `Benchmark.support.charByIndex` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L169 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if strings support accessing characters by index. - -* * * - - - - - - -### `Benchmark.support.charByOwnIndex` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L179 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if strings have indexes as own properties. - -* * * - - - - - - -### `Benchmark.support.decompilation` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L207 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if functions support decompilation. - -* * * - - - - - - -### `Benchmark.support.descriptors` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L228 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect ES5+ property descriptor API. - -* * * - - - - - - -### `Benchmark.support.getAllKeys` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L242 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect ES5+ Object.getOwnPropertyNames(). - -* * * - - - - - - -### `Benchmark.support.iteratesOwnFirst` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L255 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if own properties are iterated before inherited properties *(all but IE < `9`)*. - -* * * - - - - - - -### `Benchmark.support.java` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L190 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if Java is enabled/exposed. - -* * * - - - - - - -### `Benchmark.support.nodeClass` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L272 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if a node's [[Class]] is resolvable *(all but IE < `9`)* and that the JS engine errors when attempting to coerce an object to a string without a `toString` property value of `typeof` "function". - -* * * - - - - - - -### `Benchmark.support.timeout` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L198 "View in source") [Ⓣ][1] - -*(Boolean)*: Detect if the Timers API exists. - -* * * - - - - - - - - - -## `Benchmark.prototype.error` - - - -### `Benchmark.prototype.error` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3361 "View in source") [Ⓣ][1] - -*(Object)*: The error object if the test failed. - -* * * - - - - - - - - - -## `Benchmark.prototype.stats` - - - -### `Benchmark.prototype.stats` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3464 "View in source") [Ⓣ][1] - -*(Object)*: An object of stats including mean, margin or error, and standard deviation. - -* * * - - - - - - -### `Benchmark.prototype.stats.deviation` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3496 "View in source") [Ⓣ][1] - -*(Number)*: The sample standard deviation. - -* * * - - - - - - -### `Benchmark.prototype.stats.mean` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3504 "View in source") [Ⓣ][1] - -*(Number)*: The sample arithmetic mean. - -* * * - - - - - - -### `Benchmark.prototype.stats.moe` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3472 "View in source") [Ⓣ][1] - -*(Number)*: The margin of error. - -* * * - - - - - - -### `Benchmark.prototype.stats.rme` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3480 "View in source") [Ⓣ][1] - -*(Number)*: The relative margin of error *(expressed as a percentage of the mean)*. - -* * * - - - - - - -### `Benchmark.prototype.stats.sample` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3512 "View in source") [Ⓣ][1] - -*(Array)*: The array of sampled periods. - -* * * - - - - - - -### `Benchmark.prototype.stats.sem` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3488 "View in source") [Ⓣ][1] - -*(Number)*: The standard error of the mean. - -* * * - - - - - - -### `Benchmark.prototype.stats.variance` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3520 "View in source") [Ⓣ][1] - -*(Number)*: The sample variance. - -* * * - - - - - - - - - -## `Benchmark.prototype.times` - - - -### `Benchmark.prototype.times` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3529 "View in source") [Ⓣ][1] - -*(Object)*: An object of timing data including cycle, elapsed, period, start, and stop. - -* * * - - - - - - -### `Benchmark.prototype.times.cycle` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3537 "View in source") [Ⓣ][1] - -*(Number)*: The time taken to complete the last cycle *(secs)*. - -* * * - - - - - - -### `Benchmark.prototype.times.elapsed` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3545 "View in source") [Ⓣ][1] - -*(Number)*: The time taken to complete the benchmark *(secs)*. - -* * * - - - - - - -### `Benchmark.prototype.times.period` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3553 "View in source") [Ⓣ][1] - -*(Number)*: The time taken to execute the test once *(secs)*. - -* * * - - - - - - -### `Benchmark.prototype.times.timeStamp` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3561 "View in source") [Ⓣ][1] - -*(Number)*: A timestamp of when the benchmark started *(ms)*. - -* * * - - - - - - - - - -## `Benchmark.Deferred` - - - -### `Benchmark.Deferred(clone)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L445 "View in source") [Ⓣ][1] - -The Deferred constructor. - -#### Arguments -1. `clone` *(Object)*: The cloned benchmark instance. - -* * * - - - - - - - - - -## `Benchmark.Deferred.prototype` - - - -### `Benchmark.Deferred.prototype.benchmark` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3605 "View in source") [Ⓣ][1] - -*(Object)*: The deferred benchmark instance. - -* * * - - - - - - -### `Benchmark.Deferred.prototype.cycles` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3613 "View in source") [Ⓣ][1] - -*(Number)*: The number of deferred cycles performed while benchmarking. - -* * * - - - - - - -### `Benchmark.Deferred.prototype.elapsed` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3621 "View in source") [Ⓣ][1] - -*(Number)*: The time taken to complete the deferred benchmark *(secs)*. - -* * * - - - - - - -### `Benchmark.Deferred.prototype.resolve` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1188 "View in source") [Ⓣ][1] - -*(Unknown)*: Handles cycling/completing the deferred benchmark. - -* * * - - - - - - -### `Benchmark.Deferred.prototype.timeStamp` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3629 "View in source") [Ⓣ][1] - -*(Number)*: A timestamp of when the deferred benchmark started *(ms)*. - -* * * - - - - - - - - - -## `Benchmark.Event` - - - -### `Benchmark.Event(type)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L461 "View in source") [Ⓣ][1] - -The Event constructor. - -#### Arguments -1. `type` *(String|Object)*: The event type. - -* * * - - - - - - - - - -## `Benchmark.Event.prototype` - - - -### `Benchmark.Event.prototype.aborted` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3645 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the emitters listener iteration is aborted. - -* * * - - - - - - -### `Benchmark.Event.prototype.cancelled` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3653 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the default action is cancelled. - -* * * - - - - - - -### `Benchmark.Event.prototype.result` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3669 "View in source") [Ⓣ][1] - -*(Mixed)*: The return value of the last executed listener. - -* * * - - - - - - -### `Benchmark.Event.prototype.timeStamp` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3685 "View in source") [Ⓣ][1] - -*(Number)*: A timestamp of when the event was created *(ms)*. - -* * * - - - - - - -### `Benchmark.Event.prototype.type` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3693 "View in source") [Ⓣ][1] - -*(String)*: The event type. - -* * * - - - - - - - - - -## `Benchmark.Event.prototype.currentTarget` - - - -### `Benchmark.Event.prototype.currentTarget` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3661 "View in source") [Ⓣ][1] - -*(Object)*: The object whose listeners are currently being processed. - -* * * - - - - - - - - - -## `Benchmark.Event.prototype.target` - - - -### `Benchmark.Event.prototype.target` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3677 "View in source") [Ⓣ][1] - -*(Object)*: The object to which the event was originally emitted. - -* * * - - - - - - - - - -## `Benchmark.Suite` - - - -### `Benchmark.Suite(name [, options={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L507 "View in source") [Ⓣ][1] - -The Suite constructor. - -#### Arguments -1. `name` *(String)*: A name to identify the suite. -2. `[options={}]` *(Object)*: Options object. - -#### Example -~~~ js -// basic usage (the `new` operator is optional) -var suite = new Benchmark.Suite; - -// or using a name first -var suite = new Benchmark.Suite('foo'); - -// or with options -var suite = new Benchmark.Suite('foo', { - - // called when the suite starts running - 'onStart': onStart, - - // called between running benchmarks - 'onCycle': onCycle, - - // called when aborted - 'onAbort': onAbort, - - // called when a test errors - 'onError': onError, - - // called when reset - 'onReset': onReset, - - // called when the suite completes running - 'onComplete': onComplete -}); -~~~ - -* * * - - - - - - - - - -## `Benchmark.Suite.prototype` - - - -### `Benchmark.Suite.prototype.aborted` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3734 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the suite is aborted. - -* * * - - - - - - -### `Benchmark.Suite.prototype.length` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3726 "View in source") [Ⓣ][1] - -*(Number)*: The number of benchmarks in the suite. - -* * * - - - - - - -### `Benchmark.Suite.prototype.running` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3742 "View in source") [Ⓣ][1] - -*(Boolean)*: A flag to indicate if the suite is running. - -* * * - - - - - - -### `Benchmark.Suite.prototype.abort()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1902 "View in source") [Ⓣ][1] - -Aborts all benchmarks in the suite. - -#### Returns -*(Object)*: The suite instance. - -* * * - - - - - - -### `Benchmark.Suite.prototype.add(name, fn [, options={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1962 "View in source") [Ⓣ][1] - -Adds a test to the benchmark suite. - -#### Arguments -1. `name` *(String)*: A name to identify the benchmark. -2. `fn` *(Function|String)*: The test to benchmark. -3. `[options={}]` *(Object)*: Options object. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// basic usage -suite.add(fn); - -// or using a name first -suite.add('foo', fn); - -// or with options -suite.add('foo', fn, { - 'onCycle': onCycle, - 'onComplete': onComplete -}); - -// or name and options -suite.add('foo', { - 'fn': fn, - 'onCycle': onCycle, - 'onComplete': onComplete -}); - -// or options only -suite.add({ - 'name': 'foo', - 'fn': fn, - 'onCycle': onCycle, - 'onComplete': onComplete -}); -~~~ - -* * * - - - - - - -### `Benchmark.Suite.prototype.clone(options)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L1981 "View in source") [Ⓣ][1] - -Creates a new suite with cloned benchmarks. - -#### Arguments -1. `options` *(Object)*: Options object to overwrite cloned options. - -#### Returns -*(Object)*: The new suite instance. - -* * * - - - - - - -### `Benchmark.Suite.prototype.emit(type)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2095 "View in source") [Ⓣ][1] - -Executes all registered listeners of the specified event type. - -#### Arguments -1. `type` *(String|Object)*: The event type or object. - -#### Returns -*(Mixed)*: Returns the return value of the last listener executed. - -* * * - - - - - - -### `Benchmark.Suite.prototype.filter(callback)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2004 "View in source") [Ⓣ][1] - -An `Array#filter` like method. - -#### Arguments -1. `callback` *(Function|String)*: The function/alias called per iteration. - -#### Returns -*(Object)*: A new suite of benchmarks that passed callback filter. - -* * * - - - - - - -### `Benchmark.Suite.prototype.forEach(callback)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3752 "View in source") [Ⓣ][1] - -An `Array#forEach` like method. Callbacks may terminate the loop by explicitly returning `false`. - -#### Arguments -1. `callback` *(Function)*: The function called per iteration. - -#### Returns -*(Object)*: The suite iterated over. - -* * * - - - - - - -### `Benchmark.Suite.prototype.indexOf(value)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3761 "View in source") [Ⓣ][1] - -An `Array#indexOf` like method. - -#### Arguments -1. `value` *(Mixed)*: The value to search for. - -#### Returns -*(Number)*: The index of the matched value or `-1`. - -* * * - - - - - - -### `Benchmark.Suite.prototype.invoke(name [, arg1, arg2, ...])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3771 "View in source") [Ⓣ][1] - -Invokes a method on all benchmarks in the suite. - -#### Arguments -1. `name` *(String|Object)*: The name of the method to invoke OR options object. -2. `[arg1, arg2, ...]` *(Mixed)*: Arguments to invoke the method with. - -#### Returns -*(Array)*: A new array of values returned from each method invoked. - -* * * - - - - - - -### `Benchmark.Suite.prototype.join([separator=','])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3780 "View in source") [Ⓣ][1] - -Converts the suite of benchmarks to a string. - -#### Arguments -1. `[separator=',']` *(String)*: A string to separate each element of the array. - -#### Returns -*(String)*: The string. - -* * * - - - - - - -### `Benchmark.Suite.prototype.listeners(type)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2125 "View in source") [Ⓣ][1] - -Returns an array of event listeners for a given type that can be manipulated to add or remove listeners. - -#### Arguments -1. `type` *(String)*: The event type. - -#### Returns -*(Array)*: The listeners array. - -* * * - - - - - - -### `Benchmark.Suite.prototype.map(callback)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3789 "View in source") [Ⓣ][1] - -An `Array#map` like method. - -#### Arguments -1. `callback` *(Function)*: The function called per iteration. - -#### Returns -*(Array)*: A new array of values returned by the callback. - -* * * - - - - - - -### `Benchmark.Suite.prototype.off([type, listener])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2158 "View in source") [Ⓣ][1] - -Unregisters a listener for the specified event type(s), or unregisters all listeners for the specified event type(s), or unregisters all listeners for all event types. - -#### Arguments -1. `[type]` *(String)*: The event type. -2. `[listener]` *(Function)*: The function to unregister. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// unregister a listener for an event type -bench.off('cycle', listener); - -// unregister a listener for multiple event types -bench.off('start cycle', listener); - -// unregister all listeners for an event type -bench.off('cycle'); - -// unregister all listeners for multiple event types -bench.off('start cycle complete'); - -// unregister all listeners for all event types -bench.off(); -~~~ - -* * * - - - - - - -### `Benchmark.Suite.prototype.on(type, listener)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2197 "View in source") [Ⓣ][1] - -Registers a listener for the specified event type(s). - -#### Arguments -1. `type` *(String)*: The event type. -2. `listener` *(Function)*: The function to register. - -#### Returns -*(Object)*: The benchmark instance. - -#### Example -~~~ js -// register a listener for an event type -bench.on('cycle', listener); - -// register a listener for multiple event types -bench.on('start cycle', listener); -~~~ - -* * * - - - - - - -### `Benchmark.Suite.prototype.pluck(property)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3798 "View in source") [Ⓣ][1] - -Retrieves the value of a specified property from all benchmarks in the suite. - -#### Arguments -1. `property` *(String)*: The property to pluck. - -#### Returns -*(Array)*: A new array of property values. - -* * * - - - - - - -### `Benchmark.Suite.prototype.pop()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3806 "View in source") [Ⓣ][1] - -Removes the last benchmark from the suite and returns it. - -#### Returns -*(Mixed)*: The removed benchmark. - -* * * - - - - - - -### `Benchmark.Suite.prototype.push()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3814 "View in source") [Ⓣ][1] - -Appends benchmarks to the suite. - -#### Returns -*(Number)*: The suite's new length. - -* * * - - - - - - -### `Benchmark.Suite.prototype.reduce(callback, accumulator)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3833 "View in source") [Ⓣ][1] - -An `Array#reduce` like method. - -#### Arguments -1. `callback` *(Function)*: The function called per iteration. -2. `accumulator` *(Mixed)*: Initial value of the accumulator. - -#### Returns -*(Mixed)*: The accumulator. - -* * * - - - - - - -### `Benchmark.Suite.prototype.reset()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2019 "View in source") [Ⓣ][1] - -Resets all benchmarks in the suite. - -#### Returns -*(Object)*: The suite instance. - -* * * - - - - - - -### `Benchmark.Suite.prototype.reverse()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L638 "View in source") [Ⓣ][1] - -Rearrange the host array's elements in reverse order. - -#### Returns -*(Array)*: The reversed array. - -* * * - - - - - - -### `Benchmark.Suite.prototype.run([options={}])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L2056 "View in source") [Ⓣ][1] - -Runs the suite. - -#### Arguments -1. `[options={}]` *(Object)*: Options object. - -#### Returns -*(Object)*: The suite instance. - -#### Example -~~~ js -// basic usage -suite.run(); - -// or with options -suite.run({ 'async': true, 'queued': true }); -~~~ - -* * * - - - - - - -### `Benchmark.Suite.prototype.shift()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L671 "View in source") [Ⓣ][1] - -Removes the first element of the host array and returns it. - -#### Returns -*(Mixed)*: The first element of the array. - -* * * - - - - - - -### `Benchmark.Suite.prototype.slice(start, end)` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L684 "View in source") [Ⓣ][1] - -Creates an array of the host array's elements from the start index up to, but not including, the end index. - -#### Arguments -1. `start` *(Number)*: The starting index. -2. `end` *(Number)*: The end index. - -#### Returns -*(Array)*: The new array. - -* * * - - - - - - -### `Benchmark.Suite.prototype.sort([compareFn=null])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3823 "View in source") [Ⓣ][1] - -Sorts the benchmarks of the suite. - -#### Arguments -1. `[compareFn=null]` *(Function)*: A function that defines the sort order. - -#### Returns -*(Object)*: The sorted suite. - -* * * - - - - - - -### `Benchmark.Suite.prototype.splice(start, deleteCount [, val1, val2, ...])` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L714 "View in source") [Ⓣ][1] - -Allows removing a range of elements and/or inserting elements into the host array. - -#### Arguments -1. `start` *(Number)*: The start index. -2. `deleteCount` *(Number)*: The number of elements to delete. -3. `[val1, val2, ...]` *(Mixed)*: values to insert at the `start` index. - -#### Returns -*(Array)*: An array of removed elements. - -* * * - - - - - - -### `Benchmark.Suite.prototype.unshift()` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L749 "View in source") [Ⓣ][1] - -Appends arguments to the host array. - -#### Returns -*(Number)*: The new length. - -* * * - - - - - - - - - -## `Benchmark.Suite.options` - - - -### `Benchmark.Suite.options` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3705 "View in source") [Ⓣ][1] - -*(Object)*: The default options copied by suite instances. - -* * * - - - - - - -### `Benchmark.Suite.options.name` -# [Ⓢ](https://github.com/bestiejs/benchmark.js/blob/master/benchmark.js#L3713 "View in source") [Ⓣ][1] - -*(String)*: The name of the suite. - -* * * - - - - - - - - - - - [1]: #Benchmark "Jump back to the TOC." \ No newline at end of file diff --git a/src/node_modules/benchmark/package.json b/src/node_modules/benchmark/package.json deleted file mode 100644 index cb6a9f5..0000000 --- a/src/node_modules/benchmark/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_args": [ - [ - "benchmark@1.0.0", - "/media/Github/Vertinext2/src/node_modules/socket.io-adapter/node_modules/socket.io-parser" - ] - ], - "_from": "benchmark@1.0.0", - "_id": "benchmark@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/benchmark", - "_phantomChildren": {}, - "_requested": { - "name": "benchmark", - "raw": "benchmark@1.0.0", - "rawSpec": "1.0.0", - "scope": null, - "spec": "1.0.0", - "type": "version" - }, - "_requiredBy": [ - "/socket.io-adapter/socket.io-parser", - "/socket.io-parser" - ], - "_resolved": "https://registry.npmjs.org/benchmark/-/benchmark-1.0.0.tgz", - "_shasum": "2f1e2fa4c359f11122aa183082218e957e390c73", - "_shrinkwrap": null, - "_spec": "benchmark@1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/socket.io-adapter/node_modules/socket.io-parser", - "author": { - "email": "mathias@benchmarkjs.com", - "name": "Mathias Bynens", - "url": "http://mathiasbynens.be/" - }, - "bugs": { - "email": "bugs@benchmarkjs.com", - "url": "https://github.com/bestiejs/benchmark.js/issues" - }, - "dependencies": {}, - "description": "A benchmarking library that works on nearly all JavaScript platforms, supports high-resolution timers, and returns statistically significant results.", - "devDependencies": {}, - "directories": { - "doc": "./doc", - "test": "./test" - }, - "dist": { - "shasum": "2f1e2fa4c359f11122aa183082218e957e390c73", - "tarball": "http://registry.npmjs.org/benchmark/-/benchmark-1.0.0.tgz" - }, - "engines": [ - "node", - "rhino" - ], - "homepage": "http://benchmarkjs.com/", - "keywords": [ - "benchmark", - "narwhal", - "node", - "performance", - "ringo", - "speed" - ], - "licenses": [ - { - "type": "MIT", - "url": "http://mths.be/mit" - } - ], - "main": "benchmark", - "maintainers": [ - { - "email": "john@fusejs.com", - "name": "jdalton" - }, - { - "email": "mathias@qiwi.be", - "name": "mathias" - } - ], - "name": "benchmark", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/bestiejs/benchmark.js.git" - }, - "version": "1.0.0" -} diff --git a/src/node_modules/benchmark/test/run-test.sh b/src/node_modules/benchmark/test/run-test.sh deleted file mode 100755 index 43424e4..0000000 --- a/src/node_modules/benchmark/test/run-test.sh +++ /dev/null @@ -1,9 +0,0 @@ -cd "$(dirname "$0")" -for cmd in rhino ringo narwhal node; do - echo "" - echo "Testing in $cmd..." - $cmd test.js -done -echo "" -echo "Testing in a browser..." -open index.html diff --git a/src/node_modules/benchmark/test/test.js b/src/node_modules/benchmark/test/test.js deleted file mode 100644 index d694494..0000000 --- a/src/node_modules/benchmark/test/test.js +++ /dev/null @@ -1,2074 +0,0 @@ -;(function(window, undefined) { - 'use strict'; - - /** Use a single load function */ - var load = typeof require == 'function' ? require : window.load; - - /** The `platform` object to check */ - var platform = - window.platform || - load('../vendor/platform.js/platform.js') || - window.platform; - - /** The unit testing framework */ - var QUnit = - window.QUnit || ( - window.setTimeout || (window.addEventListener = window.setTimeout = / /), - window.QUnit = load('../vendor/qunit/qunit/qunit' + (platform.name == 'Narwhal' ? '-1.8.0' : '') + '.js') || window.QUnit, - load('../vendor/qunit-clib/qunit-clib.js'), - (window.addEventListener || 0).test && delete window.addEventListener, - window.QUnit - ); - - /** The `Benchmark` constructor to test */ - var Benchmark = - window.Benchmark || ( - Benchmark = load('../benchmark.js') || window.Benchmark, - Benchmark.Benchmark || Benchmark - ); - - /** API shortcut */ - var forOwn = Benchmark.forOwn; - - /** Used to get property descriptors */ - var getDescriptor = Object.getOwnPropertyDescriptor; - - /** Used to set property descriptors */ - var setDescriptor = Object.defineProperty; - - /** Shortcut used to convert array-like objects to arrays */ - var slice = [].slice; - - /** Used to resolve a value's internal [[Class]] */ - var toString = {}.toString; - - /** Used to check problem JScript properties (a.k.a. the [[DontEnum]] bug) */ - var shadowed = { - 'constructor': 1, - 'hasOwnProperty': 2, - 'isPrototypeOf': 3, - 'propertyIsEnumerable': 4, - 'toLocaleString': 5, - 'toString': 6, - 'valueOf': 7 - }; - - /** Used to flag environments/features */ - var support = { - 'descriptors': !!function() { - try { - var o = {}; - return (setDescriptor(o, o, o), 'value' in getDescriptor(o, o)); - } catch(e) { } - }() - }; - - /*--------------------------------------------------------------------------*/ - - /** - * Skips a given number of tests with a passing result. - * - * @private - * @param {Number} [count=1] The number of tests to skip. - */ - function skipTest(count) { - count || (count = 1); - while (count--) { - ok(true, 'test skipped'); - } - } - - /*--------------------------------------------------------------------------*/ - - // init Benchmark.options.minTime - Benchmark(function() { throw 0; }).run(); - - // set a shorter max time - Benchmark.options.maxTime = Benchmark.options.minTime * 5; - - // explicitly call `QUnit.module()` instead of `module()` - // in case we are in a CLI environment - QUnit.module('Benchmark'); - - (function() { - test('has the default `Benchmark.platform` value', function() { - if (window.document) { - equal(String(Benchmark.platform), navigator.userAgent); - } else { - skipTest(1) - } - }); - - test('supports loading Benchmark.js as a module', function() { - if (window.document && window.require) { - equal((Benchmark2 || {}).version, Benchmark.version); - } else { - skipTest(1) - } - }); - - test('supports loading Platform.js as a module', function() { - if (window.document && window.require) { - var platform = (Benchmark2 || {}).platform || {}; - equal(typeof platform.name, 'string'); - } else { - skipTest(1) - } - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark constructor'); - - (function() { - test('creates a new instance when called without the `new` operator', function() { - ok(Benchmark() instanceof Benchmark); - }); - - test('supports passing an options object', function() { - var bench = Benchmark({ 'name': 'foo', 'fn': function() { } }); - ok(bench.fn && bench.name == 'foo'); - }); - - test('supports passing a "name" and "fn" argument', function() { - var bench = Benchmark('foo', function() { }); - ok(bench.fn && bench.name == 'foo'); - }); - - test('supports passing a "name" argument and an options object', function() { - var bench = Benchmark('foo', { 'fn': function() { } }); - ok(bench.fn && bench.name == 'foo'); - }); - - test('supports passing a "name" argument and an options object', function() { - var bench = Benchmark('foo', function() { }, { 'id': 'bar' }); - ok(bench.fn && bench.name == 'foo' && bench.id == 'bar'); - }); - - test('supports passing an empy string for the "fn" options property', function() { - var bench = Benchmark({ 'fn': '' }).run(); - ok(!bench.error); - }); - - test('detects dead code', function() { - var bench = Benchmark(function() { }).run(); - ok(/setup\(\)/.test(bench.compiled) ? !bench.error : bench.error); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark compilation'); - - (function() { - test('compiles using the default `Function#toString`', function() { - var bench = Benchmark({ - 'setup': function() { var a = 1; }, - 'fn': function() { throw a; }, - 'teardown': function() { a = 2; } - }).run(); - - var compiled = bench.compiled; - if (/setup\(\)/.test(compiled)) { - skipTest(); - } - else { - ok(/var a\s*=\s*1/.test(compiled) && /throw a/.test(compiled) && /a\s*=\s*2/.test(compiled)); - } - }); - - test('compiles using a custom "toString" method', function() { - var bench = Benchmark({ - 'setup': function() { }, - 'fn': function() { }, - 'teardown': function() { } - }); - - bench.setup.toString = function() { return 'var a = 1;' }; - bench.fn.toString = function() { return 'throw a;' }; - bench.teardown.toString = function() { return 'a = 2;' }; - bench.run(); - - var compiled = bench.compiled; - if (/setup\(\)/.test(compiled)) { - skipTest(); - } - else { - ok(/var a\s*=\s*1/.test(compiled) && /throw a/.test(compiled) && /a\s*=\s*2/.test(compiled)); - } - }); - - test('compiles using a string value', function() { - var bench = Benchmark({ - 'setup': 'var a = 1;', - 'fn': 'throw a;', - 'teardown': 'a = 2;' - }).run(); - - var compiled = bench.compiled; - if (/setup\(\)/.test(compiled)) { - skipTest(); - } - else { - ok(/var a\s*=\s*1/.test(compiled) && /throw a/.test(compiled) && /a\s*=\s*2/.test(compiled)); - } - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark test binding'); - - (function() { - var count = 0; - - var tests = { - 'inlined "setup", "fn", and "teardown"': ( - 'if(/ops/.test(this))this._fn=true;' - ), - 'called "fn" and inlined "setup"/"teardown" reached by error': function() { - count++; - if (/ops/.test(this)) { - this._fn = true; - } - }, - 'called "fn" and inlined "setup"/"teardown" reached by `return` statement': function() { - if (/ops/.test(this)) { - this._fn = true; - } - return; - } - }; - - forOwn(tests, function(fn, title) { - test('has correct binding for ' + title, function() { - var bench = Benchmark({ - 'setup': 'if(/ops/.test(this))this._setup=true;', - 'fn': fn, - 'teardown': 'if(/ops/.test(this))this._teardown=true;', - 'onCycle': function() { this.abort(); } - }).run(); - - var compiled = bench.compiled; - if (/setup\(\)/.test(compiled)) { - skipTest(3); - } - else { - ok(bench._setup, 'correct binding for "setup"'); - ok(bench._fn, 'correct binding for "fn"'); - ok(bench._teardown, 'correct binding for "teardown"'); - } - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.deepClone'); - - (function() { - function createCircularObject() { - var result = { - 'foo': { 'b': { 'foo': { 'c': { } } } }, - 'bar': { } - }; - - result.foo.b.foo.c.foo = result; - result.bar.b = result.foo.b; - return result; - } - - function Klass() { - this.a = 1; - } - - Klass.prototype = { 'b': 1 }; - - var notCloneable = { - 'an arguments object': arguments, - 'an element': window.document && document.body, - 'a function': Klass, - 'a Klass instance': new Klass - }; - - var objects = { - 'an array': ['a', 'b', 'c', ''], - 'an array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 }, - 'boolean': false, - 'boolean object': Object(false), - 'an object': { 'a': 0, 'b': 1, 'c': 3 }, - 'an object with object values': { 'a': /a/, 'b': ['B'], 'c': { 'C': 1 } }, - 'null': null, - 'a number': 3, - 'a number object': Object(3), - 'a regexp': /x/gim, - 'a string': 'x', - 'a string object': Object('x'), - 'undefined': undefined - }; - - objects['an array'].length = 5; - - forOwn(objects, function(object, key) { - test('clones ' + key + ' correctly', function() { - var kind = toString.call(object), - clone = Benchmark.deepClone(object); - - if (object == null) { - equal(clone, object); - } else { - deepEqual(clone.valueOf(), object.valueOf()); - } - if (object === Object(object)) { - ok(clone !== object); - } else { - skipTest(); - } - }); - }); - - forOwn(notCloneable, function(object, key) { - test('does not clone ' + key, function() { - ok(Benchmark.deepClone(object) === object); - }); - }); - - test('clones using Klass#deepClone', function() { - var object = new Klass; - Klass.prototype.deepClone = function() { return new Klass; }; - - var clone = Benchmark.deepClone(object); - ok(clone !== object && clone instanceof Klass); - - delete Klass.prototype.clone; - }); - - test('clones problem JScript properties', function() { - var clone = Benchmark.deepClone(shadowed); - deepEqual(clone, shadowed); - }); - - test('clones string object with custom property', function() { - var object = new String('x'); - object.x = 1; - - var clone = Benchmark.deepClone(object); - ok(clone == 'x' && typeof clone == 'object' && clone.x === 1 && toString.call(clone) == '[object String]'); - }); - - test('clones objects with circular references', function() { - var object = createCircularObject(), - clone = Benchmark.deepClone(object); - - ok(clone.bar.b === clone.foo.b && clone === clone.foo.b.foo.c.foo && clone !== object); - }); - - test('clones non-extensible objects with circular references', function() { - if (Object.preventExtensions) { - var object = Object.preventExtensions(createCircularObject()); - Object.preventExtensions(object.bar.b); - - var clone = Benchmark.deepClone(object); - ok(clone.bar.b === clone.foo.b && clone === clone.foo.b.foo.c.foo && clone !== object); - } else { - skipTest(1) - } - }); - - test('clones sealed objects with circular references', function() { - if (Object.seal) { - var object = Object.seal(createCircularObject()); - Object.seal(object.bar.b); - - var clone = Benchmark.deepClone(object); - ok(clone.bar.b === clone.foo.b && clone === clone.foo.b.foo.c.foo && clone !== object); - } else { - skipTest(1) - } - }); - - test('clones frozen objects with circular references', function() { - if (Object.freeze) { - var object = Object.freeze(createCircularObject()); - Object.freeze(object.bar.b); - - var clone = Benchmark.deepClone(object); - ok(clone.bar.b === clone.foo.b && clone === clone.foo.b.foo.c.foo && clone !== object); - } else { - skipTest(1) - } - }); - - test('clones objects with custom descriptors and circular references', function() { - var accessor, - descriptor; - - if (support.descriptors) { - var object = setDescriptor({}, 'foo', { - 'configurable': true, - 'value': setDescriptor({}, 'b', { - 'writable': true, - 'value': setDescriptor({}, 'foo', { - 'get': function() { return accessor; }, - 'set': function(value) { accessor = value; } - }) - }) - }); - - setDescriptor(object, 'bar', { 'value': {} }); - object.foo.b.foo = { 'c': object }; - object.bar.b = object.foo.b; - - var clone = Benchmark.deepClone(object); - ok(clone !== object && - clone.bar.b === clone.foo.b && - clone !== clone.foo.b.foo.c.foo && - (descriptor = getDescriptor(clone, 'foo')) && - descriptor.configurable && !(descriptor.enumerable && descriptor.writable) && - (descriptor = getDescriptor(clone.foo, 'b')) && - descriptor.writable && !(descriptor.configurable && descriptor.enumerable) && - (descriptor = getDescriptor(clone.foo.b, 'foo')) && - descriptor.get && descriptor.set && - (descriptor = getDescriptor(clone.foo.b, 'foo')) && - !(descriptor.configurable && descriptor.enumerable && descriptor.writable) && - (descriptor = getDescriptor(clone, 'bar')) && - !(descriptor.configurable && descriptor.enumerable && descriptor.writable)); - } - else { - skipTest(1) - } - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.each'); - - (function() { - var xpathResult; - - var objects = { - 'array': ['a', 'b', 'c', ''], - 'array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 }, - 'xpath snapshot': null - }; - - if (window.document && document.evaluate) { - xpathResult = [document.documentElement, document.getElementsByTagName('head')[0], document.body]; - objects['xpath snapshot'] = document.evaluate('//*[self::html or self::head or self::body]', document, null, 7, null); - } - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('passes the correct arguments when passing an ' + key, function() { - if (object) { - var args - Benchmark.each(object, function() { - args || (args = slice.call(arguments)); - }); - - if (key == 'xpath snapshot') { - ok(args[0] === xpathResult[0]); - } else { - equal(args[0], 'a'); - } - equal(args[1], 0); - ok(args[2] === object); - } - else { - skipTest(3); - } - }); - - test('returns the passed object when passing an ' + key, function() { - if (object) { - var actual = Benchmark.each(object, function() { }); - ok(actual === object); - } - else { - skipTest(); - } - }); - - test('iterates over all indexes when passing an ' + key, function() { - if (object) { - var values = []; - Benchmark.each(object, function(value) { - values.push(value); - }); - - deepEqual(values, key == 'xpath snapshot' ? xpathResult : ['a', 'b', 'c', '']); - } - else { - skipTest(); - } - }); - - test('exits early when returning `false` when passing an ' + key, function() { - if (object) { - var values = []; - Benchmark.each(object, function(value) { - values.push(value); - return values.length < 2; - }); - - deepEqual(values, key == 'xpath snapshot' ? xpathResult.slice(0, 2) : ['a', 'b']); - } - else { - skipTest(); - } - }); - }); - - test('passes the third callback argument as an object', function() { - var thirdArg; - Benchmark.each('hello', function(value, index, object) { - thirdArg = object; - }); - - ok(thirdArg && typeof thirdArg == 'object'); - }); - - test('iterates over strings by index', function() { - var values = []; - Benchmark.each('hello', function(value) { - values.push(value) - }); - - deepEqual(values, ['h', 'e', 'l', 'l', 'o']); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.extend'); - - (function() { - test('allows no source argument', function() { - var object = {}; - equal(Benchmark.extend(object), object); - }); - - test('allows a single source argument', function() { - var source = { 'x': 1, 'y': 1 }, - actual = Benchmark.extend({}, source); - - deepEqual(Benchmark.extend({}, source), { 'x': 1, 'y': 1 }); - }); - - test('allows multiple source arguments', function() { - var source1 = { 'x': 1, 'y': 1 }, - source2 = { 'y': 2, 'z': 2 }, - actual = Benchmark.extend({}, source1, source2); - - deepEqual(actual, { 'x': 1, 'y': 2, 'z': 2 }); - }); - - test('will add inherited source properties', function() { - function Source() { } - Source.prototype.x = 1; - deepEqual(Benchmark.extend({}, new Source), { 'x': 1 }); - }); - - test('will add problem JScript properties', function() { - deepEqual(Benchmark.extend({}, shadowed), shadowed); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.filter'); - - (function() { - var objects = { - 'array': ['a', 'b', 'c', ''], - 'array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 } - }; - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('passes the correct arguments when passing an ' + key, function() { - var args; - Benchmark.filter(object, function() { - args || (args = slice.call(arguments)); - }); - - deepEqual(args, ['a', 0, object]); - }); - - test('produces the correct result when passing an ' + key, function() { - var actual = Benchmark.filter(object, function(value, index) { - return index > 0; - }); - - deepEqual(actual, ['b', 'c', '']); - }); - - test('iterates over sparse ' + key + 's correctly', function() { - var actual = Benchmark.filter(object, function(value) { - return value === undefined; - }); - - deepEqual(actual, []); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.forOwn'); - - (function() { - function fn() { - // no-op - } - - function KlassA() { - this.a = 1; - this.b = 2; - this.c = 3; - } - - function KlassB() { - this.a = 1; - this.constructor = 2; - this.hasOwnProperty = 3; - this.isPrototypeOf = 4; - this.propertyIsEnumerable = 5; - this.toLocaleString = 6; - this.toString = 7; - this.valueOf = 8; - } - - function KlassC() { - // no-op - } - - fn.a = 1; - fn.b = 2; - fn.c = 3; - - KlassC.prototype.a = 1; - KlassC.prototype.b = 2; - KlassC.prototype.c = 3; - - var objects = { - 'an arguments object': arguments, - 'a function': fn, - 'an object': new KlassA, - 'an object shadowing properties on Object.prototype': new KlassB, - 'a prototype object': KlassC.prototype, - 'a string': 'abc' - }; - - forOwn(objects, function(object, key) { - test('passes the correct arguments when passing ' + key, function() { - var args; - Benchmark.forOwn(object, function() { - args || (args = slice.call(arguments)); - }); - - equal(typeof args[0], key == 'a string' ? 'string' : 'number'); - equal(typeof args[1], 'string'); - equal(args[2] && typeof args[2], key == 'a function' ? 'function' : 'object'); - }); - - test('returns the passed object when passing ' + key, function() { - var actual = Benchmark.forOwn(object, function() { }); - deepEqual(actual, object); - }); - - test('iterates over own properties when passing ' + key, function() { - var values = []; - Benchmark.forOwn(object, function(value) { - values.push(value); - }); - - if (object instanceof KlassB) { - deepEqual(values.sort(), [1, 2, 3, 4, 5, 6, 7, 8]); - } else if (key == 'a string') { - deepEqual(values, ['a', 'b', 'c']); - } else { - deepEqual(values.sort(), [1, 2, 3]); - } - }); - - test('exits early when returning `false` when passing ' + key, function() { - var values = []; - Benchmark.forOwn(object, function(value) { - values.push(value); - return false; - }); - - equal(values.length, 1); - }); - - if (object instanceof KlassB) { - test('exits correctly when transitioning to the JScript [[DontEnum]] fix', function() { - var values = []; - Benchmark.forOwn(object, function(value) { - values.push(value); - return values.length < 2; - }); - - equal(values.length, 2); - }); - } - }); - }(1, 2, 3)); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.formatNumber'); - - (function() { - test('formats a million correctly', function() { - equal(Benchmark.formatNumber(1e6), '1,000,000'); - }); - - test('formats less than 100 correctly', function() { - equal(Benchmark.formatNumber(23), '23'); - }); - - test('formats numbers with decimal values correctly', function() { - equal(Benchmark.formatNumber(1234.56), '1,234.56'); - }); - - test('formats negative numbers correctly', function() { - equal(Benchmark.formatNumber(-1234.56), '-1,234.56'); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.hasKey'); - - (function() { - test('returns `true` for own properties', function() { - var object = { 'x': 1 }; - equal(Benchmark.hasKey(object, 'x'), true); - }); - - test('returns `false` for inherited properties', function() { - equal(Benchmark.hasKey({}, 'toString'), false); - }); - - test('doesn\'t use an object\'s `hasOwnProperty` method', function() { - var object = { 'hasOwnProperty': function() { return true; } }; - equal(Benchmark.hasKey(object, 'x'), false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.indexOf'); - - (function() { - var objects = { - 'array': ['a', 'b', 'c', ''], - 'array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 } - }; - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('produces the correct result when passing an ' + key, function() { - equal(Benchmark.indexOf(object, 'b'), 1); - }); - - test('matches values by strict equality when passing an ' + key, function() { - equal(Benchmark.indexOf(object, new String('b')), -1); - }); - - test('iterates over sparse ' + key + 's correctly', function() { - equal(Benchmark.indexOf(object, undefined), -1); - }); - }); - - test('searches from the given `fromIndex`', function() { - var array = ['a', 'b', 'c', 'a']; - equal(Benchmark.indexOf(array, 'a', 1), 3); - }); - - test('handles extreme negative `fromIndex` values correctly', function() { - var array = ['a']; - array['-1'] = 'z'; - equal(Benchmark.indexOf(array, 'z', -2), -1); - }); - - test('handles extreme positive `fromIndex` values correctly', function() { - var object = { '0': 'a', '1': 'b', '2': 'c', 'length': 2 }; - equal(Benchmark.indexOf(object, 'c', 2), -1); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.interpolate'); - - (function() { - test('replaces tokens correctly', function() { - var actual = Benchmark.interpolate('#{greeting} #{location}.', { - 'greeting': 'Hello', - 'location': 'world' - }); - - equal(actual, 'Hello world.'); - }); - - test('ignores inherited object properties', function() { - var actual = Benchmark.interpolate('x#{toString}', {}); - equal(actual, 'x#{toString}'); - }); - - test('allows for no template object', function() { - var actual = Benchmark.interpolate('x'); - equal(actual, 'x'); - }); - - test('replaces duplicate tokens', function() { - var actual = Benchmark.interpolate('#{x}#{x}#{x}', { 'x': 'a' }); - equal(actual, 'aaa'); - }); - - test('handles keys containing RegExp special characters', function() { - var actual = Benchmark.interpolate('#{.*+?^=!:${}()|[]\\/}', { '.*+?^=!:${}()|[]\\/': 'x' }); - equal(actual, 'x'); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.invoke'); - - (function() { - var objects = { - 'array': ['a', ['b'], 'c', null], - 'array-like-object': { '0': 'a', '1': ['b'], '2': 'c', '3': null, 'length': 5 } - }; - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('produces the correct result when passing an ' + key, function() { - var actual = Benchmark.invoke(object, 'concat'); - deepEqual(actual, ['a', ['b'], 'c', undefined, undefined]); - equal('4' in actual, false); - }); - - test('passes the correct arguments to the invoked method when passing an ' + key, function() { - var actual = Benchmark.invoke(object, 'concat', 'x', 'y', 'z'); - deepEqual(actual, ['axyz', ['b', 'x', 'y', 'z'], 'cxyz', undefined, undefined]); - equal('4' in actual, false); - }); - - test('handles options object with callbacks correctly when passing an ' + key, function() { - function callback() { - callbacks.push(slice.call(arguments)); - } - - var callbacks = []; - var actual = Benchmark.invoke(object, { - 'name': 'concat', - 'args': ['x', 'y', 'z'], - 'onStart': callback, - 'onCycle': callback, - 'onComplete': callback - }); - - deepEqual(actual, ['axyz', ['b', 'x', 'y', 'z'], 'cxyz', undefined, undefined]); - equal('4' in actual, false); - - equal(callbacks[0].length, 1); - equal(callbacks[0][0].target, 'a'); - deepEqual(callbacks[0][0].currentTarget, object); - equal(callbacks[0][0].type, 'start'); - equal(callbacks[1][0].type, 'cycle'); - equal(callbacks[5][0].type, 'complete'); - }); - - test('supports queuing when passing an ' + key, function() { - var lengths = []; - var actual = Benchmark.invoke(object, { - 'name': 'concat', - 'queued': true, - 'args': 'x', - 'onCycle': function() { - lengths.push(object.length); - } - }); - - deepEqual(lengths, [5, 4, 3, 2]); - deepEqual(actual, ['ax', ['b', 'x'], 'cx', undefined, undefined]); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.join'); - - (function() { - var objects = { - 'array': ['a', 'b', ''], - 'array-like-object': { '0': 'a', '1': 'b', '2': '', 'length': 4 }, - 'object': { 'a': '0', 'b': '1', '': '2' } - }; - - objects.array.length = 4; - - forOwn(objects, function(object, key) { - test('joins correctly using the default separator when passing an ' + key, function() { - equal(Benchmark.join(object), key == 'object' ? 'a: 0,b: 1,: 2' : 'a,b,'); - }); - - test('joins correctly using a custom separator when passing an ' + key, function() { - equal(Benchmark.join(object, '+', '@'), key == 'object' ? 'a@0+b@1+@2' : 'a+b+'); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.map'); - - (function() { - var objects = { - 'array': ['a', 'b', 'c', ''], - 'array-like-object': { '0': 'a', '1': 'b', '2': 'c', '3': '', 'length': 5 } - }; - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('passes the correct arguments when passing an ' + key, function() { - var args; - Benchmark.map(object, function() { - args || (args = slice.call(arguments)); - }); - - deepEqual(args, ['a', 0, object]); - }); - - test('produces the correct result when passing an ' + key, function() { - var actual = Benchmark.map(object, function(value, index) { - return value + index; - }); - - deepEqual(actual, ['a0', 'b1', 'c2', '3', undefined]); - equal('4' in actual, false); - }); - - test('produces an array of the correct length for sparse ' + key + 's', function() { - equal(Benchmark.map(object, function() { }).length, 5); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.pluck'); - - (function() { - var objects = { - 'array': [{ '_': 'a' }, { '_': 'b' }, { '_': 'c' }, null], - 'array-like-object': { '0': { '_': 'a' }, '1': { '_': 'b' }, '2': { '_': 'c' }, '3': null, 'length': 5 } - }; - - objects.array.length = 5; - - forOwn(objects, function(object, key) { - test('produces the correct result when passing an ' + key, function() { - var actual = Benchmark.pluck(object, '_'); - deepEqual(actual, ['a', 'b', 'c', undefined, undefined]); - equal('4' in actual, false); - }); - - test('produces the correct result for non-existent keys when passing an ' + key, function() { - var actual = Benchmark.pluck(object, 'non-existent'); - deepEqual(actual, [undefined, undefined, undefined, undefined, undefined]); - equal('4' in actual, false); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.reduce'); - - (function() { - var objects = { - 'array': ['b', 'c', ''], - 'array-like-object': { '0': 'b', '1': 'c', '2': '', 'length': 4 } - }; - - objects.array.length = 4; - - forOwn(objects, function(object, key) { - test('passes the correct arguments when passing an ' + key, function() { - var args; - Benchmark.reduce(object, function() { - args || (args = slice.call(arguments)); - }, 'a'); - - deepEqual(args, ['a', 'b', 0, object]); - }); - - test('accumulates correctly when passing an ' + key, function() { - var actual = Benchmark.reduce(object, function(string, value) { - return string + value; - }, 'a'); - - equal(actual, 'abc'); - }); - - test('handles arguments with no initial value correctly when passing an ' + key, function() { - var args; - Benchmark.reduce(object, function() { - args || (args = slice.call(arguments)); - }); - - deepEqual(args, ['b', 'c', 1, object]); - }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark#clone'); - - (function() { - var bench = Benchmark(function() { this.count += 0; }).run(); - - test('produces the correct result passing no arguments', function() { - var clone = bench.clone(); - deepEqual(clone, bench); - ok(clone.stats != bench.stats && clone.times != bench.times && clone.options != bench.options); - }); - - test('produces the correct result passing a data object', function() { - var clone = bench.clone({ 'fn': '', 'name': 'foo' }); - ok(clone.fn === '' && clone.options.fn === ''); - ok(clone.name == 'foo' && clone.options.name == 'foo'); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark#run'); - - (function() { - var data = { 'onComplete': 0, 'onCycle': 0, 'onStart': 0 }; - - var bench = Benchmark({ - 'fn': function() { - this.count += 0; - }, - 'onStart': function() { - data.onStart++; - }, - 'onComplete': function() { - data.onComplete++; - } - }) - .run(); - - test('onXYZ callbacks should not be triggered by internal benchmark clones', function() { - equal(data.onStart, 1); - equal(data.onComplete, 1); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - forOwn({ - 'Benchmark': Benchmark, - 'Benchmark.Suite': Benchmark.Suite - }, - function(Constructor, namespace) { - - QUnit.module(namespace + '#emit'); - - (function() { - test('emits passed arguments', function() { - var args, - object = Constructor(); - - object.on('args', function() { args = slice.call(arguments, 1); }); - object.emit('args', 'a', 'b', 'c'); - deepEqual(args, ['a', 'b', 'c']); - }); - - test('emits with no listeners', function() { - var event = Benchmark.Event('empty'), - object = Constructor(); - - object.emit(event); - equal(event.cancelled, false); - }); - - test('emits with an event type of "toString"', function() { - var event = Benchmark.Event('toString'), - object = Constructor(); - - object.emit(event); - equal(event.cancelled, false); - }); - - test('returns the last listeners returned value', function() { - var event = Benchmark.Event('result'), - object = Constructor(); - - object.on('result', function() { return 'x'; }); - object.on('result', function() { return 'y'; }); - equal(object.emit(event), 'y'); - }); - - test('aborts the emitters listener iteration when `event.aborted` is `true`', function() { - var event = Benchmark.Event('aborted'), - object = Constructor(); - - object.on('aborted', function(event) { - event.aborted = true; - return false; - }); - - object.on('aborted', function(event) { - // should not get here - event.aborted = false; - return true; - }); - - equal(object.emit(event), false); - equal(event.aborted, true); - }); - - test('cancels the event if a listener explicitly returns `false`', function() { - var event = Benchmark.Event('cancel'), - object = Constructor(); - - object.on('cancel', function() { return false; }); - object.on('cancel', function() { return true; }); - object.emit(event); - equal(event.cancelled, true); - }); - - test('uses a shallow clone of the listeners when emitting', function() { - var event, - listener2 = function(eventObject) { eventObject.listener2 = true }, - object = Constructor(); - - object.on('shallowclone', function(eventObject) { - event = eventObject; - object.off(event.type, listener2); - }) - .on('shallowclone', listener2) - .emit('shallowclone'); - - ok(event.listener2); - }); - - test('emits a custom event object', function() { - var event = Benchmark.Event('custom'), - object = Constructor(); - - object.on('custom', function(eventObject) { eventObject.touched = true; }); - object.emit(event); - ok(event.touched); - }); - - test('sets `event.result` correctly', function() { - var event = Benchmark.Event('result'), - object = Constructor(); - - object.on('result', function() { return 'x'; }); - object.emit(event); - equal(event.result, 'x'); - }); - - test('sets `event.type` correctly', function() { - var event, - object = Constructor(); - - object.on('type', function(eventObj) { - event = eventObj; - }); - - object.emit('type'); - equal(event.type, 'type'); - }); - }()); - - /*------------------------------------------------------------------------*/ - - QUnit.module(namespace + '#listeners'); - - (function() { - test('returns the correct listeners', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - deepEqual(object.listeners('x'), [listener]); - }); - - test('returns an array and initializes previously uninitialized listeners', function() { - var object = Constructor(); - deepEqual(object.listeners('x'), []); - deepEqual(object.events, { 'x': [] }); - }); - }()); - - /*------------------------------------------------------------------------*/ - - QUnit.module(namespace + '#off'); - - (function() { - test('returns the benchmark', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - equal(object.off('x', listener), object); - }); - - test('will ignore inherited properties of the event cache', function() { - var Dummy = function() { }, - listener = function() { }, - object = Constructor(); - - Dummy.prototype.x = [listener]; - object.events = new Dummy; - - object.off('x', listener); - deepEqual(object.events.x, [listener]); - }); - - test('handles an event type and listener', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - object.off('x', listener); - deepEqual(object.events.x, []); - }); - - test('handles unregistering duplicate listeners', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - object.on('x', listener); - - var events = object.events; - object.off('x', listener); - deepEqual(events.x, [listener]); - - object.off('x', listener); - deepEqual(events.x, []); - }); - - test('handles a non-registered listener', function() { - var object = Constructor(); - object.off('x', function() { }); - equal(object.events, undefined); - }); - - test('handles space separated event type and listener', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - object.on('y', listener); - - var events = object.events; - object.off('x y', listener); - deepEqual(events.x, []); - deepEqual(events.y, []); - }); - - test('handles space separated event type and no listener', function() { - var listener1 = function() { }, - listener2 = function() { }, - object = Constructor(); - - object.on('x', listener1); - object.on('y', listener2); - - var events = object.events; - object.off('x y'); - deepEqual(events.x, []); - deepEqual(events.y, []); - }); - - test('handles no arguments', function() { - var listener1 = function() { }, - listener2 = function() { }, - listener3 = function() { }, - object = Constructor(); - - object.on('x', listener1); - object.on('y', listener2); - object.on('z', listener3); - - var events = object.events; - object.off(); - deepEqual(events.x, []); - deepEqual(events.y, []); - deepEqual(events.z, []); - }); - }()); - - /*------------------------------------------------------------------------*/ - - QUnit.module(namespace + '#on'); - - (function() { - test('returns the benchmark', function() { - var listener = function() { }, - object = Constructor(); - - equal(object.on('x', listener), object); - }); - - test('will ignore inherited properties of the event cache', function() { - var Dummy = function() { }, - listener1 = function() { }, - listener2 = function() { }, - object = Constructor(); - - Dummy.prototype.x = [listener1]; - object.events = new Dummy; - - object.on('x', listener2); - deepEqual(object.events.x, [listener2]); - }); - - test('handles an event type and listener', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - deepEqual(object.events.x, [listener]); - }); - - test('handles registering duplicate listeners', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x', listener); - object.on('x', listener); - deepEqual(object.events.x, [listener, listener]); - }); - - test('handles space separated event type and listener', function() { - var listener = function() { }, - object = Constructor(); - - object.on('x y', listener); - - var events = object.events; - deepEqual(events.x, [listener]); - deepEqual(events.y, [listener]); - }); - }()); - }); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#abort'); - - (function() { - test('igores abort calls when the suite isn\'t running', function() { - var fired = false; - var suite = Benchmark.Suite('suite', { - 'onAbort': function() { fired = true; } - }); - - suite.add('foo', function() { }); - suite.abort(); - equal(fired, false); - }); - - test('ignores abort calls from `Benchmark.Suite#reset` when the suite isn\'t running', function() { - var fired = false; - var suite = Benchmark.Suite('suite', { - 'onAbort': function() { fired = true; } - }); - - suite.add('foo', function() { }); - suite.reset(); - equal(fired, false); - }); - - asyncTest('emits an abort event when running', function() { - var fired = false; - - Benchmark.Suite({ - 'onAbort': function() { fired = true; } - }) - .on('start', function() { - this.abort(); - }) - .on('complete', function() { - ok(fired); - QUnit.start(); - }) - .add(function(){ }) - .run({ 'async': true }); - }); - - asyncTest('emits an abort event after calling `Benchmark.Suite#reset`', function() { - var fired = false; - - Benchmark.Suite({ - 'onAbort': function() { fired = true; } - }) - .on('start', function() { - this.reset(); - }) - .on('complete', function() { - ok(fired); - QUnit.start(); - }) - .add(function(){ }) - .run({ 'async': true }); - }); - - asyncTest('should abort deferred benchmark', function() { - var fired = false, - suite = Benchmark.Suite(); - - suite.on('complete', function() { - equal(fired, false); - QUnit.start(); - }) - .add('a', { - 'defer': true, - 'fn': function(deferred) { - // avoid test inlining - suite.name; - // delay resolve - setTimeout(function() { - deferred.resolve(); - suite.abort(); - }, 10); - } - }) - .add('b', { - 'defer': true, - 'fn': function(deferred) { - // avoid test inlining - suite.name; - // delay resolve - setTimeout(function() { - deferred.resolve(); - fired = true; - }, 10); - } - }) - .run(); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#concat'); - - (function() { - var args = arguments; - - test('doesn\'t treat an arguments object like an array', function() { - var suite = Benchmark.Suite(); - deepEqual(suite.concat(args), [args]); - }); - - test('flattens array arguments', function() { - var suite = Benchmark.Suite(); - deepEqual(suite.concat([1, 2], 3, [4, 5]), [1, 2, 3, 4, 5]); - }); - - test('supports concating sparse arrays', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[2] = 2; - suite.length = 3; - - var actual = suite.concat(3); - deepEqual(actual, [0, undefined, 2, 3]); - equal('1' in actual, false); - }); - - test('supports sparse arrays as arguments', function() { - var suite = Benchmark.Suite(), - sparse = []; - - sparse[0] = 0; - sparse[2] = 2; - sparse.length = 3; - - var actual = suite.concat(sparse); - deepEqual(actual, [0, undefined, 2]); - equal('1' in actual, false); - }); - - test('creates a new array', function() { - var suite = Benchmark.Suite(); - ok(suite.concat(1) !== suite); - }); - }(1, 2, 3)); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#reverse'); - - (function() { - test('reverses the element order', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 1; - suite.length = 2; - - var actual = suite.reverse(); - equal(actual, suite); - deepEqual(slice.call(actual), [1, 0]); - }); - - test('supports reversing sparse arrays', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[2] = 2; - suite.length = 3; - - var actual = suite.reverse(); - equal(actual, suite); - deepEqual(slice.call(actual), [2, undefined, 0]); - equal('1' in actual, false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#shift'); - - (function() { - test('removes the first element', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 1; - suite.length = 2; - - var actual = suite.shift(); - equal(actual, 0); - deepEqual(slice.call(suite), [1]); - }); - - test('shifts an object with no elements', function() { - var suite = Benchmark.Suite(), - actual = suite.shift(); - - equal(actual, undefined); - deepEqual(slice.call(suite), []); - }); - - test('should have no elements when length is 0 after shift', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite.length = 1; - suite.shift(); - - // ensure element is removed - equal('0' in suite, false); - equal(suite.length, 0); - }); - - test('supports shifting sparse arrays', function() { - var suite = Benchmark.Suite(); - suite[1] = 1; - suite[3] = 3; - suite.length = 4; - - var actual = suite.shift(); - equal(actual, undefined); - deepEqual(slice.call(suite), [1, undefined, 3]); - equal('1' in suite, false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#slice'); - - (function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 1; - suite[2] = 2; - suite[3] = 3; - suite.length = 4; - - test('works with no arguments', function() { - var actual = suite.slice(); - deepEqual(actual, [0, 1, 2, 3]); - ok(suite !== actual); - }); - - test('works with positive `start` argument', function() { - var actual = suite.slice(2); - deepEqual(actual, [2, 3]); - ok(suite !== actual); - }); - - test('works with positive `start` and `end` arguments', function() { - var actual = suite.slice(1, 3); - deepEqual(actual, [1, 2]); - ok(suite !== actual); - }); - - test('works with `end` values exceeding length', function() { - var actual = suite.slice(1, 10); - deepEqual(actual, [1, 2, 3]); - ok(suite !== actual); - }); - - test('works with negative `start` and `end` arguments', function() { - var actual = suite.slice(-3, -1); - deepEqual(actual, [1, 2]); - ok(suite !== actual); - }); - - test('works with an extreme negative `end` value', function() { - var actual = suite.slice(1, -10); - deepEqual(actual, []); - equal('-1' in actual, false); - ok(suite !== actual); - }); - - test('supports slicing sparse arrays', function() { - var sparse = Benchmark.Suite(); - sparse[1] = 1; - sparse[3] = 3; - sparse.length = 4; - - var actual = sparse.slice(0, 2); - deepEqual(actual, [undefined, 1]); - equal('0' in actual, false); - - actual = sparse.slice(1); - deepEqual(actual, [1, undefined, 3]); - equal('1' in actual, false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#splice'); - - (function() { - test('works with no arguments', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite.length = 1; - - var actual = suite.splice(); - deepEqual(actual, []); - deepEqual(slice.call(suite), [0]); - }); - - test('works with only the `start` argument', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 1; - suite.length = 2; - - var actual = suite.splice(1); - deepEqual(actual, [1]); - deepEqual(slice.call(suite), [0]); - }); - - test('should have no elements when length is 0 after splice', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite.length = 1 - suite.splice(0, 1); - - // ensure element is removed - equal('0' in suite, false); - equal(suite.length, 0); - }); - - test('works with positive `start` argument', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 3; - suite.length = 2; - - var actual = suite.splice(1, 0, 1, 2); - deepEqual(actual, []); - deepEqual(slice.call(suite), [0, 1, 2, 3]); - }); - - test('works with positive `start` and `deleteCount` arguments', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 3; - suite.length = 2; - - var actual = suite.splice(1, 1, 1, 2); - deepEqual(actual, [3]); - deepEqual(slice.call(suite), [0, 1, 2]); - }); - - test('works with `deleteCount` values exceeding length', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 3; - suite.length = 2; - - var actual = suite.splice(1, 10, 1, 2); - deepEqual(actual, [3]); - deepEqual(slice.call(suite), [0, 1, 2]); - }); - - test('works with negative `start` and `deleteCount` arguments', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 3; - suite.length = 2; - - var actual = suite.splice(-1, -1, 1, 2); - deepEqual(actual, []); - deepEqual(slice.call(suite), [0, 1, 2, 3]); - }); - - test('works with an extreme negative `deleteCount` value', function() { - var suite = Benchmark.Suite(); - suite[0] = 0; - suite[1] = 3; - suite.length = 2; - - var actual = suite.splice(0, -10, 1, 2); - deepEqual(actual, []); - deepEqual(slice.call(suite), [1, 2, 0, 3]); - }); - - test('supports splicing sparse arrays', function() { - var suite = Benchmark.Suite(); - suite[1] = 1; - suite[3] = 3; - suite.length = 4; - - var actual = suite.splice(1, 2, 1, 2); - deepEqual(actual, [1, undefined]); - equal(actual.length, 2); - deepEqual(slice.call(suite), [undefined, 1, 2, 3]); - equal('0' in suite, false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite#unshift'); - - (function() { - test('adds a first element', function() { - var suite = Benchmark.Suite(); - suite[0] = 1; - suite.length = 1; - - var actual = suite.unshift(0); - equal(actual, 2); - deepEqual(slice.call(suite), [0, 1]); - }); - - test('adds multiple elements to the front', function() { - var suite = Benchmark.Suite(); - suite[0] = 3; - suite.length = 1; - - var actual = suite.unshift(0, 1, 2); - equal(actual, 4); - deepEqual(slice.call(suite), [0, 1, 2, 3]); - }); - - test('supports unshifting sparse arrays', function() { - var suite = Benchmark.Suite(); - suite[1] = 2; - suite.length = 2; - - var actual = suite.unshift(0); - equal(actual, 3); - deepEqual(slice.call(suite), [0, undefined, 2]); - equal('1' in suite, false); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite filtered results onComplete'); - - (function() { - var count = 0, - suite = Benchmark.Suite(); - - suite.add('a', function() { - count++; - }) - .add('b', function() { - for (var i = 0; i < 1e6; i++) { - count++; - } - }) - .add('c', function() { - throw new TypeError; - }); - - asyncTest('should filter by fastest', function() { - suite.on('complete', function() { - suite.off(); - deepEqual(this.filter('fastest').pluck('name'), ['a']); - QUnit.start(); - }) - .run({ 'async': true }); - }); - - asyncTest('should filter by slowest', function() { - suite.on('complete', function() { - suite.off(); - deepEqual(this.filter('slowest').pluck('name'), ['b']); - QUnit.start(); - }) - .run({ 'async': true }); - }); - - asyncTest('should filter by successful', function() { - suite.on('complete', function() { - suite.off(); - deepEqual(this.filter('successful').pluck('name'), ['a', 'b']); - QUnit.start(); - }) - .run({ 'async': true }); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.Suite event flow'); - - (function() { - var events = [], - callback = function(event) { events.push(event); }; - - var suite = Benchmark.Suite('suite', { - 'onAdd': callback, - 'onAbort': callback, - 'onClone': callback, - 'onError': callback, - 'onStart': callback, - 'onCycle': callback, - 'onComplete': callback, - 'onReset': callback - }) - .add('bench', function() { - throw null; - }, { - 'onAbort': callback, - 'onClone': callback, - 'onError': callback, - 'onStart': callback, - 'onCycle': callback, - 'onComplete': callback, - 'onReset': callback - }) - .run({ 'async': false }); - - // first Suite#onAdd - test('should emit the suite "add" event first', function() { - var event = events[0]; - ok(event.type == 'add' && event.currentTarget.name == 'suite' && event.target.name == 'bench'); - }); - - // next we start the Suite because no reset was needed - test('should emit the suite "start" event', function() { - var event = events[1]; - ok(event.type == 'start' && event.currentTarget.name == 'suite' && event.target.name == 'bench'); - }); - - // and so start the first benchmark - test('should emit the benchmark "start" event', function() { - var event = events[2]; - ok(event.type == 'start' && event.currentTarget.name == 'bench'); - }); - - // oh no! we abort because of an error - test('should emit the benchmark "error" event', function() { - var event = events[3]; - ok(event.type == 'error' && event.currentTarget.name == 'bench'); - }); - - // benchmark error triggered - test('should emit the benchmark "abort" event', function() { - var event = events[4]; - ok(event.type == 'abort' && event.currentTarget.name == 'bench'); - }); - - // we reset the benchmark as part of the abort - test('should emit the benchmark "reset" event', function() { - var event = events[5]; - ok(event.type == 'reset' && event.currentTarget.name == 'bench'); - }); - - // benchmark is cycle is finished - test('should emit the benchmark "cycle" event', function() { - var event = events[6]; - ok(event.type == 'cycle' && event.currentTarget.name == 'bench'); - }); - - // benchmark is complete - test('should emit the benchmark "complete" event', function() { - var event = events[7]; - ok(event.type == 'complete' && event.currentTarget.name == 'bench'); - }); - - // the benchmark error triggers a Suite error - test('should emit the suite "error" event', function() { - var event = events[8]; - ok(event.type == 'error' && event.currentTarget.name == 'suite' && event.target.name == 'bench'); - }); - - // the Suite cycle finishes - test('should emit the suite "cycle" event', function() { - var event = events[9]; - ok(event.type == 'cycle' && event.currentTarget.name == 'suite' && event.target.name == 'bench'); - }); - - // the Suite completes - test('finally it should emit the suite "complete" event', function() { - var event = events[10]; - ok(event.type == 'complete' && event.currentTarget.name == 'suite' && event.target.name == 'bench'); - }); - - test('emitted all expected events', function() { - ok(events.length == 11); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Deferred benchmarks'); - - (function() { - asyncTest('should run a deferred benchmark correctly', function() { - Benchmark(function(deferred) { - setTimeout(function() { deferred.resolve(); }, 1e3); - }, { - 'defer': true, - 'onComplete': function() { - equal(this.hz.toFixed(0), 1); - QUnit.start(); - } - }) - .run(); - }); - - asyncTest('should run with string values for "fn", "setup", and "teardown"', function() { - Benchmark({ - 'defer': true, - 'setup': 'var x = [3, 2, 1];', - 'fn': 'setTimeout(function() { x.sort(); deferred.resolve(); }, 10);', - 'teardown': 'x.length = 0;', - 'onComplete': function() { - ok(true); - QUnit.start(); - } - }) - .run(); - }); - - asyncTest('should run recursively', function() { - Benchmark({ - 'defer': true, - 'setup': 'var x = [3, 2, 1];', - 'fn': 'for (var i = 0; i < 100; i++) x[ i % 2 ? "sort" : "reverse" ](); deferred.resolve();', - 'teardown': 'x.length = 0;', - 'onComplete': function() { - ok(true); - QUnit.start(); - } - }) - .run(); - }); - - asyncTest('should execute "setup", "fn", and "teardown" in correct order', function() { - var fired = []; - - Benchmark({ - 'defer': true, - 'setup': function() { - fired.push('setup'); - }, - 'fn': function(deferred) { - fired.push('fn'); - setTimeout(function() { deferred.resolve(); }, 10); - }, - 'teardown': function() { - fired.push('teardown'); - }, - 'onComplete': function() { - var actual = fired.join().replace(/(fn,)+/g, '$1').replace(/(setup,fn,teardown(?:,|$))+/, '$1'); - equal(actual, 'setup,fn,teardown'); - QUnit.start(); - } - }) - .run(); - }); - }()); - - /*--------------------------------------------------------------------------*/ - - QUnit.module('Benchmark.deepClone'); - - (function() { - asyncTest('avoids call stack limits', function() { - var result, - count = 0, - object = {}, - recurse = function() { count++; recurse(); }; - - setTimeout(function() { - ok(result, 'avoids call stack limits (stack limit is ' + (count - 1) + ')'); - QUnit.start(); - }, 15); - - if (toString.call(window.java) == '[object JavaPackage]') { - // Java throws uncatchable errors on call stack overflows, so to avoid - // them I chose a number higher than Rhino's call stack limit without - // dynamically testing for the actual limit - count = 3e3; - } else { - try { recurse(); } catch(e) { } - } - - // exceed limit - count++; - for (var i = 0, sub = object; i <= count; i++) { - sub = sub[i] = {}; - } - - try { - for (var i = 0, sub = Benchmark.deepClone(object); sub = sub[i]; i++) { } - result = --i == count; - } catch(e) { } - }); - }()); - - /*--------------------------------------------------------------------------*/ - - // explicitly call `QUnit.start()` for Narwhal, Rhino, and RingoJS - if (!window.document) { - QUnit.start(); - } -}(typeof global == 'object' && global || this)); diff --git a/src/node_modules/better-assert/.npmignore b/src/node_modules/better-assert/.npmignore deleted file mode 100644 index f1250e5..0000000 --- a/src/node_modules/better-assert/.npmignore +++ /dev/null @@ -1,4 +0,0 @@ -support -test -examples -*.sock diff --git a/src/node_modules/better-assert/History.md b/src/node_modules/better-assert/History.md deleted file mode 100644 index cbb579b..0000000 --- a/src/node_modules/better-assert/History.md +++ /dev/null @@ -1,15 +0,0 @@ - -1.0.0 / 2013-02-03 -================== - - * Stop using the removed magic __stack global getter - -0.1.0 / 2012-10-04 -================== - - * add throwing of AssertionError for test frameworks etc - -0.0.1 / 2010-01-03 -================== - - * Initial release diff --git a/src/node_modules/better-assert/Makefile b/src/node_modules/better-assert/Makefile deleted file mode 100644 index 36a3ed7..0000000 --- a/src/node_modules/better-assert/Makefile +++ /dev/null @@ -1,5 +0,0 @@ - -test: - @echo "populate me" - -.PHONY: test \ No newline at end of file diff --git a/src/node_modules/better-assert/Readme.md b/src/node_modules/better-assert/Readme.md deleted file mode 100644 index d8d3a63..0000000 --- a/src/node_modules/better-assert/Readme.md +++ /dev/null @@ -1,61 +0,0 @@ - -# better-assert - - Better c-style assertions using [callsite](https://github.com/visionmedia/callsite) for - self-documenting failure messages. - -## Installation - - $ npm install better-assert - -## Example - - By default assertions are enabled, however the __NO_ASSERT__ environment variable - will deactivate them when truthy. - -```js -var assert = require('better-assert'); - -test(); - -function test() { - var user = { name: 'tobi' }; - assert('tobi' == user.name); - assert('number' == typeof user.age); -} - -AssertionError: 'number' == typeof user.age - at test (/Users/tj/projects/better-assert/example.js:9:3) - at Object. (/Users/tj/projects/better-assert/example.js:4:1) - at Module._compile (module.js:449:26) - at Object.Module._extensions..js (module.js:467:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - at Module.runMain (module.js:492:10) - at process.startup.processNextTick.process._tickCallback (node.js:244:9) -``` - -## License - -(The MIT License) - -Copyright (c) 2012 TJ Holowaychuk <tj@vision-media.ca> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/src/node_modules/better-assert/example.js b/src/node_modules/better-assert/example.js deleted file mode 100644 index 688c29e..0000000 --- a/src/node_modules/better-assert/example.js +++ /dev/null @@ -1,10 +0,0 @@ - -var assert = require('./'); - -test(); - -function test() { - var user = { name: 'tobi' }; - assert('tobi' == user.name); - assert('number' == typeof user.age); -} \ No newline at end of file diff --git a/src/node_modules/better-assert/index.js b/src/node_modules/better-assert/index.js deleted file mode 100644 index fd1c9b7..0000000 --- a/src/node_modules/better-assert/index.js +++ /dev/null @@ -1,38 +0,0 @@ -/** - * Module dependencies. - */ - -var AssertionError = require('assert').AssertionError - , callsite = require('callsite') - , fs = require('fs') - -/** - * Expose `assert`. - */ - -module.exports = process.env.NO_ASSERT - ? function(){} - : assert; - -/** - * Assert the given `expr`. - */ - -function assert(expr) { - if (expr) return; - - var stack = callsite(); - var call = stack[1]; - var file = call.getFileName(); - var lineno = call.getLineNumber(); - var src = fs.readFileSync(file, 'utf8'); - var line = src.split('\n')[lineno-1]; - var src = line.match(/assert\((.*)\)/)[1]; - - var err = new AssertionError({ - message: src, - stackStartFunction: stack[0].getFunction() - }); - - throw err; -} diff --git a/src/node_modules/better-assert/package.json b/src/node_modules/better-assert/package.json deleted file mode 100644 index c969920..0000000 --- a/src/node_modules/better-assert/package.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "_args": [ - [ - "better-assert@~1.0.0", - "/media/Github/Vertinext2/src/node_modules/parsejson" - ] - ], - "_from": "better-assert@>=1.0.0 <1.1.0", - "_id": "better-assert@1.0.2", - "_inCache": true, - "_installable": true, - "_location": "/better-assert", - "_npmUser": { - "email": "coolhzb@163.com", - "name": "tony_ado" - }, - "_npmVersion": "1.4.9", - "_phantomChildren": {}, - "_requested": { - "name": "better-assert", - "raw": "better-assert@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/engine.io-client/parseuri", - "/parsejson", - "/parseqs", - "/parseuri" - ], - "_resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", - "_shasum": "40866b9e1b9e0b55b481894311e68faffaebc522", - "_shrinkwrap": null, - "_spec": "better-assert@~1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/parsejson", - "author": { - "email": "tj@vision-media.ca", - "name": "TJ Holowaychuk" - }, - "bugs": { - "url": "https://github.com/visionmedia/better-assert/issues" - }, - "contributors": [ - { - "email": "coolhzb@163.com", - "name": "TonyHe" - }, - { - "name": "ForbesLindesay" - } - ], - "dependencies": { - "callsite": "1.0.0" - }, - "description": "Better assertions for node, reporting the expr, filename, lineno etc", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "40866b9e1b9e0b55b481894311e68faffaebc522", - "tarball": "http://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz" - }, - "engines": { - "node": "*" - }, - "homepage": "https://github.com/visionmedia/better-assert", - "keywords": [ - "assert", - "stack", - "trace", - "debug" - ], - "main": "index", - "maintainers": [ - { - "email": "tj@vision-media.ca", - "name": "tjholowaychuk" - }, - { - "email": "coolhzb@163.com", - "name": "tony_ado" - } - ], - "name": "better-assert", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/visionmedia/better-assert.git" - }, - "version": "1.0.2" -} diff --git a/src/node_modules/binary-extensions/binary-extensions.json b/src/node_modules/binary-extensions/binary-extensions.json deleted file mode 100644 index 7b200f9..0000000 --- a/src/node_modules/binary-extensions/binary-extensions.json +++ /dev/null @@ -1,188 +0,0 @@ -[ - "3ds", - "3g2", - "3gp", - "7z", - "a", - "aac", - "adp", - "ai", - "aif", - "apk", - "ar", - "asf", - "au", - "avi", - "bak", - "bin", - "bk", - "bmp", - "btif", - "bz2", - "cab", - "caf", - "cgm", - "cmx", - "cpio", - "cr2", - "dat", - "deb", - "djvu", - "dll", - "dmg", - "dng", - "doc", - "docx", - "dra", - "DS_Store", - "dsk", - "dts", - "dtshd", - "dvb", - "dwg", - "dxf", - "ecelp4800", - "ecelp7470", - "ecelp9600", - "egg", - "eol", - "eot", - "epub", - "exe", - "f4v", - "fbs", - "fh", - "fla", - "flac", - "fli", - "flv", - "fpx", - "fst", - "fvt", - "g3", - "gif", - "gz", - "h261", - "h263", - "h264", - "ico", - "ief", - "img", - "ipa", - "iso", - "jar", - "jpeg", - "jpg", - "jpgv", - "jpm", - "jxr", - "ktx", - "lvp", - "lz", - "lzma", - "lzo", - "m3u", - "m4a", - "m4v", - "mar", - "mdi", - "mid", - "mj2", - "mka", - "mkv", - "mmr", - "mng", - "mov", - "movie", - "mp3", - "mp4", - "mp4a", - "mpeg", - "mpg", - "mpga", - "mxu", - "nef", - "npx", - "o", - "oga", - "ogg", - "ogv", - "otf", - "pbm", - "pcx", - "pdf", - "pea", - "pgm", - "pic", - "png", - "pnm", - "ppm", - "psd", - "pya", - "pyc", - "pyo", - "pyv", - "qt", - "rar", - "ras", - "raw", - "rgb", - "rip", - "rlc", - "rz", - "s3m", - "s7z", - "scpt", - "sgi", - "shar", - "sil", - "smv", - "so", - "sub", - "swf", - "tar", - "tbz2", - "tga", - "tgz", - "tif", - "tiff", - "tlz", - "ts", - "ttf", - "uvh", - "uvi", - "uvm", - "uvp", - "uvs", - "uvu", - "viv", - "vob", - "war", - "wav", - "wax", - "wbmp", - "wdp", - "weba", - "webm", - "webp", - "whl", - "wm", - "wma", - "wmv", - "wmx", - "woff", - "woff2", - "wvx", - "xbm", - "xif", - "xls", - "xlsx", - "xm", - "xpi", - "xpm", - "xwd", - "xz", - "z", - "zip", - "zipx" -] diff --git a/src/node_modules/binary-extensions/license b/src/node_modules/binary-extensions/license deleted file mode 100644 index 654d0bf..0000000 --- a/src/node_modules/binary-extensions/license +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) Sindre Sorhus (sindresorhus.com) - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/src/node_modules/binary-extensions/package.json b/src/node_modules/binary-extensions/package.json deleted file mode 100644 index c7cee4b..0000000 --- a/src/node_modules/binary-extensions/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - "binary-extensions@^1.0.0", - "/media/Github/Vertinext2/src/node_modules/is-binary-path" - ] - ], - "_from": "binary-extensions@>=1.0.0 <2.0.0", - "_id": "binary-extensions@1.4.0", - "_inCache": true, - "_installable": true, - "_location": "/binary-extensions", - "_nodeVersion": "4.2.1", - "_npmUser": { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - "_npmVersion": "2.14.7", - "_phantomChildren": {}, - "_requested": { - "name": "binary-extensions", - "raw": "binary-extensions@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/is-binary-path" - ], - "_resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.4.0.tgz", - "_shasum": "d733ccb628986d7b326d88656e0ddbd3aac351b7", - "_shrinkwrap": null, - "_spec": "binary-extensions@^1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/is-binary-path", - "author": { - "email": "sindresorhus@gmail.com", - "name": "Sindre Sorhus", - "url": "sindresorhus.com" - }, - "bugs": { - "url": "https://github.com/sindresorhus/binary-extensions/issues" - }, - "dependencies": {}, - "description": "List of binary file extensions", - "devDependencies": { - "ava": "0.0.4" - }, - "directories": {}, - "dist": { - "shasum": "d733ccb628986d7b326d88656e0ddbd3aac351b7", - "tarball": "http://registry.npmjs.org/binary-extensions/-/binary-extensions-1.4.0.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "binary-extensions.json" - ], - "gitHead": "8c3a781127ff15ee516c8bedda97807e4dddf1ff", - "homepage": "https://github.com/sindresorhus/binary-extensions", - "keywords": [ - "bin", - "binary", - "ext", - "extensions", - "extension", - "file", - "json", - "list", - "array" - ], - "license": "MIT", - "main": "binary-extensions.json", - "maintainers": [ - { - "email": "sindresorhus@gmail.com", - "name": "sindresorhus" - }, - { - "email": "paul@paulmillr.com", - "name": "paulmillr" - }, - { - "email": "elan.shanker+npm@gmail.com", - "name": "es128" - }, - { - "email": "contact@arthurverschaeve.be", - "name": "arthurvr" - } - ], - "name": "binary-extensions", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/sindresorhus/binary-extensions.git" - }, - "scripts": { - "test": "node test.js" - }, - "version": "1.4.0" -} diff --git a/src/node_modules/binary-extensions/readme.md b/src/node_modules/binary-extensions/readme.md deleted file mode 100644 index 4f8f284..0000000 --- a/src/node_modules/binary-extensions/readme.md +++ /dev/null @@ -1,33 +0,0 @@ -# binary-extensions [![Build Status](https://travis-ci.org/sindresorhus/binary-extensions.svg?branch=master)](https://travis-ci.org/sindresorhus/binary-extensions) - -> List of binary file extensions - -The list is just a [JSON file](binary-extensions.json) and can be used wherever. - - -## Install - -``` -$ npm install --save binary-extensions -``` - - -## Usage - -```js -var binaryExtensions = require('binary-extensions'); - -console.log(binaryExtensions); -//=> ['3ds', '3g2', ...] -``` - - -## Related - -- [`is-binary-path`](https://github.com/sindresorhus/is-binary-path) - Check if a filepath is a binary file -- [`text-extensions`](https://github.com/sindresorhus/text-extensions) - List of text file extensions - - -## License - -MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/src/node_modules/bindings/README.md b/src/node_modules/bindings/README.md deleted file mode 100644 index 585cf51..0000000 --- a/src/node_modules/bindings/README.md +++ /dev/null @@ -1,97 +0,0 @@ -node-bindings -============= -### Helper module for loading your native module's .node file - -This is a helper module for authors of Node.js native addon modules. -It is basically the "swiss army knife" of `require()`ing your native module's -`.node` file. - -Throughout the course of Node's native addon history, addons have ended up being -compiled in a variety of different places, depending on which build tool and which -version of node was used. To make matters worse, now the _gyp_ build tool can -produce either a _Release_ or _Debug_ build, each being built into different -locations. - -This module checks _all_ the possible locations that a native addon would be built -at, and returns the first one that loads successfully. - - -Installation ------------- - -Install with `npm`: - -``` bash -$ npm install bindings -``` - -Or add it to the `"dependencies"` section of your _package.json_ file. - - -Example -------- - -`require()`ing the proper bindings file for the current node version, platform -and architecture is as simple as: - -``` js -var bindings = require('bindings')('binding.node') - -// Use your bindings defined in your C files -bindings.your_c_function() -``` - - -Nice Error Output ------------------ - -When the `.node` file could not be loaded, `node-bindings` throws an Error with -a nice error message telling you exactly what was tried. You can also check the -`err.tries` Array property. - -``` -Error: Could not load the bindings file. Tried: - → /Users/nrajlich/ref/build/binding.node - → /Users/nrajlich/ref/build/Debug/binding.node - → /Users/nrajlich/ref/build/Release/binding.node - → /Users/nrajlich/ref/out/Debug/binding.node - → /Users/nrajlich/ref/Debug/binding.node - → /Users/nrajlich/ref/out/Release/binding.node - → /Users/nrajlich/ref/Release/binding.node - → /Users/nrajlich/ref/build/default/binding.node - → /Users/nrajlich/ref/compiled/0.8.2/darwin/x64/binding.node - at bindings (/Users/nrajlich/ref/node_modules/bindings/bindings.js:84:13) - at Object. (/Users/nrajlich/ref/lib/ref.js:5:47) - at Module._compile (module.js:449:26) - at Object.Module._extensions..js (module.js:467:10) - at Module.load (module.js:356:32) - at Function.Module._load (module.js:312:12) - ... -``` - - -License -------- - -(The MIT License) - -Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net> - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -'Software'), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be -included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/src/node_modules/bindings/bindings.js b/src/node_modules/bindings/bindings.js deleted file mode 100644 index 93dcf85..0000000 --- a/src/node_modules/bindings/bindings.js +++ /dev/null @@ -1,166 +0,0 @@ - -/** - * Module dependencies. - */ - -var fs = require('fs') - , path = require('path') - , join = path.join - , dirname = path.dirname - , exists = fs.existsSync || path.existsSync - , defaults = { - arrow: process.env.NODE_BINDINGS_ARROW || ' → ' - , compiled: process.env.NODE_BINDINGS_COMPILED_DIR || 'compiled' - , platform: process.platform - , arch: process.arch - , version: process.versions.node - , bindings: 'bindings.node' - , try: [ - // node-gyp's linked version in the "build" dir - [ 'module_root', 'build', 'bindings' ] - // node-waf and gyp_addon (a.k.a node-gyp) - , [ 'module_root', 'build', 'Debug', 'bindings' ] - , [ 'module_root', 'build', 'Release', 'bindings' ] - // Debug files, for development (legacy behavior, remove for node v0.9) - , [ 'module_root', 'out', 'Debug', 'bindings' ] - , [ 'module_root', 'Debug', 'bindings' ] - // Release files, but manually compiled (legacy behavior, remove for node v0.9) - , [ 'module_root', 'out', 'Release', 'bindings' ] - , [ 'module_root', 'Release', 'bindings' ] - // Legacy from node-waf, node <= 0.4.x - , [ 'module_root', 'build', 'default', 'bindings' ] - // Production "Release" buildtype binary (meh...) - , [ 'module_root', 'compiled', 'version', 'platform', 'arch', 'bindings' ] - ] - } - -/** - * The main `bindings()` function loads the compiled bindings for a given module. - * It uses V8's Error API to determine the parent filename that this function is - * being invoked from, which is then used to find the root directory. - */ - -function bindings (opts) { - - // Argument surgery - if (typeof opts == 'string') { - opts = { bindings: opts } - } else if (!opts) { - opts = {} - } - opts.__proto__ = defaults - - // Get the module root - if (!opts.module_root) { - opts.module_root = exports.getRoot(exports.getFileName()) - } - - // Ensure the given bindings name ends with .node - if (path.extname(opts.bindings) != '.node') { - opts.bindings += '.node' - } - - var tries = [] - , i = 0 - , l = opts.try.length - , n - , b - , err - - for (; i=1.2.0 <1.3.0", - "_id": "bindings@1.2.1", - "_inCache": true, - "_installable": true, - "_location": "/bindings", - "_npmUser": { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - }, - "_npmVersion": "1.4.14", - "_phantomChildren": {}, - "_requested": { - "name": "bindings", - "raw": "bindings@1.2.x", - "rawSpec": "1.2.x", - "scope": null, - "spec": ">=1.2.0 <1.3.0", - "type": "range" - }, - "_requiredBy": [ - "/bufferutil", - "/utf-8-validate" - ], - "_resolved": "https://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz", - "_shasum": "14ad6113812d2d37d72e67b4cacb4bb726505f11", - "_shrinkwrap": null, - "_spec": "bindings@1.2.x", - "_where": "/media/Github/Vertinext2/src/node_modules/bufferutil", - "author": { - "email": "nathan@tootallnate.net", - "name": "Nathan Rajlich", - "url": "http://tootallnate.net" - }, - "bugs": { - "url": "https://github.com/TooTallNate/node-bindings/issues" - }, - "dependencies": {}, - "description": "Helper module for loading your native module's .node file", - "devDependencies": {}, - "directories": {}, - "dist": { - "shasum": "14ad6113812d2d37d72e67b4cacb4bb726505f11", - "tarball": "http://registry.npmjs.org/bindings/-/bindings-1.2.1.tgz" - }, - "gitHead": "e404152ee27f8478ccbc7122ee051246e8e5ec02", - "homepage": "https://github.com/TooTallNate/node-bindings", - "keywords": [ - "native", - "addon", - "bindings", - "gyp", - "waf", - "c", - "c++" - ], - "license": "MIT", - "main": "./bindings.js", - "maintainers": [ - { - "email": "nathan@tootallnate.net", - "name": "TooTallNate" - }, - { - "email": "nathan@tootallnate.net", - "name": "tootallnate" - } - ], - "name": "bindings", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/TooTallNate/node-bindings.git" - }, - "scripts": {}, - "version": "1.2.1" -} diff --git a/src/node_modules/bl/.jshintrc b/src/node_modules/bl/.jshintrc deleted file mode 100644 index c8ef3ca..0000000 --- a/src/node_modules/bl/.jshintrc +++ /dev/null @@ -1,59 +0,0 @@ -{ - "predef": [ ] - , "bitwise": false - , "camelcase": false - , "curly": false - , "eqeqeq": false - , "forin": false - , "immed": false - , "latedef": false - , "noarg": true - , "noempty": true - , "nonew": true - , "plusplus": false - , "quotmark": true - , "regexp": false - , "undef": true - , "unused": true - , "strict": false - , "trailing": true - , "maxlen": 120 - , "asi": true - , "boss": true - , "debug": true - , "eqnull": true - , "esnext": true - , "evil": true - , "expr": true - , "funcscope": false - , "globalstrict": false - , "iterator": false - , "lastsemic": true - , "laxbreak": true - , "laxcomma": true - , "loopfunc": true - , "multistr": false - , "onecase": false - , "proto": false - , "regexdash": false - , "scripturl": true - , "smarttabs": false - , "shadow": false - , "sub": true - , "supernew": false - , "validthis": true - , "browser": true - , "couch": false - , "devel": false - , "dojo": false - , "mootools": false - , "node": true - , "nonstandard": true - , "prototypejs": false - , "rhino": false - , "worker": true - , "wsh": false - , "nomen": false - , "onevar": false - , "passfail": false -} \ No newline at end of file diff --git a/src/node_modules/bl/.npmignore b/src/node_modules/bl/.npmignore deleted file mode 100644 index 40b878d..0000000 --- a/src/node_modules/bl/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules/ \ No newline at end of file diff --git a/src/node_modules/bl/.travis.yml b/src/node_modules/bl/.travis.yml deleted file mode 100644 index 5cb0480..0000000 --- a/src/node_modules/bl/.travis.yml +++ /dev/null @@ -1,13 +0,0 @@ -sudo: false -language: node_js -node_js: - - '0.10' - - '0.12' - - '4' - - '5' -branches: - only: - - master -notifications: - email: - - rod@vagg.org diff --git a/src/node_modules/bl/LICENSE.md b/src/node_modules/bl/LICENSE.md deleted file mode 100644 index ccb2479..0000000 --- a/src/node_modules/bl/LICENSE.md +++ /dev/null @@ -1,13 +0,0 @@ -The MIT License (MIT) -===================== - -Copyright (c) 2014 bl contributors ----------------------------------- - -*bl contributors listed at * - -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/src/node_modules/bl/README.md b/src/node_modules/bl/README.md deleted file mode 100644 index 4d87866..0000000 --- a/src/node_modules/bl/README.md +++ /dev/null @@ -1,200 +0,0 @@ -# bl *(BufferList)* - -[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl) - -**A Node.js Buffer list collector, reader and streamer thingy.** - -[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/) -[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/) - -**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them! - -The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently. - -```js -const BufferList = require('bl') - -var bl = new BufferList() -bl.append(new Buffer('abcd')) -bl.append(new Buffer('efg')) -bl.append('hi') // bl will also accept & convert Strings -bl.append(new Buffer('j')) -bl.append(new Buffer([ 0x3, 0x4 ])) - -console.log(bl.length) // 12 - -console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij' -console.log(bl.slice(3, 10).toString('ascii')) // 'defghij' -console.log(bl.slice(3, 6).toString('ascii')) // 'def' -console.log(bl.slice(3, 8).toString('ascii')) // 'defgh' -console.log(bl.slice(5, 10).toString('ascii')) // 'fghij' - -// or just use toString! -console.log(bl.toString()) // 'abcdefghij\u0003\u0004' -console.log(bl.toString('ascii', 3, 8)) // 'defgh' -console.log(bl.toString('ascii', 5, 10)) // 'fghij' - -// other standard Buffer readables -console.log(bl.readUInt16BE(10)) // 0x0304 -console.log(bl.readUInt16LE(10)) // 0x0403 -``` - -Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**: - -```js -const bl = require('bl') - , fs = require('fs') - -fs.createReadStream('README.md') - .pipe(bl(function (err, data) { // note 'new' isn't strictly required - // `data` is a complete Buffer object containing the full data - console.log(data.toString()) - })) -``` - -Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream. - -Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!): -```js -const hyperquest = require('hyperquest') - , bl = require('bl') - , url = 'https://raw.github.com/rvagg/bl/master/README.md' - -hyperquest(url).pipe(bl(function (err, data) { - console.log(data.toString()) -})) -``` - -Or, use it as a readable stream to recompose a list of Buffers to an output source: - -```js -const BufferList = require('bl') - , fs = require('fs') - -var bl = new BufferList() -bl.append(new Buffer('abcd')) -bl.append(new Buffer('efg')) -bl.append(new Buffer('hi')) -bl.append(new Buffer('j')) - -bl.pipe(fs.createWriteStream('gibberish.txt')) -``` - -## API - - * new BufferList([ callback ]) - * bl.length - * bl.append(buffer) - * bl.get(index) - * bl.slice([ start[, end ] ]) - * bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) - * bl.duplicate() - * bl.consume(bytes) - * bl.toString([encoding, [ start, [ end ]]]) - * bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - * Streams - --------------------------------------------------------- - -### new BufferList([ callback | buffer | buffer array ]) -The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream. - -Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object. - -`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with: - -```js -var bl = require('bl') -var myinstance = bl() - -// equivilant to: - -var BufferList = require('bl') -var myinstance = new BufferList() -``` - --------------------------------------------------------- - -### bl.length -Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list. - --------------------------------------------------------- - -### bl.append(buffer) -`append(buffer)` adds an additional buffer or BufferList to the internal list. - --------------------------------------------------------- - -### bl.get(index) -`get()` will return the byte at the specified index. - --------------------------------------------------------- - -### bl.slice([ start, [ end ] ]) -`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively. - -If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer. - --------------------------------------------------------- - -### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ]) -`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively. - --------------------------------------------------------- - -### bl.duplicate() -`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example: - -```js -var bl = new BufferList() - -bl.append('hello') -bl.append(' world') -bl.append('\n') - -bl.duplicate().pipe(process.stdout, { end: false }) - -console.log(bl.toString()) -``` - --------------------------------------------------------- - -### bl.consume(bytes) -`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers—initial offsets will be calculated accordingly in order to give you a consistent view of the data. - --------------------------------------------------------- - -### bl.toString([encoding, [ start, [ end ]]]) -`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information. - --------------------------------------------------------- - -### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8() - -All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently. - -See the [Buffer](http://nodejs.org/docs/latest/api/buffer.html) documentation for how these work. - --------------------------------------------------------- - -### Streams -**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance. - --------------------------------------------------------- - -## Contributors - -**bl** is brought to you by the following hackers: - - * [Rod Vagg](https://github.com/rvagg) - * [Matteo Collina](https://github.com/mcollina) - * [Jarett Cruger](https://github.com/jcrugzz) - -======= - - -## License & copyright - -Copyright (c) 2013-2014 bl contributors (listed above). - -bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details. diff --git a/src/node_modules/bl/bl.js b/src/node_modules/bl/bl.js deleted file mode 100644 index 6f27330..0000000 --- a/src/node_modules/bl/bl.js +++ /dev/null @@ -1,227 +0,0 @@ -var DuplexStream = require('readable-stream/duplex') - , util = require('util') - -function BufferList (callback) { - if (!(this instanceof BufferList)) - return new BufferList(callback) - - this._bufs = [] - this.length = 0 - - if (typeof callback == 'function') { - this._callback = callback - - var piper = function (err) { - if (this._callback) { - this._callback(err) - this._callback = null - } - }.bind(this) - - this.on('pipe', function (src) { - src.on('error', piper) - }) - this.on('unpipe', function (src) { - src.removeListener('error', piper) - }) - } - else if (Buffer.isBuffer(callback)) - this.append(callback) - else if (Array.isArray(callback)) { - callback.forEach(function (b) { - Buffer.isBuffer(b) && this.append(b) - }.bind(this)) - } - - DuplexStream.call(this) -} - -util.inherits(BufferList, DuplexStream) - -BufferList.prototype._offset = function (offset) { - var tot = 0, i = 0, _t - for (; i < this._bufs.length; i++) { - _t = tot + this._bufs[i].length - if (offset < _t) - return [ i, offset - tot ] - tot = _t - } -} - -BufferList.prototype.append = function (buf) { - var isBuffer = Buffer.isBuffer(buf) || - buf instanceof BufferList - - // coerce number arguments to strings, since Buffer(number) does - // uninitialized memory allocation - if (typeof buf == 'number') - buf = buf.toString() - - if (buf instanceof BufferList) { - this._bufs.push.apply(this._bufs, buf._bufs) - this.length += buf.length - } else { - this._bufs.push(isBuffer ? buf : new Buffer(buf)) - this.length += buf.length - } - - return this -} - -BufferList.prototype._write = function (buf, encoding, callback) { - this.append(buf) - if (callback) - callback() -} - -BufferList.prototype._read = function (size) { - if (!this.length) - return this.push(null) - size = Math.min(size, this.length) - this.push(this.slice(0, size)) - this.consume(size) -} - -BufferList.prototype.end = function (chunk) { - DuplexStream.prototype.end.call(this, chunk) - - if (this._callback) { - this._callback(null, this.slice()) - this._callback = null - } -} - -BufferList.prototype.get = function (index) { - return this.slice(index, index + 1)[0] -} - -BufferList.prototype.slice = function (start, end) { - return this.copy(null, 0, start, end) -} - -BufferList.prototype.copy = function (dst, dstStart, srcStart, srcEnd) { - if (typeof srcStart != 'number' || srcStart < 0) - srcStart = 0 - if (typeof srcEnd != 'number' || srcEnd > this.length) - srcEnd = this.length - if (srcStart >= this.length) - return dst || new Buffer(0) - if (srcEnd <= 0) - return dst || new Buffer(0) - - var copy = !!dst - , off = this._offset(srcStart) - , len = srcEnd - srcStart - , bytes = len - , bufoff = (copy && dstStart) || 0 - , start = off[1] - , l - , i - - // copy/slice everything - if (srcStart === 0 && srcEnd == this.length) { - if (!copy) // slice, just return a full concat - return Buffer.concat(this._bufs) - - // copy, need to copy individual buffers - for (i = 0; i < this._bufs.length; i++) { - this._bufs[i].copy(dst, bufoff) - bufoff += this._bufs[i].length - } - - return dst - } - - // easy, cheap case where it's a subset of one of the buffers - if (bytes <= this._bufs[off[0]].length - start) { - return copy - ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes) - : this._bufs[off[0]].slice(start, start + bytes) - } - - if (!copy) // a slice, we need something to copy in to - dst = new Buffer(len) - - for (i = off[0]; i < this._bufs.length; i++) { - l = this._bufs[i].length - start - - if (bytes > l) { - this._bufs[i].copy(dst, bufoff, start) - } else { - this._bufs[i].copy(dst, bufoff, start, start + bytes) - break - } - - bufoff += l - bytes -= l - - if (start) - start = 0 - } - - return dst -} - -BufferList.prototype.toString = function (encoding, start, end) { - return this.slice(start, end).toString(encoding) -} - -BufferList.prototype.consume = function (bytes) { - while (this._bufs.length) { - if (bytes >= this._bufs[0].length) { - bytes -= this._bufs[0].length - this.length -= this._bufs[0].length - this._bufs.shift() - } else { - this._bufs[0] = this._bufs[0].slice(bytes) - this.length -= bytes - break - } - } - return this -} - -BufferList.prototype.duplicate = function () { - var i = 0 - , copy = new BufferList() - - for (; i < this._bufs.length; i++) - copy.append(this._bufs[i]) - - return copy -} - -BufferList.prototype.destroy = function () { - this._bufs.length = 0; - this.length = 0; - this.push(null); -} - -;(function () { - var methods = { - 'readDoubleBE' : 8 - , 'readDoubleLE' : 8 - , 'readFloatBE' : 4 - , 'readFloatLE' : 4 - , 'readInt32BE' : 4 - , 'readInt32LE' : 4 - , 'readUInt32BE' : 4 - , 'readUInt32LE' : 4 - , 'readInt16BE' : 2 - , 'readInt16LE' : 2 - , 'readUInt16BE' : 2 - , 'readUInt16LE' : 2 - , 'readInt8' : 1 - , 'readUInt8' : 1 - } - - for (var m in methods) { - (function (m) { - BufferList.prototype[m] = function (offset) { - return this.slice(offset, offset + methods[m])[m](0) - } - }(m)) - } -}()) - -module.exports = BufferList diff --git a/src/node_modules/bl/package.json b/src/node_modules/bl/package.json deleted file mode 100644 index 2f17480..0000000 --- a/src/node_modules/bl/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_args": [ - [ - "bl@~1.0.0", - "/media/Github/Vertinext2/src/node_modules/request" - ] - ], - "_from": "bl@>=1.0.0 <1.1.0", - "_id": "bl@1.0.3", - "_inCache": true, - "_installable": true, - "_location": "/bl", - "_nodeVersion": "5.6.0", - "_npmOperationalInternal": { - "host": "packages-5-east.internal.npmjs.com", - "tmp": "tmp/bl-1.0.3.tgz_1455187279627_0.9823597683571279" - }, - "_npmUser": { - "email": "rod@vagg.org", - "name": "rvagg" - }, - "_npmVersion": "3.6.0", - "_phantomChildren": {}, - "_requested": { - "name": "bl", - "raw": "bl@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/request" - ], - "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.3.tgz", - "_shasum": "fc5421a28fd4226036c3b3891a66a25bc64d226e", - "_shrinkwrap": null, - "_spec": "bl@~1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/request", - "authors": [ - "Rod Vagg (https://github.com/rvagg)", - "Matteo Collina (https://github.com/mcollina)", - "Jarett Cruger (https://github.com/jcrugzz)" - ], - "bugs": { - "url": "https://github.com/rvagg/bl/issues" - }, - "dependencies": { - "readable-stream": "~2.0.5" - }, - "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!", - "devDependencies": { - "faucet": "0.0.1", - "hash_file": "~0.1.1", - "tape": "~4.4.0" - }, - "directories": {}, - "dist": { - "shasum": "fc5421a28fd4226036c3b3891a66a25bc64d226e", - "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.3.tgz" - }, - "gitHead": "906e0dd6e811c9989a2c1d46fcca22c8da9f8f5b", - "homepage": "https://github.com/rvagg/bl", - "keywords": [ - "buffer", - "buffers", - "stream", - "awesomesauce" - ], - "license": "MIT", - "main": "bl.js", - "maintainers": [ - { - "email": "rod@vagg.org", - "name": "rvagg" - } - ], - "name": "bl", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/rvagg/bl.git" - }, - "scripts": { - "test": "node test/test.js | faucet" - }, - "version": "1.0.3" -} diff --git a/src/node_modules/bl/test/test.js b/src/node_modules/bl/test/test.js deleted file mode 100644 index 2f0c6d3..0000000 --- a/src/node_modules/bl/test/test.js +++ /dev/null @@ -1,571 +0,0 @@ -var tape = require('tape') - , crypto = require('crypto') - , fs = require('fs') - , hash = require('hash_file') - , BufferList = require('../') - - , encodings = - ('hex utf8 utf-8 ascii binary base64' - + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ') - -tape('single bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - - t.end() -}) - -tape('single bytes from multiple buffers', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.get(0), 97) - t.equal(bl.get(1), 98) - t.equal(bl.get(2), 99) - t.equal(bl.get(3), 100) - t.equal(bl.get(4), 101) - t.equal(bl.get(5), 102) - t.equal(bl.get(6), 103) - t.equal(bl.get(7), 104) - t.equal(bl.get(8), 105) - t.equal(bl.get(9), 106) - t.end() -}) - -tape('multi bytes from single buffer', function (t) { - var bl = new BufferList() - bl.append(new Buffer('abcd')) - - t.equal(bl.length, 4) - - t.equal(bl.slice(0, 4).toString('ascii'), 'abcd') - t.equal(bl.slice(0, 3).toString('ascii'), 'abc') - t.equal(bl.slice(1, 4).toString('ascii'), 'bcd') - - t.end() -}) - -tape('multiple bytes from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('multiple bytes from multiple buffer lists', function (t) { - var bl = new BufferList() - - bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')])) - bl.append(new BufferList([new Buffer('hi'), new Buffer('j')])) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - t.equal(bl.slice(3, 10).toString('ascii'), 'defghij') - t.equal(bl.slice(3, 6).toString('ascii'), 'def') - t.equal(bl.slice(3, 8).toString('ascii'), 'defgh') - t.equal(bl.slice(5, 10).toString('ascii'), 'fghij') - - t.end() -}) - -tape('consuming from multiple buffers', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.length, 10) - - t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij') - - bl.consume(3) - t.equal(bl.length, 7) - t.equal(bl.slice(0, 7).toString('ascii'), 'defghij') - - bl.consume(2) - t.equal(bl.length, 5) - t.equal(bl.slice(0, 5).toString('ascii'), 'fghij') - - bl.consume(1) - t.equal(bl.length, 4) - t.equal(bl.slice(0, 4).toString('ascii'), 'ghij') - - bl.consume(1) - t.equal(bl.length, 3) - t.equal(bl.slice(0, 3).toString('ascii'), 'hij') - - bl.consume(2) - t.equal(bl.length, 1) - t.equal(bl.slice(0, 1).toString('ascii'), 'j') - - t.end() -}) - -tape('complete consumption', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('a')) - bl.append(new Buffer('b')) - - bl.consume(2) - - t.equal(bl.length, 0) - t.equal(bl._bufs.length, 0) - - t.end() -}) - -tape('test readUInt8 / readInt8', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt8(2), 0x3) - t.equal(bl.readInt8(2), 0x3) - t.equal(bl.readUInt8(3), 0x4) - t.equal(bl.readInt8(3), 0x4) - t.equal(bl.readUInt8(4), 0x23) - t.equal(bl.readInt8(4), 0x23) - t.equal(bl.readUInt8(5), 0x42) - t.equal(bl.readInt8(5), 0x42) - t.end() -}) - -tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt16BE(2), 0x0304) - t.equal(bl.readUInt16LE(2), 0x0403) - t.equal(bl.readInt16BE(2), 0x0304) - t.equal(bl.readInt16LE(2), 0x0403) - t.equal(bl.readUInt16BE(3), 0x0423) - t.equal(bl.readUInt16LE(3), 0x2304) - t.equal(bl.readInt16BE(3), 0x0423) - t.equal(bl.readInt16LE(3), 0x2304) - t.equal(bl.readUInt16BE(4), 0x2342) - t.equal(bl.readUInt16LE(4), 0x4223) - t.equal(bl.readInt16BE(4), 0x2342) - t.equal(bl.readInt16LE(4), 0x4223) - t.end() -}) - -tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x3 - buf2[2] = 0x4 - buf3[0] = 0x23 - buf3[1] = 0x42 - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readUInt32BE(2), 0x03042342) - t.equal(bl.readUInt32LE(2), 0x42230403) - t.equal(bl.readInt32BE(2), 0x03042342) - t.equal(bl.readInt32LE(2), 0x42230403) - t.end() -}) - -tape('test readFloatLE / readFloatBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(3) - , bl = new BufferList() - - buf2[1] = 0x00 - buf2[2] = 0x00 - buf3[0] = 0x80 - buf3[1] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readFloatLE(2), 0x01) - t.end() -}) - -tape('test readDoubleLE / readDoubleBE', function (t) { - var buf1 = new Buffer(1) - , buf2 = new Buffer(3) - , buf3 = new Buffer(10) - , bl = new BufferList() - - buf2[1] = 0x55 - buf2[2] = 0x55 - buf3[0] = 0x55 - buf3[1] = 0x55 - buf3[2] = 0x55 - buf3[3] = 0x55 - buf3[4] = 0xd5 - buf3[5] = 0x3f - - bl.append(buf1) - bl.append(buf2) - bl.append(buf3) - - t.equal(bl.readDoubleLE(2), 0.3333333333333333) - t.end() -}) - -tape('test toString', function (t) { - var bl = new BufferList() - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - - t.equal(bl.toString('ascii', 0, 10), 'abcdefghij') - t.equal(bl.toString('ascii', 3, 10), 'defghij') - t.equal(bl.toString('ascii', 3, 6), 'def') - t.equal(bl.toString('ascii', 3, 8), 'defgh') - t.equal(bl.toString('ascii', 5, 10), 'fghij') - - t.end() -}) - -tape('test toString encoding', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append(new Buffer('abcd')) - bl.append(new Buffer('efg')) - bl.append(new Buffer('hi')) - bl.append(new Buffer('j')) - bl.append(new Buffer('\xff\x00')) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc), enc) - }) - - t.end() -}) - -!process.browser && tape('test stream', function (t) { - var random = crypto.randomBytes(65534) - , rndhash = hash(random, 'md5') - , md5sum = crypto.createHash('md5') - , bl = new BufferList(function (err, buf) { - t.ok(Buffer.isBuffer(buf)) - t.ok(err === null) - t.equal(rndhash, hash(bl.slice(), 'md5')) - t.equal(rndhash, hash(buf, 'md5')) - - bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat')) - .on('close', function () { - var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat') - s.on('data', md5sum.update.bind(md5sum)) - s.on('end', function() { - t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!') - t.end() - }) - }) - - }) - - fs.writeFileSync('/tmp/bl_test_rnd.dat', random) - fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl) -}) - -tape('instantiation with Buffer', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = crypto.randomBytes(1024) - , b = BufferList(buf) - - t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer') - b = BufferList([ buf, buf2 ]) - t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer') - t.end() -}) - -tape('test String appendage', function (t) { - var bl = new BufferList() - , b = new Buffer('abcdefghij\xff\x00') - - bl.append('abcd') - bl.append('efg') - bl.append('hi') - bl.append('j') - bl.append('\xff\x00') - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('test Number appendage', function (t) { - var bl = new BufferList() - , b = new Buffer('1234567890') - - bl.append(1234) - bl.append(567) - bl.append(89) - bl.append(0) - - encodings.forEach(function (enc) { - t.equal(bl.toString(enc), b.toString(enc)) - }) - - t.end() -}) - -tape('write nothing, should get empty buffer', function (t) { - t.plan(3) - BufferList(function (err, data) { - t.notOk(err, 'no error') - t.ok(Buffer.isBuffer(data), 'got a buffer') - t.equal(0, data.length, 'got a zero-length buffer') - t.end() - }).end() -}) - -tape('unicode string', function (t) { - t.plan(2) - var inp1 = '\u2600' - , inp2 = '\u2603' - , exp = inp1 + ' and ' + inp2 - , bl = BufferList() - bl.write(inp1) - bl.write(' and ') - bl.write(inp2) - t.equal(exp, bl.toString()) - t.equal(new Buffer(exp).toString('hex'), bl.toString('hex')) -}) - -tape('should emit finish', function (t) { - var source = BufferList() - , dest = BufferList() - - source.write('hello') - source.pipe(dest) - - dest.on('finish', function () { - t.equal(dest.toString('utf8'), 'hello') - t.end() - }) -}) - -tape('basic copy', function (t) { - var buf = crypto.randomBytes(1024) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy after many appends', function (t) { - var buf = crypto.randomBytes(512) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2) - t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy at a precise position', function (t) { - var buf = crypto.randomBytes(1004) - , buf2 = new Buffer(1024) - , b = BufferList(buf) - - b.copy(buf2, 20) - t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer') - t.end() -}) - -tape('copy starting from a precise location', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(5) - , b = BufferList(buf) - - b.copy(buf2, 0, 5) - t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy in an interval', function (t) { - var rnd = crypto.randomBytes(10) - , b = BufferList(rnd) // put the random bytes there - , actual = new Buffer(3) - , expected = new Buffer(3) - - rnd.copy(expected, 0, 5, 8) - b.copy(actual, 0, 5, 8) - - t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer') - t.end() -}) - -tape('copy an interval between two buffers', function (t) { - var buf = crypto.randomBytes(10) - , buf2 = new Buffer(10) - , b = BufferList(buf) - - b.append(buf) - b.copy(buf2, 0, 5, 15) - - t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer') - t.end() -}) - -tape('duplicate', function (t) { - t.plan(2) - - var bl = new BufferList('abcdefghij\xff\x00') - , dup = bl.duplicate() - - t.equal(bl.prototype, dup.prototype) - t.equal(bl.toString('hex'), dup.toString('hex')) -}) - -tape('destroy no pipe', function (t) { - t.plan(2) - - var bl = new BufferList('alsdkfja;lsdkfja;lsdk') - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) -}) - -!process.browser && tape('destroy with pipe before read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/test.js') - .pipe(bl) - - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - -}) - -!process.browser && tape('destroy with pipe before read end with race', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/test.js') - .pipe(bl) - - setTimeout(function () { - bl.destroy() - setTimeout(function () { - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - }, 500) - }, 500) -}) - -!process.browser && tape('destroy with pipe after read end', function (t) { - t.plan(2) - - var bl = new BufferList() - fs.createReadStream(__dirname + '/test.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.destroy() - - t.equal(bl._bufs.length, 0) - t.equal(bl.length, 0) - } -}) - -!process.browser && tape('destroy with pipe while writing to a destination', function (t) { - t.plan(4) - - var bl = new BufferList() - , ds = new BufferList() - - fs.createReadStream(__dirname + '/test.js') - .on('end', onEnd) - .pipe(bl) - - function onEnd () { - bl.pipe(ds) - - setTimeout(function () { - bl.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - ds.destroy() - - t.equals(bl._bufs.length, 0) - t.equals(bl.length, 0) - - }, 100) - } -}) - -!process.browser && tape('handle error', function (t) { - t.plan(2) - fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) { - t.ok(err instanceof Error, 'has error') - t.notOk(data, 'no data') - })) -}) diff --git a/src/node_modules/blob/.npmignore b/src/node_modules/blob/.npmignore deleted file mode 100644 index 548a368..0000000 --- a/src/node_modules/blob/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules -blob.js diff --git a/src/node_modules/blob/.zuul.yml b/src/node_modules/blob/.zuul.yml deleted file mode 100644 index 380c395..0000000 --- a/src/node_modules/blob/.zuul.yml +++ /dev/null @@ -1,14 +0,0 @@ -ui: mocha-bdd -browsers: - - name: chrome - version: 8..latest - - name: firefox - version: 7..latest - - name: safari - version: 6..latest - - name: opera - version: 12.1..latest - - name: ie - version: 10..latest - - name: android - version: latest diff --git a/src/node_modules/blob/Makefile b/src/node_modules/blob/Makefile deleted file mode 100644 index 7d9601a..0000000 --- a/src/node_modules/blob/Makefile +++ /dev/null @@ -1,14 +0,0 @@ -REPORTER = dot - -build: blob.js - -blob.js: - @./node_modules/.bin/browserify --standalone blob index.js > blob.js - -test: - @./node_modules/.bin/zuul -- test/index.js - -clean: - rm blob.js - -.PHONY: test blob.js diff --git a/src/node_modules/blob/README.md b/src/node_modules/blob/README.md deleted file mode 100644 index 6915955..0000000 --- a/src/node_modules/blob/README.md +++ /dev/null @@ -1,14 +0,0 @@ -Blob -==== - -A module that exports a constructor that uses window.Blob when available, and a BlobBuilder with any vendor prefix in other cases. If neither is available, it exports undefined. - -Usage: - -```javascript -var Blob = require('blob'); -var b = new Blob(['hi', 'constructing', 'a', 'blob']); -``` - -## Licence -MIT diff --git a/src/node_modules/blob/index.js b/src/node_modules/blob/index.js deleted file mode 100644 index cad3f84..0000000 --- a/src/node_modules/blob/index.js +++ /dev/null @@ -1,96 +0,0 @@ -/** - * Create a blob builder even when vendor prefixes exist - */ - -var BlobBuilder = global.BlobBuilder - || global.WebKitBlobBuilder - || global.MSBlobBuilder - || global.MozBlobBuilder; - -/** - * Check if Blob constructor is supported - */ - -var blobSupported = (function() { - try { - var a = new Blob(['hi']); - return a.size === 2; - } catch(e) { - return false; - } -})(); - -/** - * Check if Blob constructor supports ArrayBufferViews - * Fails in Safari 6, so we need to map to ArrayBuffers there. - */ - -var blobSupportsArrayBufferView = blobSupported && (function() { - try { - var b = new Blob([new Uint8Array([1,2])]); - return b.size === 2; - } catch(e) { - return false; - } -})(); - -/** - * Check if BlobBuilder is supported - */ - -var blobBuilderSupported = BlobBuilder - && BlobBuilder.prototype.append - && BlobBuilder.prototype.getBlob; - -/** - * Helper function that maps ArrayBufferViews to ArrayBuffers - * Used by BlobBuilder constructor and old browsers that didn't - * support it in the Blob constructor. - */ - -function mapArrayBufferViews(ary) { - for (var i = 0; i < ary.length; i++) { - var chunk = ary[i]; - if (chunk.buffer instanceof ArrayBuffer) { - var buf = chunk.buffer; - - // if this is a subarray, make a copy so we only - // include the subarray region from the underlying buffer - if (chunk.byteLength !== buf.byteLength) { - var copy = new Uint8Array(chunk.byteLength); - copy.set(new Uint8Array(buf, chunk.byteOffset, chunk.byteLength)); - buf = copy.buffer; - } - - ary[i] = buf; - } - } -} - -function BlobBuilderConstructor(ary, options) { - options = options || {}; - - var bb = new BlobBuilder(); - mapArrayBufferViews(ary); - - for (var i = 0; i < ary.length; i++) { - bb.append(ary[i]); - } - - return (options.type) ? bb.getBlob(options.type) : bb.getBlob(); -}; - -function BlobConstructor(ary, options) { - mapArrayBufferViews(ary); - return new Blob(ary, options || {}); -}; - -module.exports = (function() { - if (blobSupported) { - return blobSupportsArrayBufferView ? global.Blob : BlobConstructor; - } else if (blobBuilderSupported) { - return BlobBuilderConstructor; - } else { - return undefined; - } -})(); diff --git a/src/node_modules/blob/package.json b/src/node_modules/blob/package.json deleted file mode 100644 index 28e43c0..0000000 --- a/src/node_modules/blob/package.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "_args": [ - [ - "blob@0.0.4", - "/media/Github/Vertinext2/src/node_modules/engine.io-parser" - ] - ], - "_from": "blob@0.0.4", - "_id": "blob@0.0.4", - "_inCache": true, - "_installable": true, - "_location": "/blob", - "_npmUser": { - "email": "tonykovanen@hotmail.com", - "name": "rase-" - }, - "_npmVersion": "1.4.6", - "_phantomChildren": {}, - "_requested": { - "name": "blob", - "raw": "blob@0.0.4", - "rawSpec": "0.0.4", - "scope": null, - "spec": "0.0.4", - "type": "version" - }, - "_requiredBy": [ - "/engine.io-parser" - ], - "_resolved": "https://registry.npmjs.org/blob/-/blob-0.0.4.tgz", - "_shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", - "_shrinkwrap": null, - "_spec": "blob@0.0.4", - "_where": "/media/Github/Vertinext2/src/node_modules/engine.io-parser", - "bugs": { - "url": "https://github.com/rase-/blob/issues" - }, - "dependencies": {}, - "description": "Abstracts out Blob and uses BlobBulder in cases where it is supported with any vendor prefix.", - "devDependencies": { - "browserify": "3.30.1", - "expect.js": "0.2.0", - "mocha": "1.17.1", - "zuul": "1.5.4" - }, - "directories": {}, - "dist": { - "shasum": "bcf13052ca54463f30f9fc7e95b9a47630a94921", - "tarball": "http://registry.npmjs.org/blob/-/blob-0.0.4.tgz" - }, - "homepage": "https://github.com/rase-/blob", - "maintainers": [ - { - "email": "tonykovanen@hotmail.com", - "name": "rase-" - } - ], - "name": "blob", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/rase-/blob.git" - }, - "scripts": { - "test": "make test" - }, - "version": "0.0.4" -} diff --git a/src/node_modules/blob/test/index.js b/src/node_modules/blob/test/index.js deleted file mode 100644 index df9303f..0000000 --- a/src/node_modules/blob/test/index.js +++ /dev/null @@ -1,94 +0,0 @@ -var Blob = require('../'); -var expect = require('expect.js'); - -describe('blob', function() { - if (!Blob) { - it('should not have a blob or a blob builder in the global namespace, or blob should not be a constructor function if the module exports false', function() { - try { - var ab = (new Uint8Array(5)).buffer; - global.Blob([ab]); - expect().fail('Blob shouldn\'t be constructable'); - } catch (e) {} - - var BlobBuilder = global.BlobBuilder - || global.WebKitBlobBuilder - || global.MSBlobBuilder - || global.MozBlobBuilder; - expect(BlobBuilder).to.be(undefined); - }); - } else { - it('should encode a proper sized blob when given a string argument', function() { - var b = new Blob(['hi']); - expect(b.size).to.be(2); - }); - - it('should encode a blob with proper size when given two strings as arguments', function() { - var b = new Blob(['hi', 'hello']); - expect(b.size).to.be(7); - }); - - it('should encode arraybuffers with right content', function(done) { - var ary = new Uint8Array(5); - for (var i = 0; i < 5; i++) ary[i] = i; - var b = new Blob([ary.buffer]); - var fr = new FileReader(); - fr.onload = function() { - var newAry = new Uint8Array(this.result); - for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); - done(); - }; - fr.readAsArrayBuffer(b); - }); - - it('should encode typed arrays with right content', function(done) { - var ary = new Uint8Array(5); - for (var i = 0; i < 5; i++) ary[i] = i; - var b = new Blob([ary]); - var fr = new FileReader(); - fr.onload = function() { - var newAry = new Uint8Array(this.result); - for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); - done(); - }; - fr.readAsArrayBuffer(b); - }); - - it('should encode sliced typed arrays with right content', function(done) { - var ary = new Uint8Array(5); - for (var i = 0; i < 5; i++) ary[i] = i; - var b = new Blob([ary.subarray(2)]); - var fr = new FileReader(); - fr.onload = function() { - var newAry = new Uint8Array(this.result); - for (var i = 0; i < 3; i++) expect(newAry[i]).to.be(i + 2); - done(); - }; - fr.readAsArrayBuffer(b); - }); - - it('should encode with blobs', function(done) { - var ary = new Uint8Array(5); - for (var i = 0; i < 5; i++) ary[i] = i; - var b = new Blob([new Blob([ary.buffer])]); - var fr = new FileReader(); - fr.onload = function() { - var newAry = new Uint8Array(this.result); - for (var i = 0; i < 5; i++) expect(newAry[i]).to.be(i); - done(); - }; - fr.readAsArrayBuffer(b); - }); - - it('should enode mixed contents to right size', function() { - var ary = new Uint8Array(5); - for (var i = 0; i < 5; i++) ary[i] = i; - var b = new Blob([ary.buffer, 'hello']); - expect(b.size).to.be(10); - }); - - it('should accept mime type', function() { - var b = new Blob(['hi', 'hello'], { type: 'text/html' }); - expect(b.type).to.be('text/html'); - }); - } -}); diff --git a/src/node_modules/bluebird/LICENSE b/src/node_modules/bluebird/LICENSE deleted file mode 100644 index 4182a1e..0000000 --- a/src/node_modules/bluebird/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2013-2015 Petka Antonov - -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/src/node_modules/bluebird/README.md b/src/node_modules/bluebird/README.md deleted file mode 100644 index e1447bf..0000000 --- a/src/node_modules/bluebird/README.md +++ /dev/null @@ -1,679 +0,0 @@ - - Promises/A+ logo - -[![Build Status](https://travis-ci.org/petkaantonov/bluebird.svg?branch=master)](https://travis-ci.org/petkaantonov/bluebird) -[![coverage-98%](http://img.shields.io/badge/coverage-98%-brightgreen.svg?style=flat)](http://petkaantonov.github.io/bluebird/coverage/debug/index.html) - -**Got a question?** Join us on [stackoverflow](http://stackoverflow.com/questions/tagged/bluebird), the [mailing list](https://groups.google.com/forum/#!forum/bluebird-js) or chat on [IRC](https://webchat.freenode.net/?channels=#promises) - -# Introduction - -Bluebird is a fully featured [promise](#what-are-promises-and-why-should-i-use-them) library with focus on innovative features and performance - - - -# Topics - -- [Features](#features) -- [Quick start](#quick-start) -- [API Reference and examples](API.md) -- [Support](#support) -- [What are promises and why should I use them?](#what-are-promises-and-why-should-i-use-them) -- [Questions and issues](#questions-and-issues) -- [Error handling](#error-handling) -- [Development](#development) - - [Testing](#testing) - - [Benchmarking](#benchmarks) - - [Custom builds](#custom-builds) - - [For library authors](#for-library-authors) -- [What is the sync build?](#what-is-the-sync-build) -- [License](#license) -- [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets) -- [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns) -- [Changelog](changelog.md) -- [Optimization guide](#optimization-guide) - -# Features -bluebird logo - -- [Promises A+](http://promisesaplus.com) -- [Synchronous inspection](API.md#synchronous-inspection) -- [Concurrency coordination](API.md#collections) -- [Promisification on steroids](API.md#promisification) -- [Resource management through a parallel of python `with`/C# `using`](API.md#resource-management) -- [Cancellation and timeouts](API.md#cancellation) -- [Parallel for C# `async` and `await`](API.md#generators) -- Mind blowing utilities such as - - [`.bind()`](API.md#binddynamic-thisarg---promise) - - [`.call()`](API.md#callstring-propertyname--dynamic-arg---promise) - - [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) - - [And](API.md#core) [much](API.md#timers) [more](API.md#utility)! -- [Practical debugging solutions and sane defaults](#error-handling) -- [Sick performance](benchmark/) - -
    - -# Quick start - -## Node.js - - npm install bluebird - -Then: - -```js -var Promise = require("bluebird"); -``` - -## Browsers - -There are many ways to use bluebird in browsers: - -- Direct downloads - - Full build [bluebird.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.js) - - Full build minified [bluebird.min.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.min.js) - - Core build [bluebird.core.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.js) - - Core build minified [bluebird.core.min.js](https://cdn.jsdelivr.net/bluebird/latest/bluebird.core.min.js) -- You may use browserify on the main export -- You may use the [bower](http://bower.io) package. - -When using script tags the global variables `Promise` and `P` (alias for `Promise`) become available. - -A [minimal bluebird browser build](#custom-builds) is ≈38.92KB minified*, 11.65KB gzipped and has no external dependencies. - -*Google Closure Compiler using Simple. - -#### Browser support - -Browsers that [implement ECMA-262, edition 3](http://en.wikipedia.org/wiki/Ecmascript#Implementations) and later are supported. - -[![Selenium Test Status](https://saucelabs.com/browser-matrix/petka_antonov.svg)](https://saucelabs.com/u/petka_antonov) - -**Note** that in ECMA-262, edition 3 (IE7, IE8 etc.) it is not possible to use methods that have keyword names like `.catch` and `.finally`. The [API documentation](API.md) always lists a compatible alternative name that you can use if you need to support these browsers. For example `.catch` is replaced with `.caught` and `.finally` with `.lastly`. - -Also, [long stack trace](API.md#promiselongstacktraces---void) support is only available in Chrome, Firefox and Internet Explorer 10+. - -After quick start, see [API Reference and examples](API.md) - -
    - -# Support - -- Mailing list: [bluebird-js@googlegroups.com](https://groups.google.com/forum/#!forum/bluebird-js) -- IRC: #promises @freenode -- StackOverflow: [bluebird tag](http://stackoverflow.com/questions/tagged/bluebird) -- Bugs and feature requests: [github issue tracker](https://github.com/petkaantonov/bluebird/issues?state=open) - -
    - -# What are promises and why should I use them? - -You should use promises to turn this: - -```js -fs.readFile("file.json", function(err, val) { - if( err ) { - console.error("unable to read file"); - } - else { - try { - val = JSON.parse(val); - console.log(val.success); - } - catch( e ) { - console.error("invalid json in file"); - } - } -}); -``` - -Into this: - -```js -fs.readFileAsync("file.json").then(JSON.parse).then(function(val) { - console.log(val.success); -}) -.catch(SyntaxError, function(e) { - console.error("invalid json in file"); -}) -.catch(function(e) { - console.error("unable to read file"); -}); -``` - -*If you are wondering "there is no `readFileAsync` method on `fs` that returns a promise", see [promisification](API.md#promisification)* - -Actually you might notice the latter has a lot in common with code that would do the same using synchronous I/O: - -```js -try { - var val = JSON.parse(fs.readFileSync("file.json")); - console.log(val.success); -} -//Syntax actually not supported in JS but drives the point -catch(SyntaxError e) { - console.error("invalid json in file"); -} -catch(Error e) { - console.error("unable to read file"); -} -``` - -And that is the point - being able to have something that is a lot like `return` and `throw` in synchronous code. - -You can also use promises to improve code that was written with callback helpers: - - -```js -//Copyright Plato http://stackoverflow.com/a/19385911/995876 -//CC BY-SA 2.5 -mapSeries(URLs, function (URL, done) { - var options = {}; - needle.get(URL, options, function (error, response, body) { - if (error) { - return done(error); - } - try { - var ret = JSON.parse(body); - return done(null, ret); - } - catch (e) { - done(e); - } - }); -}, function (err, results) { - if (err) { - console.log(err); - } else { - console.log('All Needle requests successful'); - // results is a 1 to 1 mapping in order of URLs > needle.body - processAndSaveAllInDB(results, function (err) { - if (err) { - return done(err); - } - console.log('All Needle requests saved'); - done(null); - }); - } -}); -``` - -Is more pleasing to the eye when done with promises: - -```js -Promise.promisifyAll(needle); -var options = {}; - -var current = Promise.resolve(); -Promise.map(URLs, function(URL) { - current = current.then(function () { - return needle.getAsync(URL, options); - }); - return current; -}).map(function(responseAndBody){ - return JSON.parse(responseAndBody[1]); -}).then(function (results) { - return processAndSaveAllInDB(results); -}).then(function(){ - console.log('All Needle requests saved'); -}).catch(function (e) { - console.log(e); -}); -``` - -Also promises don't just give you correspondences for synchronous features but can also be used as limited event emitters or callback aggregators. - -More reading: - - - [Promise nuggets](https://promise-nuggets.github.io/) - - [Why I am switching to promises](http://spion.github.io/posts/why-i-am-switching-to-promises.html) - - [What is the the point of promises](http://domenic.me/2012/10/14/youre-missing-the-point-of-promises/#toc_1) - - [Snippets for common problems](https://github.com/petkaantonov/bluebird/wiki/Snippets) - - [Promise anti-patterns](https://github.com/petkaantonov/bluebird/wiki/Promise-anti-patterns) - -# Questions and issues - -The [github issue tracker](https://github.com/petkaantonov/bluebird/issues) is **_only_** for bug reports and feature requests. Anything else, such as questions for help in using the library, should be posted in [StackOverflow](http://stackoverflow.com/questions/tagged/bluebird) under tags `promise` and `bluebird`. - -# Error handling - -This is a problem every promise library needs to handle in some way. Unhandled rejections/exceptions don't really have a good agreed-on asynchronous correspondence. The problem is that it is impossible to predict the future and know if a rejected promise will eventually be handled. - -There are two common pragmatic attempts at solving the problem that promise libraries do. - -The more popular one is to have the user explicitly communicate that they are done and any unhandled rejections should be thrown, like so: - -```js -download().then(...).then(...).done(); -``` - -For handling this problem, in my opinion, this is completely unacceptable and pointless. The user must remember to explicitly call `.done` and that cannot be justified when the problem is forgetting to create an error handler in the first place. - -The second approach, which is what bluebird by default takes, is to call a registered handler if a rejection is unhandled by the start of a second turn. The default handler is to write the stack trace to `stderr` or `console.error` in browsers. This is close to what happens with synchronous code - your code doesn't work as expected and you open console and see a stack trace. Nice. - -Of course this is not perfect, if your code for some reason needs to swoop in and attach error handler to some promise after the promise has been hanging around a while then you will see annoying messages. In that case you can use the `.done()` method to signal that any hanging exceptions should be thrown. - -If you want to override the default handler for these possibly unhandled rejections, you can pass yours like so: - -```js -Promise.onPossiblyUnhandledRejection(function(error){ - throw error; -}); -``` - -If you want to also enable long stack traces, call: - -```js -Promise.longStackTraces(); -``` - -right after the library is loaded. - -In node.js use the environment flag `BLUEBIRD_DEBUG`: - -``` -BLUEBIRD_DEBUG=1 node server.js -``` - -to enable long stack traces in all instances of bluebird. - -Long stack traces cannot be disabled after being enabled, and cannot be enabled after promises have already been created. Long stack traces imply a substantial performance penalty, even after using every trick to optimize them. - -Long stack traces are enabled by default in the debug build. - -#### Expected and unexpected errors - -A practical problem with Promises/A+ is that it models Javascript `try-catch` too closely for its own good. Therefore by default promises inherit `try-catch` warts such as the inability to specify the error types that the catch block is eligible for. It is an anti-pattern in every other language to use catch-all handlers because they swallow exceptions that you might not know about. - -Now, Javascript does have a perfectly fine and working way of creating error type hierarchies. It is still quite awkward to use them with the built-in `try-catch` however: - -```js -try { - //code -} -catch(e) { - if( e instanceof WhatIWantError) { - //handle - } - else { - throw e; - } -} -``` - -Without such checking, unexpected errors would be silently swallowed. However, with promises, bluebird brings the future (hopefully) here now and extends the `.catch` to [accept potential error type eligibility](API.md#catchfunction-errorclass-function-handler---promise). - -For instance here it is expected that some evil or incompetent entity will try to crash our server from `SyntaxError` by providing syntactically invalid JSON: - -```js -getJSONFromSomewhere().then(function(jsonString) { - return JSON.parse(jsonString); -}).then(function(object) { - console.log("it was valid json: ", object); -}).catch(SyntaxError, function(e){ - console.log("don't be evil"); -}); -``` - -Here any kind of unexpected error will be automatically reported on `stderr` along with a stack trace because we only register a handler for the expected `SyntaxError`. - -Ok, so, that's pretty neat. But actually not many libraries define error types and it is in fact a complete ghetto out there with ad hoc strings being attached as some arbitrary property name like `.name`, `.type`, `.code`, not having any property at all or even throwing strings as errors and so on. So how can we still listen for expected errors? - -Bluebird defines a special error type `OperationalError` (you can get a reference from `Promise.OperationalError`). This type of error is given as rejection reason by promisified methods when -their underlying library gives an untyped, but expected error. Primitives such as strings, and error objects that are directly created like `new Error("database didn't respond")` are considered untyped. - -Example of such library is the node core library `fs`. So if we promisify it, we can catch just the errors we want pretty easily and have programmer errors be redirected to unhandled rejection handler so that we notice them: - -```js -//Read more about promisification in the API Reference: -//API.md -var fs = Promise.promisifyAll(require("fs")); - -fs.readFileAsync("myfile.json").then(JSON.parse).then(function (json) { - console.log("Successful json"); -}).catch(SyntaxError, function (e) { - console.error("file contains invalid json"); -}).catch(Promise.OperationalError, function (e) { - console.error("unable to read file, because: ", e.message); -}); -``` - -The last `catch` handler is only invoked when the `fs` module explicitly used the `err` argument convention of async callbacks to inform of an expected error. The `OperationalError` instance will contain the original error in its `.cause` property but it does have a direct copy of the `.message` and `.stack` too. In this code any unexpected error - be it in our code or the `fs` module - would not be caught by these handlers and therefore not swallowed. - -Since a `catch` handler typed to `Promise.OperationalError` is expected to be used very often, it has a neat shorthand: - -```js -.error(function (e) { - console.error("unable to read file, because: ", e.message); -}); -``` - -See [API documentation for `.error()`](API.md#error-rejectedhandler----promise) - -Finally, Bluebird also supports predicate-based filters. If you pass a -predicate function instead of an error type, the predicate will receive -the error as an argument. The return result will be used to determine whether -the error handler should be called. - -Predicates should allow for very fine grained control over caught errors: -pattern matching, error typesets with set operations and many other techniques -can be implemented on top of them. - -Example of using a predicate-based filter: - -```js -var Promise = require("bluebird"); -var request = Promise.promisify(require("request")); - -function clientError(e) { - return e.code >= 400 && e.code < 500; -} - -request("http://www.google.com").then(function(contents){ - console.log(contents); -}).catch(clientError, function(e){ - //A client error like 400 Bad Request happened -}); -``` - -**Danger:** The JavaScript language allows throwing primitive values like strings. Throwing primitives can lead to worse or no stack traces. Primitives [are not exceptions](http://www.devthought.com/2011/12/22/a-string-is-not-an-error/). You should consider always throwing Error objects when handling exceptions. - -
    - -#### How do long stack traces differ from e.g. Q? - -Bluebird attempts to have more elaborate traces. Consider: - -```js -Error.stackTraceLimit = 25; -Q.longStackSupport = true; -Q().then(function outer() { - return Q().then(function inner() { - return Q().then(function evenMoreInner() { - a.b.c.d(); - }).catch(function catcher(e){ - console.error(e.stack); - }); - }) -}); -``` - -You will see - - ReferenceError: a is not defined - at evenMoreInner (:7:13) - From previous event: - at inner (:6:20) - -Compare to: - -```js -Error.stackTraceLimit = 25; -Promise.longStackTraces(); -Promise.resolve().then(function outer() { - return Promise.resolve().then(function inner() { - return Promise.resolve().then(function evenMoreInner() { - a.b.c.d(); - }).catch(function catcher(e){ - console.error(e.stack); - }); - }); -}); -``` - - ReferenceError: a is not defined - at evenMoreInner (:7:13) - From previous event: - at inner (:6:36) - From previous event: - at outer (:5:32) - From previous event: - at :4:21 - at Object.InjectedScript._evaluateOn (:572:39) - at Object.InjectedScript._evaluateAndWrap (:531:52) - at Object.InjectedScript.evaluate (:450:21) - - -A better and more practical example of the differences can be seen in gorgikosev's [debuggability competition](https://github.com/spion/async-compare#debuggability). - -
    - -# Development - -For development tasks such as running benchmarks or testing, you need to clone the repository and install dev-dependencies. - -Install [node](http://nodejs.org/) and [npm](https://npmjs.org/) - - git clone git@github.com:petkaantonov/bluebird.git - cd bluebird - npm install - -## Testing - -To run all tests, run - - node tools/test - -If you need to run generator tests run the `tool/test.js` script with `--harmony` argument and node 0.11+: - - node-dev --harmony tools/test - -You may specify an individual test file to run with the `--run` script flag: - - node tools/test --run=cancel.js - - -This enables output from the test and may give a better idea where the test is failing. The parameter to `--run` can be any file name located in `test/mocha` folder. - -#### Testing in browsers - -To run the test in a browser instead of node, pass the flag `--browser` to the test tool - - node tools/test --run=cancel.js --browser - -This will automatically create a server (default port 9999) and open it in your default browser once the tests have been compiled. - -Keep the test tab active because some tests are timing-sensitive and will fail if the browser is throttling timeouts. Chrome will do this for example when the tab is not active. - -#### Supported options by the test tool - -The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-browser`. - - - `--run=String` - Which tests to run (or compile when testing in browser). Default `"all"`. Can also be a glob string (relative to ./test/mocha folder). - - `--cover=String`. Create code coverage using the String as istanbul reporter. Coverage is created in the ./coverage folder. No coverage is created by default, default reporter is `"html"` (use `--cover` to use default reporter). - - `--browser` - Whether to compile tests for browsers. Default `false`. - - `--port=Number` - Port where local server is hosted when testing in browser. Default `9999` - - `--execute-browser-tests` - Whether to execute the compiled tests for browser when using `--browser`. Default `true`. - - `--open-browser` - Whether to open the default browser when executing browser tests. Default `true`. - - `--fake-timers` - Whether to use fake timers (`setTimeout` etc) when running tests in node. Default `true`. - - `--js-hint` - Whether to run JSHint on source files. Default `true`. - - `--saucelabs` - Whether to create a tunnel to sauce labs and run tests in their VMs instead of your browser when compiling tests for browser. Default `false`. - -## Benchmarks - -To run a benchmark, run the given command for a benchmark while on the project root. Requires bash (on windows the mingw32 that comes with git works fine too). - -Node 0.11.2+ is required to run the generator examples. - -### 1\. DoxBee sequential - -Currently the most relevant benchmark is @gorkikosev's benchmark in the article [Analysis of generators and other async patterns in node](http://spion.github.io/posts/analysis-generators-and-other-async-patterns-node.html). The benchmark emulates a situation where n amount of users are making a request in parallel to execute some mixed async/sync action. The benchmark has been modified to include a warm-up phase to minimize any JITing during timed sections. - -Command: `bench doxbee` - -### 2\. Made-up parallel - -This made-up scenario runs 15 shimmed queries in parallel. - -Command: `bench parallel` - -## Custom builds - -Custom builds for browsers are supported through a command-line utility. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    The following features can be disabled
    Feature(s)Command line identifier
    .any and Promise.anyany
    .race and Promise.racerace
    .call and .getcall_get
    .filter and Promise.filterfilter
    .map and Promise.mapmap
    .reduce and Promise.reducereduce
    .props and Promise.propsprops
    .settle and Promise.settlesettle
    .some and Promise.somesome
    .nodeifynodeify
    Promise.coroutine and Promise.spawngenerators
    Progressionprogress
    Promisificationpromisify
    Cancellationcancel
    Timerstimers
    Resource managementusing
    - - -Make sure you have cloned the repo somewhere and did `npm install` successfully. - -After that you can run: - - node tools/build --features="core" - - -The above builds the most minimal build you can get. You can add more features separated by spaces from the above list: - - node tools/build --features="core filter map reduce" - -The custom build file will be found from `/js/browser/bluebird.js`. It will have a comment that lists the disabled and enabled features. - -Note that the build leaves the `/js/main` etc folders with same features so if you use the folder for node.js at the same time, don't forget to build -a full version afterwards (after having taken a copy of the bluebird.js somewhere): - - node tools/build --debug --main --zalgo --browser --minify - -#### Supported options by the build tool - -The value of boolean flags is determined by presence, if you want to pass false value for a boolean flag, use the `no-`-prefix e.g. `--no-debug`. - - - `--main` - Whether to build the main build. The main build is placed at `js/main` directory. Default `false`. - - `--debug` - Whether to build the debug build. The debug build is placed at `js/debug` directory. Default `false`. - - `--zalgo` - Whether to build the zalgo build. The zalgo build is placed at `js/zalgo` directory. Default `false`. - - `--browser` - Whether to compile the browser build. The browser build file is placed at `js/browser/bluebird.js` Default `false`. - - `--minify` - Whether to minify the compiled browser build. The minified browser build file is placed at `js/browser/bluebird.min.js` Default `true`. - - `--features=String` - See [custom builds](#custom-builds) - -
    - -## For library authors - -Building a library that depends on bluebird? You should know about a few features. - -If your library needs to do something obtrusive like adding or modifying methods on the `Promise` prototype, uses long stack traces or uses a custom unhandled rejection handler then... that's totally ok as long as you don't use `require("bluebird")`. Instead you should create a file -that creates an isolated copy. For example, creating a file called `bluebird-extended.js` that contains: - -```js - //NOTE the function call right after -module.exports = require("bluebird/js/main/promise")(); -``` - -Your library can then use `var Promise = require("bluebird-extended");` and do whatever it wants with it. Then if the application or other library uses their own bluebird promises they will all play well together because of Promises/A+ thenable assimilation magic. - -You should also know about [`.nodeify()`](API.md#nodeifyfunction-callback---promise) which makes it easy to provide a dual callback/promise API. - -
    - -## What is the sync build? - -You may now use sync build by: - - var Promise = require("bluebird/zalgo"); - -The sync build is provided to see how forced asynchronity affects benchmarks. It should not be used in real code due to the implied hazards. - -The normal async build gives Promises/A+ guarantees about asynchronous resolution of promises. Some people think this affects performance or just plain love their code having a possibility -of stack overflow errors and non-deterministic behavior. - -The sync build skips the async call trampoline completely, e.g code like: - - async.invoke( this.fn, this, val ); - -Appears as this in the sync build: - - this.fn(val); - -This should pressure the CPU slightly less and thus the sync build should perform better. Indeed it does, but only marginally. The biggest performance boosts are from writing efficient Javascript, not from compromising determinism. - -Note that while some benchmarks are waiting for the next event tick, the CPU is actually not in use during that time. So the resulting benchmark result is not completely accurate because on node.js you only care about how much the CPU is taxed. Any time spent on CPU is time the whole process (or server) is paralyzed. And it is not graceful like it would be with threads. - - -```js -var cache = new Map(); //ES6 Map or DataStructures/Map or whatever... -function getResult(url) { - var resolver = Promise.pending(); - if (cache.has(url)) { - resolver.resolve(cache.get(url)); - } - else { - http.get(url, function(err, content) { - if (err) resolver.reject(err); - else { - cache.set(url, content); - resolver.resolve(content); - } - }); - } - return resolver.promise; -} - - - -//The result of console.log is truly random without async guarantees -function guessWhatItPrints( url ) { - var i = 3; - getResult(url).then(function(){ - i = 4; - }); - console.log(i); -} -``` - -# Optimization guide - -Articles about optimization will be periodically posted in [the wiki section](https://github.com/petkaantonov/bluebird/wiki), polishing edits are welcome. - -A single cohesive guide compiled from the articles will probably be done eventually. - -# License - -The MIT License (MIT) - -Copyright (c) 2014 Petka Antonov - -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/src/node_modules/bluebird/changelog.md b/src/node_modules/bluebird/changelog.md deleted file mode 100644 index 5f6e348..0000000 --- a/src/node_modules/bluebird/changelog.md +++ /dev/null @@ -1,1723 +0,0 @@ -## 2.10.2 (2015-10-01) - -Features: - - - `.timeout()` now takes a custom error object as second argument - -## 2.10.1 (2015-09-21) - - - Fix error "Cannot promisify an API that has normal methods with 'Async'-suffix" when promisifying certain objects with a custom promisifier - -## 2.10.0 (2015-09-08) - -Features: - - - `Promise.using` can now take the promises-for-resources as an array ([#733](.)). - - Browser builds for minimal core are now hosted on CDN ([#724](.)). - -Bugfixes: - - - Disabling debug mode with `BLUEBIRD_DEBUG=0` environment variable now works ([#719](.)). - - Fix unhandled rejection reporting when passing rejected promise to `.return()` ([#721](.)). - - Fix unbound promise's then handlers being called with wrong `this` value ([#738](.)). - -## 2.9.34 (2015-07-15) - -Bugfixes: - -- Correct domain for .map, .each, .filter, .reduce callbacks ([#701](.)). - - Preserve bound-with-promise promises across the entire chain ([#702](.)). - -## 2.9.33 (2015-07-09) - -Bugfixes: - - - Methods on `Function.prototype` are no longer promisified ([#680](.)). - -## 2.9.32 (2015-07-03) - -Bugfixes: - - - Fix `.return(primitiveValue)` returning a wrapped version of the primitive value when a Node.js domain is active ([#689](.)). - -## 2.9.31 (2015-07-03) - -Bugfixes: - - - Fix Promises/A+ compliance issue regarding circular thenables: the correct behavior is to go into an infinite loop instead of warning with an error (Fixes [#682](.)). - - Fix "(node) warning: possible EventEmitter memory leak detected" ([#661](.)). - - Fix callbacks sometimes being called with a wrong node.js domain ([#664](.)). - - Fix callbacks sometimes not being called at all in iOS 8.1 WebApp mode ([#666](.), [#687](.)). - -## 2.9.30 (2015-06-14) - -Bugfixes: - - - Fix regression with `promisifyAll` not promisifying certain methods - -## 2.9.29 (2015-06-14) - -Bugfixes: - - - Improve `promisifyAll` detection of functions that are class constructors. Fixes mongodb 2.x promisification. - -## 2.9.28 (2015-06-14) - -Bugfixes: - - - Fix handled rejection being reported as unhandled in certain scenarios when using [.all](.) or [Promise.join](.) ([#645](.)) - - Fix custom scheduler not being called in Google Chrome when long stack traces are enabled ([#650](.)) - -## 2.9.27 (2015-05-30) - -Bugfixes: - - - Fix `sinon.useFakeTimers()` breaking scheduler ([#631](.)) - -Misc: - - - Add nw testing facilities (`node tools/test --nw`) - -## 2.9.26 (2015-05-25) - -Bugfixes: - - - Fix crash in NW [#624](.) - - Fix [`.return()`](.) not supporting `undefined` as return value [#627](.) - -## 2.9.25 (2015-04-28) - -Bugfixes: - - - Fix crash in node 0.8 - -## 2.9.24 (2015-04-02) - -Bugfixes: - - - Fix not being able to load multiple bluebird copies introduced in 2.9.22 ([#559](.), [#561](.), [#560](.)). - -## 2.9.23 (2015-04-02) - -Bugfixes: - - - Fix node.js domain propagation ([#521](.)). - -## 2.9.22 (2015-04-02) - - - Fix `.promisify` crashing in phantom JS ([#556](.)) - -## 2.9.21 (2015-03-30) - - - Fix error object's `'stack'`' overwriting causing an error when its defined to be a setter that throws an error ([#552](.)). - -## 2.9.20 (2015-03-29) - -Bugfixes: - - - Fix regression where there is a long delay between calling `.cancel()` and promise actually getting cancelled in Chrome when long stack traces are enabled - -## 2.9.19 (2015-03-29) - -Bugfixes: - - - Fix crashing in Chrome when long stack traces are disabled - -## 2.9.18 (2015-03-29) - -Bugfixes: - - - Fix settlePromises using trampoline - -## 2.9.17 (2015-03-29) - - -Bugfixes: - - - Fix Chrome DevTools async stack traceability ([#542](.)). - -## 2.9.16 (2015-03-28) - -Features: - - - Use setImmediate if available - -## 2.9.15 (2015-03-26) - -Features: - - - Added `.asCallback` alias for `.nodeify`. - -Bugfixes: - - - Don't always use nextTick, but try to pick up setImmediate or setTimeout in NW. Fixes [#534](.), [#525](.) - - Make progress a core feature. Fixes [#535](.) Note that progress has been removed in 3.x - this is only a fix necessary for 2.x custom builds. - -## 2.9.14 (2015-03-12) - -Bugfixes: - - - Always use process.nextTick. Fixes [#525](.) - -## 2.9.13 (2015-02-27) - -Bugfixes: - - - Fix .each, .filter, .reduce and .map callbacks being called synchornously if the input is immediate. ([#513](.)) - -## 2.9.12 (2015-02-19) - -Bugfixes: - - - Fix memory leak introduced in 2.9.0 ([#502](.)) - -## 2.9.11 (2015-02-19) - -Bugfixes: - - - Fix [#503](.) - -## 2.9.10 (2015-02-18) - -Bugfixes: - - - Fix [#501](.) - -## 2.9.9 (2015-02-12) - -Bugfixes: - - - Fix `TypeError: Cannot assign to read only property 'length'` when jsdom has declared a read-only length for all objects to inherit. - -## 2.9.8 (2015-02-10) - -Bugfixes: - - - Fix regression introduced in 2.9.7 where promisify didn't properly dynamically look up methods on `this` - -## 2.9.7 (2015-02-08) - -Bugfixes: - - - Fix `promisify` not retaining custom properties of the function. This enables promisifying the `"request"` module's export function and its methods at the same time. - - Fix `promisifyAll` methods being dependent on `this` when they are not originally dependent on `this`. This enables e.g. passing promisified `fs` functions directly as callbacks without having to bind them to `fs`. - - Fix `process.nextTick` being used over `setImmediate` in node. - -## 2.9.6 (2015-02-02) - -Bugfixes: - - - Node environment detection can no longer be fooled - -## 2.9.5 (2015-02-02) - -Misc: - - - Warn when [`.then()`](.) is passed non-functions - -## 2.9.4 (2015-01-30) - -Bugfixes: - - - Fix [.timeout()](.) not calling `clearTimeout` with the proper handle in node causing the process to wait for unneeded timeout. This was a regression introduced in 2.9.1. - -## 2.9.3 (2015-01-27) - -Bugfixes: - - - Fix node-webkit compatibility issue ([#467](https://github.com/petkaantonov/bluebird/pull/467)) - - Fix long stack trace support in recent firefox versions - -## 2.9.2 (2015-01-26) - -Bugfixes: - - - Fix critical bug regarding to using promisifyAll in browser that was introduced in 2.9.0 ([#466](https://github.com/petkaantonov/bluebird/issues/466)). - -Misc: - - - Add `"browser"` entry point to package.json - -## 2.9.1 (2015-01-24) - -Features: - - - If a bound promise is returned by the callback to [`Promise.method`](#promisemethodfunction-fn---function) and [`Promise.try`](#promisetryfunction-fn--arraydynamicdynamic-arguments--dynamic-ctx----promise), the returned promise will be bound to the same value - -## 2.9.0 (2015-01-24) - -Features: - - - Add [`Promise.fromNode`](API.md#promisefromnodefunction-resolver---promise) - - Add new paramter `value` for [`Promise.bind`](API.md#promisebinddynamic-thisarg--dynamic-value---promise) - -Bugfixes: - - - Fix several issues with [`cancellation`](API.md#cancellation) and [`.bind()`](API.md#binddynamic-thisarg---promise) interoperation when `thisArg` is a promise or thenable - - Fix promises created in [`disposers`](API#disposerfunction-disposer---disposer) not having proper long stack trace context - - Fix [`Promise.join`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) sometimes passing the passed in callback function as the last argument to itself. - -Misc: - - - Reduce minified full browser build file size by not including unused code generation functionality. - - Major internal refactoring related to testing code and source code file layout - -## 2.8.2 (2015-01-20) - -Features: - - - [Global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) are now fired both as DOM3 events and as legacy events in browsers - -## 2.8.1 (2015-01-20) - -Bugfixes: - - - Fix long stack trace stiching consistency when rejected from thenables - -## 2.8.0 (2015-01-19) - -Features: - - - Major debuggability improvements: - - Long stack traces have been re-designed. They are now much more readable, - succint, relevant and consistent across bluebird features. - - Long stack traces are supported now in IE10+ - -## 2.7.1 (2015-01-15) - -Bugfixes: - - - Fix [#447](https://github.com/petkaantonov/bluebird/issues/447) - -## 2.7.0 (2015-01-15) - -Features: - - - Added more context to stack traces originating from coroutines ([#421](https://github.com/petkaantonov/bluebird/issues/421)) - - Implemented [global rejection events](https://github.com/petkaantonov/bluebird/blob/master/API.md#global-rejection-events) ([#428](https://github.com/petkaantonov/bluebird/issues/428), [#357](https://github.com/petkaantonov/bluebird/issues/357)) - - [Custom promisifiers](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-promisifier) are now passed the default promisifier which can be used to add enhancements on top of normal node promisification - - [Promisification filters](https://github.com/petkaantonov/bluebird/blob/master/API.md#option-filter) are now passed `passesDefaultFilter` boolean - -Bugfixes: - - - Fix `.noConflict()` call signature ([#446]()) - - Fix `Promise.method`ified functions being called with `undefined` when they were called with no arguments - -## 2.6.4 (2015-01-12) - -Bugfixes: - - - `OperationalErrors` thrown by promisified functions retain custom properties, such as `.code` and `.path`. - -## 2.6.3 (2015-01-12) - -Bugfixes: - - - Fix [#429](https://github.com/petkaantonov/bluebird/issues/429) - - Fix [#432](https://github.com/petkaantonov/bluebird/issues/432) - - Fix [#433](https://github.com/petkaantonov/bluebird/issues/433) - -## 2.6.2 (2015-01-07) - -Bugfixes: - - - Fix [#426](https://github.com/petkaantonov/bluebird/issues/426) - -## 2.6.1 (2015-01-07) - -Bugfixes: - - - Fixed built browser files not being included in the git tag release for bower - -## 2.6.0 (2015-01-06) - -Features: - - - Significantly improve parallel promise performance and memory usage (+50% faster, -50% less memory) - - -## 2.5.3 (2014-12-30) - -## 2.5.2 (2014-12-29) - -Bugfixes: - - - Fix bug where already resolved promise gets attached more handlers while calling its handlers resulting in some handlers not being called - - Fix bug where then handlers are not called in the same order as they would run if Promises/A+ 2.3.2 was implemented as adoption - - Fix bug where using `Object.create(null)` as a rejection reason would crash bluebird - -## 2.5.1 (2014-12-29) - -Bugfixes: - - - Fix `.finally` throwing null error when it is derived from a promise that is resolved with a promise that is resolved with a promise - -## 2.5.0 (2014-12-28) - -Features: - - - [`.get`](#API.md#https://github.com/petkaantonov/bluebird/blob/master/API.md#getstring-propertyname---promise) now supports negative indexing. - -Bugfixes: - - - Fix bug with `Promise.method` wrapped function returning a promise that never resolves if the function returns a promise that is resolved with another promise - - Fix bug with `Promise.delay` never resolving if the value is a promise that is resolved with another promise - -## 2.4.3 (2014-12-28) - -Bugfixes: - - - Fix memory leak as described in [this Promises/A+ spec issue](https://github.com/promises-aplus/promises-spec/issues/179). - -## 2.4.2 (2014-12-21) - -Bugfixes: - - - Fix bug where spread rejected handler is ignored in case of rejection - - Fix synchronous scheduler passed to `setScheduler` causing infinite loop - -## 2.4.1 (2014-12-20) - -Features: - - - Error messages now have links to wiki pages for additional information - - Promises now clean up all references (to handlers, child promises etc) as soon as possible. - -## 2.4.0 (2014-12-18) - -Features: - - - Better filtering of bluebird internal calls in long stack traces, especially when using minified file in browsers - - Small performance improvements for all collection methods - - Promises now delete references to handlers attached to them as soon as possible - - Additional stack traces are now output on stderr/`console.warn` for errors that are thrown in the process/window from rejected `.done()` promises. See [#411](https://github.com/petkaantonov/bluebird/issues/411) - -## 2.3.11 (2014-10-31) - -Bugfixes: - - - Fix [#371](https://github.com/petkaantonov/bluebird/issues/371), [#373](https://github.com/petkaantonov/bluebird/issues/373) - - -## 2.3.10 (2014-10-28) - -Features: - - - `Promise.method` no longer wraps primitive errors - - `Promise.try` no longer wraps primitive errors - -## 2.3.7 (2014-10-25) - -Bugfixes: - - - Fix [#359](https://github.com/petkaantonov/bluebird/issues/359), [#362](https://github.com/petkaantonov/bluebird/issues/362) and [#364](https://github.com/petkaantonov/bluebird/issues/364) - -## 2.3.6 (2014-10-15) - -Features: - - - Implement [`.reflect()`](API.md#reflect---promisepromiseinspection) - -## 2.3.5 (2014-10-06) - -Bugfixes: - - - Fix issue when promisifying methods whose names contain the string 'args' - -## 2.3.4 (2014-09-27) - - - `P` alias was not declared inside WebWorkers - -## 2.3.3 (2014-09-27) - -Bugfixes: - - - Fix [#318](https://github.com/petkaantonov/bluebird/issues/318), [#314](https://github.com/petkaantonov/bluebird/issues/#314) - -## 2.3.2 (2014-08-25) - -Bugfixes: - - - `P` alias for `Promise` now exists in global scope when using browser builds without a module loader, fixing an issue with firefox extensions - -## 2.3.1 (2014-08-23) - -Features: - - - `.using` can now be used with disposers created from different bluebird copy - -## 2.3.0 (2014-08-13) - -Features: - - - [`.bind()`](API.md#binddynamic-thisarg---promise) and [`Promise.bind()`](API.md#promisebinddynamic-thisarg---promise) now await for the resolution of the `thisArg` if it's a promise or a thenable - -Bugfixes: - - - Fix [#276](https://github.com/petkaantonov/bluebird/issues/276) - -## 2.2.2 (2014-07-14) - - - Fix [#259](https://github.com/petkaantonov/bluebird/issues/259) - -## 2.2.1 (2014-07-07) - - - Fix multiline error messages only showing the first line - -## 2.2.0 (2014-07-07) - -Bugfixes: - - - `.any` and `.some` now consistently reject with RangeError when input array contains too few promises - - Fix iteration bug with `.reduce` when input array contains already fulfilled promises - -## 2.1.3 (2014-06-18) - -Bugfixes: - - - Fix [#235](https://github.com/petkaantonov/bluebird/issues/235) - -## 2.1.2 (2014-06-15) - -Bugfixes: - - - Fix [#232](https://github.com/petkaantonov/bluebird/issues/232) - -## 2.1.1 (2014-06-11) - -## 2.1.0 (2014-06-11) - -Features: - - - Add [`promisifier`](API.md#option-promisifier) option to `Promise.promisifyAll()` - - Improve performance of `.props()` and collection methods when used with immediate values - - -Bugfixes: - - - Fix a bug where .reduce calls the callback for an already visited item - - Fix a bug where stack trace limit is calculated to be too small, which resulted in too short stack traces - -Add undocumented experimental `yieldHandler` option to `Promise.coroutine` - -## 2.0.7 (2014-06-08) -## 2.0.6 (2014-06-07) -## 2.0.5 (2014-06-05) -## 2.0.4 (2014-06-05) -## 2.0.3 (2014-06-05) -## 2.0.2 (2014-06-04) -## 2.0.1 (2014-06-04) - -## 2.0.0 (2014-06-04) - -#What's new in 2.0 - -- [Resource management](API.md#resource-management) - never leak resources again -- [Promisification](API.md#promisification) on steroids - entire modules can now be promisified with one line of code -- [`.map()`](API.md#mapfunction-mapper--object-options---promise), [`.each()`](API.md#eachfunction-iterator---promise), [`.filter()`](API.md#filterfunction-filterer--object-options---promise), [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) reimagined from simple sugar to powerful concurrency coordination tools -- [API Documentation](API.md) has been reorganized and more elaborate examples added -- Deprecated [progression](#progression-migration) and [deferreds](#deferred-migration) -- Improved performance and readability - -Features: - -- Added [`using()`](API.md#promiseusingpromisedisposer-promise-promisedisposer-promise--function-handler---promise) and [`disposer()`](API.md#disposerfunction-disposer---disposer) -- [`.map()`](API.md#mapfunction-mapper--object-options---promise) now calls the handler as soon as items in the input array become fulfilled -- Added a concurrency option to [`.map()`](API.md#mapfunction-mapper--object-options---promise) -- [`.filter()`](API.md#filterfunction-filterer--object-options---promise) now calls the handler as soon as items in the input array become fulfilled -- Added a concurrency option to [`.filter()`](API.md#filterfunction-filterer--object-options---promise) -- [`.reduce()`](API.md#reducefunction-reducer--dynamic-initialvalue---promise) now calls the handler as soon as items in the input array become fulfilled, but in-order -- Added [`.each()`](API.md#eachfunction-iterator---promise) -- [`Promise.resolve()`](API.md#promiseresolvedynamic-value---promise) behaves like `Promise.cast`. `Promise.cast` deprecated. -- [Synchronous inspection](API.md#synchronous-inspection): Removed `.inspect()`, added [`.value()`](API.md#value---dynamic) and [`.reason()`](API.md#reason---dynamic) -- [`Promise.join()`](API.md#promisejoinpromisethenablevalue-promises-function-handler---promise) now takes a function as the last argument -- Added [`Promise.setScheduler()`](API.md#promisesetschedulerfunction-scheduler---void) -- [`.cancel()`](API.md#cancelerror-reason---promise) supports a custom cancellation reason -- [`.timeout()`](API.md#timeoutint-ms--string-message---promise) now cancels the promise instead of rejecting it -- [`.nodeify()`](API.md#nodeifyfunction-callback--object-options---promise) now supports passing multiple success results when mapping promises to nodebacks -- Added `suffix` and `filter` options to [`Promise.promisifyAll()`](API.md#promisepromisifyallobject-target--object-options---object) - -Breaking changes: - -- Sparse array holes are not skipped by collection methods but treated as existing elements with `undefined` value -- `.map()` and `.filter()` do not call the given mapper or filterer function in any specific order -- Removed the `.inspect()` method -- Yielding an array from a coroutine is not supported by default. You can use [`coroutine.addYieldHandler()`](API.md#promisecoroutineaddyieldhandlerfunction-handler---void) to configure the old behavior (or any behavior you want). -- [`.any()`](API.md#any---promise) and [`.some()`](API.md#someint-count---promise) no longer use an array as the rejection reason. [`AggregateError`](API.md#aggregateerror) is used instead. - - -## 1.2.4 (2014-04-27) - -Bugfixes: - - - Fix promisifyAll causing a syntax error when a method name is not a valid identifier - - Fix syntax error when es5.js is used in strict mode - -## 1.2.3 (2014-04-17) - -Bugfixes: - - - Fix [#179](https://github.com/petkaantonov/bluebird/issues/179) - -## 1.2.2 (2014-04-09) - -Bugfixes: - - - Promisified methods from promisifyAll no longer call the original method when it is overriden - - Nodeify doesn't pass second argument to the callback if the promise is fulfilled with `undefined` - -## 1.2.1 (2014-03-31) - -Bugfixes: - - - Fix [#168](https://github.com/petkaantonov/bluebird/issues/168) - -## 1.2.0 (2014-03-29) - -Features: - - - New method: [`.value()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#value---dynamic) - - New method: [`.reason()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#reason---dynamic) - - New method: [`Promise.onUnhandledRejectionHandled()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promiseonunhandledrejectionhandledfunction-handler---undefined) - - `Promise.map()`, `.map()`, `Promise.filter()` and `.filter()` start calling their callbacks as soon as possible while retaining a correct order. See [`8085922f`](https://github.com/petkaantonov/bluebird/commit/8085922fb95a9987fda0cf2337598ab4a98dc315). - -Bugfixes: - - - Fix [#165](https://github.com/petkaantonov/bluebird/issues/165) - - Fix [#166](https://github.com/petkaantonov/bluebird/issues/166) - -## 1.1.1 (2014-03-18) - -Bugfixes: - - - [#138](https://github.com/petkaantonov/bluebird/issues/138) - - [#144](https://github.com/petkaantonov/bluebird/issues/144) - - [#148](https://github.com/petkaantonov/bluebird/issues/148) - - [#151](https://github.com/petkaantonov/bluebird/issues/151) - -## 1.1.0 (2014-03-08) - -Features: - - - Implement [`Promise.prototype.tap()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#tapfunction-handler---promise) - - Implement [`Promise.coroutine.addYieldHandler()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisecoroutineaddyieldhandlerfunction-handler---void) - - Deprecate `Promise.prototype.spawn` - -Bugfixes: - - - Fix already rejected promises being reported as unhandled when handled through collection methods - - Fix browserisfy crashing from checking `process.version.indexOf` - -## 1.0.8 (2014-03-03) - -Bugfixes: - - - Fix active domain being lost across asynchronous boundaries in Node.JS 10.xx - -## 1.0.7 (2014-02-25) - -Bugfixes: - - - Fix handled errors being reported - -## 1.0.6 (2014-02-17) - -Bugfixes: - - - Fix bug with unhandled rejections not being reported - when using `Promise.try` or `Promise.method` without - attaching further handlers - -## 1.0.5 (2014-02-15) - -Features: - - - Node.js performance: promisified functions try to check amount of passed arguments in most optimal order - - Node.js promisified functions will have same `.length` as the original function minus one (for the callback parameter) - -## 1.0.4 (2014-02-09) - -Features: - - - Possibly unhandled rejection handler will always get a stack trace, even if the rejection or thrown error was not an error - - Unhandled rejections are tracked per promise, not per error. So if you create multiple branches from a single ancestor and that ancestor gets rejected, each branch with no error handler with the end will cause a possibly unhandled rejection handler invocation - -Bugfixes: - - - Fix unhandled non-writable objects or primitives not reported by possibly unhandled rejection handler - -## 1.0.3 (2014-02-05) - -Bugfixes: - - - [#93](https://github.com/petkaantonov/bluebird/issues/88) - -## 1.0.2 (2014-02-04) - -Features: - - - Significantly improve performance of foreign bluebird thenables - -Bugfixes: - - - [#88](https://github.com/petkaantonov/bluebird/issues/88) - -## 1.0.1 (2014-01-28) - -Features: - - - Error objects that have property `.isAsync = true` will now be caught by `.error()` - -Bugfixes: - - - Fix TypeError and RangeError shims not working without `new` operator - -## 1.0.0 (2014-01-12) - -Features: - - - `.filter`, `.map`, and `.reduce` no longer skip sparse array holes. This is a backwards incompatible change. - - Like `.map` and `.filter`, `.reduce` now allows returning promises and thenables from the iteration function. - -Bugfixes: - - - [#58](https://github.com/petkaantonov/bluebird/issues/58) - - [#61](https://github.com/petkaantonov/bluebird/issues/61) - - [#64](https://github.com/petkaantonov/bluebird/issues/64) - - [#60](https://github.com/petkaantonov/bluebird/issues/60) - -## 0.11.6-1 (2013-12-29) - -## 0.11.6-0 (2013-12-29) - -Features: - - - You may now return promises and thenables from the filterer function used in `Promise.filter` and `Promise.prototype.filter`. - - - `.error()` now catches additional sources of rejections: - - - Rejections originating from `Promise.reject` - - - Rejections originating from thenables using - the `reject` callback - - - Rejections originating from promisified callbacks - which use the `errback` argument - - - Rejections originating from `new Promise` constructor - where the `reject` callback is called explicitly - - - Rejections originating from `PromiseResolver` where - `.reject()` method is called explicitly - -Bugfixes: - - - Fix `captureStackTrace` being called when it was `null` - - Fix `Promise.map` not unwrapping thenables - -## 0.11.5-1 (2013-12-15) - -## 0.11.5-0 (2013-12-03) - -Features: - - - Improve performance of collection methods - - Improve performance of promise chains - -## 0.11.4-1 (2013-12-02) - -## 0.11.4-0 (2013-12-02) - -Bugfixes: - - - Fix `Promise.some` behavior with arguments like negative integers, 0... - - Fix stack traces of synchronously throwing promisified functions' - -## 0.11.3-0 (2013-12-02) - -Features: - - - Improve performance of generators - -Bugfixes: - - - Fix critical bug with collection methods. - -## 0.11.2-0 (2013-12-02) - -Features: - - - Improve performance of all collection methods - -## 0.11.1-0 (2013-12-02) - -Features: - -- Improve overall performance. -- Improve performance of promisified functions. -- Improve performance of catch filters. -- Improve performance of .finally. - -Bugfixes: - -- Fix `.finally()` rejecting if passed non-function. It will now ignore non-functions like `.then`. -- Fix `.finally()` not converting thenables returned from the handler to promises. -- `.spread()` now rejects if the ultimate value given to it is not spreadable. - -## 0.11.0-0 (2013-12-02) - -Features: - - - Improve overall performance when not using `.bind()` or cancellation. - - Promises are now not cancellable by default. This is backwards incompatible change - see [`.cancellable()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#cancellable---promise) - - [`Promise.delay`](https://github.com/petkaantonov/bluebird/blob/master/API.md#promisedelaydynamic-value-int-ms---promise) - - [`.delay()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#delayint-ms---promise) - - [`.timeout()`](https://github.com/petkaantonov/bluebird/blob/master/API.md#timeoutint-ms--string-message---promise) - -## 0.10.14-0 (2013-12-01) - -Bugfixes: - - - Fix race condition when mixing 3rd party asynchrony. - -## 0.10.13-1 (2013-11-30) - -## 0.10.13-0 (2013-11-30) - -Bugfixes: - - - Fix another bug with progression. - -## 0.10.12-0 (2013-11-30) - -Bugfixes: - - - Fix bug with progression. - -## 0.10.11-4 (2013-11-29) - -## 0.10.11-2 (2013-11-29) - -Bugfixes: - - - Fix `.race()` not propagating bound values. - -## 0.10.11-1 (2013-11-29) - -Features: - - - Improve performance of `Promise.race` - -## 0.10.11-0 (2013-11-29) - -Bugfixes: - - - Fixed `Promise.promisifyAll` invoking property accessors. Only data properties with function values are considered. - -## 0.10.10-0 (2013-11-28) - -Features: - - - Disable long stack traces in browsers by default. Call `Promise.longStackTraces()` to enable them. - -## 0.10.9-1 (2013-11-27) - -Bugfixes: - - - Fail early when `new Promise` is constructed incorrectly - -## 0.10.9-0 (2013-11-27) - -Bugfixes: - - - Promise.props now takes a [thenable-for-collection](https://github.com/petkaantonov/bluebird/blob/f41edac61b7c421608ff439bb5a09b7cffeadcf9/test/mocha/props.js#L197-L217) - - All promise collection methods now reject when a promise-or-thenable-for-collection turns out not to give a collection - -## 0.10.8-0 (2013-11-25) - -Features: - - - All static collection methods take thenable-for-collection - -## 0.10.7-0 (2013-11-25) - -Features: - - - throw TypeError when thenable resolves with itself - - Make .race() and Promise.race() forever pending on empty collections - -## 0.10.6-0 (2013-11-25) - -Bugfixes: - - - Promise.resolve and PromiseResolver.resolve follow thenables too. - -## 0.10.5-0 (2013-11-24) - -Bugfixes: - - - Fix infinite loop when thenable resolves with itself - -## 0.10.4-1 (2013-11-24) - -Bugfixes: - - - Fix a file missing from build. (Critical fix) - -## 0.10.4-0 (2013-11-24) - -Features: - - - Remove dependency of es5-shim and es5-sham when using ES3. - -## 0.10.3-0 (2013-11-24) - -Features: - - - Improve performance of `Promise.method` - -## 0.10.2-1 (2013-11-24) - -Features: - - - Rename PromiseResolver#asCallback to PromiseResolver#callback - -## 0.10.2-0 (2013-11-24) - -Features: - - - Remove memoization of thenables - -## 0.10.1-0 (2013-11-21) - -Features: - - - Add methods `Promise.resolve()`, `Promise.reject()`, `Promise.defer()` and `.resolve()`. - -## 0.10.0-1 (2013-11-17) - -## 0.10.0-0 (2013-11-17) - -Features: - - - Implement `Promise.method()` - - Implement `.return()` - - Implement `.throw()` - -Bugfixes: - - - Fix promises being able to use themselves as resolution or follower value - -## 0.9.11-1 (2013-11-14) - -Features: - - - Implicit `Promise.all()` when yielding an array from generators - -## 0.9.11-0 (2013-11-13) - -Bugfixes: - - - Fix `.spread` not unwrapping thenables - -## 0.9.10-2 (2013-11-13) - -Features: - - - Improve performance of promisified functions on V8 - -Bugfixes: - - - Report unhandled rejections even when long stack traces are disabled - - Fix `.error()` showing up in stack traces - -## 0.9.10-1 (2013-11-05) - -Bugfixes: - - - Catch filter method calls showing in stack traces - -## 0.9.10-0 (2013-11-05) - -Bugfixes: - - - Support primitives in catch filters - -## 0.9.9-0 (2013-11-05) - -Features: - - - Add `Promise.race()` and `.race()` - -## 0.9.8-0 (2013-11-01) - -Bugfixes: - - - Fix bug with `Promise.try` not unwrapping returned promises and thenables - -## 0.9.7-0 (2013-10-29) - -Bugfixes: - - - Fix bug with build files containing duplicated code for promise.js - -## 0.9.6-0 (2013-10-28) - -Features: - - - Improve output of reporting unhandled non-errors - - Implement RejectionError wrapping and `.error()` method - -## 0.9.5-0 (2013-10-27) - -Features: - - - Allow fresh copies of the library to be made - -## 0.9.4-1 (2013-10-27) - -## 0.9.4-0 (2013-10-27) - -Bugfixes: - - - Rollback non-working multiple fresh copies feature - -## 0.9.3-0 (2013-10-27) - -Features: - - - Allow fresh copies of the library to be made - - Add more components to customized builds - -## 0.9.2-1 (2013-10-25) - -## 0.9.2-0 (2013-10-25) - -Features: - - - Allow custom builds - -## 0.9.1-1 (2013-10-22) - -Bugfixes: - - - Fix unhandled rethrown exceptions not reported - -## 0.9.1-0 (2013-10-22) - -Features: - - - Improve performance of `Promise.try` - - Extend `Promise.try` to accept arguments and ctx to make it more usable in promisification of synchronous functions. - -## 0.9.0-0 (2013-10-18) - -Features: - - - Implement `.bind` and `Promise.bind` - -Bugfixes: - - - Fix `.some()` when argument is a pending promise that later resolves to an array - -## 0.8.5-1 (2013-10-17) - -Features: - - - Enable process wide long stack traces through BLUEBIRD_DEBUG environment variable - -## 0.8.5-0 (2013-10-16) - -Features: - - - Improve performance of all collection methods - -Bugfixes: - - - Fix .finally passing the value to handlers - - Remove kew from benchmarks due to bugs in the library breaking the benchmark - - Fix some bluebird library calls potentially appearing in stack traces - -## 0.8.4-1 (2013-10-15) - -Bugfixes: - - - Fix .pending() call showing in long stack traces - -## 0.8.4-0 (2013-10-15) - -Bugfixes: - - - Fix PromiseArray and its sub-classes swallowing possibly unhandled rejections - -## 0.8.3-3 (2013-10-14) - -Bugfixes: - - - Fix AMD-declaration using named module. - -## 0.8.3-2 (2013-10-14) - -Features: - - - The mortals that can handle it may now release Zalgo by `require("bluebird/zalgo");` - -## 0.8.3-1 (2013-10-14) - -Bugfixes: - - - Fix memory leak when using the same promise to attach handlers over and over again - -## 0.8.3-0 (2013-10-13) - -Features: - - - Add `Promise.props()` and `Promise.prototype.props()`. They work like `.all()` for object properties. - -Bugfixes: - - - Fix bug with .some returning garbage when sparse arrays have rejections - -## 0.8.2-2 (2013-10-13) - -Features: - - - Improve performance of `.reduce()` when `initialValue` can be synchronously cast to a value - -## 0.8.2-1 (2013-10-12) - -Bugfixes: - - - Fix .npmignore having irrelevant files - -## 0.8.2-0 (2013-10-12) - -Features: - - - Improve performance of `.some()` - -## 0.8.1-0 (2013-10-11) - -Bugfixes: - - - Remove uses of dynamic evaluation (`new Function`, `eval` etc) when strictly not necessary. Use feature detection to use static evaluation to avoid errors when dynamic evaluation is prohibited. - -## 0.8.0-3 (2013-10-10) - -Features: - - - Add `.asCallback` property to `PromiseResolver`s - -## 0.8.0-2 (2013-10-10) - -## 0.8.0-1 (2013-10-09) - -Features: - - - Improve overall performance. Be able to sustain infinite recursion when using promises. - -## 0.8.0-0 (2013-10-09) - -Bugfixes: - - - Fix stackoverflow error when function calls itself "synchronously" from a promise handler - -## 0.7.12-2 (2013-10-09) - -Bugfixes: - - - Fix safari 6 not using `MutationObserver` as a scheduler - - Fix process exceptions interfering with internal queue flushing - -## 0.7.12-1 (2013-10-09) - -Bugfixes: - - - Don't try to detect if generators are available to allow shims to be used - -## 0.7.12-0 (2013-10-08) - -Features: - - - Promisification now consider all functions on the object and its prototype chain - - Individual promisifcation uses current `this` if no explicit receiver is given - - Give better stack traces when promisified callbacks throw or errback primitives such as strings by wrapping them in an `Error` object. - -Bugfixes: - - - Fix runtime APIs throwing synchronous errors - -## 0.7.11-0 (2013-10-08) - -Features: - - - Deprecate `Promise.promisify(Object target)` in favor of `Promise.promisifyAll(Object target)` to avoid confusion with function objects - - Coroutines now throw error when a non-promise is `yielded` - -## 0.7.10-1 (2013-10-05) - -Features: - - - Make tests pass Internet Explorer 8 - -## 0.7.10-0 (2013-10-05) - -Features: - - - Create browser tests - -## 0.7.9-1 (2013-10-03) - -Bugfixes: - - - Fix promise cast bug when thenable fulfills using itself as the fulfillment value - -## 0.7.9-0 (2013-10-03) - -Features: - - - More performance improvements when long stack traces are enabled - -## 0.7.8-1 (2013-10-02) - -Features: - - - Performance improvements when long stack traces are enabled - -## 0.7.8-0 (2013-10-02) - -Bugfixes: - - - Fix promisified methods not turning synchronous exceptions into rejections - -## 0.7.7-1 (2013-10-02) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.7-0 (2013-10-01) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.6-0 (2013-09-29) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.5-0 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.4-1 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.4-0 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.3-1 (2013-09-28) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.3-0 (2013-09-27) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.2-0 (2013-09-27) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-5 (2013-09-26) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-4 (2013-09-25) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-3 (2013-09-25) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-2 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-1 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.1-0 (2013-09-24) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.0-1 (2013-09-23) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.7.0-0 (2013-09-23) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-2 (2013-09-20) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-1 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.5-0 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.4-1 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.4-0 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-4 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-3 (2013-09-18) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-2 (2013-09-16) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-1 (2013-09-16) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.3-0 (2013-09-15) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.2-1 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.2-0 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.1-0 (2013-09-14) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.6.0-0 (2013-09-13) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-6 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-5 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-4 (2013-09-12) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-3 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-2 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-1 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.9-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.8-1 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.8-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.7-0 (2013-09-11) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.6-1 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.6-0 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.5-1 (2013-09-10) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.5-0 (2013-09-09) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.4-1 (2013-09-08) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.4-0 (2013-09-08) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.3-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.2-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.1-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.5.0-0 (2013-09-07) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.4.0-0 (2013-09-06) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.3.0-1 (2013-09-06) - -Features: - - - feature - -Bugfixes: - - - bugfix - -## 0.3.0 (2013-09-06) diff --git a/src/node_modules/bluebird/js/browser/bluebird.js b/src/node_modules/bluebird/js/browser/bluebird.js deleted file mode 100644 index 58a08a3..0000000 --- a/src/node_modules/bluebird/js/browser/bluebird.js +++ /dev/null @@ -1,4887 +0,0 @@ -/* @preserve - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 Petka Antonov - * - * 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. - * - */ -/** - * bluebird build version 2.10.2 - * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers -*/ -!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Promise=e()}}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof _dereq_=="function"&&_dereq_;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof _dereq_=="function"&&_dereq_;for(var o=0;o 0; -}; - -Async.prototype.throwLater = function(fn, arg) { - if (arguments.length === 1) { - arg = fn; - fn = function () { throw arg; }; - } - if (typeof setTimeout !== "undefined") { - setTimeout(function() { - fn(arg); - }, 0); - } else try { - this._schedule(function() { - fn(arg); - }); - } catch (e) { - throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a"); - } -}; - -function AsyncInvokeLater(fn, receiver, arg) { - this._lateQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncInvoke(fn, receiver, arg) { - this._normalQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncSettlePromises(promise) { - this._normalQueue._pushOne(promise); - this._queueTick(); -} - -if (!util.hasDevTools) { - Async.prototype.invokeLater = AsyncInvokeLater; - Async.prototype.invoke = AsyncInvoke; - Async.prototype.settlePromises = AsyncSettlePromises; -} else { - if (schedule.isStatic) { - schedule = function(fn) { setTimeout(fn, 0); }; - } - Async.prototype.invokeLater = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvokeLater.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - setTimeout(function() { - fn.call(receiver, arg); - }, 100); - }); - } - }; - - Async.prototype.invoke = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvoke.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - fn.call(receiver, arg); - }); - } - }; - - Async.prototype.settlePromises = function(promise) { - if (this._trampolineEnabled) { - AsyncSettlePromises.call(this, promise); - } else { - this._schedule(function() { - promise._settlePromises(); - }); - } - }; -} - -Async.prototype.invokeFirst = function (fn, receiver, arg) { - this._normalQueue.unshift(fn, receiver, arg); - this._queueTick(); -}; - -Async.prototype._drainQueue = function(queue) { - while (queue.length() > 0) { - var fn = queue.shift(); - if (typeof fn !== "function") { - fn._settlePromises(); - continue; - } - var receiver = queue.shift(); - var arg = queue.shift(); - fn.call(receiver, arg); - } -}; - -Async.prototype._drainQueues = function () { - this._drainQueue(this._normalQueue); - this._reset(); - this._drainQueue(this._lateQueue); -}; - -Async.prototype._queueTick = function () { - if (!this._isTickUsed) { - this._isTickUsed = true; - this._schedule(this.drainQueues); - } -}; - -Async.prototype._reset = function () { - this._isTickUsed = false; -}; - -module.exports = new Async(); -module.exports.firstLineError = firstLineError; - -},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise) { -var rejectThis = function(_, e) { - this._reject(e); -}; - -var targetRejected = function(e, context) { - context.promiseRejectionQueued = true; - context.bindingPromise._then(rejectThis, rejectThis, null, this, e); -}; - -var bindingResolved = function(thisArg, context) { - if (this._isPending()) { - this._resolveCallback(context.target); - } -}; - -var bindingRejected = function(e, context) { - if (!context.promiseRejectionQueued) this._reject(e); -}; - -Promise.prototype.bind = function (thisArg) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - ret._propagateFrom(this, 1); - var target = this._target(); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - var context = { - promiseRejectionQueued: false, - promise: ret, - target: target, - bindingPromise: maybePromise - }; - target._then(INTERNAL, targetRejected, ret._progress, ret, context); - maybePromise._then( - bindingResolved, bindingRejected, ret._progress, ret, context); - } else { - ret._resolveCallback(target); - } - return ret; -}; - -Promise.prototype._setBoundTo = function (obj) { - if (obj !== undefined) { - this._bitField = this._bitField | 131072; - this._boundTo = obj; - } else { - this._bitField = this._bitField & (~131072); - } -}; - -Promise.prototype._isBound = function () { - return (this._bitField & 131072) === 131072; -}; - -Promise.bind = function (thisArg, value) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - maybePromise._then(function() { - ret._resolveCallback(value); - }, ret._reject, ret._progress, ret, null); - } else { - ret._resolveCallback(value); - } - return ret; -}; -}; - -},{}],4:[function(_dereq_,module,exports){ -"use strict"; -var old; -if (typeof Promise !== "undefined") old = Promise; -function noConflict() { - try { if (Promise === bluebird) Promise = old; } - catch (e) {} - return bluebird; -} -var bluebird = _dereq_("./promise.js")(); -bluebird.noConflict = noConflict; -module.exports = bluebird; - -},{"./promise.js":23}],5:[function(_dereq_,module,exports){ -"use strict"; -var cr = Object.create; -if (cr) { - var callerCache = cr(null); - var getterCache = cr(null); - callerCache[" size"] = getterCache[" size"] = 0; -} - -module.exports = function(Promise) { -var util = _dereq_("./util.js"); -var canEvaluate = util.canEvaluate; -var isIdentifier = util.isIdentifier; - -var getMethodCaller; -var getGetter; -if (!true) { -var makeMethodCaller = function (methodName) { - return new Function("ensureMethod", " \n\ - return function(obj) { \n\ - 'use strict' \n\ - var len = this.length; \n\ - ensureMethod(obj, 'methodName'); \n\ - switch(len) { \n\ - case 1: return obj.methodName(this[0]); \n\ - case 2: return obj.methodName(this[0], this[1]); \n\ - case 3: return obj.methodName(this[0], this[1], this[2]); \n\ - case 0: return obj.methodName(); \n\ - default: \n\ - return obj.methodName.apply(obj, this); \n\ - } \n\ - }; \n\ - ".replace(/methodName/g, methodName))(ensureMethod); -}; - -var makeGetter = function (propertyName) { - return new Function("obj", " \n\ - 'use strict'; \n\ - return obj.propertyName; \n\ - ".replace("propertyName", propertyName)); -}; - -var getCompiled = function(name, compiler, cache) { - var ret = cache[name]; - if (typeof ret !== "function") { - if (!isIdentifier(name)) { - return null; - } - ret = compiler(name); - cache[name] = ret; - cache[" size"]++; - if (cache[" size"] > 512) { - var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) delete cache[keys[i]]; - cache[" size"] = keys.length - 256; - } - } - return ret; -}; - -getMethodCaller = function(name) { - return getCompiled(name, makeMethodCaller, callerCache); -}; - -getGetter = function(name) { - return getCompiled(name, makeGetter, getterCache); -}; -} - -function ensureMethod(obj, methodName) { - var fn; - if (obj != null) fn = obj[methodName]; - if (typeof fn !== "function") { - var message = "Object " + util.classString(obj) + " has no method '" + - util.toString(methodName) + "'"; - throw new Promise.TypeError(message); - } - return fn; -} - -function caller(obj) { - var methodName = this.pop(); - var fn = ensureMethod(obj, methodName); - return fn.apply(obj, this); -} -Promise.prototype.call = function (methodName) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - if (!true) { - if (canEvaluate) { - var maybeCaller = getMethodCaller(methodName); - if (maybeCaller !== null) { - return this._then( - maybeCaller, undefined, undefined, args, undefined); - } - } - } - args.push(methodName); - return this._then(caller, undefined, undefined, args, undefined); -}; - -function namedGetter(obj) { - return obj[this]; -} -function indexedGetter(obj) { - var index = +this; - if (index < 0) index = Math.max(0, index + obj.length); - return obj[index]; -} -Promise.prototype.get = function (propertyName) { - var isIndex = (typeof propertyName === "number"); - var getter; - if (!isIndex) { - if (canEvaluate) { - var maybeGetter = getGetter(propertyName); - getter = maybeGetter !== null ? maybeGetter : namedGetter; - } else { - getter = namedGetter; - } - } else { - getter = indexedGetter; - } - return this._then(getter, undefined, undefined, propertyName, undefined); -}; -}; - -},{"./util.js":38}],6:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -var errors = _dereq_("./errors.js"); -var async = _dereq_("./async.js"); -var CancellationError = errors.CancellationError; - -Promise.prototype._cancel = function (reason) { - if (!this.isCancellable()) return this; - var parent; - var promiseToReject = this; - while ((parent = promiseToReject._cancellationParent) !== undefined && - parent.isCancellable()) { - promiseToReject = parent; - } - this._unsetCancellable(); - promiseToReject._target()._rejectCallback(reason, false, true); -}; - -Promise.prototype.cancel = function (reason) { - if (!this.isCancellable()) return this; - if (reason === undefined) reason = new CancellationError(); - async.invokeLater(this._cancel, this, reason); - return this; -}; - -Promise.prototype.cancellable = function () { - if (this._cancellable()) return this; - async.enableTrampoline(); - this._setCancellable(); - this._cancellationParent = undefined; - return this; -}; - -Promise.prototype.uncancellable = function () { - var ret = this.then(); - ret._unsetCancellable(); - return ret; -}; - -Promise.prototype.fork = function (didFulfill, didReject, didProgress) { - var ret = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - - ret._setCancellable(); - ret._cancellationParent = undefined; - return ret; -}; -}; - -},{"./async.js":2,"./errors.js":13}],7:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function() { -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var bluebirdFramePattern = - /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/; -var stackFramePattern = null; -var formatStack = null; -var indentStackFrames = false; -var warn; - -function CapturedTrace(parent) { - this._parent = parent; - var length = this._length = 1 + (parent === undefined ? 0 : parent._length); - captureStackTrace(this, CapturedTrace); - if (length > 32) this.uncycle(); -} -util.inherits(CapturedTrace, Error); - -CapturedTrace.prototype.uncycle = function() { - var length = this._length; - if (length < 2) return; - var nodes = []; - var stackToIndex = {}; - - for (var i = 0, node = this; node !== undefined; ++i) { - nodes.push(node); - node = node._parent; - } - length = this._length = i; - for (var i = length - 1; i >= 0; --i) { - var stack = nodes[i].stack; - if (stackToIndex[stack] === undefined) { - stackToIndex[stack] = i; - } - } - for (var i = 0; i < length; ++i) { - var currentStack = nodes[i].stack; - var index = stackToIndex[currentStack]; - if (index !== undefined && index !== i) { - if (index > 0) { - nodes[index - 1]._parent = undefined; - nodes[index - 1]._length = 1; - } - nodes[i]._parent = undefined; - nodes[i]._length = 1; - var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; - - if (index < length - 1) { - cycleEdgeNode._parent = nodes[index + 1]; - cycleEdgeNode._parent.uncycle(); - cycleEdgeNode._length = - cycleEdgeNode._parent._length + 1; - } else { - cycleEdgeNode._parent = undefined; - cycleEdgeNode._length = 1; - } - var currentChildLength = cycleEdgeNode._length + 1; - for (var j = i - 2; j >= 0; --j) { - nodes[j]._length = currentChildLength; - currentChildLength++; - } - return; - } - } -}; - -CapturedTrace.prototype.parent = function() { - return this._parent; -}; - -CapturedTrace.prototype.hasParent = function() { - return this._parent !== undefined; -}; - -CapturedTrace.prototype.attachExtraTrace = function(error) { - if (error.__stackCleaned__) return; - this.uncycle(); - var parsed = CapturedTrace.parseStackAndMessage(error); - var message = parsed.message; - var stacks = [parsed.stack]; - - var trace = this; - while (trace !== undefined) { - stacks.push(cleanStack(trace.stack.split("\n"))); - trace = trace._parent; - } - removeCommonRoots(stacks); - removeDuplicateOrEmptyJumps(stacks); - util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); - util.notEnumerableProp(error, "__stackCleaned__", true); -}; - -function reconstructStack(message, stacks) { - for (var i = 0; i < stacks.length - 1; ++i) { - stacks[i].push("From previous event:"); - stacks[i] = stacks[i].join("\n"); - } - if (i < stacks.length) { - stacks[i] = stacks[i].join("\n"); - } - return message + "\n" + stacks.join("\n"); -} - -function removeDuplicateOrEmptyJumps(stacks) { - for (var i = 0; i < stacks.length; ++i) { - if (stacks[i].length === 0 || - ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { - stacks.splice(i, 1); - i--; - } - } -} - -function removeCommonRoots(stacks) { - var current = stacks[0]; - for (var i = 1; i < stacks.length; ++i) { - var prev = stacks[i]; - var currentLastIndex = current.length - 1; - var currentLastLine = current[currentLastIndex]; - var commonRootMeetPoint = -1; - - for (var j = prev.length - 1; j >= 0; --j) { - if (prev[j] === currentLastLine) { - commonRootMeetPoint = j; - break; - } - } - - for (var j = commonRootMeetPoint; j >= 0; --j) { - var line = prev[j]; - if (current[currentLastIndex] === line) { - current.pop(); - currentLastIndex--; - } else { - break; - } - } - current = prev; - } -} - -function cleanStack(stack) { - var ret = []; - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - var isTraceLine = stackFramePattern.test(line) || - " (No stack trace)" === line; - var isInternalFrame = isTraceLine && shouldIgnore(line); - if (isTraceLine && !isInternalFrame) { - if (indentStackFrames && line.charAt(0) !== " ") { - line = " " + line; - } - ret.push(line); - } - } - return ret; -} - -function stackFramesAsArray(error) { - var stack = error.stack.replace(/\s+$/g, "").split("\n"); - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - if (" (No stack trace)" === line || stackFramePattern.test(line)) { - break; - } - } - if (i > 0) { - stack = stack.slice(i); - } - return stack; -} - -CapturedTrace.parseStackAndMessage = function(error) { - var stack = error.stack; - var message = error.toString(); - stack = typeof stack === "string" && stack.length > 0 - ? stackFramesAsArray(error) : [" (No stack trace)"]; - return { - message: message, - stack: cleanStack(stack) - }; -}; - -CapturedTrace.formatAndLogError = function(error, title) { - if (typeof console !== "undefined") { - var message; - if (typeof error === "object" || typeof error === "function") { - var stack = error.stack; - message = title + formatStack(stack, error); - } else { - message = title + String(error); - } - if (typeof warn === "function") { - warn(message); - } else if (typeof console.log === "function" || - typeof console.log === "object") { - console.log(message); - } - } -}; - -CapturedTrace.unhandledRejection = function (reason) { - CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: "); -}; - -CapturedTrace.isSupported = function () { - return typeof captureStackTrace === "function"; -}; - -CapturedTrace.fireRejectionEvent = -function(name, localHandler, reason, promise) { - var localEventFired = false; - try { - if (typeof localHandler === "function") { - localEventFired = true; - if (name === "rejectionHandled") { - localHandler(promise); - } else { - localHandler(reason, promise); - } - } - } catch (e) { - async.throwLater(e); - } - - var globalEventFired = false; - try { - globalEventFired = fireGlobalEvent(name, reason, promise); - } catch (e) { - globalEventFired = true; - async.throwLater(e); - } - - var domEventFired = false; - if (fireDomEvent) { - try { - domEventFired = fireDomEvent(name.toLowerCase(), { - reason: reason, - promise: promise - }); - } catch (e) { - domEventFired = true; - async.throwLater(e); - } - } - - if (!globalEventFired && !localEventFired && !domEventFired && - name === "unhandledRejection") { - CapturedTrace.formatAndLogError(reason, "Unhandled rejection "); - } -}; - -function formatNonError(obj) { - var str; - if (typeof obj === "function") { - str = "[function " + - (obj.name || "anonymous") + - "]"; - } else { - str = obj.toString(); - var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; - if (ruselessToString.test(str)) { - try { - var newStr = JSON.stringify(obj); - str = newStr; - } - catch(e) { - - } - } - if (str.length === 0) { - str = "(empty array)"; - } - } - return ("(<" + snip(str) + ">, no stack trace)"); -} - -function snip(str) { - var maxChars = 41; - if (str.length < maxChars) { - return str; - } - return str.substr(0, maxChars - 3) + "..."; -} - -var shouldIgnore = function() { return false; }; -var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; -function parseLineInfo(line) { - var matches = line.match(parseLineInfoRegex); - if (matches) { - return { - fileName: matches[1], - line: parseInt(matches[2], 10) - }; - } -} -CapturedTrace.setBounds = function(firstLineError, lastLineError) { - if (!CapturedTrace.isSupported()) return; - var firstStackLines = firstLineError.stack.split("\n"); - var lastStackLines = lastLineError.stack.split("\n"); - var firstIndex = -1; - var lastIndex = -1; - var firstFileName; - var lastFileName; - for (var i = 0; i < firstStackLines.length; ++i) { - var result = parseLineInfo(firstStackLines[i]); - if (result) { - firstFileName = result.fileName; - firstIndex = result.line; - break; - } - } - for (var i = 0; i < lastStackLines.length; ++i) { - var result = parseLineInfo(lastStackLines[i]); - if (result) { - lastFileName = result.fileName; - lastIndex = result.line; - break; - } - } - if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || - firstFileName !== lastFileName || firstIndex >= lastIndex) { - return; - } - - shouldIgnore = function(line) { - if (bluebirdFramePattern.test(line)) return true; - var info = parseLineInfo(line); - if (info) { - if (info.fileName === firstFileName && - (firstIndex <= info.line && info.line <= lastIndex)) { - return true; - } - } - return false; - }; -}; - -var captureStackTrace = (function stackDetection() { - var v8stackFramePattern = /^\s*at\s*/; - var v8stackFormatter = function(stack, error) { - if (typeof stack === "string") return stack; - - if (error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - if (typeof Error.stackTraceLimit === "number" && - typeof Error.captureStackTrace === "function") { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - var captureStackTrace = Error.captureStackTrace; - - shouldIgnore = function(line) { - return bluebirdFramePattern.test(line); - }; - return function(receiver, ignoreUntil) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - captureStackTrace(receiver, ignoreUntil); - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - var err = new Error(); - - if (typeof err.stack === "string" && - err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { - stackFramePattern = /@/; - formatStack = v8stackFormatter; - indentStackFrames = true; - return function captureStackTrace(o) { - o.stack = new Error().stack; - }; - } - - var hasStackAfterThrow; - try { throw new Error(); } - catch(e) { - hasStackAfterThrow = ("stack" in e); - } - if (!("stack" in err) && hasStackAfterThrow && - typeof Error.stackTraceLimit === "number") { - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - return function captureStackTrace(o) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - try { throw new Error(); } - catch(e) { o.stack = e.stack; } - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - - formatStack = function(stack, error) { - if (typeof stack === "string") return stack; - - if ((typeof error === "object" || - typeof error === "function") && - error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - return null; - -})([]); - -var fireDomEvent; -var fireGlobalEvent = (function() { - if (util.isNode) { - return function(name, reason, promise) { - if (name === "rejectionHandled") { - return process.emit(name, promise); - } else { - return process.emit(name, reason, promise); - } - }; - } else { - var customEventWorks = false; - var anyEventWorks = true; - try { - var ev = new self.CustomEvent("test"); - customEventWorks = ev instanceof CustomEvent; - } catch (e) {} - if (!customEventWorks) { - try { - var event = document.createEvent("CustomEvent"); - event.initCustomEvent("testingtheevent", false, true, {}); - self.dispatchEvent(event); - } catch (e) { - anyEventWorks = false; - } - } - if (anyEventWorks) { - fireDomEvent = function(type, detail) { - var event; - if (customEventWorks) { - event = new self.CustomEvent(type, { - detail: detail, - bubbles: false, - cancelable: true - }); - } else if (self.dispatchEvent) { - event = document.createEvent("CustomEvent"); - event.initCustomEvent(type, false, true, detail); - } - - return event ? !self.dispatchEvent(event) : false; - }; - } - - var toWindowMethodNameMap = {}; - toWindowMethodNameMap["unhandledRejection"] = ("on" + - "unhandledRejection").toLowerCase(); - toWindowMethodNameMap["rejectionHandled"] = ("on" + - "rejectionHandled").toLowerCase(); - - return function(name, reason, promise) { - var methodName = toWindowMethodNameMap[name]; - var method = self[methodName]; - if (!method) return false; - if (name === "rejectionHandled") { - method.call(self, promise); - } else { - method.call(self, reason, promise); - } - return true; - }; - } -})(); - -if (typeof console !== "undefined" && typeof console.warn !== "undefined") { - warn = function (message) { - console.warn(message); - }; - if (util.isNode && process.stderr.isTTY) { - warn = function(message) { - process.stderr.write("\u001b[31m" + message + "\u001b[39m\n"); - }; - } else if (!util.isNode && typeof (new Error().stack) === "string") { - warn = function(message) { - console.warn("%c" + message, "color: red"); - }; - } -} - -return CapturedTrace; -}; - -},{"./async.js":2,"./util.js":38}],8:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(NEXT_FILTER) { -var util = _dereq_("./util.js"); -var errors = _dereq_("./errors.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var keys = _dereq_("./es5.js").keys; -var TypeError = errors.TypeError; - -function CatchFilter(instances, callback, promise) { - this._instances = instances; - this._callback = callback; - this._promise = promise; -} - -function safePredicate(predicate, e) { - var safeObject = {}; - var retfilter = tryCatch(predicate).call(safeObject, e); - - if (retfilter === errorObj) return retfilter; - - var safeKeys = keys(safeObject); - if (safeKeys.length) { - errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"); - return errorObj; - } - return retfilter; -} - -CatchFilter.prototype.doFilter = function (e) { - var cb = this._callback; - var promise = this._promise; - var boundTo = promise._boundValue(); - for (var i = 0, len = this._instances.length; i < len; ++i) { - var item = this._instances[i]; - var itemIsErrorType = item === Error || - (item != null && item.prototype instanceof Error); - - if (itemIsErrorType && e instanceof item) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } else if (typeof item === "function" && !itemIsErrorType) { - var shouldHandle = safePredicate(item, e); - if (shouldHandle === errorObj) { - e = errorObj.e; - break; - } else if (shouldHandle) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } - } - } - NEXT_FILTER.e = e; - return NEXT_FILTER; -}; - -return CatchFilter; -}; - -},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, CapturedTrace, isDebugging) { -var contextStack = []; -function Context() { - this._trace = new CapturedTrace(peekContext()); -} -Context.prototype._pushContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.push(this._trace); - } -}; - -Context.prototype._popContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.pop(); - } -}; - -function createContext() { - if (isDebugging()) return new Context(); -} - -function peekContext() { - var lastIndex = contextStack.length - 1; - if (lastIndex >= 0) { - return contextStack[lastIndex]; - } - return undefined; -} - -Promise.prototype._peekContext = peekContext; -Promise.prototype._pushContext = Context.prototype._pushContext; -Promise.prototype._popContext = Context.prototype._popContext; - -return createContext; -}; - -},{}],10:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, CapturedTrace) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var Warning = _dereq_("./errors.js").Warning; -var util = _dereq_("./util.js"); -var canAttachTrace = util.canAttachTrace; -var unhandledRejectionHandled; -var possiblyUnhandledRejection; -var debugging = false || (util.isNode && - (!!process.env["BLUEBIRD_DEBUG"] || - process.env["NODE_ENV"] === "development")); - -if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false; - -if (debugging) { - async.disableTrampolineIfNecessary(); -} - -Promise.prototype._ignoreRejections = function() { - this._unsetRejectionIsUnhandled(); - this._bitField = this._bitField | 16777216; -}; - -Promise.prototype._ensurePossibleRejectionHandled = function () { - if ((this._bitField & 16777216) !== 0) return; - this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); -}; - -Promise.prototype._notifyUnhandledRejectionIsHandled = function () { - CapturedTrace.fireRejectionEvent("rejectionHandled", - unhandledRejectionHandled, undefined, this); -}; - -Promise.prototype._notifyUnhandledRejection = function () { - if (this._isRejectionUnhandled()) { - var reason = this._getCarriedStackTrace() || this._settledValue; - this._setUnhandledRejectionIsNotified(); - CapturedTrace.fireRejectionEvent("unhandledRejection", - possiblyUnhandledRejection, reason, this); - } -}; - -Promise.prototype._setUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField | 524288; -}; - -Promise.prototype._unsetUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField & (~524288); -}; - -Promise.prototype._isUnhandledRejectionNotified = function () { - return (this._bitField & 524288) > 0; -}; - -Promise.prototype._setRejectionIsUnhandled = function () { - this._bitField = this._bitField | 2097152; -}; - -Promise.prototype._unsetRejectionIsUnhandled = function () { - this._bitField = this._bitField & (~2097152); - if (this._isUnhandledRejectionNotified()) { - this._unsetUnhandledRejectionIsNotified(); - this._notifyUnhandledRejectionIsHandled(); - } -}; - -Promise.prototype._isRejectionUnhandled = function () { - return (this._bitField & 2097152) > 0; -}; - -Promise.prototype._setCarriedStackTrace = function (capturedTrace) { - this._bitField = this._bitField | 1048576; - this._fulfillmentHandler0 = capturedTrace; -}; - -Promise.prototype._isCarryingStackTrace = function () { - return (this._bitField & 1048576) > 0; -}; - -Promise.prototype._getCarriedStackTrace = function () { - return this._isCarryingStackTrace() - ? this._fulfillmentHandler0 - : undefined; -}; - -Promise.prototype._captureStackTrace = function () { - if (debugging) { - this._trace = new CapturedTrace(this._peekContext()); - } - return this; -}; - -Promise.prototype._attachExtraTrace = function (error, ignoreSelf) { - if (debugging && canAttachTrace(error)) { - var trace = this._trace; - if (trace !== undefined) { - if (ignoreSelf) trace = trace._parent; - } - if (trace !== undefined) { - trace.attachExtraTrace(error); - } else if (!error.__stackCleaned__) { - var parsed = CapturedTrace.parseStackAndMessage(error); - util.notEnumerableProp(error, "stack", - parsed.message + "\n" + parsed.stack.join("\n")); - util.notEnumerableProp(error, "__stackCleaned__", true); - } - } -}; - -Promise.prototype._warn = function(message) { - var warning = new Warning(message); - var ctx = this._peekContext(); - if (ctx) { - ctx.attachExtraTrace(warning); - } else { - var parsed = CapturedTrace.parseStackAndMessage(warning); - warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); - } - CapturedTrace.formatAndLogError(warning, ""); -}; - -Promise.onPossiblyUnhandledRejection = function (fn) { - var domain = getDomain(); - possiblyUnhandledRejection = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.onUnhandledRejectionHandled = function (fn) { - var domain = getDomain(); - unhandledRejectionHandled = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.longStackTraces = function () { - if (async.haveItemsQueued() && - debugging === false - ) { - throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a"); - } - debugging = CapturedTrace.isSupported(); - if (debugging) { - async.disableTrampolineIfNecessary(); - } -}; - -Promise.hasLongStackTraces = function () { - return debugging && CapturedTrace.isSupported(); -}; - -if (!CapturedTrace.isSupported()) { - Promise.longStackTraces = function(){}; - debugging = false; -} - -return function() { - return debugging; -}; -}; - -},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(_dereq_,module,exports){ -"use strict"; -var util = _dereq_("./util.js"); -var isPrimitive = util.isPrimitive; - -module.exports = function(Promise) { -var returner = function () { - return this; -}; -var thrower = function () { - throw this; -}; -var returnUndefined = function() {}; -var throwUndefined = function() { - throw undefined; -}; - -var wrapper = function (value, action) { - if (action === 1) { - return function () { - throw value; - }; - } else if (action === 2) { - return function () { - return value; - }; - } -}; - - -Promise.prototype["return"] = -Promise.prototype.thenReturn = function (value) { - if (value === undefined) return this.then(returnUndefined); - - if (isPrimitive(value)) { - return this._then( - wrapper(value, 2), - undefined, - undefined, - undefined, - undefined - ); - } else if (value instanceof Promise) { - value._ignoreRejections(); - } - return this._then(returner, undefined, undefined, value, undefined); -}; - -Promise.prototype["throw"] = -Promise.prototype.thenThrow = function (reason) { - if (reason === undefined) return this.then(throwUndefined); - - if (isPrimitive(reason)) { - return this._then( - wrapper(reason, 1), - undefined, - undefined, - undefined, - undefined - ); - } - return this._then(thrower, undefined, undefined, reason, undefined); -}; -}; - -},{"./util.js":38}],12:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseReduce = Promise.reduce; - -Promise.prototype.each = function (fn) { - return PromiseReduce(this, fn, null, INTERNAL); -}; - -Promise.each = function (promises, fn) { - return PromiseReduce(promises, fn, null, INTERNAL); -}; -}; - -},{}],13:[function(_dereq_,module,exports){ -"use strict"; -var es5 = _dereq_("./es5.js"); -var Objectfreeze = es5.freeze; -var util = _dereq_("./util.js"); -var inherits = util.inherits; -var notEnumerableProp = util.notEnumerableProp; - -function subError(nameProperty, defaultMessage) { - function SubError(message) { - if (!(this instanceof SubError)) return new SubError(message); - notEnumerableProp(this, "message", - typeof message === "string" ? message : defaultMessage); - notEnumerableProp(this, "name", nameProperty); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - Error.call(this); - } - } - inherits(SubError, Error); - return SubError; -} - -var _TypeError, _RangeError; -var Warning = subError("Warning", "warning"); -var CancellationError = subError("CancellationError", "cancellation error"); -var TimeoutError = subError("TimeoutError", "timeout error"); -var AggregateError = subError("AggregateError", "aggregate error"); -try { - _TypeError = TypeError; - _RangeError = RangeError; -} catch(e) { - _TypeError = subError("TypeError", "type error"); - _RangeError = subError("RangeError", "range error"); -} - -var methods = ("join pop push shift unshift slice filter forEach some " + - "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); - -for (var i = 0; i < methods.length; ++i) { - if (typeof Array.prototype[methods[i]] === "function") { - AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; - } -} - -es5.defineProperty(AggregateError.prototype, "length", { - value: 0, - configurable: false, - writable: true, - enumerable: true -}); -AggregateError.prototype["isOperational"] = true; -var level = 0; -AggregateError.prototype.toString = function() { - var indent = Array(level * 4 + 1).join(" "); - var ret = "\n" + indent + "AggregateError of:" + "\n"; - level++; - indent = Array(level * 4 + 1).join(" "); - for (var i = 0; i < this.length; ++i) { - var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; - var lines = str.split("\n"); - for (var j = 0; j < lines.length; ++j) { - lines[j] = indent + lines[j]; - } - str = lines.join("\n"); - ret += str + "\n"; - } - level--; - return ret; -}; - -function OperationalError(message) { - if (!(this instanceof OperationalError)) - return new OperationalError(message); - notEnumerableProp(this, "name", "OperationalError"); - notEnumerableProp(this, "message", message); - this.cause = message; - this["isOperational"] = true; - - if (message instanceof Error) { - notEnumerableProp(this, "message", message.message); - notEnumerableProp(this, "stack", message.stack); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - -} -inherits(OperationalError, Error); - -var errorTypes = Error["__BluebirdErrorTypes__"]; -if (!errorTypes) { - errorTypes = Objectfreeze({ - CancellationError: CancellationError, - TimeoutError: TimeoutError, - OperationalError: OperationalError, - RejectionError: OperationalError, - AggregateError: AggregateError - }); - notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); -} - -module.exports = { - Error: Error, - TypeError: _TypeError, - RangeError: _RangeError, - CancellationError: errorTypes.CancellationError, - OperationalError: errorTypes.OperationalError, - TimeoutError: errorTypes.TimeoutError, - AggregateError: errorTypes.AggregateError, - Warning: Warning -}; - -},{"./es5.js":14,"./util.js":38}],14:[function(_dereq_,module,exports){ -var isES5 = (function(){ - "use strict"; - return this === undefined; -})(); - -if (isES5) { - module.exports = { - freeze: Object.freeze, - defineProperty: Object.defineProperty, - getDescriptor: Object.getOwnPropertyDescriptor, - keys: Object.keys, - names: Object.getOwnPropertyNames, - getPrototypeOf: Object.getPrototypeOf, - isArray: Array.isArray, - isES5: isES5, - propertyIsWritable: function(obj, prop) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop); - return !!(!descriptor || descriptor.writable || descriptor.set); - } - }; -} else { - var has = {}.hasOwnProperty; - var str = {}.toString; - var proto = {}.constructor.prototype; - - var ObjectKeys = function (o) { - var ret = []; - for (var key in o) { - if (has.call(o, key)) { - ret.push(key); - } - } - return ret; - }; - - var ObjectGetDescriptor = function(o, key) { - return {value: o[key]}; - }; - - var ObjectDefineProperty = function (o, key, desc) { - o[key] = desc.value; - return o; - }; - - var ObjectFreeze = function (obj) { - return obj; - }; - - var ObjectGetPrototypeOf = function (obj) { - try { - return Object(obj).constructor.prototype; - } - catch (e) { - return proto; - } - }; - - var ArrayIsArray = function (obj) { - try { - return str.call(obj) === "[object Array]"; - } - catch(e) { - return false; - } - }; - - module.exports = { - isArray: ArrayIsArray, - keys: ObjectKeys, - names: ObjectKeys, - defineProperty: ObjectDefineProperty, - getDescriptor: ObjectGetDescriptor, - freeze: ObjectFreeze, - getPrototypeOf: ObjectGetPrototypeOf, - isES5: isES5, - propertyIsWritable: function() { - return true; - } - }; -} - -},{}],15:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseMap = Promise.map; - -Promise.prototype.filter = function (fn, options) { - return PromiseMap(this, fn, options, INTERNAL); -}; - -Promise.filter = function (promises, fn, options) { - return PromiseMap(promises, fn, options, INTERNAL); -}; -}; - -},{}],16:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) { -var util = _dereq_("./util.js"); -var isPrimitive = util.isPrimitive; -var thrower = util.thrower; - -function returnThis() { - return this; -} -function throwThis() { - throw this; -} -function return$(r) { - return function() { - return r; - }; -} -function throw$(r) { - return function() { - throw r; - }; -} -function promisedFinally(ret, reasonOrValue, isFulfilled) { - var then; - if (isPrimitive(reasonOrValue)) { - then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); - } else { - then = isFulfilled ? returnThis : throwThis; - } - return ret._then(then, thrower, undefined, reasonOrValue, undefined); -} - -function finallyHandler(reasonOrValue) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue()) - : handler(); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, reasonOrValue, - promise.isFulfilled()); - } - } - - if (promise.isRejected()) { - NEXT_FILTER.e = reasonOrValue; - return NEXT_FILTER; - } else { - return reasonOrValue; - } -} - -function tapHandler(value) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue(), value) - : handler(value); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, value, true); - } - } - return value; -} - -Promise.prototype._passThroughHandler = function (handler, isFinally) { - if (typeof handler !== "function") return this.then(); - - var promiseAndHandler = { - promise: this, - handler: handler - }; - - return this._then( - isFinally ? finallyHandler : tapHandler, - isFinally ? finallyHandler : undefined, undefined, - promiseAndHandler, undefined); -}; - -Promise.prototype.lastly = -Promise.prototype["finally"] = function (handler) { - return this._passThroughHandler(handler, true); -}; - -Promise.prototype.tap = function (handler) { - return this._passThroughHandler(handler, false); -}; -}; - -},{"./util.js":38}],17:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - apiRejection, - INTERNAL, - tryConvertToPromise) { -var errors = _dereq_("./errors.js"); -var TypeError = errors.TypeError; -var util = _dereq_("./util.js"); -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -var yieldHandlers = []; - -function promiseFromYieldHandler(value, yieldHandlers, traceParent) { - for (var i = 0; i < yieldHandlers.length; ++i) { - traceParent._pushContext(); - var result = tryCatch(yieldHandlers[i])(value); - traceParent._popContext(); - if (result === errorObj) { - traceParent._pushContext(); - var ret = Promise.reject(errorObj.e); - traceParent._popContext(); - return ret; - } - var maybePromise = tryConvertToPromise(result, traceParent); - if (maybePromise instanceof Promise) return maybePromise; - } - return null; -} - -function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { - var promise = this._promise = new Promise(INTERNAL); - promise._captureStackTrace(); - this._stack = stack; - this._generatorFunction = generatorFunction; - this._receiver = receiver; - this._generator = undefined; - this._yieldHandlers = typeof yieldHandler === "function" - ? [yieldHandler].concat(yieldHandlers) - : yieldHandlers; -} - -PromiseSpawn.prototype.promise = function () { - return this._promise; -}; - -PromiseSpawn.prototype._run = function () { - this._generator = this._generatorFunction.call(this._receiver); - this._receiver = - this._generatorFunction = undefined; - this._next(undefined); -}; - -PromiseSpawn.prototype._continue = function (result) { - if (result === errorObj) { - return this._promise._rejectCallback(result.e, false, true); - } - - var value = result.value; - if (result.done === true) { - this._promise._resolveCallback(value); - } else { - var maybePromise = tryConvertToPromise(value, this._promise); - if (!(maybePromise instanceof Promise)) { - maybePromise = - promiseFromYieldHandler(maybePromise, - this._yieldHandlers, - this._promise); - if (maybePromise === null) { - this._throw( - new TypeError( - "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) + - "From coroutine:\u000a" + - this._stack.split("\n").slice(1, -7).join("\n") - ) - ); - return; - } - } - maybePromise._then( - this._next, - this._throw, - undefined, - this, - null - ); - } -}; - -PromiseSpawn.prototype._throw = function (reason) { - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - var result = tryCatch(this._generator["throw"]) - .call(this._generator, reason); - this._promise._popContext(); - this._continue(result); -}; - -PromiseSpawn.prototype._next = function (value) { - this._promise._pushContext(); - var result = tryCatch(this._generator.next).call(this._generator, value); - this._promise._popContext(); - this._continue(result); -}; - -Promise.coroutine = function (generatorFunction, options) { - if (typeof generatorFunction !== "function") { - throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var yieldHandler = Object(options).yieldHandler; - var PromiseSpawn$ = PromiseSpawn; - var stack = new Error().stack; - return function () { - var generator = generatorFunction.apply(this, arguments); - var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, - stack); - spawn._generator = generator; - spawn._next(undefined); - return spawn.promise(); - }; -}; - -Promise.coroutine.addYieldHandler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - yieldHandlers.push(fn); -}; - -Promise.spawn = function (generatorFunction) { - if (typeof generatorFunction !== "function") { - return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var spawn = new PromiseSpawn(generatorFunction, this); - var ret = spawn.promise(); - spawn._run(Promise.spawn); - return ret; -}; -}; - -},{"./errors.js":13,"./util.js":38}],18:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { -var util = _dereq_("./util.js"); -var canEvaluate = util.canEvaluate; -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var reject; - -if (!true) { -if (canEvaluate) { - var thenCallback = function(i) { - return new Function("value", "holder", " \n\ - 'use strict'; \n\ - holder.pIndex = value; \n\ - holder.checkFulfillment(this); \n\ - ".replace(/Index/g, i)); - }; - - var caller = function(count) { - var values = []; - for (var i = 1; i <= count; ++i) values.push("holder.p" + i); - return new Function("holder", " \n\ - 'use strict'; \n\ - var callback = holder.fn; \n\ - return callback(values); \n\ - ".replace(/values/g, values.join(", "))); - }; - var thenCallbacks = []; - var callers = [undefined]; - for (var i = 1; i <= 5; ++i) { - thenCallbacks.push(thenCallback(i)); - callers.push(caller(i)); - } - - var Holder = function(total, fn) { - this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; - this.fn = fn; - this.total = total; - this.now = 0; - }; - - Holder.prototype.callers = callers; - Holder.prototype.checkFulfillment = function(promise) { - var now = this.now; - now++; - var total = this.total; - if (now >= total) { - var handler = this.callers[total]; - promise._pushContext(); - var ret = tryCatch(handler)(this); - promise._popContext(); - if (ret === errorObj) { - promise._rejectCallback(ret.e, false, true); - } else { - promise._resolveCallback(ret); - } - } else { - this.now = now; - } - }; - - var reject = function (reason) { - this._reject(reason); - }; -} -} - -Promise.join = function () { - var last = arguments.length - 1; - var fn; - if (last > 0 && typeof arguments[last] === "function") { - fn = arguments[last]; - if (!true) { - if (last < 6 && canEvaluate) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - var holder = new Holder(last, fn); - var callbacks = thenCallbacks; - for (var i = 0; i < last; ++i) { - var maybePromise = tryConvertToPromise(arguments[i], ret); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._then(callbacks[i], reject, - undefined, ret, holder); - } else if (maybePromise._isFulfilled()) { - callbacks[i].call(ret, - maybePromise._value(), holder); - } else { - ret._reject(maybePromise._reason()); - } - } else { - callbacks[i].call(ret, maybePromise, holder); - } - } - return ret; - } - } - } - var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} - if (fn) args.pop(); - var ret = new PromiseArray(args).promise(); - return fn !== undefined ? ret.spread(fn) : ret; -}; - -}; - -},{"./util.js":38}],19:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var PENDING = {}; -var EMPTY_ARRAY = []; - -function MappingPromiseArray(promises, fn, limit, _filter) { - this.constructor$(promises); - this._promise._captureStackTrace(); - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._preservedValues = _filter === INTERNAL - ? new Array(this.length()) - : null; - this._limit = limit; - this._inFlight = 0; - this._queue = limit >= 1 ? [] : EMPTY_ARRAY; - async.invoke(init, this, undefined); -} -util.inherits(MappingPromiseArray, PromiseArray); -function init() {this._init$(undefined, -2);} - -MappingPromiseArray.prototype._init = function () {}; - -MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - var length = this.length(); - var preservedValues = this._preservedValues; - var limit = this._limit; - if (values[index] === PENDING) { - values[index] = value; - if (limit >= 1) { - this._inFlight--; - this._drainQueue(); - if (this._isResolved()) return; - } - } else { - if (limit >= 1 && this._inFlight >= limit) { - values[index] = value; - this._queue.push(index); - return; - } - if (preservedValues !== null) preservedValues[index] = value; - - var callback = this._callback; - var receiver = this._promise._boundValue(); - this._promise._pushContext(); - var ret = tryCatch(callback).call(receiver, value, index, length); - this._promise._popContext(); - if (ret === errorObj) return this._reject(ret.e); - - var maybePromise = tryConvertToPromise(ret, this._promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - if (limit >= 1) this._inFlight++; - values[index] = PENDING; - return maybePromise._proxyPromiseArray(this, index); - } else if (maybePromise._isFulfilled()) { - ret = maybePromise._value(); - } else { - return this._reject(maybePromise._reason()); - } - } - values[index] = ret; - } - var totalResolved = ++this._totalResolved; - if (totalResolved >= length) { - if (preservedValues !== null) { - this._filter(values, preservedValues); - } else { - this._resolve(values); - } - - } -}; - -MappingPromiseArray.prototype._drainQueue = function () { - var queue = this._queue; - var limit = this._limit; - var values = this._values; - while (queue.length > 0 && this._inFlight < limit) { - if (this._isResolved()) return; - var index = queue.pop(); - this._promiseFulfilled(values[index], index); - } -}; - -MappingPromiseArray.prototype._filter = function (booleans, values) { - var len = values.length; - var ret = new Array(len); - var j = 0; - for (var i = 0; i < len; ++i) { - if (booleans[i]) ret[j++] = values[i]; - } - ret.length = j; - this._resolve(ret); -}; - -MappingPromiseArray.prototype.preservedValues = function () { - return this._preservedValues; -}; - -function map(promises, fn, options, _filter) { - var limit = typeof options === "object" && options !== null - ? options.concurrency - : 0; - limit = typeof limit === "number" && - isFinite(limit) && limit >= 1 ? limit : 0; - return new MappingPromiseArray(promises, fn, limit, _filter); -} - -Promise.prototype.map = function (fn, options) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - return map(this, fn, options, null).promise(); -}; - -Promise.map = function (promises, fn, options, _filter) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - return map(promises, fn, options, _filter).promise(); -}; - - -}; - -},{"./async.js":2,"./util.js":38}],20:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; - -Promise.method = function (fn) { - if (typeof fn !== "function") { - throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - return function () { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = tryCatch(fn).apply(this, arguments); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; - }; -}; - -Promise.attempt = Promise["try"] = function (fn, args, ctx) { - if (typeof fn !== "function") { - return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = util.isArray(args) - ? tryCatch(fn).apply(ctx, args) - : tryCatch(fn).call(ctx, args); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; -}; - -Promise.prototype._resolveFromSyncValue = function (value) { - if (value === util.errorObj) { - this._rejectCallback(value.e, false, true); - } else { - this._resolveCallback(value, true); - } -}; -}; - -},{"./util.js":38}],21:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -var util = _dereq_("./util.js"); -var async = _dereq_("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -function spreadAdapter(val, nodeback) { - var promise = this; - if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); - var ret = - tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -function successAdapter(val, nodeback) { - var promise = this; - var receiver = promise._boundValue(); - var ret = val === undefined - ? tryCatch(nodeback).call(receiver, null) - : tryCatch(nodeback).call(receiver, null, val); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} -function errorAdapter(reason, nodeback) { - var promise = this; - if (!reason) { - var target = promise._target(); - var newReason = target._getCarriedStackTrace(); - newReason.cause = reason; - reason = newReason; - } - var ret = tryCatch(nodeback).call(promise._boundValue(), reason); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -Promise.prototype.asCallback = -Promise.prototype.nodeify = function (nodeback, options) { - if (typeof nodeback == "function") { - var adapter = successAdapter; - if (options !== undefined && Object(options).spread) { - adapter = spreadAdapter; - } - this._then( - adapter, - errorAdapter, - undefined, - this, - nodeback - ); - } - return this; -}; -}; - -},{"./async.js":2,"./util.js":38}],22:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, PromiseArray) { -var util = _dereq_("./util.js"); -var async = _dereq_("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -Promise.prototype.progressed = function (handler) { - return this._then(undefined, undefined, handler, undefined, undefined); -}; - -Promise.prototype._progress = function (progressValue) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._target()._progressUnchecked(progressValue); - -}; - -Promise.prototype._progressHandlerAt = function (index) { - return index === 0 - ? this._progressHandler0 - : this[(index << 2) + index - 5 + 2]; -}; - -Promise.prototype._doProgressWith = function (progression) { - var progressValue = progression.value; - var handler = progression.handler; - var promise = progression.promise; - var receiver = progression.receiver; - - var ret = tryCatch(handler).call(receiver, progressValue); - if (ret === errorObj) { - if (ret.e != null && - ret.e.name !== "StopProgressPropagation") { - var trace = util.canAttachTrace(ret.e) - ? ret.e : new Error(util.toString(ret.e)); - promise._attachExtraTrace(trace); - promise._progress(ret.e); - } - } else if (ret instanceof Promise) { - ret._then(promise._progress, null, null, promise, undefined); - } else { - promise._progress(ret); - } -}; - - -Promise.prototype._progressUnchecked = function (progressValue) { - var len = this._length(); - var progress = this._progress; - for (var i = 0; i < len; i++) { - var handler = this._progressHandlerAt(i); - var promise = this._promiseAt(i); - if (!(promise instanceof Promise)) { - var receiver = this._receiverAt(i); - if (typeof handler === "function") { - handler.call(receiver, progressValue, promise); - } else if (receiver instanceof PromiseArray && - !receiver._isResolved()) { - receiver._promiseProgressed(progressValue, promise); - } - continue; - } - - if (typeof handler === "function") { - async.invoke(this._doProgressWith, this, { - handler: handler, - promise: promise, - receiver: this._receiverAt(i), - value: progressValue - }); - } else { - async.invoke(progress, promise, progressValue); - } - } -}; -}; - -},{"./async.js":2,"./util.js":38}],23:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function() { -var makeSelfResolutionError = function () { - return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a"); -}; -var reflect = function() { - return new Promise.PromiseInspection(this._target()); -}; -var apiRejection = function(msg) { - return Promise.reject(new TypeError(msg)); -}; - -var util = _dereq_("./util.js"); - -var getDomain; -if (util.isNode) { - getDomain = function() { - var ret = process.domain; - if (ret === undefined) ret = null; - return ret; - }; -} else { - getDomain = function() { - return null; - }; -} -util.notEnumerableProp(Promise, "_getDomain", getDomain); - -var UNDEFINED_BINDING = {}; -var async = _dereq_("./async.js"); -var errors = _dereq_("./errors.js"); -var TypeError = Promise.TypeError = errors.TypeError; -Promise.RangeError = errors.RangeError; -Promise.CancellationError = errors.CancellationError; -Promise.TimeoutError = errors.TimeoutError; -Promise.OperationalError = errors.OperationalError; -Promise.RejectionError = errors.OperationalError; -Promise.AggregateError = errors.AggregateError; -var INTERNAL = function(){}; -var APPLY = {}; -var NEXT_FILTER = {e: null}; -var tryConvertToPromise = _dereq_("./thenables.js")(Promise, INTERNAL); -var PromiseArray = - _dereq_("./promise_array.js")(Promise, INTERNAL, - tryConvertToPromise, apiRejection); -var CapturedTrace = _dereq_("./captured_trace.js")(); -var isDebugging = _dereq_("./debuggability.js")(Promise, CapturedTrace); - /*jshint unused:false*/ -var createContext = - _dereq_("./context.js")(Promise, CapturedTrace, isDebugging); -var CatchFilter = _dereq_("./catch_filter.js")(NEXT_FILTER); -var PromiseResolver = _dereq_("./promise_resolver.js"); -var nodebackForPromise = PromiseResolver._nodebackForPromise; -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -function Promise(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a"); - } - if (this.constructor !== Promise) { - throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a"); - } - this._bitField = 0; - this._fulfillmentHandler0 = undefined; - this._rejectionHandler0 = undefined; - this._progressHandler0 = undefined; - this._promise0 = undefined; - this._receiver0 = undefined; - this._settledValue = undefined; - if (resolver !== INTERNAL) this._resolveFromResolver(resolver); -} - -Promise.prototype.toString = function () { - return "[object Promise]"; -}; - -Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { - var len = arguments.length; - if (len > 1) { - var catchInstances = new Array(len - 1), - j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (typeof item === "function") { - catchInstances[j++] = item; - } else { - return Promise.reject( - new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a")); - } - } - catchInstances.length = j; - fn = arguments[i]; - var catchFilter = new CatchFilter(catchInstances, fn, this); - return this._then(undefined, catchFilter.doFilter, undefined, - catchFilter, undefined); - } - return this._then(undefined, fn, undefined, undefined, undefined); -}; - -Promise.prototype.reflect = function () { - return this._then(reflect, reflect, undefined, this, undefined); -}; - -Promise.prototype.then = function (didFulfill, didReject, didProgress) { - if (isDebugging() && arguments.length > 0 && - typeof didFulfill !== "function" && - typeof didReject !== "function") { - var msg = ".then() only accepts functions but was passed: " + - util.classString(didFulfill); - if (arguments.length > 1) { - msg += ", " + util.classString(didReject); - } - this._warn(msg); - } - return this._then(didFulfill, didReject, didProgress, - undefined, undefined); -}; - -Promise.prototype.done = function (didFulfill, didReject, didProgress) { - var promise = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - promise._setIsFinal(); -}; - -Promise.prototype.spread = function (didFulfill, didReject) { - return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined); -}; - -Promise.prototype.isCancellable = function () { - return !this.isResolved() && - this._cancellable(); -}; - -Promise.prototype.toJSON = function () { - var ret = { - isFulfilled: false, - isRejected: false, - fulfillmentValue: undefined, - rejectionReason: undefined - }; - if (this.isFulfilled()) { - ret.fulfillmentValue = this.value(); - ret.isFulfilled = true; - } else if (this.isRejected()) { - ret.rejectionReason = this.reason(); - ret.isRejected = true; - } - return ret; -}; - -Promise.prototype.all = function () { - return new PromiseArray(this).promise(); -}; - -Promise.prototype.error = function (fn) { - return this.caught(util.originatesFromRejection, fn); -}; - -Promise.is = function (val) { - return val instanceof Promise; -}; - -Promise.fromNode = function(fn) { - var ret = new Promise(INTERNAL); - var result = tryCatch(fn)(nodebackForPromise(ret)); - if (result === errorObj) { - ret._rejectCallback(result.e, true, true); - } - return ret; -}; - -Promise.all = function (promises) { - return new PromiseArray(promises).promise(); -}; - -Promise.defer = Promise.pending = function () { - var promise = new Promise(INTERNAL); - return new PromiseResolver(promise); -}; - -Promise.cast = function (obj) { - var ret = tryConvertToPromise(obj); - if (!(ret instanceof Promise)) { - var val = ret; - ret = new Promise(INTERNAL); - ret._fulfillUnchecked(val); - } - return ret; -}; - -Promise.resolve = Promise.fulfilled = Promise.cast; - -Promise.reject = Promise.rejected = function (reason) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._rejectCallback(reason, true); - return ret; -}; - -Promise.setScheduler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - var prev = async._schedule; - async._schedule = fn; - return prev; -}; - -Promise.prototype._then = function ( - didFulfill, - didReject, - didProgress, - receiver, - internalData -) { - var haveInternalData = internalData !== undefined; - var ret = haveInternalData ? internalData : new Promise(INTERNAL); - - if (!haveInternalData) { - ret._propagateFrom(this, 4 | 1); - ret._captureStackTrace(); - } - - var target = this._target(); - if (target !== this) { - if (receiver === undefined) receiver = this._boundTo; - if (!haveInternalData) ret._setIsMigrated(); - } - - var callbackIndex = target._addCallbacks(didFulfill, - didReject, - didProgress, - ret, - receiver, - getDomain()); - - if (target._isResolved() && !target._isSettlePromisesQueued()) { - async.invoke( - target._settlePromiseAtPostResolution, target, callbackIndex); - } - - return ret; -}; - -Promise.prototype._settlePromiseAtPostResolution = function (index) { - if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); - this._settlePromiseAt(index); -}; - -Promise.prototype._length = function () { - return this._bitField & 131071; -}; - -Promise.prototype._isFollowingOrFulfilledOrRejected = function () { - return (this._bitField & 939524096) > 0; -}; - -Promise.prototype._isFollowing = function () { - return (this._bitField & 536870912) === 536870912; -}; - -Promise.prototype._setLength = function (len) { - this._bitField = (this._bitField & -131072) | - (len & 131071); -}; - -Promise.prototype._setFulfilled = function () { - this._bitField = this._bitField | 268435456; -}; - -Promise.prototype._setRejected = function () { - this._bitField = this._bitField | 134217728; -}; - -Promise.prototype._setFollowing = function () { - this._bitField = this._bitField | 536870912; -}; - -Promise.prototype._setIsFinal = function () { - this._bitField = this._bitField | 33554432; -}; - -Promise.prototype._isFinal = function () { - return (this._bitField & 33554432) > 0; -}; - -Promise.prototype._cancellable = function () { - return (this._bitField & 67108864) > 0; -}; - -Promise.prototype._setCancellable = function () { - this._bitField = this._bitField | 67108864; -}; - -Promise.prototype._unsetCancellable = function () { - this._bitField = this._bitField & (~67108864); -}; - -Promise.prototype._setIsMigrated = function () { - this._bitField = this._bitField | 4194304; -}; - -Promise.prototype._unsetIsMigrated = function () { - this._bitField = this._bitField & (~4194304); -}; - -Promise.prototype._isMigrated = function () { - return (this._bitField & 4194304) > 0; -}; - -Promise.prototype._receiverAt = function (index) { - var ret = index === 0 - ? this._receiver0 - : this[ - index * 5 - 5 + 4]; - if (ret === UNDEFINED_BINDING) { - return undefined; - } else if (ret === undefined && this._isBound()) { - return this._boundValue(); - } - return ret; -}; - -Promise.prototype._promiseAt = function (index) { - return index === 0 - ? this._promise0 - : this[index * 5 - 5 + 3]; -}; - -Promise.prototype._fulfillmentHandlerAt = function (index) { - return index === 0 - ? this._fulfillmentHandler0 - : this[index * 5 - 5 + 0]; -}; - -Promise.prototype._rejectionHandlerAt = function (index) { - return index === 0 - ? this._rejectionHandler0 - : this[index * 5 - 5 + 1]; -}; - -Promise.prototype._boundValue = function() { - var ret = this._boundTo; - if (ret !== undefined) { - if (ret instanceof Promise) { - if (ret.isFulfilled()) { - return ret.value(); - } else { - return undefined; - } - } - } - return ret; -}; - -Promise.prototype._migrateCallbacks = function (follower, index) { - var fulfill = follower._fulfillmentHandlerAt(index); - var reject = follower._rejectionHandlerAt(index); - var progress = follower._progressHandlerAt(index); - var promise = follower._promiseAt(index); - var receiver = follower._receiverAt(index); - if (promise instanceof Promise) promise._setIsMigrated(); - if (receiver === undefined) receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, progress, promise, receiver, null); -}; - -Promise.prototype._addCallbacks = function ( - fulfill, - reject, - progress, - promise, - receiver, - domain -) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - - if (index === 0) { - this._promise0 = promise; - if (receiver !== undefined) this._receiver0 = receiver; - if (typeof fulfill === "function" && !this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this._rejectionHandler0 = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this._progressHandler0 = - domain === null ? progress : domain.bind(progress); - } - } else { - var base = index * 5 - 5; - this[base + 3] = promise; - this[base + 4] = receiver; - if (typeof fulfill === "function") { - this[base + 0] = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this[base + 1] = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this[base + 2] = - domain === null ? progress : domain.bind(progress); - } - } - this._setLength(index + 1); - return index; -}; - -Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - if (index === 0) { - this._promise0 = promiseSlotValue; - this._receiver0 = receiver; - } else { - var base = index * 5 - 5; - this[base + 3] = promiseSlotValue; - this[base + 4] = receiver; - } - this._setLength(index + 1); -}; - -Promise.prototype._proxyPromiseArray = function (promiseArray, index) { - this._setProxyHandlers(promiseArray, index); -}; - -Promise.prototype._resolveCallback = function(value, shouldBind) { - if (this._isFollowingOrFulfilledOrRejected()) return; - if (value === this) - return this._rejectCallback(makeSelfResolutionError(), false, true); - var maybePromise = tryConvertToPromise(value, this); - if (!(maybePromise instanceof Promise)) return this._fulfill(value); - - var propagationFlags = 1 | (shouldBind ? 4 : 0); - this._propagateFrom(maybePromise, propagationFlags); - var promise = maybePromise._target(); - if (promise._isPending()) { - var len = this._length(); - for (var i = 0; i < len; ++i) { - promise._migrateCallbacks(this, i); - } - this._setFollowing(); - this._setLength(0); - this._setFollowee(promise); - } else if (promise._isFulfilled()) { - this._fulfillUnchecked(promise._value()); - } else { - this._rejectUnchecked(promise._reason(), - promise._getCarriedStackTrace()); - } -}; - -Promise.prototype._rejectCallback = -function(reason, synchronous, shouldNotMarkOriginatingFromRejection) { - if (!shouldNotMarkOriginatingFromRejection) { - util.markAsOriginatingFromRejection(reason); - } - var trace = util.ensureErrorObject(reason); - var hasStack = trace === reason; - this._attachExtraTrace(trace, synchronous ? hasStack : false); - this._reject(reason, hasStack ? undefined : trace); -}; - -Promise.prototype._resolveFromResolver = function (resolver) { - var promise = this; - this._captureStackTrace(); - this._pushContext(); - var synchronous = true; - var r = tryCatch(resolver)(function(value) { - if (promise === null) return; - promise._resolveCallback(value); - promise = null; - }, function (reason) { - if (promise === null) return; - promise._rejectCallback(reason, synchronous); - promise = null; - }); - synchronous = false; - this._popContext(); - - if (r !== undefined && r === errorObj && promise !== null) { - promise._rejectCallback(r.e, true, true); - promise = null; - } -}; - -Promise.prototype._settlePromiseFromHandler = function ( - handler, receiver, value, promise -) { - if (promise._isRejected()) return; - promise._pushContext(); - var x; - if (receiver === APPLY && !this._isRejected()) { - x = tryCatch(handler).apply(this._boundValue(), value); - } else { - x = tryCatch(handler).call(receiver, value); - } - promise._popContext(); - - if (x === errorObj || x === promise || x === NEXT_FILTER) { - var err = x === promise ? makeSelfResolutionError() : x.e; - promise._rejectCallback(err, false, true); - } else { - promise._resolveCallback(x); - } -}; - -Promise.prototype._target = function() { - var ret = this; - while (ret._isFollowing()) ret = ret._followee(); - return ret; -}; - -Promise.prototype._followee = function() { - return this._rejectionHandler0; -}; - -Promise.prototype._setFollowee = function(promise) { - this._rejectionHandler0 = promise; -}; - -Promise.prototype._cleanValues = function () { - if (this._cancellable()) { - this._cancellationParent = undefined; - } -}; - -Promise.prototype._propagateFrom = function (parent, flags) { - if ((flags & 1) > 0 && parent._cancellable()) { - this._setCancellable(); - this._cancellationParent = parent; - } - if ((flags & 4) > 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); - } -}; - -Promise.prototype._fulfill = function (value) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._fulfillUnchecked(value); -}; - -Promise.prototype._reject = function (reason, carriedStackTrace) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._rejectUnchecked(reason, carriedStackTrace); -}; - -Promise.prototype._settlePromiseAt = function (index) { - var promise = this._promiseAt(index); - var isPromise = promise instanceof Promise; - - if (isPromise && promise._isMigrated()) { - promise._unsetIsMigrated(); - return async.invoke(this._settlePromiseAt, this, index); - } - var handler = this._isFulfilled() - ? this._fulfillmentHandlerAt(index) - : this._rejectionHandlerAt(index); - - var carriedStackTrace = - this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined; - var value = this._settledValue; - var receiver = this._receiverAt(index); - this._clearCallbackDataAtIndex(index); - - if (typeof handler === "function") { - if (!isPromise) { - handler.call(receiver, value, promise); - } else { - this._settlePromiseFromHandler(handler, receiver, value, promise); - } - } else if (receiver instanceof PromiseArray) { - if (!receiver._isResolved()) { - if (this._isFulfilled()) { - receiver._promiseFulfilled(value, promise); - } - else { - receiver._promiseRejected(value, promise); - } - } - } else if (isPromise) { - if (this._isFulfilled()) { - promise._fulfill(value); - } else { - promise._reject(value, carriedStackTrace); - } - } - - if (index >= 4 && (index & 31) === 4) - async.invokeLater(this._setLength, this, 0); -}; - -Promise.prototype._clearCallbackDataAtIndex = function(index) { - if (index === 0) { - if (!this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = undefined; - } - this._rejectionHandler0 = - this._progressHandler0 = - this._receiver0 = - this._promise0 = undefined; - } else { - var base = index * 5 - 5; - this[base + 3] = - this[base + 4] = - this[base + 0] = - this[base + 1] = - this[base + 2] = undefined; - } -}; - -Promise.prototype._isSettlePromisesQueued = function () { - return (this._bitField & - -1073741824) === -1073741824; -}; - -Promise.prototype._setSettlePromisesQueued = function () { - this._bitField = this._bitField | -1073741824; -}; - -Promise.prototype._unsetSettlePromisesQueued = function () { - this._bitField = this._bitField & (~-1073741824); -}; - -Promise.prototype._queueSettlePromises = function() { - async.settlePromises(this); - this._setSettlePromisesQueued(); -}; - -Promise.prototype._fulfillUnchecked = function (value) { - if (value === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err, undefined); - } - this._setFulfilled(); - this._settledValue = value; - this._cleanValues(); - - if (this._length() > 0) { - this._queueSettlePromises(); - } -}; - -Promise.prototype._rejectUncheckedCheckError = function (reason) { - var trace = util.ensureErrorObject(reason); - this._rejectUnchecked(reason, trace === reason ? undefined : trace); -}; - -Promise.prototype._rejectUnchecked = function (reason, trace) { - if (reason === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err); - } - this._setRejected(); - this._settledValue = reason; - this._cleanValues(); - - if (this._isFinal()) { - async.throwLater(function(e) { - if ("stack" in e) { - async.invokeFirst( - CapturedTrace.unhandledRejection, undefined, e); - } - throw e; - }, trace === undefined ? reason : trace); - return; - } - - if (trace !== undefined && trace !== reason) { - this._setCarriedStackTrace(trace); - } - - if (this._length() > 0) { - this._queueSettlePromises(); - } else { - this._ensurePossibleRejectionHandled(); - } -}; - -Promise.prototype._settlePromises = function () { - this._unsetSettlePromisesQueued(); - var len = this._length(); - for (var i = 0; i < len; i++) { - this._settlePromiseAt(i); - } -}; - -util.notEnumerableProp(Promise, - "_makeSelfResolutionError", - makeSelfResolutionError); - -_dereq_("./progress.js")(Promise, PromiseArray); -_dereq_("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection); -_dereq_("./bind.js")(Promise, INTERNAL, tryConvertToPromise); -_dereq_("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise); -_dereq_("./direct_resolve.js")(Promise); -_dereq_("./synchronous_inspection.js")(Promise); -_dereq_("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL); -Promise.Promise = Promise; -_dereq_('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -_dereq_('./cancel.js')(Promise); -_dereq_('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext); -_dereq_('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise); -_dereq_('./nodeify.js')(Promise); -_dereq_('./call_get.js')(Promise); -_dereq_('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); -_dereq_('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); -_dereq_('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -_dereq_('./settle.js')(Promise, PromiseArray); -_dereq_('./some.js')(Promise, PromiseArray, apiRejection); -_dereq_('./promisify.js')(Promise, INTERNAL); -_dereq_('./any.js')(Promise); -_dereq_('./each.js')(Promise, INTERNAL); -_dereq_('./timers.js')(Promise, INTERNAL); -_dereq_('./filter.js')(Promise, INTERNAL); - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._progressHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - p._settledValue = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - CapturedTrace.setBounds(async.firstLineError, util.lastLineError); - return Promise; - -}; - -},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise, - apiRejection) { -var util = _dereq_("./util.js"); -var isArray = util.isArray; - -function toResolutionValue(val) { - switch(val) { - case -2: return []; - case -3: return {}; - } -} - -function PromiseArray(values) { - var promise = this._promise = new Promise(INTERNAL); - var parent; - if (values instanceof Promise) { - parent = values; - promise._propagateFrom(parent, 1 | 4); - } - this._values = values; - this._length = 0; - this._totalResolved = 0; - this._init(undefined, -2); -} -PromiseArray.prototype.length = function () { - return this._length; -}; - -PromiseArray.prototype.promise = function () { - return this._promise; -}; - -PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { - var values = tryConvertToPromise(this._values, this._promise); - if (values instanceof Promise) { - values = values._target(); - this._values = values; - if (values._isFulfilled()) { - values = values._value(); - if (!isArray(values)) { - var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - this.__hardReject__(err); - return; - } - } else if (values._isPending()) { - values._then( - init, - this._reject, - undefined, - this, - resolveValueIfEmpty - ); - return; - } else { - this._reject(values._reason()); - return; - } - } else if (!isArray(values)) { - this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason()); - return; - } - - if (values.length === 0) { - if (resolveValueIfEmpty === -5) { - this._resolveEmptyArray(); - } - else { - this._resolve(toResolutionValue(resolveValueIfEmpty)); - } - return; - } - var len = this.getActualLength(values.length); - this._length = len; - this._values = this.shouldCopyValues() ? new Array(len) : this._values; - var promise = this._promise; - for (var i = 0; i < len; ++i) { - var isResolved = this._isResolved(); - var maybePromise = tryConvertToPromise(values[i], promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (isResolved) { - maybePromise._ignoreRejections(); - } else if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, i); - } else if (maybePromise._isFulfilled()) { - this._promiseFulfilled(maybePromise._value(), i); - } else { - this._promiseRejected(maybePromise._reason(), i); - } - } else if (!isResolved) { - this._promiseFulfilled(maybePromise, i); - } - } -}; - -PromiseArray.prototype._isResolved = function () { - return this._values === null; -}; - -PromiseArray.prototype._resolve = function (value) { - this._values = null; - this._promise._fulfill(value); -}; - -PromiseArray.prototype.__hardReject__ = -PromiseArray.prototype._reject = function (reason) { - this._values = null; - this._promise._rejectCallback(reason, false, true); -}; - -PromiseArray.prototype._promiseProgressed = function (progressValue, index) { - this._promise._progress({ - index: index, - value: progressValue - }); -}; - - -PromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - } -}; - -PromiseArray.prototype._promiseRejected = function (reason, index) { - this._totalResolved++; - this._reject(reason); -}; - -PromiseArray.prototype.shouldCopyValues = function () { - return true; -}; - -PromiseArray.prototype.getActualLength = function (len) { - return len; -}; - -return PromiseArray; -}; - -},{"./util.js":38}],25:[function(_dereq_,module,exports){ -"use strict"; -var util = _dereq_("./util.js"); -var maybeWrapAsError = util.maybeWrapAsError; -var errors = _dereq_("./errors.js"); -var TimeoutError = errors.TimeoutError; -var OperationalError = errors.OperationalError; -var haveGetters = util.haveGetters; -var es5 = _dereq_("./es5.js"); - -function isUntypedError(obj) { - return obj instanceof Error && - es5.getPrototypeOf(obj) === Error.prototype; -} - -var rErrorKey = /^(?:name|message|stack|cause)$/; -function wrapAsOperationalError(obj) { - var ret; - if (isUntypedError(obj)) { - ret = new OperationalError(obj); - ret.name = obj.name; - ret.message = obj.message; - ret.stack = obj.stack; - var keys = es5.keys(obj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!rErrorKey.test(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - util.markAsOriginatingFromRejection(obj); - return obj; -} - -function nodebackForPromise(promise) { - return function(err, value) { - if (promise === null) return; - - if (err) { - var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); - promise._attachExtraTrace(wrapped); - promise._reject(wrapped); - } else if (arguments.length > 2) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - promise._fulfill(args); - } else { - promise._fulfill(value); - } - - promise = null; - }; -} - - -var PromiseResolver; -if (!haveGetters) { - PromiseResolver = function (promise) { - this.promise = promise; - this.asCallback = nodebackForPromise(promise); - this.callback = this.asCallback; - }; -} -else { - PromiseResolver = function (promise) { - this.promise = promise; - }; -} -if (haveGetters) { - var prop = { - get: function() { - return nodebackForPromise(this.promise); - } - }; - es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); - es5.defineProperty(PromiseResolver.prototype, "callback", prop); -} - -PromiseResolver._nodebackForPromise = nodebackForPromise; - -PromiseResolver.prototype.toString = function () { - return "[object PromiseResolver]"; -}; - -PromiseResolver.prototype.resolve = -PromiseResolver.prototype.fulfill = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._resolveCallback(value); -}; - -PromiseResolver.prototype.reject = function (reason) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._rejectCallback(reason); -}; - -PromiseResolver.prototype.progress = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._progress(value); -}; - -PromiseResolver.prototype.cancel = function (err) { - this.promise.cancel(err); -}; - -PromiseResolver.prototype.timeout = function () { - this.reject(new TimeoutError("timeout")); -}; - -PromiseResolver.prototype.isResolved = function () { - return this.promise.isResolved(); -}; - -PromiseResolver.prototype.toJSON = function () { - return this.promise.toJSON(); -}; - -module.exports = PromiseResolver; - -},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var THIS = {}; -var util = _dereq_("./util.js"); -var nodebackForPromise = _dereq_("./promise_resolver.js") - ._nodebackForPromise; -var withAppended = util.withAppended; -var maybeWrapAsError = util.maybeWrapAsError; -var canEvaluate = util.canEvaluate; -var TypeError = _dereq_("./errors").TypeError; -var defaultSuffix = "Async"; -var defaultPromisified = {__isPromisified__: true}; -var noCopyProps = [ - "arity", "length", - "name", - "arguments", - "caller", - "callee", - "prototype", - "__isPromisified__" -]; -var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); - -var defaultFilter = function(name) { - return util.isIdentifier(name) && - name.charAt(0) !== "_" && - name !== "constructor"; -}; - -function propsFilter(key) { - return !noCopyPropsPattern.test(key); -} - -function isPromisified(fn) { - try { - return fn.__isPromisified__ === true; - } - catch (e) { - return false; - } -} - -function hasPromisified(obj, key, suffix) { - var val = util.getDataPropertyOrDefault(obj, key + suffix, - defaultPromisified); - return val ? isPromisified(val) : false; -} -function checkValid(ret, suffix, suffixRegexp) { - for (var i = 0; i < ret.length; i += 2) { - var key = ret[i]; - if (suffixRegexp.test(key)) { - var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); - for (var j = 0; j < ret.length; j += 2) { - if (ret[j] === keyWithoutAsyncSuffix) { - throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a" - .replace("%s", suffix)); - } - } - } - } -} - -function promisifiableMethods(obj, suffix, suffixRegexp, filter) { - var keys = util.inheritedDataKeys(obj); - var ret = []; - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var value = obj[key]; - var passesDefaultFilter = filter === defaultFilter - ? true : defaultFilter(key, value, obj); - if (typeof value === "function" && - !isPromisified(value) && - !hasPromisified(obj, key, suffix) && - filter(key, value, obj, passesDefaultFilter)) { - ret.push(key, value); - } - } - checkValid(ret, suffix, suffixRegexp); - return ret; -} - -var escapeIdentRegex = function(str) { - return str.replace(/([$])/, "\\$"); -}; - -var makeNodePromisifiedEval; -if (!true) { -var switchCaseArgumentOrder = function(likelyArgumentCount) { - var ret = [likelyArgumentCount]; - var min = Math.max(0, likelyArgumentCount - 1 - 3); - for(var i = likelyArgumentCount - 1; i >= min; --i) { - ret.push(i); - } - for(var i = likelyArgumentCount + 1; i <= 3; ++i) { - ret.push(i); - } - return ret; -}; - -var argumentSequence = function(argumentCount) { - return util.filledRange(argumentCount, "_arg", ""); -}; - -var parameterDeclaration = function(parameterCount) { - return util.filledRange( - Math.max(parameterCount, 3), "_arg", ""); -}; - -var parameterCount = function(fn) { - if (typeof fn.length === "number") { - return Math.max(Math.min(fn.length, 1023 + 1), 0); - } - return 0; -}; - -makeNodePromisifiedEval = -function(callback, receiver, originalName, fn) { - var newParameterCount = Math.max(0, parameterCount(fn) - 1); - var argumentOrder = switchCaseArgumentOrder(newParameterCount); - var shouldProxyThis = typeof callback === "string" || receiver === THIS; - - function generateCallForArgumentCount(count) { - var args = argumentSequence(count).join(", "); - var comma = count > 0 ? ", " : ""; - var ret; - if (shouldProxyThis) { - ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; - } else { - ret = receiver === undefined - ? "ret = callback({{args}}, nodeback); break;\n" - : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; - } - return ret.replace("{{args}}", args).replace(", ", comma); - } - - function generateArgumentSwitchCase() { - var ret = ""; - for (var i = 0; i < argumentOrder.length; ++i) { - ret += "case " + argumentOrder[i] +":" + - generateCallForArgumentCount(argumentOrder[i]); - } - - ret += " \n\ - default: \n\ - var args = new Array(len + 1); \n\ - var i = 0; \n\ - for (var i = 0; i < len; ++i) { \n\ - args[i] = arguments[i]; \n\ - } \n\ - args[i] = nodeback; \n\ - [CodeForCall] \n\ - break; \n\ - ".replace("[CodeForCall]", (shouldProxyThis - ? "ret = callback.apply(this, args);\n" - : "ret = callback.apply(receiver, args);\n")); - return ret; - } - - var getFunctionCode = typeof callback === "string" - ? ("this != null ? this['"+callback+"'] : fn") - : "fn"; - - return new Function("Promise", - "fn", - "receiver", - "withAppended", - "maybeWrapAsError", - "nodebackForPromise", - "tryCatch", - "errorObj", - "notEnumerableProp", - "INTERNAL","'use strict'; \n\ - var ret = function (Parameters) { \n\ - 'use strict'; \n\ - var len = arguments.length; \n\ - var promise = new Promise(INTERNAL); \n\ - promise._captureStackTrace(); \n\ - var nodeback = nodebackForPromise(promise); \n\ - var ret; \n\ - var callback = tryCatch([GetFunctionCode]); \n\ - switch(len) { \n\ - [CodeForSwitchCase] \n\ - } \n\ - if (ret === errorObj) { \n\ - promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ - } \n\ - return promise; \n\ - }; \n\ - notEnumerableProp(ret, '__isPromisified__', true); \n\ - return ret; \n\ - " - .replace("Parameters", parameterDeclaration(newParameterCount)) - .replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) - .replace("[GetFunctionCode]", getFunctionCode))( - Promise, - fn, - receiver, - withAppended, - maybeWrapAsError, - nodebackForPromise, - util.tryCatch, - util.errorObj, - util.notEnumerableProp, - INTERNAL - ); -}; -} - -function makeNodePromisifiedClosure(callback, receiver, _, fn) { - var defaultThis = (function() {return this;})(); - var method = callback; - if (typeof method === "string") { - callback = fn; - } - function promisified() { - var _receiver = receiver; - if (receiver === THIS) _receiver = this; - var promise = new Promise(INTERNAL); - promise._captureStackTrace(); - var cb = typeof method === "string" && this !== defaultThis - ? this[method] : callback; - var fn = nodebackForPromise(promise); - try { - cb.apply(_receiver, withAppended(arguments, fn)); - } catch(e) { - promise._rejectCallback(maybeWrapAsError(e), true, true); - } - return promise; - } - util.notEnumerableProp(promisified, "__isPromisified__", true); - return promisified; -} - -var makeNodePromisified = canEvaluate - ? makeNodePromisifiedEval - : makeNodePromisifiedClosure; - -function promisifyAll(obj, suffix, filter, promisifier) { - var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); - var methods = - promisifiableMethods(obj, suffix, suffixRegexp, filter); - - for (var i = 0, len = methods.length; i < len; i+= 2) { - var key = methods[i]; - var fn = methods[i+1]; - var promisifiedKey = key + suffix; - if (promisifier === makeNodePromisified) { - obj[promisifiedKey] = - makeNodePromisified(key, THIS, key, fn, suffix); - } else { - var promisified = promisifier(fn, function() { - return makeNodePromisified(key, THIS, key, fn, suffix); - }); - util.notEnumerableProp(promisified, "__isPromisified__", true); - obj[promisifiedKey] = promisified; - } - } - util.toFastProperties(obj); - return obj; -} - -function promisify(callback, receiver) { - return makeNodePromisified(callback, receiver, undefined, callback); -} - -Promise.promisify = function (fn, receiver) { - if (typeof fn !== "function") { - throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - if (isPromisified(fn)) { - return fn; - } - var ret = promisify(fn, arguments.length < 2 ? THIS : receiver); - util.copyDescriptors(fn, ret, propsFilter); - return ret; -}; - -Promise.promisifyAll = function (target, options) { - if (typeof target !== "function" && typeof target !== "object") { - throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a"); - } - options = Object(options); - var suffix = options.suffix; - if (typeof suffix !== "string") suffix = defaultSuffix; - var filter = options.filter; - if (typeof filter !== "function") filter = defaultFilter; - var promisifier = options.promisifier; - if (typeof promisifier !== "function") promisifier = makeNodePromisified; - - if (!util.isIdentifier(suffix)) { - throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a"); - } - - var keys = util.inheritedDataKeys(target); - for (var i = 0; i < keys.length; ++i) { - var value = target[keys[i]]; - if (keys[i] !== "constructor" && - util.isClass(value)) { - promisifyAll(value.prototype, suffix, filter, promisifier); - promisifyAll(value, suffix, filter, promisifier); - } - } - - return promisifyAll(target, suffix, filter, promisifier); -}; -}; - - -},{"./errors":13,"./promise_resolver.js":25,"./util.js":38}],27:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function( - Promise, PromiseArray, tryConvertToPromise, apiRejection) { -var util = _dereq_("./util.js"); -var isObject = util.isObject; -var es5 = _dereq_("./es5.js"); - -function PropertiesPromiseArray(obj) { - var keys = es5.keys(obj); - var len = keys.length; - var values = new Array(len * 2); - for (var i = 0; i < len; ++i) { - var key = keys[i]; - values[i] = obj[key]; - values[i + len] = key; - } - this.constructor$(values); -} -util.inherits(PropertiesPromiseArray, PromiseArray); - -PropertiesPromiseArray.prototype._init = function () { - this._init$(undefined, -3) ; -}; - -PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - var val = {}; - var keyOffset = this.length(); - for (var i = 0, len = this.length(); i < len; ++i) { - val[this._values[i + keyOffset]] = this._values[i]; - } - this._resolve(val); - } -}; - -PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) { - this._promise._progress({ - key: this._values[index + this.length()], - value: value - }); -}; - -PropertiesPromiseArray.prototype.shouldCopyValues = function () { - return false; -}; - -PropertiesPromiseArray.prototype.getActualLength = function (len) { - return len >> 1; -}; - -function props(promises) { - var ret; - var castValue = tryConvertToPromise(promises); - - if (!isObject(castValue)) { - return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a"); - } else if (castValue instanceof Promise) { - ret = castValue._then( - Promise.props, undefined, undefined, undefined, undefined); - } else { - ret = new PropertiesPromiseArray(castValue).promise(); - } - - if (castValue instanceof Promise) { - ret._propagateFrom(castValue, 4); - } - return ret; -} - -Promise.prototype.props = function () { - return props(this); -}; - -Promise.props = function (promises) { - return props(promises); -}; -}; - -},{"./es5.js":14,"./util.js":38}],28:[function(_dereq_,module,exports){ -"use strict"; -function arrayMove(src, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src[j + srcIndex]; - src[j + srcIndex] = void 0; - } -} - -function Queue(capacity) { - this._capacity = capacity; - this._length = 0; - this._front = 0; -} - -Queue.prototype._willBeOverCapacity = function (size) { - return this._capacity < size; -}; - -Queue.prototype._pushOne = function (arg) { - var length = this.length(); - this._checkCapacity(length + 1); - var i = (this._front + length) & (this._capacity - 1); - this[i] = arg; - this._length = length + 1; -}; - -Queue.prototype._unshiftOne = function(value) { - var capacity = this._capacity; - this._checkCapacity(this.length() + 1); - var front = this._front; - var i = (((( front - 1 ) & - ( capacity - 1) ) ^ capacity ) - capacity ); - this[i] = value; - this._front = i; - this._length = this.length() + 1; -}; - -Queue.prototype.unshift = function(fn, receiver, arg) { - this._unshiftOne(arg); - this._unshiftOne(receiver); - this._unshiftOne(fn); -}; - -Queue.prototype.push = function (fn, receiver, arg) { - var length = this.length() + 3; - if (this._willBeOverCapacity(length)) { - this._pushOne(fn); - this._pushOne(receiver); - this._pushOne(arg); - return; - } - var j = this._front + length - 3; - this._checkCapacity(length); - var wrapMask = this._capacity - 1; - this[(j + 0) & wrapMask] = fn; - this[(j + 1) & wrapMask] = receiver; - this[(j + 2) & wrapMask] = arg; - this._length = length; -}; - -Queue.prototype.shift = function () { - var front = this._front, - ret = this[front]; - - this[front] = undefined; - this._front = (front + 1) & (this._capacity - 1); - this._length--; - return ret; -}; - -Queue.prototype.length = function () { - return this._length; -}; - -Queue.prototype._checkCapacity = function (size) { - if (this._capacity < size) { - this._resizeTo(this._capacity << 1); - } -}; - -Queue.prototype._resizeTo = function (capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - var front = this._front; - var length = this._length; - var moveItemsCount = (front + length) & (oldCapacity - 1); - arrayMove(this, 0, this, oldCapacity, moveItemsCount); -}; - -module.exports = Queue; - -},{}],29:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function( - Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var isArray = _dereq_("./util.js").isArray; - -var raceLater = function (promise) { - return promise.then(function(array) { - return race(array, promise); - }); -}; - -function race(promises, parent) { - var maybePromise = tryConvertToPromise(promises); - - if (maybePromise instanceof Promise) { - return raceLater(maybePromise); - } else if (!isArray(promises)) { - return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - } - - var ret = new Promise(INTERNAL); - if (parent !== undefined) { - ret._propagateFrom(parent, 4 | 1); - } - var fulfill = ret._fulfill; - var reject = ret._reject; - for (var i = 0, len = promises.length; i < len; ++i) { - var val = promises[i]; - - if (val === undefined && !(i in promises)) { - continue; - } - - Promise.cast(val)._then(fulfill, reject, undefined, ret, null); - } - return ret; -} - -Promise.race = function (promises) { - return race(promises, undefined); -}; - -Promise.prototype.race = function () { - return race(this, undefined); -}; - -}; - -},{"./util.js":38}],30:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = _dereq_("./async.js"); -var util = _dereq_("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -function ReductionPromiseArray(promises, fn, accum, _each) { - this.constructor$(promises); - this._promise._captureStackTrace(); - this._preservedValues = _each === INTERNAL ? [] : null; - this._zerothIsAccum = (accum === undefined); - this._gotAccum = false; - this._reducingIndex = (this._zerothIsAccum ? 1 : 0); - this._valuesPhase = undefined; - var maybePromise = tryConvertToPromise(accum, this._promise); - var rejected = false; - var isPromise = maybePromise instanceof Promise; - if (isPromise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, -1); - } else if (maybePromise._isFulfilled()) { - accum = maybePromise._value(); - this._gotAccum = true; - } else { - this._reject(maybePromise._reason()); - rejected = true; - } - } - if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._accum = accum; - if (!rejected) async.invoke(init, this, undefined); -} -function init() { - this._init$(undefined, -5); -} -util.inherits(ReductionPromiseArray, PromiseArray); - -ReductionPromiseArray.prototype._init = function () {}; - -ReductionPromiseArray.prototype._resolveEmptyArray = function () { - if (this._gotAccum || this._zerothIsAccum) { - this._resolve(this._preservedValues !== null - ? [] : this._accum); - } -}; - -ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - values[index] = value; - var length = this.length(); - var preservedValues = this._preservedValues; - var isEach = preservedValues !== null; - var gotAccum = this._gotAccum; - var valuesPhase = this._valuesPhase; - var valuesPhaseIndex; - if (!valuesPhase) { - valuesPhase = this._valuesPhase = new Array(length); - for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) { - this._resolve(this._values); - } -}; - -SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { - var ret = new PromiseInspection(); - ret._bitField = 268435456; - ret._settledValue = value; - this._promiseResolved(index, ret); -}; -SettledPromiseArray.prototype._promiseRejected = function (reason, index) { - var ret = new PromiseInspection(); - ret._bitField = 134217728; - ret._settledValue = reason; - this._promiseResolved(index, ret); -}; - -Promise.settle = function (promises) { - return new SettledPromiseArray(promises).promise(); -}; - -Promise.prototype.settle = function () { - return new SettledPromiseArray(this).promise(); -}; -}; - -},{"./util.js":38}],33:[function(_dereq_,module,exports){ -"use strict"; -module.exports = -function(Promise, PromiseArray, apiRejection) { -var util = _dereq_("./util.js"); -var RangeError = _dereq_("./errors.js").RangeError; -var AggregateError = _dereq_("./errors.js").AggregateError; -var isArray = util.isArray; - - -function SomePromiseArray(values) { - this.constructor$(values); - this._howMany = 0; - this._unwrap = false; - this._initialized = false; -} -util.inherits(SomePromiseArray, PromiseArray); - -SomePromiseArray.prototype._init = function () { - if (!this._initialized) { - return; - } - if (this._howMany === 0) { - this._resolve([]); - return; - } - this._init$(undefined, -5); - var isArrayResolved = isArray(this._values); - if (!this._isResolved() && - isArrayResolved && - this._howMany > this._canPossiblyFulfill()) { - this._reject(this._getRangeError(this.length())); - } -}; - -SomePromiseArray.prototype.init = function () { - this._initialized = true; - this._init(); -}; - -SomePromiseArray.prototype.setUnwrap = function () { - this._unwrap = true; -}; - -SomePromiseArray.prototype.howMany = function () { - return this._howMany; -}; - -SomePromiseArray.prototype.setHowMany = function (count) { - this._howMany = count; -}; - -SomePromiseArray.prototype._promiseFulfilled = function (value) { - this._addFulfilled(value); - if (this._fulfilled() === this.howMany()) { - this._values.length = this.howMany(); - if (this.howMany() === 1 && this._unwrap) { - this._resolve(this._values[0]); - } else { - this._resolve(this._values); - } - } - -}; -SomePromiseArray.prototype._promiseRejected = function (reason) { - this._addRejected(reason); - if (this.howMany() > this._canPossiblyFulfill()) { - var e = new AggregateError(); - for (var i = this.length(); i < this._values.length; ++i) { - e.push(this._values[i]); - } - this._reject(e); - } -}; - -SomePromiseArray.prototype._fulfilled = function () { - return this._totalResolved; -}; - -SomePromiseArray.prototype._rejected = function () { - return this._values.length - this.length(); -}; - -SomePromiseArray.prototype._addRejected = function (reason) { - this._values.push(reason); -}; - -SomePromiseArray.prototype._addFulfilled = function (value) { - this._values[this._totalResolved++] = value; -}; - -SomePromiseArray.prototype._canPossiblyFulfill = function () { - return this.length() - this._rejected(); -}; - -SomePromiseArray.prototype._getRangeError = function (count) { - var message = "Input array must contain at least " + - this._howMany + " items but contains only " + count + " items"; - return new RangeError(message); -}; - -SomePromiseArray.prototype._resolveEmptyArray = function () { - this._reject(this._getRangeError(0)); -}; - -function some(promises, howMany) { - if ((howMany | 0) !== howMany || howMany < 0) { - return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a"); - } - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(howMany); - ret.init(); - return promise; -} - -Promise.some = function (promises, howMany) { - return some(promises, howMany); -}; - -Promise.prototype.some = function (howMany) { - return some(this, howMany); -}; - -Promise._SomePromiseArray = SomePromiseArray; -}; - -},{"./errors.js":13,"./util.js":38}],34:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise) { -function PromiseInspection(promise) { - if (promise !== undefined) { - promise = promise._target(); - this._bitField = promise._bitField; - this._settledValue = promise._settledValue; - } - else { - this._bitField = 0; - this._settledValue = undefined; - } -} - -PromiseInspection.prototype.value = function () { - if (!this.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.error = -PromiseInspection.prototype.reason = function () { - if (!this.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.isFulfilled = -Promise.prototype._isFulfilled = function () { - return (this._bitField & 268435456) > 0; -}; - -PromiseInspection.prototype.isRejected = -Promise.prototype._isRejected = function () { - return (this._bitField & 134217728) > 0; -}; - -PromiseInspection.prototype.isPending = -Promise.prototype._isPending = function () { - return (this._bitField & 402653184) === 0; -}; - -PromiseInspection.prototype.isResolved = -Promise.prototype._isResolved = function () { - return (this._bitField & 402653184) > 0; -}; - -Promise.prototype.isPending = function() { - return this._target()._isPending(); -}; - -Promise.prototype.isRejected = function() { - return this._target()._isRejected(); -}; - -Promise.prototype.isFulfilled = function() { - return this._target()._isFulfilled(); -}; - -Promise.prototype.isResolved = function() { - return this._target()._isResolved(); -}; - -Promise.prototype._value = function() { - return this._settledValue; -}; - -Promise.prototype._reason = function() { - this._unsetRejectionIsUnhandled(); - return this._settledValue; -}; - -Promise.prototype.value = function() { - var target = this._target(); - if (!target.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return target._settledValue; -}; - -Promise.prototype.reason = function() { - var target = this._target(); - if (!target.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - target._unsetRejectionIsUnhandled(); - return target._settledValue; -}; - - -Promise.PromiseInspection = PromiseInspection; -}; - -},{}],35:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = _dereq_("./util.js"); -var errorObj = util.errorObj; -var isObject = util.isObject; - -function tryConvertToPromise(obj, context) { - if (isObject(obj)) { - if (obj instanceof Promise) { - return obj; - } - else if (isAnyBluebirdPromise(obj)) { - var ret = new Promise(INTERNAL); - obj._then( - ret._fulfillUnchecked, - ret._rejectUncheckedCheckError, - ret._progressUnchecked, - ret, - null - ); - return ret; - } - var then = util.tryCatch(getThen)(obj); - if (then === errorObj) { - if (context) context._pushContext(); - var ret = Promise.reject(then.e); - if (context) context._popContext(); - return ret; - } else if (typeof then === "function") { - return doThenable(obj, then, context); - } - } - return obj; -} - -function getThen(obj) { - return obj.then; -} - -var hasProp = {}.hasOwnProperty; -function isAnyBluebirdPromise(obj) { - return hasProp.call(obj, "_promise0"); -} - -function doThenable(x, then, context) { - var promise = new Promise(INTERNAL); - var ret = promise; - if (context) context._pushContext(); - promise._captureStackTrace(); - if (context) context._popContext(); - var synchronous = true; - var result = util.tryCatch(then).call(x, - resolveFromThenable, - rejectFromThenable, - progressFromThenable); - synchronous = false; - if (promise && result === errorObj) { - promise._rejectCallback(result.e, true, true); - promise = null; - } - - function resolveFromThenable(value) { - if (!promise) return; - promise._resolveCallback(value); - promise = null; - } - - function rejectFromThenable(reason) { - if (!promise) return; - promise._rejectCallback(reason, synchronous, true); - promise = null; - } - - function progressFromThenable(value) { - if (!promise) return; - if (typeof promise._progress === "function") { - promise._progress(value); - } - } - return ret; -} - -return tryConvertToPromise; -}; - -},{"./util.js":38}],36:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = _dereq_("./util.js"); -var TimeoutError = Promise.TimeoutError; - -var afterTimeout = function (promise, message) { - if (!promise.isPending()) return; - - var err; - if(!util.isPrimitive(message) && (message instanceof Error)) { - err = message; - } else { - if (typeof message !== "string") { - message = "operation timed out"; - } - err = new TimeoutError(message); - } - util.markAsOriginatingFromRejection(err); - promise._attachExtraTrace(err); - promise._cancel(err); -}; - -var afterValue = function(value) { return delay(+this).thenReturn(value); }; -var delay = Promise.delay = function (value, ms) { - if (ms === undefined) { - ms = value; - value = undefined; - var ret = new Promise(INTERNAL); - setTimeout(function() { ret._fulfill(); }, ms); - return ret; - } - ms = +ms; - return Promise.resolve(value)._then(afterValue, null, null, ms, undefined); -}; - -Promise.prototype.delay = function (ms) { - return delay(this, ms); -}; - -function successClear(value) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - return value; -} - -function failureClear(reason) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - throw reason; -} - -Promise.prototype.timeout = function (ms, message) { - ms = +ms; - var ret = this.then().cancellable(); - ret._cancellationParent = this; - var handle = setTimeout(function timeoutTimeout() { - afterTimeout(ret, message); - }, ms); - return ret._then(successClear, failureClear, undefined, handle, undefined); -}; - -}; - -},{"./util.js":38}],37:[function(_dereq_,module,exports){ -"use strict"; -module.exports = function (Promise, apiRejection, tryConvertToPromise, - createContext) { - var TypeError = _dereq_("./errors.js").TypeError; - var inherits = _dereq_("./util.js").inherits; - var PromiseInspection = Promise.PromiseInspection; - - function inspectionMapper(inspections) { - var len = inspections.length; - for (var i = 0; i < len; ++i) { - var inspection = inspections[i]; - if (inspection.isRejected()) { - return Promise.reject(inspection.error()); - } - inspections[i] = inspection._settledValue; - } - return inspections; - } - - function thrower(e) { - setTimeout(function(){throw e;}, 0); - } - - function castPreservingDisposable(thenable) { - var maybePromise = tryConvertToPromise(thenable); - if (maybePromise !== thenable && - typeof thenable._isDisposable === "function" && - typeof thenable._getDisposer === "function" && - thenable._isDisposable()) { - maybePromise._setDisposable(thenable._getDisposer()); - } - return maybePromise; - } - function dispose(resources, inspection) { - var i = 0; - var len = resources.length; - var ret = Promise.defer(); - function iterator() { - if (i >= len) return ret.resolve(); - var maybePromise = castPreservingDisposable(resources[i++]); - if (maybePromise instanceof Promise && - maybePromise._isDisposable()) { - try { - maybePromise = tryConvertToPromise( - maybePromise._getDisposer().tryDispose(inspection), - resources.promise); - } catch (e) { - return thrower(e); - } - if (maybePromise instanceof Promise) { - return maybePromise._then(iterator, thrower, - null, null, null); - } - } - iterator(); - } - iterator(); - return ret.promise; - } - - function disposerSuccess(value) { - var inspection = new PromiseInspection(); - inspection._settledValue = value; - inspection._bitField = 268435456; - return dispose(this, inspection).thenReturn(value); - } - - function disposerFail(reason) { - var inspection = new PromiseInspection(); - inspection._settledValue = reason; - inspection._bitField = 134217728; - return dispose(this, inspection).thenThrow(reason); - } - - function Disposer(data, promise, context) { - this._data = data; - this._promise = promise; - this._context = context; - } - - Disposer.prototype.data = function () { - return this._data; - }; - - Disposer.prototype.promise = function () { - return this._promise; - }; - - Disposer.prototype.resource = function () { - if (this.promise().isFulfilled()) { - return this.promise().value(); - } - return null; - }; - - Disposer.prototype.tryDispose = function(inspection) { - var resource = this.resource(); - var context = this._context; - if (context !== undefined) context._pushContext(); - var ret = resource !== null - ? this.doDispose(resource, inspection) : null; - if (context !== undefined) context._popContext(); - this._promise._unsetDisposable(); - this._data = null; - return ret; - }; - - Disposer.isDisposer = function (d) { - return (d != null && - typeof d.resource === "function" && - typeof d.tryDispose === "function"); - }; - - function FunctionDisposer(fn, promise, context) { - this.constructor$(fn, promise, context); - } - inherits(FunctionDisposer, Disposer); - - FunctionDisposer.prototype.doDispose = function (resource, inspection) { - var fn = this.data(); - return fn.call(resource, resource, inspection); - }; - - function maybeUnwrapDisposer(value) { - if (Disposer.isDisposer(value)) { - this.resources[this.index]._setDisposable(value); - return value.promise(); - } - return value; - } - - Promise.using = function () { - var len = arguments.length; - if (len < 2) return apiRejection( - "you must pass at least 2 arguments to Promise.using"); - var fn = arguments[len - 1]; - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - var input; - var spreadArgs = true; - if (len === 2 && Array.isArray(arguments[0])) { - input = arguments[0]; - len = input.length; - spreadArgs = false; - } else { - input = arguments; - len--; - } - var resources = new Array(len); - for (var i = 0; i < len; ++i) { - var resource = input[i]; - if (Disposer.isDisposer(resource)) { - var disposer = resource; - resource = resource.promise(); - resource._setDisposable(disposer); - } else { - var maybePromise = tryConvertToPromise(resource); - if (maybePromise instanceof Promise) { - resource = - maybePromise._then(maybeUnwrapDisposer, null, null, { - resources: resources, - index: i - }, undefined); - } - } - resources[i] = resource; - } - - var promise = Promise.settle(resources) - .then(inspectionMapper) - .then(function(vals) { - promise._pushContext(); - var ret; - try { - ret = spreadArgs - ? fn.apply(undefined, vals) : fn.call(undefined, vals); - } finally { - promise._popContext(); - } - return ret; - }) - ._then( - disposerSuccess, disposerFail, undefined, resources, undefined); - resources.promise = promise; - return promise; - }; - - Promise.prototype._setDisposable = function (disposer) { - this._bitField = this._bitField | 262144; - this._disposer = disposer; - }; - - Promise.prototype._isDisposable = function () { - return (this._bitField & 262144) > 0; - }; - - Promise.prototype._getDisposer = function () { - return this._disposer; - }; - - Promise.prototype._unsetDisposable = function () { - this._bitField = this._bitField & (~262144); - this._disposer = undefined; - }; - - Promise.prototype.disposer = function (fn) { - if (typeof fn === "function") { - return new FunctionDisposer(fn, this, createContext()); - } - throw new TypeError(); - }; - -}; - -},{"./errors.js":13,"./util.js":38}],38:[function(_dereq_,module,exports){ -"use strict"; -var es5 = _dereq_("./es5.js"); -var canEvaluate = typeof navigator == "undefined"; -var haveGetters = (function(){ - try { - var o = {}; - es5.defineProperty(o, "f", { - get: function () { - return 3; - } - }); - return o.f === 3; - } - catch (e) { - return false; - } - -})(); - -var errorObj = {e: {}}; -var tryCatchTarget; -function tryCatcher() { - try { - var target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } -} -function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; -} - -var inherits = function(Child, Parent) { - var hasProp = {}.hasOwnProperty; - - function T() { - this.constructor = Child; - this.constructor$ = Parent; - for (var propertyName in Parent.prototype) { - if (hasProp.call(Parent.prototype, propertyName) && - propertyName.charAt(propertyName.length-1) !== "$" - ) { - this[propertyName + "$"] = Parent.prototype[propertyName]; - } - } - } - T.prototype = Parent.prototype; - Child.prototype = new T(); - return Child.prototype; -}; - - -function isPrimitive(val) { - return val == null || val === true || val === false || - typeof val === "string" || typeof val === "number"; - -} - -function isObject(value) { - return !isPrimitive(value); -} - -function maybeWrapAsError(maybeError) { - if (!isPrimitive(maybeError)) return maybeError; - - return new Error(safeToString(maybeError)); -} - -function withAppended(target, appendee) { - var len = target.length; - var ret = new Array(len + 1); - var i; - for (i = 0; i < len; ++i) { - ret[i] = target[i]; - } - ret[i] = appendee; - return ret; -} - -function getDataPropertyOrDefault(obj, key, defaultValue) { - if (es5.isES5) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - - if (desc != null) { - return desc.get == null && desc.set == null - ? desc.value - : defaultValue; - } - } else { - return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; - } -} - -function notEnumerableProp(obj, name, value) { - if (isPrimitive(obj)) return obj; - var descriptor = { - value: value, - configurable: true, - enumerable: false, - writable: true - }; - es5.defineProperty(obj, name, descriptor); - return obj; -} - -function thrower(r) { - throw r; -} - -var inheritedDataKeys = (function() { - var excludedPrototypes = [ - Array.prototype, - Object.prototype, - Function.prototype - ]; - - var isExcludedProto = function(val) { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (excludedPrototypes[i] === val) { - return true; - } - } - return false; - }; - - if (es5.isES5) { - var getKeys = Object.getOwnPropertyNames; - return function(obj) { - var ret = []; - var visitedKeys = Object.create(null); - while (obj != null && !isExcludedProto(obj)) { - var keys; - try { - keys = getKeys(obj); - } catch (e) { - return ret; - } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (visitedKeys[key]) continue; - visitedKeys[key] = true; - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null && desc.get == null && desc.set == null) { - ret.push(key); - } - } - obj = es5.getPrototypeOf(obj); - } - return ret; - }; - } else { - var hasProp = {}.hasOwnProperty; - return function(obj) { - if (isExcludedProto(obj)) return []; - var ret = []; - - /*jshint forin:false */ - enumeration: for (var key in obj) { - if (hasProp.call(obj, key)) { - ret.push(key); - } else { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (hasProp.call(excludedPrototypes[i], key)) { - continue enumeration; - } - } - ret.push(key); - } - } - return ret; - }; - } - -})(); - -var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; -function isClass(fn) { - try { - if (typeof fn === "function") { - var keys = es5.names(fn.prototype); - - var hasMethods = es5.isES5 && keys.length > 1; - var hasMethodsOtherThanConstructor = keys.length > 0 && - !(keys.length === 1 && keys[0] === "constructor"); - var hasThisAssignmentAndStaticMethods = - thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; - - if (hasMethods || hasMethodsOtherThanConstructor || - hasThisAssignmentAndStaticMethods) { - return true; - } - } - return false; - } catch (e) { - return false; - } -} - -function toFastProperties(obj) { - /*jshint -W027,-W055,-W031*/ - function f() {} - f.prototype = obj; - var l = 8; - while (l--) new f(); - return obj; - eval(obj); -} - -var rident = /^[a-z$_][a-z$_0-9]*$/i; -function isIdentifier(str) { - return rident.test(str); -} - -function filledRange(count, prefix, suffix) { - var ret = new Array(count); - for(var i = 0; i < count; ++i) { - ret[i] = prefix + i + suffix; - } - return ret; -} - -function safeToString(obj) { - try { - return obj + ""; - } catch (e) { - return "[no string representation]"; - } -} - -function markAsOriginatingFromRejection(e) { - try { - notEnumerableProp(e, "isOperational", true); - } - catch(ignore) {} -} - -function originatesFromRejection(e) { - if (e == null) return false; - return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || - e["isOperational"] === true); -} - -function canAttachTrace(obj) { - return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); -} - -var ensureErrorObject = (function() { - if (!("stack" in new Error())) { - return function(value) { - if (canAttachTrace(value)) return value; - try {throw new Error(safeToString(value));} - catch(err) {return err;} - }; - } else { - return function(value) { - if (canAttachTrace(value)) return value; - return new Error(safeToString(value)); - }; - } -})(); - -function classString(obj) { - return {}.toString.call(obj); -} - -function copyDescriptors(from, to, filter) { - var keys = es5.names(from); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (filter(key)) { - try { - es5.defineProperty(to, key, es5.getDescriptor(from, key)); - } catch (ignore) {} - } - } -} - -var ret = { - isClass: isClass, - isIdentifier: isIdentifier, - inheritedDataKeys: inheritedDataKeys, - getDataPropertyOrDefault: getDataPropertyOrDefault, - thrower: thrower, - isArray: es5.isArray, - haveGetters: haveGetters, - notEnumerableProp: notEnumerableProp, - isPrimitive: isPrimitive, - isObject: isObject, - canEvaluate: canEvaluate, - errorObj: errorObj, - tryCatch: tryCatch, - inherits: inherits, - withAppended: withAppended, - maybeWrapAsError: maybeWrapAsError, - toFastProperties: toFastProperties, - filledRange: filledRange, - toString: safeToString, - canAttachTrace: canAttachTrace, - ensureErrorObject: ensureErrorObject, - originatesFromRejection: originatesFromRejection, - markAsOriginatingFromRejection: markAsOriginatingFromRejection, - classString: classString, - copyDescriptors: copyDescriptors, - hasDevTools: typeof chrome !== "undefined" && chrome && - typeof chrome.loadTimes === "function", - isNode: typeof process !== "undefined" && - classString(process).toLowerCase() === "[object process]" -}; -ret.isRecentNode = ret.isNode && (function() { - var version = process.versions.node.split(".").map(Number); - return (version[0] === 0 && version[1] > 10) || (version[0] > 0); -})(); - -if (ret.isNode) ret.toFastProperties(process); - -try {throw new Error(); } catch (e) {ret.lastLineError = e;} -module.exports = ret; - -},{"./es5.js":14}]},{},[4])(4) -}); ;if (typeof window !== 'undefined' && window !== null) { window.P = window.Promise; } else if (typeof self !== 'undefined' && self !== null) { self.P = self.Promise; } \ No newline at end of file diff --git a/src/node_modules/bluebird/js/browser/bluebird.min.js b/src/node_modules/bluebird/js/browser/bluebird.min.js deleted file mode 100644 index 9d066dd..0000000 --- a/src/node_modules/bluebird/js/browser/bluebird.min.js +++ /dev/null @@ -1,31 +0,0 @@ -/* @preserve - * The MIT License (MIT) - * - * Copyright (c) 2013-2015 Petka Antonov - * - * 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. - * - */ -/** - * bluebird build version 2.10.2 - * Features enabled: core, race, call_get, generators, map, nodeify, promisify, props, reduce, settle, some, cancel, using, filter, any, each, timers -*/ -!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;"undefined"!=typeof window?e=window:"undefined"!=typeof global?e=global:"undefined"!=typeof self&&(e=self),e.Promise=t()}}(function(){var t,e,r;return function n(t,e,r){function i(s,a){if(!e[s]){if(!t[s]){var u="function"==typeof _dereq_&&_dereq_;if(!a&&u)return u(s,!0);if(o)return o(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=e[s]={exports:{}};t[s][0].call(l.exports,function(e){var r=t[s][1][e];return i(r?r:e)},l,l.exports,n,t,e,r)}return e[s].exports}for(var o="function"==typeof _dereq_&&_dereq_,s=0;s0},r.prototype.throwLater=function(t,e){if(1===arguments.length&&(e=t,t=function(){throw e}),"undefined"!=typeof setTimeout)setTimeout(function(){t(e)},0);else try{this._schedule(function(){t(e)})}catch(r){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")}},l.hasDevTools?(u.isStatic&&(u=function(t){setTimeout(t,0)}),r.prototype.invokeLater=function(t,e,r){this._trampolineEnabled?n.call(this,t,e,r):this._schedule(function(){setTimeout(function(){t.call(e,r)},100)})},r.prototype.invoke=function(t,e,r){this._trampolineEnabled?i.call(this,t,e,r):this._schedule(function(){t.call(e,r)})},r.prototype.settlePromises=function(t){this._trampolineEnabled?o.call(this,t):this._schedule(function(){t._settlePromises()})}):(r.prototype.invokeLater=n,r.prototype.invoke=i,r.prototype.settlePromises=o),r.prototype.invokeFirst=function(t,e,r){this._normalQueue.unshift(t,e,r),this._queueTick()},r.prototype._drainQueue=function(t){for(;t.length()>0;){var e=t.shift();if("function"==typeof e){var r=t.shift(),n=t.shift();e.call(r,n)}else e._settlePromises()}},r.prototype._drainQueues=function(){this._drainQueue(this._normalQueue),this._reset(),this._drainQueue(this._lateQueue)},r.prototype._queueTick=function(){this._isTickUsed||(this._isTickUsed=!0,this._schedule(this.drainQueues))},r.prototype._reset=function(){this._isTickUsed=!1},e.exports=new r,e.exports.firstLineError=s},{"./queue.js":28,"./schedule.js":31,"./util.js":38}],3:[function(t,e){"use strict";e.exports=function(t,e,r){var n=function(t,e){this._reject(e)},i=function(t,e){e.promiseRejectionQueued=!0,e.bindingPromise._then(n,n,null,this,t)},o=function(t,e){this._isPending()&&this._resolveCallback(e.target)},s=function(t,e){e.promiseRejectionQueued||this._reject(t)};t.prototype.bind=function(n){var a=r(n),u=new t(e);u._propagateFrom(this,1);var c=this._target();if(u._setBoundTo(a),a instanceof t){var l={promiseRejectionQueued:!1,promise:u,target:c,bindingPromise:a};c._then(e,i,u._progress,u,l),a._then(o,s,u._progress,u,l)}else u._resolveCallback(c);return u},t.prototype._setBoundTo=function(t){void 0!==t?(this._bitField=131072|this._bitField,this._boundTo=t):this._bitField=-131073&this._bitField},t.prototype._isBound=function(){return 131072===(131072&this._bitField)},t.bind=function(n,i){var o=r(n),s=new t(e);return s._setBoundTo(o),o instanceof t?o._then(function(){s._resolveCallback(i)},s._reject,s._progress,s,null):s._resolveCallback(i),s}}},{}],4:[function(t,e){"use strict";function r(){try{Promise===i&&(Promise=n)}catch(t){}return i}var n;"undefined"!=typeof Promise&&(n=Promise);var i=t("./promise.js")();i.noConflict=r,e.exports=i},{"./promise.js":23}],5:[function(t,e){"use strict";var r=Object.create;if(r){var n=r(null),i=r(null);n[" size"]=i[" size"]=0}e.exports=function(e){function r(t,r){var n;if(null!=t&&(n=t[r]),"function"!=typeof n){var i="Object "+a.classString(t)+" has no method '"+a.toString(r)+"'";throw new e.TypeError(i)}return n}function n(t){var e=this.pop(),n=r(t,e);return n.apply(t,this)}function i(t){return t[this]}function o(t){var e=+this;return 0>e&&(e=Math.max(0,e+t.length)),t[e]}{var s,a=t("./util.js"),u=a.canEvaluate;a.isIdentifier}e.prototype.call=function(t){for(var e=arguments.length,r=new Array(e-1),i=1;e>i;++i)r[i-1]=arguments[i];return r.push(t),this._then(n,void 0,void 0,r,void 0)},e.prototype.get=function(t){var e,r="number"==typeof t;if(r)e=o;else if(u){var n=s(t);e=null!==n?n:i}else e=i;return this._then(e,void 0,void 0,t,void 0)}}},{"./util.js":38}],6:[function(t,e){"use strict";e.exports=function(e){var r=t("./errors.js"),n=t("./async.js"),i=r.CancellationError;e.prototype._cancel=function(t){if(!this.isCancellable())return this;for(var e,r=this;void 0!==(e=r._cancellationParent)&&e.isCancellable();)r=e;this._unsetCancellable(),r._target()._rejectCallback(t,!1,!0)},e.prototype.cancel=function(t){return this.isCancellable()?(void 0===t&&(t=new i),n.invokeLater(this._cancel,this,t),this):this},e.prototype.cancellable=function(){return this._cancellable()?this:(n.enableTrampoline(),this._setCancellable(),this._cancellationParent=void 0,this)},e.prototype.uncancellable=function(){var t=this.then();return t._unsetCancellable(),t},e.prototype.fork=function(t,e,r){var n=this._then(t,e,r,void 0,void 0);return n._setCancellable(),n._cancellationParent=void 0,n}}},{"./async.js":2,"./errors.js":13}],7:[function(t,e){"use strict";e.exports=function(){function e(t){this._parent=t;var r=this._length=1+(void 0===t?0:t._length);j(this,e),r>32&&this.uncycle()}function r(t,e){for(var r=0;r=0;--a)if(n[a]===o){s=a;break}for(var a=s;a>=0;--a){var u=n[a];if(e[i]!==u)break;e.pop(),i--}e=n}}function o(t){for(var e=[],r=0;r0&&(e=e.slice(r)),e}function a(t){var e;if("function"==typeof t)e="[function "+(t.name||"anonymous")+"]";else{e=t.toString();var r=/\[object [a-zA-Z0-9$_]+\]/;if(r.test(e))try{var n=JSON.stringify(t);e=n}catch(i){}0===e.length&&(e="(empty array)")}return"(<"+u(e)+">, no stack trace)"}function u(t){var e=41;return t.lengtht)){for(var e=[],r={},n=0,i=this;void 0!==i;++n)e.push(i),i=i._parent;t=this._length=n;for(var n=t-1;n>=0;--n){var o=e[n].stack;void 0===r[o]&&(r[o]=n)}for(var n=0;t>n;++n){var s=e[n].stack,a=r[s];if(void 0!==a&&a!==n){a>0&&(e[a-1]._parent=void 0,e[a-1]._length=1),e[n]._parent=void 0,e[n]._length=1;var u=n>0?e[n-1]:this;t-1>a?(u._parent=e[a+1],u._parent.uncycle(),u._length=u._parent._length+1):(u._parent=void 0,u._length=1);for(var c=u._length+1,l=n-2;l>=0;--l)e[l]._length=c,c++;return}}}},e.prototype.parent=function(){return this._parent},e.prototype.hasParent=function(){return void 0!==this._parent},e.prototype.attachExtraTrace=function(t){if(!t.__stackCleaned__){this.uncycle();for(var s=e.parseStackAndMessage(t),a=s.message,u=[s.stack],c=this;void 0!==c;)u.push(o(c.stack.split("\n"))),c=c._parent;i(u),n(u),p.notEnumerableProp(t,"stack",r(a,u)),p.notEnumerableProp(t,"__stackCleaned__",!0)}},e.parseStackAndMessage=function(t){var e=t.stack,r=t.toString();return e="string"==typeof e&&e.length>0?s(t):[" (No stack trace)"],{message:r,stack:o(e)}},e.formatAndLogError=function(t,e){if("undefined"!=typeof console){var r;if("object"==typeof t||"function"==typeof t){var n=t.stack;r=e+d(n,t)}else r=e+String(t);"function"==typeof l?l(r):("function"==typeof console.log||"object"==typeof console.log)&&console.log(r)}},e.unhandledRejection=function(t){e.formatAndLogError(t,"^--- With additional stack trace: ")},e.isSupported=function(){return"function"==typeof j},e.fireRejectionEvent=function(t,r,n,i){var o=!1;try{"function"==typeof r&&(o=!0,"rejectionHandled"===t?r(i):r(n,i))}catch(s){h.throwLater(s)}var a=!1;try{a=b(t,n,i)}catch(s){a=!0,h.throwLater(s)}var u=!1;if(m)try{u=m(t.toLowerCase(),{reason:n,promise:i})}catch(s){u=!0,h.throwLater(s)}a||o||u||"unhandledRejection"!==t||e.formatAndLogError(n,"Unhandled rejection ")};var y=function(){return!1},g=/[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/;e.setBounds=function(t,r){if(e.isSupported()){for(var n,i,o=t.stack.split("\n"),s=r.stack.split("\n"),a=-1,u=-1,l=0;la||0>u||!n||!i||n!==i||a>=u||(y=function(t){if(f.test(t))return!0;var e=c(t);return e&&e.fileName===n&&a<=e.line&&e.line<=u?!0:!1})}};var m,j=function(){var t=/^\s*at\s*/,e=function(t,e){return"string"==typeof t?t:void 0!==e.name&&void 0!==e.message?e.toString():a(e)};if("number"==typeof Error.stackTraceLimit&&"function"==typeof Error.captureStackTrace){Error.stackTraceLimit=Error.stackTraceLimit+6,_=t,d=e;var r=Error.captureStackTrace;return y=function(t){return f.test(t)},function(t,e){Error.stackTraceLimit=Error.stackTraceLimit+6,r(t,e),Error.stackTraceLimit=Error.stackTraceLimit-6}}var n=new Error;if("string"==typeof n.stack&&n.stack.split("\n")[0].indexOf("stackDetection@")>=0)return _=/@/,d=e,v=!0,function(t){t.stack=(new Error).stack};var i;try{throw new Error}catch(o){i="stack"in o}return"stack"in n||!i||"number"!=typeof Error.stackTraceLimit?(d=function(t,e){return"string"==typeof t?t:"object"!=typeof e&&"function"!=typeof e||void 0===e.name||void 0===e.message?a(e):e.toString()},null):(_=t,d=e,function(t){Error.stackTraceLimit=Error.stackTraceLimit+6;try{throw new Error}catch(e){t.stack=e.stack}Error.stackTraceLimit=Error.stackTraceLimit-6})}([]),b=function(){if(p.isNode)return function(t,e,r){return"rejectionHandled"===t?process.emit(t,r):process.emit(t,e,r)};var t=!1,e=!0;try{var r=new self.CustomEvent("test");t=r instanceof CustomEvent}catch(n){}if(!t)try{var i=document.createEvent("CustomEvent");i.initCustomEvent("testingtheevent",!1,!0,{}),self.dispatchEvent(i)}catch(n){e=!1}e&&(m=function(e,r){var n;return t?n=new self.CustomEvent(e,{detail:r,bubbles:!1,cancelable:!0}):self.dispatchEvent&&(n=document.createEvent("CustomEvent"),n.initCustomEvent(e,!1,!0,r)),n?!self.dispatchEvent(n):!1});var o={};return o.unhandledRejection="onunhandledRejection".toLowerCase(),o.rejectionHandled="onrejectionHandled".toLowerCase(),function(t,e,r){var n=o[t],i=self[n];return i?("rejectionHandled"===t?i.call(self,r):i.call(self,e,r),!0):!1}}();return"undefined"!=typeof console&&"undefined"!=typeof console.warn&&(l=function(t){console.warn(t)},p.isNode&&process.stderr.isTTY?l=function(t){process.stderr.write(""+t+"\n")}:p.isNode||"string"!=typeof(new Error).stack||(l=function(t){console.warn("%c"+t,"color: red")})),e}},{"./async.js":2,"./util.js":38}],8:[function(t,e){"use strict";e.exports=function(e){function r(t,e,r){this._instances=t,this._callback=e,this._promise=r}function n(t,e){var r={},n=s(t).call(r,e);if(n===a)return n;var i=u(r);return i.length?(a.e=new c("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"),a):n}var i=t("./util.js"),o=t("./errors.js"),s=i.tryCatch,a=i.errorObj,u=t("./es5.js").keys,c=o.TypeError;return r.prototype.doFilter=function(t){for(var r=this._callback,i=this._promise,o=i._boundValue(),u=0,c=this._instances.length;c>u;++u){var l=this._instances[u],h=l===Error||null!=l&&l.prototype instanceof Error;if(h&&t instanceof l){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}if("function"==typeof l&&!h){var f=n(l,t);if(f===a){t=a.e;break}if(f){var p=s(r).call(o,t);return p===a?(e.e=p.e,e):p}}}return e.e=t,e},r}},{"./errors.js":13,"./es5.js":14,"./util.js":38}],9:[function(t,e){"use strict";e.exports=function(t,e,r){function n(){this._trace=new e(o())}function i(){return r()?new n:void 0}function o(){var t=s.length-1;return t>=0?s[t]:void 0}var s=[];return n.prototype._pushContext=function(){r()&&void 0!==this._trace&&s.push(this._trace)},n.prototype._popContext=function(){r()&&void 0!==this._trace&&s.pop()},t.prototype._peekContext=o,t.prototype._pushContext=n.prototype._pushContext,t.prototype._popContext=n.prototype._popContext,i}},{}],10:[function(t,e){"use strict";e.exports=function(e,r){var n,i,o=e._getDomain,s=t("./async.js"),a=t("./errors.js").Warning,u=t("./util.js"),c=u.canAttachTrace,l=!1||u.isNode&&(!!process.env.BLUEBIRD_DEBUG||"development"===process.env.NODE_ENV);return u.isNode&&0==process.env.BLUEBIRD_DEBUG&&(l=!1),l&&s.disableTrampolineIfNecessary(),e.prototype._ignoreRejections=function(){this._unsetRejectionIsUnhandled(),this._bitField=16777216|this._bitField},e.prototype._ensurePossibleRejectionHandled=function(){0===(16777216&this._bitField)&&(this._setRejectionIsUnhandled(),s.invokeLater(this._notifyUnhandledRejection,this,void 0))},e.prototype._notifyUnhandledRejectionIsHandled=function(){r.fireRejectionEvent("rejectionHandled",n,void 0,this)},e.prototype._notifyUnhandledRejection=function(){if(this._isRejectionUnhandled()){var t=this._getCarriedStackTrace()||this._settledValue;this._setUnhandledRejectionIsNotified(),r.fireRejectionEvent("unhandledRejection",i,t,this)}},e.prototype._setUnhandledRejectionIsNotified=function(){this._bitField=524288|this._bitField},e.prototype._unsetUnhandledRejectionIsNotified=function(){this._bitField=-524289&this._bitField},e.prototype._isUnhandledRejectionNotified=function(){return(524288&this._bitField)>0},e.prototype._setRejectionIsUnhandled=function(){this._bitField=2097152|this._bitField},e.prototype._unsetRejectionIsUnhandled=function(){this._bitField=-2097153&this._bitField,this._isUnhandledRejectionNotified()&&(this._unsetUnhandledRejectionIsNotified(),this._notifyUnhandledRejectionIsHandled())},e.prototype._isRejectionUnhandled=function(){return(2097152&this._bitField)>0},e.prototype._setCarriedStackTrace=function(t){this._bitField=1048576|this._bitField,this._fulfillmentHandler0=t},e.prototype._isCarryingStackTrace=function(){return(1048576&this._bitField)>0},e.prototype._getCarriedStackTrace=function(){return this._isCarryingStackTrace()?this._fulfillmentHandler0:void 0},e.prototype._captureStackTrace=function(){return l&&(this._trace=new r(this._peekContext())),this},e.prototype._attachExtraTrace=function(t,e){if(l&&c(t)){var n=this._trace;if(void 0!==n&&e&&(n=n._parent),void 0!==n)n.attachExtraTrace(t);else if(!t.__stackCleaned__){var i=r.parseStackAndMessage(t);u.notEnumerableProp(t,"stack",i.message+"\n"+i.stack.join("\n")),u.notEnumerableProp(t,"__stackCleaned__",!0)}}},e.prototype._warn=function(t){var e=new a(t),n=this._peekContext();if(n)n.attachExtraTrace(e);else{var i=r.parseStackAndMessage(e);e.stack=i.message+"\n"+i.stack.join("\n")}r.formatAndLogError(e,"")},e.onPossiblyUnhandledRejection=function(t){var e=o();i="function"==typeof t?null===e?t:e.bind(t):void 0},e.onUnhandledRejectionHandled=function(t){var e=o();n="function"==typeof t?null===e?t:e.bind(t):void 0},e.longStackTraces=function(){if(s.haveItemsQueued()&&l===!1)throw new Error("cannot enable long stack traces after promises have been created\n\n See http://goo.gl/DT1qyG\n");l=r.isSupported(),l&&s.disableTrampolineIfNecessary()},e.hasLongStackTraces=function(){return l&&r.isSupported()},r.isSupported()||(e.longStackTraces=function(){},l=!1),function(){return l}}},{"./async.js":2,"./errors.js":13,"./util.js":38}],11:[function(t,e){"use strict";var r=t("./util.js"),n=r.isPrimitive;e.exports=function(t){var e=function(){return this},r=function(){throw this},i=function(){},o=function(){throw void 0},s=function(t,e){return 1===e?function(){throw t}:2===e?function(){return t}:void 0};t.prototype["return"]=t.prototype.thenReturn=function(r){return void 0===r?this.then(i):n(r)?this._then(s(r,2),void 0,void 0,void 0,void 0):(r instanceof t&&r._ignoreRejections(),this._then(e,void 0,void 0,r,void 0))},t.prototype["throw"]=t.prototype.thenThrow=function(t){return void 0===t?this.then(o):n(t)?this._then(s(t,1),void 0,void 0,void 0,void 0):this._then(r,void 0,void 0,t,void 0)}}},{"./util.js":38}],12:[function(t,e){"use strict";e.exports=function(t,e){var r=t.reduce;t.prototype.each=function(t){return r(this,t,null,e)},t.each=function(t,n){return r(t,n,null,e)}}},{}],13:[function(t,e){"use strict";function r(t,e){function r(n){return this instanceof r?(l(this,"message","string"==typeof n?n:e),l(this,"name",t),void(Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):Error.call(this))):new r(n)}return c(r,Error),r}function n(t){return this instanceof n?(l(this,"name","OperationalError"),l(this,"message",t),this.cause=t,this.isOperational=!0,void(t instanceof Error?(l(this,"message",t.message),l(this,"stack",t.stack)):Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor))):new n(t)}var i,o,s=t("./es5.js"),a=s.freeze,u=t("./util.js"),c=u.inherits,l=u.notEnumerableProp,h=r("Warning","warning"),p=r("CancellationError","cancellation error"),f=r("TimeoutError","timeout error"),_=r("AggregateError","aggregate error");try{i=TypeError,o=RangeError}catch(d){i=r("TypeError","type error"),o=r("RangeError","range error")}for(var v="join pop push shift unshift slice filter forEach some every map indexOf lastIndexOf reduce reduceRight sort reverse".split(" "),y=0;y0&&"function"==typeof arguments[e]){t=arguments[e];var n}for(var i=arguments.length,o=new Array(i),s=0;i>s;++s)o[s]=arguments[s];t&&o.pop();var n=new r(o).promise();return void 0!==t?n.spread(t):n}}},{"./util.js":38}],19:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,e,r,n){this.constructor$(t),this._promise._captureStackTrace();var i=c();this._callback=null===i?e:i.bind(e),this._preservedValues=n===o?new Array(this.length()):null,this._limit=r,this._inFlight=0,this._queue=r>=1?[]:d,l.invoke(a,this,void 0)}function a(){this._init$(void 0,-2)}function u(t,e,r,n){var i="object"==typeof r&&null!==r?r.concurrency:0;return i="number"==typeof i&&isFinite(i)&&i>=1?i:0,new s(t,e,i,n)}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj,_={},d=[];h.inherits(s,r),s.prototype._init=function(){},s.prototype._promiseFulfilled=function(t,r){var n=this._values,o=this.length(),s=this._preservedValues,a=this._limit;if(n[r]===_){if(n[r]=t,a>=1&&(this._inFlight--,this._drainQueue(),this._isResolved()))return}else{if(a>=1&&this._inFlight>=a)return n[r]=t,void this._queue.push(r);null!==s&&(s[r]=t);var u=this._callback,c=this._promise._boundValue();this._promise._pushContext();var l=p(u).call(c,t,r,o);if(this._promise._popContext(),l===f)return this._reject(l.e);var h=i(l,this._promise);if(h instanceof e){if(h=h._target(),h._isPending())return a>=1&&this._inFlight++,n[r]=_,h._proxyPromiseArray(this,r);if(!h._isFulfilled())return this._reject(h._reason());l=h._value()}n[r]=l}var d=++this._totalResolved;d>=o&&(null!==s?this._filter(n,s):this._resolve(n))},s.prototype._drainQueue=function(){for(var t=this._queue,e=this._limit,r=this._values;t.length>0&&this._inFlighto;++o)t[o]&&(n[i++]=e[o]);n.length=i,this._resolve(n)},s.prototype.preservedValues=function(){return this._preservedValues},e.prototype.map=function(t,e){return"function"!=typeof t?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(this,t,e,null).promise()},e.map=function(t,e,r,i){return"function"!=typeof e?n("fn must be a function\n\n See http://goo.gl/916lJJ\n"):u(t,e,r,i).promise()}}},{"./async.js":2,"./util.js":38}],20:[function(t,e){"use strict";e.exports=function(e,r,n,i){var o=t("./util.js"),s=o.tryCatch;e.method=function(t){if("function"!=typeof t)throw new e.TypeError("fn must be a function\n\n See http://goo.gl/916lJJ\n");return function(){var n=new e(r);n._captureStackTrace(),n._pushContext();var i=s(t).apply(this,arguments);return n._popContext(),n._resolveFromSyncValue(i),n}},e.attempt=e["try"]=function(t,n,a){if("function"!=typeof t)return i("fn must be a function\n\n See http://goo.gl/916lJJ\n");var u=new e(r);u._captureStackTrace(),u._pushContext();var c=o.isArray(n)?s(t).apply(a,n):s(t).call(a,n);return u._popContext(),u._resolveFromSyncValue(c),u},e.prototype._resolveFromSyncValue=function(t){t===o.errorObj?this._rejectCallback(t.e,!1,!0):this._resolveCallback(t,!0)}}},{"./util.js":38}],21:[function(t,e){"use strict";e.exports=function(e){function r(t,e){var r=this;if(!o.isArray(t))return n.call(r,t,e);var i=a(e).apply(r._boundValue(),[null].concat(t));i===u&&s.throwLater(i.e)}function n(t,e){var r=this,n=r._boundValue(),i=void 0===t?a(e).call(n,null):a(e).call(n,null,t);i===u&&s.throwLater(i.e)}function i(t,e){var r=this;if(!t){var n=r._target(),i=n._getCarriedStackTrace();i.cause=t,t=i}var o=a(e).call(r._boundValue(),t);o===u&&s.throwLater(o.e)}var o=t("./util.js"),s=t("./async.js"),a=o.tryCatch,u=o.errorObj;e.prototype.asCallback=e.prototype.nodeify=function(t,e){if("function"==typeof t){var o=n;void 0!==e&&Object(e).spread&&(o=r),this._then(o,i,void 0,this,t)}return this}}},{"./async.js":2,"./util.js":38}],22:[function(t,e){"use strict";e.exports=function(e,r){var n=t("./util.js"),i=t("./async.js"),o=n.tryCatch,s=n.errorObj;e.prototype.progressed=function(t){return this._then(void 0,void 0,t,void 0,void 0)},e.prototype._progress=function(t){this._isFollowingOrFulfilledOrRejected()||this._target()._progressUnchecked(t)},e.prototype._progressHandlerAt=function(t){return 0===t?this._progressHandler0:this[(t<<2)+t-5+2]},e.prototype._doProgressWith=function(t){var r=t.value,i=t.handler,a=t.promise,u=t.receiver,c=o(i).call(u,r);if(c===s){if(null!=c.e&&"StopProgressPropagation"!==c.e.name){var l=n.canAttachTrace(c.e)?c.e:new Error(n.toString(c.e));a._attachExtraTrace(l),a._progress(c.e)}}else c instanceof e?c._then(a._progress,null,null,a,void 0):a._progress(c)},e.prototype._progressUnchecked=function(t){for(var n=this._length(),o=this._progress,s=0;n>s;s++){var a=this._progressHandlerAt(s),u=this._promiseAt(s);if(u instanceof e)"function"==typeof a?i.invoke(this._doProgressWith,this,{handler:a,promise:u,receiver:this._receiverAt(s),value:t}):i.invoke(o,u,t);else{var c=this._receiverAt(s);"function"==typeof a?a.call(c,t,u):c instanceof r&&!c._isResolved()&&c._promiseProgressed(t,u)}}}}},{"./async.js":2,"./util.js":38}],23:[function(t,e){"use strict";e.exports=function(){function e(t){if("function"!=typeof t)throw new h("the promise constructor requires a resolver function\n\n See http://goo.gl/EC22Yn\n");if(this.constructor!==e)throw new h("the promise constructor cannot be invoked directly\n\n See http://goo.gl/KsIlge\n");this._bitField=0,this._fulfillmentHandler0=void 0,this._rejectionHandler0=void 0,this._progressHandler0=void 0,this._promise0=void 0,this._receiver0=void 0,this._settledValue=void 0,t!==p&&this._resolveFromResolver(t)}function r(t){var r=new e(p);r._fulfillmentHandler0=t,r._rejectionHandler0=t,r._progressHandler0=t,r._promise0=t,r._receiver0=t,r._settledValue=t}var n,i=function(){return new h("circular promise resolution chain\n\n See http://goo.gl/LhFpo0\n")},o=function(){return new e.PromiseInspection(this._target())},s=function(t){return e.reject(new h(t))},a=t("./util.js");n=a.isNode?function(){var t=process.domain;return void 0===t&&(t=null),t}:function(){return null},a.notEnumerableProp(e,"_getDomain",n);var u={},c=t("./async.js"),l=t("./errors.js"),h=e.TypeError=l.TypeError;e.RangeError=l.RangeError,e.CancellationError=l.CancellationError,e.TimeoutError=l.TimeoutError,e.OperationalError=l.OperationalError,e.RejectionError=l.OperationalError,e.AggregateError=l.AggregateError;var p=function(){},f={},_={e:null},d=t("./thenables.js")(e,p),v=t("./promise_array.js")(e,p,d,s),y=t("./captured_trace.js")(),g=t("./debuggability.js")(e,y),m=t("./context.js")(e,y,g),j=t("./catch_filter.js")(_),b=t("./promise_resolver.js"),w=b._nodebackForPromise,k=a.errorObj,E=a.tryCatch;return e.prototype.toString=function(){return"[object Promise]"},e.prototype.caught=e.prototype["catch"]=function(t){var r=arguments.length;if(r>1){var n,i=new Array(r-1),o=0;for(n=0;r-1>n;++n){var s=arguments[n];if("function"!=typeof s)return e.reject(new h("Catch filter must inherit from Error or be a simple predicate function\n\n See http://goo.gl/o84o68\n"));i[o++]=s}i.length=o,t=arguments[n];var a=new j(i,t,this);return this._then(void 0,a.doFilter,void 0,a,void 0)}return this._then(void 0,t,void 0,void 0,void 0)},e.prototype.reflect=function(){return this._then(o,o,void 0,this,void 0)},e.prototype.then=function(t,e,r){if(g()&&arguments.length>0&&"function"!=typeof t&&"function"!=typeof e){var n=".then() only accepts functions but was passed: "+a.classString(t);arguments.length>1&&(n+=", "+a.classString(e)),this._warn(n)}return this._then(t,e,r,void 0,void 0)},e.prototype.done=function(t,e,r){var n=this._then(t,e,r,void 0,void 0); -n._setIsFinal()},e.prototype.spread=function(t,e){return this.all()._then(t,e,void 0,f,void 0)},e.prototype.isCancellable=function(){return!this.isResolved()&&this._cancellable()},e.prototype.toJSON=function(){var t={isFulfilled:!1,isRejected:!1,fulfillmentValue:void 0,rejectionReason:void 0};return this.isFulfilled()?(t.fulfillmentValue=this.value(),t.isFulfilled=!0):this.isRejected()&&(t.rejectionReason=this.reason(),t.isRejected=!0),t},e.prototype.all=function(){return new v(this).promise()},e.prototype.error=function(t){return this.caught(a.originatesFromRejection,t)},e.is=function(t){return t instanceof e},e.fromNode=function(t){var r=new e(p),n=E(t)(w(r));return n===k&&r._rejectCallback(n.e,!0,!0),r},e.all=function(t){return new v(t).promise()},e.defer=e.pending=function(){var t=new e(p);return new b(t)},e.cast=function(t){var r=d(t);if(!(r instanceof e)){var n=r;r=new e(p),r._fulfillUnchecked(n)}return r},e.resolve=e.fulfilled=e.cast,e.reject=e.rejected=function(t){var r=new e(p);return r._captureStackTrace(),r._rejectCallback(t,!0),r},e.setScheduler=function(t){if("function"!=typeof t)throw new h("fn must be a function\n\n See http://goo.gl/916lJJ\n");var e=c._schedule;return c._schedule=t,e},e.prototype._then=function(t,r,i,o,s){var a=void 0!==s,u=a?s:new e(p);a||(u._propagateFrom(this,5),u._captureStackTrace());var l=this._target();l!==this&&(void 0===o&&(o=this._boundTo),a||u._setIsMigrated());var h=l._addCallbacks(t,r,i,u,o,n());return l._isResolved()&&!l._isSettlePromisesQueued()&&c.invoke(l._settlePromiseAtPostResolution,l,h),u},e.prototype._settlePromiseAtPostResolution=function(t){this._isRejectionUnhandled()&&this._unsetRejectionIsUnhandled(),this._settlePromiseAt(t)},e.prototype._length=function(){return 131071&this._bitField},e.prototype._isFollowingOrFulfilledOrRejected=function(){return(939524096&this._bitField)>0},e.prototype._isFollowing=function(){return 536870912===(536870912&this._bitField)},e.prototype._setLength=function(t){this._bitField=-131072&this._bitField|131071&t},e.prototype._setFulfilled=function(){this._bitField=268435456|this._bitField},e.prototype._setRejected=function(){this._bitField=134217728|this._bitField},e.prototype._setFollowing=function(){this._bitField=536870912|this._bitField},e.prototype._setIsFinal=function(){this._bitField=33554432|this._bitField},e.prototype._isFinal=function(){return(33554432&this._bitField)>0},e.prototype._cancellable=function(){return(67108864&this._bitField)>0},e.prototype._setCancellable=function(){this._bitField=67108864|this._bitField},e.prototype._unsetCancellable=function(){this._bitField=-67108865&this._bitField},e.prototype._setIsMigrated=function(){this._bitField=4194304|this._bitField},e.prototype._unsetIsMigrated=function(){this._bitField=-4194305&this._bitField},e.prototype._isMigrated=function(){return(4194304&this._bitField)>0},e.prototype._receiverAt=function(t){var e=0===t?this._receiver0:this[5*t-5+4];return e===u?void 0:void 0===e&&this._isBound()?this._boundValue():e},e.prototype._promiseAt=function(t){return 0===t?this._promise0:this[5*t-5+3]},e.prototype._fulfillmentHandlerAt=function(t){return 0===t?this._fulfillmentHandler0:this[5*t-5+0]},e.prototype._rejectionHandlerAt=function(t){return 0===t?this._rejectionHandler0:this[5*t-5+1]},e.prototype._boundValue=function(){var t=this._boundTo;return void 0!==t&&t instanceof e?t.isFulfilled()?t.value():void 0:t},e.prototype._migrateCallbacks=function(t,r){var n=t._fulfillmentHandlerAt(r),i=t._rejectionHandlerAt(r),o=t._progressHandlerAt(r),s=t._promiseAt(r),a=t._receiverAt(r);s instanceof e&&s._setIsMigrated(),void 0===a&&(a=u),this._addCallbacks(n,i,o,s,a,null)},e.prototype._addCallbacks=function(t,e,r,n,i,o){var s=this._length();if(s>=131066&&(s=0,this._setLength(0)),0===s)this._promise0=n,void 0!==i&&(this._receiver0=i),"function"!=typeof t||this._isCarryingStackTrace()||(this._fulfillmentHandler0=null===o?t:o.bind(t)),"function"==typeof e&&(this._rejectionHandler0=null===o?e:o.bind(e)),"function"==typeof r&&(this._progressHandler0=null===o?r:o.bind(r));else{var a=5*s-5;this[a+3]=n,this[a+4]=i,"function"==typeof t&&(this[a+0]=null===o?t:o.bind(t)),"function"==typeof e&&(this[a+1]=null===o?e:o.bind(e)),"function"==typeof r&&(this[a+2]=null===o?r:o.bind(r))}return this._setLength(s+1),s},e.prototype._setProxyHandlers=function(t,e){var r=this._length();if(r>=131066&&(r=0,this._setLength(0)),0===r)this._promise0=e,this._receiver0=t;else{var n=5*r-5;this[n+3]=e,this[n+4]=t}this._setLength(r+1)},e.prototype._proxyPromiseArray=function(t,e){this._setProxyHandlers(t,e)},e.prototype._resolveCallback=function(t,r){if(!this._isFollowingOrFulfilledOrRejected()){if(t===this)return this._rejectCallback(i(),!1,!0);var n=d(t,this);if(!(n instanceof e))return this._fulfill(t);var o=1|(r?4:0);this._propagateFrom(n,o);var s=n._target();if(s._isPending()){for(var a=this._length(),u=0;a>u;++u)s._migrateCallbacks(this,u);this._setFollowing(),this._setLength(0),this._setFollowee(s)}else s._isFulfilled()?this._fulfillUnchecked(s._value()):this._rejectUnchecked(s._reason(),s._getCarriedStackTrace())}},e.prototype._rejectCallback=function(t,e,r){r||a.markAsOriginatingFromRejection(t);var n=a.ensureErrorObject(t),i=n===t;this._attachExtraTrace(n,e?i:!1),this._reject(t,i?void 0:n)},e.prototype._resolveFromResolver=function(t){var e=this;this._captureStackTrace(),this._pushContext();var r=!0,n=E(t)(function(t){null!==e&&(e._resolveCallback(t),e=null)},function(t){null!==e&&(e._rejectCallback(t,r),e=null)});r=!1,this._popContext(),void 0!==n&&n===k&&null!==e&&(e._rejectCallback(n.e,!0,!0),e=null)},e.prototype._settlePromiseFromHandler=function(t,e,r,n){if(!n._isRejected()){n._pushContext();var o;if(o=e!==f||this._isRejected()?E(t).call(e,r):E(t).apply(this._boundValue(),r),n._popContext(),o===k||o===n||o===_){var s=o===n?i():o.e;n._rejectCallback(s,!1,!0)}else n._resolveCallback(o)}},e.prototype._target=function(){for(var t=this;t._isFollowing();)t=t._followee();return t},e.prototype._followee=function(){return this._rejectionHandler0},e.prototype._setFollowee=function(t){this._rejectionHandler0=t},e.prototype._cleanValues=function(){this._cancellable()&&(this._cancellationParent=void 0)},e.prototype._propagateFrom=function(t,e){(1&e)>0&&t._cancellable()&&(this._setCancellable(),this._cancellationParent=t),(4&e)>0&&t._isBound()&&this._setBoundTo(t._boundTo)},e.prototype._fulfill=function(t){this._isFollowingOrFulfilledOrRejected()||this._fulfillUnchecked(t)},e.prototype._reject=function(t,e){this._isFollowingOrFulfilledOrRejected()||this._rejectUnchecked(t,e)},e.prototype._settlePromiseAt=function(t){var r=this._promiseAt(t),n=r instanceof e;if(n&&r._isMigrated())return r._unsetIsMigrated(),c.invoke(this._settlePromiseAt,this,t);var i=this._isFulfilled()?this._fulfillmentHandlerAt(t):this._rejectionHandlerAt(t),o=this._isCarryingStackTrace()?this._getCarriedStackTrace():void 0,s=this._settledValue,a=this._receiverAt(t);this._clearCallbackDataAtIndex(t),"function"==typeof i?n?this._settlePromiseFromHandler(i,a,s,r):i.call(a,s,r):a instanceof v?a._isResolved()||(this._isFulfilled()?a._promiseFulfilled(s,r):a._promiseRejected(s,r)):n&&(this._isFulfilled()?r._fulfill(s):r._reject(s,o)),t>=4&&4===(31&t)&&c.invokeLater(this._setLength,this,0)},e.prototype._clearCallbackDataAtIndex=function(t){if(0===t)this._isCarryingStackTrace()||(this._fulfillmentHandler0=void 0),this._rejectionHandler0=this._progressHandler0=this._receiver0=this._promise0=void 0;else{var e=5*t-5;this[e+3]=this[e+4]=this[e+0]=this[e+1]=this[e+2]=void 0}},e.prototype._isSettlePromisesQueued=function(){return-1073741824===(-1073741824&this._bitField)},e.prototype._setSettlePromisesQueued=function(){this._bitField=-1073741824|this._bitField},e.prototype._unsetSettlePromisesQueued=function(){this._bitField=1073741823&this._bitField},e.prototype._queueSettlePromises=function(){c.settlePromises(this),this._setSettlePromisesQueued()},e.prototype._fulfillUnchecked=function(t){if(t===this){var e=i();return this._attachExtraTrace(e),this._rejectUnchecked(e,void 0)}this._setFulfilled(),this._settledValue=t,this._cleanValues(),this._length()>0&&this._queueSettlePromises()},e.prototype._rejectUncheckedCheckError=function(t){var e=a.ensureErrorObject(t);this._rejectUnchecked(t,e===t?void 0:e)},e.prototype._rejectUnchecked=function(t,e){if(t===this){var r=i();return this._attachExtraTrace(r),this._rejectUnchecked(r)}return this._setRejected(),this._settledValue=t,this._cleanValues(),this._isFinal()?void c.throwLater(function(t){throw"stack"in t&&c.invokeFirst(y.unhandledRejection,void 0,t),t},void 0===e?t:e):(void 0!==e&&e!==t&&this._setCarriedStackTrace(e),void(this._length()>0?this._queueSettlePromises():this._ensurePossibleRejectionHandled()))},e.prototype._settlePromises=function(){this._unsetSettlePromisesQueued();for(var t=this._length(),e=0;t>e;e++)this._settlePromiseAt(e)},a.notEnumerableProp(e,"_makeSelfResolutionError",i),t("./progress.js")(e,v),t("./method.js")(e,p,d,s),t("./bind.js")(e,p,d),t("./finally.js")(e,_,d),t("./direct_resolve.js")(e),t("./synchronous_inspection.js")(e),t("./join.js")(e,v,d,p),e.Promise=e,t("./map.js")(e,v,s,d,p),t("./cancel.js")(e),t("./using.js")(e,s,d,m),t("./generators.js")(e,s,p,d),t("./nodeify.js")(e),t("./call_get.js")(e),t("./props.js")(e,v,d,s),t("./race.js")(e,p,d,s),t("./reduce.js")(e,v,s,d,p),t("./settle.js")(e,v),t("./some.js")(e,v,s),t("./promisify.js")(e,p),t("./any.js")(e),t("./each.js")(e,p),t("./timers.js")(e,p),t("./filter.js")(e,p),a.toFastProperties(e),a.toFastProperties(e.prototype),r({a:1}),r({b:2}),r({c:3}),r(1),r(function(){}),r(void 0),r(!1),r(new e(p)),y.setBounds(c.firstLineError,a.lastLineError),e}},{"./any.js":1,"./async.js":2,"./bind.js":3,"./call_get.js":5,"./cancel.js":6,"./captured_trace.js":7,"./catch_filter.js":8,"./context.js":9,"./debuggability.js":10,"./direct_resolve.js":11,"./each.js":12,"./errors.js":13,"./filter.js":15,"./finally.js":16,"./generators.js":17,"./join.js":18,"./map.js":19,"./method.js":20,"./nodeify.js":21,"./progress.js":22,"./promise_array.js":24,"./promise_resolver.js":25,"./promisify.js":26,"./props.js":27,"./race.js":29,"./reduce.js":30,"./settle.js":32,"./some.js":33,"./synchronous_inspection.js":34,"./thenables.js":35,"./timers.js":36,"./using.js":37,"./util.js":38}],24:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){switch(t){case-2:return[];case-3:return{}}}function s(t){var n,i=this._promise=new e(r);t instanceof e&&(n=t,i._propagateFrom(n,5)),this._values=t,this._length=0,this._totalResolved=0,this._init(void 0,-2)}var a=t("./util.js"),u=a.isArray;return s.prototype.length=function(){return this._length},s.prototype.promise=function(){return this._promise},s.prototype._init=function c(t,r){var s=n(this._values,this._promise);if(s instanceof e){if(s=s._target(),this._values=s,!s._isFulfilled())return s._isPending()?void s._then(c,this._reject,void 0,this,r):void this._reject(s._reason());if(s=s._value(),!u(s)){var a=new e.TypeError("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n");return void this.__hardReject__(a)}}else if(!u(s))return void this._promise._reject(i("expecting an array, a promise or a thenable\n\n See http://goo.gl/s8MMhc\n")._reason());if(0===s.length)return void(-5===r?this._resolveEmptyArray():this._resolve(o(r)));var l=this.getActualLength(s.length);this._length=l,this._values=this.shouldCopyValues()?new Array(l):this._values;for(var h=this._promise,p=0;l>p;++p){var f=this._isResolved(),_=n(s[p],h);_ instanceof e?(_=_._target(),f?_._ignoreRejections():_._isPending()?_._proxyPromiseArray(this,p):_._isFulfilled()?this._promiseFulfilled(_._value(),p):this._promiseRejected(_._reason(),p)):f||this._promiseFulfilled(_,p)}},s.prototype._isResolved=function(){return null===this._values},s.prototype._resolve=function(t){this._values=null,this._promise._fulfill(t)},s.prototype.__hardReject__=s.prototype._reject=function(t){this._values=null,this._promise._rejectCallback(t,!1,!0)},s.prototype._promiseProgressed=function(t,e){this._promise._progress({index:e,value:t})},s.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},s.prototype._promiseRejected=function(t){this._totalResolved++,this._reject(t)},s.prototype.shouldCopyValues=function(){return!0},s.prototype.getActualLength=function(t){return t},s}},{"./util.js":38}],25:[function(t,e){"use strict";function r(t){return t instanceof Error&&p.getPrototypeOf(t)===Error.prototype}function n(t){var e;if(r(t)){e=new l(t),e.name=t.name,e.message=t.message,e.stack=t.stack;for(var n=p.keys(t),i=0;i2){for(var o=arguments.length,s=new Array(o-1),u=1;o>u;++u)s[u-1]=arguments[u];t._fulfill(s)}else t._fulfill(r);t=null}}}var o,s=t("./util.js"),a=s.maybeWrapAsError,u=t("./errors.js"),c=u.TimeoutError,l=u.OperationalError,h=s.haveGetters,p=t("./es5.js"),f=/^(?:name|message|stack|cause)$/;if(o=h?function(t){this.promise=t}:function(t){this.promise=t,this.asCallback=i(t),this.callback=this.asCallback},h){var _={get:function(){return i(this.promise)}};p.defineProperty(o.prototype,"asCallback",_),p.defineProperty(o.prototype,"callback",_)}o._nodebackForPromise=i,o.prototype.toString=function(){return"[object PromiseResolver]"},o.prototype.resolve=o.prototype.fulfill=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._resolveCallback(t)},o.prototype.reject=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._rejectCallback(t)},o.prototype.progress=function(t){if(!(this instanceof o))throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\n\n See http://goo.gl/sdkXL9\n");this.promise._progress(t)},o.prototype.cancel=function(t){this.promise.cancel(t)},o.prototype.timeout=function(){this.reject(new c("timeout"))},o.prototype.isResolved=function(){return this.promise.isResolved()},o.prototype.toJSON=function(){return this.promise.toJSON()},e.exports=o},{"./errors.js":13,"./es5.js":14,"./util.js":38}],26:[function(t,e){"use strict";e.exports=function(e,r){function n(t){return!w.test(t)}function i(t){try{return t.__isPromisified__===!0}catch(e){return!1}}function o(t,e,r){var n=f.getDataPropertyOrDefault(t,e+r,j);return n?i(n):!1}function s(t,e,r){for(var n=0;ns;s+=2){var c=o[s],l=o[s+1],h=c+e;if(n===F)t[h]=F(c,p,c,l,e);else{var _=n(l,function(){return F(c,p,c,l,e)});f.notEnumerableProp(_,"__isPromisified__",!0),t[h]=_}}return f.toFastProperties(t),t}function l(t,e){return F(t,e,void 0,t)}var h,p={},f=t("./util.js"),_=t("./promise_resolver.js")._nodebackForPromise,d=f.withAppended,v=f.maybeWrapAsError,y=f.canEvaluate,g=t("./errors").TypeError,m="Async",j={__isPromisified__:!0},b=["arity","length","name","arguments","caller","callee","prototype","__isPromisified__"],w=new RegExp("^(?:"+b.join("|")+")$"),k=function(t){return f.isIdentifier(t)&&"_"!==t.charAt(0)&&"constructor"!==t},E=function(t){return t.replace(/([$])/,"\\$")},F=y?h:u;e.promisify=function(t,e){if("function"!=typeof t)throw new g("fn must be a function\n\n See http://goo.gl/916lJJ\n");if(i(t))return t;var r=l(t,arguments.length<2?p:e);return f.copyDescriptors(t,r,n),r},e.promisifyAll=function(t,e){if("function"!=typeof t&&"object"!=typeof t)throw new g("the target of promisifyAll must be an object or a function\n\n See http://goo.gl/9ITlV0\n");e=Object(e);var r=e.suffix;"string"!=typeof r&&(r=m);var n=e.filter;"function"!=typeof n&&(n=k);var i=e.promisifier;if("function"!=typeof i&&(i=F),!f.isIdentifier(r))throw new RangeError("suffix must be a valid identifier\n\n See http://goo.gl/8FZo5V\n");for(var o=f.inheritedDataKeys(t),s=0;si;++i){var o=e[i];n[i]=t[o],n[i+r]=o}this.constructor$(n)}function s(t){var r,s=n(t);return u(s)?(r=s instanceof e?s._then(e.props,void 0,void 0,void 0,void 0):new o(s).promise(),s instanceof e&&r._propagateFrom(s,4),r):i("cannot await properties of a non-object\n\n See http://goo.gl/OsFKC8\n")}var a=t("./util.js"),u=a.isObject,c=t("./es5.js");a.inherits(o,r),o.prototype._init=function(){this._init$(void 0,-3)},o.prototype._promiseFulfilled=function(t,e){this._values[e]=t;var r=++this._totalResolved;if(r>=this._length){for(var n={},i=this.length(),o=0,s=this.length();s>o;++o)n[this._values[o+i]]=this._values[o];this._resolve(n)}},o.prototype._promiseProgressed=function(t,e){this._promise._progress({key:this._values[e+this.length()],value:t})},o.prototype.shouldCopyValues=function(){return!1},o.prototype.getActualLength=function(t){return t>>1},e.prototype.props=function(){return s(this)},e.props=function(t){return s(t)}}},{"./es5.js":14,"./util.js":38}],28:[function(t,e){"use strict";function r(t,e,r,n,i){for(var o=0;i>o;++o)r[o+n]=t[o+e],t[o+e]=void 0}function n(t){this._capacity=t,this._length=0,this._front=0}n.prototype._willBeOverCapacity=function(t){return this._capacityp;++p){var _=t[p];(void 0!==_||p in t)&&e.cast(_)._then(l,h,void 0,c,null)}return c}var s=t("./util.js").isArray,a=function(t){return t.then(function(e){return o(e,t)})};e.race=function(t){return o(t,void 0)},e.prototype.race=function(){return o(this,void 0)}}},{"./util.js":38}],30:[function(t,e){"use strict";e.exports=function(e,r,n,i,o){function s(t,r,n,s){this.constructor$(t),this._promise._captureStackTrace(),this._preservedValues=s===o?[]:null,this._zerothIsAccum=void 0===n,this._gotAccum=!1,this._reducingIndex=this._zerothIsAccum?1:0,this._valuesPhase=void 0;var u=i(n,this._promise),h=!1,p=u instanceof e;p&&(u=u._target(),u._isPending()?u._proxyPromiseArray(this,-1):u._isFulfilled()?(n=u._value(),this._gotAccum=!0):(this._reject(u._reason()),h=!0)),p||this._zerothIsAccum||(this._gotAccum=!0);var f=c();this._callback=null===f?r:f.bind(r),this._accum=n,h||l.invoke(a,this,void 0)}function a(){this._init$(void 0,-5)}function u(t,e,r,i){if("function"!=typeof e)return n("fn must be a function\n\n See http://goo.gl/916lJJ\n");var o=new s(t,e,r,i);return o.promise()}var c=e._getDomain,l=t("./async.js"),h=t("./util.js"),p=h.tryCatch,f=h.errorObj;h.inherits(s,r),s.prototype._init=function(){},s.prototype._resolveEmptyArray=function(){(this._gotAccum||this._zerothIsAccum)&&this._resolve(null!==this._preservedValues?[]:this._accum)},s.prototype._promiseFulfilled=function(t,r){var n=this._values;n[r]=t;var o,s=this.length(),a=this._preservedValues,u=null!==a,c=this._gotAccum,l=this._valuesPhase;if(!l)for(l=this._valuesPhase=new Array(s),o=0;s>o;++o)l[o]=0;if(o=l[r],0===r&&this._zerothIsAccum?(this._accum=t,this._gotAccum=c=!0,l[r]=0===o?1:2):-1===r?(this._accum=t,this._gotAccum=c=!0):0===o?l[r]=1:(l[r]=2,this._accum=t),c){for(var h,_=this._callback,d=this._promise._boundValue(),v=this._reducingIndex;s>v;++v)if(o=l[v],2!==o){if(1!==o)return;if(t=n[v],this._promise._pushContext(),u?(a.push(t),h=p(_).call(d,t,v,s)):h=p(_).call(d,this._accum,t,v,s),this._promise._popContext(),h===f)return this._reject(h.e);var y=i(h,this._promise);if(y instanceof e){if(y=y._target(),y._isPending())return l[v]=4,y._proxyPromiseArray(this,v);if(!y._isFulfilled())return this._reject(y._reason());h=y._value()}this._reducingIndex=v+1,this._accum=h}else this._reducingIndex=v+1;this._resolve(u?a:this._accum)}},e.prototype.reduce=function(t,e){return u(this,t,e,null)},e.reduce=function(t,e,r,n){return u(t,e,r,n)}}},{"./async.js":2,"./util.js":38}],31:[function(t,e){"use strict";var r,n=t("./util"),i=function(){throw new Error("No async scheduler available\n\n See http://goo.gl/m3OTXk\n")};if(n.isNode&&"undefined"==typeof MutationObserver){var o=global.setImmediate,s=process.nextTick;r=n.isRecentNode?function(t){o.call(global,t)}:function(t){s.call(process,t)}}else"undefined"==typeof MutationObserver||"undefined"!=typeof window&&window.navigator&&window.navigator.standalone?r="undefined"!=typeof setImmediate?function(t){setImmediate(t)}:"undefined"!=typeof setTimeout?function(t){setTimeout(t,0)}:i:(r=function(t){var e=document.createElement("div"),r=new MutationObserver(t);return r.observe(e,{attributes:!0}),function(){e.classList.toggle("foo")}},r.isStatic=!0);e.exports=r},{"./util":38}],32:[function(t,e){"use strict";e.exports=function(e,r){function n(t){this.constructor$(t)}var i=e.PromiseInspection,o=t("./util.js");o.inherits(n,r),n.prototype._promiseResolved=function(t,e){this._values[t]=e;var r=++this._totalResolved;r>=this._length&&this._resolve(this._values)},n.prototype._promiseFulfilled=function(t,e){var r=new i;r._bitField=268435456,r._settledValue=t,this._promiseResolved(e,r)},n.prototype._promiseRejected=function(t,e){var r=new i;r._bitField=134217728,r._settledValue=t,this._promiseResolved(e,r)},e.settle=function(t){return new n(t).promise()},e.prototype.settle=function(){return new n(this).promise()}}},{"./util.js":38}],33:[function(t,e){"use strict";e.exports=function(e,r,n){function i(t){this.constructor$(t),this._howMany=0,this._unwrap=!1,this._initialized=!1}function o(t,e){if((0|e)!==e||0>e)return n("expecting a positive integer\n\n See http://goo.gl/1wAmHx\n");var r=new i(t),o=r.promise();return r.setHowMany(e),r.init(),o}var s=t("./util.js"),a=t("./errors.js").RangeError,u=t("./errors.js").AggregateError,c=s.isArray;s.inherits(i,r),i.prototype._init=function(){if(this._initialized){if(0===this._howMany)return void this._resolve([]);this._init$(void 0,-5);var t=c(this._values);!this._isResolved()&&t&&this._howMany>this._canPossiblyFulfill()&&this._reject(this._getRangeError(this.length()))}},i.prototype.init=function(){this._initialized=!0,this._init()},i.prototype.setUnwrap=function(){this._unwrap=!0},i.prototype.howMany=function(){return this._howMany},i.prototype.setHowMany=function(t){this._howMany=t},i.prototype._promiseFulfilled=function(t){this._addFulfilled(t),this._fulfilled()===this.howMany()&&(this._values.length=this.howMany(),this._resolve(1===this.howMany()&&this._unwrap?this._values[0]:this._values))},i.prototype._promiseRejected=function(t){if(this._addRejected(t),this.howMany()>this._canPossiblyFulfill()){for(var e=new u,r=this.length();r0},e.prototype.isRejected=t.prototype._isRejected=function(){return(134217728&this._bitField)>0},e.prototype.isPending=t.prototype._isPending=function(){return 0===(402653184&this._bitField)},e.prototype.isResolved=t.prototype._isResolved=function(){return(402653184&this._bitField)>0},t.prototype.isPending=function(){return this._target()._isPending()},t.prototype.isRejected=function(){return this._target()._isRejected()},t.prototype.isFulfilled=function(){return this._target()._isFulfilled()},t.prototype.isResolved=function(){return this._target()._isResolved()},t.prototype._value=function(){return this._settledValue},t.prototype._reason=function(){return this._unsetRejectionIsUnhandled(),this._settledValue},t.prototype.value=function(){var t=this._target();if(!t.isFulfilled())throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\n\n See http://goo.gl/hc1DLj\n");return t._settledValue},t.prototype.reason=function(){var t=this._target();if(!t.isRejected())throw new TypeError("cannot get rejection reason of a non-rejected promise\n\n See http://goo.gl/hPuiwB\n");return t._unsetRejectionIsUnhandled(),t._settledValue},t.PromiseInspection=e}},{}],35:[function(t,e){"use strict";e.exports=function(e,r){function n(t,n){if(c(t)){if(t instanceof e)return t;if(o(t)){var l=new e(r);return t._then(l._fulfillUnchecked,l._rejectUncheckedCheckError,l._progressUnchecked,l,null),l}var h=a.tryCatch(i)(t);if(h===u){n&&n._pushContext();var l=e.reject(h.e);return n&&n._popContext(),l}if("function"==typeof h)return s(t,h,n)}return t}function i(t){return t.then}function o(t){return l.call(t,"_promise0")}function s(t,n,i){function o(t){l&&(l._resolveCallback(t),l=null)}function s(t){l&&(l._rejectCallback(t,p,!0),l=null)}function c(t){l&&"function"==typeof l._progress&&l._progress(t)}var l=new e(r),h=l;i&&i._pushContext(),l._captureStackTrace(),i&&i._popContext();var p=!0,f=a.tryCatch(n).call(t,o,s,c);return p=!1,l&&f===u&&(l._rejectCallback(f.e,!0,!0),l=null),h}var a=t("./util.js"),u=a.errorObj,c=a.isObject,l={}.hasOwnProperty;return n}},{"./util.js":38}],36:[function(t,e){"use strict";e.exports=function(e,r){function n(t){var e=this;return e instanceof Number&&(e=+e),clearTimeout(e),t}function i(t){var e=this;throw e instanceof Number&&(e=+e),clearTimeout(e),t}var o=t("./util.js"),s=e.TimeoutError,a=function(t,e){if(t.isPending()){var r;!o.isPrimitive(e)&&e instanceof Error?r=e:("string"!=typeof e&&(e="operation timed out"),r=new s(e)),o.markAsOriginatingFromRejection(r),t._attachExtraTrace(r),t._cancel(r)}},u=function(t){return c(+this).thenReturn(t)},c=e.delay=function(t,n){if(void 0===n){n=t,t=void 0;var i=new e(r);return setTimeout(function(){i._fulfill()},n),i}return n=+n,e.resolve(t)._then(u,null,null,n,void 0)};e.prototype.delay=function(t){return c(this,t)},e.prototype.timeout=function(t,e){t=+t;var r=this.then().cancellable();r._cancellationParent=this;var o=setTimeout(function(){a(r,e)},t);return r._then(n,i,void 0,o,void 0)}}},{"./util.js":38}],37:[function(t,e){"use strict";e.exports=function(e,r,n,i){function o(t){for(var r=t.length,n=0;r>n;++n){var i=t[n];if(i.isRejected())return e.reject(i.error());t[n]=i._settledValue}return t}function s(t){setTimeout(function(){throw t},0)}function a(t){var e=n(t);return e!==t&&"function"==typeof t._isDisposable&&"function"==typeof t._getDisposer&&t._isDisposable()&&e._setDisposable(t._getDisposer()),e}function u(t,r){function i(){if(o>=u)return c.resolve();var l=a(t[o++]);if(l instanceof e&&l._isDisposable()){try{l=n(l._getDisposer().tryDispose(r),t.promise)}catch(h){return s(h)}if(l instanceof e)return l._then(i,s,null,null,null)}i()}var o=0,u=t.length,c=e.defer();return i(),c.promise}function c(t){var e=new v;return e._settledValue=t,e._bitField=268435456,u(this,e).thenReturn(t)}function l(t){var e=new v;return e._settledValue=t,e._bitField=134217728,u(this,e).thenThrow(t)}function h(t,e,r){this._data=t,this._promise=e,this._context=r}function p(t,e,r){this.constructor$(t,e,r)}function f(t){return h.isDisposer(t)?(this.resources[this.index]._setDisposable(t),t.promise()):t}var _=t("./errors.js").TypeError,d=t("./util.js").inherits,v=e.PromiseInspection;h.prototype.data=function(){return this._data},h.prototype.promise=function(){return this._promise},h.prototype.resource=function(){return this.promise().isFulfilled()?this.promise().value():null},h.prototype.tryDispose=function(t){var e=this.resource(),r=this._context;void 0!==r&&r._pushContext();var n=null!==e?this.doDispose(e,t):null;return void 0!==r&&r._popContext(),this._promise._unsetDisposable(),this._data=null,n},h.isDisposer=function(t){return null!=t&&"function"==typeof t.resource&&"function"==typeof t.tryDispose},d(p,h),p.prototype.doDispose=function(t,e){var r=this.data();return r.call(t,t,e)},e.using=function(){var t=arguments.length;if(2>t)return r("you must pass at least 2 arguments to Promise.using");var i=arguments[t-1];if("function"!=typeof i)return r("fn must be a function\n\n See http://goo.gl/916lJJ\n");var s,a=!0;2===t&&Array.isArray(arguments[0])?(s=arguments[0],t=s.length,a=!1):(s=arguments,t--);for(var u=new Array(t),p=0;t>p;++p){var _=s[p];if(h.isDisposer(_)){var d=_;_=_.promise(),_._setDisposable(d) -}else{var v=n(_);v instanceof e&&(_=v._then(f,null,null,{resources:u,index:p},void 0))}u[p]=_}var y=e.settle(u).then(o).then(function(t){y._pushContext();var e;try{e=a?i.apply(void 0,t):i.call(void 0,t)}finally{y._popContext()}return e})._then(c,l,void 0,u,void 0);return u.promise=y,y},e.prototype._setDisposable=function(t){this._bitField=262144|this._bitField,this._disposer=t},e.prototype._isDisposable=function(){return(262144&this._bitField)>0},e.prototype._getDisposer=function(){return this._disposer},e.prototype._unsetDisposable=function(){this._bitField=-262145&this._bitField,this._disposer=void 0},e.prototype.disposer=function(t){if("function"==typeof t)return new p(t,this,i());throw new _}}},{"./errors.js":13,"./util.js":38}],38:[function(t,e,r){"use strict";function n(){try{var t=C;return C=null,t.apply(this,arguments)}catch(e){return F.e=e,F}}function i(t){return C=t,n}function o(t){return null==t||t===!0||t===!1||"string"==typeof t||"number"==typeof t}function s(t){return!o(t)}function a(t){return o(t)?new Error(v(t)):t}function u(t,e){var r,n=t.length,i=new Array(n+1);for(r=0;n>r;++r)i[r]=t[r];return i[r]=e,i}function c(t,e,r){if(!w.isES5)return{}.hasOwnProperty.call(t,e)?t[e]:void 0;var n=Object.getOwnPropertyDescriptor(t,e);return null!=n?null==n.get&&null==n.set?n.value:r:void 0}function l(t,e,r){if(o(t))return t;var n={value:r,configurable:!0,enumerable:!1,writable:!0};return w.defineProperty(t,e,n),t}function h(t){throw t}function p(t){try{if("function"==typeof t){var e=w.names(t.prototype),r=w.isES5&&e.length>1,n=e.length>0&&!(1===e.length&&"constructor"===e[0]),i=x.test(t+"")&&w.names(t).length>0;if(r||n||i)return!0}return!1}catch(o){return!1}}function f(t){function e(){}e.prototype=t;for(var r=8;r--;)new e;return t}function _(t){return R.test(t)}function d(t,e,r){for(var n=new Array(t),i=0;t>i;++i)n[i]=e+i+r;return n}function v(t){try{return t+""}catch(e){return"[no string representation]"}}function y(t){try{l(t,"isOperational",!0)}catch(e){}}function g(t){return null==t?!1:t instanceof Error.__BluebirdErrorTypes__.OperationalError||t.isOperational===!0}function m(t){return t instanceof Error&&w.propertyIsWritable(t,"stack")}function j(t){return{}.toString.call(t)}function b(t,e,r){for(var n=w.names(t),i=0;i10||t[0]>0}(),A.isNode&&A.toFastProperties(process);try{throw new Error}catch(O){A.lastLineError=O}e.exports=A},{"./es5.js":14}]},{},[4])(4)}),"undefined"!=typeof window&&null!==window?window.P=window.Promise:"undefined"!=typeof self&&null!==self&&(self.P=self.Promise); \ No newline at end of file diff --git a/src/node_modules/bluebird/js/main/any.js b/src/node_modules/bluebird/js/main/any.js deleted file mode 100644 index 05a6228..0000000 --- a/src/node_modules/bluebird/js/main/any.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var SomePromiseArray = Promise._SomePromiseArray; -function any(promises) { - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(1); - ret.setUnwrap(); - ret.init(); - return promise; -} - -Promise.any = function (promises) { - return any(promises); -}; - -Promise.prototype.any = function () { - return any(this); -}; - -}; diff --git a/src/node_modules/bluebird/js/main/assert.js b/src/node_modules/bluebird/js/main/assert.js deleted file mode 100644 index a98955c..0000000 --- a/src/node_modules/bluebird/js/main/assert.js +++ /dev/null @@ -1,55 +0,0 @@ -"use strict"; -module.exports = (function(){ -var AssertionError = (function() { - function AssertionError(a) { - this.constructor$(a); - this.message = a; - this.name = "AssertionError"; - } - AssertionError.prototype = new Error(); - AssertionError.prototype.constructor = AssertionError; - AssertionError.prototype.constructor$ = Error; - return AssertionError; -})(); - -function getParams(args) { - var params = []; - for (var i = 0; i < args.length; ++i) params.push("arg" + i); - return params; -} - -function nativeAssert(callName, args, expect) { - try { - var params = getParams(args); - var constructorArgs = params; - constructorArgs.push("return " + - callName + "("+ params.join(",") + ");"); - var fn = Function.apply(null, constructorArgs); - return fn.apply(null, args); - } catch (e) { - if (!(e instanceof SyntaxError)) { - throw e; - } else { - return expect; - } - } -} - -return function assert(boolExpr, message) { - if (boolExpr === true) return; - - if (typeof boolExpr === "string" && - boolExpr.charAt(0) === "%") { - var nativeCallName = boolExpr; - var $_len = arguments.length;var args = new Array($_len - 2); for(var $_i = 2; $_i < $_len; ++$_i) {args[$_i - 2] = arguments[$_i];} - if (nativeAssert(nativeCallName, args, message) === message) return; - message = (nativeCallName + " !== " + message); - } - - var ret = new AssertionError(message); - if (Error.captureStackTrace) { - Error.captureStackTrace(ret, assert); - } - throw ret; -}; -})(); diff --git a/src/node_modules/bluebird/js/main/async.js b/src/node_modules/bluebird/js/main/async.js deleted file mode 100644 index 0104459..0000000 --- a/src/node_modules/bluebird/js/main/async.js +++ /dev/null @@ -1,150 +0,0 @@ -"use strict"; -var firstLineError; -try {throw new Error(); } catch (e) {firstLineError = e;} -var schedule = require("./schedule.js"); -var Queue = require("./queue.js"); -var util = require("./util.js"); - -function Async() { - this._isTickUsed = false; - this._lateQueue = new Queue(16); - this._normalQueue = new Queue(16); - this._trampolineEnabled = true; - var self = this; - this.drainQueues = function () { - self._drainQueues(); - }; - this._schedule = - schedule.isStatic ? schedule(this.drainQueues) : schedule; -} - -Async.prototype.disableTrampolineIfNecessary = function() { - if (util.hasDevTools) { - this._trampolineEnabled = false; - } -}; - -Async.prototype.enableTrampoline = function() { - if (!this._trampolineEnabled) { - this._trampolineEnabled = true; - this._schedule = function(fn) { - setTimeout(fn, 0); - }; - } -}; - -Async.prototype.haveItemsQueued = function () { - return this._normalQueue.length() > 0; -}; - -Async.prototype.throwLater = function(fn, arg) { - if (arguments.length === 1) { - arg = fn; - fn = function () { throw arg; }; - } - if (typeof setTimeout !== "undefined") { - setTimeout(function() { - fn(arg); - }, 0); - } else try { - this._schedule(function() { - fn(arg); - }); - } catch (e) { - throw new Error("No async scheduler available\u000a\u000a See http://goo.gl/m3OTXk\u000a"); - } -}; - -function AsyncInvokeLater(fn, receiver, arg) { - this._lateQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncInvoke(fn, receiver, arg) { - this._normalQueue.push(fn, receiver, arg); - this._queueTick(); -} - -function AsyncSettlePromises(promise) { - this._normalQueue._pushOne(promise); - this._queueTick(); -} - -if (!util.hasDevTools) { - Async.prototype.invokeLater = AsyncInvokeLater; - Async.prototype.invoke = AsyncInvoke; - Async.prototype.settlePromises = AsyncSettlePromises; -} else { - if (schedule.isStatic) { - schedule = function(fn) { setTimeout(fn, 0); }; - } - Async.prototype.invokeLater = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvokeLater.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - setTimeout(function() { - fn.call(receiver, arg); - }, 100); - }); - } - }; - - Async.prototype.invoke = function (fn, receiver, arg) { - if (this._trampolineEnabled) { - AsyncInvoke.call(this, fn, receiver, arg); - } else { - this._schedule(function() { - fn.call(receiver, arg); - }); - } - }; - - Async.prototype.settlePromises = function(promise) { - if (this._trampolineEnabled) { - AsyncSettlePromises.call(this, promise); - } else { - this._schedule(function() { - promise._settlePromises(); - }); - } - }; -} - -Async.prototype.invokeFirst = function (fn, receiver, arg) { - this._normalQueue.unshift(fn, receiver, arg); - this._queueTick(); -}; - -Async.prototype._drainQueue = function(queue) { - while (queue.length() > 0) { - var fn = queue.shift(); - if (typeof fn !== "function") { - fn._settlePromises(); - continue; - } - var receiver = queue.shift(); - var arg = queue.shift(); - fn.call(receiver, arg); - } -}; - -Async.prototype._drainQueues = function () { - this._drainQueue(this._normalQueue); - this._reset(); - this._drainQueue(this._lateQueue); -}; - -Async.prototype._queueTick = function () { - if (!this._isTickUsed) { - this._isTickUsed = true; - this._schedule(this.drainQueues); - } -}; - -Async.prototype._reset = function () { - this._isTickUsed = false; -}; - -module.exports = new Async(); -module.exports.firstLineError = firstLineError; diff --git a/src/node_modules/bluebird/js/main/bind.js b/src/node_modules/bluebird/js/main/bind.js deleted file mode 100644 index 9d8257a..0000000 --- a/src/node_modules/bluebird/js/main/bind.js +++ /dev/null @@ -1,72 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise) { -var rejectThis = function(_, e) { - this._reject(e); -}; - -var targetRejected = function(e, context) { - context.promiseRejectionQueued = true; - context.bindingPromise._then(rejectThis, rejectThis, null, this, e); -}; - -var bindingResolved = function(thisArg, context) { - if (this._isPending()) { - this._resolveCallback(context.target); - } -}; - -var bindingRejected = function(e, context) { - if (!context.promiseRejectionQueued) this._reject(e); -}; - -Promise.prototype.bind = function (thisArg) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - ret._propagateFrom(this, 1); - var target = this._target(); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - var context = { - promiseRejectionQueued: false, - promise: ret, - target: target, - bindingPromise: maybePromise - }; - target._then(INTERNAL, targetRejected, ret._progress, ret, context); - maybePromise._then( - bindingResolved, bindingRejected, ret._progress, ret, context); - } else { - ret._resolveCallback(target); - } - return ret; -}; - -Promise.prototype._setBoundTo = function (obj) { - if (obj !== undefined) { - this._bitField = this._bitField | 131072; - this._boundTo = obj; - } else { - this._bitField = this._bitField & (~131072); - } -}; - -Promise.prototype._isBound = function () { - return (this._bitField & 131072) === 131072; -}; - -Promise.bind = function (thisArg, value) { - var maybePromise = tryConvertToPromise(thisArg); - var ret = new Promise(INTERNAL); - - ret._setBoundTo(maybePromise); - if (maybePromise instanceof Promise) { - maybePromise._then(function() { - ret._resolveCallback(value); - }, ret._reject, ret._progress, ret, null); - } else { - ret._resolveCallback(value); - } - return ret; -}; -}; diff --git a/src/node_modules/bluebird/js/main/bluebird.js b/src/node_modules/bluebird/js/main/bluebird.js deleted file mode 100644 index ed6226e..0000000 --- a/src/node_modules/bluebird/js/main/bluebird.js +++ /dev/null @@ -1,11 +0,0 @@ -"use strict"; -var old; -if (typeof Promise !== "undefined") old = Promise; -function noConflict() { - try { if (Promise === bluebird) Promise = old; } - catch (e) {} - return bluebird; -} -var bluebird = require("./promise.js")(); -bluebird.noConflict = noConflict; -module.exports = bluebird; diff --git a/src/node_modules/bluebird/js/main/call_get.js b/src/node_modules/bluebird/js/main/call_get.js deleted file mode 100644 index 62c166d..0000000 --- a/src/node_modules/bluebird/js/main/call_get.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -var cr = Object.create; -if (cr) { - var callerCache = cr(null); - var getterCache = cr(null); - callerCache[" size"] = getterCache[" size"] = 0; -} - -module.exports = function(Promise) { -var util = require("./util.js"); -var canEvaluate = util.canEvaluate; -var isIdentifier = util.isIdentifier; - -var getMethodCaller; -var getGetter; -if (!false) { -var makeMethodCaller = function (methodName) { - return new Function("ensureMethod", " \n\ - return function(obj) { \n\ - 'use strict' \n\ - var len = this.length; \n\ - ensureMethod(obj, 'methodName'); \n\ - switch(len) { \n\ - case 1: return obj.methodName(this[0]); \n\ - case 2: return obj.methodName(this[0], this[1]); \n\ - case 3: return obj.methodName(this[0], this[1], this[2]); \n\ - case 0: return obj.methodName(); \n\ - default: \n\ - return obj.methodName.apply(obj, this); \n\ - } \n\ - }; \n\ - ".replace(/methodName/g, methodName))(ensureMethod); -}; - -var makeGetter = function (propertyName) { - return new Function("obj", " \n\ - 'use strict'; \n\ - return obj.propertyName; \n\ - ".replace("propertyName", propertyName)); -}; - -var getCompiled = function(name, compiler, cache) { - var ret = cache[name]; - if (typeof ret !== "function") { - if (!isIdentifier(name)) { - return null; - } - ret = compiler(name); - cache[name] = ret; - cache[" size"]++; - if (cache[" size"] > 512) { - var keys = Object.keys(cache); - for (var i = 0; i < 256; ++i) delete cache[keys[i]]; - cache[" size"] = keys.length - 256; - } - } - return ret; -}; - -getMethodCaller = function(name) { - return getCompiled(name, makeMethodCaller, callerCache); -}; - -getGetter = function(name) { - return getCompiled(name, makeGetter, getterCache); -}; -} - -function ensureMethod(obj, methodName) { - var fn; - if (obj != null) fn = obj[methodName]; - if (typeof fn !== "function") { - var message = "Object " + util.classString(obj) + " has no method '" + - util.toString(methodName) + "'"; - throw new Promise.TypeError(message); - } - return fn; -} - -function caller(obj) { - var methodName = this.pop(); - var fn = ensureMethod(obj, methodName); - return fn.apply(obj, this); -} -Promise.prototype.call = function (methodName) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - if (!false) { - if (canEvaluate) { - var maybeCaller = getMethodCaller(methodName); - if (maybeCaller !== null) { - return this._then( - maybeCaller, undefined, undefined, args, undefined); - } - } - } - args.push(methodName); - return this._then(caller, undefined, undefined, args, undefined); -}; - -function namedGetter(obj) { - return obj[this]; -} -function indexedGetter(obj) { - var index = +this; - if (index < 0) index = Math.max(0, index + obj.length); - return obj[index]; -} -Promise.prototype.get = function (propertyName) { - var isIndex = (typeof propertyName === "number"); - var getter; - if (!isIndex) { - if (canEvaluate) { - var maybeGetter = getGetter(propertyName); - getter = maybeGetter !== null ? maybeGetter : namedGetter; - } else { - getter = namedGetter; - } - } else { - getter = indexedGetter; - } - return this._then(getter, undefined, undefined, propertyName, undefined); -}; -}; diff --git a/src/node_modules/bluebird/js/main/cancel.js b/src/node_modules/bluebird/js/main/cancel.js deleted file mode 100644 index 9eb40b6..0000000 --- a/src/node_modules/bluebird/js/main/cancel.js +++ /dev/null @@ -1,48 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var errors = require("./errors.js"); -var async = require("./async.js"); -var CancellationError = errors.CancellationError; - -Promise.prototype._cancel = function (reason) { - if (!this.isCancellable()) return this; - var parent; - var promiseToReject = this; - while ((parent = promiseToReject._cancellationParent) !== undefined && - parent.isCancellable()) { - promiseToReject = parent; - } - this._unsetCancellable(); - promiseToReject._target()._rejectCallback(reason, false, true); -}; - -Promise.prototype.cancel = function (reason) { - if (!this.isCancellable()) return this; - if (reason === undefined) reason = new CancellationError(); - async.invokeLater(this._cancel, this, reason); - return this; -}; - -Promise.prototype.cancellable = function () { - if (this._cancellable()) return this; - async.enableTrampoline(); - this._setCancellable(); - this._cancellationParent = undefined; - return this; -}; - -Promise.prototype.uncancellable = function () { - var ret = this.then(); - ret._unsetCancellable(); - return ret; -}; - -Promise.prototype.fork = function (didFulfill, didReject, didProgress) { - var ret = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - - ret._setCancellable(); - ret._cancellationParent = undefined; - return ret; -}; -}; diff --git a/src/node_modules/bluebird/js/main/captured_trace.js b/src/node_modules/bluebird/js/main/captured_trace.js deleted file mode 100644 index 802acd3..0000000 --- a/src/node_modules/bluebird/js/main/captured_trace.js +++ /dev/null @@ -1,493 +0,0 @@ -"use strict"; -module.exports = function() { -var async = require("./async.js"); -var util = require("./util.js"); -var bluebirdFramePattern = - /[\\\/]bluebird[\\\/]js[\\\/](main|debug|zalgo|instrumented)/; -var stackFramePattern = null; -var formatStack = null; -var indentStackFrames = false; -var warn; - -function CapturedTrace(parent) { - this._parent = parent; - var length = this._length = 1 + (parent === undefined ? 0 : parent._length); - captureStackTrace(this, CapturedTrace); - if (length > 32) this.uncycle(); -} -util.inherits(CapturedTrace, Error); - -CapturedTrace.prototype.uncycle = function() { - var length = this._length; - if (length < 2) return; - var nodes = []; - var stackToIndex = {}; - - for (var i = 0, node = this; node !== undefined; ++i) { - nodes.push(node); - node = node._parent; - } - length = this._length = i; - for (var i = length - 1; i >= 0; --i) { - var stack = nodes[i].stack; - if (stackToIndex[stack] === undefined) { - stackToIndex[stack] = i; - } - } - for (var i = 0; i < length; ++i) { - var currentStack = nodes[i].stack; - var index = stackToIndex[currentStack]; - if (index !== undefined && index !== i) { - if (index > 0) { - nodes[index - 1]._parent = undefined; - nodes[index - 1]._length = 1; - } - nodes[i]._parent = undefined; - nodes[i]._length = 1; - var cycleEdgeNode = i > 0 ? nodes[i - 1] : this; - - if (index < length - 1) { - cycleEdgeNode._parent = nodes[index + 1]; - cycleEdgeNode._parent.uncycle(); - cycleEdgeNode._length = - cycleEdgeNode._parent._length + 1; - } else { - cycleEdgeNode._parent = undefined; - cycleEdgeNode._length = 1; - } - var currentChildLength = cycleEdgeNode._length + 1; - for (var j = i - 2; j >= 0; --j) { - nodes[j]._length = currentChildLength; - currentChildLength++; - } - return; - } - } -}; - -CapturedTrace.prototype.parent = function() { - return this._parent; -}; - -CapturedTrace.prototype.hasParent = function() { - return this._parent !== undefined; -}; - -CapturedTrace.prototype.attachExtraTrace = function(error) { - if (error.__stackCleaned__) return; - this.uncycle(); - var parsed = CapturedTrace.parseStackAndMessage(error); - var message = parsed.message; - var stacks = [parsed.stack]; - - var trace = this; - while (trace !== undefined) { - stacks.push(cleanStack(trace.stack.split("\n"))); - trace = trace._parent; - } - removeCommonRoots(stacks); - removeDuplicateOrEmptyJumps(stacks); - util.notEnumerableProp(error, "stack", reconstructStack(message, stacks)); - util.notEnumerableProp(error, "__stackCleaned__", true); -}; - -function reconstructStack(message, stacks) { - for (var i = 0; i < stacks.length - 1; ++i) { - stacks[i].push("From previous event:"); - stacks[i] = stacks[i].join("\n"); - } - if (i < stacks.length) { - stacks[i] = stacks[i].join("\n"); - } - return message + "\n" + stacks.join("\n"); -} - -function removeDuplicateOrEmptyJumps(stacks) { - for (var i = 0; i < stacks.length; ++i) { - if (stacks[i].length === 0 || - ((i + 1 < stacks.length) && stacks[i][0] === stacks[i+1][0])) { - stacks.splice(i, 1); - i--; - } - } -} - -function removeCommonRoots(stacks) { - var current = stacks[0]; - for (var i = 1; i < stacks.length; ++i) { - var prev = stacks[i]; - var currentLastIndex = current.length - 1; - var currentLastLine = current[currentLastIndex]; - var commonRootMeetPoint = -1; - - for (var j = prev.length - 1; j >= 0; --j) { - if (prev[j] === currentLastLine) { - commonRootMeetPoint = j; - break; - } - } - - for (var j = commonRootMeetPoint; j >= 0; --j) { - var line = prev[j]; - if (current[currentLastIndex] === line) { - current.pop(); - currentLastIndex--; - } else { - break; - } - } - current = prev; - } -} - -function cleanStack(stack) { - var ret = []; - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - var isTraceLine = stackFramePattern.test(line) || - " (No stack trace)" === line; - var isInternalFrame = isTraceLine && shouldIgnore(line); - if (isTraceLine && !isInternalFrame) { - if (indentStackFrames && line.charAt(0) !== " ") { - line = " " + line; - } - ret.push(line); - } - } - return ret; -} - -function stackFramesAsArray(error) { - var stack = error.stack.replace(/\s+$/g, "").split("\n"); - for (var i = 0; i < stack.length; ++i) { - var line = stack[i]; - if (" (No stack trace)" === line || stackFramePattern.test(line)) { - break; - } - } - if (i > 0) { - stack = stack.slice(i); - } - return stack; -} - -CapturedTrace.parseStackAndMessage = function(error) { - var stack = error.stack; - var message = error.toString(); - stack = typeof stack === "string" && stack.length > 0 - ? stackFramesAsArray(error) : [" (No stack trace)"]; - return { - message: message, - stack: cleanStack(stack) - }; -}; - -CapturedTrace.formatAndLogError = function(error, title) { - if (typeof console !== "undefined") { - var message; - if (typeof error === "object" || typeof error === "function") { - var stack = error.stack; - message = title + formatStack(stack, error); - } else { - message = title + String(error); - } - if (typeof warn === "function") { - warn(message); - } else if (typeof console.log === "function" || - typeof console.log === "object") { - console.log(message); - } - } -}; - -CapturedTrace.unhandledRejection = function (reason) { - CapturedTrace.formatAndLogError(reason, "^--- With additional stack trace: "); -}; - -CapturedTrace.isSupported = function () { - return typeof captureStackTrace === "function"; -}; - -CapturedTrace.fireRejectionEvent = -function(name, localHandler, reason, promise) { - var localEventFired = false; - try { - if (typeof localHandler === "function") { - localEventFired = true; - if (name === "rejectionHandled") { - localHandler(promise); - } else { - localHandler(reason, promise); - } - } - } catch (e) { - async.throwLater(e); - } - - var globalEventFired = false; - try { - globalEventFired = fireGlobalEvent(name, reason, promise); - } catch (e) { - globalEventFired = true; - async.throwLater(e); - } - - var domEventFired = false; - if (fireDomEvent) { - try { - domEventFired = fireDomEvent(name.toLowerCase(), { - reason: reason, - promise: promise - }); - } catch (e) { - domEventFired = true; - async.throwLater(e); - } - } - - if (!globalEventFired && !localEventFired && !domEventFired && - name === "unhandledRejection") { - CapturedTrace.formatAndLogError(reason, "Unhandled rejection "); - } -}; - -function formatNonError(obj) { - var str; - if (typeof obj === "function") { - str = "[function " + - (obj.name || "anonymous") + - "]"; - } else { - str = obj.toString(); - var ruselessToString = /\[object [a-zA-Z0-9$_]+\]/; - if (ruselessToString.test(str)) { - try { - var newStr = JSON.stringify(obj); - str = newStr; - } - catch(e) { - - } - } - if (str.length === 0) { - str = "(empty array)"; - } - } - return ("(<" + snip(str) + ">, no stack trace)"); -} - -function snip(str) { - var maxChars = 41; - if (str.length < maxChars) { - return str; - } - return str.substr(0, maxChars - 3) + "..."; -} - -var shouldIgnore = function() { return false; }; -var parseLineInfoRegex = /[\/<\(]([^:\/]+):(\d+):(?:\d+)\)?\s*$/; -function parseLineInfo(line) { - var matches = line.match(parseLineInfoRegex); - if (matches) { - return { - fileName: matches[1], - line: parseInt(matches[2], 10) - }; - } -} -CapturedTrace.setBounds = function(firstLineError, lastLineError) { - if (!CapturedTrace.isSupported()) return; - var firstStackLines = firstLineError.stack.split("\n"); - var lastStackLines = lastLineError.stack.split("\n"); - var firstIndex = -1; - var lastIndex = -1; - var firstFileName; - var lastFileName; - for (var i = 0; i < firstStackLines.length; ++i) { - var result = parseLineInfo(firstStackLines[i]); - if (result) { - firstFileName = result.fileName; - firstIndex = result.line; - break; - } - } - for (var i = 0; i < lastStackLines.length; ++i) { - var result = parseLineInfo(lastStackLines[i]); - if (result) { - lastFileName = result.fileName; - lastIndex = result.line; - break; - } - } - if (firstIndex < 0 || lastIndex < 0 || !firstFileName || !lastFileName || - firstFileName !== lastFileName || firstIndex >= lastIndex) { - return; - } - - shouldIgnore = function(line) { - if (bluebirdFramePattern.test(line)) return true; - var info = parseLineInfo(line); - if (info) { - if (info.fileName === firstFileName && - (firstIndex <= info.line && info.line <= lastIndex)) { - return true; - } - } - return false; - }; -}; - -var captureStackTrace = (function stackDetection() { - var v8stackFramePattern = /^\s*at\s*/; - var v8stackFormatter = function(stack, error) { - if (typeof stack === "string") return stack; - - if (error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - if (typeof Error.stackTraceLimit === "number" && - typeof Error.captureStackTrace === "function") { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - var captureStackTrace = Error.captureStackTrace; - - shouldIgnore = function(line) { - return bluebirdFramePattern.test(line); - }; - return function(receiver, ignoreUntil) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - captureStackTrace(receiver, ignoreUntil); - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - var err = new Error(); - - if (typeof err.stack === "string" && - err.stack.split("\n")[0].indexOf("stackDetection@") >= 0) { - stackFramePattern = /@/; - formatStack = v8stackFormatter; - indentStackFrames = true; - return function captureStackTrace(o) { - o.stack = new Error().stack; - }; - } - - var hasStackAfterThrow; - try { throw new Error(); } - catch(e) { - hasStackAfterThrow = ("stack" in e); - } - if (!("stack" in err) && hasStackAfterThrow && - typeof Error.stackTraceLimit === "number") { - stackFramePattern = v8stackFramePattern; - formatStack = v8stackFormatter; - return function captureStackTrace(o) { - Error.stackTraceLimit = Error.stackTraceLimit + 6; - try { throw new Error(); } - catch(e) { o.stack = e.stack; } - Error.stackTraceLimit = Error.stackTraceLimit - 6; - }; - } - - formatStack = function(stack, error) { - if (typeof stack === "string") return stack; - - if ((typeof error === "object" || - typeof error === "function") && - error.name !== undefined && - error.message !== undefined) { - return error.toString(); - } - return formatNonError(error); - }; - - return null; - -})([]); - -var fireDomEvent; -var fireGlobalEvent = (function() { - if (util.isNode) { - return function(name, reason, promise) { - if (name === "rejectionHandled") { - return process.emit(name, promise); - } else { - return process.emit(name, reason, promise); - } - }; - } else { - var customEventWorks = false; - var anyEventWorks = true; - try { - var ev = new self.CustomEvent("test"); - customEventWorks = ev instanceof CustomEvent; - } catch (e) {} - if (!customEventWorks) { - try { - var event = document.createEvent("CustomEvent"); - event.initCustomEvent("testingtheevent", false, true, {}); - self.dispatchEvent(event); - } catch (e) { - anyEventWorks = false; - } - } - if (anyEventWorks) { - fireDomEvent = function(type, detail) { - var event; - if (customEventWorks) { - event = new self.CustomEvent(type, { - detail: detail, - bubbles: false, - cancelable: true - }); - } else if (self.dispatchEvent) { - event = document.createEvent("CustomEvent"); - event.initCustomEvent(type, false, true, detail); - } - - return event ? !self.dispatchEvent(event) : false; - }; - } - - var toWindowMethodNameMap = {}; - toWindowMethodNameMap["unhandledRejection"] = ("on" + - "unhandledRejection").toLowerCase(); - toWindowMethodNameMap["rejectionHandled"] = ("on" + - "rejectionHandled").toLowerCase(); - - return function(name, reason, promise) { - var methodName = toWindowMethodNameMap[name]; - var method = self[methodName]; - if (!method) return false; - if (name === "rejectionHandled") { - method.call(self, promise); - } else { - method.call(self, reason, promise); - } - return true; - }; - } -})(); - -if (typeof console !== "undefined" && typeof console.warn !== "undefined") { - warn = function (message) { - console.warn(message); - }; - if (util.isNode && process.stderr.isTTY) { - warn = function(message) { - process.stderr.write("\u001b[31m" + message + "\u001b[39m\n"); - }; - } else if (!util.isNode && typeof (new Error().stack) === "string") { - warn = function(message) { - console.warn("%c" + message, "color: red"); - }; - } -} - -return CapturedTrace; -}; diff --git a/src/node_modules/bluebird/js/main/catch_filter.js b/src/node_modules/bluebird/js/main/catch_filter.js deleted file mode 100644 index df12733..0000000 --- a/src/node_modules/bluebird/js/main/catch_filter.js +++ /dev/null @@ -1,66 +0,0 @@ -"use strict"; -module.exports = function(NEXT_FILTER) { -var util = require("./util.js"); -var errors = require("./errors.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var keys = require("./es5.js").keys; -var TypeError = errors.TypeError; - -function CatchFilter(instances, callback, promise) { - this._instances = instances; - this._callback = callback; - this._promise = promise; -} - -function safePredicate(predicate, e) { - var safeObject = {}; - var retfilter = tryCatch(predicate).call(safeObject, e); - - if (retfilter === errorObj) return retfilter; - - var safeKeys = keys(safeObject); - if (safeKeys.length) { - errorObj.e = new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a"); - return errorObj; - } - return retfilter; -} - -CatchFilter.prototype.doFilter = function (e) { - var cb = this._callback; - var promise = this._promise; - var boundTo = promise._boundValue(); - for (var i = 0, len = this._instances.length; i < len; ++i) { - var item = this._instances[i]; - var itemIsErrorType = item === Error || - (item != null && item.prototype instanceof Error); - - if (itemIsErrorType && e instanceof item) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } else if (typeof item === "function" && !itemIsErrorType) { - var shouldHandle = safePredicate(item, e); - if (shouldHandle === errorObj) { - e = errorObj.e; - break; - } else if (shouldHandle) { - var ret = tryCatch(cb).call(boundTo, e); - if (ret === errorObj) { - NEXT_FILTER.e = ret.e; - return NEXT_FILTER; - } - return ret; - } - } - } - NEXT_FILTER.e = e; - return NEXT_FILTER; -}; - -return CatchFilter; -}; diff --git a/src/node_modules/bluebird/js/main/context.js b/src/node_modules/bluebird/js/main/context.js deleted file mode 100644 index ccd7702..0000000 --- a/src/node_modules/bluebird/js/main/context.js +++ /dev/null @@ -1,38 +0,0 @@ -"use strict"; -module.exports = function(Promise, CapturedTrace, isDebugging) { -var contextStack = []; -function Context() { - this._trace = new CapturedTrace(peekContext()); -} -Context.prototype._pushContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.push(this._trace); - } -}; - -Context.prototype._popContext = function () { - if (!isDebugging()) return; - if (this._trace !== undefined) { - contextStack.pop(); - } -}; - -function createContext() { - if (isDebugging()) return new Context(); -} - -function peekContext() { - var lastIndex = contextStack.length - 1; - if (lastIndex >= 0) { - return contextStack[lastIndex]; - } - return undefined; -} - -Promise.prototype._peekContext = peekContext; -Promise.prototype._pushContext = Context.prototype._pushContext; -Promise.prototype._popContext = Context.prototype._popContext; - -return createContext; -}; diff --git a/src/node_modules/bluebird/js/main/debuggability.js b/src/node_modules/bluebird/js/main/debuggability.js deleted file mode 100644 index 106baf6..0000000 --- a/src/node_modules/bluebird/js/main/debuggability.js +++ /dev/null @@ -1,162 +0,0 @@ -"use strict"; -module.exports = function(Promise, CapturedTrace) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var Warning = require("./errors.js").Warning; -var util = require("./util.js"); -var canAttachTrace = util.canAttachTrace; -var unhandledRejectionHandled; -var possiblyUnhandledRejection; -var debugging = false || (util.isNode && - (!!process.env["BLUEBIRD_DEBUG"] || - process.env["NODE_ENV"] === "development")); - -if (util.isNode && process.env["BLUEBIRD_DEBUG"] == 0) debugging = false; - -if (debugging) { - async.disableTrampolineIfNecessary(); -} - -Promise.prototype._ignoreRejections = function() { - this._unsetRejectionIsUnhandled(); - this._bitField = this._bitField | 16777216; -}; - -Promise.prototype._ensurePossibleRejectionHandled = function () { - if ((this._bitField & 16777216) !== 0) return; - this._setRejectionIsUnhandled(); - async.invokeLater(this._notifyUnhandledRejection, this, undefined); -}; - -Promise.prototype._notifyUnhandledRejectionIsHandled = function () { - CapturedTrace.fireRejectionEvent("rejectionHandled", - unhandledRejectionHandled, undefined, this); -}; - -Promise.prototype._notifyUnhandledRejection = function () { - if (this._isRejectionUnhandled()) { - var reason = this._getCarriedStackTrace() || this._settledValue; - this._setUnhandledRejectionIsNotified(); - CapturedTrace.fireRejectionEvent("unhandledRejection", - possiblyUnhandledRejection, reason, this); - } -}; - -Promise.prototype._setUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField | 524288; -}; - -Promise.prototype._unsetUnhandledRejectionIsNotified = function () { - this._bitField = this._bitField & (~524288); -}; - -Promise.prototype._isUnhandledRejectionNotified = function () { - return (this._bitField & 524288) > 0; -}; - -Promise.prototype._setRejectionIsUnhandled = function () { - this._bitField = this._bitField | 2097152; -}; - -Promise.prototype._unsetRejectionIsUnhandled = function () { - this._bitField = this._bitField & (~2097152); - if (this._isUnhandledRejectionNotified()) { - this._unsetUnhandledRejectionIsNotified(); - this._notifyUnhandledRejectionIsHandled(); - } -}; - -Promise.prototype._isRejectionUnhandled = function () { - return (this._bitField & 2097152) > 0; -}; - -Promise.prototype._setCarriedStackTrace = function (capturedTrace) { - this._bitField = this._bitField | 1048576; - this._fulfillmentHandler0 = capturedTrace; -}; - -Promise.prototype._isCarryingStackTrace = function () { - return (this._bitField & 1048576) > 0; -}; - -Promise.prototype._getCarriedStackTrace = function () { - return this._isCarryingStackTrace() - ? this._fulfillmentHandler0 - : undefined; -}; - -Promise.prototype._captureStackTrace = function () { - if (debugging) { - this._trace = new CapturedTrace(this._peekContext()); - } - return this; -}; - -Promise.prototype._attachExtraTrace = function (error, ignoreSelf) { - if (debugging && canAttachTrace(error)) { - var trace = this._trace; - if (trace !== undefined) { - if (ignoreSelf) trace = trace._parent; - } - if (trace !== undefined) { - trace.attachExtraTrace(error); - } else if (!error.__stackCleaned__) { - var parsed = CapturedTrace.parseStackAndMessage(error); - util.notEnumerableProp(error, "stack", - parsed.message + "\n" + parsed.stack.join("\n")); - util.notEnumerableProp(error, "__stackCleaned__", true); - } - } -}; - -Promise.prototype._warn = function(message) { - var warning = new Warning(message); - var ctx = this._peekContext(); - if (ctx) { - ctx.attachExtraTrace(warning); - } else { - var parsed = CapturedTrace.parseStackAndMessage(warning); - warning.stack = parsed.message + "\n" + parsed.stack.join("\n"); - } - CapturedTrace.formatAndLogError(warning, ""); -}; - -Promise.onPossiblyUnhandledRejection = function (fn) { - var domain = getDomain(); - possiblyUnhandledRejection = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.onUnhandledRejectionHandled = function (fn) { - var domain = getDomain(); - unhandledRejectionHandled = - typeof fn === "function" ? (domain === null ? fn : domain.bind(fn)) - : undefined; -}; - -Promise.longStackTraces = function () { - if (async.haveItemsQueued() && - debugging === false - ) { - throw new Error("cannot enable long stack traces after promises have been created\u000a\u000a See http://goo.gl/DT1qyG\u000a"); - } - debugging = CapturedTrace.isSupported(); - if (debugging) { - async.disableTrampolineIfNecessary(); - } -}; - -Promise.hasLongStackTraces = function () { - return debugging && CapturedTrace.isSupported(); -}; - -if (!CapturedTrace.isSupported()) { - Promise.longStackTraces = function(){}; - debugging = false; -} - -return function() { - return debugging; -}; -}; diff --git a/src/node_modules/bluebird/js/main/direct_resolve.js b/src/node_modules/bluebird/js/main/direct_resolve.js deleted file mode 100644 index 054685a..0000000 --- a/src/node_modules/bluebird/js/main/direct_resolve.js +++ /dev/null @@ -1,63 +0,0 @@ -"use strict"; -var util = require("./util.js"); -var isPrimitive = util.isPrimitive; - -module.exports = function(Promise) { -var returner = function () { - return this; -}; -var thrower = function () { - throw this; -}; -var returnUndefined = function() {}; -var throwUndefined = function() { - throw undefined; -}; - -var wrapper = function (value, action) { - if (action === 1) { - return function () { - throw value; - }; - } else if (action === 2) { - return function () { - return value; - }; - } -}; - - -Promise.prototype["return"] = -Promise.prototype.thenReturn = function (value) { - if (value === undefined) return this.then(returnUndefined); - - if (isPrimitive(value)) { - return this._then( - wrapper(value, 2), - undefined, - undefined, - undefined, - undefined - ); - } else if (value instanceof Promise) { - value._ignoreRejections(); - } - return this._then(returner, undefined, undefined, value, undefined); -}; - -Promise.prototype["throw"] = -Promise.prototype.thenThrow = function (reason) { - if (reason === undefined) return this.then(throwUndefined); - - if (isPrimitive(reason)) { - return this._then( - wrapper(reason, 1), - undefined, - undefined, - undefined, - undefined - ); - } - return this._then(thrower, undefined, undefined, reason, undefined); -}; -}; diff --git a/src/node_modules/bluebird/js/main/each.js b/src/node_modules/bluebird/js/main/each.js deleted file mode 100644 index a37e22c..0000000 --- a/src/node_modules/bluebird/js/main/each.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseReduce = Promise.reduce; - -Promise.prototype.each = function (fn) { - return PromiseReduce(this, fn, null, INTERNAL); -}; - -Promise.each = function (promises, fn) { - return PromiseReduce(promises, fn, null, INTERNAL); -}; -}; diff --git a/src/node_modules/bluebird/js/main/errors.js b/src/node_modules/bluebird/js/main/errors.js deleted file mode 100644 index c334bb1..0000000 --- a/src/node_modules/bluebird/js/main/errors.js +++ /dev/null @@ -1,111 +0,0 @@ -"use strict"; -var es5 = require("./es5.js"); -var Objectfreeze = es5.freeze; -var util = require("./util.js"); -var inherits = util.inherits; -var notEnumerableProp = util.notEnumerableProp; - -function subError(nameProperty, defaultMessage) { - function SubError(message) { - if (!(this instanceof SubError)) return new SubError(message); - notEnumerableProp(this, "message", - typeof message === "string" ? message : defaultMessage); - notEnumerableProp(this, "name", nameProperty); - if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } else { - Error.call(this); - } - } - inherits(SubError, Error); - return SubError; -} - -var _TypeError, _RangeError; -var Warning = subError("Warning", "warning"); -var CancellationError = subError("CancellationError", "cancellation error"); -var TimeoutError = subError("TimeoutError", "timeout error"); -var AggregateError = subError("AggregateError", "aggregate error"); -try { - _TypeError = TypeError; - _RangeError = RangeError; -} catch(e) { - _TypeError = subError("TypeError", "type error"); - _RangeError = subError("RangeError", "range error"); -} - -var methods = ("join pop push shift unshift slice filter forEach some " + - "every map indexOf lastIndexOf reduce reduceRight sort reverse").split(" "); - -for (var i = 0; i < methods.length; ++i) { - if (typeof Array.prototype[methods[i]] === "function") { - AggregateError.prototype[methods[i]] = Array.prototype[methods[i]]; - } -} - -es5.defineProperty(AggregateError.prototype, "length", { - value: 0, - configurable: false, - writable: true, - enumerable: true -}); -AggregateError.prototype["isOperational"] = true; -var level = 0; -AggregateError.prototype.toString = function() { - var indent = Array(level * 4 + 1).join(" "); - var ret = "\n" + indent + "AggregateError of:" + "\n"; - level++; - indent = Array(level * 4 + 1).join(" "); - for (var i = 0; i < this.length; ++i) { - var str = this[i] === this ? "[Circular AggregateError]" : this[i] + ""; - var lines = str.split("\n"); - for (var j = 0; j < lines.length; ++j) { - lines[j] = indent + lines[j]; - } - str = lines.join("\n"); - ret += str + "\n"; - } - level--; - return ret; -}; - -function OperationalError(message) { - if (!(this instanceof OperationalError)) - return new OperationalError(message); - notEnumerableProp(this, "name", "OperationalError"); - notEnumerableProp(this, "message", message); - this.cause = message; - this["isOperational"] = true; - - if (message instanceof Error) { - notEnumerableProp(this, "message", message.message); - notEnumerableProp(this, "stack", message.stack); - } else if (Error.captureStackTrace) { - Error.captureStackTrace(this, this.constructor); - } - -} -inherits(OperationalError, Error); - -var errorTypes = Error["__BluebirdErrorTypes__"]; -if (!errorTypes) { - errorTypes = Objectfreeze({ - CancellationError: CancellationError, - TimeoutError: TimeoutError, - OperationalError: OperationalError, - RejectionError: OperationalError, - AggregateError: AggregateError - }); - notEnumerableProp(Error, "__BluebirdErrorTypes__", errorTypes); -} - -module.exports = { - Error: Error, - TypeError: _TypeError, - RangeError: _RangeError, - CancellationError: errorTypes.CancellationError, - OperationalError: errorTypes.OperationalError, - TimeoutError: errorTypes.TimeoutError, - AggregateError: errorTypes.AggregateError, - Warning: Warning -}; diff --git a/src/node_modules/bluebird/js/main/es5.js b/src/node_modules/bluebird/js/main/es5.js deleted file mode 100644 index ea41d5a..0000000 --- a/src/node_modules/bluebird/js/main/es5.js +++ /dev/null @@ -1,80 +0,0 @@ -var isES5 = (function(){ - "use strict"; - return this === undefined; -})(); - -if (isES5) { - module.exports = { - freeze: Object.freeze, - defineProperty: Object.defineProperty, - getDescriptor: Object.getOwnPropertyDescriptor, - keys: Object.keys, - names: Object.getOwnPropertyNames, - getPrototypeOf: Object.getPrototypeOf, - isArray: Array.isArray, - isES5: isES5, - propertyIsWritable: function(obj, prop) { - var descriptor = Object.getOwnPropertyDescriptor(obj, prop); - return !!(!descriptor || descriptor.writable || descriptor.set); - } - }; -} else { - var has = {}.hasOwnProperty; - var str = {}.toString; - var proto = {}.constructor.prototype; - - var ObjectKeys = function (o) { - var ret = []; - for (var key in o) { - if (has.call(o, key)) { - ret.push(key); - } - } - return ret; - }; - - var ObjectGetDescriptor = function(o, key) { - return {value: o[key]}; - }; - - var ObjectDefineProperty = function (o, key, desc) { - o[key] = desc.value; - return o; - }; - - var ObjectFreeze = function (obj) { - return obj; - }; - - var ObjectGetPrototypeOf = function (obj) { - try { - return Object(obj).constructor.prototype; - } - catch (e) { - return proto; - } - }; - - var ArrayIsArray = function (obj) { - try { - return str.call(obj) === "[object Array]"; - } - catch(e) { - return false; - } - }; - - module.exports = { - isArray: ArrayIsArray, - keys: ObjectKeys, - names: ObjectKeys, - defineProperty: ObjectDefineProperty, - getDescriptor: ObjectGetDescriptor, - freeze: ObjectFreeze, - getPrototypeOf: ObjectGetPrototypeOf, - isES5: isES5, - propertyIsWritable: function() { - return true; - } - }; -} diff --git a/src/node_modules/bluebird/js/main/filter.js b/src/node_modules/bluebird/js/main/filter.js deleted file mode 100644 index ed57bf0..0000000 --- a/src/node_modules/bluebird/js/main/filter.js +++ /dev/null @@ -1,12 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var PromiseMap = Promise.map; - -Promise.prototype.filter = function (fn, options) { - return PromiseMap(this, fn, options, INTERNAL); -}; - -Promise.filter = function (promises, fn, options) { - return PromiseMap(promises, fn, options, INTERNAL); -}; -}; diff --git a/src/node_modules/bluebird/js/main/finally.js b/src/node_modules/bluebird/js/main/finally.js deleted file mode 100644 index c9342bc..0000000 --- a/src/node_modules/bluebird/js/main/finally.js +++ /dev/null @@ -1,98 +0,0 @@ -"use strict"; -module.exports = function(Promise, NEXT_FILTER, tryConvertToPromise) { -var util = require("./util.js"); -var isPrimitive = util.isPrimitive; -var thrower = util.thrower; - -function returnThis() { - return this; -} -function throwThis() { - throw this; -} -function return$(r) { - return function() { - return r; - }; -} -function throw$(r) { - return function() { - throw r; - }; -} -function promisedFinally(ret, reasonOrValue, isFulfilled) { - var then; - if (isPrimitive(reasonOrValue)) { - then = isFulfilled ? return$(reasonOrValue) : throw$(reasonOrValue); - } else { - then = isFulfilled ? returnThis : throwThis; - } - return ret._then(then, thrower, undefined, reasonOrValue, undefined); -} - -function finallyHandler(reasonOrValue) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue()) - : handler(); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, reasonOrValue, - promise.isFulfilled()); - } - } - - if (promise.isRejected()) { - NEXT_FILTER.e = reasonOrValue; - return NEXT_FILTER; - } else { - return reasonOrValue; - } -} - -function tapHandler(value) { - var promise = this.promise; - var handler = this.handler; - - var ret = promise._isBound() - ? handler.call(promise._boundValue(), value) - : handler(value); - - if (ret !== undefined) { - var maybePromise = tryConvertToPromise(ret, promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - return promisedFinally(maybePromise, value, true); - } - } - return value; -} - -Promise.prototype._passThroughHandler = function (handler, isFinally) { - if (typeof handler !== "function") return this.then(); - - var promiseAndHandler = { - promise: this, - handler: handler - }; - - return this._then( - isFinally ? finallyHandler : tapHandler, - isFinally ? finallyHandler : undefined, undefined, - promiseAndHandler, undefined); -}; - -Promise.prototype.lastly = -Promise.prototype["finally"] = function (handler) { - return this._passThroughHandler(handler, true); -}; - -Promise.prototype.tap = function (handler) { - return this._passThroughHandler(handler, false); -}; -}; diff --git a/src/node_modules/bluebird/js/main/generators.js b/src/node_modules/bluebird/js/main/generators.js deleted file mode 100644 index 4c0568d..0000000 --- a/src/node_modules/bluebird/js/main/generators.js +++ /dev/null @@ -1,136 +0,0 @@ -"use strict"; -module.exports = function(Promise, - apiRejection, - INTERNAL, - tryConvertToPromise) { -var errors = require("./errors.js"); -var TypeError = errors.TypeError; -var util = require("./util.js"); -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -var yieldHandlers = []; - -function promiseFromYieldHandler(value, yieldHandlers, traceParent) { - for (var i = 0; i < yieldHandlers.length; ++i) { - traceParent._pushContext(); - var result = tryCatch(yieldHandlers[i])(value); - traceParent._popContext(); - if (result === errorObj) { - traceParent._pushContext(); - var ret = Promise.reject(errorObj.e); - traceParent._popContext(); - return ret; - } - var maybePromise = tryConvertToPromise(result, traceParent); - if (maybePromise instanceof Promise) return maybePromise; - } - return null; -} - -function PromiseSpawn(generatorFunction, receiver, yieldHandler, stack) { - var promise = this._promise = new Promise(INTERNAL); - promise._captureStackTrace(); - this._stack = stack; - this._generatorFunction = generatorFunction; - this._receiver = receiver; - this._generator = undefined; - this._yieldHandlers = typeof yieldHandler === "function" - ? [yieldHandler].concat(yieldHandlers) - : yieldHandlers; -} - -PromiseSpawn.prototype.promise = function () { - return this._promise; -}; - -PromiseSpawn.prototype._run = function () { - this._generator = this._generatorFunction.call(this._receiver); - this._receiver = - this._generatorFunction = undefined; - this._next(undefined); -}; - -PromiseSpawn.prototype._continue = function (result) { - if (result === errorObj) { - return this._promise._rejectCallback(result.e, false, true); - } - - var value = result.value; - if (result.done === true) { - this._promise._resolveCallback(value); - } else { - var maybePromise = tryConvertToPromise(value, this._promise); - if (!(maybePromise instanceof Promise)) { - maybePromise = - promiseFromYieldHandler(maybePromise, - this._yieldHandlers, - this._promise); - if (maybePromise === null) { - this._throw( - new TypeError( - "A value %s was yielded that could not be treated as a promise\u000a\u000a See http://goo.gl/4Y4pDk\u000a\u000a".replace("%s", value) + - "From coroutine:\u000a" + - this._stack.split("\n").slice(1, -7).join("\n") - ) - ); - return; - } - } - maybePromise._then( - this._next, - this._throw, - undefined, - this, - null - ); - } -}; - -PromiseSpawn.prototype._throw = function (reason) { - this._promise._attachExtraTrace(reason); - this._promise._pushContext(); - var result = tryCatch(this._generator["throw"]) - .call(this._generator, reason); - this._promise._popContext(); - this._continue(result); -}; - -PromiseSpawn.prototype._next = function (value) { - this._promise._pushContext(); - var result = tryCatch(this._generator.next).call(this._generator, value); - this._promise._popContext(); - this._continue(result); -}; - -Promise.coroutine = function (generatorFunction, options) { - if (typeof generatorFunction !== "function") { - throw new TypeError("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var yieldHandler = Object(options).yieldHandler; - var PromiseSpawn$ = PromiseSpawn; - var stack = new Error().stack; - return function () { - var generator = generatorFunction.apply(this, arguments); - var spawn = new PromiseSpawn$(undefined, undefined, yieldHandler, - stack); - spawn._generator = generator; - spawn._next(undefined); - return spawn.promise(); - }; -}; - -Promise.coroutine.addYieldHandler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - yieldHandlers.push(fn); -}; - -Promise.spawn = function (generatorFunction) { - if (typeof generatorFunction !== "function") { - return apiRejection("generatorFunction must be a function\u000a\u000a See http://goo.gl/6Vqhm0\u000a"); - } - var spawn = new PromiseSpawn(generatorFunction, this); - var ret = spawn.promise(); - spawn._run(Promise.spawn); - return ret; -}; -}; diff --git a/src/node_modules/bluebird/js/main/join.js b/src/node_modules/bluebird/js/main/join.js deleted file mode 100644 index cf33eb1..0000000 --- a/src/node_modules/bluebird/js/main/join.js +++ /dev/null @@ -1,107 +0,0 @@ -"use strict"; -module.exports = -function(Promise, PromiseArray, tryConvertToPromise, INTERNAL) { -var util = require("./util.js"); -var canEvaluate = util.canEvaluate; -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var reject; - -if (!false) { -if (canEvaluate) { - var thenCallback = function(i) { - return new Function("value", "holder", " \n\ - 'use strict'; \n\ - holder.pIndex = value; \n\ - holder.checkFulfillment(this); \n\ - ".replace(/Index/g, i)); - }; - - var caller = function(count) { - var values = []; - for (var i = 1; i <= count; ++i) values.push("holder.p" + i); - return new Function("holder", " \n\ - 'use strict'; \n\ - var callback = holder.fn; \n\ - return callback(values); \n\ - ".replace(/values/g, values.join(", "))); - }; - var thenCallbacks = []; - var callers = [undefined]; - for (var i = 1; i <= 5; ++i) { - thenCallbacks.push(thenCallback(i)); - callers.push(caller(i)); - } - - var Holder = function(total, fn) { - this.p1 = this.p2 = this.p3 = this.p4 = this.p5 = null; - this.fn = fn; - this.total = total; - this.now = 0; - }; - - Holder.prototype.callers = callers; - Holder.prototype.checkFulfillment = function(promise) { - var now = this.now; - now++; - var total = this.total; - if (now >= total) { - var handler = this.callers[total]; - promise._pushContext(); - var ret = tryCatch(handler)(this); - promise._popContext(); - if (ret === errorObj) { - promise._rejectCallback(ret.e, false, true); - } else { - promise._resolveCallback(ret); - } - } else { - this.now = now; - } - }; - - var reject = function (reason) { - this._reject(reason); - }; -} -} - -Promise.join = function () { - var last = arguments.length - 1; - var fn; - if (last > 0 && typeof arguments[last] === "function") { - fn = arguments[last]; - if (!false) { - if (last < 6 && canEvaluate) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - var holder = new Holder(last, fn); - var callbacks = thenCallbacks; - for (var i = 0; i < last; ++i) { - var maybePromise = tryConvertToPromise(arguments[i], ret); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._then(callbacks[i], reject, - undefined, ret, holder); - } else if (maybePromise._isFulfilled()) { - callbacks[i].call(ret, - maybePromise._value(), holder); - } else { - ret._reject(maybePromise._reason()); - } - } else { - callbacks[i].call(ret, maybePromise, holder); - } - } - return ret; - } - } - } - var $_len = arguments.length;var args = new Array($_len); for(var $_i = 0; $_i < $_len; ++$_i) {args[$_i] = arguments[$_i];} - if (fn) args.pop(); - var ret = new PromiseArray(args).promise(); - return fn !== undefined ? ret.spread(fn) : ret; -}; - -}; diff --git a/src/node_modules/bluebird/js/main/map.js b/src/node_modules/bluebird/js/main/map.js deleted file mode 100644 index 2f40efd..0000000 --- a/src/node_modules/bluebird/js/main/map.js +++ /dev/null @@ -1,133 +0,0 @@ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var util = require("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -var PENDING = {}; -var EMPTY_ARRAY = []; - -function MappingPromiseArray(promises, fn, limit, _filter) { - this.constructor$(promises); - this._promise._captureStackTrace(); - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._preservedValues = _filter === INTERNAL - ? new Array(this.length()) - : null; - this._limit = limit; - this._inFlight = 0; - this._queue = limit >= 1 ? [] : EMPTY_ARRAY; - async.invoke(init, this, undefined); -} -util.inherits(MappingPromiseArray, PromiseArray); -function init() {this._init$(undefined, -2);} - -MappingPromiseArray.prototype._init = function () {}; - -MappingPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - var length = this.length(); - var preservedValues = this._preservedValues; - var limit = this._limit; - if (values[index] === PENDING) { - values[index] = value; - if (limit >= 1) { - this._inFlight--; - this._drainQueue(); - if (this._isResolved()) return; - } - } else { - if (limit >= 1 && this._inFlight >= limit) { - values[index] = value; - this._queue.push(index); - return; - } - if (preservedValues !== null) preservedValues[index] = value; - - var callback = this._callback; - var receiver = this._promise._boundValue(); - this._promise._pushContext(); - var ret = tryCatch(callback).call(receiver, value, index, length); - this._promise._popContext(); - if (ret === errorObj) return this._reject(ret.e); - - var maybePromise = tryConvertToPromise(ret, this._promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - if (limit >= 1) this._inFlight++; - values[index] = PENDING; - return maybePromise._proxyPromiseArray(this, index); - } else if (maybePromise._isFulfilled()) { - ret = maybePromise._value(); - } else { - return this._reject(maybePromise._reason()); - } - } - values[index] = ret; - } - var totalResolved = ++this._totalResolved; - if (totalResolved >= length) { - if (preservedValues !== null) { - this._filter(values, preservedValues); - } else { - this._resolve(values); - } - - } -}; - -MappingPromiseArray.prototype._drainQueue = function () { - var queue = this._queue; - var limit = this._limit; - var values = this._values; - while (queue.length > 0 && this._inFlight < limit) { - if (this._isResolved()) return; - var index = queue.pop(); - this._promiseFulfilled(values[index], index); - } -}; - -MappingPromiseArray.prototype._filter = function (booleans, values) { - var len = values.length; - var ret = new Array(len); - var j = 0; - for (var i = 0; i < len; ++i) { - if (booleans[i]) ret[j++] = values[i]; - } - ret.length = j; - this._resolve(ret); -}; - -MappingPromiseArray.prototype.preservedValues = function () { - return this._preservedValues; -}; - -function map(promises, fn, options, _filter) { - var limit = typeof options === "object" && options !== null - ? options.concurrency - : 0; - limit = typeof limit === "number" && - isFinite(limit) && limit >= 1 ? limit : 0; - return new MappingPromiseArray(promises, fn, limit, _filter); -} - -Promise.prototype.map = function (fn, options) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - return map(this, fn, options, null).promise(); -}; - -Promise.map = function (promises, fn, options, _filter) { - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - return map(promises, fn, options, _filter).promise(); -}; - - -}; diff --git a/src/node_modules/bluebird/js/main/method.js b/src/node_modules/bluebird/js/main/method.js deleted file mode 100644 index 3d3eeb1..0000000 --- a/src/node_modules/bluebird/js/main/method.js +++ /dev/null @@ -1,44 +0,0 @@ -"use strict"; -module.exports = -function(Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var util = require("./util.js"); -var tryCatch = util.tryCatch; - -Promise.method = function (fn) { - if (typeof fn !== "function") { - throw new Promise.TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - return function () { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = tryCatch(fn).apply(this, arguments); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; - }; -}; - -Promise.attempt = Promise["try"] = function (fn, args, ctx) { - if (typeof fn !== "function") { - return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._pushContext(); - var value = util.isArray(args) - ? tryCatch(fn).apply(ctx, args) - : tryCatch(fn).call(ctx, args); - ret._popContext(); - ret._resolveFromSyncValue(value); - return ret; -}; - -Promise.prototype._resolveFromSyncValue = function (value) { - if (value === util.errorObj) { - this._rejectCallback(value.e, false, true); - } else { - this._resolveCallback(value, true); - } -}; -}; diff --git a/src/node_modules/bluebird/js/main/nodeify.js b/src/node_modules/bluebird/js/main/nodeify.js deleted file mode 100644 index 257565d..0000000 --- a/src/node_modules/bluebird/js/main/nodeify.js +++ /dev/null @@ -1,59 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -var util = require("./util.js"); -var async = require("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -function spreadAdapter(val, nodeback) { - var promise = this; - if (!util.isArray(val)) return successAdapter.call(promise, val, nodeback); - var ret = - tryCatch(nodeback).apply(promise._boundValue(), [null].concat(val)); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -function successAdapter(val, nodeback) { - var promise = this; - var receiver = promise._boundValue(); - var ret = val === undefined - ? tryCatch(nodeback).call(receiver, null) - : tryCatch(nodeback).call(receiver, null, val); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} -function errorAdapter(reason, nodeback) { - var promise = this; - if (!reason) { - var target = promise._target(); - var newReason = target._getCarriedStackTrace(); - newReason.cause = reason; - reason = newReason; - } - var ret = tryCatch(nodeback).call(promise._boundValue(), reason); - if (ret === errorObj) { - async.throwLater(ret.e); - } -} - -Promise.prototype.asCallback = -Promise.prototype.nodeify = function (nodeback, options) { - if (typeof nodeback == "function") { - var adapter = successAdapter; - if (options !== undefined && Object(options).spread) { - adapter = spreadAdapter; - } - this._then( - adapter, - errorAdapter, - undefined, - this, - nodeback - ); - } - return this; -}; -}; diff --git a/src/node_modules/bluebird/js/main/progress.js b/src/node_modules/bluebird/js/main/progress.js deleted file mode 100644 index 2e3e95e..0000000 --- a/src/node_modules/bluebird/js/main/progress.js +++ /dev/null @@ -1,76 +0,0 @@ -"use strict"; -module.exports = function(Promise, PromiseArray) { -var util = require("./util.js"); -var async = require("./async.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; - -Promise.prototype.progressed = function (handler) { - return this._then(undefined, undefined, handler, undefined, undefined); -}; - -Promise.prototype._progress = function (progressValue) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._target()._progressUnchecked(progressValue); - -}; - -Promise.prototype._progressHandlerAt = function (index) { - return index === 0 - ? this._progressHandler0 - : this[(index << 2) + index - 5 + 2]; -}; - -Promise.prototype._doProgressWith = function (progression) { - var progressValue = progression.value; - var handler = progression.handler; - var promise = progression.promise; - var receiver = progression.receiver; - - var ret = tryCatch(handler).call(receiver, progressValue); - if (ret === errorObj) { - if (ret.e != null && - ret.e.name !== "StopProgressPropagation") { - var trace = util.canAttachTrace(ret.e) - ? ret.e : new Error(util.toString(ret.e)); - promise._attachExtraTrace(trace); - promise._progress(ret.e); - } - } else if (ret instanceof Promise) { - ret._then(promise._progress, null, null, promise, undefined); - } else { - promise._progress(ret); - } -}; - - -Promise.prototype._progressUnchecked = function (progressValue) { - var len = this._length(); - var progress = this._progress; - for (var i = 0; i < len; i++) { - var handler = this._progressHandlerAt(i); - var promise = this._promiseAt(i); - if (!(promise instanceof Promise)) { - var receiver = this._receiverAt(i); - if (typeof handler === "function") { - handler.call(receiver, progressValue, promise); - } else if (receiver instanceof PromiseArray && - !receiver._isResolved()) { - receiver._promiseProgressed(progressValue, promise); - } - continue; - } - - if (typeof handler === "function") { - async.invoke(this._doProgressWith, this, { - handler: handler, - promise: promise, - receiver: this._receiverAt(i), - value: progressValue - }); - } else { - async.invoke(progress, promise, progressValue); - } - } -}; -}; diff --git a/src/node_modules/bluebird/js/main/promise.js b/src/node_modules/bluebird/js/main/promise.js deleted file mode 100644 index 96bd545..0000000 --- a/src/node_modules/bluebird/js/main/promise.js +++ /dev/null @@ -1,754 +0,0 @@ -"use strict"; -module.exports = function() { -var makeSelfResolutionError = function () { - return new TypeError("circular promise resolution chain\u000a\u000a See http://goo.gl/LhFpo0\u000a"); -}; -var reflect = function() { - return new Promise.PromiseInspection(this._target()); -}; -var apiRejection = function(msg) { - return Promise.reject(new TypeError(msg)); -}; - -var util = require("./util.js"); - -var getDomain; -if (util.isNode) { - getDomain = function() { - var ret = process.domain; - if (ret === undefined) ret = null; - return ret; - }; -} else { - getDomain = function() { - return null; - }; -} -util.notEnumerableProp(Promise, "_getDomain", getDomain); - -var UNDEFINED_BINDING = {}; -var async = require("./async.js"); -var errors = require("./errors.js"); -var TypeError = Promise.TypeError = errors.TypeError; -Promise.RangeError = errors.RangeError; -Promise.CancellationError = errors.CancellationError; -Promise.TimeoutError = errors.TimeoutError; -Promise.OperationalError = errors.OperationalError; -Promise.RejectionError = errors.OperationalError; -Promise.AggregateError = errors.AggregateError; -var INTERNAL = function(){}; -var APPLY = {}; -var NEXT_FILTER = {e: null}; -var tryConvertToPromise = require("./thenables.js")(Promise, INTERNAL); -var PromiseArray = - require("./promise_array.js")(Promise, INTERNAL, - tryConvertToPromise, apiRejection); -var CapturedTrace = require("./captured_trace.js")(); -var isDebugging = require("./debuggability.js")(Promise, CapturedTrace); - /*jshint unused:false*/ -var createContext = - require("./context.js")(Promise, CapturedTrace, isDebugging); -var CatchFilter = require("./catch_filter.js")(NEXT_FILTER); -var PromiseResolver = require("./promise_resolver.js"); -var nodebackForPromise = PromiseResolver._nodebackForPromise; -var errorObj = util.errorObj; -var tryCatch = util.tryCatch; -function Promise(resolver) { - if (typeof resolver !== "function") { - throw new TypeError("the promise constructor requires a resolver function\u000a\u000a See http://goo.gl/EC22Yn\u000a"); - } - if (this.constructor !== Promise) { - throw new TypeError("the promise constructor cannot be invoked directly\u000a\u000a See http://goo.gl/KsIlge\u000a"); - } - this._bitField = 0; - this._fulfillmentHandler0 = undefined; - this._rejectionHandler0 = undefined; - this._progressHandler0 = undefined; - this._promise0 = undefined; - this._receiver0 = undefined; - this._settledValue = undefined; - if (resolver !== INTERNAL) this._resolveFromResolver(resolver); -} - -Promise.prototype.toString = function () { - return "[object Promise]"; -}; - -Promise.prototype.caught = Promise.prototype["catch"] = function (fn) { - var len = arguments.length; - if (len > 1) { - var catchInstances = new Array(len - 1), - j = 0, i; - for (i = 0; i < len - 1; ++i) { - var item = arguments[i]; - if (typeof item === "function") { - catchInstances[j++] = item; - } else { - return Promise.reject( - new TypeError("Catch filter must inherit from Error or be a simple predicate function\u000a\u000a See http://goo.gl/o84o68\u000a")); - } - } - catchInstances.length = j; - fn = arguments[i]; - var catchFilter = new CatchFilter(catchInstances, fn, this); - return this._then(undefined, catchFilter.doFilter, undefined, - catchFilter, undefined); - } - return this._then(undefined, fn, undefined, undefined, undefined); -}; - -Promise.prototype.reflect = function () { - return this._then(reflect, reflect, undefined, this, undefined); -}; - -Promise.prototype.then = function (didFulfill, didReject, didProgress) { - if (isDebugging() && arguments.length > 0 && - typeof didFulfill !== "function" && - typeof didReject !== "function") { - var msg = ".then() only accepts functions but was passed: " + - util.classString(didFulfill); - if (arguments.length > 1) { - msg += ", " + util.classString(didReject); - } - this._warn(msg); - } - return this._then(didFulfill, didReject, didProgress, - undefined, undefined); -}; - -Promise.prototype.done = function (didFulfill, didReject, didProgress) { - var promise = this._then(didFulfill, didReject, didProgress, - undefined, undefined); - promise._setIsFinal(); -}; - -Promise.prototype.spread = function (didFulfill, didReject) { - return this.all()._then(didFulfill, didReject, undefined, APPLY, undefined); -}; - -Promise.prototype.isCancellable = function () { - return !this.isResolved() && - this._cancellable(); -}; - -Promise.prototype.toJSON = function () { - var ret = { - isFulfilled: false, - isRejected: false, - fulfillmentValue: undefined, - rejectionReason: undefined - }; - if (this.isFulfilled()) { - ret.fulfillmentValue = this.value(); - ret.isFulfilled = true; - } else if (this.isRejected()) { - ret.rejectionReason = this.reason(); - ret.isRejected = true; - } - return ret; -}; - -Promise.prototype.all = function () { - return new PromiseArray(this).promise(); -}; - -Promise.prototype.error = function (fn) { - return this.caught(util.originatesFromRejection, fn); -}; - -Promise.is = function (val) { - return val instanceof Promise; -}; - -Promise.fromNode = function(fn) { - var ret = new Promise(INTERNAL); - var result = tryCatch(fn)(nodebackForPromise(ret)); - if (result === errorObj) { - ret._rejectCallback(result.e, true, true); - } - return ret; -}; - -Promise.all = function (promises) { - return new PromiseArray(promises).promise(); -}; - -Promise.defer = Promise.pending = function () { - var promise = new Promise(INTERNAL); - return new PromiseResolver(promise); -}; - -Promise.cast = function (obj) { - var ret = tryConvertToPromise(obj); - if (!(ret instanceof Promise)) { - var val = ret; - ret = new Promise(INTERNAL); - ret._fulfillUnchecked(val); - } - return ret; -}; - -Promise.resolve = Promise.fulfilled = Promise.cast; - -Promise.reject = Promise.rejected = function (reason) { - var ret = new Promise(INTERNAL); - ret._captureStackTrace(); - ret._rejectCallback(reason, true); - return ret; -}; - -Promise.setScheduler = function(fn) { - if (typeof fn !== "function") throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - var prev = async._schedule; - async._schedule = fn; - return prev; -}; - -Promise.prototype._then = function ( - didFulfill, - didReject, - didProgress, - receiver, - internalData -) { - var haveInternalData = internalData !== undefined; - var ret = haveInternalData ? internalData : new Promise(INTERNAL); - - if (!haveInternalData) { - ret._propagateFrom(this, 4 | 1); - ret._captureStackTrace(); - } - - var target = this._target(); - if (target !== this) { - if (receiver === undefined) receiver = this._boundTo; - if (!haveInternalData) ret._setIsMigrated(); - } - - var callbackIndex = target._addCallbacks(didFulfill, - didReject, - didProgress, - ret, - receiver, - getDomain()); - - if (target._isResolved() && !target._isSettlePromisesQueued()) { - async.invoke( - target._settlePromiseAtPostResolution, target, callbackIndex); - } - - return ret; -}; - -Promise.prototype._settlePromiseAtPostResolution = function (index) { - if (this._isRejectionUnhandled()) this._unsetRejectionIsUnhandled(); - this._settlePromiseAt(index); -}; - -Promise.prototype._length = function () { - return this._bitField & 131071; -}; - -Promise.prototype._isFollowingOrFulfilledOrRejected = function () { - return (this._bitField & 939524096) > 0; -}; - -Promise.prototype._isFollowing = function () { - return (this._bitField & 536870912) === 536870912; -}; - -Promise.prototype._setLength = function (len) { - this._bitField = (this._bitField & -131072) | - (len & 131071); -}; - -Promise.prototype._setFulfilled = function () { - this._bitField = this._bitField | 268435456; -}; - -Promise.prototype._setRejected = function () { - this._bitField = this._bitField | 134217728; -}; - -Promise.prototype._setFollowing = function () { - this._bitField = this._bitField | 536870912; -}; - -Promise.prototype._setIsFinal = function () { - this._bitField = this._bitField | 33554432; -}; - -Promise.prototype._isFinal = function () { - return (this._bitField & 33554432) > 0; -}; - -Promise.prototype._cancellable = function () { - return (this._bitField & 67108864) > 0; -}; - -Promise.prototype._setCancellable = function () { - this._bitField = this._bitField | 67108864; -}; - -Promise.prototype._unsetCancellable = function () { - this._bitField = this._bitField & (~67108864); -}; - -Promise.prototype._setIsMigrated = function () { - this._bitField = this._bitField | 4194304; -}; - -Promise.prototype._unsetIsMigrated = function () { - this._bitField = this._bitField & (~4194304); -}; - -Promise.prototype._isMigrated = function () { - return (this._bitField & 4194304) > 0; -}; - -Promise.prototype._receiverAt = function (index) { - var ret = index === 0 - ? this._receiver0 - : this[ - index * 5 - 5 + 4]; - if (ret === UNDEFINED_BINDING) { - return undefined; - } else if (ret === undefined && this._isBound()) { - return this._boundValue(); - } - return ret; -}; - -Promise.prototype._promiseAt = function (index) { - return index === 0 - ? this._promise0 - : this[index * 5 - 5 + 3]; -}; - -Promise.prototype._fulfillmentHandlerAt = function (index) { - return index === 0 - ? this._fulfillmentHandler0 - : this[index * 5 - 5 + 0]; -}; - -Promise.prototype._rejectionHandlerAt = function (index) { - return index === 0 - ? this._rejectionHandler0 - : this[index * 5 - 5 + 1]; -}; - -Promise.prototype._boundValue = function() { - var ret = this._boundTo; - if (ret !== undefined) { - if (ret instanceof Promise) { - if (ret.isFulfilled()) { - return ret.value(); - } else { - return undefined; - } - } - } - return ret; -}; - -Promise.prototype._migrateCallbacks = function (follower, index) { - var fulfill = follower._fulfillmentHandlerAt(index); - var reject = follower._rejectionHandlerAt(index); - var progress = follower._progressHandlerAt(index); - var promise = follower._promiseAt(index); - var receiver = follower._receiverAt(index); - if (promise instanceof Promise) promise._setIsMigrated(); - if (receiver === undefined) receiver = UNDEFINED_BINDING; - this._addCallbacks(fulfill, reject, progress, promise, receiver, null); -}; - -Promise.prototype._addCallbacks = function ( - fulfill, - reject, - progress, - promise, - receiver, - domain -) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - - if (index === 0) { - this._promise0 = promise; - if (receiver !== undefined) this._receiver0 = receiver; - if (typeof fulfill === "function" && !this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this._rejectionHandler0 = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this._progressHandler0 = - domain === null ? progress : domain.bind(progress); - } - } else { - var base = index * 5 - 5; - this[base + 3] = promise; - this[base + 4] = receiver; - if (typeof fulfill === "function") { - this[base + 0] = - domain === null ? fulfill : domain.bind(fulfill); - } - if (typeof reject === "function") { - this[base + 1] = - domain === null ? reject : domain.bind(reject); - } - if (typeof progress === "function") { - this[base + 2] = - domain === null ? progress : domain.bind(progress); - } - } - this._setLength(index + 1); - return index; -}; - -Promise.prototype._setProxyHandlers = function (receiver, promiseSlotValue) { - var index = this._length(); - - if (index >= 131071 - 5) { - index = 0; - this._setLength(0); - } - if (index === 0) { - this._promise0 = promiseSlotValue; - this._receiver0 = receiver; - } else { - var base = index * 5 - 5; - this[base + 3] = promiseSlotValue; - this[base + 4] = receiver; - } - this._setLength(index + 1); -}; - -Promise.prototype._proxyPromiseArray = function (promiseArray, index) { - this._setProxyHandlers(promiseArray, index); -}; - -Promise.prototype._resolveCallback = function(value, shouldBind) { - if (this._isFollowingOrFulfilledOrRejected()) return; - if (value === this) - return this._rejectCallback(makeSelfResolutionError(), false, true); - var maybePromise = tryConvertToPromise(value, this); - if (!(maybePromise instanceof Promise)) return this._fulfill(value); - - var propagationFlags = 1 | (shouldBind ? 4 : 0); - this._propagateFrom(maybePromise, propagationFlags); - var promise = maybePromise._target(); - if (promise._isPending()) { - var len = this._length(); - for (var i = 0; i < len; ++i) { - promise._migrateCallbacks(this, i); - } - this._setFollowing(); - this._setLength(0); - this._setFollowee(promise); - } else if (promise._isFulfilled()) { - this._fulfillUnchecked(promise._value()); - } else { - this._rejectUnchecked(promise._reason(), - promise._getCarriedStackTrace()); - } -}; - -Promise.prototype._rejectCallback = -function(reason, synchronous, shouldNotMarkOriginatingFromRejection) { - if (!shouldNotMarkOriginatingFromRejection) { - util.markAsOriginatingFromRejection(reason); - } - var trace = util.ensureErrorObject(reason); - var hasStack = trace === reason; - this._attachExtraTrace(trace, synchronous ? hasStack : false); - this._reject(reason, hasStack ? undefined : trace); -}; - -Promise.prototype._resolveFromResolver = function (resolver) { - var promise = this; - this._captureStackTrace(); - this._pushContext(); - var synchronous = true; - var r = tryCatch(resolver)(function(value) { - if (promise === null) return; - promise._resolveCallback(value); - promise = null; - }, function (reason) { - if (promise === null) return; - promise._rejectCallback(reason, synchronous); - promise = null; - }); - synchronous = false; - this._popContext(); - - if (r !== undefined && r === errorObj && promise !== null) { - promise._rejectCallback(r.e, true, true); - promise = null; - } -}; - -Promise.prototype._settlePromiseFromHandler = function ( - handler, receiver, value, promise -) { - if (promise._isRejected()) return; - promise._pushContext(); - var x; - if (receiver === APPLY && !this._isRejected()) { - x = tryCatch(handler).apply(this._boundValue(), value); - } else { - x = tryCatch(handler).call(receiver, value); - } - promise._popContext(); - - if (x === errorObj || x === promise || x === NEXT_FILTER) { - var err = x === promise ? makeSelfResolutionError() : x.e; - promise._rejectCallback(err, false, true); - } else { - promise._resolveCallback(x); - } -}; - -Promise.prototype._target = function() { - var ret = this; - while (ret._isFollowing()) ret = ret._followee(); - return ret; -}; - -Promise.prototype._followee = function() { - return this._rejectionHandler0; -}; - -Promise.prototype._setFollowee = function(promise) { - this._rejectionHandler0 = promise; -}; - -Promise.prototype._cleanValues = function () { - if (this._cancellable()) { - this._cancellationParent = undefined; - } -}; - -Promise.prototype._propagateFrom = function (parent, flags) { - if ((flags & 1) > 0 && parent._cancellable()) { - this._setCancellable(); - this._cancellationParent = parent; - } - if ((flags & 4) > 0 && parent._isBound()) { - this._setBoundTo(parent._boundTo); - } -}; - -Promise.prototype._fulfill = function (value) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._fulfillUnchecked(value); -}; - -Promise.prototype._reject = function (reason, carriedStackTrace) { - if (this._isFollowingOrFulfilledOrRejected()) return; - this._rejectUnchecked(reason, carriedStackTrace); -}; - -Promise.prototype._settlePromiseAt = function (index) { - var promise = this._promiseAt(index); - var isPromise = promise instanceof Promise; - - if (isPromise && promise._isMigrated()) { - promise._unsetIsMigrated(); - return async.invoke(this._settlePromiseAt, this, index); - } - var handler = this._isFulfilled() - ? this._fulfillmentHandlerAt(index) - : this._rejectionHandlerAt(index); - - var carriedStackTrace = - this._isCarryingStackTrace() ? this._getCarriedStackTrace() : undefined; - var value = this._settledValue; - var receiver = this._receiverAt(index); - this._clearCallbackDataAtIndex(index); - - if (typeof handler === "function") { - if (!isPromise) { - handler.call(receiver, value, promise); - } else { - this._settlePromiseFromHandler(handler, receiver, value, promise); - } - } else if (receiver instanceof PromiseArray) { - if (!receiver._isResolved()) { - if (this._isFulfilled()) { - receiver._promiseFulfilled(value, promise); - } - else { - receiver._promiseRejected(value, promise); - } - } - } else if (isPromise) { - if (this._isFulfilled()) { - promise._fulfill(value); - } else { - promise._reject(value, carriedStackTrace); - } - } - - if (index >= 4 && (index & 31) === 4) - async.invokeLater(this._setLength, this, 0); -}; - -Promise.prototype._clearCallbackDataAtIndex = function(index) { - if (index === 0) { - if (!this._isCarryingStackTrace()) { - this._fulfillmentHandler0 = undefined; - } - this._rejectionHandler0 = - this._progressHandler0 = - this._receiver0 = - this._promise0 = undefined; - } else { - var base = index * 5 - 5; - this[base + 3] = - this[base + 4] = - this[base + 0] = - this[base + 1] = - this[base + 2] = undefined; - } -}; - -Promise.prototype._isSettlePromisesQueued = function () { - return (this._bitField & - -1073741824) === -1073741824; -}; - -Promise.prototype._setSettlePromisesQueued = function () { - this._bitField = this._bitField | -1073741824; -}; - -Promise.prototype._unsetSettlePromisesQueued = function () { - this._bitField = this._bitField & (~-1073741824); -}; - -Promise.prototype._queueSettlePromises = function() { - async.settlePromises(this); - this._setSettlePromisesQueued(); -}; - -Promise.prototype._fulfillUnchecked = function (value) { - if (value === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err, undefined); - } - this._setFulfilled(); - this._settledValue = value; - this._cleanValues(); - - if (this._length() > 0) { - this._queueSettlePromises(); - } -}; - -Promise.prototype._rejectUncheckedCheckError = function (reason) { - var trace = util.ensureErrorObject(reason); - this._rejectUnchecked(reason, trace === reason ? undefined : trace); -}; - -Promise.prototype._rejectUnchecked = function (reason, trace) { - if (reason === this) { - var err = makeSelfResolutionError(); - this._attachExtraTrace(err); - return this._rejectUnchecked(err); - } - this._setRejected(); - this._settledValue = reason; - this._cleanValues(); - - if (this._isFinal()) { - async.throwLater(function(e) { - if ("stack" in e) { - async.invokeFirst( - CapturedTrace.unhandledRejection, undefined, e); - } - throw e; - }, trace === undefined ? reason : trace); - return; - } - - if (trace !== undefined && trace !== reason) { - this._setCarriedStackTrace(trace); - } - - if (this._length() > 0) { - this._queueSettlePromises(); - } else { - this._ensurePossibleRejectionHandled(); - } -}; - -Promise.prototype._settlePromises = function () { - this._unsetSettlePromisesQueued(); - var len = this._length(); - for (var i = 0; i < len; i++) { - this._settlePromiseAt(i); - } -}; - -util.notEnumerableProp(Promise, - "_makeSelfResolutionError", - makeSelfResolutionError); - -require("./progress.js")(Promise, PromiseArray); -require("./method.js")(Promise, INTERNAL, tryConvertToPromise, apiRejection); -require("./bind.js")(Promise, INTERNAL, tryConvertToPromise); -require("./finally.js")(Promise, NEXT_FILTER, tryConvertToPromise); -require("./direct_resolve.js")(Promise); -require("./synchronous_inspection.js")(Promise); -require("./join.js")(Promise, PromiseArray, tryConvertToPromise, INTERNAL); -Promise.Promise = Promise; -require('./map.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -require('./cancel.js')(Promise); -require('./using.js')(Promise, apiRejection, tryConvertToPromise, createContext); -require('./generators.js')(Promise, apiRejection, INTERNAL, tryConvertToPromise); -require('./nodeify.js')(Promise); -require('./call_get.js')(Promise); -require('./props.js')(Promise, PromiseArray, tryConvertToPromise, apiRejection); -require('./race.js')(Promise, INTERNAL, tryConvertToPromise, apiRejection); -require('./reduce.js')(Promise, PromiseArray, apiRejection, tryConvertToPromise, INTERNAL); -require('./settle.js')(Promise, PromiseArray); -require('./some.js')(Promise, PromiseArray, apiRejection); -require('./promisify.js')(Promise, INTERNAL); -require('./any.js')(Promise); -require('./each.js')(Promise, INTERNAL); -require('./timers.js')(Promise, INTERNAL); -require('./filter.js')(Promise, INTERNAL); - - util.toFastProperties(Promise); - util.toFastProperties(Promise.prototype); - function fillTypes(value) { - var p = new Promise(INTERNAL); - p._fulfillmentHandler0 = value; - p._rejectionHandler0 = value; - p._progressHandler0 = value; - p._promise0 = value; - p._receiver0 = value; - p._settledValue = value; - } - // Complete slack tracking, opt out of field-type tracking and - // stabilize map - fillTypes({a: 1}); - fillTypes({b: 2}); - fillTypes({c: 3}); - fillTypes(1); - fillTypes(function(){}); - fillTypes(undefined); - fillTypes(false); - fillTypes(new Promise(INTERNAL)); - CapturedTrace.setBounds(async.firstLineError, util.lastLineError); - return Promise; - -}; diff --git a/src/node_modules/bluebird/js/main/promise_array.js b/src/node_modules/bluebird/js/main/promise_array.js deleted file mode 100644 index b2e8f1c..0000000 --- a/src/node_modules/bluebird/js/main/promise_array.js +++ /dev/null @@ -1,142 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL, tryConvertToPromise, - apiRejection) { -var util = require("./util.js"); -var isArray = util.isArray; - -function toResolutionValue(val) { - switch(val) { - case -2: return []; - case -3: return {}; - } -} - -function PromiseArray(values) { - var promise = this._promise = new Promise(INTERNAL); - var parent; - if (values instanceof Promise) { - parent = values; - promise._propagateFrom(parent, 1 | 4); - } - this._values = values; - this._length = 0; - this._totalResolved = 0; - this._init(undefined, -2); -} -PromiseArray.prototype.length = function () { - return this._length; -}; - -PromiseArray.prototype.promise = function () { - return this._promise; -}; - -PromiseArray.prototype._init = function init(_, resolveValueIfEmpty) { - var values = tryConvertToPromise(this._values, this._promise); - if (values instanceof Promise) { - values = values._target(); - this._values = values; - if (values._isFulfilled()) { - values = values._value(); - if (!isArray(values)) { - var err = new Promise.TypeError("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - this.__hardReject__(err); - return; - } - } else if (values._isPending()) { - values._then( - init, - this._reject, - undefined, - this, - resolveValueIfEmpty - ); - return; - } else { - this._reject(values._reason()); - return; - } - } else if (!isArray(values)) { - this._promise._reject(apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a")._reason()); - return; - } - - if (values.length === 0) { - if (resolveValueIfEmpty === -5) { - this._resolveEmptyArray(); - } - else { - this._resolve(toResolutionValue(resolveValueIfEmpty)); - } - return; - } - var len = this.getActualLength(values.length); - this._length = len; - this._values = this.shouldCopyValues() ? new Array(len) : this._values; - var promise = this._promise; - for (var i = 0; i < len; ++i) { - var isResolved = this._isResolved(); - var maybePromise = tryConvertToPromise(values[i], promise); - if (maybePromise instanceof Promise) { - maybePromise = maybePromise._target(); - if (isResolved) { - maybePromise._ignoreRejections(); - } else if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, i); - } else if (maybePromise._isFulfilled()) { - this._promiseFulfilled(maybePromise._value(), i); - } else { - this._promiseRejected(maybePromise._reason(), i); - } - } else if (!isResolved) { - this._promiseFulfilled(maybePromise, i); - } - } -}; - -PromiseArray.prototype._isResolved = function () { - return this._values === null; -}; - -PromiseArray.prototype._resolve = function (value) { - this._values = null; - this._promise._fulfill(value); -}; - -PromiseArray.prototype.__hardReject__ = -PromiseArray.prototype._reject = function (reason) { - this._values = null; - this._promise._rejectCallback(reason, false, true); -}; - -PromiseArray.prototype._promiseProgressed = function (progressValue, index) { - this._promise._progress({ - index: index, - value: progressValue - }); -}; - - -PromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - this._resolve(this._values); - } -}; - -PromiseArray.prototype._promiseRejected = function (reason, index) { - this._totalResolved++; - this._reject(reason); -}; - -PromiseArray.prototype.shouldCopyValues = function () { - return true; -}; - -PromiseArray.prototype.getActualLength = function (len) { - return len; -}; - -return PromiseArray; -}; diff --git a/src/node_modules/bluebird/js/main/promise_resolver.js b/src/node_modules/bluebird/js/main/promise_resolver.js deleted file mode 100644 index b180a32..0000000 --- a/src/node_modules/bluebird/js/main/promise_resolver.js +++ /dev/null @@ -1,123 +0,0 @@ -"use strict"; -var util = require("./util.js"); -var maybeWrapAsError = util.maybeWrapAsError; -var errors = require("./errors.js"); -var TimeoutError = errors.TimeoutError; -var OperationalError = errors.OperationalError; -var haveGetters = util.haveGetters; -var es5 = require("./es5.js"); - -function isUntypedError(obj) { - return obj instanceof Error && - es5.getPrototypeOf(obj) === Error.prototype; -} - -var rErrorKey = /^(?:name|message|stack|cause)$/; -function wrapAsOperationalError(obj) { - var ret; - if (isUntypedError(obj)) { - ret = new OperationalError(obj); - ret.name = obj.name; - ret.message = obj.message; - ret.stack = obj.stack; - var keys = es5.keys(obj); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (!rErrorKey.test(key)) { - ret[key] = obj[key]; - } - } - return ret; - } - util.markAsOriginatingFromRejection(obj); - return obj; -} - -function nodebackForPromise(promise) { - return function(err, value) { - if (promise === null) return; - - if (err) { - var wrapped = wrapAsOperationalError(maybeWrapAsError(err)); - promise._attachExtraTrace(wrapped); - promise._reject(wrapped); - } else if (arguments.length > 2) { - var $_len = arguments.length;var args = new Array($_len - 1); for(var $_i = 1; $_i < $_len; ++$_i) {args[$_i - 1] = arguments[$_i];} - promise._fulfill(args); - } else { - promise._fulfill(value); - } - - promise = null; - }; -} - - -var PromiseResolver; -if (!haveGetters) { - PromiseResolver = function (promise) { - this.promise = promise; - this.asCallback = nodebackForPromise(promise); - this.callback = this.asCallback; - }; -} -else { - PromiseResolver = function (promise) { - this.promise = promise; - }; -} -if (haveGetters) { - var prop = { - get: function() { - return nodebackForPromise(this.promise); - } - }; - es5.defineProperty(PromiseResolver.prototype, "asCallback", prop); - es5.defineProperty(PromiseResolver.prototype, "callback", prop); -} - -PromiseResolver._nodebackForPromise = nodebackForPromise; - -PromiseResolver.prototype.toString = function () { - return "[object PromiseResolver]"; -}; - -PromiseResolver.prototype.resolve = -PromiseResolver.prototype.fulfill = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._resolveCallback(value); -}; - -PromiseResolver.prototype.reject = function (reason) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._rejectCallback(reason); -}; - -PromiseResolver.prototype.progress = function (value) { - if (!(this instanceof PromiseResolver)) { - throw new TypeError("Illegal invocation, resolver resolve/reject must be called within a resolver context. Consider using the promise constructor instead.\u000a\u000a See http://goo.gl/sdkXL9\u000a"); - } - this.promise._progress(value); -}; - -PromiseResolver.prototype.cancel = function (err) { - this.promise.cancel(err); -}; - -PromiseResolver.prototype.timeout = function () { - this.reject(new TimeoutError("timeout")); -}; - -PromiseResolver.prototype.isResolved = function () { - return this.promise.isResolved(); -}; - -PromiseResolver.prototype.toJSON = function () { - return this.promise.toJSON(); -}; - -module.exports = PromiseResolver; diff --git a/src/node_modules/bluebird/js/main/promisify.js b/src/node_modules/bluebird/js/main/promisify.js deleted file mode 100644 index 86763d6..0000000 --- a/src/node_modules/bluebird/js/main/promisify.js +++ /dev/null @@ -1,307 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var THIS = {}; -var util = require("./util.js"); -var nodebackForPromise = require("./promise_resolver.js") - ._nodebackForPromise; -var withAppended = util.withAppended; -var maybeWrapAsError = util.maybeWrapAsError; -var canEvaluate = util.canEvaluate; -var TypeError = require("./errors").TypeError; -var defaultSuffix = "Async"; -var defaultPromisified = {__isPromisified__: true}; -var noCopyProps = [ - "arity", "length", - "name", - "arguments", - "caller", - "callee", - "prototype", - "__isPromisified__" -]; -var noCopyPropsPattern = new RegExp("^(?:" + noCopyProps.join("|") + ")$"); - -var defaultFilter = function(name) { - return util.isIdentifier(name) && - name.charAt(0) !== "_" && - name !== "constructor"; -}; - -function propsFilter(key) { - return !noCopyPropsPattern.test(key); -} - -function isPromisified(fn) { - try { - return fn.__isPromisified__ === true; - } - catch (e) { - return false; - } -} - -function hasPromisified(obj, key, suffix) { - var val = util.getDataPropertyOrDefault(obj, key + suffix, - defaultPromisified); - return val ? isPromisified(val) : false; -} -function checkValid(ret, suffix, suffixRegexp) { - for (var i = 0; i < ret.length; i += 2) { - var key = ret[i]; - if (suffixRegexp.test(key)) { - var keyWithoutAsyncSuffix = key.replace(suffixRegexp, ""); - for (var j = 0; j < ret.length; j += 2) { - if (ret[j] === keyWithoutAsyncSuffix) { - throw new TypeError("Cannot promisify an API that has normal methods with '%s'-suffix\u000a\u000a See http://goo.gl/iWrZbw\u000a" - .replace("%s", suffix)); - } - } - } - } -} - -function promisifiableMethods(obj, suffix, suffixRegexp, filter) { - var keys = util.inheritedDataKeys(obj); - var ret = []; - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - var value = obj[key]; - var passesDefaultFilter = filter === defaultFilter - ? true : defaultFilter(key, value, obj); - if (typeof value === "function" && - !isPromisified(value) && - !hasPromisified(obj, key, suffix) && - filter(key, value, obj, passesDefaultFilter)) { - ret.push(key, value); - } - } - checkValid(ret, suffix, suffixRegexp); - return ret; -} - -var escapeIdentRegex = function(str) { - return str.replace(/([$])/, "\\$"); -}; - -var makeNodePromisifiedEval; -if (!false) { -var switchCaseArgumentOrder = function(likelyArgumentCount) { - var ret = [likelyArgumentCount]; - var min = Math.max(0, likelyArgumentCount - 1 - 3); - for(var i = likelyArgumentCount - 1; i >= min; --i) { - ret.push(i); - } - for(var i = likelyArgumentCount + 1; i <= 3; ++i) { - ret.push(i); - } - return ret; -}; - -var argumentSequence = function(argumentCount) { - return util.filledRange(argumentCount, "_arg", ""); -}; - -var parameterDeclaration = function(parameterCount) { - return util.filledRange( - Math.max(parameterCount, 3), "_arg", ""); -}; - -var parameterCount = function(fn) { - if (typeof fn.length === "number") { - return Math.max(Math.min(fn.length, 1023 + 1), 0); - } - return 0; -}; - -makeNodePromisifiedEval = -function(callback, receiver, originalName, fn) { - var newParameterCount = Math.max(0, parameterCount(fn) - 1); - var argumentOrder = switchCaseArgumentOrder(newParameterCount); - var shouldProxyThis = typeof callback === "string" || receiver === THIS; - - function generateCallForArgumentCount(count) { - var args = argumentSequence(count).join(", "); - var comma = count > 0 ? ", " : ""; - var ret; - if (shouldProxyThis) { - ret = "ret = callback.call(this, {{args}}, nodeback); break;\n"; - } else { - ret = receiver === undefined - ? "ret = callback({{args}}, nodeback); break;\n" - : "ret = callback.call(receiver, {{args}}, nodeback); break;\n"; - } - return ret.replace("{{args}}", args).replace(", ", comma); - } - - function generateArgumentSwitchCase() { - var ret = ""; - for (var i = 0; i < argumentOrder.length; ++i) { - ret += "case " + argumentOrder[i] +":" + - generateCallForArgumentCount(argumentOrder[i]); - } - - ret += " \n\ - default: \n\ - var args = new Array(len + 1); \n\ - var i = 0; \n\ - for (var i = 0; i < len; ++i) { \n\ - args[i] = arguments[i]; \n\ - } \n\ - args[i] = nodeback; \n\ - [CodeForCall] \n\ - break; \n\ - ".replace("[CodeForCall]", (shouldProxyThis - ? "ret = callback.apply(this, args);\n" - : "ret = callback.apply(receiver, args);\n")); - return ret; - } - - var getFunctionCode = typeof callback === "string" - ? ("this != null ? this['"+callback+"'] : fn") - : "fn"; - - return new Function("Promise", - "fn", - "receiver", - "withAppended", - "maybeWrapAsError", - "nodebackForPromise", - "tryCatch", - "errorObj", - "notEnumerableProp", - "INTERNAL","'use strict'; \n\ - var ret = function (Parameters) { \n\ - 'use strict'; \n\ - var len = arguments.length; \n\ - var promise = new Promise(INTERNAL); \n\ - promise._captureStackTrace(); \n\ - var nodeback = nodebackForPromise(promise); \n\ - var ret; \n\ - var callback = tryCatch([GetFunctionCode]); \n\ - switch(len) { \n\ - [CodeForSwitchCase] \n\ - } \n\ - if (ret === errorObj) { \n\ - promise._rejectCallback(maybeWrapAsError(ret.e), true, true);\n\ - } \n\ - return promise; \n\ - }; \n\ - notEnumerableProp(ret, '__isPromisified__', true); \n\ - return ret; \n\ - " - .replace("Parameters", parameterDeclaration(newParameterCount)) - .replace("[CodeForSwitchCase]", generateArgumentSwitchCase()) - .replace("[GetFunctionCode]", getFunctionCode))( - Promise, - fn, - receiver, - withAppended, - maybeWrapAsError, - nodebackForPromise, - util.tryCatch, - util.errorObj, - util.notEnumerableProp, - INTERNAL - ); -}; -} - -function makeNodePromisifiedClosure(callback, receiver, _, fn) { - var defaultThis = (function() {return this;})(); - var method = callback; - if (typeof method === "string") { - callback = fn; - } - function promisified() { - var _receiver = receiver; - if (receiver === THIS) _receiver = this; - var promise = new Promise(INTERNAL); - promise._captureStackTrace(); - var cb = typeof method === "string" && this !== defaultThis - ? this[method] : callback; - var fn = nodebackForPromise(promise); - try { - cb.apply(_receiver, withAppended(arguments, fn)); - } catch(e) { - promise._rejectCallback(maybeWrapAsError(e), true, true); - } - return promise; - } - util.notEnumerableProp(promisified, "__isPromisified__", true); - return promisified; -} - -var makeNodePromisified = canEvaluate - ? makeNodePromisifiedEval - : makeNodePromisifiedClosure; - -function promisifyAll(obj, suffix, filter, promisifier) { - var suffixRegexp = new RegExp(escapeIdentRegex(suffix) + "$"); - var methods = - promisifiableMethods(obj, suffix, suffixRegexp, filter); - - for (var i = 0, len = methods.length; i < len; i+= 2) { - var key = methods[i]; - var fn = methods[i+1]; - var promisifiedKey = key + suffix; - if (promisifier === makeNodePromisified) { - obj[promisifiedKey] = - makeNodePromisified(key, THIS, key, fn, suffix); - } else { - var promisified = promisifier(fn, function() { - return makeNodePromisified(key, THIS, key, fn, suffix); - }); - util.notEnumerableProp(promisified, "__isPromisified__", true); - obj[promisifiedKey] = promisified; - } - } - util.toFastProperties(obj); - return obj; -} - -function promisify(callback, receiver) { - return makeNodePromisified(callback, receiver, undefined, callback); -} - -Promise.promisify = function (fn, receiver) { - if (typeof fn !== "function") { - throw new TypeError("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - } - if (isPromisified(fn)) { - return fn; - } - var ret = promisify(fn, arguments.length < 2 ? THIS : receiver); - util.copyDescriptors(fn, ret, propsFilter); - return ret; -}; - -Promise.promisifyAll = function (target, options) { - if (typeof target !== "function" && typeof target !== "object") { - throw new TypeError("the target of promisifyAll must be an object or a function\u000a\u000a See http://goo.gl/9ITlV0\u000a"); - } - options = Object(options); - var suffix = options.suffix; - if (typeof suffix !== "string") suffix = defaultSuffix; - var filter = options.filter; - if (typeof filter !== "function") filter = defaultFilter; - var promisifier = options.promisifier; - if (typeof promisifier !== "function") promisifier = makeNodePromisified; - - if (!util.isIdentifier(suffix)) { - throw new RangeError("suffix must be a valid identifier\u000a\u000a See http://goo.gl/8FZo5V\u000a"); - } - - var keys = util.inheritedDataKeys(target); - for (var i = 0; i < keys.length; ++i) { - var value = target[keys[i]]; - if (keys[i] !== "constructor" && - util.isClass(value)) { - promisifyAll(value.prototype, suffix, filter, promisifier); - promisifyAll(value, suffix, filter, promisifier); - } - } - - return promisifyAll(target, suffix, filter, promisifier); -}; -}; - diff --git a/src/node_modules/bluebird/js/main/props.js b/src/node_modules/bluebird/js/main/props.js deleted file mode 100644 index d6f9e64..0000000 --- a/src/node_modules/bluebird/js/main/props.js +++ /dev/null @@ -1,79 +0,0 @@ -"use strict"; -module.exports = function( - Promise, PromiseArray, tryConvertToPromise, apiRejection) { -var util = require("./util.js"); -var isObject = util.isObject; -var es5 = require("./es5.js"); - -function PropertiesPromiseArray(obj) { - var keys = es5.keys(obj); - var len = keys.length; - var values = new Array(len * 2); - for (var i = 0; i < len; ++i) { - var key = keys[i]; - values[i] = obj[key]; - values[i + len] = key; - } - this.constructor$(values); -} -util.inherits(PropertiesPromiseArray, PromiseArray); - -PropertiesPromiseArray.prototype._init = function () { - this._init$(undefined, -3) ; -}; - -PropertiesPromiseArray.prototype._promiseFulfilled = function (value, index) { - this._values[index] = value; - var totalResolved = ++this._totalResolved; - if (totalResolved >= this._length) { - var val = {}; - var keyOffset = this.length(); - for (var i = 0, len = this.length(); i < len; ++i) { - val[this._values[i + keyOffset]] = this._values[i]; - } - this._resolve(val); - } -}; - -PropertiesPromiseArray.prototype._promiseProgressed = function (value, index) { - this._promise._progress({ - key: this._values[index + this.length()], - value: value - }); -}; - -PropertiesPromiseArray.prototype.shouldCopyValues = function () { - return false; -}; - -PropertiesPromiseArray.prototype.getActualLength = function (len) { - return len >> 1; -}; - -function props(promises) { - var ret; - var castValue = tryConvertToPromise(promises); - - if (!isObject(castValue)) { - return apiRejection("cannot await properties of a non-object\u000a\u000a See http://goo.gl/OsFKC8\u000a"); - } else if (castValue instanceof Promise) { - ret = castValue._then( - Promise.props, undefined, undefined, undefined, undefined); - } else { - ret = new PropertiesPromiseArray(castValue).promise(); - } - - if (castValue instanceof Promise) { - ret._propagateFrom(castValue, 4); - } - return ret; -} - -Promise.prototype.props = function () { - return props(this); -}; - -Promise.props = function (promises) { - return props(promises); -}; -}; diff --git a/src/node_modules/bluebird/js/main/queue.js b/src/node_modules/bluebird/js/main/queue.js deleted file mode 100644 index 84d57d5..0000000 --- a/src/node_modules/bluebird/js/main/queue.js +++ /dev/null @@ -1,90 +0,0 @@ -"use strict"; -function arrayMove(src, srcIndex, dst, dstIndex, len) { - for (var j = 0; j < len; ++j) { - dst[j + dstIndex] = src[j + srcIndex]; - src[j + srcIndex] = void 0; - } -} - -function Queue(capacity) { - this._capacity = capacity; - this._length = 0; - this._front = 0; -} - -Queue.prototype._willBeOverCapacity = function (size) { - return this._capacity < size; -}; - -Queue.prototype._pushOne = function (arg) { - var length = this.length(); - this._checkCapacity(length + 1); - var i = (this._front + length) & (this._capacity - 1); - this[i] = arg; - this._length = length + 1; -}; - -Queue.prototype._unshiftOne = function(value) { - var capacity = this._capacity; - this._checkCapacity(this.length() + 1); - var front = this._front; - var i = (((( front - 1 ) & - ( capacity - 1) ) ^ capacity ) - capacity ); - this[i] = value; - this._front = i; - this._length = this.length() + 1; -}; - -Queue.prototype.unshift = function(fn, receiver, arg) { - this._unshiftOne(arg); - this._unshiftOne(receiver); - this._unshiftOne(fn); -}; - -Queue.prototype.push = function (fn, receiver, arg) { - var length = this.length() + 3; - if (this._willBeOverCapacity(length)) { - this._pushOne(fn); - this._pushOne(receiver); - this._pushOne(arg); - return; - } - var j = this._front + length - 3; - this._checkCapacity(length); - var wrapMask = this._capacity - 1; - this[(j + 0) & wrapMask] = fn; - this[(j + 1) & wrapMask] = receiver; - this[(j + 2) & wrapMask] = arg; - this._length = length; -}; - -Queue.prototype.shift = function () { - var front = this._front, - ret = this[front]; - - this[front] = undefined; - this._front = (front + 1) & (this._capacity - 1); - this._length--; - return ret; -}; - -Queue.prototype.length = function () { - return this._length; -}; - -Queue.prototype._checkCapacity = function (size) { - if (this._capacity < size) { - this._resizeTo(this._capacity << 1); - } -}; - -Queue.prototype._resizeTo = function (capacity) { - var oldCapacity = this._capacity; - this._capacity = capacity; - var front = this._front; - var length = this._length; - var moveItemsCount = (front + length) & (oldCapacity - 1); - arrayMove(this, 0, this, oldCapacity, moveItemsCount); -}; - -module.exports = Queue; diff --git a/src/node_modules/bluebird/js/main/race.js b/src/node_modules/bluebird/js/main/race.js deleted file mode 100644 index 30e7bb0..0000000 --- a/src/node_modules/bluebird/js/main/race.js +++ /dev/null @@ -1,47 +0,0 @@ -"use strict"; -module.exports = function( - Promise, INTERNAL, tryConvertToPromise, apiRejection) { -var isArray = require("./util.js").isArray; - -var raceLater = function (promise) { - return promise.then(function(array) { - return race(array, promise); - }); -}; - -function race(promises, parent) { - var maybePromise = tryConvertToPromise(promises); - - if (maybePromise instanceof Promise) { - return raceLater(maybePromise); - } else if (!isArray(promises)) { - return apiRejection("expecting an array, a promise or a thenable\u000a\u000a See http://goo.gl/s8MMhc\u000a"); - } - - var ret = new Promise(INTERNAL); - if (parent !== undefined) { - ret._propagateFrom(parent, 4 | 1); - } - var fulfill = ret._fulfill; - var reject = ret._reject; - for (var i = 0, len = promises.length; i < len; ++i) { - var val = promises[i]; - - if (val === undefined && !(i in promises)) { - continue; - } - - Promise.cast(val)._then(fulfill, reject, undefined, ret, null); - } - return ret; -} - -Promise.race = function (promises) { - return race(promises, undefined); -}; - -Promise.prototype.race = function () { - return race(this, undefined); -}; - -}; diff --git a/src/node_modules/bluebird/js/main/reduce.js b/src/node_modules/bluebird/js/main/reduce.js deleted file mode 100644 index 1f92daf..0000000 --- a/src/node_modules/bluebird/js/main/reduce.js +++ /dev/null @@ -1,148 +0,0 @@ -"use strict"; -module.exports = function(Promise, - PromiseArray, - apiRejection, - tryConvertToPromise, - INTERNAL) { -var getDomain = Promise._getDomain; -var async = require("./async.js"); -var util = require("./util.js"); -var tryCatch = util.tryCatch; -var errorObj = util.errorObj; -function ReductionPromiseArray(promises, fn, accum, _each) { - this.constructor$(promises); - this._promise._captureStackTrace(); - this._preservedValues = _each === INTERNAL ? [] : null; - this._zerothIsAccum = (accum === undefined); - this._gotAccum = false; - this._reducingIndex = (this._zerothIsAccum ? 1 : 0); - this._valuesPhase = undefined; - var maybePromise = tryConvertToPromise(accum, this._promise); - var rejected = false; - var isPromise = maybePromise instanceof Promise; - if (isPromise) { - maybePromise = maybePromise._target(); - if (maybePromise._isPending()) { - maybePromise._proxyPromiseArray(this, -1); - } else if (maybePromise._isFulfilled()) { - accum = maybePromise._value(); - this._gotAccum = true; - } else { - this._reject(maybePromise._reason()); - rejected = true; - } - } - if (!(isPromise || this._zerothIsAccum)) this._gotAccum = true; - var domain = getDomain(); - this._callback = domain === null ? fn : domain.bind(fn); - this._accum = accum; - if (!rejected) async.invoke(init, this, undefined); -} -function init() { - this._init$(undefined, -5); -} -util.inherits(ReductionPromiseArray, PromiseArray); - -ReductionPromiseArray.prototype._init = function () {}; - -ReductionPromiseArray.prototype._resolveEmptyArray = function () { - if (this._gotAccum || this._zerothIsAccum) { - this._resolve(this._preservedValues !== null - ? [] : this._accum); - } -}; - -ReductionPromiseArray.prototype._promiseFulfilled = function (value, index) { - var values = this._values; - values[index] = value; - var length = this.length(); - var preservedValues = this._preservedValues; - var isEach = preservedValues !== null; - var gotAccum = this._gotAccum; - var valuesPhase = this._valuesPhase; - var valuesPhaseIndex; - if (!valuesPhase) { - valuesPhase = this._valuesPhase = new Array(length); - for (valuesPhaseIndex=0; valuesPhaseIndex= this._length) { - this._resolve(this._values); - } -}; - -SettledPromiseArray.prototype._promiseFulfilled = function (value, index) { - var ret = new PromiseInspection(); - ret._bitField = 268435456; - ret._settledValue = value; - this._promiseResolved(index, ret); -}; -SettledPromiseArray.prototype._promiseRejected = function (reason, index) { - var ret = new PromiseInspection(); - ret._bitField = 134217728; - ret._settledValue = reason; - this._promiseResolved(index, ret); -}; - -Promise.settle = function (promises) { - return new SettledPromiseArray(promises).promise(); -}; - -Promise.prototype.settle = function () { - return new SettledPromiseArray(this).promise(); -}; -}; diff --git a/src/node_modules/bluebird/js/main/some.js b/src/node_modules/bluebird/js/main/some.js deleted file mode 100644 index f3968cf..0000000 --- a/src/node_modules/bluebird/js/main/some.js +++ /dev/null @@ -1,125 +0,0 @@ -"use strict"; -module.exports = -function(Promise, PromiseArray, apiRejection) { -var util = require("./util.js"); -var RangeError = require("./errors.js").RangeError; -var AggregateError = require("./errors.js").AggregateError; -var isArray = util.isArray; - - -function SomePromiseArray(values) { - this.constructor$(values); - this._howMany = 0; - this._unwrap = false; - this._initialized = false; -} -util.inherits(SomePromiseArray, PromiseArray); - -SomePromiseArray.prototype._init = function () { - if (!this._initialized) { - return; - } - if (this._howMany === 0) { - this._resolve([]); - return; - } - this._init$(undefined, -5); - var isArrayResolved = isArray(this._values); - if (!this._isResolved() && - isArrayResolved && - this._howMany > this._canPossiblyFulfill()) { - this._reject(this._getRangeError(this.length())); - } -}; - -SomePromiseArray.prototype.init = function () { - this._initialized = true; - this._init(); -}; - -SomePromiseArray.prototype.setUnwrap = function () { - this._unwrap = true; -}; - -SomePromiseArray.prototype.howMany = function () { - return this._howMany; -}; - -SomePromiseArray.prototype.setHowMany = function (count) { - this._howMany = count; -}; - -SomePromiseArray.prototype._promiseFulfilled = function (value) { - this._addFulfilled(value); - if (this._fulfilled() === this.howMany()) { - this._values.length = this.howMany(); - if (this.howMany() === 1 && this._unwrap) { - this._resolve(this._values[0]); - } else { - this._resolve(this._values); - } - } - -}; -SomePromiseArray.prototype._promiseRejected = function (reason) { - this._addRejected(reason); - if (this.howMany() > this._canPossiblyFulfill()) { - var e = new AggregateError(); - for (var i = this.length(); i < this._values.length; ++i) { - e.push(this._values[i]); - } - this._reject(e); - } -}; - -SomePromiseArray.prototype._fulfilled = function () { - return this._totalResolved; -}; - -SomePromiseArray.prototype._rejected = function () { - return this._values.length - this.length(); -}; - -SomePromiseArray.prototype._addRejected = function (reason) { - this._values.push(reason); -}; - -SomePromiseArray.prototype._addFulfilled = function (value) { - this._values[this._totalResolved++] = value; -}; - -SomePromiseArray.prototype._canPossiblyFulfill = function () { - return this.length() - this._rejected(); -}; - -SomePromiseArray.prototype._getRangeError = function (count) { - var message = "Input array must contain at least " + - this._howMany + " items but contains only " + count + " items"; - return new RangeError(message); -}; - -SomePromiseArray.prototype._resolveEmptyArray = function () { - this._reject(this._getRangeError(0)); -}; - -function some(promises, howMany) { - if ((howMany | 0) !== howMany || howMany < 0) { - return apiRejection("expecting a positive integer\u000a\u000a See http://goo.gl/1wAmHx\u000a"); - } - var ret = new SomePromiseArray(promises); - var promise = ret.promise(); - ret.setHowMany(howMany); - ret.init(); - return promise; -} - -Promise.some = function (promises, howMany) { - return some(promises, howMany); -}; - -Promise.prototype.some = function (howMany) { - return some(this, howMany); -}; - -Promise._SomePromiseArray = SomePromiseArray; -}; diff --git a/src/node_modules/bluebird/js/main/synchronous_inspection.js b/src/node_modules/bluebird/js/main/synchronous_inspection.js deleted file mode 100644 index 7aac149..0000000 --- a/src/node_modules/bluebird/js/main/synchronous_inspection.js +++ /dev/null @@ -1,94 +0,0 @@ -"use strict"; -module.exports = function(Promise) { -function PromiseInspection(promise) { - if (promise !== undefined) { - promise = promise._target(); - this._bitField = promise._bitField; - this._settledValue = promise._settledValue; - } - else { - this._bitField = 0; - this._settledValue = undefined; - } -} - -PromiseInspection.prototype.value = function () { - if (!this.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.error = -PromiseInspection.prototype.reason = function () { - if (!this.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - return this._settledValue; -}; - -PromiseInspection.prototype.isFulfilled = -Promise.prototype._isFulfilled = function () { - return (this._bitField & 268435456) > 0; -}; - -PromiseInspection.prototype.isRejected = -Promise.prototype._isRejected = function () { - return (this._bitField & 134217728) > 0; -}; - -PromiseInspection.prototype.isPending = -Promise.prototype._isPending = function () { - return (this._bitField & 402653184) === 0; -}; - -PromiseInspection.prototype.isResolved = -Promise.prototype._isResolved = function () { - return (this._bitField & 402653184) > 0; -}; - -Promise.prototype.isPending = function() { - return this._target()._isPending(); -}; - -Promise.prototype.isRejected = function() { - return this._target()._isRejected(); -}; - -Promise.prototype.isFulfilled = function() { - return this._target()._isFulfilled(); -}; - -Promise.prototype.isResolved = function() { - return this._target()._isResolved(); -}; - -Promise.prototype._value = function() { - return this._settledValue; -}; - -Promise.prototype._reason = function() { - this._unsetRejectionIsUnhandled(); - return this._settledValue; -}; - -Promise.prototype.value = function() { - var target = this._target(); - if (!target.isFulfilled()) { - throw new TypeError("cannot get fulfillment value of a non-fulfilled promise\u000a\u000a See http://goo.gl/hc1DLj\u000a"); - } - return target._settledValue; -}; - -Promise.prototype.reason = function() { - var target = this._target(); - if (!target.isRejected()) { - throw new TypeError("cannot get rejection reason of a non-rejected promise\u000a\u000a See http://goo.gl/hPuiwB\u000a"); - } - target._unsetRejectionIsUnhandled(); - return target._settledValue; -}; - - -Promise.PromiseInspection = PromiseInspection; -}; diff --git a/src/node_modules/bluebird/js/main/thenables.js b/src/node_modules/bluebird/js/main/thenables.js deleted file mode 100644 index eadfffb..0000000 --- a/src/node_modules/bluebird/js/main/thenables.js +++ /dev/null @@ -1,84 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = require("./util.js"); -var errorObj = util.errorObj; -var isObject = util.isObject; - -function tryConvertToPromise(obj, context) { - if (isObject(obj)) { - if (obj instanceof Promise) { - return obj; - } - else if (isAnyBluebirdPromise(obj)) { - var ret = new Promise(INTERNAL); - obj._then( - ret._fulfillUnchecked, - ret._rejectUncheckedCheckError, - ret._progressUnchecked, - ret, - null - ); - return ret; - } - var then = util.tryCatch(getThen)(obj); - if (then === errorObj) { - if (context) context._pushContext(); - var ret = Promise.reject(then.e); - if (context) context._popContext(); - return ret; - } else if (typeof then === "function") { - return doThenable(obj, then, context); - } - } - return obj; -} - -function getThen(obj) { - return obj.then; -} - -var hasProp = {}.hasOwnProperty; -function isAnyBluebirdPromise(obj) { - return hasProp.call(obj, "_promise0"); -} - -function doThenable(x, then, context) { - var promise = new Promise(INTERNAL); - var ret = promise; - if (context) context._pushContext(); - promise._captureStackTrace(); - if (context) context._popContext(); - var synchronous = true; - var result = util.tryCatch(then).call(x, - resolveFromThenable, - rejectFromThenable, - progressFromThenable); - synchronous = false; - if (promise && result === errorObj) { - promise._rejectCallback(result.e, true, true); - promise = null; - } - - function resolveFromThenable(value) { - if (!promise) return; - promise._resolveCallback(value); - promise = null; - } - - function rejectFromThenable(reason) { - if (!promise) return; - promise._rejectCallback(reason, synchronous, true); - promise = null; - } - - function progressFromThenable(value) { - if (!promise) return; - if (typeof promise._progress === "function") { - promise._progress(value); - } - } - return ret; -} - -return tryConvertToPromise; -}; diff --git a/src/node_modules/bluebird/js/main/timers.js b/src/node_modules/bluebird/js/main/timers.js deleted file mode 100644 index f26431a..0000000 --- a/src/node_modules/bluebird/js/main/timers.js +++ /dev/null @@ -1,64 +0,0 @@ -"use strict"; -module.exports = function(Promise, INTERNAL) { -var util = require("./util.js"); -var TimeoutError = Promise.TimeoutError; - -var afterTimeout = function (promise, message) { - if (!promise.isPending()) return; - - var err; - if(!util.isPrimitive(message) && (message instanceof Error)) { - err = message; - } else { - if (typeof message !== "string") { - message = "operation timed out"; - } - err = new TimeoutError(message); - } - util.markAsOriginatingFromRejection(err); - promise._attachExtraTrace(err); - promise._cancel(err); -}; - -var afterValue = function(value) { return delay(+this).thenReturn(value); }; -var delay = Promise.delay = function (value, ms) { - if (ms === undefined) { - ms = value; - value = undefined; - var ret = new Promise(INTERNAL); - setTimeout(function() { ret._fulfill(); }, ms); - return ret; - } - ms = +ms; - return Promise.resolve(value)._then(afterValue, null, null, ms, undefined); -}; - -Promise.prototype.delay = function (ms) { - return delay(this, ms); -}; - -function successClear(value) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - return value; -} - -function failureClear(reason) { - var handle = this; - if (handle instanceof Number) handle = +handle; - clearTimeout(handle); - throw reason; -} - -Promise.prototype.timeout = function (ms, message) { - ms = +ms; - var ret = this.then().cancellable(); - ret._cancellationParent = this; - var handle = setTimeout(function timeoutTimeout() { - afterTimeout(ret, message); - }, ms); - return ret._then(successClear, failureClear, undefined, handle, undefined); -}; - -}; diff --git a/src/node_modules/bluebird/js/main/using.js b/src/node_modules/bluebird/js/main/using.js deleted file mode 100644 index 957182d..0000000 --- a/src/node_modules/bluebird/js/main/using.js +++ /dev/null @@ -1,213 +0,0 @@ -"use strict"; -module.exports = function (Promise, apiRejection, tryConvertToPromise, - createContext) { - var TypeError = require("./errors.js").TypeError; - var inherits = require("./util.js").inherits; - var PromiseInspection = Promise.PromiseInspection; - - function inspectionMapper(inspections) { - var len = inspections.length; - for (var i = 0; i < len; ++i) { - var inspection = inspections[i]; - if (inspection.isRejected()) { - return Promise.reject(inspection.error()); - } - inspections[i] = inspection._settledValue; - } - return inspections; - } - - function thrower(e) { - setTimeout(function(){throw e;}, 0); - } - - function castPreservingDisposable(thenable) { - var maybePromise = tryConvertToPromise(thenable); - if (maybePromise !== thenable && - typeof thenable._isDisposable === "function" && - typeof thenable._getDisposer === "function" && - thenable._isDisposable()) { - maybePromise._setDisposable(thenable._getDisposer()); - } - return maybePromise; - } - function dispose(resources, inspection) { - var i = 0; - var len = resources.length; - var ret = Promise.defer(); - function iterator() { - if (i >= len) return ret.resolve(); - var maybePromise = castPreservingDisposable(resources[i++]); - if (maybePromise instanceof Promise && - maybePromise._isDisposable()) { - try { - maybePromise = tryConvertToPromise( - maybePromise._getDisposer().tryDispose(inspection), - resources.promise); - } catch (e) { - return thrower(e); - } - if (maybePromise instanceof Promise) { - return maybePromise._then(iterator, thrower, - null, null, null); - } - } - iterator(); - } - iterator(); - return ret.promise; - } - - function disposerSuccess(value) { - var inspection = new PromiseInspection(); - inspection._settledValue = value; - inspection._bitField = 268435456; - return dispose(this, inspection).thenReturn(value); - } - - function disposerFail(reason) { - var inspection = new PromiseInspection(); - inspection._settledValue = reason; - inspection._bitField = 134217728; - return dispose(this, inspection).thenThrow(reason); - } - - function Disposer(data, promise, context) { - this._data = data; - this._promise = promise; - this._context = context; - } - - Disposer.prototype.data = function () { - return this._data; - }; - - Disposer.prototype.promise = function () { - return this._promise; - }; - - Disposer.prototype.resource = function () { - if (this.promise().isFulfilled()) { - return this.promise().value(); - } - return null; - }; - - Disposer.prototype.tryDispose = function(inspection) { - var resource = this.resource(); - var context = this._context; - if (context !== undefined) context._pushContext(); - var ret = resource !== null - ? this.doDispose(resource, inspection) : null; - if (context !== undefined) context._popContext(); - this._promise._unsetDisposable(); - this._data = null; - return ret; - }; - - Disposer.isDisposer = function (d) { - return (d != null && - typeof d.resource === "function" && - typeof d.tryDispose === "function"); - }; - - function FunctionDisposer(fn, promise, context) { - this.constructor$(fn, promise, context); - } - inherits(FunctionDisposer, Disposer); - - FunctionDisposer.prototype.doDispose = function (resource, inspection) { - var fn = this.data(); - return fn.call(resource, resource, inspection); - }; - - function maybeUnwrapDisposer(value) { - if (Disposer.isDisposer(value)) { - this.resources[this.index]._setDisposable(value); - return value.promise(); - } - return value; - } - - Promise.using = function () { - var len = arguments.length; - if (len < 2) return apiRejection( - "you must pass at least 2 arguments to Promise.using"); - var fn = arguments[len - 1]; - if (typeof fn !== "function") return apiRejection("fn must be a function\u000a\u000a See http://goo.gl/916lJJ\u000a"); - - var input; - var spreadArgs = true; - if (len === 2 && Array.isArray(arguments[0])) { - input = arguments[0]; - len = input.length; - spreadArgs = false; - } else { - input = arguments; - len--; - } - var resources = new Array(len); - for (var i = 0; i < len; ++i) { - var resource = input[i]; - if (Disposer.isDisposer(resource)) { - var disposer = resource; - resource = resource.promise(); - resource._setDisposable(disposer); - } else { - var maybePromise = tryConvertToPromise(resource); - if (maybePromise instanceof Promise) { - resource = - maybePromise._then(maybeUnwrapDisposer, null, null, { - resources: resources, - index: i - }, undefined); - } - } - resources[i] = resource; - } - - var promise = Promise.settle(resources) - .then(inspectionMapper) - .then(function(vals) { - promise._pushContext(); - var ret; - try { - ret = spreadArgs - ? fn.apply(undefined, vals) : fn.call(undefined, vals); - } finally { - promise._popContext(); - } - return ret; - }) - ._then( - disposerSuccess, disposerFail, undefined, resources, undefined); - resources.promise = promise; - return promise; - }; - - Promise.prototype._setDisposable = function (disposer) { - this._bitField = this._bitField | 262144; - this._disposer = disposer; - }; - - Promise.prototype._isDisposable = function () { - return (this._bitField & 262144) > 0; - }; - - Promise.prototype._getDisposer = function () { - return this._disposer; - }; - - Promise.prototype._unsetDisposable = function () { - this._bitField = this._bitField & (~262144); - this._disposer = undefined; - }; - - Promise.prototype.disposer = function (fn) { - if (typeof fn === "function") { - return new FunctionDisposer(fn, this, createContext()); - } - throw new TypeError(); - }; - -}; diff --git a/src/node_modules/bluebird/js/main/util.js b/src/node_modules/bluebird/js/main/util.js deleted file mode 100644 index ea39344..0000000 --- a/src/node_modules/bluebird/js/main/util.js +++ /dev/null @@ -1,321 +0,0 @@ -"use strict"; -var es5 = require("./es5.js"); -var canEvaluate = typeof navigator == "undefined"; -var haveGetters = (function(){ - try { - var o = {}; - es5.defineProperty(o, "f", { - get: function () { - return 3; - } - }); - return o.f === 3; - } - catch (e) { - return false; - } - -})(); - -var errorObj = {e: {}}; -var tryCatchTarget; -function tryCatcher() { - try { - var target = tryCatchTarget; - tryCatchTarget = null; - return target.apply(this, arguments); - } catch (e) { - errorObj.e = e; - return errorObj; - } -} -function tryCatch(fn) { - tryCatchTarget = fn; - return tryCatcher; -} - -var inherits = function(Child, Parent) { - var hasProp = {}.hasOwnProperty; - - function T() { - this.constructor = Child; - this.constructor$ = Parent; - for (var propertyName in Parent.prototype) { - if (hasProp.call(Parent.prototype, propertyName) && - propertyName.charAt(propertyName.length-1) !== "$" - ) { - this[propertyName + "$"] = Parent.prototype[propertyName]; - } - } - } - T.prototype = Parent.prototype; - Child.prototype = new T(); - return Child.prototype; -}; - - -function isPrimitive(val) { - return val == null || val === true || val === false || - typeof val === "string" || typeof val === "number"; - -} - -function isObject(value) { - return !isPrimitive(value); -} - -function maybeWrapAsError(maybeError) { - if (!isPrimitive(maybeError)) return maybeError; - - return new Error(safeToString(maybeError)); -} - -function withAppended(target, appendee) { - var len = target.length; - var ret = new Array(len + 1); - var i; - for (i = 0; i < len; ++i) { - ret[i] = target[i]; - } - ret[i] = appendee; - return ret; -} - -function getDataPropertyOrDefault(obj, key, defaultValue) { - if (es5.isES5) { - var desc = Object.getOwnPropertyDescriptor(obj, key); - - if (desc != null) { - return desc.get == null && desc.set == null - ? desc.value - : defaultValue; - } - } else { - return {}.hasOwnProperty.call(obj, key) ? obj[key] : undefined; - } -} - -function notEnumerableProp(obj, name, value) { - if (isPrimitive(obj)) return obj; - var descriptor = { - value: value, - configurable: true, - enumerable: false, - writable: true - }; - es5.defineProperty(obj, name, descriptor); - return obj; -} - -function thrower(r) { - throw r; -} - -var inheritedDataKeys = (function() { - var excludedPrototypes = [ - Array.prototype, - Object.prototype, - Function.prototype - ]; - - var isExcludedProto = function(val) { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (excludedPrototypes[i] === val) { - return true; - } - } - return false; - }; - - if (es5.isES5) { - var getKeys = Object.getOwnPropertyNames; - return function(obj) { - var ret = []; - var visitedKeys = Object.create(null); - while (obj != null && !isExcludedProto(obj)) { - var keys; - try { - keys = getKeys(obj); - } catch (e) { - return ret; - } - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (visitedKeys[key]) continue; - visitedKeys[key] = true; - var desc = Object.getOwnPropertyDescriptor(obj, key); - if (desc != null && desc.get == null && desc.set == null) { - ret.push(key); - } - } - obj = es5.getPrototypeOf(obj); - } - return ret; - }; - } else { - var hasProp = {}.hasOwnProperty; - return function(obj) { - if (isExcludedProto(obj)) return []; - var ret = []; - - /*jshint forin:false */ - enumeration: for (var key in obj) { - if (hasProp.call(obj, key)) { - ret.push(key); - } else { - for (var i = 0; i < excludedPrototypes.length; ++i) { - if (hasProp.call(excludedPrototypes[i], key)) { - continue enumeration; - } - } - ret.push(key); - } - } - return ret; - }; - } - -})(); - -var thisAssignmentPattern = /this\s*\.\s*\S+\s*=/; -function isClass(fn) { - try { - if (typeof fn === "function") { - var keys = es5.names(fn.prototype); - - var hasMethods = es5.isES5 && keys.length > 1; - var hasMethodsOtherThanConstructor = keys.length > 0 && - !(keys.length === 1 && keys[0] === "constructor"); - var hasThisAssignmentAndStaticMethods = - thisAssignmentPattern.test(fn + "") && es5.names(fn).length > 0; - - if (hasMethods || hasMethodsOtherThanConstructor || - hasThisAssignmentAndStaticMethods) { - return true; - } - } - return false; - } catch (e) { - return false; - } -} - -function toFastProperties(obj) { - /*jshint -W027,-W055,-W031*/ - function f() {} - f.prototype = obj; - var l = 8; - while (l--) new f(); - return obj; - eval(obj); -} - -var rident = /^[a-z$_][a-z$_0-9]*$/i; -function isIdentifier(str) { - return rident.test(str); -} - -function filledRange(count, prefix, suffix) { - var ret = new Array(count); - for(var i = 0; i < count; ++i) { - ret[i] = prefix + i + suffix; - } - return ret; -} - -function safeToString(obj) { - try { - return obj + ""; - } catch (e) { - return "[no string representation]"; - } -} - -function markAsOriginatingFromRejection(e) { - try { - notEnumerableProp(e, "isOperational", true); - } - catch(ignore) {} -} - -function originatesFromRejection(e) { - if (e == null) return false; - return ((e instanceof Error["__BluebirdErrorTypes__"].OperationalError) || - e["isOperational"] === true); -} - -function canAttachTrace(obj) { - return obj instanceof Error && es5.propertyIsWritable(obj, "stack"); -} - -var ensureErrorObject = (function() { - if (!("stack" in new Error())) { - return function(value) { - if (canAttachTrace(value)) return value; - try {throw new Error(safeToString(value));} - catch(err) {return err;} - }; - } else { - return function(value) { - if (canAttachTrace(value)) return value; - return new Error(safeToString(value)); - }; - } -})(); - -function classString(obj) { - return {}.toString.call(obj); -} - -function copyDescriptors(from, to, filter) { - var keys = es5.names(from); - for (var i = 0; i < keys.length; ++i) { - var key = keys[i]; - if (filter(key)) { - try { - es5.defineProperty(to, key, es5.getDescriptor(from, key)); - } catch (ignore) {} - } - } -} - -var ret = { - isClass: isClass, - isIdentifier: isIdentifier, - inheritedDataKeys: inheritedDataKeys, - getDataPropertyOrDefault: getDataPropertyOrDefault, - thrower: thrower, - isArray: es5.isArray, - haveGetters: haveGetters, - notEnumerableProp: notEnumerableProp, - isPrimitive: isPrimitive, - isObject: isObject, - canEvaluate: canEvaluate, - errorObj: errorObj, - tryCatch: tryCatch, - inherits: inherits, - withAppended: withAppended, - maybeWrapAsError: maybeWrapAsError, - toFastProperties: toFastProperties, - filledRange: filledRange, - toString: safeToString, - canAttachTrace: canAttachTrace, - ensureErrorObject: ensureErrorObject, - originatesFromRejection: originatesFromRejection, - markAsOriginatingFromRejection: markAsOriginatingFromRejection, - classString: classString, - copyDescriptors: copyDescriptors, - hasDevTools: typeof chrome !== "undefined" && chrome && - typeof chrome.loadTimes === "function", - isNode: typeof process !== "undefined" && - classString(process).toLowerCase() === "[object process]" -}; -ret.isRecentNode = ret.isNode && (function() { - var version = process.versions.node.split(".").map(Number); - return (version[0] === 0 && version[1] > 10) || (version[0] > 0); -})(); - -if (ret.isNode) ret.toFastProperties(process); - -try {throw new Error(); } catch (e) {ret.lastLineError = e;} -module.exports = ret; diff --git a/src/node_modules/bluebird/package.json b/src/node_modules/bluebird/package.json deleted file mode 100644 index fccbefb..0000000 --- a/src/node_modules/bluebird/package.json +++ /dev/null @@ -1,127 +0,0 @@ -{ - "_args": [ - [ - "bluebird@^2.9.33", - "/media/Github/Vertinext2/src/node_modules/babel-core" - ] - ], - "_from": "bluebird@>=2.9.33 <3.0.0", - "_id": "bluebird@2.10.2", - "_inCache": true, - "_installable": true, - "_location": "/bluebird", - "_nodeVersion": "2.3.0", - "_npmUser": { - "email": "petka_antonov@hotmail.com", - "name": "esailija" - }, - "_npmVersion": "2.11.1", - "_phantomChildren": {}, - "_requested": { - "name": "bluebird", - "raw": "bluebird@^2.9.33", - "rawSpec": "^2.9.33", - "scope": null, - "spec": ">=2.9.33 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/babel-core" - ], - "_resolved": "https://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz", - "_shasum": "024a5517295308857f14f91f1106fc3b555f446b", - "_shrinkwrap": null, - "_spec": "bluebird@^2.9.33", - "_where": "/media/Github/Vertinext2/src/node_modules/babel-core", - "author": { - "email": "petka_antonov@hotmail.com", - "name": "Petka Antonov", - "url": "http://github.com/petkaantonov/" - }, - "browser": "./js/browser/bluebird.js", - "bugs": { - "url": "http://github.com/petkaantonov/bluebird/issues" - }, - "dependencies": {}, - "description": "Full featured Promises/A+ implementation with exceptionally good performance", - "devDependencies": { - "acorn": "~0.6.0", - "baconjs": "^0.7.43", - "bluebird": "^2.9.2", - "body-parser": "^1.10.2", - "browserify": "^8.1.1", - "cli-table": "~0.3.1", - "co": "^4.2.0", - "cross-spawn": "^0.2.3", - "glob": "^4.3.2", - "grunt-saucelabs": "~8.4.1", - "highland": "^2.3.0", - "istanbul": "^0.3.5", - "jshint": "^2.6.0", - "jshint-stylish": "~0.2.0", - "kefir": "^2.4.1", - "mkdirp": "~0.5.0", - "mocha": "~2.1", - "open": "~0.0.5", - "optimist": "~0.6.1", - "rimraf": "~2.2.6", - "rx": "^2.3.25", - "serve-static": "^1.7.1", - "sinon": "~1.7.3", - "uglify-js": "~2.4.16" - }, - "directories": {}, - "dist": { - "shasum": "024a5517295308857f14f91f1106fc3b555f446b", - "tarball": "http://registry.npmjs.org/bluebird/-/bluebird-2.10.2.tgz" - }, - "files": [ - "js/browser", - "js/main", - "js/zalgo", - "zalgo.js" - ], - "gitHead": "02c0fd252cf7c0c86e6b27bb06422c404829b539", - "homepage": "https://github.com/petkaantonov/bluebird", - "keywords": [ - "promise", - "performance", - "promises", - "promises-a", - "promises-aplus", - "async", - "await", - "deferred", - "deferreds", - "future", - "flow control", - "dsl", - "fluent interface", - "parallel", - "thread", - "concurrency" - ], - "license": "MIT", - "main": "./js/main/bluebird.js", - "maintainers": [ - { - "email": "petka_antonov@hotmail.com", - "name": "esailija" - } - ], - "name": "bluebird", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/petkaantonov/bluebird.git" - }, - "scripts": { - "generate-browser-core": "node tools/build.js --features=core --no-debug --main --zalgo --browser --minify && mv js/browser/bluebird.js js/browser/bluebird.core.js && mv js/browser/bluebird.min.js js/browser/bluebird.core.min.js", - "istanbul": "istanbul", - "lint": "node scripts/jshint.js", - "prepublish": "node tools/build.js --no-debug --main --zalgo --browser --minify", - "test": "node tools/test.js" - }, - "version": "2.10.2" -} diff --git a/src/node_modules/bn.js/.npmignore b/src/node_modules/bn.js/.npmignore deleted file mode 100644 index 6d1eebb..0000000 --- a/src/node_modules/bn.js/.npmignore +++ /dev/null @@ -1,6 +0,0 @@ -benchmarks/ -coverage/ -node_modules/ -npm-debug.log -1.js -logo.png diff --git a/src/node_modules/bn.js/.travis.yml b/src/node_modules/bn.js/.travis.yml deleted file mode 100644 index 936b7b7..0000000 --- a/src/node_modules/bn.js/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -sudo: false -language: node_js -node_js: - - "0.10" - - "0.12" - - "4" - - "5" -env: - matrix: - - TEST_SUITE=unit -matrix: - include: - - node_js: "4" - env: TEST_SUITE=lint -script: npm run $TEST_SUITE diff --git a/src/node_modules/bn.js/README.md b/src/node_modules/bn.js/README.md deleted file mode 100644 index 9ae5927..0000000 --- a/src/node_modules/bn.js/README.md +++ /dev/null @@ -1,218 +0,0 @@ -# bn.js - -> BigNum in pure javascript - -[![Build Status](https://secure.travis-ci.org/indutny/bn.js.png)](http://travis-ci.org/indutny/bn.js) - -## Install -`npm install --save bn.js` - -## Usage - -```js -const BN = require('bn.js'); - -var a = new BN('dead', 16); -var b = new BN('101010', 2); - -var res = a.add(b); -console.log(res.toString(10)); // 57047 -``` - -**Note**: decimals are not supported in this library. - -## Notation - -### Prefixes - -There are several prefixes to instructions that affect the way the work. Here -is the list of them in the order of appearance in the function name: - -* `i` - perform operation in-place, storing the result in the host object (on - which the method was invoked). Might be used to avoid number allocation costs -* `u` - unsigned, ignore the sign of operands when performing operation, or - always return positive value. Second case applies to reduction operations - like `mod()`. In such cases if the result will be negative - modulo will be - added to the result to make it positive - -### Postfixes - -The only available postfix at the moment is: - -* `n` - which means that the argument of the function must be a plain JavaScript - number - -### Examples - -* `a.iadd(b)` - perform addition on `a` and `b`, storing the result in `a` -* `a.pmod(b)` - reduce `a` modulo `b`, returning positive value -* `a.iushln(13)` - shift bits of `a` left by 13 - -## Instructions - -Prefixes/postfixes are put in parens at the of the line. `endian` - could be -either `le` (little-endian) or `be` (big-endian). - -### Utilities - -* `a.clone()` - clone number -* `a.toString(base, length)` - convert to base-string and pad with zeroes -* `a.toNumber()` - convert to Javascript Number (limited to 53 bits) -* `a.toJSON()` - convert to JSON compatible hex string (alias of `toString(16)`) -* `a.toArray(endian, length)` - convert to byte `Array`, and optionally zero - pad to length, throwing if already exceeding -* `a.toArrayLike(type, endian, length)` - convert to an instance of `type`, - which must behave like an `Array` -* `a.toBuffer(endian, length)` - convert to Node.js Buffer (if available) -* `a.bitLength()` - get number of bits occupied -* `a.zeroBits()` - return number of less-significant consequent zero bits - (example: `1010000` has 4 zero bits) -* `a.byteLength()` - return number of bytes occupied -* `a.isNeg()` - true if the number is negative -* `a.isEven()` - no comments -* `a.isOdd()` - no comments -* `a.isZero()` - no comments -* `a.cmp(b)` - compare numbers and return `-1` (a `<` b), `0` (a `==` b), or `1` (a `>` b) - depending on the comparison result (`ucmp`, `cmpn`) -* `a.lt(b)` - `a` less than `b` (`n`) -* `a.lte(b)` - `a` less than or equals `b` (`n`) -* `a.gt(b)` - `a` greater than `b` (`n`) -* `a.gte(b)` - `a` greater than or equals `b` (`n`) -* `a.eq(b)` - `a` equals `b` (`n`) -* `a.toTwos(width)` - convert to two's complement representation, where `width` is bit width -* `a.fromTwos(width)` - convert from two's complement representation, where `width` is the bit width - -### Arithmetics - -* `a.neg()` - negate sign (`i`) -* `a.abs()` - absolute value (`i`) -* `a.add(b)` - addition (`i`, `n`, `in`) -* `a.sub(b)` - subtraction (`i`, `n`, `in`) -* `a.mul(b)` - multiply (`i`, `n`, `in`) -* `a.sqr()` - square (`i`) -* `a.pow(b)` - raise `a` to the power of `b` -* `a.div(b)` - divide (`divn`, `idivn`) -* `a.mod(b)` - reduct (`u`, `n`) (but no `umodn`) -* `a.divRound(b)` - rounded division - -### Bit operations - -* `a.or(b)` - or (`i`, `u`, `iu`) -* `a.and(b)` - and (`i`, `u`, `iu`, `andln`) (NOTE: `andln` is going to be replaced - with `andn` in future) -* `a.xor(b)` - xor (`i`, `u`, `iu`) -* `a.setn(b)` - set specified bit to `1` -* `a.shln(b)` - shift left (`i`, `u`, `iu`) -* `a.shrn(b)` - shift right (`i`, `u`, `iu`) -* `a.testn(b)` - test if specified bit is set -* `a.maskn(b)` - clear bits with indexes higher or equal to `b` (`i`) -* `a.bincn(b)` - add `1 << b` to the number -* `a.notn(w)` - not (for the width specified by `w`) (`i`) - -### Reduction - -* `a.gcd(b)` - GCD -* `a.egcd(b)` - Extended GCD results (`{ a: ..., b: ..., gcd: ... }`) -* `a.invm(b)` - inverse `a` modulo `b` - -## Fast reduction - -When doing lots of reductions using the same modulo, it might be beneficial to -use some tricks: like [Montgomery multiplication][0], or using special algorithm -for [Mersenne Prime][1]. - -### Reduction context - -To enable this tricks one should create a reduction context: - -```js -var red = BN.red(num); -``` -where `num` is just a BN instance. - -Or: - -```js -var red = BN.red(primeName); -``` - -Where `primeName` is either of these [Mersenne Primes][1]: - -* `'k256'` -* `'p224'` -* `'p192'` -* `'p25519'` - -Or: - -```js -var red = BN.mont(num); -``` - -To reduce numbers with [Montgomery trick][1]. `.mont()` is generally faster than -`.red(num)`, but slower than `BN.red(primeName)`. - -### Converting numbers - -Before performing anything in reduction context - numbers should be converted -to it. Usually, this means that one should: - -* Convert inputs to reducted ones -* Operate on them in reduction context -* Convert outputs back from the reduction context - -Here is how one may convert numbers to `red`: - -```js -var redA = a.toRed(red); -``` -Where `red` is a reduction context created using instructions above - -Here is how to convert them back: - -```js -var a = redA.fromRed(); -``` - -### Red instructions - -Most of the instructions from the very start of this readme have their -counterparts in red context: - -* `a.redAdd(b)`, `a.redIAdd(b)` -* `a.redSub(b)`, `a.redISub(b)` -* `a.redShl(num)` -* `a.redMul(b)`, `a.redIMul(b)` -* `a.redSqr()`, `a.redISqr()` -* `a.redSqrt()` - square root modulo reduction context's prime -* `a.redInvm()` - modular inverse of the number -* `a.redNeg()` -* `a.redPow(b)` - modular exponentiation - -## LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2015. - -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. - -[0]: https://en.wikipedia.org/wiki/Montgomery_modular_multiplication -[1]: https://en.wikipedia.org/wiki/Mersenne_prime diff --git a/src/node_modules/bn.js/lib/bn.js b/src/node_modules/bn.js/lib/bn.js deleted file mode 100644 index f9e1a2f..0000000 --- a/src/node_modules/bn.js/lib/bn.js +++ /dev/null @@ -1,3435 +0,0 @@ -(function (module, exports) { - 'use strict'; - - // Utils - function assert (val, msg) { - if (!val) throw new Error(msg || 'Assertion failed'); - } - - // Could use `inherits` module, but don't want to move from single file - // architecture yet. - function inherits (ctor, superCtor) { - ctor.super_ = superCtor; - var TempCtor = function () {}; - TempCtor.prototype = superCtor.prototype; - ctor.prototype = new TempCtor(); - ctor.prototype.constructor = ctor; - } - - // BN - - function BN (number, base, endian) { - // May be `new BN(bn)` ? - if (number !== null && - typeof number === 'object' && - Array.isArray(number.words)) { - return number; - } - - this.negative = 0; - this.words = null; - this.length = 0; - - // Reduction context - this.red = null; - - if (number !== null) { - if (base === 'le' || base === 'be') { - endian = base; - base = 10; - } - - this._init(number || 0, base || 10, endian || 'be'); - } - } - if (typeof module === 'object') { - module.exports = BN; - } else { - exports.BN = BN; - } - - BN.BN = BN; - BN.wordSize = 26; - - var Buffer; - try { - Buffer = require('buf' + 'fer').Buffer; - } catch (e) { - } - - BN.max = function max (left, right) { - if (left.cmp(right) > 0) return left; - return right; - }; - - BN.min = function min (left, right) { - if (left.cmp(right) < 0) return left; - return right; - }; - - BN.prototype._init = function init (number, base, endian) { - if (typeof number === 'number') { - return this._initNumber(number, base, endian); - } - - if (typeof number === 'object') { - return this._initArray(number, base, endian); - } - - if (base === 'hex') { - base = 16; - } - assert(base === (base | 0) && base >= 2 && base <= 36); - - number = number.toString().replace(/\s+/g, ''); - var start = 0; - if (number[0] === '-') { - start++; - } - - if (base === 16) { - this._parseHex(number, start); - } else { - this._parseBase(number, base, start); - } - - if (number[0] === '-') { - this.negative = 1; - } - - this.strip(); - - if (endian !== 'le') return; - - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initNumber = function _initNumber (number, base, endian) { - if (number < 0) { - this.negative = 1; - number = -number; - } - if (number < 0x4000000) { - this.words = [ number & 0x3ffffff ]; - this.length = 1; - } else if (number < 0x10000000000000) { - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff - ]; - this.length = 2; - } else { - assert(number < 0x20000000000000); // 2 ^ 53 (unsafe) - this.words = [ - number & 0x3ffffff, - (number / 0x4000000) & 0x3ffffff, - 1 - ]; - this.length = 3; - } - - if (endian !== 'le') return; - - // Reverse the bytes - this._initArray(this.toArray(), base, endian); - }; - - BN.prototype._initArray = function _initArray (number, base, endian) { - // Perhaps a Uint8Array - assert(typeof number.length === 'number'); - if (number.length <= 0) { - this.words = [ 0 ]; - this.length = 1; - return this; - } - - this.length = Math.ceil(number.length / 3); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - var off = 0; - if (endian === 'be') { - for (i = number.length - 1, j = 0; i >= 0; i -= 3) { - w = number[i] | (number[i - 1] << 8) | (number[i - 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } else if (endian === 'le') { - for (i = 0, j = 0; i < number.length; i += 3) { - w = number[i] | (number[i + 1] << 8) | (number[i + 2] << 16); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] = (w >>> (26 - off)) & 0x3ffffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - } - return this.strip(); - }; - - function parseHex (str, start, end) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r <<= 4; - - // 'a' - 'f' - if (c >= 49 && c <= 54) { - r |= c - 49 + 0xa; - - // 'A' - 'F' - } else if (c >= 17 && c <= 22) { - r |= c - 17 + 0xa; - - // '0' - '9' - } else { - r |= c & 0xf; - } - } - return r; - } - - BN.prototype._parseHex = function _parseHex (number, start) { - // Create possibly bigger array to ensure that it fits the number - this.length = Math.ceil((number.length - start) / 6); - this.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - this.words[i] = 0; - } - - var j, w; - // Scan 24-bit chunks and add them to the number - var off = 0; - for (i = number.length - 6, j = 0; i >= start; i -= 6) { - w = parseHex(number, i, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - off += 24; - if (off >= 26) { - off -= 26; - j++; - } - } - if (i + 6 !== start) { - w = parseHex(number, start, i + 6); - this.words[j] |= (w << off) & 0x3ffffff; - this.words[j + 1] |= w >>> (26 - off) & 0x3fffff; - } - this.strip(); - }; - - function parseBase (str, start, end, mul) { - var r = 0; - var len = Math.min(str.length, end); - for (var i = start; i < len; i++) { - var c = str.charCodeAt(i) - 48; - - r *= mul; - - // 'a' - if (c >= 49) { - r += c - 49 + 0xa; - - // 'A' - } else if (c >= 17) { - r += c - 17 + 0xa; - - // '0' - '9' - } else { - r += c; - } - } - return r; - } - - BN.prototype._parseBase = function _parseBase (number, base, start) { - // Initialize as zero - this.words = [ 0 ]; - this.length = 1; - - // Find length of limb in base - for (var limbLen = 0, limbPow = 1; limbPow <= 0x3ffffff; limbPow *= base) { - limbLen++; - } - limbLen--; - limbPow = (limbPow / base) | 0; - - var total = number.length - start; - var mod = total % limbLen; - var end = Math.min(total, total - mod) + start; - - var word = 0; - for (var i = start; i < end; i += limbLen) { - word = parseBase(number, i, i + limbLen, base); - - this.imuln(limbPow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - - if (mod !== 0) { - var pow = 1; - word = parseBase(number, i, number.length, base); - - for (i = 0; i < mod; i++) { - pow *= base; - } - - this.imuln(pow); - if (this.words[0] + word < 0x4000000) { - this.words[0] += word; - } else { - this._iaddn(word); - } - } - }; - - BN.prototype.copy = function copy (dest) { - dest.words = new Array(this.length); - for (var i = 0; i < this.length; i++) { - dest.words[i] = this.words[i]; - } - dest.length = this.length; - dest.negative = this.negative; - dest.red = this.red; - }; - - BN.prototype.clone = function clone () { - var r = new BN(null); - this.copy(r); - return r; - }; - - // Remove leading `0` from `this` - BN.prototype.strip = function strip () { - while (this.length > 1 && this.words[this.length - 1] === 0) { - this.length--; - } - return this._normSign(); - }; - - BN.prototype._normSign = function _normSign () { - // -0 = 0 - if (this.length === 1 && this.words[0] === 0) { - this.negative = 0; - } - return this; - }; - - BN.prototype.inspect = function inspect () { - return (this.red ? ''; - }; - - /* - - var zeros = []; - var groupSizes = []; - var groupBases = []; - - var s = ''; - var i = -1; - while (++i < BN.wordSize) { - zeros[i] = s; - s += '0'; - } - groupSizes[0] = 0; - groupSizes[1] = 0; - groupBases[0] = 0; - groupBases[1] = 0; - var base = 2 - 1; - while (++base < 36 + 1) { - var groupSize = 0; - var groupBase = 1; - while (groupBase < (1 << BN.wordSize) / base) { - groupBase *= base; - groupSize += 1; - } - groupSizes[base] = groupSize; - groupBases[base] = groupBase; - } - - */ - - var zeros = [ - '', - '0', - '00', - '000', - '0000', - '00000', - '000000', - '0000000', - '00000000', - '000000000', - '0000000000', - '00000000000', - '000000000000', - '0000000000000', - '00000000000000', - '000000000000000', - '0000000000000000', - '00000000000000000', - '000000000000000000', - '0000000000000000000', - '00000000000000000000', - '000000000000000000000', - '0000000000000000000000', - '00000000000000000000000', - '000000000000000000000000', - '0000000000000000000000000' - ]; - - var groupSizes = [ - 0, 0, - 25, 16, 12, 11, 10, 9, 8, - 8, 7, 7, 7, 7, 6, 6, - 6, 6, 6, 6, 6, 5, 5, - 5, 5, 5, 5, 5, 5, 5, - 5, 5, 5, 5, 5, 5, 5 - ]; - - var groupBases = [ - 0, 0, - 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, - 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, - 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, - 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, - 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 - ]; - - BN.prototype.toString = function toString (base, padding) { - base = base || 10; - padding = padding | 0 || 1; - - var out; - if (base === 16 || base === 'hex') { - out = ''; - var off = 0; - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = this.words[i]; - var word = (((w << off) | carry) & 0xffffff).toString(16); - carry = (w >>> (24 - off)) & 0xffffff; - if (carry !== 0 || i !== this.length - 1) { - out = zeros[6 - word.length] + word + out; - } else { - out = word + out; - } - off += 2; - if (off >= 26) { - off -= 26; - i--; - } - } - if (carry !== 0) { - out = carry.toString(16) + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - if (base === (base | 0) && base >= 2 && base <= 36) { - // var groupSize = Math.floor(BN.wordSize * Math.LN2 / Math.log(base)); - var groupSize = groupSizes[base]; - // var groupBase = Math.pow(base, groupSize); - var groupBase = groupBases[base]; - out = ''; - var c = this.clone(); - c.negative = 0; - while (!c.isZero()) { - var r = c.modn(groupBase).toString(base); - c = c.idivn(groupBase); - - if (!c.isZero()) { - out = zeros[groupSize - r.length] + r + out; - } else { - out = r + out; - } - } - if (this.isZero()) { - out = '0' + out; - } - while (out.length % padding !== 0) { - out = '0' + out; - } - if (this.negative !== 0) { - out = '-' + out; - } - return out; - } - - assert(false, 'Base should be between 2 and 36'); - }; - - BN.prototype.toNumber = function toNumber () { - var length = this.bitLength(); - var ret; - if (length <= 26) { - ret = this.words[0]; - } else if (length <= 52) { - ret = (this.words[1] * 0x4000000) + this.words[0]; - } else if (length === 53) { - // NOTE: at this stage it is known that the top bit is set - ret = 0x10000000000000 + (this.words[1] * 0x4000000) + this.words[0]; - } else { - assert(false, 'Number can only safely store up to 53 bits'); - } - return (this.negative !== 0) ? -ret : ret; - }; - - BN.prototype.toJSON = function toJSON () { - return this.toString(16); - }; - - BN.prototype.toBuffer = function toBuffer (endian, length) { - assert(typeof Buffer !== 'undefined'); - return this.toArrayLike(Buffer, endian, length); - }; - - BN.prototype.toArray = function toArray (endian, length) { - return this.toArrayLike(Array, endian, length); - }; - - BN.prototype.toArrayLike = function toArrayLike (ArrayType, endian, length) { - var byteLength = this.byteLength(); - var reqLength = length || Math.max(1, byteLength); - assert(byteLength <= reqLength, 'byte array longer than desired length'); - assert(reqLength > 0, 'Requested array length <= 0'); - - this.strip(); - var littleEndian = endian === 'le'; - var res = new ArrayType(reqLength); - - var b, i; - var q = this.clone(); - if (!littleEndian) { - // Assume big-endian - for (i = 0; i < reqLength - byteLength; i++) { - res[i] = 0; - } - - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[reqLength - i - 1] = b; - } - } else { - for (i = 0; !q.isZero(); i++) { - b = q.andln(0xff); - q.iushrn(8); - - res[i] = b; - } - - for (; i < reqLength; i++) { - res[i] = 0; - } - } - - return res; - }; - - if (Math.clz32) { - BN.prototype._countBits = function _countBits (w) { - return 32 - Math.clz32(w); - }; - } else { - BN.prototype._countBits = function _countBits (w) { - var t = w; - var r = 0; - if (t >= 0x1000) { - r += 13; - t >>>= 13; - } - if (t >= 0x40) { - r += 7; - t >>>= 7; - } - if (t >= 0x8) { - r += 4; - t >>>= 4; - } - if (t >= 0x02) { - r += 2; - t >>>= 2; - } - return r + t; - }; - } - - BN.prototype._zeroBits = function _zeroBits (w) { - // Short-cut - if (w === 0) return 26; - - var t = w; - var r = 0; - if ((t & 0x1fff) === 0) { - r += 13; - t >>>= 13; - } - if ((t & 0x7f) === 0) { - r += 7; - t >>>= 7; - } - if ((t & 0xf) === 0) { - r += 4; - t >>>= 4; - } - if ((t & 0x3) === 0) { - r += 2; - t >>>= 2; - } - if ((t & 0x1) === 0) { - r++; - } - return r; - }; - - // Return number of used bits in a BN - BN.prototype.bitLength = function bitLength () { - var w = this.words[this.length - 1]; - var hi = this._countBits(w); - return (this.length - 1) * 26 + hi; - }; - - function toBitArray (num) { - var w = new Array(num.bitLength()); - - for (var bit = 0; bit < w.length; bit++) { - var off = (bit / 26) | 0; - var wbit = bit % 26; - - w[bit] = (num.words[off] & (1 << wbit)) >>> wbit; - } - - return w; - } - - // Number of trailing zero bits - BN.prototype.zeroBits = function zeroBits () { - if (this.isZero()) return 0; - - var r = 0; - for (var i = 0; i < this.length; i++) { - var b = this._zeroBits(this.words[i]); - r += b; - if (b !== 26) break; - } - return r; - }; - - BN.prototype.byteLength = function byteLength () { - return Math.ceil(this.bitLength() / 8); - }; - - BN.prototype.toTwos = function toTwos (width) { - if (this.negative !== 0) { - return this.abs().inotn(width).iaddn(1); - } - return this.clone(); - }; - - BN.prototype.fromTwos = function fromTwos (width) { - if (this.testn(width - 1)) { - return this.notn(width).iaddn(1).ineg(); - } - return this.clone(); - }; - - BN.prototype.isNeg = function isNeg () { - return this.negative !== 0; - }; - - // Return negative clone of `this` - BN.prototype.neg = function neg () { - return this.clone().ineg(); - }; - - BN.prototype.ineg = function ineg () { - if (!this.isZero()) { - this.negative ^= 1; - } - - return this; - }; - - // Or `num` with `this` in-place - BN.prototype.iuor = function iuor (num) { - while (this.length < num.length) { - this.words[this.length++] = 0; - } - - for (var i = 0; i < num.length; i++) { - this.words[i] = this.words[i] | num.words[i]; - } - - return this.strip(); - }; - - BN.prototype.ior = function ior (num) { - assert((this.negative | num.negative) === 0); - return this.iuor(num); - }; - - // Or `num` with `this` - BN.prototype.or = function or (num) { - if (this.length > num.length) return this.clone().ior(num); - return num.clone().ior(this); - }; - - BN.prototype.uor = function uor (num) { - if (this.length > num.length) return this.clone().iuor(num); - return num.clone().iuor(this); - }; - - // And `num` with `this` in-place - BN.prototype.iuand = function iuand (num) { - // b = min-length(num, this) - var b; - if (this.length > num.length) { - b = num; - } else { - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = this.words[i] & num.words[i]; - } - - this.length = b.length; - - return this.strip(); - }; - - BN.prototype.iand = function iand (num) { - assert((this.negative | num.negative) === 0); - return this.iuand(num); - }; - - // And `num` with `this` - BN.prototype.and = function and (num) { - if (this.length > num.length) return this.clone().iand(num); - return num.clone().iand(this); - }; - - BN.prototype.uand = function uand (num) { - if (this.length > num.length) return this.clone().iuand(num); - return num.clone().iuand(this); - }; - - // Xor `num` with `this` in-place - BN.prototype.iuxor = function iuxor (num) { - // a.length > b.length - var a; - var b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - for (var i = 0; i < b.length; i++) { - this.words[i] = a.words[i] ^ b.words[i]; - } - - if (this !== a) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = a.length; - - return this.strip(); - }; - - BN.prototype.ixor = function ixor (num) { - assert((this.negative | num.negative) === 0); - return this.iuxor(num); - }; - - // Xor `num` with `this` - BN.prototype.xor = function xor (num) { - if (this.length > num.length) return this.clone().ixor(num); - return num.clone().ixor(this); - }; - - BN.prototype.uxor = function uxor (num) { - if (this.length > num.length) return this.clone().iuxor(num); - return num.clone().iuxor(this); - }; - - // Not ``this`` with ``width`` bitwidth - BN.prototype.inotn = function inotn (width) { - assert(typeof width === 'number' && width >= 0); - - var bytesNeeded = Math.ceil(width / 26) | 0; - var bitsLeft = width % 26; - - // Extend the buffer with leading zeroes - while (this.length < bytesNeeded) { - this.words[this.length++] = 0; - } - - if (bitsLeft > 0) { - bytesNeeded--; - } - - // Handle complete words - for (var i = 0; i < bytesNeeded; i++) { - this.words[i] = ~this.words[i] & 0x3ffffff; - } - - // Handle the residue - if (bitsLeft > 0) { - this.words[i] = ~this.words[i] & (0x3ffffff >> (26 - bitsLeft)); - } - - // And remove leading zeroes - return this.strip(); - }; - - BN.prototype.notn = function notn (width) { - return this.clone().inotn(width); - }; - - // Set `bit` of `this` - BN.prototype.setn = function setn (bit, val) { - assert(typeof bit === 'number' && bit >= 0); - - var off = (bit / 26) | 0; - var wbit = bit % 26; - - while (this.length <= off) { - this.words[this.length++] = 0; - } - - if (val) { - this.words[off] = this.words[off] | (1 << wbit); - } else { - this.words[off] = this.words[off] & ~(1 << wbit); - } - - return this.strip(); - }; - - // Add `num` to `this` in-place - BN.prototype.iadd = function iadd (num) { - var r; - - // negative + positive - if (this.negative !== 0 && num.negative === 0) { - this.negative = 0; - r = this.isub(num); - this.negative ^= 1; - return this._normSign(); - - // positive + negative - } else if (this.negative === 0 && num.negative !== 0) { - num.negative = 0; - r = this.isub(num); - num.negative = 1; - return r._normSign(); - } - - // a.length > b.length - var a, b; - if (this.length > num.length) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) + (b.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - this.words[i] = r & 0x3ffffff; - carry = r >>> 26; - } - - this.length = a.length; - if (carry !== 0) { - this.words[this.length] = carry; - this.length++; - // Copy the rest of the words - } else if (a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - return this; - }; - - // Add `num` to `this` - BN.prototype.add = function add (num) { - var res; - if (num.negative !== 0 && this.negative === 0) { - num.negative = 0; - res = this.sub(num); - num.negative ^= 1; - return res; - } else if (num.negative === 0 && this.negative !== 0) { - this.negative = 0; - res = num.sub(this); - this.negative = 1; - return res; - } - - if (this.length > num.length) return this.clone().iadd(num); - - return num.clone().iadd(this); - }; - - // Subtract `num` from `this` in-place - BN.prototype.isub = function isub (num) { - // this - (-num) = this + num - if (num.negative !== 0) { - num.negative = 0; - var r = this.iadd(num); - num.negative = 1; - return r._normSign(); - - // -this - num = -(this + num) - } else if (this.negative !== 0) { - this.negative = 0; - this.iadd(num); - this.negative = 1; - return this._normSign(); - } - - // At this point both numbers are positive - var cmp = this.cmp(num); - - // Optimization - zeroify - if (cmp === 0) { - this.negative = 0; - this.length = 1; - this.words[0] = 0; - return this; - } - - // a > b - var a, b; - if (cmp > 0) { - a = this; - b = num; - } else { - a = num; - b = this; - } - - var carry = 0; - for (var i = 0; i < b.length; i++) { - r = (a.words[i] | 0) - (b.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - for (; carry !== 0 && i < a.length; i++) { - r = (a.words[i] | 0) + carry; - carry = r >> 26; - this.words[i] = r & 0x3ffffff; - } - - // Copy rest of the words - if (carry === 0 && i < a.length && a !== this) { - for (; i < a.length; i++) { - this.words[i] = a.words[i]; - } - } - - this.length = Math.max(this.length, i); - - if (a !== this) { - this.negative = 1; - } - - return this.strip(); - }; - - // Subtract `num` from `this` - BN.prototype.sub = function sub (num) { - return this.clone().isub(num); - }; - - function smallMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - var len = (self.length + num.length) | 0; - out.length = len; - len = (len - 1) | 0; - - // Peel one iteration (compiler can't do it, because of code complexity) - var a = self.words[0] | 0; - var b = num.words[0] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - var carry = (r / 0x4000000) | 0; - out.words[0] = lo; - - for (var k = 1; k < len; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = carry >>> 26; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = (k - j) | 0; - a = self.words[i] | 0; - b = num.words[j] | 0; - r = a * b + rword; - ncarry += (r / 0x4000000) | 0; - rword = r & 0x3ffffff; - } - out.words[k] = rword | 0; - carry = ncarry | 0; - } - if (carry !== 0) { - out.words[k] = carry | 0; - } else { - out.length--; - } - - return out.strip(); - } - - // TODO(indutny): it may be reasonable to omit it for users who don't need - // to work with 256-bit numbers, otherwise it gives 20% improvement for 256-bit - // multiplication (like elliptic secp256k1). - var comb10MulTo = function comb10MulTo (self, num, out) { - var a = self.words; - var b = num.words; - var o = out.words; - var c = 0; - var lo; - var mid; - var hi; - var a0 = a[0] | 0; - var al0 = a0 & 0x1fff; - var ah0 = a0 >>> 13; - var a1 = a[1] | 0; - var al1 = a1 & 0x1fff; - var ah1 = a1 >>> 13; - var a2 = a[2] | 0; - var al2 = a2 & 0x1fff; - var ah2 = a2 >>> 13; - var a3 = a[3] | 0; - var al3 = a3 & 0x1fff; - var ah3 = a3 >>> 13; - var a4 = a[4] | 0; - var al4 = a4 & 0x1fff; - var ah4 = a4 >>> 13; - var a5 = a[5] | 0; - var al5 = a5 & 0x1fff; - var ah5 = a5 >>> 13; - var a6 = a[6] | 0; - var al6 = a6 & 0x1fff; - var ah6 = a6 >>> 13; - var a7 = a[7] | 0; - var al7 = a7 & 0x1fff; - var ah7 = a7 >>> 13; - var a8 = a[8] | 0; - var al8 = a8 & 0x1fff; - var ah8 = a8 >>> 13; - var a9 = a[9] | 0; - var al9 = a9 & 0x1fff; - var ah9 = a9 >>> 13; - var b0 = b[0] | 0; - var bl0 = b0 & 0x1fff; - var bh0 = b0 >>> 13; - var b1 = b[1] | 0; - var bl1 = b1 & 0x1fff; - var bh1 = b1 >>> 13; - var b2 = b[2] | 0; - var bl2 = b2 & 0x1fff; - var bh2 = b2 >>> 13; - var b3 = b[3] | 0; - var bl3 = b3 & 0x1fff; - var bh3 = b3 >>> 13; - var b4 = b[4] | 0; - var bl4 = b4 & 0x1fff; - var bh4 = b4 >>> 13; - var b5 = b[5] | 0; - var bl5 = b5 & 0x1fff; - var bh5 = b5 >>> 13; - var b6 = b[6] | 0; - var bl6 = b6 & 0x1fff; - var bh6 = b6 >>> 13; - var b7 = b[7] | 0; - var bl7 = b7 & 0x1fff; - var bh7 = b7 >>> 13; - var b8 = b[8] | 0; - var bl8 = b8 & 0x1fff; - var bh8 = b8 >>> 13; - var b9 = b[9] | 0; - var bl9 = b9 & 0x1fff; - var bh9 = b9 >>> 13; - - out.negative = self.negative ^ num.negative; - out.length = 19; - /* k = 0 */ - lo = Math.imul(al0, bl0); - mid = Math.imul(al0, bh0); - mid += Math.imul(ah0, bl0); - hi = Math.imul(ah0, bh0); - var w0 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w0 >>> 26); - w0 &= 0x3ffffff; - /* k = 1 */ - lo = Math.imul(al1, bl0); - mid = Math.imul(al1, bh0); - mid += Math.imul(ah1, bl0); - hi = Math.imul(ah1, bh0); - lo += Math.imul(al0, bl1); - mid += Math.imul(al0, bh1); - mid += Math.imul(ah0, bl1); - hi += Math.imul(ah0, bh1); - var w1 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w1 >>> 26); - w1 &= 0x3ffffff; - /* k = 2 */ - lo = Math.imul(al2, bl0); - mid = Math.imul(al2, bh0); - mid += Math.imul(ah2, bl0); - hi = Math.imul(ah2, bh0); - lo += Math.imul(al1, bl1); - mid += Math.imul(al1, bh1); - mid += Math.imul(ah1, bl1); - hi += Math.imul(ah1, bh1); - lo += Math.imul(al0, bl2); - mid += Math.imul(al0, bh2); - mid += Math.imul(ah0, bl2); - hi += Math.imul(ah0, bh2); - var w2 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w2 >>> 26); - w2 &= 0x3ffffff; - /* k = 3 */ - lo = Math.imul(al3, bl0); - mid = Math.imul(al3, bh0); - mid += Math.imul(ah3, bl0); - hi = Math.imul(ah3, bh0); - lo += Math.imul(al2, bl1); - mid += Math.imul(al2, bh1); - mid += Math.imul(ah2, bl1); - hi += Math.imul(ah2, bh1); - lo += Math.imul(al1, bl2); - mid += Math.imul(al1, bh2); - mid += Math.imul(ah1, bl2); - hi += Math.imul(ah1, bh2); - lo += Math.imul(al0, bl3); - mid += Math.imul(al0, bh3); - mid += Math.imul(ah0, bl3); - hi += Math.imul(ah0, bh3); - var w3 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w3 >>> 26); - w3 &= 0x3ffffff; - /* k = 4 */ - lo = Math.imul(al4, bl0); - mid = Math.imul(al4, bh0); - mid += Math.imul(ah4, bl0); - hi = Math.imul(ah4, bh0); - lo += Math.imul(al3, bl1); - mid += Math.imul(al3, bh1); - mid += Math.imul(ah3, bl1); - hi += Math.imul(ah3, bh1); - lo += Math.imul(al2, bl2); - mid += Math.imul(al2, bh2); - mid += Math.imul(ah2, bl2); - hi += Math.imul(ah2, bh2); - lo += Math.imul(al1, bl3); - mid += Math.imul(al1, bh3); - mid += Math.imul(ah1, bl3); - hi += Math.imul(ah1, bh3); - lo += Math.imul(al0, bl4); - mid += Math.imul(al0, bh4); - mid += Math.imul(ah0, bl4); - hi += Math.imul(ah0, bh4); - var w4 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w4 >>> 26); - w4 &= 0x3ffffff; - /* k = 5 */ - lo = Math.imul(al5, bl0); - mid = Math.imul(al5, bh0); - mid += Math.imul(ah5, bl0); - hi = Math.imul(ah5, bh0); - lo += Math.imul(al4, bl1); - mid += Math.imul(al4, bh1); - mid += Math.imul(ah4, bl1); - hi += Math.imul(ah4, bh1); - lo += Math.imul(al3, bl2); - mid += Math.imul(al3, bh2); - mid += Math.imul(ah3, bl2); - hi += Math.imul(ah3, bh2); - lo += Math.imul(al2, bl3); - mid += Math.imul(al2, bh3); - mid += Math.imul(ah2, bl3); - hi += Math.imul(ah2, bh3); - lo += Math.imul(al1, bl4); - mid += Math.imul(al1, bh4); - mid += Math.imul(ah1, bl4); - hi += Math.imul(ah1, bh4); - lo += Math.imul(al0, bl5); - mid += Math.imul(al0, bh5); - mid += Math.imul(ah0, bl5); - hi += Math.imul(ah0, bh5); - var w5 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w5 >>> 26); - w5 &= 0x3ffffff; - /* k = 6 */ - lo = Math.imul(al6, bl0); - mid = Math.imul(al6, bh0); - mid += Math.imul(ah6, bl0); - hi = Math.imul(ah6, bh0); - lo += Math.imul(al5, bl1); - mid += Math.imul(al5, bh1); - mid += Math.imul(ah5, bl1); - hi += Math.imul(ah5, bh1); - lo += Math.imul(al4, bl2); - mid += Math.imul(al4, bh2); - mid += Math.imul(ah4, bl2); - hi += Math.imul(ah4, bh2); - lo += Math.imul(al3, bl3); - mid += Math.imul(al3, bh3); - mid += Math.imul(ah3, bl3); - hi += Math.imul(ah3, bh3); - lo += Math.imul(al2, bl4); - mid += Math.imul(al2, bh4); - mid += Math.imul(ah2, bl4); - hi += Math.imul(ah2, bh4); - lo += Math.imul(al1, bl5); - mid += Math.imul(al1, bh5); - mid += Math.imul(ah1, bl5); - hi += Math.imul(ah1, bh5); - lo += Math.imul(al0, bl6); - mid += Math.imul(al0, bh6); - mid += Math.imul(ah0, bl6); - hi += Math.imul(ah0, bh6); - var w6 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w6 >>> 26); - w6 &= 0x3ffffff; - /* k = 7 */ - lo = Math.imul(al7, bl0); - mid = Math.imul(al7, bh0); - mid += Math.imul(ah7, bl0); - hi = Math.imul(ah7, bh0); - lo += Math.imul(al6, bl1); - mid += Math.imul(al6, bh1); - mid += Math.imul(ah6, bl1); - hi += Math.imul(ah6, bh1); - lo += Math.imul(al5, bl2); - mid += Math.imul(al5, bh2); - mid += Math.imul(ah5, bl2); - hi += Math.imul(ah5, bh2); - lo += Math.imul(al4, bl3); - mid += Math.imul(al4, bh3); - mid += Math.imul(ah4, bl3); - hi += Math.imul(ah4, bh3); - lo += Math.imul(al3, bl4); - mid += Math.imul(al3, bh4); - mid += Math.imul(ah3, bl4); - hi += Math.imul(ah3, bh4); - lo += Math.imul(al2, bl5); - mid += Math.imul(al2, bh5); - mid += Math.imul(ah2, bl5); - hi += Math.imul(ah2, bh5); - lo += Math.imul(al1, bl6); - mid += Math.imul(al1, bh6); - mid += Math.imul(ah1, bl6); - hi += Math.imul(ah1, bh6); - lo += Math.imul(al0, bl7); - mid += Math.imul(al0, bh7); - mid += Math.imul(ah0, bl7); - hi += Math.imul(ah0, bh7); - var w7 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w7 >>> 26); - w7 &= 0x3ffffff; - /* k = 8 */ - lo = Math.imul(al8, bl0); - mid = Math.imul(al8, bh0); - mid += Math.imul(ah8, bl0); - hi = Math.imul(ah8, bh0); - lo += Math.imul(al7, bl1); - mid += Math.imul(al7, bh1); - mid += Math.imul(ah7, bl1); - hi += Math.imul(ah7, bh1); - lo += Math.imul(al6, bl2); - mid += Math.imul(al6, bh2); - mid += Math.imul(ah6, bl2); - hi += Math.imul(ah6, bh2); - lo += Math.imul(al5, bl3); - mid += Math.imul(al5, bh3); - mid += Math.imul(ah5, bl3); - hi += Math.imul(ah5, bh3); - lo += Math.imul(al4, bl4); - mid += Math.imul(al4, bh4); - mid += Math.imul(ah4, bl4); - hi += Math.imul(ah4, bh4); - lo += Math.imul(al3, bl5); - mid += Math.imul(al3, bh5); - mid += Math.imul(ah3, bl5); - hi += Math.imul(ah3, bh5); - lo += Math.imul(al2, bl6); - mid += Math.imul(al2, bh6); - mid += Math.imul(ah2, bl6); - hi += Math.imul(ah2, bh6); - lo += Math.imul(al1, bl7); - mid += Math.imul(al1, bh7); - mid += Math.imul(ah1, bl7); - hi += Math.imul(ah1, bh7); - lo += Math.imul(al0, bl8); - mid += Math.imul(al0, bh8); - mid += Math.imul(ah0, bl8); - hi += Math.imul(ah0, bh8); - var w8 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w8 >>> 26); - w8 &= 0x3ffffff; - /* k = 9 */ - lo = Math.imul(al9, bl0); - mid = Math.imul(al9, bh0); - mid += Math.imul(ah9, bl0); - hi = Math.imul(ah9, bh0); - lo += Math.imul(al8, bl1); - mid += Math.imul(al8, bh1); - mid += Math.imul(ah8, bl1); - hi += Math.imul(ah8, bh1); - lo += Math.imul(al7, bl2); - mid += Math.imul(al7, bh2); - mid += Math.imul(ah7, bl2); - hi += Math.imul(ah7, bh2); - lo += Math.imul(al6, bl3); - mid += Math.imul(al6, bh3); - mid += Math.imul(ah6, bl3); - hi += Math.imul(ah6, bh3); - lo += Math.imul(al5, bl4); - mid += Math.imul(al5, bh4); - mid += Math.imul(ah5, bl4); - hi += Math.imul(ah5, bh4); - lo += Math.imul(al4, bl5); - mid += Math.imul(al4, bh5); - mid += Math.imul(ah4, bl5); - hi += Math.imul(ah4, bh5); - lo += Math.imul(al3, bl6); - mid += Math.imul(al3, bh6); - mid += Math.imul(ah3, bl6); - hi += Math.imul(ah3, bh6); - lo += Math.imul(al2, bl7); - mid += Math.imul(al2, bh7); - mid += Math.imul(ah2, bl7); - hi += Math.imul(ah2, bh7); - lo += Math.imul(al1, bl8); - mid += Math.imul(al1, bh8); - mid += Math.imul(ah1, bl8); - hi += Math.imul(ah1, bh8); - lo += Math.imul(al0, bl9); - mid += Math.imul(al0, bh9); - mid += Math.imul(ah0, bl9); - hi += Math.imul(ah0, bh9); - var w9 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w9 >>> 26); - w9 &= 0x3ffffff; - /* k = 10 */ - lo = Math.imul(al9, bl1); - mid = Math.imul(al9, bh1); - mid += Math.imul(ah9, bl1); - hi = Math.imul(ah9, bh1); - lo += Math.imul(al8, bl2); - mid += Math.imul(al8, bh2); - mid += Math.imul(ah8, bl2); - hi += Math.imul(ah8, bh2); - lo += Math.imul(al7, bl3); - mid += Math.imul(al7, bh3); - mid += Math.imul(ah7, bl3); - hi += Math.imul(ah7, bh3); - lo += Math.imul(al6, bl4); - mid += Math.imul(al6, bh4); - mid += Math.imul(ah6, bl4); - hi += Math.imul(ah6, bh4); - lo += Math.imul(al5, bl5); - mid += Math.imul(al5, bh5); - mid += Math.imul(ah5, bl5); - hi += Math.imul(ah5, bh5); - lo += Math.imul(al4, bl6); - mid += Math.imul(al4, bh6); - mid += Math.imul(ah4, bl6); - hi += Math.imul(ah4, bh6); - lo += Math.imul(al3, bl7); - mid += Math.imul(al3, bh7); - mid += Math.imul(ah3, bl7); - hi += Math.imul(ah3, bh7); - lo += Math.imul(al2, bl8); - mid += Math.imul(al2, bh8); - mid += Math.imul(ah2, bl8); - hi += Math.imul(ah2, bh8); - lo += Math.imul(al1, bl9); - mid += Math.imul(al1, bh9); - mid += Math.imul(ah1, bl9); - hi += Math.imul(ah1, bh9); - var w10 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w10 >>> 26); - w10 &= 0x3ffffff; - /* k = 11 */ - lo = Math.imul(al9, bl2); - mid = Math.imul(al9, bh2); - mid += Math.imul(ah9, bl2); - hi = Math.imul(ah9, bh2); - lo += Math.imul(al8, bl3); - mid += Math.imul(al8, bh3); - mid += Math.imul(ah8, bl3); - hi += Math.imul(ah8, bh3); - lo += Math.imul(al7, bl4); - mid += Math.imul(al7, bh4); - mid += Math.imul(ah7, bl4); - hi += Math.imul(ah7, bh4); - lo += Math.imul(al6, bl5); - mid += Math.imul(al6, bh5); - mid += Math.imul(ah6, bl5); - hi += Math.imul(ah6, bh5); - lo += Math.imul(al5, bl6); - mid += Math.imul(al5, bh6); - mid += Math.imul(ah5, bl6); - hi += Math.imul(ah5, bh6); - lo += Math.imul(al4, bl7); - mid += Math.imul(al4, bh7); - mid += Math.imul(ah4, bl7); - hi += Math.imul(ah4, bh7); - lo += Math.imul(al3, bl8); - mid += Math.imul(al3, bh8); - mid += Math.imul(ah3, bl8); - hi += Math.imul(ah3, bh8); - lo += Math.imul(al2, bl9); - mid += Math.imul(al2, bh9); - mid += Math.imul(ah2, bl9); - hi += Math.imul(ah2, bh9); - var w11 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w11 >>> 26); - w11 &= 0x3ffffff; - /* k = 12 */ - lo = Math.imul(al9, bl3); - mid = Math.imul(al9, bh3); - mid += Math.imul(ah9, bl3); - hi = Math.imul(ah9, bh3); - lo += Math.imul(al8, bl4); - mid += Math.imul(al8, bh4); - mid += Math.imul(ah8, bl4); - hi += Math.imul(ah8, bh4); - lo += Math.imul(al7, bl5); - mid += Math.imul(al7, bh5); - mid += Math.imul(ah7, bl5); - hi += Math.imul(ah7, bh5); - lo += Math.imul(al6, bl6); - mid += Math.imul(al6, bh6); - mid += Math.imul(ah6, bl6); - hi += Math.imul(ah6, bh6); - lo += Math.imul(al5, bl7); - mid += Math.imul(al5, bh7); - mid += Math.imul(ah5, bl7); - hi += Math.imul(ah5, bh7); - lo += Math.imul(al4, bl8); - mid += Math.imul(al4, bh8); - mid += Math.imul(ah4, bl8); - hi += Math.imul(ah4, bh8); - lo += Math.imul(al3, bl9); - mid += Math.imul(al3, bh9); - mid += Math.imul(ah3, bl9); - hi += Math.imul(ah3, bh9); - var w12 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w12 >>> 26); - w12 &= 0x3ffffff; - /* k = 13 */ - lo = Math.imul(al9, bl4); - mid = Math.imul(al9, bh4); - mid += Math.imul(ah9, bl4); - hi = Math.imul(ah9, bh4); - lo += Math.imul(al8, bl5); - mid += Math.imul(al8, bh5); - mid += Math.imul(ah8, bl5); - hi += Math.imul(ah8, bh5); - lo += Math.imul(al7, bl6); - mid += Math.imul(al7, bh6); - mid += Math.imul(ah7, bl6); - hi += Math.imul(ah7, bh6); - lo += Math.imul(al6, bl7); - mid += Math.imul(al6, bh7); - mid += Math.imul(ah6, bl7); - hi += Math.imul(ah6, bh7); - lo += Math.imul(al5, bl8); - mid += Math.imul(al5, bh8); - mid += Math.imul(ah5, bl8); - hi += Math.imul(ah5, bh8); - lo += Math.imul(al4, bl9); - mid += Math.imul(al4, bh9); - mid += Math.imul(ah4, bl9); - hi += Math.imul(ah4, bh9); - var w13 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w13 >>> 26); - w13 &= 0x3ffffff; - /* k = 14 */ - lo = Math.imul(al9, bl5); - mid = Math.imul(al9, bh5); - mid += Math.imul(ah9, bl5); - hi = Math.imul(ah9, bh5); - lo += Math.imul(al8, bl6); - mid += Math.imul(al8, bh6); - mid += Math.imul(ah8, bl6); - hi += Math.imul(ah8, bh6); - lo += Math.imul(al7, bl7); - mid += Math.imul(al7, bh7); - mid += Math.imul(ah7, bl7); - hi += Math.imul(ah7, bh7); - lo += Math.imul(al6, bl8); - mid += Math.imul(al6, bh8); - mid += Math.imul(ah6, bl8); - hi += Math.imul(ah6, bh8); - lo += Math.imul(al5, bl9); - mid += Math.imul(al5, bh9); - mid += Math.imul(ah5, bl9); - hi += Math.imul(ah5, bh9); - var w14 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w14 >>> 26); - w14 &= 0x3ffffff; - /* k = 15 */ - lo = Math.imul(al9, bl6); - mid = Math.imul(al9, bh6); - mid += Math.imul(ah9, bl6); - hi = Math.imul(ah9, bh6); - lo += Math.imul(al8, bl7); - mid += Math.imul(al8, bh7); - mid += Math.imul(ah8, bl7); - hi += Math.imul(ah8, bh7); - lo += Math.imul(al7, bl8); - mid += Math.imul(al7, bh8); - mid += Math.imul(ah7, bl8); - hi += Math.imul(ah7, bh8); - lo += Math.imul(al6, bl9); - mid += Math.imul(al6, bh9); - mid += Math.imul(ah6, bl9); - hi += Math.imul(ah6, bh9); - var w15 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w15 >>> 26); - w15 &= 0x3ffffff; - /* k = 16 */ - lo = Math.imul(al9, bl7); - mid = Math.imul(al9, bh7); - mid += Math.imul(ah9, bl7); - hi = Math.imul(ah9, bh7); - lo += Math.imul(al8, bl8); - mid += Math.imul(al8, bh8); - mid += Math.imul(ah8, bl8); - hi += Math.imul(ah8, bh8); - lo += Math.imul(al7, bl9); - mid += Math.imul(al7, bh9); - mid += Math.imul(ah7, bl9); - hi += Math.imul(ah7, bh9); - var w16 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w16 >>> 26); - w16 &= 0x3ffffff; - /* k = 17 */ - lo = Math.imul(al9, bl8); - mid = Math.imul(al9, bh8); - mid += Math.imul(ah9, bl8); - hi = Math.imul(ah9, bh8); - lo += Math.imul(al8, bl9); - mid += Math.imul(al8, bh9); - mid += Math.imul(ah8, bl9); - hi += Math.imul(ah8, bh9); - var w17 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w17 >>> 26); - w17 &= 0x3ffffff; - /* k = 18 */ - lo = Math.imul(al9, bl9); - mid = Math.imul(al9, bh9); - mid += Math.imul(ah9, bl9); - hi = Math.imul(ah9, bh9); - var w18 = c + lo + ((mid & 0x1fff) << 13); - c = hi + (mid >>> 13) + (w18 >>> 26); - w18 &= 0x3ffffff; - o[0] = w0; - o[1] = w1; - o[2] = w2; - o[3] = w3; - o[4] = w4; - o[5] = w5; - o[6] = w6; - o[7] = w7; - o[8] = w8; - o[9] = w9; - o[10] = w10; - o[11] = w11; - o[12] = w12; - o[13] = w13; - o[14] = w14; - o[15] = w15; - o[16] = w16; - o[17] = w17; - o[18] = w18; - if (c !== 0) { - o[19] = c; - out.length++; - } - return out; - }; - - // Polyfill comb - if (!Math.imul) { - comb10MulTo = smallMulTo; - } - - function bigMulTo (self, num, out) { - out.negative = num.negative ^ self.negative; - out.length = self.length + num.length; - - var carry = 0; - var hncarry = 0; - for (var k = 0; k < out.length - 1; k++) { - // Sum all words with the same `i + j = k` and accumulate `ncarry`, - // note that ncarry could be >= 0x3ffffff - var ncarry = hncarry; - hncarry = 0; - var rword = carry & 0x3ffffff; - var maxJ = Math.min(k, num.length - 1); - for (var j = Math.max(0, k - self.length + 1); j <= maxJ; j++) { - var i = k - j; - var a = self.words[i] | 0; - var b = num.words[j] | 0; - var r = a * b; - - var lo = r & 0x3ffffff; - ncarry = (ncarry + ((r / 0x4000000) | 0)) | 0; - lo = (lo + rword) | 0; - rword = lo & 0x3ffffff; - ncarry = (ncarry + (lo >>> 26)) | 0; - - hncarry += ncarry >>> 26; - ncarry &= 0x3ffffff; - } - out.words[k] = rword; - carry = ncarry; - ncarry = hncarry; - } - if (carry !== 0) { - out.words[k] = carry; - } else { - out.length--; - } - - return out.strip(); - } - - function jumboMulTo (self, num, out) { - var fftm = new FFTM(); - return fftm.mulp(self, num, out); - } - - BN.prototype.mulTo = function mulTo (num, out) { - var res; - var len = this.length + num.length; - if (this.length === 10 && num.length === 10) { - res = comb10MulTo(this, num, out); - } else if (len < 63) { - res = smallMulTo(this, num, out); - } else if (len < 1024) { - res = bigMulTo(this, num, out); - } else { - res = jumboMulTo(this, num, out); - } - - return res; - }; - - // Cooley-Tukey algorithm for FFT - // slightly revisited to rely on looping instead of recursion - - function FFTM (x, y) { - this.x = x; - this.y = y; - } - - FFTM.prototype.makeRBT = function makeRBT (N) { - var t = new Array(N); - var l = BN.prototype._countBits(N) - 1; - for (var i = 0; i < N; i++) { - t[i] = this.revBin(i, l, N); - } - - return t; - }; - - // Returns binary-reversed representation of `x` - FFTM.prototype.revBin = function revBin (x, l, N) { - if (x === 0 || x === N - 1) return x; - - var rb = 0; - for (var i = 0; i < l; i++) { - rb |= (x & 1) << (l - i - 1); - x >>= 1; - } - - return rb; - }; - - // Performs "tweedling" phase, therefore 'emulating' - // behaviour of the recursive algorithm - FFTM.prototype.permute = function permute (rbt, rws, iws, rtws, itws, N) { - for (var i = 0; i < N; i++) { - rtws[i] = rws[rbt[i]]; - itws[i] = iws[rbt[i]]; - } - }; - - FFTM.prototype.transform = function transform (rws, iws, rtws, itws, N, rbt) { - this.permute(rbt, rws, iws, rtws, itws, N); - - for (var s = 1; s < N; s <<= 1) { - var l = s << 1; - - var rtwdf = Math.cos(2 * Math.PI / l); - var itwdf = Math.sin(2 * Math.PI / l); - - for (var p = 0; p < N; p += l) { - var rtwdf_ = rtwdf; - var itwdf_ = itwdf; - - for (var j = 0; j < s; j++) { - var re = rtws[p + j]; - var ie = itws[p + j]; - - var ro = rtws[p + j + s]; - var io = itws[p + j + s]; - - var rx = rtwdf_ * ro - itwdf_ * io; - - io = rtwdf_ * io + itwdf_ * ro; - ro = rx; - - rtws[p + j] = re + ro; - itws[p + j] = ie + io; - - rtws[p + j + s] = re - ro; - itws[p + j + s] = ie - io; - - /* jshint maxdepth : false */ - if (j !== l) { - rx = rtwdf * rtwdf_ - itwdf * itwdf_; - - itwdf_ = rtwdf * itwdf_ + itwdf * rtwdf_; - rtwdf_ = rx; - } - } - } - } - }; - - FFTM.prototype.guessLen13b = function guessLen13b (n, m) { - var N = Math.max(m, n) | 1; - var odd = N & 1; - var i = 0; - for (N = N / 2 | 0; N; N = N >>> 1) { - i++; - } - - return 1 << i + 1 + odd; - }; - - FFTM.prototype.conjugate = function conjugate (rws, iws, N) { - if (N <= 1) return; - - for (var i = 0; i < N / 2; i++) { - var t = rws[i]; - - rws[i] = rws[N - i - 1]; - rws[N - i - 1] = t; - - t = iws[i]; - - iws[i] = -iws[N - i - 1]; - iws[N - i - 1] = -t; - } - }; - - FFTM.prototype.normalize13b = function normalize13b (ws, N) { - var carry = 0; - for (var i = 0; i < N / 2; i++) { - var w = Math.round(ws[2 * i + 1] / N) * 0x2000 + - Math.round(ws[2 * i] / N) + - carry; - - ws[i] = w & 0x3ffffff; - - if (w < 0x4000000) { - carry = 0; - } else { - carry = w / 0x4000000 | 0; - } - } - - return ws; - }; - - FFTM.prototype.convert13b = function convert13b (ws, len, rws, N) { - var carry = 0; - for (var i = 0; i < len; i++) { - carry = carry + (ws[i] | 0); - - rws[2 * i] = carry & 0x1fff; carry = carry >>> 13; - rws[2 * i + 1] = carry & 0x1fff; carry = carry >>> 13; - } - - // Pad with zeroes - for (i = 2 * len; i < N; ++i) { - rws[i] = 0; - } - - assert(carry === 0); - assert((carry & ~0x1fff) === 0); - }; - - FFTM.prototype.stub = function stub (N) { - var ph = new Array(N); - for (var i = 0; i < N; i++) { - ph[i] = 0; - } - - return ph; - }; - - FFTM.prototype.mulp = function mulp (x, y, out) { - var N = 2 * this.guessLen13b(x.length, y.length); - - var rbt = this.makeRBT(N); - - var _ = this.stub(N); - - var rws = new Array(N); - var rwst = new Array(N); - var iwst = new Array(N); - - var nrws = new Array(N); - var nrwst = new Array(N); - var niwst = new Array(N); - - var rmws = out.words; - rmws.length = N; - - this.convert13b(x.words, x.length, rws, N); - this.convert13b(y.words, y.length, nrws, N); - - this.transform(rws, _, rwst, iwst, N, rbt); - this.transform(nrws, _, nrwst, niwst, N, rbt); - - for (var i = 0; i < N; i++) { - var rx = rwst[i] * nrwst[i] - iwst[i] * niwst[i]; - iwst[i] = rwst[i] * niwst[i] + iwst[i] * nrwst[i]; - rwst[i] = rx; - } - - this.conjugate(rwst, iwst, N); - this.transform(rwst, iwst, rmws, _, N, rbt); - this.conjugate(rmws, _, N); - this.normalize13b(rmws, N); - - out.negative = x.negative ^ y.negative; - out.length = x.length + y.length; - return out.strip(); - }; - - // Multiply `this` by `num` - BN.prototype.mul = function mul (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return this.mulTo(num, out); - }; - - // Multiply employing FFT - BN.prototype.mulf = function mulf (num) { - var out = new BN(null); - out.words = new Array(this.length + num.length); - return jumboMulTo(this, num, out); - }; - - // In-place Multiplication - BN.prototype.imul = function imul (num) { - return this.clone().mulTo(num, this); - }; - - BN.prototype.imuln = function imuln (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - - // Carry - var carry = 0; - for (var i = 0; i < this.length; i++) { - var w = (this.words[i] | 0) * num; - var lo = (w & 0x3ffffff) + (carry & 0x3ffffff); - carry >>= 26; - carry += (w / 0x4000000) | 0; - // NOTE: lo is 27bit maximum - carry += lo >>> 26; - this.words[i] = lo & 0x3ffffff; - } - - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - - return this; - }; - - BN.prototype.muln = function muln (num) { - return this.clone().imuln(num); - }; - - // `this` * `this` - BN.prototype.sqr = function sqr () { - return this.mul(this); - }; - - // `this` * `this` in-place - BN.prototype.isqr = function isqr () { - return this.imul(this.clone()); - }; - - // Math.pow(`this`, `num`) - BN.prototype.pow = function pow (num) { - var w = toBitArray(num); - if (w.length === 0) return new BN(1); - - // Skip leading zeroes - var res = this; - for (var i = 0; i < w.length; i++, res = res.sqr()) { - if (w[i] !== 0) break; - } - - if (++i < w.length) { - for (var q = res.sqr(); i < w.length; i++, q = q.sqr()) { - if (w[i] === 0) continue; - - res = res.mul(q); - } - } - - return res; - }; - - // Shift-left in-place - BN.prototype.iushln = function iushln (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - var carryMask = (0x3ffffff >>> (26 - r)) << (26 - r); - var i; - - if (r !== 0) { - var carry = 0; - - for (i = 0; i < this.length; i++) { - var newCarry = this.words[i] & carryMask; - var c = ((this.words[i] | 0) - newCarry) << r; - this.words[i] = c | carry; - carry = newCarry >>> (26 - r); - } - - if (carry) { - this.words[i] = carry; - this.length++; - } - } - - if (s !== 0) { - for (i = this.length - 1; i >= 0; i--) { - this.words[i + s] = this.words[i]; - } - - for (i = 0; i < s; i++) { - this.words[i] = 0; - } - - this.length += s; - } - - return this.strip(); - }; - - BN.prototype.ishln = function ishln (bits) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushln(bits); - }; - - // Shift-right in-place - // NOTE: `hint` is a lowest bit before trailing zeroes - // NOTE: if `extended` is present - it will be filled with destroyed bits - BN.prototype.iushrn = function iushrn (bits, hint, extended) { - assert(typeof bits === 'number' && bits >= 0); - var h; - if (hint) { - h = (hint - (hint % 26)) / 26; - } else { - h = 0; - } - - var r = bits % 26; - var s = Math.min((bits - r) / 26, this.length); - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - var maskedWords = extended; - - h -= s; - h = Math.max(0, h); - - // Extended mode, copy masked part - if (maskedWords) { - for (var i = 0; i < s; i++) { - maskedWords.words[i] = this.words[i]; - } - maskedWords.length = s; - } - - if (s === 0) { - // No-op, we should not move anything at all - } else if (this.length > s) { - this.length -= s; - for (i = 0; i < this.length; i++) { - this.words[i] = this.words[i + s]; - } - } else { - this.words[0] = 0; - this.length = 1; - } - - var carry = 0; - for (i = this.length - 1; i >= 0 && (carry !== 0 || i >= h); i--) { - var word = this.words[i] | 0; - this.words[i] = (carry << (26 - r)) | (word >>> r); - carry = word & mask; - } - - // Push carried bits as a mask - if (maskedWords && carry !== 0) { - maskedWords.words[maskedWords.length++] = carry; - } - - if (this.length === 0) { - this.words[0] = 0; - this.length = 1; - } - - return this.strip(); - }; - - BN.prototype.ishrn = function ishrn (bits, hint, extended) { - // TODO(indutny): implement me - assert(this.negative === 0); - return this.iushrn(bits, hint, extended); - }; - - // Shift-left - BN.prototype.shln = function shln (bits) { - return this.clone().ishln(bits); - }; - - BN.prototype.ushln = function ushln (bits) { - return this.clone().iushln(bits); - }; - - // Shift-right - BN.prototype.shrn = function shrn (bits) { - return this.clone().ishrn(bits); - }; - - BN.prototype.ushrn = function ushrn (bits) { - return this.clone().iushrn(bits); - }; - - // Test if n bit is set - BN.prototype.testn = function testn (bit) { - assert(typeof bit === 'number' && bit >= 0); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) return false; - - // Check bit and return - var w = this.words[s]; - - return !!(w & q); - }; - - // Return only lowers bits of number (in-place) - BN.prototype.imaskn = function imaskn (bits) { - assert(typeof bits === 'number' && bits >= 0); - var r = bits % 26; - var s = (bits - r) / 26; - - assert(this.negative === 0, 'imaskn works only with positive numbers'); - - if (r !== 0) { - s++; - } - this.length = Math.min(s, this.length); - - if (r !== 0) { - var mask = 0x3ffffff ^ ((0x3ffffff >>> r) << r); - this.words[this.length - 1] &= mask; - } - - return this.strip(); - }; - - // Return only lowers bits of number - BN.prototype.maskn = function maskn (bits) { - return this.clone().imaskn(bits); - }; - - // Add plain number `num` to `this` - BN.prototype.iaddn = function iaddn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.isubn(-num); - - // Possible sign change - if (this.negative !== 0) { - if (this.length === 1 && (this.words[0] | 0) < num) { - this.words[0] = num - (this.words[0] | 0); - this.negative = 0; - return this; - } - - this.negative = 0; - this.isubn(num); - this.negative = 1; - return this; - } - - // Add without checks - return this._iaddn(num); - }; - - BN.prototype._iaddn = function _iaddn (num) { - this.words[0] += num; - - // Carry - for (var i = 0; i < this.length && this.words[i] >= 0x4000000; i++) { - this.words[i] -= 0x4000000; - if (i === this.length - 1) { - this.words[i + 1] = 1; - } else { - this.words[i + 1]++; - } - } - this.length = Math.max(this.length, i + 1); - - return this; - }; - - // Subtract plain number `num` from `this` - BN.prototype.isubn = function isubn (num) { - assert(typeof num === 'number'); - assert(num < 0x4000000); - if (num < 0) return this.iaddn(-num); - - if (this.negative !== 0) { - this.negative = 0; - this.iaddn(num); - this.negative = 1; - return this; - } - - this.words[0] -= num; - - if (this.length === 1 && this.words[0] < 0) { - this.words[0] = -this.words[0]; - this.negative = 1; - } else { - // Carry - for (var i = 0; i < this.length && this.words[i] < 0; i++) { - this.words[i] += 0x4000000; - this.words[i + 1] -= 1; - } - } - - return this.strip(); - }; - - BN.prototype.addn = function addn (num) { - return this.clone().iaddn(num); - }; - - BN.prototype.subn = function subn (num) { - return this.clone().isubn(num); - }; - - BN.prototype.iabs = function iabs () { - this.negative = 0; - - return this; - }; - - BN.prototype.abs = function abs () { - return this.clone().iabs(); - }; - - BN.prototype._ishlnsubmul = function _ishlnsubmul (num, mul, shift) { - // Bigger storage is needed - var len = num.length + shift; - var i; - if (this.words.length < len) { - var t = new Array(len); - for (i = 0; i < this.length; i++) { - t[i] = this.words[i]; - } - this.words = t; - } else { - i = this.length; - } - - // Zeroify rest - this.length = Math.max(this.length, len); - for (; i < this.length; i++) { - this.words[i] = 0; - } - - var w; - var carry = 0; - for (i = 0; i < num.length; i++) { - w = (this.words[i + shift] | 0) + carry; - var right = (num.words[i] | 0) * mul; - w -= right & 0x3ffffff; - carry = (w >> 26) - ((right / 0x4000000) | 0); - this.words[i + shift] = w & 0x3ffffff; - } - for (; i < this.length - shift; i++) { - w = (this.words[i + shift] | 0) + carry; - carry = w >> 26; - this.words[i + shift] = w & 0x3ffffff; - } - - if (carry === 0) return this.strip(); - - // Subtraction overflow - assert(carry === -1); - carry = 0; - for (i = 0; i < this.length; i++) { - w = -(this.words[i] | 0) + carry; - carry = w >> 26; - this.words[i] = w & 0x3ffffff; - } - this.negative = 1; - - return this.strip(); - }; - - BN.prototype._wordDiv = function _wordDiv (num, mode) { - var shift = this.length - num.length; - - var a = this.clone(); - var b = num; - - // Normalize - var bhi = b.words[b.length - 1] | 0; - var bhiBits = this._countBits(bhi); - shift = 26 - bhiBits; - if (shift !== 0) { - b = b.ushln(shift); - a.iushln(shift); - bhi = b.words[b.length - 1] | 0; - } - - // Initialize quotient - var m = a.length - b.length; - var q; - - if (mode !== 'mod') { - q = new BN(null); - q.length = m + 1; - q.words = new Array(q.length); - for (var i = 0; i < q.length; i++) { - q.words[i] = 0; - } - } - - var diff = a.clone()._ishlnsubmul(b, 1, m); - if (diff.negative === 0) { - a = diff; - if (q) { - q.words[m] = 1; - } - } - - for (var j = m - 1; j >= 0; j--) { - var qj = (a.words[b.length + j] | 0) * 0x4000000 + - (a.words[b.length + j - 1] | 0); - - // NOTE: (qj / bhi) is (0x3ffffff * 0x4000000 + 0x3ffffff) / 0x2000000 max - // (0x7ffffff) - qj = Math.min((qj / bhi) | 0, 0x3ffffff); - - a._ishlnsubmul(b, qj, j); - while (a.negative !== 0) { - qj--; - a.negative = 0; - a._ishlnsubmul(b, 1, j); - if (!a.isZero()) { - a.negative ^= 1; - } - } - if (q) { - q.words[j] = qj; - } - } - if (q) { - q.strip(); - } - a.strip(); - - // Denormalize - if (mode !== 'div' && shift !== 0) { - a.iushrn(shift); - } - - return { - div: q || null, - mod: a - }; - }; - - // NOTE: 1) `mode` can be set to `mod` to request mod only, - // to `div` to request div only, or be absent to - // request both div & mod - // 2) `positive` is true if unsigned mod is requested - BN.prototype.divmod = function divmod (num, mode, positive) { - assert(!num.isZero()); - - if (this.isZero()) { - return { - div: new BN(0), - mod: new BN(0) - }; - } - - var div, mod, res; - if (this.negative !== 0 && num.negative === 0) { - res = this.neg().divmod(num, mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.iadd(num); - } - } - - return { - div: div, - mod: mod - }; - } - - if (this.negative === 0 && num.negative !== 0) { - res = this.divmod(num.neg(), mode); - - if (mode !== 'mod') { - div = res.div.neg(); - } - - return { - div: div, - mod: res.mod - }; - } - - if ((this.negative & num.negative) !== 0) { - res = this.neg().divmod(num.neg(), mode); - - if (mode !== 'div') { - mod = res.mod.neg(); - if (positive && mod.negative !== 0) { - mod.isub(num); - } - } - - return { - div: res.div, - mod: mod - }; - } - - // Both numbers are positive at this point - - // Strip both numbers to approximate shift value - if (num.length > this.length || this.cmp(num) < 0) { - return { - div: new BN(0), - mod: this - }; - } - - // Very short reduction - if (num.length === 1) { - if (mode === 'div') { - return { - div: this.divn(num.words[0]), - mod: null - }; - } - - if (mode === 'mod') { - return { - div: null, - mod: new BN(this.modn(num.words[0])) - }; - } - - return { - div: this.divn(num.words[0]), - mod: new BN(this.modn(num.words[0])) - }; - } - - return this._wordDiv(num, mode); - }; - - // Find `this` / `num` - BN.prototype.div = function div (num) { - return this.divmod(num, 'div', false).div; - }; - - // Find `this` % `num` - BN.prototype.mod = function mod (num) { - return this.divmod(num, 'mod', false).mod; - }; - - BN.prototype.umod = function umod (num) { - return this.divmod(num, 'mod', true).mod; - }; - - // Find Round(`this` / `num`) - BN.prototype.divRound = function divRound (num) { - var dm = this.divmod(num); - - // Fast case - exact division - if (dm.mod.isZero()) return dm.div; - - var mod = dm.div.negative !== 0 ? dm.mod.isub(num) : dm.mod; - - var half = num.ushrn(1); - var r2 = num.andln(1); - var cmp = mod.cmp(half); - - // Round down - if (cmp < 0 || r2 === 1 && cmp === 0) return dm.div; - - // Round up - return dm.div.negative !== 0 ? dm.div.isubn(1) : dm.div.iaddn(1); - }; - - BN.prototype.modn = function modn (num) { - assert(num <= 0x3ffffff); - var p = (1 << 26) % num; - - var acc = 0; - for (var i = this.length - 1; i >= 0; i--) { - acc = (p * acc + (this.words[i] | 0)) % num; - } - - return acc; - }; - - // In-place division by number - BN.prototype.idivn = function idivn (num) { - assert(num <= 0x3ffffff); - - var carry = 0; - for (var i = this.length - 1; i >= 0; i--) { - var w = (this.words[i] | 0) + carry * 0x4000000; - this.words[i] = (w / num) | 0; - carry = w % num; - } - - return this.strip(); - }; - - BN.prototype.divn = function divn (num) { - return this.clone().idivn(num); - }; - - BN.prototype.egcd = function egcd (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var x = this; - var y = p.clone(); - - if (x.negative !== 0) { - x = x.umod(p); - } else { - x = x.clone(); - } - - // A * x + B * y = x - var A = new BN(1); - var B = new BN(0); - - // C * x + D * y = y - var C = new BN(0); - var D = new BN(1); - - var g = 0; - - while (x.isEven() && y.isEven()) { - x.iushrn(1); - y.iushrn(1); - ++g; - } - - var yp = y.clone(); - var xp = x.clone(); - - while (!x.isZero()) { - for (var i = 0, im = 1; (x.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - x.iushrn(i); - while (i-- > 0) { - if (A.isOdd() || B.isOdd()) { - A.iadd(yp); - B.isub(xp); - } - - A.iushrn(1); - B.iushrn(1); - } - } - - for (var j = 0, jm = 1; (y.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - y.iushrn(j); - while (j-- > 0) { - if (C.isOdd() || D.isOdd()) { - C.iadd(yp); - D.isub(xp); - } - - C.iushrn(1); - D.iushrn(1); - } - } - - if (x.cmp(y) >= 0) { - x.isub(y); - A.isub(C); - B.isub(D); - } else { - y.isub(x); - C.isub(A); - D.isub(B); - } - } - - return { - a: C, - b: D, - gcd: y.iushln(g) - }; - }; - - // This is reduced incarnation of the binary EEA - // above, designated to invert members of the - // _prime_ fields F(p) at a maximal speed - BN.prototype._invmp = function _invmp (p) { - assert(p.negative === 0); - assert(!p.isZero()); - - var a = this; - var b = p.clone(); - - if (a.negative !== 0) { - a = a.umod(p); - } else { - a = a.clone(); - } - - var x1 = new BN(1); - var x2 = new BN(0); - - var delta = b.clone(); - - while (a.cmpn(1) > 0 && b.cmpn(1) > 0) { - for (var i = 0, im = 1; (a.words[0] & im) === 0 && i < 26; ++i, im <<= 1); - if (i > 0) { - a.iushrn(i); - while (i-- > 0) { - if (x1.isOdd()) { - x1.iadd(delta); - } - - x1.iushrn(1); - } - } - - for (var j = 0, jm = 1; (b.words[0] & jm) === 0 && j < 26; ++j, jm <<= 1); - if (j > 0) { - b.iushrn(j); - while (j-- > 0) { - if (x2.isOdd()) { - x2.iadd(delta); - } - - x2.iushrn(1); - } - } - - if (a.cmp(b) >= 0) { - a.isub(b); - x1.isub(x2); - } else { - b.isub(a); - x2.isub(x1); - } - } - - var res; - if (a.cmpn(1) === 0) { - res = x1; - } else { - res = x2; - } - - if (res.cmpn(0) < 0) { - res.iadd(p); - } - - return res; - }; - - BN.prototype.gcd = function gcd (num) { - if (this.isZero()) return num.abs(); - if (num.isZero()) return this.abs(); - - var a = this.clone(); - var b = num.clone(); - a.negative = 0; - b.negative = 0; - - // Remove common factor of two - for (var shift = 0; a.isEven() && b.isEven(); shift++) { - a.iushrn(1); - b.iushrn(1); - } - - do { - while (a.isEven()) { - a.iushrn(1); - } - while (b.isEven()) { - b.iushrn(1); - } - - var r = a.cmp(b); - if (r < 0) { - // Swap `a` and `b` to make `a` always bigger than `b` - var t = a; - a = b; - b = t; - } else if (r === 0 || b.cmpn(1) === 0) { - break; - } - - a.isub(b); - } while (true); - - return b.iushln(shift); - }; - - // Invert number in the field F(num) - BN.prototype.invm = function invm (num) { - return this.egcd(num).a.umod(num); - }; - - BN.prototype.isEven = function isEven () { - return (this.words[0] & 1) === 0; - }; - - BN.prototype.isOdd = function isOdd () { - return (this.words[0] & 1) === 1; - }; - - // And first word and num - BN.prototype.andln = function andln (num) { - return this.words[0] & num; - }; - - // Increment at the bit position in-line - BN.prototype.bincn = function bincn (bit) { - assert(typeof bit === 'number'); - var r = bit % 26; - var s = (bit - r) / 26; - var q = 1 << r; - - // Fast case: bit is much higher than all existing words - if (this.length <= s) { - for (var i = this.length; i < s + 1; i++) { - this.words[i] = 0; - } - this.words[s] |= q; - this.length = s + 1; - return this; - } - - // Add bit and propagate, if needed - var carry = q; - for (i = s; carry !== 0 && i < this.length; i++) { - var w = this.words[i] | 0; - w += carry; - carry = w >>> 26; - w &= 0x3ffffff; - this.words[i] = w; - } - if (carry !== 0) { - this.words[i] = carry; - this.length++; - } - return this; - }; - - BN.prototype.isZero = function isZero () { - return this.length === 1 && this.words[0] === 0; - }; - - BN.prototype.cmpn = function cmpn (num) { - var negative = num < 0; - - if (this.negative !== 0 && !negative) return -1; - if (this.negative === 0 && negative) return 1; - - this.strip(); - - var res; - if (this.length > 1) { - res = 1; - } else { - if (negative) { - num = -num; - } - - assert(num <= 0x3ffffff, 'Number is too big'); - - var w = this.words[0] | 0; - res = w === num ? 0 : w < num ? -1 : 1; - } - if (this.negative !== 0) { - res = -res; - } - return res; - }; - - // Compare two numbers and return: - // 1 - if `this` > `num` - // 0 - if `this` == `num` - // -1 - if `this` < `num` - BN.prototype.cmp = function cmp (num) { - if (this.negative !== 0 && num.negative === 0) return -1; - if (this.negative === 0 && num.negative !== 0) return 1; - - var res = this.ucmp(num); - if (this.negative !== 0) return -res; - - return res; - }; - - // Unsigned comparison - BN.prototype.ucmp = function ucmp (num) { - // At this point both numbers have the same sign - if (this.length > num.length) return 1; - if (this.length < num.length) return -1; - - var res = 0; - for (var i = this.length - 1; i >= 0; i--) { - var a = this.words[i] | 0; - var b = num.words[i] | 0; - - if (a === b) continue; - if (a < b) { - res = -1; - } else if (a > b) { - res = 1; - } - break; - } - return res; - }; - - BN.prototype.gtn = function gtn (num) { - return this.cmpn(num) === 1; - }; - - BN.prototype.gt = function gt (num) { - return this.cmp(num) === 1; - }; - - BN.prototype.gten = function gten (num) { - return this.cmpn(num) >= 0; - }; - - BN.prototype.gte = function gte (num) { - return this.cmp(num) >= 0; - }; - - BN.prototype.ltn = function ltn (num) { - return this.cmpn(num) === -1; - }; - - BN.prototype.lt = function lt (num) { - return this.cmp(num) === -1; - }; - - BN.prototype.lten = function lten (num) { - return this.cmpn(num) <= 0; - }; - - BN.prototype.lte = function lte (num) { - return this.cmp(num) <= 0; - }; - - BN.prototype.eqn = function eqn (num) { - return this.cmpn(num) === 0; - }; - - BN.prototype.eq = function eq (num) { - return this.cmp(num) === 0; - }; - - // - // A reduce context, could be using montgomery or something better, depending - // on the `m` itself. - // - BN.red = function red (num) { - return new Red(num); - }; - - BN.prototype.toRed = function toRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - assert(this.negative === 0, 'red works only with positives'); - return ctx.convertTo(this)._forceRed(ctx); - }; - - BN.prototype.fromRed = function fromRed () { - assert(this.red, 'fromRed works only with numbers in reduction context'); - return this.red.convertFrom(this); - }; - - BN.prototype._forceRed = function _forceRed (ctx) { - this.red = ctx; - return this; - }; - - BN.prototype.forceRed = function forceRed (ctx) { - assert(!this.red, 'Already a number in reduction context'); - return this._forceRed(ctx); - }; - - BN.prototype.redAdd = function redAdd (num) { - assert(this.red, 'redAdd works only with red numbers'); - return this.red.add(this, num); - }; - - BN.prototype.redIAdd = function redIAdd (num) { - assert(this.red, 'redIAdd works only with red numbers'); - return this.red.iadd(this, num); - }; - - BN.prototype.redSub = function redSub (num) { - assert(this.red, 'redSub works only with red numbers'); - return this.red.sub(this, num); - }; - - BN.prototype.redISub = function redISub (num) { - assert(this.red, 'redISub works only with red numbers'); - return this.red.isub(this, num); - }; - - BN.prototype.redShl = function redShl (num) { - assert(this.red, 'redShl works only with red numbers'); - return this.red.ushl(this, num); - }; - - BN.prototype.redMul = function redMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.mul(this, num); - }; - - BN.prototype.redIMul = function redIMul (num) { - assert(this.red, 'redMul works only with red numbers'); - this.red._verify2(this, num); - return this.red.imul(this, num); - }; - - BN.prototype.redSqr = function redSqr () { - assert(this.red, 'redSqr works only with red numbers'); - this.red._verify1(this); - return this.red.sqr(this); - }; - - BN.prototype.redISqr = function redISqr () { - assert(this.red, 'redISqr works only with red numbers'); - this.red._verify1(this); - return this.red.isqr(this); - }; - - // Square root over p - BN.prototype.redSqrt = function redSqrt () { - assert(this.red, 'redSqrt works only with red numbers'); - this.red._verify1(this); - return this.red.sqrt(this); - }; - - BN.prototype.redInvm = function redInvm () { - assert(this.red, 'redInvm works only with red numbers'); - this.red._verify1(this); - return this.red.invm(this); - }; - - // Return negative clone of `this` % `red modulo` - BN.prototype.redNeg = function redNeg () { - assert(this.red, 'redNeg works only with red numbers'); - this.red._verify1(this); - return this.red.neg(this); - }; - - BN.prototype.redPow = function redPow (num) { - assert(this.red && !num.red, 'redPow(normalNum)'); - this.red._verify1(this); - return this.red.pow(this, num); - }; - - // Prime numbers with efficient reduction - var primes = { - k256: null, - p224: null, - p192: null, - p25519: null - }; - - // Pseudo-Mersenne prime - function MPrime (name, p) { - // P = 2 ^ N - K - this.name = name; - this.p = new BN(p, 16); - this.n = this.p.bitLength(); - this.k = new BN(1).iushln(this.n).isub(this.p); - - this.tmp = this._tmp(); - } - - MPrime.prototype._tmp = function _tmp () { - var tmp = new BN(null); - tmp.words = new Array(Math.ceil(this.n / 13)); - return tmp; - }; - - MPrime.prototype.ireduce = function ireduce (num) { - // Assumes that `num` is less than `P^2` - // num = HI * (2 ^ N - K) + HI * K + LO = HI * K + LO (mod P) - var r = num; - var rlen; - - do { - this.split(r, this.tmp); - r = this.imulK(r); - r = r.iadd(this.tmp); - rlen = r.bitLength(); - } while (rlen > this.n); - - var cmp = rlen < this.n ? -1 : r.ucmp(this.p); - if (cmp === 0) { - r.words[0] = 0; - r.length = 1; - } else if (cmp > 0) { - r.isub(this.p); - } else { - r.strip(); - } - - return r; - }; - - MPrime.prototype.split = function split (input, out) { - input.iushrn(this.n, 0, out); - }; - - MPrime.prototype.imulK = function imulK (num) { - return num.imul(this.k); - }; - - function K256 () { - MPrime.call( - this, - 'k256', - 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); - } - inherits(K256, MPrime); - - K256.prototype.split = function split (input, output) { - // 256 = 9 * 26 + 22 - var mask = 0x3fffff; - - var outLen = Math.min(input.length, 9); - for (var i = 0; i < outLen; i++) { - output.words[i] = input.words[i]; - } - output.length = outLen; - - if (input.length <= 9) { - input.words[0] = 0; - input.length = 1; - return; - } - - // Shift by 9 limbs - var prev = input.words[9]; - output.words[output.length++] = prev & mask; - - for (i = 10; i < input.length; i++) { - var next = input.words[i] | 0; - input.words[i - 10] = ((next & mask) << 4) | (prev >>> 22); - prev = next; - } - prev >>>= 22; - input.words[i - 10] = prev; - if (prev === 0 && input.length > 10) { - input.length -= 10; - } else { - input.length -= 9; - } - }; - - K256.prototype.imulK = function imulK (num) { - // K = 0x1000003d1 = [ 0x40, 0x3d1 ] - num.words[num.length] = 0; - num.words[num.length + 1] = 0; - num.length += 2; - - // bounded at: 0x40 * 0x3ffffff + 0x3d0 = 0x100000390 - var lo = 0; - for (var i = 0; i < num.length; i++) { - var w = num.words[i] | 0; - lo += w * 0x3d1; - num.words[i] = lo & 0x3ffffff; - lo = w * 0x40 + ((lo / 0x4000000) | 0); - } - - // Fast length reduction - if (num.words[num.length - 1] === 0) { - num.length--; - if (num.words[num.length - 1] === 0) { - num.length--; - } - } - return num; - }; - - function P224 () { - MPrime.call( - this, - 'p224', - 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); - } - inherits(P224, MPrime); - - function P192 () { - MPrime.call( - this, - 'p192', - 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); - } - inherits(P192, MPrime); - - function P25519 () { - // 2 ^ 255 - 19 - MPrime.call( - this, - '25519', - '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); - } - inherits(P25519, MPrime); - - P25519.prototype.imulK = function imulK (num) { - // K = 0x13 - var carry = 0; - for (var i = 0; i < num.length; i++) { - var hi = (num.words[i] | 0) * 0x13 + carry; - var lo = hi & 0x3ffffff; - hi >>>= 26; - - num.words[i] = lo; - carry = hi; - } - if (carry !== 0) { - num.words[num.length++] = carry; - } - return num; - }; - - // Exported mostly for testing purposes, use plain name instead - BN._prime = function prime (name) { - // Cached version of prime - if (primes[name]) return primes[name]; - - var prime; - if (name === 'k256') { - prime = new K256(); - } else if (name === 'p224') { - prime = new P224(); - } else if (name === 'p192') { - prime = new P192(); - } else if (name === 'p25519') { - prime = new P25519(); - } else { - throw new Error('Unknown prime ' + name); - } - primes[name] = prime; - - return prime; - }; - - // - // Base reduction engine - // - function Red (m) { - if (typeof m === 'string') { - var prime = BN._prime(m); - this.m = prime.p; - this.prime = prime; - } else { - this.m = m; - this.prime = null; - } - } - - Red.prototype._verify1 = function _verify1 (a) { - assert(a.negative === 0, 'red works only with positives'); - assert(a.red, 'red works only with red numbers'); - }; - - Red.prototype._verify2 = function _verify2 (a, b) { - assert((a.negative | b.negative) === 0, 'red works only with positives'); - assert(a.red && a.red === b.red, - 'red works only with red numbers'); - }; - - Red.prototype.imod = function imod (a) { - if (this.prime) return this.prime.ireduce(a)._forceRed(this); - return a.umod(this.m)._forceRed(this); - }; - - Red.prototype.neg = function neg (a) { - if (a.isZero()) { - return a.clone(); - } - - return this.m.sub(a)._forceRed(this); - }; - - Red.prototype.add = function add (a, b) { - this._verify2(a, b); - - var res = a.add(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.iadd = function iadd (a, b) { - this._verify2(a, b); - - var res = a.iadd(b); - if (res.cmp(this.m) >= 0) { - res.isub(this.m); - } - return res; - }; - - Red.prototype.sub = function sub (a, b) { - this._verify2(a, b); - - var res = a.sub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res._forceRed(this); - }; - - Red.prototype.isub = function isub (a, b) { - this._verify2(a, b); - - var res = a.isub(b); - if (res.cmpn(0) < 0) { - res.iadd(this.m); - } - return res; - }; - - Red.prototype.shl = function shl (a, num) { - this._verify1(a); - return this.imod(a.ushln(num)); - }; - - Red.prototype.imul = function imul (a, b) { - this._verify2(a, b); - return this.imod(a.imul(b)); - }; - - Red.prototype.mul = function mul (a, b) { - this._verify2(a, b); - return this.imod(a.mul(b)); - }; - - Red.prototype.isqr = function isqr (a) { - return this.imul(a, a.clone()); - }; - - Red.prototype.sqr = function sqr (a) { - return this.mul(a, a); - }; - - Red.prototype.sqrt = function sqrt (a) { - if (a.isZero()) return a.clone(); - - var mod3 = this.m.andln(3); - assert(mod3 % 2 === 1); - - // Fast case - if (mod3 === 3) { - var pow = this.m.add(new BN(1)).iushrn(2); - return this.pow(a, pow); - } - - // Tonelli-Shanks algorithm (Totally unoptimized and slow) - // - // Find Q and S, that Q * 2 ^ S = (P - 1) - var q = this.m.subn(1); - var s = 0; - while (!q.isZero() && q.andln(1) === 0) { - s++; - q.iushrn(1); - } - assert(!q.isZero()); - - var one = new BN(1).toRed(this); - var nOne = one.redNeg(); - - // Find quadratic non-residue - // NOTE: Max is such because of generalized Riemann hypothesis. - var lpow = this.m.subn(1).iushrn(1); - var z = this.m.bitLength(); - z = new BN(2 * z * z).toRed(this); - - while (this.pow(z, lpow).cmp(nOne) !== 0) { - z.redIAdd(nOne); - } - - var c = this.pow(z, q); - var r = this.pow(a, q.addn(1).iushrn(1)); - var t = this.pow(a, q); - var m = s; - while (t.cmp(one) !== 0) { - var tmp = t; - for (var i = 0; tmp.cmp(one) !== 0; i++) { - tmp = tmp.redSqr(); - } - assert(i < m); - var b = this.pow(c, new BN(1).iushln(m - i - 1)); - - r = r.redMul(b); - c = b.redSqr(); - t = t.redMul(c); - m = i; - } - - return r; - }; - - Red.prototype.invm = function invm (a) { - var inv = a._invmp(this.m); - if (inv.negative !== 0) { - inv.negative = 0; - return this.imod(inv).redNeg(); - } else { - return this.imod(inv); - } - }; - - Red.prototype.pow = function pow (a, num) { - if (num.isZero()) return new BN(1); - if (num.cmpn(1) === 0) return a.clone(); - - var windowSize = 4; - var wnd = new Array(1 << windowSize); - wnd[0] = new BN(1).toRed(this); - wnd[1] = a; - for (var i = 2; i < wnd.length; i++) { - wnd[i] = this.mul(wnd[i - 1], a); - } - - var res = wnd[0]; - var current = 0; - var currentLen = 0; - var start = num.bitLength() % 26; - if (start === 0) { - start = 26; - } - - for (i = num.length - 1; i >= 0; i--) { - var word = num.words[i]; - for (var j = start - 1; j >= 0; j--) { - var bit = (word >> j) & 1; - if (res !== wnd[0]) { - res = this.sqr(res); - } - - if (bit === 0 && current === 0) { - currentLen = 0; - continue; - } - - current <<= 1; - current |= bit; - currentLen++; - if (currentLen !== windowSize && (i !== 0 || j !== 0)) continue; - - res = this.mul(res, wnd[current]); - currentLen = 0; - current = 0; - } - start = 26; - } - - return res; - }; - - Red.prototype.convertTo = function convertTo (num) { - var r = num.umod(this.m); - - return r === num ? r.clone() : r; - }; - - Red.prototype.convertFrom = function convertFrom (num) { - var res = num.clone(); - res.red = null; - return res; - }; - - // - // Montgomery method engine - // - - BN.mont = function mont (num) { - return new Mont(num); - }; - - function Mont (m) { - Red.call(this, m); - - this.shift = this.m.bitLength(); - if (this.shift % 26 !== 0) { - this.shift += 26 - (this.shift % 26); - } - - this.r = new BN(1).iushln(this.shift); - this.r2 = this.imod(this.r.sqr()); - this.rinv = this.r._invmp(this.m); - - this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); - this.minv = this.minv.umod(this.r); - this.minv = this.r.sub(this.minv); - } - inherits(Mont, Red); - - Mont.prototype.convertTo = function convertTo (num) { - return this.imod(num.ushln(this.shift)); - }; - - Mont.prototype.convertFrom = function convertFrom (num) { - var r = this.imod(num.mul(this.rinv)); - r.red = null; - return r; - }; - - Mont.prototype.imul = function imul (a, b) { - if (a.isZero() || b.isZero()) { - a.words[0] = 0; - a.length = 1; - return a; - } - - var t = a.imul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.mul = function mul (a, b) { - if (a.isZero() || b.isZero()) return new BN(0)._forceRed(this); - - var t = a.mul(b); - var c = t.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); - var u = t.isub(c).iushrn(this.shift); - var res = u; - if (u.cmp(this.m) >= 0) { - res = u.isub(this.m); - } else if (u.cmpn(0) < 0) { - res = u.iadd(this.m); - } - - return res._forceRed(this); - }; - - Mont.prototype.invm = function invm (a) { - // (AR)^-1 * R^2 = (A^-1 * R^-1) * R^2 = A^-1 * R - var res = this.imod(a._invmp(this.m).mul(this.r2)); - return res._forceRed(this); - }; -})(typeof module === 'undefined' || module, this); diff --git a/src/node_modules/bn.js/package.json b/src/node_modules/bn.js/package.json deleted file mode 100644 index 79779b2..0000000 --- a/src/node_modules/bn.js/package.json +++ /dev/null @@ -1,96 +0,0 @@ -{ - "_args": [ - [ - "bn.js@^4.1.1", - "/media/Github/Vertinext2/src/node_modules/browserify-sign" - ] - ], - "_from": "bn.js@>=4.1.1 <5.0.0", - "_id": "bn.js@4.10.3", - "_inCache": true, - "_installable": true, - "_location": "/bn.js", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-9-west.internal.npmjs.com", - "tmp": "tmp/bn.js-4.10.3.tgz_1454986084401_0.5097152111120522" - }, - "_npmUser": { - "email": "fedor@indutny.com", - "name": "indutny" - }, - "_npmVersion": "3.7.1", - "_phantomChildren": {}, - "_requested": { - "name": "bn.js", - "raw": "bn.js@^4.1.1", - "rawSpec": "^4.1.1", - "scope": null, - "spec": ">=4.1.1 <5.0.0", - "type": "range" - }, - "_requiredBy": [ - "/asn1.js", - "/browserify-rsa", - "/browserify-sign", - "/create-ecdh", - "/diffie-hellman", - "/elliptic", - "/miller-rabin", - "/public-encrypt" - ], - "_resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.10.3.tgz", - "_shasum": "5a0322c6a4eb187ff37a025b922354d565537433", - "_shrinkwrap": null, - "_spec": "bn.js@^4.1.1", - "_where": "/media/Github/Vertinext2/src/node_modules/browserify-sign", - "author": { - "email": "fedor@indutny.com", - "name": "Fedor Indutny" - }, - "bugs": { - "url": "https://github.com/indutny/bn.js/issues" - }, - "dependencies": {}, - "description": "Big number implementation in pure javascript", - "devDependencies": { - "istanbul": "^0.3.5", - "mocha": "^2.1.0", - "semistandard": "^7.0.4" - }, - "directories": {}, - "dist": { - "shasum": "5a0322c6a4eb187ff37a025b922354d565537433", - "tarball": "http://registry.npmjs.org/bn.js/-/bn.js-4.10.3.tgz" - }, - "gitHead": "dc8ddfe05574763e2b1f3730528d224ab04d61f3", - "homepage": "https://github.com/indutny/bn.js", - "keywords": [ - "BN", - "BigNum", - "Big number", - "Modulo", - "Montgomery" - ], - "license": "MIT", - "main": "lib/bn.js", - "maintainers": [ - { - "email": "fedor@indutny.com", - "name": "indutny" - } - ], - "name": "bn.js", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/bn.js.git" - }, - "scripts": { - "lint": "semistandard", - "test": "npm run lint && npm run unit", - "unit": "mocha --reporter=spec test/*-test.js" - }, - "version": "4.10.3" -} diff --git a/src/node_modules/bn.js/test/arithmetic-test.js b/src/node_modules/bn.js/test/arithmetic-test.js deleted file mode 100644 index a8e07d0..0000000 --- a/src/node_modules/bn.js/test/arithmetic-test.js +++ /dev/null @@ -1,557 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../').BN; -var fixtures = require('./fixtures'); - -describe('BN.js/Arithmetic', function () { - describe('.add()', function () { - it('should add numbers', function () { - assert.equal(new BN(14).add(new BN(26)).toString(16), '28'); - var k = new BN(0x1234); - var r = k; - - for (var i = 0; i < 257; i++) { - r = r.add(k); - } - - assert.equal(r.toString(16), '125868'); - }); - - it('should handle carry properly (in-place)', function () { - var k = new BN('abcdefabcdefabcdef', 16); - var r = new BN('deadbeef', 16); - - for (var i = 0; i < 257; i++) { - r.iadd(k); - } - - assert.equal(r.toString(16), 'ac79bd9b79be7a277bde'); - }); - - it('should properly do positive + negative', function () { - var a = new BN('abcd', 16); - var b = new BN('-abce', 16); - - assert.equal(a.iadd(b).toString(16), '-1'); - - a = new BN('abcd', 16); - b = new BN('-abce', 16); - - assert.equal(a.add(b).toString(16), '-1'); - assert.equal(b.add(a).toString(16), '-1'); - }); - }); - - describe('.iaddn()', function () { - it('should allow a sign change', function () { - var a = new BN(-100); - assert.equal(a.negative, 1); - - a.iaddn(200); - - assert.equal(a.negative, 0); - assert.equal(a.toString(), '100'); - }); - - it('should add negative number', function () { - var a = new BN(-100); - assert.equal(a.negative, 1); - - a.iaddn(-200); - - assert.equal(a.toString(), '-300'); - }); - - it('should allow neg + pos with big number', function () { - var a = new BN('-1000000000', 10); - assert.equal(a.negative, 1); - - a.iaddn(200); - - assert.equal(a.toString(), '-999999800'); - }); - - it('should carry limb', function () { - var a = new BN('3ffffff', 16); - - assert.equal(a.iaddn(1).toString(16), '4000000'); - }); - - it('should throw error with num eq 0x4000000', function () { - assert.throws(function () { - new BN(0).iaddn(0x4000000); - }); - }); - }); - - describe('.sub()', function () { - it('should subtract small numbers', function () { - assert.equal(new BN(26).sub(new BN(14)).toString(16), 'c'); - assert.equal(new BN(14).sub(new BN(26)).toString(16), '-c'); - assert.equal(new BN(26).sub(new BN(26)).toString(16), '0'); - assert.equal(new BN(-26).sub(new BN(26)).toString(16), '-34'); - }); - - var a = new BN( - '31ff3c61db2db84b9823d320907a573f6ad37c437abe458b1802cda041d6384' + - 'a7d8daef41395491e2', - 16); - var b = new BN( - '6f0e4d9f1d6071c183677f601af9305721c91d31b0bbbae8fb790000', - 16); - var r = new BN( - '31ff3c61db2db84b9823d3208989726578fd75276287cd9516533a9acfb9a67' + - '76281f34583ddb91e2', - 16); - - it('should subtract big numbers', function () { - assert.equal(a.sub(b).cmp(r), 0); - }); - - it('should subtract numbers in place', function () { - assert.equal(b.clone().isub(a).neg().cmp(r), 0); - }); - - it('should subtract with carry', function () { - // Carry and copy - var a = new BN('12345', 16); - var b = new BN('1000000000000', 16); - assert.equal(a.isub(b).toString(16), '-fffffffedcbb'); - - a = new BN('12345', 16); - b = new BN('1000000000000', 16); - assert.equal(b.isub(a).toString(16), 'fffffffedcbb'); - }); - }); - - describe('.isubn()', function () { - it('should subtract negative number', function () { - var r = new BN( - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b', 16); - assert.equal(r.isubn(-1).toString(16), - '7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681c'); - }); - - it('should work for positive numbers', function () { - var a = new BN(-100); - assert.equal(a.negative, 1); - - a.isubn(200); - assert.equal(a.negative, 1); - assert.equal(a.toString(), '-300'); - }); - - it('should not allow a sign change', function () { - var a = new BN(-100); - assert.equal(a.negative, 1); - - a.isubn(-200); - assert.equal(a.negative, 0); - assert.equal(a.toString(), '100'); - }); - - it('should change sign on small numbers at 0', function () { - var a = new BN(0).subn(2); - assert.equal(a.toString(), '-2'); - }); - - it('should change sign on small numbers at 1', function () { - var a = new BN(1).subn(2); - assert.equal(a.toString(), '-1'); - }); - - it('should throw error with num eq 0x4000000', function () { - assert.throws(function () { - new BN(0).isubn(0x4000000); - }); - }); - }); - - function testMethod (name, mul) { - describe(name, function () { - it('should multiply numbers of different signs', function () { - var offsets = [ - 1, // smallMulTo - 250, // comb10MulTo - 1000, // bigMulTo - 15000 // jumboMulTo - ]; - - for (var i = 0; i < offsets.length; ++i) { - var x = new BN(1).ishln(offsets[i]); - - assert.equal(mul(x, x).isNeg(), false); - assert.equal(mul(x, x.neg()).isNeg(), true); - assert.equal(mul(x.neg(), x).isNeg(), true); - assert.equal(mul(x.neg(), x.neg()).isNeg(), false); - } - }); - - it('should multiply with carry', function () { - var n = new BN(0x1001); - var r = n; - - for (var i = 0; i < 4; i++) { - r = mul(r, n); - } - - assert.equal(r.toString(16), '100500a00a005001'); - }); - - it('should correctly multiply big numbers', function () { - var n = new BN( - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - 16 - ); - assert.equal( - mul(n, n).toString(16), - '39e58a8055b6fb264b75ec8c646509784204ac15a8c24e05babc9729ab9' + - 'b055c3a9458e4ce3289560a38e08ba8175a9446ce14e608245ab3a9' + - '978a8bd8acaa40'); - assert.equal( - mul(mul(n, n), n).toString(16), - '1b888e01a06e974017a28a5b4da436169761c9730b7aeedf75fc60f687b' + - '46e0cf2cb11667f795d5569482640fe5f628939467a01a612b02350' + - '0d0161e9730279a7561043af6197798e41b7432458463e64fa81158' + - '907322dc330562697d0d600'); - }); - - it('should multiply neg number on 0', function () { - assert.equal( - mul(new BN('-100000000000'), new BN('3').div(new BN('4'))) - .toString(16), - '0' - ); - }); - - it('should regress mul big numbers', function () { - var q = fixtures.dhGroups.p17.q; - var qs = fixtures.dhGroups.p17.qs; - - q = new BN(q, 16); - assert.equal(mul(q, q).toString(16), qs); - }); - }); - } - - testMethod('.mul()', function (x, y) { - return BN.prototype.mul.apply(x, [ y ]); - }); - - testMethod('.mulf()', function (x, y) { - return BN.prototype.mulf.apply(x, [ y ]); - }); - - describe('.imul()', function () { - it('should multiply numbers in-place', function () { - var a = new BN('abcdef01234567890abcd', 16); - var b = new BN('deadbeefa551edebabba8', 16); - var c = a.mul(b); - - assert.equal(a.imul(b).toString(16), c.toString(16)); - - a = new BN('abcdef01234567890abcd214a25123f512361e6d236', 16); - b = new BN('deadbeefa551edebabba8121234fd21bac0341324dd', 16); - c = a.mul(b); - - assert.equal(a.imul(b).toString(16), c.toString(16)); - }); - - it('should multiply by 0', function () { - var a = new BN('abcdef01234567890abcd', 16); - var b = new BN('0', 16); - var c = a.mul(b); - - assert.equal(a.imul(b).toString(16), c.toString(16)); - }); - - it('should regress mul big numbers in-place', function () { - var q = fixtures.dhGroups.p17.q; - var qs = fixtures.dhGroups.p17.qs; - - q = new BN(q, 16); - - assert.equal(q.isqr().toString(16), qs); - }); - }); - - describe('.muln()', function () { - it('should multiply number by small number', function () { - var a = new BN('abcdef01234567890abcd', 16); - var b = new BN('dead', 16); - var c = a.mul(b); - - assert.equal(a.muln(0xdead).toString(16), c.toString(16)); - }); - - it('should throw error with num eq 0x4000000', function () { - assert.throws(function () { - new BN(0).imuln(0x4000000); - }); - }); - }); - - describe('.pow()', function () { - it('should raise number to the power', function () { - var a = new BN('ab', 16); - var b = new BN('13', 10); - var c = a.pow(b); - - assert.equal(c.toString(16), '15963da06977df51909c9ba5b'); - }); - }); - - describe('.div()', function () { - it('should divide numbers', function () { - assert.equal(new BN('10').div(new BN(256)).toString(16), - '0'); - assert.equal(new BN('69527932928').div(new BN('16974594')).toString(16), - 'fff'); - assert.equal(new BN('-69527932928').div(new BN('16974594')).toString(16), - '-fff'); - - var b = new BN( - '39e58a8055b6fb264b75ec8c646509784204ac15a8c24e05babc9729ab9' + - 'b055c3a9458e4ce3289560a38e08ba8175a9446ce14e608245ab3a9' + - '978a8bd8acaa40', - 16); - var n = new BN( - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - 16 - ); - assert.equal(b.div(n).toString(16), n.toString(16)); - - assert.equal(new BN('1').div(new BN('-5')).toString(10), '0'); - }); - - it('should not fail on regression after moving to _wordDiv', function () { - // Regression after moving to word div - var p = new BN( - 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f', - 16); - var a = new BN( - '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', - 16); - var as = a.sqr(); - assert.equal( - as.div(p).toString(16), - '39e58a8055b6fb264b75ec8c646509784204ac15a8c24e05babc9729e58090b9'); - - p = new BN( - 'ffffffff00000001000000000000000000000000ffffffffffffffffffffffff', - 16); - a = new BN( - 'fffffffe00000003fffffffd0000000200000001fffffffe00000002ffffffff' + - 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', - 16); - assert.equal( - a.div(p).toString(16), - 'ffffffff00000002000000000000000000000001000000000000000000000001'); - }); - }); - - describe('.idivn()', function () { - it('should divide numbers in-place', function () { - assert.equal(new BN('10', 16).idivn(3).toString(16), '5'); - assert.equal(new BN('12', 16).idivn(3).toString(16), '6'); - assert.equal(new BN('10000000000000000').idivn(3).toString(10), - '3333333333333333'); - assert.equal( - new BN('100000000000000000000000000000').idivn(3).toString(10), - '33333333333333333333333333333'); - - var t = new BN(3); - assert.equal( - new BN('12345678901234567890123456', 16).idivn(3).toString(16), - new BN('12345678901234567890123456', 16).div(t).toString(16)); - }); - }); - - describe('.divRound()', function () { - it('should divide numbers with rounding', function () { - assert.equal(new BN(9).divRound(new BN(20)).toString(10), - '0'); - assert.equal(new BN(10).divRound(new BN(20)).toString(10), - '1'); - assert.equal(new BN(150).divRound(new BN(20)).toString(10), - '8'); - assert.equal(new BN(149).divRound(new BN(20)).toString(10), - '7'); - assert.equal(new BN(149).divRound(new BN(17)).toString(10), - '9'); - assert.equal(new BN(144).divRound(new BN(17)).toString(10), - '8'); - assert.equal(new BN(-144).divRound(new BN(17)).toString(10), - '-8'); - }); - - it('should return 1 on exact division', function () { - assert.equal(new BN(144).divRound(new BN(144)).toString(10), '1'); - }); - }); - - describe('.mod()', function () { - it('should mod numbers', function () { - assert.equal(new BN('10').mod(new BN(256)).toString(16), - 'a'); - assert.equal(new BN('69527932928').mod(new BN('16974594')).toString(16), - '102f302'); - - // 178 = 10 * 17 + 8 - assert.equal(new BN(178).div(new BN(10)).toNumber(), 17); - assert.equal(new BN(178).mod(new BN(10)).toNumber(), 8); - assert.equal(new BN(178).umod(new BN(10)).toNumber(), 8); - - // -178 = 10 * (-17) + (-8) - assert.equal(new BN(-178).div(new BN(10)).toNumber(), -17); - assert.equal(new BN(-178).mod(new BN(10)).toNumber(), -8); - assert.equal(new BN(-178).umod(new BN(10)).toNumber(), 2); - - // 178 = -10 * (-17) + 8 - assert.equal(new BN(178).div(new BN(-10)).toNumber(), -17); - assert.equal(new BN(178).mod(new BN(-10)).toNumber(), 8); - assert.equal(new BN(178).umod(new BN(-10)).toNumber(), 8); - - // -178 = -10 * (17) + (-8) - assert.equal(new BN(-178).div(new BN(-10)).toNumber(), 17); - assert.equal(new BN(-178).mod(new BN(-10)).toNumber(), -8); - assert.equal(new BN(-178).umod(new BN(-10)).toNumber(), 2); - - // -4 = 1 * (-3) + -1 - assert.equal(new BN(-4).div(new BN(-3)).toNumber(), 1); - assert.equal(new BN(-4).mod(new BN(-3)).toNumber(), -1); - - // -4 = -1 * (3) + -1 - assert.equal(new BN(-4).mod(new BN(3)).toNumber(), -1); - // -4 = 1 * (-3) + (-1 + 3) - assert.equal(new BN(-4).umod(new BN(-3)).toNumber(), 2); - - var p = new BN( - 'ffffffff00000001000000000000000000000000ffffffffffffffffffffffff', - 16); - var a = new BN( - 'fffffffe00000003fffffffd0000000200000001fffffffe00000002ffffffff' + - 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', - 16); - assert.equal( - a.mod(p).toString(16), - '0'); - }); - - it('should properly carry the sign inside division', function () { - var a = new BN('945304eb96065b2a98b57a48a06ae28d285a71b5', 'hex'); - var b = new BN( - 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe', - 'hex'); - - assert.equal(a.mul(b).mod(a).cmpn(0), 0); - }); - }); - - describe('.modn()', function () { - it('should act like .mod() on small numbers', function () { - assert.equal(new BN('10', 16).modn(256).toString(16), '10'); - assert.equal(new BN('100', 16).modn(256).toString(16), '0'); - assert.equal(new BN('1001', 16).modn(256).toString(16), '1'); - assert.equal(new BN('100000000001', 16).modn(256).toString(16), '1'); - assert.equal(new BN('100000000001', 16).modn(257).toString(16), - new BN('100000000001', 16).mod(new BN(257)).toString(16)); - assert.equal(new BN('123456789012', 16).modn(3).toString(16), - new BN('123456789012', 16).mod(new BN(3)).toString(16)); - }); - }); - - describe('.abs()', function () { - it('should return absolute value', function () { - assert.equal(new BN(0x1001).abs().toString(), '4097'); - assert.equal(new BN(-0x1001).abs().toString(), '4097'); - assert.equal(new BN('ffffffff', 16).abs().toString(), '4294967295'); - }); - }); - - describe('.invm()', function () { - it('should invert relatively-prime numbers', function () { - var p = new BN(257); - var a = new BN(3); - var b = a.invm(p); - assert.equal(a.mul(b).mod(p).toString(16), '1'); - - var p192 = new BN( - 'fffffffffffffffffffffffffffffffeffffffffffffffff', - 16); - a = new BN('deadbeef', 16); - b = a.invm(p192); - assert.equal(a.mul(b).mod(p192).toString(16), '1'); - - // Even base - var phi = new BN('872d9b030ba368706b68932cf07a0e0c', 16); - var e = new BN(65537); - var d = e.invm(phi); - assert.equal(e.mul(d).mod(phi).toString(16), '1'); - - // Even base (take #2) - a = new BN('5'); - b = new BN('6'); - var r = a.invm(b); - assert.equal(r.mul(a).mod(b).toString(16), '1'); - }); - }); - - describe('.gcd()', function () { - it('should return GCD', function () { - assert.equal(new BN(3).gcd(new BN(2)).toString(10), '1'); - assert.equal(new BN(18).gcd(new BN(12)).toString(10), '6'); - assert.equal(new BN(-18).gcd(new BN(12)).toString(10), '6'); - assert.equal(new BN(-18).gcd(new BN(-12)).toString(10), '6'); - assert.equal(new BN(-18).gcd(new BN(0)).toString(10), '18'); - assert.equal(new BN(0).gcd(new BN(-18)).toString(10), '18'); - assert.equal(new BN(2).gcd(new BN(0)).toString(10), '2'); - assert.equal(new BN(0).gcd(new BN(3)).toString(10), '3'); - assert.equal(new BN(0).gcd(new BN(0)).toString(10), '0'); - }); - }); - - describe('.egcd()', function () { - it('should return EGCD', function () { - assert.equal(new BN(3).egcd(new BN(2)).gcd.toString(10), '1'); - assert.equal(new BN(18).egcd(new BN(12)).gcd.toString(10), '6'); - assert.equal(new BN(-18).egcd(new BN(12)).gcd.toString(10), '6'); - assert.equal(new BN(0).egcd(new BN(12)).gcd.toString(10), '12'); - }); - it('should not allow 0 input', function () { - assert.throws(function () { - BN(1).egcd(0); - }); - }); - it('should not allow negative input', function () { - assert.throws(function () { - BN(1).egcd(-1); - }); - }); - }); - - describe('BN.max(a, b)', function () { - it('should return maximum', function () { - assert.equal(BN.max(new BN(3), new BN(2)).toString(16), '3'); - assert.equal(BN.max(new BN(2), new BN(3)).toString(16), '3'); - assert.equal(BN.max(new BN(2), new BN(2)).toString(16), '2'); - assert.equal(BN.max(new BN(2), new BN(-2)).toString(16), '2'); - }); - }); - - describe('BN.min(a, b)', function () { - it('should return minimum', function () { - assert.equal(BN.min(new BN(3), new BN(2)).toString(16), '2'); - assert.equal(BN.min(new BN(2), new BN(3)).toString(16), '2'); - assert.equal(BN.min(new BN(2), new BN(2)).toString(16), '2'); - assert.equal(BN.min(new BN(2), new BN(-2)).toString(16), '-2'); - }); - }); - - describe('BN.ineg', function () { - it('shouldn\'t change sign for zero', function () { - assert.equal(new BN(0).ineg().toString(10), '0'); - }); - }); -}); diff --git a/src/node_modules/bn.js/test/binary-test.js b/src/node_modules/bn.js/test/binary-test.js deleted file mode 100644 index 62e75c8..0000000 --- a/src/node_modules/bn.js/test/binary-test.js +++ /dev/null @@ -1,224 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../').BN; - -describe('BN.js/Binary', function () { - describe('.shl()', function () { - it('should shl numbers', function () { - // TODO(indutny): add negative numbers when the time will come - assert.equal(new BN('69527932928').shln(13).toString(16), - '2060602000000'); - assert.equal(new BN('69527932928').shln(45).toString(16), - '206060200000000000000'); - }); - - it('should ushl numbers', function () { - assert.equal(new BN('69527932928').ushln(13).toString(16), - '2060602000000'); - assert.equal(new BN('69527932928').ushln(45).toString(16), - '206060200000000000000'); - }); - }); - - describe('.shr()', function () { - it('should shr numbers', function () { - // TODO(indutny): add negative numbers when the time will come - assert.equal(new BN('69527932928').shrn(13).toString(16), - '818180'); - assert.equal(new BN('69527932928').shrn(17).toString(16), - '81818'); - assert.equal(new BN('69527932928').shrn(256).toString(16), - '0'); - }); - - it('should ushr numbers', function () { - assert.equal(new BN('69527932928').ushrn(13).toString(16), - '818180'); - assert.equal(new BN('69527932928').ushrn(17).toString(16), - '81818'); - assert.equal(new BN('69527932928').ushrn(256).toString(16), - '0'); - }); - }); - - describe('.bincn()', function () { - it('should increment bit', function () { - assert.equal(new BN(0).bincn(1).toString(16), '2'); - assert.equal(new BN(2).bincn(1).toString(16), '4'); - assert.equal(new BN(2).bincn(1).bincn(1).toString(16), - new BN(2).bincn(2).toString(16)); - assert.equal(new BN(0xffffff).bincn(1).toString(16), '1000001'); - }); - }); - - describe('.imaskn()', function () { - it('should mask bits in-place', function () { - assert.equal(new BN(0).imaskn(1).toString(16), '0'); - assert.equal(new BN(3).imaskn(1).toString(16), '1'); - assert.equal(new BN('123456789', 16).imaskn(4).toString(16), '9'); - assert.equal(new BN('123456789', 16).imaskn(16).toString(16), '6789'); - assert.equal(new BN('123456789', 16).imaskn(28).toString(16), '3456789'); - }); - }); - - describe('.testn()', function () { - it('should support test specific bit', function () { - [ - 'ff', - 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff' - ].forEach(function (hex) { - var bn = new BN(hex, 16); - var bl = bn.bitLength(); - - for (var i = 0; i < bl; ++i) { - assert.equal(bn.testn(i), true); - } - - // test off the end - assert.equal(bn.testn(bl), false); - }); - - var xbits = '01111001010111001001000100011101' + - '11010011101100011000111001011101' + - '10010100111000000001011000111101' + - '01011111001111100100011110000010' + - '01011010100111010001010011000100' + - '01101001011110100001001111100110' + - '001110010111'; - - var x = new BN( - '23478905234580795234378912401239784125643978256123048348957342' - ); - for (var i = 0; i < x.bitLength(); ++i) { - assert.equal(x.testn(i), (xbits.charAt(i) === '1'), 'Failed @ bit ' + i); - } - }); - - it('should have short-cuts', function () { - var x = new BN('abcd', 16); - assert(!x.testn(128)); - }); - }); - - describe('.and()', function () { - it('should and numbers', function () { - assert.equal(new BN('1010101010101010101010101010101010101010', 2) - .and(new BN('101010101010101010101010101010101010101', 2)) - .toString(2), '0'); - }); - - it('should and numbers of different limb-length', function () { - assert.equal( - new BN('abcd0000ffff', 16) - .and(new BN('abcd', 16)).toString(16), - 'abcd'); - }); - }); - - describe('.iand()', function () { - it('should iand numbers', function () { - assert.equal(new BN('1010101010101010101010101010101010101010', 2) - .iand(new BN('101010101010101010101010101010101010101', 2)) - .toString(2), '0'); - assert.equal(new BN('1000000000000000000000000000000000000001', 2) - .iand(new BN('1', 2)) - .toString(2), '1'); - assert.equal(new BN('1', 2) - .iand(new BN('1000000000000000000000000000000000000001', 2)) - .toString(2), '1'); - }); - }); - - describe('.or()', function () { - it('should or numbers', function () { - assert.equal(new BN('1010101010101010101010101010101010101010', 2) - .or(new BN('101010101010101010101010101010101010101', 2)) - .toString(2), '1111111111111111111111111111111111111111'); - }); - - it('should or numbers of different limb-length', function () { - assert.equal( - new BN('abcd00000000', 16) - .or(new BN('abcd', 16)).toString(16), - 'abcd0000abcd'); - }); - }); - - describe('.ior()', function () { - it('should ior numbers', function () { - assert.equal(new BN('1010101010101010101010101010101010101010', 2) - .ior(new BN('101010101010101010101010101010101010101', 2)) - .toString(2), '1111111111111111111111111111111111111111'); - assert.equal(new BN('1000000000000000000000000000000000000000', 2) - .ior(new BN('1', 2)) - .toString(2), '1000000000000000000000000000000000000001'); - assert.equal(new BN('1', 2) - .ior(new BN('1000000000000000000000000000000000000000', 2)) - .toString(2), '1000000000000000000000000000000000000001'); - }); - }); - - describe('.xor()', function () { - it('should xor numbers', function () { - assert.equal(new BN('11001100110011001100110011001100', 2) - .xor(new BN('1100110011001100110011001100110', 2)) - .toString(2), '10101010101010101010101010101010'); - }); - }); - - describe('.ixor()', function () { - it('should ixor numbers', function () { - assert.equal(new BN('11001100110011001100110011001100', 2) - .ixor(new BN('1100110011001100110011001100110', 2)) - .toString(2), '10101010101010101010101010101010'); - assert.equal(new BN('11001100110011001100110011001100', 2) - .ixor(new BN('1', 2)) - .toString(2), '11001100110011001100110011001101'); - assert.equal(new BN('1', 2) - .ixor(new BN('11001100110011001100110011001100', 2)) - .toString(2), '11001100110011001100110011001101'); - }); - - it('should and numbers of different limb-length', function () { - assert.equal( - new BN('abcd0000ffff', 16) - .xor(new BN('abcd', 16)).toString(16), - 'abcd00005432'); - }); - }); - - describe('.setn()', function () { - it('should allow single bits to be set', function () { - assert.equal(new BN(0).setn(2, true).toString(2), '100'); - assert.equal(new BN(0).setn(27, true).toString(2), - '1000000000000000000000000000'); - assert.equal(new BN('1000000000000000000000000001', 2).setn(27, false) - .toString(2), '1'); - assert.equal(new BN('101', 2).setn(2, false).toString(2), '1'); - }); - }); - - describe('.notn()', function () { - it('should allow bitwise negation', function () { - assert.equal(new BN('111000111', 2).notn(9).toString(2), - '111000'); - assert.equal(new BN('000111000', 2).notn(9).toString(2), - '111000111'); - assert.equal(new BN('111000111', 2).notn(9).toString(2), - '111000'); - assert.equal(new BN('000111000', 2).notn(9).toString(2), - '111000111'); - assert.equal(new BN('111000111', 2).notn(32).toString(2), - '11111111111111111111111000111000'); - assert.equal(new BN('000111000', 2).notn(32).toString(2), - '11111111111111111111111111000111'); - assert.equal(new BN('111000111', 2).notn(68).toString(2), - '11111111111111111111111111111111' + - '111111111111111111111111111000111000'); - assert.equal(new BN('000111000', 2).notn(68).toString(2), - '11111111111111111111111111111111' + - '111111111111111111111111111111000111'); - }); - }); -}); diff --git a/src/node_modules/bn.js/test/constructor-test.js b/src/node_modules/bn.js/test/constructor-test.js deleted file mode 100644 index bad412b..0000000 --- a/src/node_modules/bn.js/test/constructor-test.js +++ /dev/null @@ -1,149 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../').BN; - -describe('BN.js/Constructor', function () { - describe('with Smi input', function () { - it('should accept one limb number', function () { - assert.equal(new BN(12345).toString(16), '3039'); - }); - - it('should accept two-limb number', function () { - assert.equal(new BN(0x4123456).toString(16), '4123456'); - }); - - it('should accept 52 bits of precision', function () { - var num = Math.pow(2, 52); - assert.equal(new BN(num, 10).toString(10), num.toString(10)); - }); - - it('should accept max safe integer', function () { - var num = Math.pow(2, 53) - 1; - assert.equal(new BN(num, 10).toString(10), num.toString(10)); - }); - - it('should not accept an unsafe integer', function () { - var num = Math.pow(2, 53); - - assert.throws(function () { - BN(num, 10); - }); - }); - - it('should accept two-limb LE number', function () { - assert.equal(new BN(0x4123456, null, 'le').toString(16), '56341204'); - }); - }); - - describe('with String input', function () { - it('should accept base-16', function () { - assert.equal(new BN('1A6B765D8CDF', 16).toString(16), '1a6b765d8cdf'); - assert.equal(new BN('1A6B765D8CDF', 16).toString(), '29048849665247'); - }); - - it('should accept base-hex', function () { - assert.equal(new BN('FF', 'hex').toString(), '255'); - }); - - it('should accept base-16 with spaces', function () { - var num = 'a89c e5af8724 c0a23e0e 0ff77500'; - assert.equal(new BN(num, 16).toString(16), num.replace(/ /g, '')); - }); - - it('should accept long base-16', function () { - var num = '123456789abcdef123456789abcdef123456789abcdef'; - assert.equal(new BN(num, 16).toString(16), num); - }); - - it('should accept positive base-10', function () { - assert.equal(new BN('10654321').toString(), '10654321'); - assert.equal(new BN('29048849665247').toString(16), '1a6b765d8cdf'); - }); - - it('should accept negative base-10', function () { - assert.equal(new BN('-29048849665247').toString(16), '-1a6b765d8cdf'); - }); - - it('should accept long base-10', function () { - var num = '10000000000000000'; - assert.equal(new BN(num).toString(10), num); - }); - - it('should accept base-2', function () { - var base2 = '11111111111111111111111111111111111111111111111111111'; - assert.equal(new BN(base2, 2).toString(2), base2); - }); - - it('should accept base-36', function () { - var base36 = 'zzZzzzZzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'; - assert.equal(new BN(base36, 36).toString(36), base36.toLowerCase()); - }); - - it('should not overflow limbs during base-10', function () { - var num = '65820182292848241686198767302293' + - '20890292528855852623664389292032'; - assert(new BN(num).words[0] < 0x4000000); - }); - - it('should accept base-16 LE integer', function () { - assert.equal(new BN('1A6B765D8CDF', 16, 'le').toString(16), - 'df8c5d766b1a'); - }); - }); - - describe('with Array input', function () { - it('should not fail on empty array', function () { - assert.equal(new BN([]).toString(16), '0'); - }); - - it('should import/export big endian', function () { - assert.equal(new BN([ 1, 2, 3 ]).toString(16), '10203'); - assert.equal(new BN([ 1, 2, 3, 4 ]).toString(16), '1020304'); - assert.equal(new BN([ 1, 2, 3, 4, 5 ]).toString(16), '102030405'); - assert.equal(new BN([ 1, 2, 3, 4, 5, 6, 7, 8 ]).toString(16), - '102030405060708'); - assert.equal(new BN([ 1, 2, 3, 4 ]).toArray().join(','), '1,2,3,4'); - assert.equal(new BN([ 1, 2, 3, 4, 5, 6, 7, 8 ]).toArray().join(','), - '1,2,3,4,5,6,7,8'); - }); - - it('should import little endian', function () { - assert.equal(new BN([ 1, 2, 3 ], 10, 'le').toString(16), '30201'); - assert.equal(new BN([ 1, 2, 3, 4 ], 10, 'le').toString(16), '4030201'); - assert.equal(new BN([ 1, 2, 3, 4, 5 ], 10, 'le').toString(16), - '504030201'); - assert.equal(new BN([ 1, 2, 3, 4, 5, 6, 7, 8 ], 'le').toString(16), - '807060504030201'); - assert.equal(new BN([ 1, 2, 3, 4 ]).toArray('le').join(','), '4,3,2,1'); - assert.equal(new BN([ 1, 2, 3, 4, 5, 6, 7, 8 ]).toArray('le').join(','), - '8,7,6,5,4,3,2,1'); - }); - - it('should import big endian with implicit base', function () { - assert.equal(new BN([ 1, 2, 3, 4, 5 ], 'le').toString(16), '504030201'); - }); - }); - - // the Array code is able to handle Buffer - describe('with Buffer input', function () { - it('should not fail on empty Buffer', function () { - assert.equal(new BN(new Buffer(0)).toString(16), '0'); - }); - - it('should import/export big endian', function () { - assert.equal(new BN(new Buffer('010203', 'hex')).toString(16), '10203'); - }); - - it('should import little endian', function () { - assert.equal(new BN(new Buffer('010203', 'hex'), 'le').toString(16), '30201'); - }); - }); - - describe('with BN input', function () { - it('should clone BN', function () { - var num = new BN(12345); - assert.equal(new BN(num).toString(10), '12345'); - }); - }); -}); diff --git a/src/node_modules/bn.js/test/fixtures.js b/src/node_modules/bn.js/test/fixtures.js deleted file mode 100644 index 39fd661..0000000 --- a/src/node_modules/bn.js/test/fixtures.js +++ /dev/null @@ -1,264 +0,0 @@ -exports.dhGroups = { - p16: { - prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd1' + - '29024e088a67cc74020bbea63b139b22514a08798e3404dd' + - 'ef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245' + - 'e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7ed' + - 'ee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3d' + - 'c2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f' + - '83655d23dca3ad961c62f356208552bb9ed529077096966d' + - '670c354e4abc9804f1746c08ca18217c32905e462e36ce3b' + - 'e39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9' + - 'de2bcbf6955817183995497cea956ae515d2261898fa0510' + - '15728e5a8aaac42dad33170d04507a33a85521abdf1cba64' + - 'ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7' + - 'abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6b' + - 'f12ffa06d98a0864d87602733ec86a64521f2b18177b200c' + - 'bbe117577a615d6c770988c0bad946e208e24fa074e5ab31' + - '43db5bfce0fd108e4b82d120a92108011a723c12a787e6d7' + - '88719a10bdba5b2699c327186af4e23c1a946834b6150bda' + - '2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6' + - '287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed' + - '1f612970cee2d7afb81bdd762170481cd0069127d5b05aa9' + - '93b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199' + - 'ffffffffffffffff', - priv: '6d5923e6449122cbbcc1b96093e0b7e4fd3e469f58daddae' + - '53b49b20664f4132675df9ce98ae0cfdcac0f4181ccb643b' + - '625f98104dcf6f7d8e81961e2cab4b5014895260cb977c7d' + - '2f981f8532fb5da60b3676dfe57f293f05d525866053ac7e' + - '65abfd19241146e92e64f309a97ef3b529af4d6189fa416c' + - '9e1a816c3bdf88e5edf48fbd8233ef9038bb46faa95122c0' + - '5a426be72039639cd2d53d37254b3d258960dcb33c255ede' + - '20e9d7b4b123c8b4f4b986f53cdd510d042166f7dd7dca98' + - '7c39ab36381ba30a5fdd027eb6128d2ef8e5802a2194d422' + - 'b05fe6e1cb4817789b923d8636c1ec4b7601c90da3ddc178' + - '52f59217ae070d87f2e75cbfb6ff92430ad26a71c8373452' + - 'ae1cc5c93350e2d7b87e0acfeba401aaf518580937bf0b6c' + - '341f8c49165a47e49ce50853989d07171c00f43dcddddf72' + - '94fb9c3f4e1124e98ef656b797ef48974ddcd43a21fa06d0' + - '565ae8ce494747ce9e0ea0166e76eb45279e5c6471db7df8' + - 'cc88764be29666de9c545e72da36da2f7a352fb17bdeb982' + - 'a6dc0193ec4bf00b2e533efd6cd4d46e6fb237b775615576' + - 'dd6c7c7bbc087a25e6909d1ebc6e5b38e5c8472c0fc429c6' + - 'f17da1838cbcd9bbef57c5b5522fd6053e62ba21fe97c826' + - 'd3889d0cc17e5fa00b54d8d9f0f46fb523698af965950f4b' + - '941369e180f0aece3870d9335f2301db251595d173902cad' + - '394eaa6ffef8be6c', - pub: 'd53703b7340bc89bfc47176d351e5cf86d5a18d9662eca3c' + - '9759c83b6ccda8859649a5866524d77f79e501db923416ca' + - '2636243836d3e6df752defc0fb19cc386e3ae48ad647753f' + - 'bf415e2612f8a9fd01efe7aca249589590c7e6a0332630bb' + - '29c5b3501265d720213790556f0f1d114a9e2071be3620bd' + - '4ee1e8bb96689ac9e226f0a4203025f0267adc273a43582b' + - '00b70b490343529eaec4dcff140773cd6654658517f51193' + - '13f21f0a8e04fe7d7b21ffeca85ff8f87c42bb8d9cb13a72' + - 'c00e9c6e9dfcedda0777af951cc8ccab90d35e915e707d8e' + - '4c2aca219547dd78e9a1a0730accdc9ad0b854e51edd1e91' + - '4756760bab156ca6e3cb9c625cf0870def34e9ac2e552800' + - 'd6ce506d43dbbc75acfa0c8d8fb12daa3c783fb726f187d5' + - '58131779239c912d389d0511e0f3a81969d12aeee670e48f' + - 'ba41f7ed9f10705543689c2506b976a8ffabed45e33795b0' + - '1df4f6b993a33d1deab1316a67419afa31fbb6fdd252ee8c' + - '7c7d1d016c44e3fcf6b41898d7f206aa33760b505e4eff2e' + - 'c624bc7fe636b1d59e45d6f904fc391419f13d1f0cdb5b6c' + - '2378b09434159917dde709f8a6b5dc30994d056e3f964371' + - '11587ac7af0a442b8367a7bd940f752ddabf31cf01171e24' + - 'd78df136e9681cd974ce4f858a5fb6efd3234a91857bb52d' + - '9e7b414a8bc66db4b5a73bbeccfb6eb764b4f0cbf0375136' + - 'b024b04e698d54a5' - }, - p17: { - prime: 'ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd1' + - '29024e088a67cc74020bbea63b139b22514a08798e3404dd' + - 'ef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245' + - 'e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7ed' + - 'ee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3d' + - 'c2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f' + - '83655d23dca3ad961c62f356208552bb9ed529077096966d' + - '670c354e4abc9804f1746c08ca18217c32905e462e36ce3b' + - 'e39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9' + - 'de2bcbf6955817183995497cea956ae515d2261898fa0510' + - '15728e5a8aaac42dad33170d04507a33a85521abdf1cba64' + - 'ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7' + - 'abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6b' + - 'f12ffa06d98a0864d87602733ec86a64521f2b18177b200c' + - 'bbe117577a615d6c770988c0bad946e208e24fa074e5ab31' + - '43db5bfce0fd108e4b82d120a92108011a723c12a787e6d7' + - '88719a10bdba5b2699c327186af4e23c1a946834b6150bda' + - '2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6' + - '287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed' + - '1f612970cee2d7afb81bdd762170481cd0069127d5b05aa9' + - '93b4ea988d8fddc186ffb7dc90a6c08f4df435c934028492' + - '36c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bd' + - 'f8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831' + - '179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1b' + - 'db7f1447e6cc254b332051512bd7af426fb8f401378cd2bf' + - '5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6' + - 'd55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f3' + - '23a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aa' + - 'cc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be328' + - '06a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55c' + - 'da56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee' + - '12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff', - priv: '6017f2bc23e1caff5b0a8b4e1fc72422b5204415787801dc' + - '025762b8dbb98ab57603aaaa27c4e6bdf742b4a1726b9375' + - 'a8ca3cf07771779589831d8bd18ddeb79c43e7e77d433950' + - 'e652e49df35b11fa09644874d71d62fdaffb580816c2c88c' + - '2c4a2eefd4a660360316741b05a15a2e37f236692ad3c463' + - 'fff559938fc6b77176e84e1bb47fb41af691c5eb7bb81bd8' + - 'c918f52625a1128f754b08f5a1403b84667231c4dfe07ed4' + - '326234c113931ce606037e960f35a2dfdec38a5f057884d3' + - '0af8fab3be39c1eeb390205fd65982191fc21d5aa30ddf51' + - 'a8e1c58c0c19fc4b4a7380ea9e836aaf671c90c29bc4bcc7' + - '813811aa436a7a9005de9b507957c56a9caa1351b6efc620' + - '7225a18f6e97f830fb6a8c4f03b82f4611e67ab9497b9271' + - 'd6ac252793cc3e5538990dbd894d2dbc2d152801937d9f74' + - 'da4b741b50b4d40e4c75e2ac163f7b397fd555648b249f97' + - 'ffe58ffb6d096aa84534c4c5729cff137759bd34e80db4ab' + - '47e2b9c52064e7f0bf677f72ac9e5d0c6606943683f9d12f' + - '180cf065a5cb8ec3179a874f358847a907f8471d15f1e728' + - '7023249d6d13c82da52628654438f47b8b5cdf4761fbf6ad' + - '9219eceac657dbd06cf2ab776ad4c968f81c3d039367f0a4' + - 'd77c7ec4435c27b6c147071665100063b5666e06eb2fb2cc' + - '3159ba34bc98ca346342195f6f1fb053ddc3bc1873564d40' + - '1c6738cdf764d6e1ff25ca5926f80102ea6593c17170966b' + - 'b5d7352dd7fb821230237ea3ebed1f920feaadbd21be295a' + - '69f2083deae9c5cdf5f4830eb04b7c1f80cc61c17232d79f' + - '7ecc2cc462a7965f804001c89982734e5abba2d31df1b012' + - '152c6b226dff34510b54be8c2cd68d795def66c57a3abfb6' + - '896f1d139e633417f8c694764974d268f46ece3a8d6616ea' + - 'a592144be48ee1e0a1595d3e5edfede5b27cec6c48ceb2ff' + - 'b42cb44275851b0ebf87dfc9aa2d0cb0805e9454b051dfe8' + - 'a29fadd82491a4b4c23f2d06ba45483ab59976da1433c9ce' + - '500164b957a04cf62dd67595319b512fc4b998424d1164dd' + - 'bbe5d1a0f7257cbb04ec9b5ed92079a1502d98725023ecb2', - pub: '3bf836229c7dd874fe37c1790d201e82ed8e192ed61571ca' + - '7285264974eb2a0171f3747b2fc23969a916cbd21e14f7e2' + - 'f0d72dcd2247affba926f9e7bb99944cb5609aed85e71b89' + - 'e89d2651550cb5bd8281bd3144066af78f194032aa777739' + - 'cccb7862a1af401f99f7e5c693f25ddce2dedd9686633820' + - 'd28d0f5ed0c6b5a094f5fe6170b8e2cbc9dff118398baee6' + - 'e895a6301cb6e881b3cae749a5bdf5c56fc897ff68bc73f2' + - '4811bb108b882872bade1f147d886a415cda2b93dd90190c' + - 'be5c2dd53fe78add5960e97f58ff2506afe437f4cf4c912a' + - '397c1a2139ac6207d3ab76e6b7ffd23bb6866dd7f87a9ae5' + - '578789084ff2d06ea0d30156d7a10496e8ebe094f5703539' + - '730f5fdbebc066de417be82c99c7da59953071f49da7878d' + - 'a588775ff2a7f0084de390f009f372af75cdeba292b08ea8' + - '4bd13a87e1ca678f9ad148145f7cef3620d69a891be46fbb' + - 'cad858e2401ec0fd72abdea2f643e6d0197b7646fbb83220' + - '0f4cf7a7f6a7559f9fb0d0f1680822af9dbd8dec4cd1b5e1' + - '7bc799e902d9fe746ddf41da3b7020350d3600347398999a' + - 'baf75d53e03ad2ee17de8a2032f1008c6c2e6618b62f225b' + - 'a2f350179445debe68500fcbb6cae970a9920e321b468b74' + - '5fb524fb88abbcacdca121d737c44d30724227a99745c209' + - 'b970d1ff93bbc9f28b01b4e714d6c9cbd9ea032d4e964d8e' + - '8fff01db095160c20b7646d9fcd314c4bc11bcc232aeccc0' + - 'fbedccbc786951025597522eef283e3f56b44561a0765783' + - '420128638c257e54b972a76e4261892d81222b3e2039c61a' + - 'ab8408fcaac3d634f848ab3ee65ea1bd13c6cd75d2e78060' + - 'e13cf67fbef8de66d2049e26c0541c679fff3e6afc290efe' + - '875c213df9678e4a7ec484bc87dae5f0a1c26d7583e38941' + - 'b7c68b004d4df8b004b666f9448aac1cc3ea21461f41ea5d' + - 'd0f7a9e6161cfe0f58bcfd304bdc11d78c2e9d542e86c0b5' + - '6985cc83f693f686eaac17411a8247bf62f5ccc7782349b5' + - 'cc1f20e312fa2acc0197154d1bfee507e8db77e8f2732f2d' + - '641440ccf248e8643b2bd1e1f9e8239356ab91098fcb431d', - q: 'a899c59999bf877d96442d284359783bdc64b5f878b688fe' + - '51407f0526e616553ad0aaaac4d5bed3046f10a1faaf42bb' + - '2342dc4b7908eea0c46e4c4576897675c2bfdc4467870d3d' + - 'cd90adaed4359237a4bc6924bfb99aa6bf5f5ede15b574ea' + - 'e977eac096f3c67d09bda574c6306c6123fa89d2f086b8dc' + - 'ff92bc570c18d83fe6c810ccfd22ce4c749ef5e6ead3fffe' + - 'c63d95e0e3fde1df9db6a35fa1d107058f37e41957769199' + - 'd945dd7a373622c65f0af3fd9eb1ddc5c764bbfaf7a3dc37' + - '2548e683b970dac4aa4b9869080d2376c9adecebb84e172c' + - '09aeeb25fb8df23e60033260c4f8aac6b8b98ab894b1fb84' + - 'ebb83c0fb2081c3f3eee07f44e24d8fabf76f19ed167b0d7' + - 'ff971565aa4efa3625fce5a43ceeaa3eebb3ce88a00f597f' + - '048c69292b38dba2103ecdd5ec4ccfe3b2d87fa6202f334b' + - 'c1cab83b608dfc875b650b69f2c7e23c0b2b4adf149a6100' + - 'db1b6dbad4679ecb1ea95eafaba3bd00db11c2134f5a8686' + - '358b8b2ab49a1b2e85e1e45caeac5cd4dc0b3b5fffba8871' + - '1c6baf399edd48dad5e5c313702737a6dbdcede80ca358e5' + - '1d1c4fe42e8948a084403f61baed38aa9a1a5ce2918e9f33' + - '100050a430b47bc592995606440272a4994677577a6aaa1b' + - 'a101045dbec5a4e9566dab5445d1af3ed19519f07ac4e2a8' + - 'bd0a84b01978f203a9125a0be020f71fab56c2c9e344d4f4' + - '12d53d3cd8eb74ca5122002e931e3cb0bd4b7492436be17a' + - 'd7ebe27148671f59432c36d8c56eb762655711cfc8471f70' + - '83a8b7283bcb3b1b1d47d37c23d030288cfcef05fbdb4e16' + - '652ee03ee7b77056a808cd700bc3d9ef826eca9a59be959c' + - '947c865d6b372a1ca2d503d7df6d7611b12111665438475a' + - '1c64145849b3da8c2d343410df892d958db232617f9896f1' + - 'de95b8b5a47132be80dd65298c7f2047858409bf762dbc05' + - 'a62ca392ac40cfb8201a0607a2cae07d99a307625f2b2d04' + - 'fe83fbd3ab53602263410f143b73d5b46fc761882e78c782' + - 'd2c36e716a770a7aefaf7f76cea872db7bffefdbc4c2f9e0' + - '39c19adac915e7a63dcb8c8c78c113f29a3e0bc10e100ce0', - qs: '6f0a2fb763eaeb8eb324d564f03d4a55fdcd709e5f1b65e9' + - '5702b0141182f9f945d71bc3e64a7dfdae7482a7dd5a4e58' + - 'bc38f78de2013f2c468a621f08536969d2c8d011bb3bc259' + - '2124692c91140a5472cad224acdacdeae5751dadfdf068b8' + - '77bfa7374694c6a7be159fc3d24ff9eeeecaf62580427ad8' + - '622d48c51a1c4b1701d768c79d8c819776e096d2694107a2' + - 'f3ec0c32224795b59d32894834039dacb369280afb221bc0' + - '90570a93cf409889b818bb30cccee98b2aa26dbba0f28499' + - '08e1a3cd43fa1f1fb71049e5c77c3724d74dc351d9989057' + - '37bbda3805bd6b1293da8774410fb66e3194e18cdb304dd9' + - 'a0b59b583dcbc9fc045ac9d56aea5cfc9f8a0b95da1e11b7' + - '574d1f976e45fe12294997fac66ca0b83fc056183549e850' + - 'a11413cc4abbe39a211e8c8cbf82f2a23266b3c10ab9e286' + - '07a1b6088909cddff856e1eb6b2cde8bdac53fa939827736' + - 'ca1b892f6c95899613442bd02dbdb747f02487718e2d3f22' + - 'f73734d29767ed8d0e346d0c4098b6fdcb4df7d0c4d29603' + - '5bffe80d6c65ae0a1b814150d349096baaf950f2caf298d2' + - 'b292a1d48cf82b10734fe8cedfa16914076dfe3e9b51337b' + - 'ed28ea1e6824bb717b641ca0e526e175d3e5ed7892aebab0' + - 'f207562cc938a821e2956107c09b6ce4049adddcd0b7505d' + - '49ae6c69a20122461102d465d93dc03db026be54c303613a' + - 'b8e5ce3fd4f65d0b6162ff740a0bf5469ffd442d8c509cd2' + - '3b40dab90f6776ca17fc0678774bd6eee1fa85ababa52ec1' + - 'a15031eb677c6c488661dddd8b83d6031fe294489ded5f08' + - '8ad1689a14baeae7e688afa3033899c81f58de39b392ca94' + - 'af6f15a46f19fa95c06f9493c8b96a9be25e78b9ea35013b' + - 'caa76de6303939299d07426a88a334278fc3d0d9fa71373e' + - 'be51d3c1076ab93a11d3d0d703366ff8cde4c11261d488e5' + - '60a2bdf3bfe2476032294800d6a4a39d306e65c6d7d8d66e' + - '5ec63eee94531e83a9bddc458a2b508285c0ee10b7bd94da' + - '2815a0c5bd5b2e15cbe66355e42f5af8955cdfc0b3a4996d' + - '288db1f4b32b15643b18193e378cb7491f3c3951cdd044b1' + - 'a519571bffac2da986f5f1d506c66530a55f70751e24fa8e' + - 'd83ac2347f4069fb561a5565e78c6f0207da24e889a93a96' + - '65f717d9fe8a2938a09ab5f81be7ccecf466c0397fc15a57' + - '469939793f302739765773c256a3ca55d0548afd117a7cae' + - '98ca7e0d749a130c7b743d376848e255f8fdbe4cb4480b63' + - 'cd2c015d1020cf095d175f3ca9dcdfbaf1b2a6e6468eee4c' + - 'c750f2132a77f376bd9782b9d0ff4da98621b898e251a263' + - '4301ba2214a8c430b2f7a79dbbfd6d7ff6e9b0c137b025ff' + - '587c0bf912f0b19d4fff96b1ecd2ca990c89b386055c60f2' + - '3b94214bd55096f17a7b2c0fa12b333235101cd6f28a128c' + - '782e8a72671adadebbd073ded30bd7f09fb693565dcf0bf3' + - '090c21d13e5b0989dd8956f18f17f4f69449a13549c9d80a' + - '77e5e61b5aeeee9528634100e7bc390672f0ded1ca53555b' + - 'abddbcf700b9da6192255bddf50a76b709fbed251dce4c7e' + - '1ca36b85d1e97c1bc9d38c887a5adf140f9eeef674c31422' + - 'e65f63cae719f8c1324e42fa5fd8500899ef5aa3f9856aa7' + - 'ce10c85600a040343204f36bfeab8cfa6e9deb8a2edd2a8e' + - '018d00c7c9fa3a251ad0f57183c37e6377797653f382ec7a' + - '2b0145e16d3c856bc3634b46d90d7198aff12aff88a30e34' + - 'e2bfaf62705f3382576a9d3eeb0829fca2387b5b654af46e' + - '5cf6316fb57d59e5ea6c369061ac64d99671b0e516529dd5' + - 'd9c48ea0503e55fee090d36c5ea8b5954f6fcc0060794e1c' + - 'b7bc24aa1e5c0142fd4ce6e8fd5aa92a7bf84317ea9e1642' + - 'b6995bac6705adf93cbce72433ed0871139970d640f67b78' + - 'e63a7a6d849db2567df69ac7d79f8c62664ac221df228289' + - 'd0a4f9ebd9acb4f87d49da64e51a619fd3f3baccbd9feb12' + - '5abe0cc2c8d17ed1d8546da2b6c641f4d3020a5f9b9f26ac' + - '16546c2d61385505612275ea344c2bbf1ce890023738f715' + - '5e9eba6a071678c8ebd009c328c3eb643679de86e69a9fa5' + - '67a9e146030ff03d546310a0a568c5ba0070e0da22f2cef8' + - '54714b04d399bbc8fd261f9e8efcd0e83bdbc3f5cfb2d024' + - '3e398478cc598e000124eb8858f9df8f52946c2a1ca5c400' - } -}; diff --git a/src/node_modules/bn.js/test/pummel/dh-group-test.js b/src/node_modules/bn.js/test/pummel/dh-group-test.js deleted file mode 100644 index 37a259f..0000000 --- a/src/node_modules/bn.js/test/pummel/dh-group-test.js +++ /dev/null @@ -1,23 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../../').BN; -var fixtures = require('../fixtures'); - -describe('BN.js/Slow DH test', function () { - var groups = fixtures.dhGroups; - Object.keys(groups).forEach(function (name) { - it('should match public key for ' + name + ' group', function () { - var group = groups[name]; - - this.timeout(3600 * 1000); - - var base = new BN(2); - var mont = BN.red(new BN(group.prime, 16)); - var priv = new BN(group.priv, 16); - var multed = base.toRed(mont).redPow(priv).fromRed(); - var actual = new Buffer(multed.toArray()); - assert.equal(actual.toString('hex'), group.pub); - }); - }); -}); diff --git a/src/node_modules/bn.js/test/red-test.js b/src/node_modules/bn.js/test/red-test.js deleted file mode 100644 index 75d2f5c..0000000 --- a/src/node_modules/bn.js/test/red-test.js +++ /dev/null @@ -1,243 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../').BN; - -describe('BN.js/Reduction context', function () { - function testMethod (name, fn) { - describe(name + ' method', function () { - it('should support add, iadd, sub, isub operations', function () { - var p = new BN(257); - var m = fn(p); - var a = new BN(123).toRed(m); - var b = new BN(231).toRed(m); - - assert.equal(a.redAdd(b).fromRed().toString(10), '97'); - assert.equal(a.redSub(b).fromRed().toString(10), '149'); - assert.equal(b.redSub(a).fromRed().toString(10), '108'); - - assert.equal(a.clone().redIAdd(b).fromRed().toString(10), '97'); - assert.equal(a.clone().redISub(b).fromRed().toString(10), '149'); - assert.equal(b.clone().redISub(a).fromRed().toString(10), '108'); - }); - - it('should support pow and mul operations', function () { - var p192 = new BN( - 'fffffffffffffffffffffffffffffffeffffffffffffffff', - 16); - var m = fn(p192); - var a = new BN(123); - var b = new BN(231); - var c = a.toRed(m).redMul(b.toRed(m)).fromRed(); - assert(c.cmp(a.mul(b).mod(p192)) === 0); - - assert.equal(a.toRed(m).redPow(new BN(3)).fromRed() - .cmp(a.sqr().mul(a)), 0); - assert.equal(a.toRed(m).redPow(new BN(4)).fromRed() - .cmp(a.sqr().sqr()), 0); - assert.equal(a.toRed(m).redPow(new BN(8)).fromRed() - .cmp(a.sqr().sqr().sqr()), 0); - assert.equal(a.toRed(m).redPow(new BN(9)).fromRed() - .cmp(a.sqr().sqr().sqr().mul(a)), 0); - assert.equal(a.toRed(m).redPow(new BN(17)).fromRed() - .cmp(a.sqr().sqr().sqr().sqr().mul(a)), 0); - assert.equal( - a.toRed(m).redPow(new BN('deadbeefabbadead', 16)).fromRed() - .toString(16), - '3aa0e7e304e320b68ef61592bcb00341866d6fa66e11a4d6'); - }); - - it('should sqrtm numbers', function () { - var p = new BN(263); - var m = fn(p); - var q = new BN(11).toRed(m); - - var qr = q.redSqrt(true, p); - assert.equal(qr.redSqr().cmp(q), 0); - - qr = q.redSqrt(false, p); - assert.equal(qr.redSqr().cmp(q), 0); - - p = new BN( - 'fffffffffffffffffffffffffffffffeffffffffffffffff', - 16); - m = fn(p); - - q = new BN(13).toRed(m); - qr = q.redSqrt(true, p); - assert.equal(qr.redSqr().cmp(q), 0); - - qr = q.redSqrt(false, p); - assert.equal(qr.redSqr().cmp(q), 0); - - // Tonelli-shanks - p = new BN(13); - m = fn(p); - q = new BN(10).toRed(m); - assert.equal(q.redSqrt().fromRed().toString(10), '7'); - }); - - it('should invm numbers', function () { - var p = new BN(257); - var m = fn(p); - var a = new BN(3).toRed(m); - var b = a.redInvm(); - assert.equal(a.redMul(b).fromRed().toString(16), '1'); - }); - - it('should invm numbers (regression)', function () { - var p = new BN( - 'ffffffff00000001000000000000000000000000ffffffffffffffffffffffff', - 16); - var a = new BN( - 'e1d969b8192fbac73ea5b7921896d6a2263d4d4077bb8e5055361d1f7f8163f3', - 16); - - var m = fn(p); - a = a.toRed(m); - - assert.equal(a.redInvm().fromRed().negative, 0); - }); - - it('should imul numbers', function () { - var p = new BN( - 'fffffffffffffffffffffffffffffffeffffffffffffffff', - 16); - var m = fn(p); - - var a = new BN('deadbeefabbadead', 16); - var b = new BN('abbadeadbeefdead', 16); - var c = a.mul(b).mod(p); - - assert.equal(a.toRed(m).redIMul(b.toRed(m)).fromRed().toString(16), - c.toString(16)); - }); - - it('should pow(base, 0) == 1', function () { - var base = new BN(256).toRed(BN.red('k256')); - var exponent = new BN(0); - var result = base.redPow(exponent); - assert.equal(result.toString(), '1'); - }); - - it('should reduce when converting to red', function () { - var p = new BN(257); - var m = fn(p); - var a = new BN(5).toRed(m); - - assert.doesNotThrow(function () { - var b = a.redISub(new BN(512).toRed(m)); - b.redISub(new BN(512).toRed(m)); - }); - }); - - it('redNeg and zero value', function () { - var a = new BN(0).toRed(BN.red('k256')).redNeg(); - assert.equal(a.isZero(), true); - }); - }); - } - - testMethod('Plain', BN.red); - testMethod('Montgomery', BN.mont); - - describe('Pseudo-Mersenne Primes', function () { - it('should reduce numbers mod k256', function () { - var p = BN._prime('k256'); - - assert.equal(p.ireduce(new BN(0xdead)).toString(16), 'dead'); - assert.equal(p.ireduce(new BN('deadbeef', 16)).toString(16), 'deadbeef'); - - var num = new BN('fedcba9876543210fedcba9876543210dead' + - 'fedcba9876543210fedcba9876543210dead', - 16); - var exp = num.mod(p.p).toString(16); - assert.equal(p.ireduce(num).toString(16), exp); - - var regr = new BN('f7e46df64c1815962bf7bc9c56128798' + - '3f4fcef9cb1979573163b477eab93959' + - '335dfb29ef07a4d835d22aa3b6797760' + - '70a8b8f59ba73d56d01a79af9', - 16); - exp = regr.mod(p.p).toString(16); - - assert.equal(p.ireduce(regr).toString(16), exp); - }); - - it('should not fail to invm number mod k256', function () { - var regr2 = new BN( - '6c150c4aa9a8cf1934485d40674d4a7cd494675537bda36d49405c5d2c6f496f', 16); - regr2 = regr2.toRed(BN.red('k256')); - assert.equal(regr2.redInvm().redMul(regr2).fromRed().cmpn(1), 0); - }); - - it('should correctly square the number', function () { - var p = BN._prime('k256').p; - var red = BN.red('k256'); - - var n = new BN('9cd8cb48c3281596139f147c1364a3ed' + - 'e88d3f310fdb0eb98c924e599ca1b3c9', - 16); - var expected = n.sqr().mod(p); - var actual = n.toRed(red).redSqr().fromRed(); - - assert.equal(actual.toString(16), expected.toString(16)); - }); - - it('redISqr should return right result', function () { - var n = new BN('30f28939', 16); - var actual = n.toRed(BN.red('k256')).redISqr().fromRed(); - assert.equal(actual.toString(16), '95bd93d19520eb1'); - }); - }); - - it('should avoid 4.1.0 regresion', function () { - function bits2int (obits, q) { - var bits = new BN(obits); - var shift = (obits.length << 3) - q.bitLength(); - if (shift > 0) { - bits.ishrn(shift); - } - return bits; - } - var t = new Buffer('aff1651e4cd6036d57aa8b2a05ccf1a9d5a40166340ecbbdc55' + - 'be10b568aa0aa3d05ce9a2fcec9df8ed018e29683c6051cb83e' + - '46ce31ba4edb045356a8d0d80b', 'hex'); - var g = new BN('5c7ff6b06f8f143fe8288433493e4769c4d988ace5be25a0e24809670' + - '716c613d7b0cee6932f8faa7c44d2cb24523da53fbe4f6ec3595892d1' + - 'aa58c4328a06c46a15662e7eaa703a1decf8bbb2d05dbe2eb956c142a' + - '338661d10461c0d135472085057f3494309ffa73c611f78b32adbb574' + - '0c361c9f35be90997db2014e2ef5aa61782f52abeb8bd6432c4dd097b' + - 'c5423b285dafb60dc364e8161f4a2a35aca3a10b1c4d203cc76a470a3' + - '3afdcbdd92959859abd8b56e1725252d78eac66e71ba9ae3f1dd24871' + - '99874393cd4d832186800654760e1e34c09e4d155179f9ec0dc4473f9' + - '96bdce6eed1cabed8b6f116f7ad9cf505df0f998e34ab27514b0ffe7', - 16); - var p = new BN('9db6fb5951b66bb6fe1e140f1d2ce5502374161fd6538df1648218642' + - 'f0b5c48c8f7a41aadfa187324b87674fa1822b00f1ecf8136943d7c55' + - '757264e5a1a44ffe012e9936e00c1d3e9310b01c7d179805d3058b2a9' + - 'f4bb6f9716bfe6117c6b5b3cc4d9be341104ad4a80ad6c94e005f4b99' + - '3e14f091eb51743bf33050c38de235567e1b34c3d6a5c0ceaa1a0f368' + - '213c3d19843d0b4b09dcb9fc72d39c8de41f1bf14d4bb4563ca283716' + - '21cad3324b6a2d392145bebfac748805236f5ca2fe92b871cd8f9c36d' + - '3292b5509ca8caa77a2adfc7bfd77dda6f71125a7456fea153e433256' + - 'a2261c6a06ed3693797e7995fad5aabbcfbe3eda2741e375404ae25b', - 16); - var q = new BN('f2c3119374ce76c9356990b465374a17f23f9ed35089bd969f61c6dde' + - '9998c1f', 16); - var k = bits2int(t, q); - var expectedR = '89ec4bb1400eccff8e7d9aa515cd1de7803f2daff09693ee7fd1353e' + - '90a68307'; - var r = g.toRed(BN.mont(p)).redPow(k).fromRed().mod(q); - assert.equal(r.toString(16), expectedR); - }); - - it('K256.split for 512 bits number should return equal numbers', function () { - var red = BN.red('k256'); - var input = new BN(1).iushln(512).subn(1); - assert.equal(input.bitLength(), 512); - var output = new BN(0); - red.prime.split(input, output); - assert.equal(input.cmp(output), 0); - }); -}); diff --git a/src/node_modules/bn.js/test/utils-test.js b/src/node_modules/bn.js/test/utils-test.js deleted file mode 100644 index 04687fa..0000000 --- a/src/node_modules/bn.js/test/utils-test.js +++ /dev/null @@ -1,331 +0,0 @@ -/* global describe, it */ - -var assert = require('assert'); -var BN = require('../').BN; - -describe('BN.js/Utils', function () { - describe('.toString()', function () { - describe('binary padding', function () { - it('should have a length of 256', function () { - var a = new BN(0); - - assert.equal(a.toString(2, 256).length, 256); - }); - }); - describe('hex padding', function () { - it('should have length of 8 from leading 15', function () { - var a = new BN('ffb9602', 16); - - assert.equal(a.toString('hex', 2).length, 8); - }); - - it('should have length of 8 from leading zero', function () { - var a = new BN('fb9604', 16); - - assert.equal(a.toString('hex', 8).length, 8); - }); - - it('should have length of 8 from leading zeros', function () { - var a = new BN(0); - - assert.equal(a.toString('hex', 8).length, 8); - }); - - it('should have length of 64 from leading 15', function () { - var a = new BN( - 'ffb96ff654e61130ba8422f0debca77a0ea74ae5ea8bca9b54ab64aabf01003', - 16); - - assert.equal(a.toString('hex', 2).length, 64); - }); - - it('should have length of 64 from leading zero', function () { - var a = new BN( - 'fb96ff654e61130ba8422f0debca77a0ea74ae5ea8bca9b54ab64aabf01003', - 16); - - assert.equal(a.toString('hex', 64).length, 64); - }); - }); - }); - - describe('.isNeg()', function () { - it('should return true for negative numbers', function () { - assert.equal(new BN(-1).isNeg(), true); - assert.equal(new BN(1).isNeg(), false); - assert.equal(new BN(0).isNeg(), false); - assert.equal(new BN('-0', 10).isNeg(), false); - }); - }); - - describe('.isOdd()', function () { - it('should return true for odd numbers', function () { - assert.equal(new BN(0).isOdd(), false); - assert.equal(new BN(1).isOdd(), true); - assert.equal(new BN(2).isOdd(), false); - assert.equal(new BN('-0', 10).isOdd(), false); - assert.equal(new BN('-1', 10).isOdd(), true); - assert.equal(new BN('-2', 10).isOdd(), false); - }); - }); - - describe('.isEven()', function () { - it('should return true for even numbers', function () { - assert.equal(new BN(0).isEven(), true); - assert.equal(new BN(1).isEven(), false); - assert.equal(new BN(2).isEven(), true); - assert.equal(new BN('-0', 10).isEven(), true); - assert.equal(new BN('-1', 10).isEven(), false); - assert.equal(new BN('-2', 10).isEven(), true); - }); - }); - - describe('.isZero()', function () { - it('should return true for zero', function () { - assert.equal(new BN(0).isZero(), true); - assert.equal(new BN(1).isZero(), false); - assert.equal(new BN(0xffffffff).isZero(), false); - }); - }); - - describe('.bitLength()', function () { - it('should return proper bitLength', function () { - assert.equal(new BN(0).bitLength(), 0); - assert.equal(new BN(0x1).bitLength(), 1); - assert.equal(new BN(0x2).bitLength(), 2); - assert.equal(new BN(0x3).bitLength(), 2); - assert.equal(new BN(0x4).bitLength(), 3); - assert.equal(new BN(0x8).bitLength(), 4); - assert.equal(new BN(0x10).bitLength(), 5); - assert.equal(new BN(0x100).bitLength(), 9); - assert.equal(new BN(0x123456).bitLength(), 21); - assert.equal(new BN('123456789', 16).bitLength(), 33); - assert.equal(new BN('8023456789', 16).bitLength(), 40); - }); - }); - - describe('.byteLength()', function () { - it('should return proper byteLength', function () { - assert.equal(new BN(0).byteLength(), 0); - assert.equal(new BN(0x1).byteLength(), 1); - assert.equal(new BN(0x2).byteLength(), 1); - assert.equal(new BN(0x3).byteLength(), 1); - assert.equal(new BN(0x4).byteLength(), 1); - assert.equal(new BN(0x8).byteLength(), 1); - assert.equal(new BN(0x10).byteLength(), 1); - assert.equal(new BN(0x100).byteLength(), 2); - assert.equal(new BN(0x123456).byteLength(), 3); - assert.equal(new BN('123456789', 16).byteLength(), 5); - assert.equal(new BN('8023456789', 16).byteLength(), 5); - }); - }); - - describe('.toArray()', function () { - it('should return [ 0 ] for `0`', function () { - var n = new BN(0); - assert.deepEqual(n.toArray('be'), [ 0 ]); - assert.deepEqual(n.toArray('le'), [ 0 ]); - }); - - it('should zero pad to desired lengths', function () { - var n = new BN(0x123456); - assert.deepEqual(n.toArray('be', 5), [ 0x00, 0x00, 0x12, 0x34, 0x56 ]); - assert.deepEqual(n.toArray('le', 5), [ 0x56, 0x34, 0x12, 0x00, 0x00 ]); - }); - - it('should throw when naturally larger than desired length', function () { - var n = new BN(0x123456); - assert.throws(function () { - n.toArray('be', 2); - }); - }); - }); - - describe('.toBuffer', function () { - it('should return proper Buffer', function () { - var n = new BN(0x123456); - assert.deepEqual(n.toBuffer('be', 5).toString('hex'), '0000123456'); - assert.deepEqual(n.toBuffer('le', 5).toString('hex'), '5634120000'); - }); - }); - - describe('.toNumber()', function () { - it('should return proper Number if below the limit', function () { - assert.deepEqual(new BN(0x123456).toNumber(), 0x123456); - assert.deepEqual(new BN(0x3ffffff).toNumber(), 0x3ffffff); - assert.deepEqual(new BN(0x4000000).toNumber(), 0x4000000); - assert.deepEqual(new BN(0x10000000000000).toNumber(), 0x10000000000000); - assert.deepEqual(new BN(0x10040004004000).toNumber(), 0x10040004004000); - assert.deepEqual(new BN(-0x123456).toNumber(), -0x123456); - assert.deepEqual(new BN(-0x3ffffff).toNumber(), -0x3ffffff); - assert.deepEqual(new BN(-0x4000000).toNumber(), -0x4000000); - assert.deepEqual(new BN(-0x10000000000000).toNumber(), -0x10000000000000); - assert.deepEqual(new BN(-0x10040004004000).toNumber(), -0x10040004004000); - }); - - it('should throw when number exceeds 53 bits', function () { - var n = new BN(1).iushln(54); - assert.throws(function () { - n.toNumber(); - }); - }); - }); - - describe('.zeroBits()', function () { - it('should return proper zeroBits', function () { - assert.equal(new BN(0).zeroBits(), 0); - assert.equal(new BN(0x1).zeroBits(), 0); - assert.equal(new BN(0x2).zeroBits(), 1); - assert.equal(new BN(0x3).zeroBits(), 0); - assert.equal(new BN(0x4).zeroBits(), 2); - assert.equal(new BN(0x8).zeroBits(), 3); - assert.equal(new BN(0x10).zeroBits(), 4); - assert.equal(new BN(0x100).zeroBits(), 8); - assert.equal(new BN(0x1000000).zeroBits(), 24); - assert.equal(new BN(0x123456).zeroBits(), 1); - }); - }); - - describe('.toJSON', function () { - it('should return hex string', function () { - assert.equal(new BN(0x123).toJSON(), '123'); - }); - }); - - describe('.cmpn', function () { - it('should return -1, 0, 1 correctly', function () { - assert.equal(new BN(42).cmpn(42), 0); - assert.equal(new BN(42).cmpn(43), -1); - assert.equal(new BN(42).cmpn(41), 1); - assert.equal(new BN(0x3fffffe).cmpn(0x3fffffe), 0); - assert.equal(new BN(0x3fffffe).cmpn(0x3ffffff), -1); - assert.equal(new BN(0x3fffffe).cmpn(0x3fffffd), 1); - assert.throws(function () { - new BN(0x3fffffe).cmpn(0x4000000); - }); - assert.equal(new BN(42).cmpn(-42), 1); - assert.equal(new BN(-42).cmpn(42), -1); - assert.equal(new BN(-42).cmpn(-42), 0); - }); - }); - - describe('.cmp', function () { - it('should return -1, 0, 1 correctly', function () { - assert.equal(new BN(42).cmp(new BN(42)), 0); - assert.equal(new BN(42).cmp(new BN(43)), -1); - assert.equal(new BN(42).cmp(new BN(41)), 1); - assert.equal(new BN(0x3fffffe).cmp(new BN(0x3fffffe)), 0); - assert.equal(new BN(0x3fffffe).cmp(new BN(0x3ffffff)), -1); - assert.equal(new BN(0x3fffffe).cmp(new BN(0x3fffffd)), 1); - assert.equal(new BN(0x3fffffe).cmp(new BN(0x4000000)), -1); - assert.equal(new BN(42).cmp(new BN(-42)), 1); - assert.equal(new BN(-42).cmp(new BN(42)), -1); - assert.equal(new BN(-42).cmp(new BN(-42)), 0); - }); - }); - - describe('comparison shorthands', function () { - it('.gtn greater than', function () { - assert.equal(new BN(3).gtn(2), true); - assert.equal(new BN(3).gtn(3), false); - assert.equal(new BN(3).gtn(4), false); - }); - it('.gt greater than', function () { - assert.equal(new BN(3).gt(new BN(2)), true); - assert.equal(new BN(3).gt(new BN(3)), false); - assert.equal(new BN(3).gt(new BN(4)), false); - }); - it('.gten greater than or equal', function () { - assert.equal(new BN(3).gten(3), true); - assert.equal(new BN(3).gten(2), true); - assert.equal(new BN(3).gten(4), false); - }); - it('.gte greater than or equal', function () { - assert.equal(new BN(3).gte(new BN(3)), true); - assert.equal(new BN(3).gte(new BN(2)), true); - assert.equal(new BN(3).gte(new BN(4)), false); - }); - it('.ltn less than', function () { - assert.equal(new BN(2).ltn(3), true); - assert.equal(new BN(2).ltn(2), false); - assert.equal(new BN(2).ltn(1), false); - }); - it('.lt less than', function () { - assert.equal(new BN(2).lt(new BN(3)), true); - assert.equal(new BN(2).lt(new BN(2)), false); - assert.equal(new BN(2).lt(new BN(1)), false); - }); - it('.lten less than or equal', function () { - assert.equal(new BN(3).lten(3), true); - assert.equal(new BN(3).lten(2), false); - assert.equal(new BN(3).lten(4), true); - }); - it('.lte less than or equal', function () { - assert.equal(new BN(3).lte(new BN(3)), true); - assert.equal(new BN(3).lte(new BN(2)), false); - assert.equal(new BN(3).lte(new BN(4)), true); - }); - it('.eqn equal', function () { - assert.equal(new BN(3).eqn(3), true); - assert.equal(new BN(3).eqn(2), false); - assert.equal(new BN(3).eqn(4), false); - }); - it('.eq equal', function () { - assert.equal(new BN(3).eq(new BN(3)), true); - assert.equal(new BN(3).eq(new BN(2)), false); - assert.equal(new BN(3).eq(new BN(4)), false); - }); - }); - - describe('.fromTwos', function () { - it('should convert from two\'s complement to negative number', function () { - assert.equal(new BN('00000000', 16).fromTwos(32).toNumber(), 0); - assert.equal(new BN('00000001', 16).fromTwos(32).toNumber(), 1); - assert.equal(new BN('7fffffff', 16).fromTwos(32).toNumber(), 2147483647); - assert.equal(new BN('80000000', 16).fromTwos(32).toNumber(), -2147483648); - assert.equal(new BN('f0000000', 16).fromTwos(32).toNumber(), -268435456); - assert.equal(new BN('f1234567', 16).fromTwos(32).toNumber(), -249346713); - assert.equal(new BN('ffffffff', 16).fromTwos(32).toNumber(), -1); - assert.equal(new BN('fffffffe', 16).fromTwos(32).toNumber(), -2); - assert.equal(new BN('fffffffffffffffffffffffffffffffe', 16) - .fromTwos(128).toNumber(), -2); - assert.equal(new BN('ffffffffffffffffffffffffffffffff' + - 'fffffffffffffffffffffffffffffffe', 16).fromTwos(256).toNumber(), -2); - assert.equal(new BN('ffffffffffffffffffffffffffffffff' + - 'ffffffffffffffffffffffffffffffff', 16).fromTwos(256).toNumber(), -1); - assert.equal(new BN('7fffffffffffffffffffffffffffffff' + - 'ffffffffffffffffffffffffffffffff', 16).fromTwos(256).toString(10), - new BN('5789604461865809771178549250434395392663499' + - '2332820282019728792003956564819967', 10).toString(10)); - assert.equal(new BN('80000000000000000000000000000000' + - '00000000000000000000000000000000', 16).fromTwos(256).toString(10), - new BN('-578960446186580977117854925043439539266349' + - '92332820282019728792003956564819968', 10).toString(10)); - }); - }); - - describe('.toTwos', function () { - it('should convert from negative number to two\'s complement', function () { - assert.equal(new BN(0).toTwos(32).toString(16), '0'); - assert.equal(new BN(1).toTwos(32).toString(16), '1'); - assert.equal(new BN(2147483647).toTwos(32).toString(16), '7fffffff'); - assert.equal(new BN('-2147483648', 10).toTwos(32).toString(16), '80000000'); - assert.equal(new BN('-268435456', 10).toTwos(32).toString(16), 'f0000000'); - assert.equal(new BN('-249346713', 10).toTwos(32).toString(16), 'f1234567'); - assert.equal(new BN('-1', 10).toTwos(32).toString(16), 'ffffffff'); - assert.equal(new BN('-2', 10).toTwos(32).toString(16), 'fffffffe'); - assert.equal(new BN('-2', 10).toTwos(128).toString(16), - 'fffffffffffffffffffffffffffffffe'); - assert.equal(new BN('-2', 10).toTwos(256).toString(16), - 'fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe'); - assert.equal(new BN('-1', 10).toTwos(256).toString(16), - 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); - assert.equal(new BN('5789604461865809771178549250434395392663' + - '4992332820282019728792003956564819967', 10).toTwos(256).toString(16), - '7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'); - assert.equal(new BN('-578960446186580977117854925043439539266' + - '34992332820282019728792003956564819968', 10).toTwos(256).toString(16), - '8000000000000000000000000000000000000000000000000000000000000000'); - }); - }); -}); diff --git a/src/node_modules/bn.js/util/genCombMulTo.js b/src/node_modules/bn.js/util/genCombMulTo.js deleted file mode 100644 index 8b456c7..0000000 --- a/src/node_modules/bn.js/util/genCombMulTo.js +++ /dev/null @@ -1,65 +0,0 @@ -'use strict'; - -// NOTE: This could be potentionally used to generate loop-less multiplications -function genCombMulTo (alen, blen) { - var len = alen + blen - 1; - var src = [ - 'var a = self.words;', - 'var b = num.words;', - 'var o = out.words;', - 'var c = 0;', - 'var lo;', - 'var mid;', - 'var hi;' - ]; - for (var i = 0; i < alen; i++) { - src.push('var a' + i + ' = a[' + i + '] | 0;'); - src.push('var al' + i + ' = a' + i + ' & 0x1fff;'); - src.push('var ah' + i + ' = a' + i + ' >>> 13;'); - } - for (i = 0; i < blen; i++) { - src.push('var b' + i + ' = b[' + i + '] | 0;'); - src.push('var bl' + i + ' = b' + i + ' & 0x1fff;'); - src.push('var bh' + i + ' = b' + i + ' >>> 13;'); - } - src.push(''); - src.push('out.negative = self.negative ^ num.negative;'); - src.push('out.length = ' + len + ';'); - - for (var k = 0; k < len; k++) { - var minJ = Math.max(0, k - alen + 1); - var maxJ = Math.min(k, blen - 1); - - src.push('\/* k = ' + k + ' *\/'); - src.push('var w' + k + ' = c;'); - src.push('c = 0;'); - for (var j = minJ; j <= maxJ; j++) { - i = k - j; - - src.push('lo = Math.imul(al' + i + ', bl' + j + ');'); - src.push('mid = Math.imul(al' + i + ', bh' + j + ');'); - src.push('mid = (mid + Math.imul(ah' + i + ', bl' + j + ')) | 0;'); - src.push('hi = Math.imul(ah' + i + ', bh' + j + ');'); - - src.push('w' + k + ' = (w' + k + ' + lo) | 0;'); - src.push('w' + k + ' = (w' + k + ' + ((mid & 0x1fff) << 13)) | 0;'); - src.push('c = (c + hi) | 0;'); - src.push('c = (c + (mid >>> 13)) | 0;'); - src.push('c = (c + (w' + k + ' >>> 26)) | 0;'); - src.push('w' + k + ' &= 0x3ffffff;'); - } - } - // Store in separate step for better memory access - for (k = 0; k < len; k++) { - src.push('o[' + k + '] = w' + k + ';'); - } - src.push('if (c !== 0) {', - ' o[' + k + '] = c;', - ' out.length++;', - '}', - 'return out;'); - - return src.join('\n'); -} - -console.log(genCombMulTo(10, 10)); diff --git a/src/node_modules/bn.js/util/genCombMulTo10.js b/src/node_modules/bn.js/util/genCombMulTo10.js deleted file mode 100644 index 4214ffd..0000000 --- a/src/node_modules/bn.js/util/genCombMulTo10.js +++ /dev/null @@ -1,64 +0,0 @@ -'use strict'; - -function genCombMulTo (alen, blen) { - var len = alen + blen - 1; - var src = [ - 'var a = self.words;', - 'var b = num.words;', - 'var o = out.words;', - 'var c = 0;', - 'var lo;', - 'var mid;', - 'var hi;' - ]; - for (var i = 0; i < alen; i++) { - src.push('var a' + i + ' = a[' + i + '] | 0;'); - src.push('var al' + i + ' = a' + i + ' & 0x1fff;'); - src.push('var ah' + i + ' = a' + i + ' >>> 13;'); - } - for (i = 0; i < blen; i++) { - src.push('var b' + i + ' = b[' + i + '] | 0;'); - src.push('var bl' + i + ' = b' + i + ' & 0x1fff;'); - src.push('var bh' + i + ' = b' + i + ' >>> 13;'); - } - src.push(''); - src.push('out.negative = self.negative ^ num.negative;'); - src.push('out.length = ' + len + ';'); - - for (var k = 0; k < len; k++) { - var minJ = Math.max(0, k - alen + 1); - var maxJ = Math.min(k, blen - 1); - - src.push('\/* k = ' + k + ' *\/'); - src.push('lo = Math.imul(al' + (k - minJ) + ', bl' + minJ + ');'); - src.push('mid = Math.imul(al' + (k - minJ) + ', bh' + minJ + ');'); - src.push('mid += Math.imul(ah' + (k - minJ) + ', bl' + minJ + ');'); - src.push('hi = Math.imul(ah' + (k - minJ) + ', bh' + minJ + ');'); - - for (var j = minJ + 1; j <= maxJ; j++) { - i = k - j; - - src.push('lo += Math.imul(al' + i + ', bl' + j + ');'); - src.push('mid += Math.imul(al' + i + ', bh' + j + ');'); - src.push('mid += Math.imul(ah' + i + ', bl' + j + ');'); - src.push('hi += Math.imul(ah' + i + ', bh' + j + ');'); - } - - src.push('var w' + k + ' = c + lo + ((mid & 0x1fff) << 13);'); - src.push('c = hi + (mid >>> 13) + (w' + k + ' >>> 26);'); - src.push('w' + k + ' &= 0x3ffffff;'); - } - // Store in separate step for better memory access - for (k = 0; k < len; k++) { - src.push('o[' + k + '] = w' + k + ';'); - } - src.push('if (c !== 0) {', - ' o[' + k + '] = c;', - ' out.length++;', - '}', - 'return out;'); - - return src.join('\n'); -} - -console.log(genCombMulTo(10, 10)); diff --git a/src/node_modules/boom/.npmignore b/src/node_modules/boom/.npmignore deleted file mode 100644 index 77ba16c..0000000 --- a/src/node_modules/boom/.npmignore +++ /dev/null @@ -1,18 +0,0 @@ -.idea -*.iml -npm-debug.log -dump.rdb -node_modules -results.tap -results.xml -npm-shrinkwrap.json -config.json -.DS_Store -*/.DS_Store -*/*/.DS_Store -._* -*/._* -*/*/._* -coverage.* -lib-cov - diff --git a/src/node_modules/boom/.travis.yml b/src/node_modules/boom/.travis.yml deleted file mode 100755 index dd1b24f..0000000 --- a/src/node_modules/boom/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js - -node_js: - - 0.10 - - 4.0 - -sudo: false - diff --git a/src/node_modules/boom/CONTRIBUTING.md b/src/node_modules/boom/CONTRIBUTING.md deleted file mode 100644 index 8928361..0000000 --- a/src/node_modules/boom/CONTRIBUTING.md +++ /dev/null @@ -1 +0,0 @@ -Please view our [hapijs contributing guide](https://github.com/hapijs/hapi/blob/master/CONTRIBUTING.md). diff --git a/src/node_modules/boom/LICENSE b/src/node_modules/boom/LICENSE deleted file mode 100755 index 3946889..0000000 --- a/src/node_modules/boom/LICENSE +++ /dev/null @@ -1,28 +0,0 @@ -Copyright (c) 2012-2014, Walmart and other 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. - * The names of any contributors may not be used to endorse or promote - products derived from this software without specific prior written - permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY -DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - * * * - -The complete list of contributors can be found at: https://github.com/hapijs/boom/graphs/contributors \ No newline at end of file diff --git a/src/node_modules/boom/README.md b/src/node_modules/boom/README.md deleted file mode 100755 index cbd91c9..0000000 --- a/src/node_modules/boom/README.md +++ /dev/null @@ -1,652 +0,0 @@ -![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png) - -HTTP-friendly error objects - -[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom) -[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom) - -Lead Maintainer: [Adam Bretz](https://github.com/arb) - -**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response -object (instance of `Error`) which includes the following properties: -- `isBoom` - if `true`, indicates this is a `Boom` object instance. -- `isServer` - convenience bool indicating status code >= 500. -- `message` - the error message. -- `output` - the formatted response. Can be directly manipulated after object construction to return a custom - error response. Allowed root keys: - - `statusCode` - the HTTP status code (typically 4xx or 5xx). - - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content. - - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any - changes will be lost - if `reformat()` is called. Any content allowed and by default includes the following content: - - `statusCode` - the HTTP status code, derived from `error.output.statusCode`. - - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`. - - `message` - the error message derived from `error.message`. -- inherited `Error` properties. - -The `Boom` object also supports the following method: -- `reformat()` - rebuilds `error.output` using the other object properties. - -## Overview - -- Helper methods - - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message) - - [`create(statusCode, [message], [data])`](#createstatuscode-message-data) -- HTTP 4xx Errors - - 400: [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data) - - 401: [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes) - - 403: [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data) - - 404: [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data) - - 405: [`Boom.methodNotAllowed([message], [data])`](#boommethodnotallowedmessage-data) - - 406: [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data) - - 407: [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data) - - 408: [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data) - - 409: [`Boom.conflict([message], [data])`](#boomconflictmessage-data) - - 410: [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data) - - 411: [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data) - - 412: [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data) - - 413: [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data) - - 414: [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data) - - 415: [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data) - - 416: [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data) - - 417: [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data) - - 422: [`Boom.badData([message], [data])`](#boombaddatamessage-data) - - 428: [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data) - - 429: [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data) -- HTTP 5xx Errors - - 500: [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data) - - 501: [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data) - - 502: [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data) - - 503: [`Boom.serverTimeout([message], [data])`](#boomservertimeoutmessage-data) - - 504: [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data) -- [FAQ](#faq) - - -## Helper Methods - -### `wrap(error, [statusCode], [message])` - -Decorates an error with the **boom** properties where: -- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object. -- `statusCode` - optional HTTP status code. Defaults to `500`. -- `message` - optional message string. If the error already has a message, it adds the message as a prefix. - Defaults to no message. - -```js -var error = new Error('Unexpected input'); -Boom.wrap(error, 400); -``` - -### `create(statusCode, [message], [data])` - -Generates an `Error` object with the **boom** decorations where: -- `statusCode` - an HTTP error code number. Must be greater or equal 400. -- `message` - optional message string. -- `data` - additional error data set to `error.data` property. - -```js -var error = Boom.create(400, 'Bad request', { timestamp: Date.now() }); -``` - -## HTTP 4xx Errors - -### `Boom.badRequest([message], [data])` - -Returns a 400 Bad Request error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.badRequest('invalid query'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 400, - "error": "Bad Request", - "message": "invalid query" -} -``` - -### `Boom.unauthorized([message], [scheme], [attributes])` - -Returns a 401 Unauthorized error where: -- `message` - optional message. -- `scheme` can be one of the following: - - an authentication scheme name - - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header. -- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used - when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the - 'WWW-Authenticate' in the format of 'key="value"' as well as in the response payload under the `attributes` key. - `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as - the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header - will not be present and `isMissing` will be true on the error object. - -If either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response. - -```js -Boom.unauthorized('invalid password'); -``` - -Generates the following response: - -```json -"payload": { - "statusCode": 401, - "error": "Unauthorized", - "message": "invalid password" -}, -"headers" {} -``` - -```js -Boom.unauthorized('invalid password', 'sample'); -``` - -Generates the following response: - -```json -"payload": { - "statusCode": 401, - "error": "Unauthorized", - "message": "invalid password", - "attributes": { - "error": "invalid password" - } -}, -"headers" { - "WWW-Authenticate": "sample error=\"invalid password\"" -} -``` - -```js -Boom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' }); -``` - -Generates the following response: - -```json -"payload": { - "statusCode": 401, - "error": "Unauthorized", - "message": "invalid password", - "attributes": { - "error": "invalid password", - "ttl": 0, - "cache": "", - "foo": "bar" - } -}, -"headers" { - "WWW-Authenticate": "sample ttl=\"0\", cache=\"\", foo=\"bar\", error=\"invalid password\"" -} -``` - -### `Boom.forbidden([message], [data])` - -Returns a 403 Forbidden error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.forbidden('try again some time'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 403, - "error": "Forbidden", - "message": "try again some time" -} -``` - -### `Boom.notFound([message], [data])` - -Returns a 404 Not Found error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.notFound('missing'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 404, - "error": "Not Found", - "message": "missing" -} -``` - -### `Boom.methodNotAllowed([message], [data])` - -Returns a 405 Method Not Allowed error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.methodNotAllowed('that method is not allowed'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 405, - "error": "Method Not Allowed", - "message": "that method is not allowed" -} -``` - -### `Boom.notAcceptable([message], [data])` - -Returns a 406 Not Acceptable error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.notAcceptable('unacceptable'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 406, - "error": "Not Acceptable", - "message": "unacceptable" -} -``` - -### `Boom.proxyAuthRequired([message], [data])` - -Returns a 407 Proxy Authentication Required error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.proxyAuthRequired('auth missing'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 407, - "error": "Proxy Authentication Required", - "message": "auth missing" -} -``` - -### `Boom.clientTimeout([message], [data])` - -Returns a 408 Request Time-out error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.clientTimeout('timed out'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 408, - "error": "Request Time-out", - "message": "timed out" -} -``` - -### `Boom.conflict([message], [data])` - -Returns a 409 Conflict error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.conflict('there was a conflict'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 409, - "error": "Conflict", - "message": "there was a conflict" -} -``` - -### `Boom.resourceGone([message], [data])` - -Returns a 410 Gone error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.resourceGone('it is gone'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 410, - "error": "Gone", - "message": "it is gone" -} -``` - -### `Boom.lengthRequired([message], [data])` - -Returns a 411 Length Required error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.lengthRequired('length needed'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 411, - "error": "Length Required", - "message": "length needed" -} -``` - -### `Boom.preconditionFailed([message], [data])` - -Returns a 412 Precondition Failed error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.preconditionFailed(); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 412, - "error": "Precondition Failed" -} -``` - -### `Boom.entityTooLarge([message], [data])` - -Returns a 413 Request Entity Too Large error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.entityTooLarge('too big'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 413, - "error": "Request Entity Too Large", - "message": "too big" -} -``` - -### `Boom.uriTooLong([message], [data])` - -Returns a 414 Request-URI Too Large error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.uriTooLong('uri is too long'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 414, - "error": "Request-URI Too Large", - "message": "uri is too long" -} -``` - -### `Boom.unsupportedMediaType([message], [data])` - -Returns a 415 Unsupported Media Type error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.unsupportedMediaType('that media is not supported'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 415, - "error": "Unsupported Media Type", - "message": "that media is not supported" -} -``` - -### `Boom.rangeNotSatisfiable([message], [data])` - -Returns a 416 Requested Range Not Satisfiable error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.rangeNotSatisfiable(); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 416, - "error": "Requested Range Not Satisfiable" -} -``` - -### `Boom.expectationFailed([message], [data])` - -Returns a 417 Expectation Failed error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.expectationFailed('expected this to work'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 417, - "error": "Expectation Failed", - "message": "expected this to work" -} -``` - -### `Boom.badData([message], [data])` - -Returns a 422 Unprocessable Entity error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.badData('your data is bad and you should feel bad'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 422, - "error": "Unprocessable Entity", - "message": "your data is bad and you should feel bad" -} -``` - -### `Boom.preconditionRequired([message], [data])` - -Returns a 428 Precondition Required error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.preconditionRequired('you must supply an If-Match header'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 428, - "error": "Precondition Required", - "message": "you must supply an If-Match header" -} -``` - -### `Boom.tooManyRequests([message], [data])` - -Returns a 429 Too Many Requests error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.tooManyRequests('you have exceeded your request limit'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 429, - "error": "Too Many Requests", - "message": "you have exceeded your request limit" -} -``` - -## HTTP 5xx Errors - -All 500 errors hide your message from the end user. Your message is recorded in the server log. - -### `Boom.badImplementation([message], [data])` - -Returns a 500 Internal Server Error error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.badImplementation('terrible implementation'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 500, - "error": "Internal Server Error", - "message": "An internal server error occurred" -} -``` - -### `Boom.notImplemented([message], [data])` - -Returns a 501 Not Implemented error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.notImplemented('method not implemented'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 501, - "error": "Not Implemented", - "message": "method not implemented" -} -``` - -### `Boom.badGateway([message], [data])` - -Returns a 502 Bad Gateway error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.badGateway('that is a bad gateway'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 502, - "error": "Bad Gateway", - "message": "that is a bad gateway" -} -``` - -### `Boom.serverTimeout([message], [data])` - -Returns a 503 Service Unavailable error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.serverTimeout('unavailable'); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 503, - "error": "Service Unavailable", - "message": "unavailable" -} -``` - -### `Boom.gatewayTimeout([message], [data])` - -Returns a 504 Gateway Time-out error where: -- `message` - optional message. -- `data` - optional additional error data. - -```js -Boom.gatewayTimeout(); -``` - -Generates the following response payload: - -```json -{ - "statusCode": 504, - "error": "Gateway Time-out" -} -``` - -## F.A.Q. - -###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives? - -There is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the ["Error transformation"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation. diff --git a/src/node_modules/boom/images/boom.png b/src/node_modules/boom/images/boom.png deleted file mode 100755 index 373bc13..0000000 Binary files a/src/node_modules/boom/images/boom.png and /dev/null differ diff --git a/src/node_modules/boom/lib/index.js b/src/node_modules/boom/lib/index.js deleted file mode 100755 index 6bdea69..0000000 --- a/src/node_modules/boom/lib/index.js +++ /dev/null @@ -1,318 +0,0 @@ -// Load modules - -var Http = require('http'); -var Hoek = require('hoek'); - - -// Declare internals - -var internals = {}; - -exports.wrap = function (error, statusCode, message) { - - Hoek.assert(error instanceof Error, 'Cannot wrap non-Error object'); - return (error.isBoom ? error : internals.initialize(error, statusCode || 500, message)); -}; - - -exports.create = function (statusCode, message, data) { - - return internals.create(statusCode, message, data, exports.create); -}; - -internals.create = function (statusCode, message, data, ctor) { - - var error = new Error(message ? message : undefined); // Avoids settings null message - Error.captureStackTrace(error, ctor); // Filter the stack to our external API - error.data = data || null; - internals.initialize(error, statusCode); - return error; -}; - -internals.initialize = function (error, statusCode, message) { - - var numberCode = parseInt(statusCode, 10); - Hoek.assert(!isNaN(numberCode) && numberCode >= 400, 'First argument must be a number (400+):', statusCode); - - error.isBoom = true; - error.isServer = numberCode >= 500; - - if (!error.hasOwnProperty('data')) { - error.data = null; - } - - error.output = { - statusCode: numberCode, - payload: {}, - headers: {} - }; - - error.reformat = internals.reformat; - error.reformat(); - - if (!message && - !error.message) { - - message = error.output.payload.error; - } - - if (message) { - error.message = (message + (error.message ? ': ' + error.message : '')); - } - - return error; -}; - - -internals.reformat = function () { - - this.output.payload.statusCode = this.output.statusCode; - this.output.payload.error = Http.STATUS_CODES[this.output.statusCode] || 'Unknown'; - - if (this.output.statusCode === 500) { - this.output.payload.message = 'An internal server error occurred'; // Hide actual error from user - } - else if (this.message) { - this.output.payload.message = this.message; - } -}; - - -// 4xx Client Errors - -exports.badRequest = function (message, data) { - - return internals.create(400, message, data, exports.badRequest); -}; - - -exports.unauthorized = function (message, scheme, attributes) { // Or function (message, wwwAuthenticate[]) - - var err = internals.create(401, message, undefined, exports.unauthorized); - - if (!scheme) { - return err; - } - - var wwwAuthenticate = ''; - var i = 0; - var il = 0; - - if (typeof scheme === 'string') { - - // function (message, scheme, attributes) - - wwwAuthenticate = scheme; - - if (attributes || message) { - err.output.payload.attributes = {}; - } - - if (attributes) { - var names = Object.keys(attributes); - for (i = 0, il = names.length; i < il; ++i) { - var name = names[i]; - if (i) { - wwwAuthenticate += ','; - } - - var value = attributes[name]; - if (value === null || - value === undefined) { // Value can be zero - - value = ''; - } - wwwAuthenticate += ' ' + name + '="' + Hoek.escapeHeaderAttribute(value.toString()) + '"'; - err.output.payload.attributes[name] = value; - } - } - - if (message) { - if (attributes) { - wwwAuthenticate += ','; - } - wwwAuthenticate += ' error="' + Hoek.escapeHeaderAttribute(message) + '"'; - err.output.payload.attributes.error = message; - } - else { - err.isMissing = true; - } - } - else { - - // function (message, wwwAuthenticate[]) - - var wwwArray = scheme; - for (i = 0, il = wwwArray.length; i < il; ++i) { - if (i) { - wwwAuthenticate += ', '; - } - - wwwAuthenticate += wwwArray[i]; - } - } - - err.output.headers['WWW-Authenticate'] = wwwAuthenticate; - - return err; -}; - - -exports.forbidden = function (message, data) { - - return internals.create(403, message, data, exports.forbidden); -}; - - -exports.notFound = function (message, data) { - - return internals.create(404, message, data, exports.notFound); -}; - - -exports.methodNotAllowed = function (message, data) { - - return internals.create(405, message, data, exports.methodNotAllowed); -}; - - -exports.notAcceptable = function (message, data) { - - return internals.create(406, message, data, exports.notAcceptable); -}; - - -exports.proxyAuthRequired = function (message, data) { - - return internals.create(407, message, data, exports.proxyAuthRequired); -}; - - -exports.clientTimeout = function (message, data) { - - return internals.create(408, message, data, exports.clientTimeout); -}; - - -exports.conflict = function (message, data) { - - return internals.create(409, message, data, exports.conflict); -}; - - -exports.resourceGone = function (message, data) { - - return internals.create(410, message, data, exports.resourceGone); -}; - - -exports.lengthRequired = function (message, data) { - - return internals.create(411, message, data, exports.lengthRequired); -}; - - -exports.preconditionFailed = function (message, data) { - - return internals.create(412, message, data, exports.preconditionFailed); -}; - - -exports.entityTooLarge = function (message, data) { - - return internals.create(413, message, data, exports.entityTooLarge); -}; - - -exports.uriTooLong = function (message, data) { - - return internals.create(414, message, data, exports.uriTooLong); -}; - - -exports.unsupportedMediaType = function (message, data) { - - return internals.create(415, message, data, exports.unsupportedMediaType); -}; - - -exports.rangeNotSatisfiable = function (message, data) { - - return internals.create(416, message, data, exports.rangeNotSatisfiable); -}; - - -exports.expectationFailed = function (message, data) { - - return internals.create(417, message, data, exports.expectationFailed); -}; - -exports.badData = function (message, data) { - - return internals.create(422, message, data, exports.badData); -}; - - -exports.preconditionRequired = function (message, data) { - - return internals.create(428, message, data, exports.preconditionRequired); -}; - - -exports.tooManyRequests = function (message, data) { - - return internals.create(429, message, data, exports.tooManyRequests); -}; - - -// 5xx Server Errors - -exports.internal = function (message, data, statusCode) { - - return internals.serverError(message, data, statusCode, exports.internal); -}; - -internals.serverError = function (message, data, statusCode, ctor) { - - var error; - if (data instanceof Error) { - error = exports.wrap(data, statusCode, message); - } else { - error = internals.create(statusCode || 500, message, undefined, ctor); - error.data = data; - } - - return error; -}; - - -exports.notImplemented = function (message, data) { - - return internals.serverError(message, data, 501, exports.notImplemented); -}; - - -exports.badGateway = function (message, data) { - - return internals.serverError(message, data, 502, exports.badGateway); -}; - - -exports.serverTimeout = function (message, data) { - - return internals.serverError(message, data, 503, exports.serverTimeout); -}; - - -exports.gatewayTimeout = function (message, data) { - - return internals.serverError(message, data, 504, exports.gatewayTimeout); -}; - - -exports.badImplementation = function (message, data) { - - var err = internals.serverError(message, data, 500, exports.badImplementation); - err.isDeveloperError = true; - return err; -}; diff --git a/src/node_modules/boom/package.json b/src/node_modules/boom/package.json deleted file mode 100644 index 9ab19bf..0000000 --- a/src/node_modules/boom/package.json +++ /dev/null @@ -1,90 +0,0 @@ -{ - "_args": [ - [ - "boom@2.x.x", - "/media/Github/Vertinext2/src/node_modules/hawk" - ] - ], - "_from": "boom@>=2.0.0 <3.0.0", - "_id": "boom@2.10.1", - "_inCache": true, - "_installable": true, - "_location": "/boom", - "_nodeVersion": "0.10.40", - "_npmUser": { - "email": "arbretz@gmail.com", - "name": "arb" - }, - "_npmVersion": "2.11.1", - "_phantomChildren": {}, - "_requested": { - "name": "boom", - "raw": "boom@2.x.x", - "rawSpec": "2.x.x", - "scope": null, - "spec": ">=2.0.0 <3.0.0", - "type": "range" - }, - "_requiredBy": [ - "/cryptiles", - "/hawk" - ], - "_resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz", - "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "_shrinkwrap": null, - "_spec": "boom@2.x.x", - "_where": "/media/Github/Vertinext2/src/node_modules/hawk", - "bugs": { - "url": "https://github.com/hapijs/boom/issues" - }, - "dependencies": { - "hoek": "2.x.x" - }, - "description": "HTTP-friendly error objects", - "devDependencies": { - "code": "1.x.x", - "lab": "7.x.x" - }, - "directories": {}, - "dist": { - "shasum": "39c8918ceff5799f83f9492a848f625add0c766f", - "tarball": "http://registry.npmjs.org/boom/-/boom-2.10.1.tgz" - }, - "engines": { - "node": ">=0.10.40" - }, - "gitHead": "ff1a662a86b39426cdd18f4441b112d307a34a6f", - "homepage": "https://github.com/hapijs/boom#readme", - "keywords": [ - "error", - "http" - ], - "license": "BSD-3-Clause", - "main": "lib/index.js", - "maintainers": [ - { - "email": "eran@hueniverse.com", - "name": "hueniverse" - }, - { - "email": "wpreul@gmail.com", - "name": "wyatt" - }, - { - "email": "arbretz@gmail.com", - "name": "arb" - } - ], - "name": "boom", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/hapijs/boom.git" - }, - "scripts": { - "test": "lab -a code -t 100 -L", - "test-cov-html": "lab -a code -r html -o coverage.html -L" - }, - "version": "2.10.1" -} diff --git a/src/node_modules/boom/test/index.js b/src/node_modules/boom/test/index.js deleted file mode 100755 index 79a59e9..0000000 --- a/src/node_modules/boom/test/index.js +++ /dev/null @@ -1,654 +0,0 @@ -// Load modules - -var Code = require('code'); -var Boom = require('../lib'); -var Lab = require('lab'); - - -// Declare internals - -var internals = {}; - - -// Test shortcuts - -var lab = exports.lab = Lab.script(); -var describe = lab.describe; -var it = lab.it; -var expect = Code.expect; - - -it('returns the same object when already boom', function (done) { - - var error = Boom.badRequest(); - var wrapped = Boom.wrap(error); - expect(error).to.equal(wrapped); - done(); -}); - -it('returns an error with info when constructed using another error', function (done) { - - var error = new Error('ka-boom'); - error.xyz = 123; - var err = Boom.wrap(error); - expect(err.xyz).to.equal(123); - expect(err.message).to.equal('ka-boom'); - expect(err.output).to.deep.equal({ - statusCode: 500, - payload: { - statusCode: 500, - error: 'Internal Server Error', - message: 'An internal server error occurred' - }, - headers: {} - }); - expect(err.data).to.equal(null); - done(); -}); - -it('does not override data when constructed using another error', function (done) { - - var error = new Error('ka-boom'); - error.data = { useful: 'data' }; - var err = Boom.wrap(error); - expect(err.data).to.equal(error.data); - done(); -}); - -it('sets new message when none exists', function (done) { - - var error = new Error(); - var wrapped = Boom.wrap(error, 400, 'something bad'); - expect(wrapped.message).to.equal('something bad'); - done(); -}); - -it('throws when statusCode is not a number', function (done) { - - expect(function () { - - Boom.create('x'); - }).to.throw('First argument must be a number (400+): x'); - done(); -}); - -it('will cast a number-string to an integer', function (done) { - - var codes = [ - { input: '404', result: 404 }, - { input: '404.1', result: 404 }, - { input: 400, result: 400 }, - { input: 400.123, result: 400 }]; - for (var i = 0, il = codes.length; i < il; ++i) { - var code = codes[i]; - var err = Boom.create(code.input); - expect(err.output.statusCode).to.equal(code.result); - } - - done(); -}); - -it('throws when statusCode is not finite', function (done) { - - expect(function () { - - Boom.create(1 / 0); - }).to.throw('First argument must be a number (400+): null'); - done(); -}); - -it('sets error code to unknown', function (done) { - - var err = Boom.create(999); - expect(err.output.payload.error).to.equal('Unknown'); - done(); -}); - -describe('create()', function () { - - it('does not sets null message', function (done) { - - var error = Boom.unauthorized(null); - expect(error.output.payload.message).to.not.exist(); - expect(error.isServer).to.be.false(); - done(); - }); - - it('sets message and data', function (done) { - - var error = Boom.badRequest('Missing data', { type: 'user' }); - expect(error.data.type).to.equal('user'); - expect(error.output.payload.message).to.equal('Missing data'); - done(); - }); -}); - -describe('isBoom()', function () { - - it('returns true for Boom object', function (done) { - - expect(Boom.badRequest().isBoom).to.equal(true); - done(); - }); - - it('returns false for Error object', function (done) { - - expect((new Error()).isBoom).to.not.exist(); - done(); - }); -}); - -describe('badRequest()', function () { - - it('returns a 400 error statusCode', function (done) { - - var error = Boom.badRequest(); - - expect(error.output.statusCode).to.equal(400); - expect(error.isServer).to.be.false(); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badRequest('my message').message).to.equal('my message'); - done(); - }); - - it('sets the message to HTTP status if none provided', function (done) { - - expect(Boom.badRequest().message).to.equal('Bad Request'); - done(); - }); -}); - -describe('unauthorized()', function () { - - it('returns a 401 error statusCode', function (done) { - - var err = Boom.unauthorized(); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers).to.deep.equal({}); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.unauthorized('my message').message).to.equal('my message'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme', function (done) { - - var err = Boom.unauthorized('boom', 'Test'); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test error="boom"'); - done(); - }); - - it('returns a WWW-Authenticate header set to the schema array value', function (done) { - - var err = Boom.unauthorized(null, ['Test','one','two']); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test, one, two'); - done(); - }); - - it('returns a WWW-Authenticate header when passed a scheme and attributes', function (done) { - - var err = Boom.unauthorized('boom', 'Test', { a: 1, b: 'something', c: null, d: 0 }); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0", error="boom"'); - expect(err.output.payload.attributes).to.deep.equal({ a: 1, b: 'something', c: '', d: 0, error: 'boom' }); - done(); - }); - - it('returns a WWW-Authenticate header when passed attributes, missing error', function (done) { - - var err = Boom.unauthorized(null, 'Test', { a: 1, b: 'something', c: null, d: 0 }); - expect(err.output.statusCode).to.equal(401); - expect(err.output.headers['WWW-Authenticate']).to.equal('Test a="1", b="something", c="", d="0"'); - expect(err.isMissing).to.equal(true); - done(); - }); - - it('sets the isMissing flag when error message is empty', function (done) { - - var err = Boom.unauthorized('', 'Basic'); - expect(err.isMissing).to.equal(true); - done(); - }); - - it('does not set the isMissing flag when error message is not empty', function (done) { - - var err = Boom.unauthorized('message', 'Basic'); - expect(err.isMissing).to.equal(undefined); - done(); - }); - - it('sets a WWW-Authenticate when passed as an array', function (done) { - - var err = Boom.unauthorized('message', ['Basic', 'Example e="1"', 'Another x="3", y="4"']); - expect(err.output.headers['WWW-Authenticate']).to.equal('Basic, Example e="1", Another x="3", y="4"'); - done(); - }); -}); - - -describe('methodNotAllowed()', function () { - - it('returns a 405 error statusCode', function (done) { - - expect(Boom.methodNotAllowed().output.statusCode).to.equal(405); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.methodNotAllowed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('notAcceptable()', function () { - - it('returns a 406 error statusCode', function (done) { - - expect(Boom.notAcceptable().output.statusCode).to.equal(406); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notAcceptable('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('proxyAuthRequired()', function () { - - it('returns a 407 error statusCode', function (done) { - - expect(Boom.proxyAuthRequired().output.statusCode).to.equal(407); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.proxyAuthRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('clientTimeout()', function () { - - it('returns a 408 error statusCode', function (done) { - - expect(Boom.clientTimeout().output.statusCode).to.equal(408); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.clientTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('conflict()', function () { - - it('returns a 409 error statusCode', function (done) { - - expect(Boom.conflict().output.statusCode).to.equal(409); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.conflict('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('resourceGone()', function () { - - it('returns a 410 error statusCode', function (done) { - - expect(Boom.resourceGone().output.statusCode).to.equal(410); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.resourceGone('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('lengthRequired()', function () { - - it('returns a 411 error statusCode', function (done) { - - expect(Boom.lengthRequired().output.statusCode).to.equal(411); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.lengthRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('preconditionFailed()', function () { - - it('returns a 412 error statusCode', function (done) { - - expect(Boom.preconditionFailed().output.statusCode).to.equal(412); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.preconditionFailed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('entityTooLarge()', function () { - - it('returns a 413 error statusCode', function (done) { - - expect(Boom.entityTooLarge().output.statusCode).to.equal(413); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.entityTooLarge('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('uriTooLong()', function () { - - it('returns a 414 error statusCode', function (done) { - - expect(Boom.uriTooLong().output.statusCode).to.equal(414); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.uriTooLong('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('unsupportedMediaType()', function () { - - it('returns a 415 error statusCode', function (done) { - - expect(Boom.unsupportedMediaType().output.statusCode).to.equal(415); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.unsupportedMediaType('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('rangeNotSatisfiable()', function () { - - it('returns a 416 error statusCode', function (done) { - - expect(Boom.rangeNotSatisfiable().output.statusCode).to.equal(416); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.rangeNotSatisfiable('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('expectationFailed()', function () { - - it('returns a 417 error statusCode', function (done) { - - expect(Boom.expectationFailed().output.statusCode).to.equal(417); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.expectationFailed('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('badData()', function () { - - it('returns a 422 error statusCode', function (done) { - - expect(Boom.badData().output.statusCode).to.equal(422); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badData('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('preconditionRequired()', function () { - - it('returns a 428 error statusCode', function (done) { - - expect(Boom.preconditionRequired().output.statusCode).to.equal(428); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.preconditionRequired('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('tooManyRequests()', function () { - - it('returns a 429 error statusCode', function (done) { - - expect(Boom.tooManyRequests().output.statusCode).to.equal(429); - done(); - }); - - it('sets the message with the passed-in message', function (done) { - - expect(Boom.tooManyRequests('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('serverTimeout()', function () { - - it('returns a 503 error statusCode', function (done) { - - expect(Boom.serverTimeout().output.statusCode).to.equal(503); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.serverTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('forbidden()', function () { - - it('returns a 403 error statusCode', function (done) { - - expect(Boom.forbidden().output.statusCode).to.equal(403); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.forbidden('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('notFound()', function () { - - it('returns a 404 error statusCode', function (done) { - - expect(Boom.notFound().output.statusCode).to.equal(404); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notFound('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('internal()', function () { - - it('returns a 500 error statusCode', function (done) { - - expect(Boom.internal().output.statusCode).to.equal(500); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - var err = Boom.internal('my message'); - expect(err.message).to.equal('my message'); - expect(err.isServer).to.true(); - expect(err.output.payload.message).to.equal('An internal server error occurred'); - done(); - }); - - it('passes data on the callback if its passed in', function (done) { - - expect(Boom.internal('my message', { my: 'data' }).data.my).to.equal('data'); - done(); - }); - - it('returns an error with composite message', function (done) { - - try { - JSON.parse('{'); - } - catch (err) { - var boom = Boom.internal('Someting bad', err); - expect(boom.message).to.equal('Someting bad: Unexpected end of input'); - expect(boom.isServer).to.be.true(); - done(); - } - }); -}); - -describe('notImplemented()', function () { - - it('returns a 501 error statusCode', function (done) { - - expect(Boom.notImplemented().output.statusCode).to.equal(501); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.notImplemented('my message').message).to.equal('my message'); - done(); - }); -}); - - -describe('badGateway()', function () { - - it('returns a 502 error statusCode', function (done) { - - expect(Boom.badGateway().output.statusCode).to.equal(502); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.badGateway('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('gatewayTimeout()', function () { - - it('returns a 504 error statusCode', function (done) { - - expect(Boom.gatewayTimeout().output.statusCode).to.equal(504); - done(); - }); - - it('sets the message with the passed in message', function (done) { - - expect(Boom.gatewayTimeout('my message').message).to.equal('my message'); - done(); - }); -}); - -describe('badImplementation()', function () { - - it('returns a 500 error statusCode', function (done) { - - var err = Boom.badImplementation(); - expect(err.output.statusCode).to.equal(500); - expect(err.isDeveloperError).to.equal(true); - expect(err.isServer).to.be.true(); - done(); - }); -}); - -describe('stack trace', function () { - - it('should omit lib', function (done) { - - ['badRequest', 'unauthorized', 'forbidden', 'notFound', 'methodNotAllowed', - 'notAcceptable', 'proxyAuthRequired', 'clientTimeout', 'conflict', - 'resourceGone', 'lengthRequired', 'preconditionFailed', 'entityTooLarge', - 'uriTooLong', 'unsupportedMediaType', 'rangeNotSatisfiable', 'expectationFailed', - 'badData', 'preconditionRequired', 'tooManyRequests', - - // 500s - 'internal', 'notImplemented', 'badGateway', 'serverTimeout', 'gatewayTimeout', - 'badImplementation' - ].forEach(function (name) { - - var err = Boom[name](); - expect(err.stack).to.not.match(/\/lib\/index\.js/); - }); - - done(); - }); -}); diff --git a/src/node_modules/brace-expansion/.npmignore b/src/node_modules/brace-expansion/.npmignore deleted file mode 100644 index 353546a..0000000 --- a/src/node_modules/brace-expansion/.npmignore +++ /dev/null @@ -1,3 +0,0 @@ -test -.gitignore -.travis.yml diff --git a/src/node_modules/brace-expansion/README.md b/src/node_modules/brace-expansion/README.md deleted file mode 100644 index 1793929..0000000 --- a/src/node_modules/brace-expansion/README.md +++ /dev/null @@ -1,122 +0,0 @@ -# brace-expansion - -[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), -as known from sh/bash, in JavaScript. - -[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion) -[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion) - -[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion) - -## Example - -```js -var expand = require('brace-expansion'); - -expand('file-{a,b,c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('-v{,,}') -// => ['-v', '-v', '-v'] - -expand('file{0..2}.jpg') -// => ['file0.jpg', 'file1.jpg', 'file2.jpg'] - -expand('file-{a..c}.jpg') -// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg'] - -expand('file{2..0}.jpg') -// => ['file2.jpg', 'file1.jpg', 'file0.jpg'] - -expand('file{0..4..2}.jpg') -// => ['file0.jpg', 'file2.jpg', 'file4.jpg'] - -expand('file-{a..e..2}.jpg') -// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg'] - -expand('file{00..10..5}.jpg') -// => ['file00.jpg', 'file05.jpg', 'file10.jpg'] - -expand('{{A..C},{a..c}}') -// => ['A', 'B', 'C', 'a', 'b', 'c'] - -expand('ppp{,config,oe{,conf}}') -// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf'] -``` - -## API - -```js -var expand = require('brace-expansion'); -``` - -### var expanded = expand(str) - -Return an array of all possible and valid expansions of `str`. If none are -found, `[str]` is returned. - -Valid expansions are: - -```js -/^(.*,)+(.+)?$/ -// {a,b,...} -``` - -A comma seperated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -A numeric sequence from `x` to `y` inclusive, with optional increment. -If `x` or `y` start with a leading `0`, all the numbers will be padded -to have equal length. Negative numbers and backwards iteration work too. - -```js -/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/ -// {x..y[..incr]} -``` - -An alphabetic sequence from `x` to `y` inclusive, with optional increment. -`x` and `y` must be exactly one character, and if given, `incr` must be a -number. - -For compatibility reasons, the string `${` is not eligible for brace expansion. - -## Installation - -With [npm](https://npmjs.org) do: - -```bash -npm install brace-expansion -``` - -## Contributors - -- [Julian Gruber](https://github.com/juliangruber) -- [Isaac Z. Schlueter](https://github.com/isaacs) - -## License - -(MIT) - -Copyright (c) 2013 Julian Gruber <julian@juliangruber.com> - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/src/node_modules/brace-expansion/example.js b/src/node_modules/brace-expansion/example.js deleted file mode 100644 index 60ecfc7..0000000 --- a/src/node_modules/brace-expansion/example.js +++ /dev/null @@ -1,8 +0,0 @@ -var expand = require('./'); - -console.log(expand('http://any.org/archive{1996..1999}/vol{1..4}/part{a,b,c}.html')); -console.log(expand('http://www.numericals.com/file{1..100..10}.txt')); -console.log(expand('http://www.letters.com/file{a..z..2}.txt')); -console.log(expand('mkdir /usr/local/src/bash/{old,new,dist,bugs}')); -console.log(expand('chown root /usr/{ucb/{ex,edit},lib/{ex?.?*,how_ex}}')); - diff --git a/src/node_modules/brace-expansion/index.js b/src/node_modules/brace-expansion/index.js deleted file mode 100644 index 932718f..0000000 --- a/src/node_modules/brace-expansion/index.js +++ /dev/null @@ -1,191 +0,0 @@ -var concatMap = require('concat-map'); -var balanced = require('balanced-match'); - -module.exports = expandTop; - -var escSlash = '\0SLASH'+Math.random()+'\0'; -var escOpen = '\0OPEN'+Math.random()+'\0'; -var escClose = '\0CLOSE'+Math.random()+'\0'; -var escComma = '\0COMMA'+Math.random()+'\0'; -var escPeriod = '\0PERIOD'+Math.random()+'\0'; - -function numeric(str) { - return parseInt(str, 10) == str - ? parseInt(str, 10) - : str.charCodeAt(0); -} - -function escapeBraces(str) { - return str.split('\\\\').join(escSlash) - .split('\\{').join(escOpen) - .split('\\}').join(escClose) - .split('\\,').join(escComma) - .split('\\.').join(escPeriod); -} - -function unescapeBraces(str) { - return str.split(escSlash).join('\\') - .split(escOpen).join('{') - .split(escClose).join('}') - .split(escComma).join(',') - .split(escPeriod).join('.'); -} - - -// Basically just str.split(","), but handling cases -// where we have nested braced sections, which should be -// treated as individual members, like {a,{b,c},d} -function parseCommaParts(str) { - if (!str) - return ['']; - - var parts = []; - var m = balanced('{', '}', str); - - if (!m) - return str.split(','); - - var pre = m.pre; - var body = m.body; - var post = m.post; - var p = pre.split(','); - - p[p.length-1] += '{' + body + '}'; - var postParts = parseCommaParts(post); - if (post.length) { - p[p.length-1] += postParts.shift(); - p.push.apply(p, postParts); - } - - parts.push.apply(parts, p); - - return parts; -} - -function expandTop(str) { - if (!str) - return []; - - return expand(escapeBraces(str), true).map(unescapeBraces); -} - -function identity(e) { - return e; -} - -function embrace(str) { - return '{' + str + '}'; -} -function isPadded(el) { - return /^-?0\d/.test(el); -} - -function lte(i, y) { - return i <= y; -} -function gte(i, y) { - return i >= y; -} - -function expand(str, isTop) { - var expansions = []; - - var m = balanced('{', '}', str); - if (!m || /\$$/.test(m.pre)) return [str]; - - var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body); - var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body); - var isSequence = isNumericSequence || isAlphaSequence; - var isOptions = /^(.*,)+(.+)?$/.test(m.body); - if (!isSequence && !isOptions) { - // {a},b} - if (m.post.match(/,.*\}/)) { - str = m.pre + '{' + m.body + escClose + m.post; - return expand(str); - } - return [str]; - } - - var n; - if (isSequence) { - n = m.body.split(/\.\./); - } else { - n = parseCommaParts(m.body); - if (n.length === 1) { - // x{{a,b}}y ==> x{a}y x{b}y - n = expand(n[0], false).map(embrace); - if (n.length === 1) { - var post = m.post.length - ? expand(m.post, false) - : ['']; - return post.map(function(p) { - return m.pre + n[0] + p; - }); - } - } - } - - // at this point, n is the parts, and we know it's not a comma set - // with a single entry. - - // no need to expand pre, since it is guaranteed to be free of brace-sets - var pre = m.pre; - var post = m.post.length - ? expand(m.post, false) - : ['']; - - var N; - - if (isSequence) { - var x = numeric(n[0]); - var y = numeric(n[1]); - var width = Math.max(n[0].length, n[1].length) - var incr = n.length == 3 - ? Math.abs(numeric(n[2])) - : 1; - var test = lte; - var reverse = y < x; - if (reverse) { - incr *= -1; - test = gte; - } - var pad = n.some(isPadded); - - N = []; - - for (var i = x; test(i, y); i += incr) { - var c; - if (isAlphaSequence) { - c = String.fromCharCode(i); - if (c === '\\') - c = ''; - } else { - c = String(i); - if (pad) { - var need = width - c.length; - if (need > 0) { - var z = new Array(need + 1).join('0'); - if (i < 0) - c = '-' + z + c.slice(1); - else - c = z + c; - } - } - } - N.push(c); - } - } else { - N = concatMap(n, function(el) { return expand(el, false) }); - } - - for (var j = 0; j < N.length; j++) { - for (var k = 0; k < post.length; k++) { - var expansion = pre + N[j] + post[k]; - if (!isTop || isSequence || expansion) - expansions.push(expansion); - } - } - - return expansions; -} - diff --git a/src/node_modules/brace-expansion/package.json b/src/node_modules/brace-expansion/package.json deleted file mode 100644 index 689ac6b..0000000 --- a/src/node_modules/brace-expansion/package.json +++ /dev/null @@ -1,104 +0,0 @@ -{ - "_args": [ - [ - "brace-expansion@^1.0.0", - "/media/Github/Vertinext2/src/node_modules/minimatch" - ] - ], - "_from": "brace-expansion@>=1.0.0 <2.0.0", - "_id": "brace-expansion@1.1.3", - "_inCache": true, - "_installable": true, - "_location": "/brace-expansion", - "_nodeVersion": "5.5.0", - "_npmOperationalInternal": { - "host": "packages-6-west.internal.npmjs.com", - "tmp": "tmp/brace-expansion-1.1.3.tgz_1455216688668_0.948847763473168" - }, - "_npmUser": { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "brace-expansion", - "raw": "brace-expansion@^1.0.0", - "rawSpec": "^1.0.0", - "scope": null, - "spec": ">=1.0.0 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/minimatch" - ], - "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz", - "_shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "_shrinkwrap": null, - "_spec": "brace-expansion@^1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/minimatch", - "author": { - "email": "mail@juliangruber.com", - "name": "Julian Gruber", - "url": "http://juliangruber.com" - }, - "bugs": { - "url": "https://github.com/juliangruber/brace-expansion/issues" - }, - "dependencies": { - "balanced-match": "^0.3.0", - "concat-map": "0.0.1" - }, - "description": "Brace expansion as known from sh/bash", - "devDependencies": { - "tape": "4.4.0" - }, - "directories": {}, - "dist": { - "shasum": "46bff50115d47fc9ab89854abb87d98078a10991", - "tarball": "http://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.3.tgz" - }, - "gitHead": "f0da1bb668e655f67b6b2d660c6e1c19e2a6f231", - "homepage": "https://github.com/juliangruber/brace-expansion", - "keywords": [], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "julian@juliangruber.com", - "name": "juliangruber" - }, - { - "email": "isaacs@npmjs.com", - "name": "isaacs" - } - ], - "name": "brace-expansion", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/juliangruber/brace-expansion.git" - }, - "scripts": { - "gentest": "bash test/generate.sh", - "test": "tape test/*.js" - }, - "testling": { - "browsers": [ - "ie/8..latest", - "firefox/20..latest", - "firefox/nightly", - "chrome/25..latest", - "chrome/canary", - "opera/12..latest", - "opera/next", - "safari/5.1..latest", - "ipad/6.0..latest", - "iphone/6.0..latest", - "android-browser/4.2..latest" - ], - "files": "test/*.js" - }, - "version": "1.1.3" -} diff --git a/src/node_modules/braces/LICENSE b/src/node_modules/braces/LICENSE deleted file mode 100644 index 5a9956a..0000000 --- a/src/node_modules/braces/LICENSE +++ /dev/null @@ -1,24 +0,0 @@ -The MIT License (MIT) - -Copyright (c) 2014-2015, Jon Schlinkert. - -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/src/node_modules/braces/README.md b/src/node_modules/braces/README.md deleted file mode 100644 index eb1db0b..0000000 --- a/src/node_modules/braces/README.md +++ /dev/null @@ -1,230 +0,0 @@ -# braces [![NPM version](https://badge.fury.io/js/braces.svg)](http://badge.fury.io/js/braces) - -> Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification. - -* Complete support for the braces part of the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/). Braces passes [all of the relevant unit tests](#bash-4-3-support) from the spec. -* Expands comma-separated values: `a/{b,c}/d` => `['a/b/d', 'a/c/d']` -* Expands alphabetical or numerical ranges: `{1..3}` => `['1', '2', '3']` -* [Very fast](#benchmarks) -* [Special characters](./patterns.md) can be used to generate interesting patterns. - -Install with [npm](https://www.npmjs.com/) - -```sh -$ npm i braces --save -``` - -## Example usage - -```js -var braces = require('braces'); - -braces('a/{x,y}/c{d}e') -//=> ['a/x/cde', 'a/y/cde'] - -braces('a/b/c/{x,y}') -//=> ['a/b/c/x', 'a/b/c/y'] - -braces('a/{x,{1..5},y}/c{d}e') -//=> ['a/x/cde', 'a/1/cde', 'a/y/cde', 'a/2/cde', 'a/3/cde', 'a/4/cde', 'a/5/cde'] -``` - -### Pro tip! - -> Use braces to generate test fixtures! - -**Example** - -```js -var braces = require('./'); -var path = require('path'); -var fs = require('fs'); - -braces('blah/{a..z}.js').forEach(function(fp) { - if (!fs.existsSync(path.dirname(fp))) { - fs.mkdirSync(path.dirname(fp)); - } - fs.writeFileSync(fp, ''); -}); -``` - -See the [tests](./test/test.js) for more examples and use cases (also see the [bash spec tests](./test/bash-mm-adjusted.js)); - -### Range expansion - -Uses [expand-range](https://github.com/jonschlinkert/expand-range) for range expansion. - -```js -braces('a{1..3}b') -//=> ['a1b', 'a2b', 'a3b'] - -braces('a{5..8}b') -//=> ['a5b', 'a6b', 'a7b', 'a8b'] - -braces('a{00..05}b') -//=> ['a00b', 'a01b', 'a02b', 'a03b', 'a04b', 'a05b'] - -braces('a{01..03}b') -//=> ['a01b', 'a02b', 'a03b'] - -braces('a{000..005}b') -//=> ['a000b', 'a001b', 'a002b', 'a003b', 'a004b', 'a005b'] - -braces('a{a..e}b') -//=> ['aab', 'abb', 'acb', 'adb', 'aeb'] - -braces('a{A..E}b') -//=> ['aAb', 'aBb', 'aCb', 'aDb', 'aEb'] -``` - -Pass a function as the last argument to customize range expansions: - -```js -var range = braces('x{a..e}y', function (str, i) { - return String.fromCharCode(str) + i; -}); - -console.log(range); -//=> ['xa0y', 'xb1y', 'xc2y', 'xd3y', 'xe4y'] -``` - -See [expand-range](https://github.com/jonschlinkert/expand-range)for benchmarks, tests and the full list of range expansion features. - -## Options - -### options.makeRe - -Type: `Boolean` - -Deafault: `false` - -Return a regex-optimal string. If you're using braces to generate regex, this will result in dramatically faster performance. - -**Examples** - -With the default settings (`{makeRe: false}`): - -```js -braces('{1..5}'); -//=> ['1', '2', '3', '4', '5'] -``` - -With `{makeRe: true}`: - -```js -braces('{1..5}', {makeRe: true}); -//=> ['[1-5]'] - -braces('{3..9..3}', {makeRe: true}); -//=> ['(3|6|9)'] -``` - -### options.bash - -Type: `Boolean` - -Default: `false` - -Enables complete support for the Bash specification. The downside is a 20-25% speed decrease. - -**Example** - -Using the default setting (`{bash: false}`): - -```js -braces('a{b}c'); -//=> ['abc'] -``` - -In bash (and minimatch), braces with one item are not expanded. To get the same result with braces, set `{bash: true}`: - -```js -braces('a{b}c', {bash: true}); -//=> ['a{b}c'] -``` - -### options.nodupes - -Type: `Boolean` - -Deafault: `true` - -Duplicates are removed by default. To keep duplicates, pass `{nodupes: false}` on the options - -## Bash 4.3 Support - -> Better support for Bash 4.3 than minimatch - -This project has comprehensive unit tests, including tests coverted from [Bash 4.3](www.gnu.org/software/bash/). Currently only 8 of 102 unit tests fail, and - -## Run benchmarks - -Install dev dependencies: - -```bash -npm i -d && npm benchmark -``` - -```bash -#1: escape.js - brace-expansion.js x 114,934 ops/sec ±1.24% (93 runs sampled) - braces.js x 342,254 ops/sec ±0.84% (90 runs sampled) - -#2: exponent.js - brace-expansion.js x 12,359 ops/sec ±0.86% (96 runs sampled) - braces.js x 20,389 ops/sec ±0.71% (97 runs sampled) - -#3: multiple.js - brace-expansion.js x 114,469 ops/sec ±1.44% (94 runs sampled) - braces.js x 401,621 ops/sec ±0.87% (91 runs sampled) - -#4: nested.js - brace-expansion.js x 102,769 ops/sec ±1.55% (92 runs sampled) - braces.js x 314,088 ops/sec ±0.71% (98 runs sampled) - -#5: normal.js - brace-expansion.js x 157,577 ops/sec ±1.65% (91 runs sampled) - braces.js x 1,115,950 ops/sec ±0.74% (94 runs sampled) - -#6: range.js - brace-expansion.js x 138,822 ops/sec ±1.71% (91 runs sampled) - braces.js x 1,108,353 ops/sec ±0.85% (94 runs sampled) -``` - -## Run tests - -Install dev dependencies: - -```bash -npm i -d && npm test -``` - -## Related - -* [micromatch](https://github.com/jonschlinkert/micromatch): wildcard/glob matcher for javascript. a faster alternative to minimatch. -* [fill-range](https://github.com/jonschlinkert/fill-range): Fill in a range of numbers or letters, optionally passing an increment or multiplier to use -* [expand-range](https://github.com/jonschlinkert/expand-range): Wraps fill-range for fast, bash-like range expansion in strings. Expand a range of numbers or letters, uppercase or lowercase - -## Contributing - -Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/braces/issues). - -Please run benchmarks before and after any code changes to what the impact of the code changes are before submitting a PR. - -## Author - -**Jon Schlinkert** - -+ [github/jonschlinkert](https://github.com/jonschlinkert) -+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) - -## License - -Copyright © 2014-2015 Jon Schlinkert -Released under the MIT license. - -*** - -_This file was generated by [verb-cli](https://github.com/assemble/verb-cli) on October 19, 2015._ - - \ No newline at end of file diff --git a/src/node_modules/braces/index.js b/src/node_modules/braces/index.js deleted file mode 100644 index a4dbf3f..0000000 --- a/src/node_modules/braces/index.js +++ /dev/null @@ -1,399 +0,0 @@ -/*! - * braces - * - * Copyright (c) 2014-2015, Jon Schlinkert. - * Licensed under the MIT license. - */ - -'use strict'; - -/** - * Module dependencies - */ - -var expand = require('expand-range'); -var repeat = require('repeat-element'); -var tokens = require('preserve'); - -/** - * Expose `braces` - */ - -module.exports = function (str, options) { - if (typeof str !== 'string') { - throw new Error('braces expects a string'); - } - return braces(str, options); -}; - -/** - * Expand `{foo,bar}` or `{1..5}` braces in the - * given `string`. - * - * @param {String} `str` - * @param {Array} `arr` - * @param {Object} `options` - * @return {Array} - */ - -function braces(str, arr, options) { - if (str === '') { - return []; - } - - if (!Array.isArray(arr)) { - options = arr; - arr = []; - } - - var opts = options || {}; - arr = arr || []; - - if (typeof opts.nodupes === 'undefined') { - opts.nodupes = true; - } - - var fn = opts.fn; - var es6; - - if (typeof opts === 'function') { - fn = opts; - opts = {}; - } - - if (!(patternRe instanceof RegExp)) { - patternRe = patternRegex(); - } - - var matches = str.match(patternRe) || []; - var m = matches[0]; - - switch(m) { - case '\\,': - return escapeCommas(str, arr, opts); - case '\\.': - return escapeDots(str, arr, opts); - case '\/.': - return escapePaths(str, arr, opts); - case ' ': - return splitWhitespace(str); - case '{,}': - return exponential(str, opts, braces); - case '{}': - return emptyBraces(str, arr, opts); - case '\\{': - case '\\}': - return escapeBraces(str, arr, opts); - case '${': - if (!/\{[^{]+\{/.test(str)) { - return arr.concat(str); - } else { - es6 = true; - str = tokens.before(str, es6Regex()); - } - } - - if (!(braceRe instanceof RegExp)) { - braceRe = braceRegex(); - } - - var match = braceRe.exec(str); - if (match == null) { - return [str]; - } - - var outter = match[1]; - var inner = match[2]; - if (inner === '') { return [str]; } - - var segs, segsLength; - - if (inner.indexOf('..') !== -1) { - segs = expand(inner, opts, fn) || inner.split(','); - segsLength = segs.length; - - } else if (inner[0] === '"' || inner[0] === '\'') { - return arr.concat(str.split(/['"]/).join('')); - - } else { - segs = inner.split(','); - if (opts.makeRe) { - return braces(str.replace(outter, wrap(segs, '|')), opts); - } - - segsLength = segs.length; - if (segsLength === 1 && opts.bash) { - segs[0] = wrap(segs[0], '\\'); - } - } - - var len = segs.length; - var i = 0, val; - - while (len--) { - var path = segs[i++]; - - if (/(\.[^.\/])/.test(path)) { - if (segsLength > 1) { - return segs; - } else { - return [str]; - } - } - - val = splice(str, outter, path); - - if (/\{[^{}]+?\}/.test(val)) { - arr = braces(val, arr, opts); - } else if (val !== '') { - if (opts.nodupes && arr.indexOf(val) !== -1) { continue; } - arr.push(es6 ? tokens.after(val) : val); - } - } - - if (opts.strict) { return filter(arr, filterEmpty); } - return arr; -} - -/** - * Expand exponential ranges - * - * `a{,}{,}` => ['a', 'a', 'a', 'a'] - */ - -function exponential(str, options, fn) { - if (typeof options === 'function') { - fn = options; - options = null; - } - - var opts = options || {}; - var esc = '__ESC_EXP__'; - var exp = 0; - var res; - - var parts = str.split('{,}'); - if (opts.nodupes) { - return fn(parts.join(''), opts); - } - - exp = parts.length - 1; - res = fn(parts.join(esc), opts); - var len = res.length; - var arr = []; - var i = 0; - - while (len--) { - var ele = res[i++]; - var idx = ele.indexOf(esc); - - if (idx === -1) { - arr.push(ele); - - } else { - ele = ele.split('__ESC_EXP__').join(''); - if (!!ele && opts.nodupes !== false) { - arr.push(ele); - - } else { - var num = Math.pow(2, exp); - arr.push.apply(arr, repeat(ele, num)); - } - } - } - return arr; -} - -/** - * Wrap a value with parens, brackets or braces, - * based on the given character/separator. - * - * @param {String|Array} `val` - * @param {String} `ch` - * @return {String} - */ - -function wrap(val, ch) { - if (ch === '|') { - return '(' + val.join(ch) + ')'; - } - if (ch === ',') { - return '{' + val.join(ch) + '}'; - } - if (ch === '-') { - return '[' + val.join(ch) + ']'; - } - if (ch === '\\') { - return '\\{' + val + '\\}'; - } -} - -/** - * Handle empty braces: `{}` - */ - -function emptyBraces(str, arr, opts) { - return braces(str.split('{}').join('\\{\\}'), arr, opts); -} - -/** - * Filter out empty-ish values - */ - -function filterEmpty(ele) { - return !!ele && ele !== '\\'; -} - -/** - * Handle patterns with whitespace - */ - -function splitWhitespace(str) { - var segs = str.split(' '); - var len = segs.length; - var res = []; - var i = 0; - - while (len--) { - res.push.apply(res, braces(segs[i++])); - } - return res; -} - -/** - * Handle escaped braces: `\\{foo,bar}` - */ - -function escapeBraces(str, arr, opts) { - if (!/\{[^{]+\{/.test(str)) { - return arr.concat(str.split('\\').join('')); - } else { - str = str.split('\\{').join('__LT_BRACE__'); - str = str.split('\\}').join('__RT_BRACE__'); - return map(braces(str, arr, opts), function (ele) { - ele = ele.split('__LT_BRACE__').join('{'); - return ele.split('__RT_BRACE__').join('}'); - }); - } -} - -/** - * Handle escaped dots: `{1\\.2}` - */ - -function escapeDots(str, arr, opts) { - if (!/[^\\]\..+\\\./.test(str)) { - return arr.concat(str.split('\\').join('')); - } else { - str = str.split('\\.').join('__ESC_DOT__'); - return map(braces(str, arr, opts), function (ele) { - return ele.split('__ESC_DOT__').join('.'); - }); - } -} - -/** - * Handle escaped dots: `{1\\.2}` - */ - -function escapePaths(str, arr, opts) { - str = str.split('\/.').join('__ESC_PATH__'); - return map(braces(str, arr, opts), function (ele) { - return ele.split('__ESC_PATH__').join('\/.'); - }); -} - -/** - * Handle escaped commas: `{a\\,b}` - */ - -function escapeCommas(str, arr, opts) { - if (!/\w,/.test(str)) { - return arr.concat(str.split('\\').join('')); - } else { - str = str.split('\\,').join('__ESC_COMMA__'); - return map(braces(str, arr, opts), function (ele) { - return ele.split('__ESC_COMMA__').join(','); - }); - } -} - -/** - * Regex for common patterns - */ - -function patternRegex() { - return /\$\{|[ \t]|{}|{,}|\\,(?=.*[{}])|\/\.(?=.*[{}])|\\\.(?={)|\\{|\\}/; -} - -/** - * Braces regex. - */ - -function braceRegex() { - return /.*(\\?\{([^}]+)\})/; -} - -/** - * es6 delimiter regex. - */ - -function es6Regex() { - return /\$\{([^}]+)\}/; -} - -var braceRe; -var patternRe; - -/** - * Faster alternative to `String.replace()` when the - * index of the token to be replaces can't be supplied - */ - -function splice(str, token, replacement) { - var i = str.indexOf(token); - return str.substr(0, i) + replacement - + str.substr(i + token.length); -} - -/** - * Fast array map - */ - -function map(arr, fn) { - if (arr == null) { - return []; - } - - var len = arr.length; - var res = new Array(len); - var i = -1; - - while (++i < len) { - res[i] = fn(arr[i], i, arr); - } - - return res; -} - -/** - * Fast array filter - */ - -function filter(arr, cb) { - if (arr == null) return []; - if (typeof cb !== 'function') { - throw new TypeError('braces: filter expects a callback function.'); - } - - var len = arr.length; - var res = arr.slice(); - var i = 0; - - while (len--) { - if (!cb(arr[len], i++)) { - res.splice(len, 1); - } - } - return res; -} diff --git a/src/node_modules/braces/package.json b/src/node_modules/braces/package.json deleted file mode 100644 index bd61cec..0000000 --- a/src/node_modules/braces/package.json +++ /dev/null @@ -1,122 +0,0 @@ -{ - "_args": [ - [ - "braces@^1.8.1", - "/media/Github/Vertinext2/src/node_modules/micromatch" - ] - ], - "_from": "braces@>=1.8.1 <2.0.0", - "_id": "braces@1.8.3", - "_inCache": true, - "_installable": true, - "_location": "/braces", - "_nodeVersion": "5.0.0", - "_npmUser": { - "email": "github@sellside.com", - "name": "jonschlinkert" - }, - "_npmVersion": "3.3.6", - "_phantomChildren": {}, - "_requested": { - "name": "braces", - "raw": "braces@^1.8.1", - "rawSpec": "^1.8.1", - "scope": null, - "spec": ">=1.8.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/micromatch" - ], - "_resolved": "https://registry.npmjs.org/braces/-/braces-1.8.3.tgz", - "_shasum": "35d4e7dda632b33e215d38a8a9cf4329c9c75d2c", - "_shrinkwrap": null, - "_spec": "braces@^1.8.1", - "_where": "/media/Github/Vertinext2/src/node_modules/micromatch", - "author": { - "name": "Jon Schlinkert", - "url": "https://github.com/jonschlinkert" - }, - "bugs": { - "url": "https://github.com/jonschlinkert/braces/issues" - }, - "dependencies": { - "expand-range": "^1.8.1", - "preserve": "^0.2.0", - "repeat-element": "^1.1.2" - }, - "description": "Fastest brace expansion for node.js, with the most complete support for the Bash 4.3 braces specification.", - "devDependencies": { - "benchmarked": "^0.1.3", - "brace-expansion": "^1.1.0", - "chalk": "^0.5.1", - "minimatch": "^2.0.1", - "minimist": "^1.1.0", - "mocha": "*", - "should": "*" - }, - "directories": {}, - "dist": { - "shasum": "35d4e7dda632b33e215d38a8a9cf4329c9c75d2c", - "tarball": "http://registry.npmjs.org/braces/-/braces-1.8.3.tgz" - }, - "engines": { - "node": ">=0.10.0" - }, - "files": [ - "index.js", - "utils.js" - ], - "gitHead": "9ab31c0dbf663ad08a7d9519286858f24e2ea9ac", - "homepage": "https://github.com/jonschlinkert/braces", - "keywords": [ - "alpha", - "alphabetical", - "bash", - "brace", - "expand", - "expansion", - "filepath", - "fill", - "fs", - "glob", - "globbing", - "letter", - "match", - "matches", - "matching", - "number", - "numerical", - "path", - "range", - "ranges", - "sh" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "github@sellside.com", - "name": "jonschlinkert" - }, - { - "email": "elan.shanker+npm@gmail.com", - "name": "es128" - }, - { - "email": "brian.woodward@gmail.com", - "name": "doowb" - } - ], - "name": "braces", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/jonschlinkert/braces.git" - }, - "scripts": { - "test": "mocha" - }, - "version": "1.8.3" -} diff --git a/src/node_modules/breakable/LICENSE b/src/node_modules/breakable/LICENSE deleted file mode 100644 index 4b87819..0000000 --- a/src/node_modules/breakable/LICENSE +++ /dev/null @@ -1,19 +0,0 @@ -Copyright (c) 2013 Olov Lassus - -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/src/node_modules/breakable/README.md b/src/node_modules/breakable/README.md deleted file mode 100644 index 87b5e38..0000000 --- a/src/node_modules/breakable/README.md +++ /dev/null @@ -1,93 +0,0 @@ -# breakable.js -Break out of functions, recursive or not, in a more composable way -than by using exceptions explicitly. Non-local return. - - - -## Usage -You can use breakable to break out of simple loops like this example -but note that it is often simpler to just use `.some` instead. Anyways, -here's a minimal example. - -```javascript -var breakable = require("breakable"); - -breakable(function(brk) { - arr.forEach(function(v) { - if (...) { - brk(); - } - }); -}); -``` - -Pass a value to `brk` and it becomes the return-value of breakable. - - -breakable is useful when you want to break out of a deep recursion, -passing a value, without riddling your code with exception ceremony. - -Instead of: - -```javascript -var esprima = require("esprima").parse; -var traverse = require("ast-traverse"); -var ast = esprima("f(!x, y)"); - -var val; -try { - traverse(ast, {pre: function(node) { - if (node.type === "UnaryExpression" && node.operator === "!") { - val = node.argument; - throw 0; - } - }}); -} catch(e) { - if (val === undefined) { - throw e; // re-throw if it wasn't our exception - } -} - -console.dir(val); // { type: 'Identifier', name: 'x' } -``` - -you use breakable and do: - -```javascript -var breakable = require("breakable"); -var esprima = require("esprima").parse; -var traverse = require("ast-traverse"); -var ast = esprima("f(!x, y)"); - -var val = breakable(function(brk) { - traverse(ast, {pre: function(node) { - if (node.type === "UnaryExpression" && node.operator === "!") { - brk(node.argument); - } - }}); -}); - -console.dir(val); // { type: 'Identifier', name: 'x' } -``` - - - -## Installation - -### Node -Install using npm - - npm install breakable - -```javascript -var breakable = require("breakable"); -``` - -### Browser -Clone the repo and include it in a script tag - - git clone https://github.com/olov/breakable.git - -```html - -``` diff --git a/src/node_modules/breakable/breakable.js b/src/node_modules/breakable/breakable.js deleted file mode 100644 index 80a8f92..0000000 --- a/src/node_modules/breakable/breakable.js +++ /dev/null @@ -1,36 +0,0 @@ -// breakable.js -// MIT licensed, see LICENSE file -// Copyright (c) 2013-2014 Olov Lassus - -var breakable = (function() { - "use strict"; - - function Val(val, brk) { - this.val = val; - this.brk = brk; - } - - function make_brk() { - return function brk(val) { - throw new Val(val, brk); - }; - } - - function breakable(fn) { - var brk = make_brk(); - try { - return fn(brk); - } catch (e) { - if (e instanceof Val && e.brk === brk) { - return e.val; - } - throw e; - } - } - - return breakable; -})(); - -if (typeof module !== "undefined" && typeof module.exports !== "undefined") { - module.exports = breakable; -} diff --git a/src/node_modules/breakable/examples/example-explicit.js b/src/node_modules/breakable/examples/example-explicit.js deleted file mode 100644 index d494116..0000000 --- a/src/node_modules/breakable/examples/example-explicit.js +++ /dev/null @@ -1,19 +0,0 @@ -var esprima = require("esprima").parse; -var traverse = require("ast-traverse"); -var ast = esprima("f(!x, y)"); - -var val; -try { - traverse(ast, {pre: function(node) { - if (node.type === "UnaryExpression" && node.operator === "!") { - val = node.argument; - throw 0; - } - }}); -} catch(e) { - if (val === undefined) { - throw e; // re-throw if it wasn't our exception - } -} - -console.dir(val); // { type: 'Identifier', name: 'x' } diff --git a/src/node_modules/breakable/examples/example.js b/src/node_modules/breakable/examples/example.js deleted file mode 100644 index fa2ea49..0000000 --- a/src/node_modules/breakable/examples/example.js +++ /dev/null @@ -1,14 +0,0 @@ -var breakable = require("./breakable"); -var esprima = require("esprima").parse; -var traverse = require("ast-traverse"); -var ast = esprima("f(!x, y)"); - -var val = breakable(function(brk) { - traverse(ast, {pre: function(node) { - if (node.type === "UnaryExpression" && node.operator === "!") { - brk(node.argument); - } - }}); -}); - -console.dir(val); // { type: 'Identifier', name: 'x' } diff --git a/src/node_modules/breakable/package.json b/src/node_modules/breakable/package.json deleted file mode 100644 index 762c385..0000000 --- a/src/node_modules/breakable/package.json +++ /dev/null @@ -1,82 +0,0 @@ -{ - "_args": [ - [ - "breakable@~1.0.0", - "/media/Github/Vertinext2/src/node_modules/defs" - ] - ], - "_from": "breakable@>=1.0.0 <1.1.0", - "_id": "breakable@1.0.0", - "_inCache": true, - "_installable": true, - "_location": "/breakable", - "_npmUser": { - "email": "olov.lassus@gmail.com", - "name": "olov" - }, - "_npmVersion": "1.3.25", - "_phantomChildren": {}, - "_requested": { - "name": "breakable", - "raw": "breakable@~1.0.0", - "rawSpec": "~1.0.0", - "scope": null, - "spec": ">=1.0.0 <1.1.0", - "type": "range" - }, - "_requiredBy": [ - "/defs" - ], - "_resolved": "https://registry.npmjs.org/breakable/-/breakable-1.0.0.tgz", - "_shasum": "784a797915a38ead27bad456b5572cb4bbaa78c1", - "_shrinkwrap": null, - "_spec": "breakable@~1.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/defs", - "author": { - "email": "olov.lassus@gmail.com", - "name": "Olov Lassus" - }, - "bugs": { - "url": "https://github.com/olov/breakable/issues" - }, - "dependencies": {}, - "description": "Break out of functions, recursive or not, in a more composable way than by using exceptions explicitly. Non-local return.", - "devDependencies": { - "tap": "~0.4.4" - }, - "directories": {}, - "dist": { - "shasum": "784a797915a38ead27bad456b5572cb4bbaa78c1", - "tarball": "http://registry.npmjs.org/breakable/-/breakable-1.0.0.tgz" - }, - "homepage": "https://github.com/olov/breakable", - "keywords": [ - "throw", - "try", - "catch", - "exception", - "non-local", - "return", - "break", - "breakable" - ], - "license": "MIT", - "main": "breakable.js", - "maintainers": [ - { - "email": "olov.lassus@gmail.com", - "name": "olov" - } - ], - "name": "breakable", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+https://github.com/olov/breakable.git" - }, - "scripts": { - "test": "tap test/*.js" - }, - "version": "1.0.0" -} diff --git a/src/node_modules/breakable/test/breakable-tests.js b/src/node_modules/breakable/test/breakable-tests.js deleted file mode 100644 index 85a2fa3..0000000 --- a/src/node_modules/breakable/test/breakable-tests.js +++ /dev/null @@ -1,118 +0,0 @@ -"use strict"; - -var test = require("tap").test; -var breakable = require("../"); - -test("normal-return", function(t) { - t.equal(breakable(function(brk) { - return 1; - }), 1); - t.end(); -}); - -test("break-return", function(t) { - t.equal(breakable(function(brk) { - brk(2); - return 1; - }), 2); - t.end(); -}); - -test("recurse", function(t) { - t.equal(breakable(function(brk) { - function traverse(n) { - if (n < 100) { - traverse(n + 1); - } - brk(n); - } - traverse(0); - }), 100); - t.end(); -}); - -test("simple-throws", function(t) { - t.throws(breakable.bind(null, function(brk) { - throw 1; - })); - t.doesNotThrow(breakable.bind(null, function(brk) { - brk(1); - throw 2; - })); - t.end(); -}); - -test("prop-recurse-break", function(t) { - var tstObj = {a: 1, b: {c: 2, d: {e: 3, f: "gold", g: null}}, h: {i: 6}}; - - var found = breakable(function(brk) { - function traverse(obj) { - var props = Object.keys(obj); - props.forEach(function(prop) { - var val = obj[prop]; - if (val === "gold") { - brk(prop); - } else if (val === null) { - throw new Error("break did not work"); - } else if (val && typeof val === "object") { - traverse(val); - } - }); - } - traverse(tstObj); - }); - t.equal(found, "f"); - t.end(); -}); - -test("forEach-break", function(t) { - var cnt = 0; - breakable(function(brk) { - [1,2,3].forEach(function(v) { - ++cnt; - if (v === 2) { - brk(); - } - }); - }); - t.equal(cnt, 2); - t.end(); -}); - -test("nested-forEach-break", function(t) { - var cnt = 0; - breakable(function(brk) { - [1,2,3].forEach(function(v) { - [4,5,6].forEach(function(v1) { - ++cnt; - if (v === 2 && v1 === 5) { - brk(); - } - }); - }); - }); - t.equal(cnt, 5); - t.end(); -}); - -test("nested-breakables-1", function(t) { - var res = breakable(function(brk1) { - breakable(function(brk2) { - brk1(13); - }); - }); - t.equal(res, 13); - t.end(); -}); - -test("nested-breakables-2", function(t) { - t.plan(2); - var res1 = breakable(function(brk1) { - var res2 = breakable(function(brk2) { - brk2(13); - }); - t.equal(res2, 13); - }); - t.equal(res1, undefined); - t.end(); -}); diff --git a/src/node_modules/brorand/.npmignore b/src/node_modules/brorand/.npmignore deleted file mode 100644 index 1ca9571..0000000 --- a/src/node_modules/brorand/.npmignore +++ /dev/null @@ -1,2 +0,0 @@ -node_modules/ -npm-debug.log diff --git a/src/node_modules/brorand/README.md b/src/node_modules/brorand/README.md deleted file mode 100644 index f80437d..0000000 --- a/src/node_modules/brorand/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# Brorand - -#### LICENSE - -This software is licensed under the MIT License. - -Copyright Fedor Indutny, 2014. - -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/src/node_modules/brorand/index.js b/src/node_modules/brorand/index.js deleted file mode 100644 index 436f040..0000000 --- a/src/node_modules/brorand/index.js +++ /dev/null @@ -1,57 +0,0 @@ -var r; - -module.exports = function rand(len) { - if (!r) - r = new Rand(null); - - return r.generate(len); -}; - -function Rand(rand) { - this.rand = rand; -} -module.exports.Rand = Rand; - -Rand.prototype.generate = function generate(len) { - return this._rand(len); -}; - -if (typeof window === 'object') { - if (window.crypto && window.crypto.getRandomValues) { - // Modern browsers - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - window.crypto.getRandomValues(arr); - return arr; - }; - } else if (window.msCrypto && window.msCrypto.getRandomValues) { - // IE - Rand.prototype._rand = function _rand(n) { - var arr = new Uint8Array(n); - window.msCrypto.getRandomValues(arr); - return arr; - }; - } else { - // Old junk - Rand.prototype._rand = function() { - throw new Error('Not implemented yet'); - }; - } -} else { - // Node.js or Web worker - try { - var crypto = require('cry' + 'pto'); - - Rand.prototype._rand = function _rand(n) { - return crypto.randomBytes(n); - }; - } catch (e) { - // Emulate crypto API using randy - Rand.prototype._rand = function _rand(n) { - var res = new Uint8Array(n); - for (var i = 0; i < res.length; i++) - res[i] = this.rand.getByte(); - return res; - }; - } -} diff --git a/src/node_modules/brorand/package.json b/src/node_modules/brorand/package.json deleted file mode 100644 index c525e7c..0000000 --- a/src/node_modules/brorand/package.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "_args": [ - [ - "brorand@^1.0.1", - "/media/Github/Vertinext2/src/node_modules/elliptic" - ] - ], - "_from": "brorand@>=1.0.1 <2.0.0", - "_id": "brorand@1.0.5", - "_inCache": true, - "_installable": true, - "_location": "/brorand", - "_nodeVersion": "0.10.33", - "_npmUser": { - "email": "fedor@indutny.com", - "name": "indutny" - }, - "_npmVersion": "2.1.6", - "_phantomChildren": {}, - "_requested": { - "name": "brorand", - "raw": "brorand@^1.0.1", - "rawSpec": "^1.0.1", - "scope": null, - "spec": ">=1.0.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/elliptic", - "/miller-rabin" - ], - "_resolved": "https://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz", - "_shasum": "07b54ca30286abd1718a0e2a830803efdc9bfa04", - "_shrinkwrap": null, - "_spec": "brorand@^1.0.1", - "_where": "/media/Github/Vertinext2/src/node_modules/elliptic", - "author": { - "email": "fedor@indutny.com", - "name": "Fedor Indutny" - }, - "bugs": { - "url": "https://github.com/indutny/brorand/issues" - }, - "dependencies": {}, - "description": "Random number generator for browsers and node.js", - "devDependencies": { - "mocha": "^2.0.1" - }, - "directories": {}, - "dist": { - "shasum": "07b54ca30286abd1718a0e2a830803efdc9bfa04", - "tarball": "http://registry.npmjs.org/brorand/-/brorand-1.0.5.tgz" - }, - "gitHead": "571027e0ffa1119c720bcdb8aa9c987f63beb5a6", - "homepage": "https://github.com/indutny/brorand", - "keywords": [ - "Random", - "RNG", - "browser", - "crypto" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "fedor@indutny.com", - "name": "indutny" - } - ], - "name": "brorand", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git+ssh://git@github.com/indutny/brorand.git" - }, - "scripts": { - "test": "mocha --reporter=spec test/**/*-test.js" - }, - "version": "1.0.5" -} diff --git a/src/node_modules/brorand/test/api-test.js b/src/node_modules/brorand/test/api-test.js deleted file mode 100644 index b6c876d..0000000 --- a/src/node_modules/brorand/test/api-test.js +++ /dev/null @@ -1,8 +0,0 @@ -var brorand = require('../'); -var assert = require('assert'); - -describe('Brorand', function() { - it('should generate random numbers', function() { - assert.equal(brorand(100).length, 100); - }); -}); diff --git a/src/node_modules/browser-pack/.npmignore b/src/node_modules/browser-pack/.npmignore deleted file mode 100644 index 3c3629e..0000000 --- a/src/node_modules/browser-pack/.npmignore +++ /dev/null @@ -1 +0,0 @@ -node_modules diff --git a/src/node_modules/browser-pack/.travis.yml b/src/node_modules/browser-pack/.travis.yml deleted file mode 100644 index bc21ef6..0000000 --- a/src/node_modules/browser-pack/.travis.yml +++ /dev/null @@ -1,8 +0,0 @@ -language: node_js -node_js: - - "0.8" - - "0.10" - - "0.12" - - "iojs" -before_install: - - npm install -g npm@~1.4.6 \ No newline at end of file diff --git a/src/node_modules/browser-pack/LICENSE b/src/node_modules/browser-pack/LICENSE deleted file mode 100644 index ee27ba4..0000000 --- a/src/node_modules/browser-pack/LICENSE +++ /dev/null @@ -1,18 +0,0 @@ -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/src/node_modules/browser-pack/_prelude.js b/src/node_modules/browser-pack/_prelude.js deleted file mode 100644 index 4ab156f..0000000 --- a/src/node_modules/browser-pack/_prelude.js +++ /dev/null @@ -1 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o=5.0.0 <6.0.0", - "_id": "browser-pack@5.0.1", - "_inCache": true, - "_installable": true, - "_location": "/browser-pack", - "_nodeVersion": "0.10.38", - "_npmUser": { - "email": "zertosh@gmail.com", - "name": "zertosh" - }, - "_npmVersion": "2.10.1", - "_phantomChildren": {}, - "_requested": { - "name": "browser-pack", - "raw": "browser-pack@^5.0.0", - "rawSpec": "^5.0.0", - "scope": null, - "spec": ">=5.0.0 <6.0.0", - "type": "range" - }, - "_requiredBy": [ - "/browserify" - ], - "_resolved": "https://registry.npmjs.org/browser-pack/-/browser-pack-5.0.1.tgz", - "_shasum": "4197719b20c6e0aaa09451c5111e53efb6fbc18d", - "_shrinkwrap": null, - "_spec": "browser-pack@^5.0.0", - "_where": "/media/Github/Vertinext2/src/node_modules/browserify", - "author": { - "email": "mail@substack.net", - "name": "James Halliday", - "url": "http://substack.net" - }, - "bin": { - "browser-pack": "bin/cmd.js" - }, - "bugs": { - "url": "https://github.com/substack/browser-pack/issues" - }, - "dependencies": { - "JSONStream": "^1.0.3", - "combine-source-map": "~0.6.1", - "defined": "^1.0.0", - "through2": "^1.0.0", - "umd": "^3.0.0" - }, - "description": "pack node-style source files from a json stream into a browser bundle", - "devDependencies": { - "concat-stream": "~1.4.1", - "convert-source-map": "~1.1.0", - "parse-base64vlq-mappings": "~0.1.1", - "tap": "^1.1.0", - "uglify-js": "1.3.5" - }, - "directories": {}, - "dist": { - "shasum": "4197719b20c6e0aaa09451c5111e53efb6fbc18d", - "tarball": "http://registry.npmjs.org/browser-pack/-/browser-pack-5.0.1.tgz" - }, - "gitHead": "aadeabea66feac48193d27d233daf1c85209357e", - "homepage": "https://github.com/substack/browser-pack", - "keywords": [ - "browser", - "bundle", - "commonjs", - "commonj-esque", - "exports", - "module.exports", - "require" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "substack@gmail.com", - "name": "substack" - }, - { - "email": "forbes@lindesay.co.uk", - "name": "forbeslindesay" - }, - { - "email": "zertosh@gmail.com", - "name": "zertosh" - } - ], - "name": "browser-pack", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/substack/browser-pack.git" - }, - "scripts": { - "prepublish": "node bin/prepublish.js", - "test": "tap test/*.js" - }, - "testling": { - "browsers": [ - "ie/8", - "ie/9", - "ie/10", - "chrome/15", - "chrome/latest", - "firefox/10", - "firefox/latest", - "safari/latest", - "opera/latest" - ], - "files": "test/*.js" - }, - "version": "5.0.1" -} diff --git a/src/node_modules/browser-pack/prelude.js b/src/node_modules/browser-pack/prelude.js deleted file mode 100644 index d291c69..0000000 --- a/src/node_modules/browser-pack/prelude.js +++ /dev/null @@ -1,44 +0,0 @@ - -// modules are defined as an array -// [ module function, map of requireuires ] -// -// map of requireuires is short require name -> numeric require -// -// anything defined in a previous bundle is accessed via the -// orig method which is the requireuire for previous bundles - -(function outer (modules, cache, entry) { - // Save the require from previous bundle to this closure if any - var previousRequire = typeof require == "function" && require; - - function newRequire(name, jumped){ - if(!cache[name]) { - if(!modules[name]) { - // if we cannot find the module within our internal map or - // cache jump to the current global require ie. the last bundle - // that was added to the page. - var currentRequire = typeof require == "function" && require; - if (!jumped && currentRequire) return currentRequire(name, true); - - // If there are other bundles on this page the require from the - // previous one is saved to 'previousRequire'. Repeat this as - // many times as there are bundles until the module is found or - // we exhaust the require chain. - if (previousRequire) return previousRequire(name, true); - var err = new Error('Cannot find module \'' + name + '\''); - err.code = 'MODULE_NOT_FOUND'; - throw err; - } - var m = cache[name] = {exports:{}}; - modules[name][0].call(m.exports, function(x){ - var id = modules[name][1][x]; - return newRequire(id ? id : x); - },m,m.exports,outer,modules,cache,entry); - } - return cache[name].exports; - } - for(var i=0;i - -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/src/node_modules/browser-resolve/README.md b/src/node_modules/browser-resolve/README.md deleted file mode 100644 index 2a21648..0000000 --- a/src/node_modules/browser-resolve/README.md +++ /dev/null @@ -1,141 +0,0 @@ -# browser-resolve [![Build Status](https://travis-ci.org/defunctzombie/node-browser-resolve.png?branch=master)](https://travis-ci.org/defunctzombie/node-browser-resolve) - -node.js resolve algorithm with [browser](https://gist.github.com/defunctzombie/4339901) field support. - -## api - -### resolve(id, opts={}, cb) - -Resolve a module path and call `cb(err, path [, pkg])` - -Options: - -* `filename` - the calling filename where the `require()` call originated (in the source) -* `paths` - `require.paths` array to use if nothing is found on the normal `node_modules` recursive walk -* `packageFilter` - transform the parsed `package.json` contents before looking at the `main` field -* `modules` - object with module id/name -> path mappings to consult before doing manual resolution (use to provide core modules) -* `browser` - the 'browser' property to use from package.json (defaults to 'browser') - -### resolve.sync(id, opts={}) - -Same as the async resolve, just uses sync methods. - -## basic usage - -you can resolve files like `require.resolve()`: -``` js -var resolve = require('browser-resolve'); -resolve('../', { filename: __filename }, function(err, path) { - console.log(path); -}); -``` - -``` -$ node example/resolve.js -/home/substack/projects/node-browser-resolve/index.js -``` - -## core modules - -By default, core modules (http, dgram, etc) will return their same name as the path. If you want to have specific paths returned, specify a `modules` property in the options object. - -``` js -var shims = { - http: '/your/path/to/http.js' -}; - -var resolve = require('browser-resolve'); -resolve('fs', { modules: shims }, function(err, path) { - console.log(path); -}); -``` - -``` -$ node example/builtin.js -/home/substack/projects/node-browser-resolve/builtin/fs.js -``` - -## browser field -browser-specific versions of modules - -``` js -{ - "name": "custom", - "version": "0.0.0", - "browser": { - "./main.js": "custom.js" - }, - "chromeapp": { - "./main.js": "custom-chromeapp.js" - } -} -``` - -``` js -var resolve = require('browser-resolve'); -var parent = { filename: __dirname + '/custom/file.js' /*, browser: 'chromeapp' */ }; -resolve('./main.js', parent, function(err, path) { - console.log(path); -}); -``` - -``` -$ node example/custom.js -/home/substack/projects/node-browser-resolve/example/custom/custom.js -``` - -## skip - -You can skip over dependencies by setting a -[browser field](https://gist.github.com/defunctzombie/4339901) -value to `false`: - -``` json -{ - "name": "skip", - "version": "0.0.0", - "browser": { - "tar": false - } -} -``` - -This is handy if you have code like: - -``` js -var tar = require('tar'); - -exports.add = function (a, b) { - return a + b; -}; - -exports.parse = function () { - return tar.Parse(); -}; -``` - -so that `require('tar')` will just return `{}` in the browser because you don't -intend to support the `.parse()` export in a browser environment. - -``` js -var resolve = require('browser-resolve'); -var parent = { filename: __dirname + '/skip/main.js' }; -resolve('tar', parent, function(err, path) { - console.log(path); -}); -``` - -``` -$ node example/skip.js -/home/substack/projects/node-browser-resolve/empty.js -``` - -# license - -MIT - -# upgrade notes - -Prior to v1.x this library provided shims for node core modules. These have since been removed. If you want to have alternative core modules provided, use the `modules` option when calling resolve. - -This was done to allow package managers to choose which shims they want to use without browser-resolve being the central point of update. diff --git a/src/node_modules/browser-resolve/empty.js b/src/node_modules/browser-resolve/empty.js deleted file mode 100644 index e69de29..0000000 diff --git a/src/node_modules/browser-resolve/index.js b/src/node_modules/browser-resolve/index.js deleted file mode 100644 index aef07e2..0000000 --- a/src/node_modules/browser-resolve/index.js +++ /dev/null @@ -1,340 +0,0 @@ -// builtin -var fs = require('fs'); -var path = require('path'); - -// vendor -var resv = require('resolve'); - -// given a path, create an array of node_module paths for it -// borrowed from substack/resolve -function nodeModulesPaths (start, cb) { - var splitRe = process.platform === 'win32' ? /[\/\\]/ : /\/+/; - var parts = start.split(splitRe); - - var dirs = []; - for (var i = parts.length - 1; i >= 0; i--) { - if (parts[i] === 'node_modules') continue; - var dir = path.join.apply( - path, parts.slice(0, i + 1).concat(['node_modules']) - ); - if (!parts[0].match(/([A-Za-z]:)/)) { - dir = '/' + dir; - } - dirs.push(dir); - } - return dirs; -} - -function find_shims_in_package(pkgJson, cur_path, shims, browser) { - try { - var info = JSON.parse(pkgJson); - } - catch (err) { - err.message = pkgJson + ' : ' + err.message - throw err; - } - - var replacements = getReplacements(info, browser); - - // no replacements, skip shims - if (!replacements) { - return; - } - - // if browser mapping is a string - // then it just replaces the main entry point - if (typeof replacements === 'string') { - var key = path.resolve(cur_path, info.main || 'index.js'); - shims[key] = path.resolve(cur_path, replacements); - return; - } - - // http://nodejs.org/api/modules.html#modules_loading_from_node_modules_folders - Object.keys(replacements).forEach(function(key) { - var val; - if (replacements[key] === false) { - val = __dirname + '/empty.js'; - } - else { - val = replacements[key]; - // if target is a relative path, then resolve - // otherwise we assume target is a module - if (val[0] === '.') { - val = path.resolve(cur_path, val); - } - } - - if (key[0] === '/' || key[0] === '.') { - // if begins with / ../ or ./ then we must resolve to a full path - key = path.resolve(cur_path, key); - } - shims[key] = val; - }); - - [ '.js', '.json' ].forEach(function (ext) { - Object.keys(shims).forEach(function (key) { - if (!shims[key + ext]) { - shims[key + ext] = shims[key]; - } - }); - }); -} - -// paths is mutated -// load shims from first package.json file found -function load_shims(paths, browser, cb) { - // identify if our file should be replaced per the browser field - // original filename|id -> replacement - var shims = Object.create(null); - - (function next() { - var cur_path = paths.shift(); - if (!cur_path) { - return cb(null, shims); - } - - var pkg_path = path.join(cur_path, 'package.json'); - - fs.readFile(pkg_path, 'utf8', function(err, data) { - if (err) { - // ignore paths we can't open - // avoids an exists check - if (err.code === 'ENOENT') { - return next(); - } - - return cb(err); - } - try { - find_shims_in_package(data, cur_path, shims, browser); - return cb(null, shims); - } - catch (err) { - return cb(err); - } - }); - })(); -}; - -// paths is mutated -// synchronously load shims from first package.json file found -function load_shims_sync(paths, browser) { - // identify if our file should be replaced per the browser field - // original filename|id -> replacement - var shims = Object.create(null); - var cur_path; - - while (cur_path = paths.shift()) { - var pkg_path = path.join(cur_path, 'package.json'); - - try { - var data = fs.readFileSync(pkg_path, 'utf8'); - find_shims_in_package(data, cur_path, shims, browser); - return shims; - } - catch (err) { - // ignore paths we can't open - // avoids an exists check - if (err.code === 'ENOENT') { - continue; - } - - throw err; - } - } - return shims; -} - -function build_resolve_opts(opts, base) { - var packageFilter = opts.packageFilter; - var browser = normalizeBrowserFieldName(opts.browser) - - opts.basedir = base; - opts.packageFilter = function (info, pkgdir) { - if (packageFilter) info = packageFilter(info, pkgdir); - - var replacements = getReplacements(info, browser); - - // no browser field, keep info unchanged - if (!replacements) { - return info; - } - - info[browser] = replacements; - - // replace main - if (typeof replacements === 'string') { - info.main = replacements; - return info; - } - - var replace_main = replacements[info.main || './index.js'] || - replacements['./' + info.main || './index.js']; - - info.main = replace_main || info.main; - return info; - }; - - var pathFilter = opts.pathFilter; - opts.pathFilter = function(info, resvPath, relativePath) { - if (relativePath[0] != '.') { - relativePath = './' + relativePath; - } - var mappedPath; - if (pathFilter) { - mappedPath = pathFilter.apply(this, arguments); - } - if (mappedPath) { - return mappedPath; - } - - var replacements = info[browser]; - if (!replacements) { - return; - } - - mappedPath = replacements[relativePath]; - if (!mappedPath && path.extname(relativePath) === '') { - mappedPath = replacements[relativePath + '.js']; - if (!mappedPath) { - mappedPath = replacements[relativePath + '.json']; - } - } - return mappedPath; - }; - - return opts; -} - -function resolve(id, opts, cb) { - - // opts.filename - // opts.paths - // opts.modules - // opts.packageFilter - - opts = opts || {}; - - var base = path.dirname(opts.filename); - - if (opts.basedir) { - base = opts.basedir; - } - - var paths = nodeModulesPaths(base); - - if (opts.paths) { - paths.push.apply(paths, opts.paths); - } - - paths = paths.map(function(p) { - return path.dirname(p); - }); - - // we must always load shims because the browser field could shim out a module - load_shims(paths, opts.browser, function(err, shims) { - if (err) { - return cb(err); - } - - var resid = path.resolve(opts.basedir || path.dirname(opts.filename), id); - if (shims[id] || shims[resid]) { - var xid = shims[id] ? id : resid; - // if the shim was is an absolute path, it was fully resolved - if (shims[xid][0] === '/') { - return resv(shims[xid], build_resolve_opts(opts, base), function(err, full, pkg) { - cb(null, full, pkg); - }); - } - - // module -> alt-module shims - id = shims[xid]; - } - - var modules = opts.modules || Object.create(null); - var shim_path = modules[id]; - if (shim_path) { - return cb(null, shim_path); - } - - // our browser field resolver - // if browser field is an object tho? - var full = resv(id, build_resolve_opts(opts, base), function(err, full, pkg) { - if (err) { - return cb(err); - } - - var resolved = (shims) ? shims[full] || full : full; - cb(null, resolved, pkg); - }); - }); -}; - -resolve.sync = function (id, opts) { - - // opts.filename - // opts.paths - // opts.modules - // opts.packageFilter - - opts = opts || {}; - var base = path.dirname(opts.filename); - - if (opts.basedir) { - base = opts.basedir; - } - - var paths = nodeModulesPaths(base); - - if (opts.paths) { - paths.push.apply(paths, opts.paths); - } - - paths = paths.map(function(p) { - return path.dirname(p); - }); - - // we must always load shims because the browser field could shim out a module - var shims = load_shims_sync(paths, opts.browser); - - if (shims[id]) { - // if the shim was is an absolute path, it was fully resolved - if (shims[id][0] === '/') { - return shims[id]; - } - - // module -> alt-module shims - id = shims[id]; - } - - var modules = opts.modules || Object.create(null); - var shim_path = modules[id]; - if (shim_path) { - return shim_path; - } - - // our browser field resolver - // if browser field is an object tho? - var full = resv.sync(id, build_resolve_opts(opts, base)); - - return (shims) ? shims[full] || full : full; -}; - -function normalizeBrowserFieldName(browser) { - return browser || 'browser'; -} - -function getReplacements(info, browser) { - browser = normalizeBrowserFieldName(browser); - var replacements = info[browser] || info.browser; - - // support legacy browserify field for easier migration from legacy - // many packages used this field historically - if (typeof info.browserify === 'string' && !replacements) { - replacements = info.browserify; - } - - return replacements; -} - -module.exports = resolve; diff --git a/src/node_modules/browser-resolve/package.json b/src/node_modules/browser-resolve/package.json deleted file mode 100644 index 94e939e..0000000 --- a/src/node_modules/browser-resolve/package.json +++ /dev/null @@ -1,89 +0,0 @@ -{ - "_args": [ - [ - "browser-resolve@^1.7.1", - "/media/Github/Vertinext2/src/node_modules/browserify" - ] - ], - "_from": "browser-resolve@>=1.7.1 <2.0.0", - "_id": "browser-resolve@1.11.1", - "_inCache": true, - "_installable": true, - "_location": "/browser-resolve", - "_nodeVersion": "5.4.1", - "_npmUser": { - "email": "shtylman@gmail.com", - "name": "defunctzombie" - }, - "_npmVersion": "3.3.12", - "_phantomChildren": {}, - "_requested": { - "name": "browser-resolve", - "raw": "browser-resolve@^1.7.1", - "rawSpec": "^1.7.1", - "scope": null, - "spec": ">=1.7.1 <2.0.0", - "type": "range" - }, - "_requiredBy": [ - "/browserify", - "/module-deps" - ], - "_resolved": "https://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.1.tgz", - "_shasum": "73c3c2a1d3a68a6e17d88f0cadb13ea24632d496", - "_shrinkwrap": null, - "_spec": "browser-resolve@^1.7.1", - "_where": "/media/Github/Vertinext2/src/node_modules/browserify", - "author": { - "email": "shtylman@gmail.com", - "name": "Roman Shtylman" - }, - "bugs": { - "url": "https://github.com/shtylman/node-browser-resolve/issues" - }, - "dependencies": { - "resolve": "1.1.7" - }, - "description": "resolve which handles browser field support in package.json", - "devDependencies": { - "mocha": "1.14.0" - }, - "directories": {}, - "dist": { - "shasum": "73c3c2a1d3a68a6e17d88f0cadb13ea24632d496", - "tarball": "http://registry.npmjs.org/browser-resolve/-/browser-resolve-1.11.1.tgz" - }, - "files": [ - "index.js", - "empty.js" - ], - "gitHead": "a238dd1ca8db9319cdd6b6340358a09f298c9156", - "homepage": "https://github.com/shtylman/node-browser-resolve#readme", - "keywords": [ - "resolve", - "browser" - ], - "license": "MIT", - "main": "index.js", - "maintainers": [ - { - "email": "substack@gmail.com", - "name": "substack" - }, - { - "email": "shtylman@gmail.com", - "name": "defunctzombie" - } - ], - "name": "browser-resolve", - "optionalDependencies": {}, - "readme": "ERROR: No README data found!", - "repository": { - "type": "git", - "url": "git://github.com/shtylman/node-browser-resolve.git" - }, - "scripts": { - "test": "mocha --reporter list test/*.js" - }, - "version": "1.11.1" -} diff --git a/src/node_modules/browser-sync-client/README.md b/src/node_modules/browser-sync-client/README.md deleted file mode 100644 index 5f79a11..0000000 --- a/src/node_modules/browser-sync-client/README.md +++ /dev/null @@ -1,19 +0,0 @@ -# browser-sync-client [![Build Status](https://travis-ci.org/BrowserSync/browser-sync-client.svg)](https://travis-ci.org/BrowserSync/browser-sync-client) - -Client-side script for BrowserSync - -## Contributors - -``` - 177 Shane Osbourne - 2 Sergey Slipchenko - 1 Hugo Dias - 1 Shinnosuke Watanabe - 1 Tim Schaub - 1 Shane Daniel - 1 Matthieu Vachon -``` - -## License -Copyright (c) 2014 Shane Osbourne -Licensed under the MIT license. diff --git a/src/node_modules/browser-sync-client/dist/.gitkeep b/src/node_modules/browser-sync-client/dist/.gitkeep deleted file mode 100644 index e69de29..0000000 diff --git a/src/node_modules/browser-sync-client/dist/index.js b/src/node_modules/browser-sync-client/dist/index.js deleted file mode 100755 index a02a41a..0000000 --- a/src/node_modules/browser-sync-client/dist/index.js +++ /dev/null @@ -1,1761 +0,0 @@ -(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o